@zealicsolutions/web-ui 1.0.93 → 1.0.94

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/index.js CHANGED
@@ -9570,7 +9570,7 @@ var Nst={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 2
9570
9570
  *
9571
9571
  * This source code is licensed under the ISC license.
9572
9572
  * See the LICENSE file in the root directory of this source tree.
9573
- */function ult(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function dlt(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function plt(...e){return t=>{let r=!1;const n=e.map(e=>{const n=dlt(e,t);return!r&&"function"==typeof n&&(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():dlt(e[t],null)}}}}function hlt(...e){return s.useCallback(plt(...e),e)}function flt(e,r=[]){let n=[];const o=()=>{const t=n.map(e=>s.createContext(e));return function(r){const n=(null==r?void 0:r[e])||t;return s.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return o.scopeName=e,[function(r,o){const a=s.createContext(o),i=n.length;n=[...n,o];const l=r=>{var n;const{scope:o,children:l,...c}=r,u=(null==(n=null==o?void 0:o[e])?void 0:n[i])||a,d=s.useMemo(()=>c,Object.values(c));return t.jsx(u.Provider,{value:d,children:l})};return l.displayName=r+"Provider",[l,function(t,n){var l;const c=(null==(l=null==n?void 0:n[e])?void 0:l[i])||a,u=s.useContext(c);if(u)return u;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${r}\``)}]},mlt(o,...r)]}function mlt(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}var vlt=null!=globalThis&&globalThis.document?s.useLayoutEffect:()=>{},ylt=s[" useId ".trim().toString()]||(()=>{}),glt=0;function xlt(e){const[t,r]=s.useState(ylt());return vlt(()=>{r(e=>e??String(glt++))},[e]),t?`radix-${t}`:""}var blt=s[" useInsertionEffect ".trim().toString()]||vlt;function klt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,a,i]=function({defaultProp:e,onChange:t}){const[r,n]=s.useState(e),o=s.useRef(r),a=s.useRef(t);return blt(()=>{a.current=t},[t]),s.useEffect(()=>{var e;o.current!==r&&(null==(e=a.current)||e.call(a,r),o.current=r)},[r,o]),[r,n,a]}({defaultProp:t,onChange:r}),l=void 0!==e,c=l?e:o;{const t=s.useRef(void 0!==e);s.useEffect(()=>{const e=t.current;e!==l&&console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=l},[l,n])}const u=s.useCallback(t=>{var r;if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&(null==(r=i.current)||r.call(i,n))}else a(t)},[l,e,a,i]);return[c,u]}function _lt(e){const r=Mlt(e),n=s.forwardRef((e,n)=>{const{children:o,...a}=e,i=s.Children.toArray(o),l=i.find(Dlt);if(l){const e=l.props.children,o=i.map(t=>t===l?s.Children.count(e)>1?s.Children.only(null):s.isValidElement(e)?e.props.children:null:t);return t.jsx(r,{...a,ref:n,children:s.isValidElement(e)?s.cloneElement(e,void 0,o):null})}return t.jsx(r,{...a,ref:n,children:o})});return n.displayName=`${e}.Slot`,n}var wlt=_lt("Slot");function Mlt(e){const t=s.forwardRef((e,t)=>{const{children:r,...n}=e;if(s.isValidElement(r)){const e=function(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=n&&"isReactWarning"in n&&n.isReactWarning;return o?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,o=n&&"isReactWarning"in n&&n.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}(r),o=function(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==s.Fragment&&(o.ref=t?plt(t,e):e),s.cloneElement(r,o)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Clt=Symbol("radix.slottable");function jlt(e){const r=({children:e})=>t.jsx(t.Fragment,{children:e});return r.displayName=`${e}.Slottable`,r.__radixId=Clt,r}function Dlt(e){return s.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Clt}var Olt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const n=_lt(`Primitive.${r}`),o=s.forwardRef((e,o)=>{const{asChild:a,...i}=e,s=a?n:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:o})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{});function Slt(e,t){e&&d.flushSync(()=>e.dispatchEvent(t))}function Plt(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}var Tlt,Elt="dismissableLayer.update",Nlt="dismissableLayer.pointerDownOutside",zlt="dismissableLayer.focusOutside",Alt=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Rlt=s.forwardRef((e,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:c,...u}=e,d=s.useContext(Alt),[p,h]=s.useState(null),f=(null==p?void 0:p.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,m]=s.useState({}),v=hlt(r,e=>h(e)),y=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(g),b=p?y.indexOf(p):-1,k=d.layersWithOutsidePointerEventsDisabled.size>0,_=b>=x,w=function(e,t=(null==globalThis?void 0:globalThis.document)){const r=Plt(e),n=s.useRef(!1),o=s.useRef(()=>{});return s.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){Blt(Nlt,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=n,t.addEventListener("click",o.current,{once:!0})):n()}else t.removeEventListener("click",o.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));!_||r||(null==a||a(e),null==l||l(e),e.defaultPrevented||null==c||c())},f),M=function(e,t=(null==globalThis?void 0:globalThis.document)){const r=Plt(e),n=s.useRef(!1);return s.useEffect(()=>{const e=e=>{e.target&&!n.current&&Blt(zlt,r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())},f);return function(e,t=(null==globalThis?void 0:globalThis.document)){const r=Plt(e);s.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{b===d.layers.size-1&&(null==o||o(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},f),s.useEffect(()=>{if(p)return n&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Tlt=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),Llt(),()=>{n&&1===d.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=Tlt)}},[p,f,n,d]),s.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),Llt())},[p,d]),s.useEffect(()=>{const e=()=>m({});return document.addEventListener(Elt,e),()=>document.removeEventListener(Elt,e)},[]),t.jsx(Olt.div,{...u,ref:v,style:{pointerEvents:k?_?"auto":"none":void 0,...e.style},onFocusCapture:ult(e.onFocusCapture,M.onFocusCapture),onBlurCapture:ult(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:ult(e.onPointerDownCapture,w.onPointerDownCapture)})});Rlt.displayName="DismissableLayer";var Flt=s.forwardRef((e,r)=>{const n=s.useContext(Alt),o=s.useRef(null),a=hlt(r,o);return s.useEffect(()=>{const e=o.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),t.jsx(Olt.div,{...e,ref:a})});function Llt(){const e=new CustomEvent(Elt);document.dispatchEvent(e)}function Blt(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Slt(o,a):o.dispatchEvent(a)}Flt.displayName="DismissableLayerBranch";var Vlt="focusScope.autoFocusOnMount",Ilt="focusScope.autoFocusOnUnmount",qlt={bubbles:!1,cancelable:!0},$lt=s.forwardRef((e,r)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[c,u]=s.useState(null),d=Plt(a),p=Plt(i),h=s.useRef(null),f=hlt(r,e=>u(e)),m=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?h.current=t:Ylt(h.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Ylt(h.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Ylt(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return c&&n.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[o,c,m.paused]),s.useEffect(()=>{if(c){Zlt.add(m);const e=document.activeElement;if(!c.contains(e)){const t=new CustomEvent(Vlt,qlt);c.addEventListener(Vlt,d),c.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ylt(n,{select:t}),document.activeElement!==r)return}(function(e){return e.filter(e=>"A"!==e.tagName)}(Hlt(c)),{select:!0}),document.activeElement===e&&Ylt(c))}return()=>{c.removeEventListener(Vlt,d),setTimeout(()=>{const t=new CustomEvent(Ilt,qlt);c.addEventListener(Ilt,p),c.dispatchEvent(t),t.defaultPrevented||Ylt(e??document.body,{select:!0}),c.removeEventListener(Ilt,p),Zlt.remove(m)},0)}}},[c,d,p,m]);const v=s.useCallback(e=>{if(!n&&!o||m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[o,a]=function(e){const t=Hlt(e),r=Wlt(t,e),n=Wlt(t.reverse(),e);return[r,n]}(t);o&&a?e.shiftKey||r!==a?e.shiftKey&&r===o&&(e.preventDefault(),n&&Ylt(a,{select:!0})):(e.preventDefault(),n&&Ylt(o,{select:!0})):r===t&&e.preventDefault()}},[n,o,m.paused]);return t.jsx(Olt.div,{tabIndex:-1,...l,ref:f,onKeyDown:v})});function Hlt(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Wlt(e,t){for(const r of e)if(!Ult(r,{upTo:t}))return r}function Ult(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Ylt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}$lt.displayName="FocusScope";var Zlt=function(){let e=[];return{add(t){const r=e[0];t!==r&&(null==r||r.pause()),e=Klt(e,t),e.unshift(t)},remove(t){var r;e=Klt(e,t),null==(r=e[0])||r.resume()}}}();function Klt(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var Glt=s.forwardRef((e,r)=>{var n;const{container:o,...a}=e,[i,l]=s.useState(!1);vlt(()=>l(!0),[]);const c=o||i&&(null==(n=null==globalThis?void 0:globalThis.document)?void 0:n.body);return c?u.default.createPortal(t.jsx(Olt.div,{...a,ref:r}),c):null});Glt.displayName="Portal";var Xlt=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=s.useState(),n=s.useRef(null),o=s.useRef(e),a=s.useRef("none"),i=e?"mounted":"unmounted",[l,c]=function(e,t){return s.useReducer((e,r)=>t[e][r]??e,e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const e=Qlt(n.current);a.current="mounted"===l?e:"none"},[l]),vlt(()=>{const t=n.current,r=o.current;if(r!==e){const n=a.current,i=Qlt(t);e?c("MOUNT"):"none"===i||"none"===(null==t?void 0:t.display)?c("UNMOUNT"):c(r&&n!==i?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),vlt(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,i=a=>{const i=Qlt(n.current).includes(a.animationName);if(a.target===t&&i&&(c("ANIMATION_END"),!o.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},s=e=>{e.target===t&&(a.current=Qlt(n.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:s.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),o="function"==typeof r?r({present:n.isPresent}):s.Children.only(r),a=hlt(n.ref,function(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=n&&"isReactWarning"in n&&n.isReactWarning;return o?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,o=n&&"isReactWarning"in n&&n.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}(o));return"function"==typeof r||n.isPresent?s.cloneElement(o,{ref:a}):null};function Qlt(e){return(null==e?void 0:e.animationName)||"none"}Xlt.displayName="Presence";var Jlt=0;function ect(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tct()),document.body.insertAdjacentElement("beforeend",e[1]??tct()),Jlt++,()=>{1===Jlt&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Jlt--}},[])}function tct(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var rct=function(){return rct=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},rct.apply(this,arguments)};function nct(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function oct(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var act="right-scroll-bar-position",ict="width-before-scroll-bar";function sct(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var lct=typeof window<"u"?s.useLayoutEffect:s.useEffect,cct=new WeakMap;function uct(t,r){var n=function(t,r){var n=e.useState(function(){return{value:t,callback:r,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=r,n.facade}(null,function(e){return t.forEach(function(t){return sct(t,e)})});return lct(function(){var e=cct.get(n);if(e){var r=new Set(e),o=new Set(t),a=n.current;r.forEach(function(e){o.has(e)||sct(e,null)}),o.forEach(function(e){r.has(e)||sct(e,a)})}cct.set(n,t)},[t]),n}function dct(e){return e}function pct(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=dct);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var o=t(e,n);return r.push(o),function(){r=r.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var o=r;r=[],o.forEach(e),t=r}var a=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}};return o}(null);return t.options=rct({async:!0,ssr:!1},e),t}var hct=function(e){var t=e.sideCar,r=nct(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return s.createElement(n,rct({},r))};function fct(e,t){return e.useMedium(t),hct}hct.isSideCarExport=!0;var mct=pct(),vct=function(){},yct=s.forwardRef(function(e,t){var r=s.useRef(null),n=s.useState({onScrollCapture:vct,onWheelCapture:vct,onTouchMoveCapture:vct}),o=n[0],a=n[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,f=e.noRelative,m=e.noIsolation,v=e.inert,y=e.allowPinchZoom,g=e.as,x=void 0===g?"div":g,b=e.gapMode,k=nct(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=h,w=uct([r,t]),M=rct(rct({},k),o);return s.createElement(s.Fragment,null,d&&s.createElement(_,{sideCar:mct,removeScrollBar:u,shards:p,noRelative:f,noIsolation:m,inert:v,setCallbacks:a,allowPinchZoom:!!y,lockRef:r,gapMode:b}),i?s.cloneElement(s.Children.only(l),rct(rct({},M),{ref:w})):s.createElement(x,rct({},M,{className:c,ref:w}),l))});yct.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},yct.classNames={fullWidth:ict,zeroRight:act};function gct(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var xct=function(){var e=0,t=null;return{add:function(r){0==e&&(t=gct())&&(function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,r),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bct=function(){var e=function(){var e=xct();return function(t,r){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}}();return function(t){var r=t.styles,n=t.dynamic;return e(r,n),null}},kct={left:0,top:0,right:0,gap:0},_ct=function(e){return parseInt(e||"",10)||0},wct=function(e){if(void 0===e&&(e="margin"),typeof window>"u")return kct;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[_ct(r),_ct(n),_ct(o)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Mct=bct(),Cct="data-scroll-locked",jct=function(e,t,r,n){var o=e.left,a=e.top,i=e.right,s=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(s,"px ").concat(n,";\n }\n body[").concat(Cct,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(act," {\n right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(ict," {\n margin-right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(act," .").concat(act," {\n right: 0 ").concat(n,";\n }\n \n .").concat(ict," .").concat(ict," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(Cct,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},Dct=function(){var e=parseInt(document.body.getAttribute(Cct)||"0",10);return isFinite(e)?e:0},Oct=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;s.useEffect(function(){return document.body.setAttribute(Cct,(Dct()+1).toString()),function(){var e=Dct()-1;e<=0?document.body.removeAttribute(Cct):document.body.setAttribute(Cct,e.toString())}},[]);var a=s.useMemo(function(){return wct(o)},[o]);return s.createElement(Mct,{styles:jct(a,!t,o,r?"":"!important")})},Sct=!1;if(typeof window<"u")try{var Pct=Object.defineProperty({},"passive",{get:function(){return Sct=!0,!0}});window.addEventListener("test",Pct,Pct),window.removeEventListener("test",Pct,Pct)}catch{Sct=!1}var Tct=!!Sct&&{passive:!1},Ect=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},Nct=function(e,t){var r=t.ownerDocument,n=t;do{if(typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host),zct(e,n)){var o=Act(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},zct=function(e,t){return"v"===e?function(e){return Ect(e,"overflowY")}(t):function(e){return Ect(e,"overflowX")}(t)},Act=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},Rct=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Fct=function(e){return[e.deltaX,e.deltaY]},Lct=function(e){return e&&"current"in e?e.current:e},Bct=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Vct=0,Ict=[];function qct(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $ct=fct(mct,function(e){var t=s.useRef([]),r=s.useRef([0,0]),n=s.useRef(),o=s.useState(Vct++)[0],a=s.useState(bct)[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=oct([e.lockRef.current],(e.shards||[]).map(Lct),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=s.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var o,a=Rct(e),s=r.current,l="deltaX"in e?e.deltaX:s[0]-a[0],c="deltaY"in e?e.deltaY:s[1]-a[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=Nct(d,u);if(!p)return!0;if(p?o=d:(o="v"===d?"h":"v",p=Nct(d,u)),!p)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=o),!o)return!0;var h=n.current||o;return function(e,t,r,n){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,s=t.contains(i),l=!1,c=a>0,u=0,d=0;do{if(!i)break;var p=Act(e,i),h=p[0],f=p[1]-p[2]-o*h;(h||f)&&zct(e,i)&&(u+=f,d+=h);var m=i.parentNode;i=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(h,t,e,"h"===h?l:c)},[]),c=s.useCallback(function(e){var r=e;if(Ict.length&&Ict[Ict.length-1]===a){var n="deltaY"in r?Fct(r):Rct(r),o=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,n)})[0];if(o&&o.should)return void(r.cancelable&&r.preventDefault());if(!o){var s=(i.current.shards||[]).map(Lct).filter(Boolean).filter(function(e){return e.contains(r.target)});(s.length>0?l(r,s[0]):!i.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=s.useCallback(function(e,r,n,o){var a={name:e,delta:r,target:n,should:o,shadowParent:qct(n)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){r.current=Rct(e),n.current=void 0},[]),p=s.useCallback(function(t){u(t.type,Fct(t),t.target,l(t,e.lockRef.current))},[]),h=s.useCallback(function(t){u(t.type,Rct(t),t.target,l(t,e.lockRef.current))},[]);s.useEffect(function(){return Ict.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Tct),document.addEventListener("touchmove",c,Tct),document.addEventListener("touchstart",d,Tct),function(){Ict=Ict.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,Tct),document.removeEventListener("touchmove",c,Tct),document.removeEventListener("touchstart",d,Tct)}},[]);var f=e.removeScrollBar,m=e.inert;return s.createElement(s.Fragment,null,m?s.createElement(a,{styles:Bct(o)}):null,f?s.createElement(Oct,{noRelative:e.noRelative,gapMode:e.gapMode}):null)});var Hct=s.forwardRef(function(e,t){return s.createElement(yct,rct({},e,{ref:t,sideCar:$ct}))});Hct.classNames=yct.classNames;var Wct=new WeakMap,Uct=new WeakMap,Yct={},Zct=0,Kct=function(e){return e&&(e.host||Kct(e.parentNode))},Gct=function(e,t,r,n){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=Kct(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return!!e})}(t,Array.isArray(e)?e:[e]);Yct[r]||(Yct[r]=new WeakMap);var a=Yct[r],i=[],s=new Set,l=new Set(o),c=function(e){!e||s.has(e)||(s.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(n),o=null!==t&&"false"!==t,l=(Wct.get(e)||0)+1,c=(a.get(e)||0)+1;Wct.set(e,l),a.set(e,c),i.push(e),1===l&&o&&Uct.set(e,!0),1===c&&e.setAttribute(r,"true"),o||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),Zct++,function(){i.forEach(function(e){var t=Wct.get(e)-1,o=a.get(e)-1;Wct.set(e,t),a.set(e,o),t||(Uct.has(e)||e.removeAttribute(n),Uct.delete(e)),o||e.removeAttribute(r)}),--Zct||(Wct=new WeakMap,Wct=new WeakMap,Uct=new WeakMap,Yct={})}},Xct=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=function(e){return typeof document>"u"?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Gct(n,o,r,"aria-hidden")):function(){return null}},Qct="Dialog",[Jct,eut]=flt(Qct),[tut,rut]=Jct(Qct),nut=e=>{const{__scopeDialog:r,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,c=s.useRef(null),u=s.useRef(null),[d,p]=klt({prop:o,defaultProp:a??!1,onChange:i,caller:Qct});return t.jsx(tut,{scope:r,triggerRef:c,contentRef:u,contentId:xlt(),titleId:xlt(),descriptionId:xlt(),open:d,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(e=>!e),[p]),modal:l,children:n})};nut.displayName=Qct;var out="DialogTrigger",aut=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=rut(out,n),i=hlt(r,a.triggerRef);return t.jsx(Olt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Cut(a.open),...o,ref:i,onClick:ult(e.onClick,a.onOpenToggle)})});aut.displayName=out;var iut="DialogPortal",[sut,lut]=Jct(iut,{forceMount:void 0}),cut=e=>{const{__scopeDialog:r,forceMount:n,children:o,container:a}=e,i=rut(iut,r);return t.jsx(sut,{scope:r,forceMount:n,children:s.Children.map(o,e=>t.jsx(Xlt,{present:n||i.open,children:t.jsx(Glt,{asChild:!0,container:a,children:e})}))})};cut.displayName=iut;var uut="DialogOverlay",dut=s.forwardRef((e,r)=>{const n=lut(uut,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=rut(uut,e.__scopeDialog);return i.modal?t.jsx(Xlt,{present:o||i.open,children:t.jsx(hut,{...a,ref:r})}):null});dut.displayName=uut;var put=_lt("DialogOverlay.RemoveScroll"),hut=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=rut(uut,n);return t.jsx(Hct,{as:put,allowPinchZoom:!0,shards:[a.contentRef],children:t.jsx(Olt.div,{"data-state":Cut(a.open),...o,ref:r,style:{pointerEvents:"auto",...o.style}})})}),fut="DialogContent",mut=s.forwardRef((e,r)=>{const n=lut(fut,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=rut(fut,e.__scopeDialog);return t.jsx(Xlt,{present:o||i.open,children:i.modal?t.jsx(vut,{...a,ref:r}):t.jsx(yut,{...a,ref:r})})});mut.displayName=fut;var vut=s.forwardRef((e,r)=>{const n=rut(fut,e.__scopeDialog),o=s.useRef(null),a=hlt(r,n.contentRef,o);return s.useEffect(()=>{const e=o.current;if(e)return Xct(e)},[]),t.jsx(gut,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ult(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:ult(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:ult(e.onFocusOutside,e=>e.preventDefault())})}),yut=s.forwardRef((e,r)=>{const n=rut(fut,e.__scopeDialog),o=s.useRef(!1),a=s.useRef(!1);return t.jsx(gut,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,i;null==(r=e.onCloseAutoFocus)||r.call(e,t),t.defaultPrevented||(o.current||null==(i=n.triggerRef.current)||i.focus(),t.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:t=>{var r,i;null==(r=e.onInteractOutside)||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null==(i=n.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),gut=s.forwardRef((e,r)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,c=rut(fut,n),u=s.useRef(null),d=hlt(r,u);return ect(),t.jsxs(t.Fragment,{children:[t.jsx($lt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:t.jsx(Rlt,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Cut(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(Sut,{titleId:c.titleId}),t.jsx(Put,{contentRef:u,descriptionId:c.descriptionId})]})]})}),xut="DialogTitle",but=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=rut(xut,n);return t.jsx(Olt.h2,{id:a.titleId,...o,ref:r})});but.displayName=xut;var kut="DialogDescription",_ut=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=rut(kut,n);return t.jsx(Olt.p,{id:a.descriptionId,...o,ref:r})});_ut.displayName=kut;var wut="DialogClose",Mut=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=rut(wut,n);return t.jsx(Olt.button,{type:"button",...o,ref:r,onClick:ult(e.onClick,()=>a.onOpenChange(!1))})});function Cut(e){return e?"open":"closed"}Mut.displayName=wut;var jut="DialogTitleWarning",[Dut,Out]=function(e,r){const n=s.createContext(r),o=e=>{const{children:r,...o}=e,a=s.useMemo(()=>o,Object.values(o));return t.jsx(n.Provider,{value:a,children:r})};return o.displayName=e+"Provider",[o,function(t){const o=s.useContext(n);if(o)return o;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(jut,{contentName:fut,titleName:xut,docsSlug:"dialog"}),Sut=({titleId:e})=>{const t=Out(jut),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Put=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Out("DialogDescriptionWarning").contentName}}.`;return s.useEffect(()=>{var n;const o=null==(n=e.current)?void 0:n.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Tut=nut,Eut=aut,Nut=cut,zut=dut,Aut=mut,Rut=but,Fut=_ut,Lut=Mut;function But(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=But(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Vut(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=But(e))&&(n&&(n+=" "),n+=t);return n}const Iut=e=>{const t=Wut(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),qut(r,t)||Hut(e)},getConflictingClassGroupIds:(e,t)=>{const o=r[e]||[];return t&&n[e]?[...o,...n[e]]:o}}},qut=(e,t)=>{var r;if(0===e.length)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),a=o?qut(e.slice(1),o):void 0;if(a)return a;if(0===t.validators.length)return;const i=e.join("-");return null==(r=t.validators.find(({validator:e})=>e(i)))?void 0:r.classGroupId},$ut=/^\[(.+)\]$/,Hut=e=>{if($ut.test(e)){const t=$ut.exec(e)[1],r=null==t?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Wut=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return Kut(Object.entries(e.classGroups),r).forEach(([e,r])=>{Uut(r,n,e,t)}),n},Uut=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:Yut(t,e)).classGroupId=r)}if("function"==typeof e)return Zut(e)?void Uut(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,o])=>{Uut(o,Yut(t,e),r,n)})})},Yut=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},Zut=e=>e.isThemeGetter,Kut=(e,t)=>t?e.map(([e,r])=>{const n=r.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,r])=>[t+e,r])):e);return[e,n]}):e,Gut=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(o(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):o(e,t)}}},Xut=e=>{const{separator:t,experimentalParseClassName:r}=e,n=1===t.length,o=t[0],a=t.length,i=e=>{const r=[];let i,s=0,l=0;for(let c=0;c<e.length;c++){let u=e[c];if(0===s){if(u===o&&(n||e.slice(c,c+a)===t)){r.push(e.slice(l,c)),l=c+a;continue}if("/"===u){i=c;continue}}"["===u?s++:"]"===u&&s--}const c=0===r.length?e:e.substring(l),u=c.startsWith("!");return{modifiers:r,hasImportantModifier:u,baseClassName:u?c.substring(1):c,maybePostfixModifierPosition:i&&i>l?i-l:void 0}};return r?e=>r({className:e,parseClassName:i}):i},Qut=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)}),t.push(...r.sort()),t},Jut=/\s+/;function edt(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=tdt(e))&&(n&&(n+=" "),n+=t);return n}const tdt=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=tdt(e[n]))&&(r&&(r+=" "),r+=t);return r};function rdt(e,...t){let r,n,o,a=function(s){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:Gut(e.cacheSize),parseClassName:Xut(e),...Iut(e)}))(l),n=r.cache.get,o=r.cache.set,a=i,i(s)};function i(e){const t=n(e);if(t)return t;const a=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(Jut);let s="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=r(t);let p=!!d,h=n(p?u.substring(0,d):u);if(!h){if(!p){s=t+(s.length>0?" "+s:s);continue}if(h=n(u),!h){s=t+(s.length>0?" "+s:s);continue}p=!1}const f=Qut(l).join(":"),m=c?f+"!":f,v=m+h;if(a.includes(v))continue;a.push(v);const y=o(h,p);for(let e=0;e<y.length;++e){const t=y[e];a.push(m+t)}s=t+(s.length>0?" "+s:s)}return s})(e,r);return o(e,a),a}return function(){return a(edt.apply(null,arguments))}}const ndt=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},odt=/^\[(?:([a-z-]+):)?(.+)\]$/i,adt=/^\d+\/\d+$/,idt=new Set(["px","full","screen"]),sdt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ldt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cdt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,udt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ddt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pdt=e=>fdt(e)||idt.has(e)||adt.test(e),hdt=e=>Ddt(e,"length",Odt),fdt=e=>!!e&&!Number.isNaN(Number(e)),mdt=e=>Ddt(e,"number",fdt),vdt=e=>!!e&&Number.isInteger(Number(e)),ydt=e=>e.endsWith("%")&&fdt(e.slice(0,-1)),gdt=e=>odt.test(e),xdt=e=>sdt.test(e),bdt=new Set(["length","size","percentage"]),kdt=e=>Ddt(e,bdt,Sdt),_dt=e=>Ddt(e,"position",Sdt),wdt=new Set(["image","url"]),Mdt=e=>Ddt(e,wdt,Tdt),Cdt=e=>Ddt(e,"",Pdt),jdt=()=>!0,Ddt=(e,t,r)=>{const n=odt.exec(e);return!!n&&(n[1]?"string"==typeof t?n[1]===t:t.has(n[1]):r(n[2]))},Odt=e=>ldt.test(e)&&!cdt.test(e),Sdt=()=>!1,Pdt=e=>udt.test(e),Tdt=e=>ddt.test(e),Edt=()=>{const e=ndt("colors"),t=ndt("spacing"),r=ndt("blur"),n=ndt("brightness"),o=ndt("borderColor"),a=ndt("borderRadius"),i=ndt("borderSpacing"),s=ndt("borderWidth"),l=ndt("contrast"),c=ndt("grayscale"),u=ndt("hueRotate"),d=ndt("invert"),p=ndt("gap"),h=ndt("gradientColorStops"),f=ndt("gradientColorStopPositions"),m=ndt("inset"),v=ndt("margin"),y=ndt("opacity"),g=ndt("padding"),x=ndt("saturate"),b=ndt("scale"),k=ndt("sepia"),_=ndt("skew"),w=ndt("space"),M=ndt("translate"),C=()=>["auto",gdt,t],j=()=>[gdt,t],D=()=>["",pdt,hdt],O=()=>["auto",fdt,gdt],S=()=>["","0",gdt],P=()=>[fdt,gdt];return{cacheSize:500,separator:":",theme:{colors:[jdt],spacing:[pdt,hdt],blur:["none","",xdt,gdt],brightness:P(),borderColor:[e],borderRadius:["none","","full",xdt,gdt],borderSpacing:j(),borderWidth:D(),contrast:P(),grayscale:S(),hueRotate:P(),invert:S(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[ydt,hdt],inset:C(),margin:C(),opacity:P(),padding:j(),saturate:P(),scale:P(),sepia:S(),skew:P(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",gdt]}],container:["container"],columns:[{columns:[xdt]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",gdt]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",vdt,gdt]}],basis:[{basis:C()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",gdt]}],grow:[{grow:S()}],shrink:[{shrink:S()}],order:[{order:["first","last","none",vdt,gdt]}],"grid-cols":[{"grid-cols":[jdt]}],"col-start-end":[{col:["auto",{span:["full",vdt,gdt]},gdt]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[jdt]}],"row-start-end":[{row:["auto",{span:[vdt,gdt]},gdt]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",gdt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",gdt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[w]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[w]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",gdt,t]}],"min-w":[{"min-w":[gdt,t,"min","max","fit"]}],"max-w":[{"max-w":[gdt,t,"none","full","min","max","fit","prose",{screen:[xdt]},xdt]}],h:[{h:[gdt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[gdt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[gdt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[gdt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xdt,hdt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",mdt]}],"font-family":[{font:[jdt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",gdt]}],"line-clamp":[{"line-clamp":["none",fdt,mdt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",pdt,gdt]}],"list-image":[{"list-image":["none",gdt]}],"list-style-type":[{list:["none","disc","decimal",gdt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",pdt,hdt]}],"underline-offset":[{"underline-offset":["auto",pdt,gdt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",gdt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",gdt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",_dt]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kdt]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Mdt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[pdt,gdt]}],"outline-w":[{outline:[pdt,hdt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[pdt,hdt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xdt,Cdt]}],"shadow-color":[{shadow:[jdt]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",xdt,gdt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",gdt]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",gdt]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",gdt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[vdt,gdt]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",gdt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",gdt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",gdt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[pdt,hdt,mdt]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Ndt=rdt(Edt);function zdt(...e){return Ndt(Vut(e))}const Adt=Tut,Rdt=Eut,Fdt=Nut,Ldt=s.forwardRef(({className:e,...r},n)=>t.jsx(zut,{ref:n,className:zdt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));Ldt.displayName=zut.displayName;const Bdt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(Fdt,{children:[t.jsx(Ldt,{}),t.jsxs(Aut,{ref:o,className:zdt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[r,t.jsxs(Lut,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(clt,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Bdt.displayName=Aut.displayName;const Vdt=({className:e,...r})=>t.jsx("div",{className:zdt("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});Vdt.displayName="DialogHeader";const Idt=({className:e,...r})=>t.jsx("div",{className:zdt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});Idt.displayName="DialogFooter";const qdt=s.forwardRef(({className:e,...r},n)=>t.jsx(Rut,{ref:n,className:zdt("text-lg font-semibold leading-none tracking-tight",e),...r}));qdt.displayName=Rut.displayName;const $dt=s.forwardRef(({className:e,...r},n)=>t.jsx(Fut,{ref:n,className:zdt("text-sm text-muted-foreground",e),...r}));$dt.displayName=Fut.displayName;var Hdt=Array(12).fill(0),Wdt=({visible:e,className:t})=>l.default.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},l.default.createElement("div",{className:"sonner-spinner"},Hdt.map((e,t)=>l.default.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),Udt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Ydt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Zdt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Kdt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Gdt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},l.default.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.default.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Xdt=1,Qdt=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:Xdt++,a=this.toasts.find(e=>e.id===o),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(t=>t.id===o?(this.publish({...t,...e,id:o,title:r}),{...t,...e,id:o,dismissible:i,title:r}):t):this.addToast({title:r,...n,dismissible:i,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;void 0!==t.loading&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let n,o=e instanceof Promise?e:e(),a=void 0!==r,i=o.then(async e=>{if(n=["resolve",e],l.default.isValidElement(e))a=!1,this.create({id:r,type:"default",message:e});else if(Jdt(e)&&!e.ok){a=!1;let n="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,o="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description;this.create({id:r,type:"error",message:n,description:o})}else if(void 0!==t.success){a=!1;let n="function"==typeof t.success?await t.success(e):t.success,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"success",message:n,description:o})}}).catch(async e=>{if(n=["reject",e],void 0!==t.error){a=!1;let n="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"error",message:n,description:o})}}).finally(()=>{var e;a&&(this.dismiss(r),r=void 0),null==(e=t.finally)||e.call(t)}),s=()=>new Promise((e,t)=>i.then(()=>"reject"===n[0]?t(n[1]):e(n[1])).catch(t));return"string"!=typeof r&&"number"!=typeof r?{unwrap:s}:Object.assign(r,{unwrap:s})},this.custom=(e,t)=>{let r=(null==t?void 0:t.id)||Xdt++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Jdt=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,ept=(e,t)=>{let r=(null==t?void 0:t.id)||Xdt++;return Qdt.addToast({title:e,...t,id:r}),r},tpt=Object.assign(ept,{success:Qdt.success,info:Qdt.info,warning:Qdt.warning,error:Qdt.error,custom:Qdt.custom,message:Qdt.message,promise:Qdt.promise,dismiss:Qdt.dismiss,loading:Qdt.loading},{getHistory:()=>Qdt.toasts,getToasts:()=>Qdt.getActiveToasts()});function rpt(e){return void 0!==e.label}!function(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n');var npt=3,opt=14;function apt(...e){return e.filter(Boolean).join(" ")}var ipt=t=>{var r,n,o,a,i,s,c,u,d,p,h;let{invert:f,toast:m,unstyled:v,interacting:y,setHeights:g,visibleToasts:x,heights:b,index:k,toasts:_,expanded:w,removeToast:M,defaultRichColors:C,closeButton:j,style:D,cancelButtonStyle:O,actionButtonStyle:S,className:P="",descriptionClassName:T="",duration:E,position:N,gap:z,loadingIcon:A,expandByDefault:R,classNames:F,icons:L,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:V}=t,[I,q]=l.default.useState(null),[$,H]=l.default.useState(null),[W,U]=l.default.useState(!1),[Y,Z]=l.default.useState(!1),[K,G]=l.default.useState(!1),[X,Q]=l.default.useState(!1),[J,ee]=l.default.useState(!1),[te,re]=l.default.useState(0),[ne,oe]=l.default.useState(0),ae=l.default.useRef(m.duration||E||4e3),ie=l.default.useRef(null),se=l.default.useRef(null),le=0===k,ce=k+1<=x,ue=m.type,de=!1!==m.dismissible,pe=m.className||"",he=m.descriptionClassName||"",fe=l.default.useMemo(()=>b.findIndex(e=>e.toastId===m.id)||0,[b,m.id]),me=l.default.useMemo(()=>{var e;return null!=(e=m.closeButton)?e:j},[m.closeButton,j]),ve=l.default.useMemo(()=>m.duration||E||4e3,[m.duration,E]),ye=l.default.useRef(0),ge=l.default.useRef(0),xe=l.default.useRef(0),be=l.default.useRef(null),[ke,_e]=N.split("-"),we=l.default.useMemo(()=>b.reduce((e,t,r)=>r>=fe?e:e+t.height,0),[b,fe]),Me=(()=>{let[e,t]=l.default.useState(document.hidden);return l.default.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),Ce=m.invert||f,je="loading"===ue;ge.current=l.default.useMemo(()=>fe*z+we,[fe,we]),l.default.useEffect(()=>{ae.current=ve},[ve]),l.default.useEffect(()=>{U(!0)},[]),l.default.useEffect(()=>{let e=se.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),g(e=>[{toastId:m.id,height:t,position:m.position},...e]),()=>g(e=>e.filter(e=>e.toastId!==m.id))}},[g,m.id]),l.default.useLayoutEffect(()=>{if(!W)return;let e=se.current,t=e.style.height;e.style.height="auto";let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),g(e=>e.find(e=>e.toastId===m.id)?e.map(e=>e.toastId===m.id?{...e,height:r}:e):[{toastId:m.id,height:r,position:m.position},...e])},[W,m.title,m.description,g,m.id]);let De=l.default.useCallback(()=>{Z(!0),re(ge.current),g(e=>e.filter(e=>e.toastId!==m.id)),setTimeout(()=>{M(m)},200)},[m,M,g,ge]);return l.default.useEffect(()=>{if(m.promise&&"loading"===ue||m.duration===1/0||"loading"===m.type)return;let e;return w||y||V&&Me?(()=>{if(xe.current<ye.current){let e=(new Date).getTime()-ye.current;ae.current=ae.current-e}xe.current=(new Date).getTime()})():ae.current!==1/0&&(ye.current=(new Date).getTime(),e=setTimeout(()=>{var e;null==(e=m.onAutoClose)||e.call(m,m),De()},ae.current)),()=>clearTimeout(e)},[w,y,m,ue,V,Me,De]),l.default.useEffect(()=>{m.delete&&De()},[De,m.delete]),l.default.createElement("li",{tabIndex:0,ref:se,className:apt(P,pe,null==F?void 0:F.toast,null==(r=null==m?void 0:m.classNames)?void 0:r.toast,null==F?void 0:F.default,null==F?void 0:F[ue],null==(n=null==m?void 0:m.classNames)?void 0:n[ue]),"data-sonner-toast":"","data-rich-colors":null!=(o=m.richColors)?o:C,"data-styled":!(m.jsx||m.unstyled||v),"data-mounted":W,"data-promise":!!m.promise,"data-swiped":J,"data-removed":Y,"data-visible":ce,"data-y-position":ke,"data-x-position":_e,"data-index":k,"data-front":le,"data-swiping":K,"data-dismissible":de,"data-type":ue,"data-invert":Ce,"data-swipe-out":X,"data-swipe-direction":$,"data-expanded":!!(w||R&&W),style:{"--index":k,"--toasts-before":k,"--z-index":_.length-k,"--offset":`${Y?te:ge.current}px`,"--initial-height":R?"auto":`${ne}px`,...D,...m.style},onDragEnd:()=>{G(!1),q(null),be.current=null},onPointerDown:e=>{je||!de||(ie.current=new Date,re(ge.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(G(!0),be.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,r,n;if(X||!de)return;be.current=null;let o=Number((null==(e=se.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),a=Number((null==(t=se.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),i=(new Date).getTime()-(null==(r=ie.current)?void 0:r.getTime()),s="x"===I?o:a,l=Math.abs(s)/i;if(Math.abs(s)>=20||l>.11)return re(ge.current),null==(n=m.onDismiss)||n.call(m,m),H("x"===I?o>0?"right":"left":a>0?"down":"up"),De(),Q(!0),void ee(!1);G(!1),q(null)},onPointerMove:e=>{var r,n,o,a;if(!be.current||!de||(null==(r=window.getSelection())?void 0:r.toString().length)>0)return;let i=e.clientY-be.current.y,s=e.clientX-be.current.x,l=null!=(n=t.swipeDirections)?n:function(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}(N);!I&&(Math.abs(s)>1||Math.abs(i)>1)&&q(Math.abs(s)>Math.abs(i)?"x":"y");let c={x:0,y:0};"y"===I?(l.includes("top")||l.includes("bottom"))&&(l.includes("top")&&i<0||l.includes("bottom")&&i>0)&&(c.y=i):"x"===I&&(l.includes("left")||l.includes("right"))&&(l.includes("left")&&s<0||l.includes("right")&&s>0)&&(c.x=s),(Math.abs(c.x)>0||Math.abs(c.y)>0)&&ee(!0),null==(o=se.current)||o.style.setProperty("--swipe-amount-x",`${c.x}px`),null==(a=se.current)||a.style.setProperty("--swipe-amount-y",`${c.y}px`)}},me&&!m.jsx?l.default.createElement("button",{"aria-label":B,"data-disabled":je,"data-close-button":!0,onClick:je||!de?()=>{}:()=>{var e;De(),null==(e=m.onDismiss)||e.call(m,m)},className:apt(null==F?void 0:F.closeButton,null==(a=null==m?void 0:m.classNames)?void 0:a.closeButton)},null!=(i=null==L?void 0:L.close)?i:Gdt):null,m.jsx||e.isValidElement(m.title)?m.jsx?m.jsx:"function"==typeof m.title?m.title():m.title:l.default.createElement(l.default.Fragment,null,ue||m.icon||m.promise?l.default.createElement("div",{"data-icon":"",className:apt(null==F?void 0:F.icon,null==(s=null==m?void 0:m.classNames)?void 0:s.icon)},m.promise||"loading"===m.type&&!m.icon?m.icon||(null!=L&&L.loading?l.default.createElement("div",{className:apt(null==F?void 0:F.loader,null==(Oe=null==m?void 0:m.classNames)?void 0:Oe.loader,"sonner-loader"),"data-visible":"loading"===ue},L.loading):A?l.default.createElement("div",{className:apt(null==F?void 0:F.loader,null==(Se=null==m?void 0:m.classNames)?void 0:Se.loader,"sonner-loader"),"data-visible":"loading"===ue},A):l.default.createElement(Wdt,{className:apt(null==F?void 0:F.loader,null==(Pe=null==m?void 0:m.classNames)?void 0:Pe.loader),visible:"loading"===ue})):null,"loading"!==m.type?m.icon||(null==L?void 0:L[ue])||(e=>{switch(e){case"success":return Udt;case"info":return Zdt;case"warning":return Ydt;case"error":return Kdt;default:return null}})(ue):null):null,l.default.createElement("div",{"data-content":"",className:apt(null==F?void 0:F.content,null==(c=null==m?void 0:m.classNames)?void 0:c.content)},l.default.createElement("div",{"data-title":"",className:apt(null==F?void 0:F.title,null==(u=null==m?void 0:m.classNames)?void 0:u.title)},"function"==typeof m.title?m.title():m.title),m.description?l.default.createElement("div",{"data-description":"",className:apt(T,he,null==F?void 0:F.description,null==(d=null==m?void 0:m.classNames)?void 0:d.description)},"function"==typeof m.description?m.description():m.description):null),e.isValidElement(m.cancel)?m.cancel:m.cancel&&rpt(m.cancel)?l.default.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||O,onClick:e=>{var t,r;rpt(m.cancel)&&de&&(null==(r=(t=m.cancel).onClick)||r.call(t,e),De())},className:apt(null==F?void 0:F.cancelButton,null==(p=null==m?void 0:m.classNames)?void 0:p.cancelButton)},m.cancel.label):null,e.isValidElement(m.action)?m.action:m.action&&rpt(m.action)?l.default.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||S,onClick:e=>{var t,r;rpt(m.action)&&(null==(r=(t=m.action).onClick)||r.call(t,e),!e.defaultPrevented&&De())},className:apt(null==F?void 0:F.actionButton,null==(h=null==m?void 0:m.classNames)?void 0:h.actionButton)},m.action.label):null));var Oe,Se,Pe};function spt(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}function lpt(e,t){let r={};return[e,t].forEach((e,t)=>{let n=1===t,o=n?"--mobile-offset":"--offset",a=n?"16px":"32px";function i(e){["top","right","bottom","left"].forEach(t=>{r[`${o}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?i(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?r[`${o}-${t}`]=a:r[`${o}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):i(a)}),r}e.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:i,className:s,offset:c,mobileOffset:d,theme:p="light",richColors:h,duration:f,style:m,visibleToasts:v=npt,toastOptions:y,dir:g=spt(),gap:x=opt,loadingIcon:b,icons:k,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:w}=e,[M,C]=l.default.useState([]),j=l.default.useMemo(()=>Array.from(new Set([n].concat(M.filter(e=>e.position).map(e=>e.position)))),[M,n]),[D,O]=l.default.useState([]),[S,P]=l.default.useState(!1),[T,E]=l.default.useState(!1),[N,z]=l.default.useState("system"!==p?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),A=l.default.useRef(null),R=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=l.default.useRef(null),L=l.default.useRef(!1),B=l.default.useCallback(e=>{C(t=>{var r;return null!=(r=t.find(t=>t.id===e.id))&&r.delete||Qdt.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return l.default.useEffect(()=>Qdt.subscribe(e=>{e.dismiss?C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t)):setTimeout(()=>{u.default.flushSync(()=>{C(t=>{let r=t.findIndex(t=>t.id===e.id);return-1!==r?[...t.slice(0,r),{...t[r],...e},...t.slice(r+1)]:[e,...t]})})})}),[]),l.default.useEffect(()=>{if("system"!==p)return void z(p);if("system"===p&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{z(e?"dark":"light")})}catch{e.addListener(({matches:e})=>{try{z(e?"dark":"light")}catch(e){console.error(e)}})}},[p]),l.default.useEffect(()=>{M.length<=1&&P(!1)},[M]),l.default.useEffect(()=>{let e=e=>{var t,r;o.every(t=>e[t]||e.code===t)&&(P(!0),null==(t=A.current)||t.focus()),"Escape"===e.code&&(document.activeElement===A.current||null!=(r=A.current)&&r.contains(document.activeElement))&&P(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]),l.default.useEffect(()=>{if(A.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,L.current=!1)}},[A.current]),l.default.createElement("section",{ref:t,"aria-label":`${_} ${R}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},j.map((t,n)=>{var o;let[u,p]=t.split("-");return M.length?l.default.createElement("ol",{key:t,dir:"auto"===g?spt():g,tabIndex:-1,ref:A,className:s,"data-sonner-toaster":!0,"data-theme":N,"data-y-position":u,"data-lifted":S&&M.length>1&&!a,"data-x-position":p,style:{"--front-toast-height":`${(null==(o=D[0])?void 0:o.height)||0}px`,"--width":"356px","--gap":`${x}px`,...m,...lpt(c,d)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||L.current||(L.current=!0,F.current=e.relatedTarget)},onMouseEnter:()=>P(!0),onMouseMove:()=>P(!0),onMouseLeave:()=>{T||P(!1)},onDragEnd:()=>P(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||E(!0)},onPointerUp:()=>E(!1)},M.filter(e=>!e.position&&0===n||e.position===t).map((n,o)=>{var s,c;return l.default.createElement(ipt,{key:n.id,icons:k,index:o,toast:n,defaultRichColors:h,duration:null!=(s=null==y?void 0:y.duration)?s:f,className:null==y?void 0:y.className,descriptionClassName:null==y?void 0:y.descriptionClassName,invert:r,visibleToasts:v,closeButton:null!=(c=null==y?void 0:y.closeButton)?c:i,interacting:T,position:t,style:null==y?void 0:y.style,unstyled:null==y?void 0:y.unstyled,classNames:null==y?void 0:y.classNames,cancelButtonStyle:null==y?void 0:y.cancelButtonStyle,actionButtonStyle:null==y?void 0:y.actionButtonStyle,removeToast:B,toasts:M.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:a,gap:x,loadingIcon:b,expanded:S,pauseWhenPageIsHidden:w,swipeDirections:e.swipeDirections})})):null}))});var cpt=e=>"checkbox"===e.type,upt=e=>e instanceof Date,dpt=e=>null==e;const ppt=e=>"object"==typeof e;var hpt=e=>!dpt(e)&&!Array.isArray(e)&&ppt(e)&&!upt(e),fpt=e=>hpt(e)&&e.target?cpt(e.target)?e.target.checked:e.target.value:e,mpt=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),vpt=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ypt(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(vpt&&(e instanceof Blob||n)||!r&&!hpt(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return hpt(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=ypt(e[r]));else t=e}return t}var gpt=e=>/^\w*$/.test(e),xpt=e=>void 0===e,bpt=e=>Array.isArray(e)?e.filter(Boolean):[],kpt=e=>bpt(e.replace(/["|']|\]/g,"").split(/\.|\[/)),_pt=(e,t,r)=>{if(!t||!hpt(e))return r;const n=(gpt(t)?[t]:kpt(t)).reduce((e,t)=>dpt(e)?e:e[t],e);return xpt(n)||n===e?xpt(e[t])?r:e[t]:n},wpt=e=>"boolean"==typeof e,Mpt=(e,t,r)=>{let n=-1;const o=gpt(t)?[t]:kpt(t),a=o.length,i=a-1;for(;++n<a;){const t=o[n];let a=r;if(n!==i){const r=e[t];a=hpt(r)||Array.isArray(r)?r:isNaN(+o[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=a,e=e[t]}};const Cpt="blur",jpt="focusout",Dpt="change",Opt="onBlur",Spt="onChange",Ppt="onSubmit",Tpt="onTouched",Ept="all",Npt="max",zpt="min",Apt="maxLength",Rpt="minLength",Fpt="pattern",Lpt="required",Bpt="validate",Vpt=l.default.createContext(null);Vpt.displayName="HookFormContext";const Ipt=()=>l.default.useContext(Vpt);var qpt=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(o,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Ept&&(t._proxyFormState[o]=!n||Ept),r&&(r[o]=!0),e[o]}});return o};const $pt=typeof window<"u"?s.useLayoutEffect:s.useEffect;var Hpt=e=>"string"==typeof e,Wpt=(e,t,r,n,o)=>Hpt(e)?(n&&t.watch.add(e),_pt(r,e,o)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),_pt(r,e))):(n&&(t.watchAll=!0),r);function Upt(e){const t=Ipt(),{name:r,disabled:n,control:o=t.control,shouldUnregister:a}=e,i=mpt(o._names.array,r),s=function(e){const t=Ipt(),{control:r=t.control,name:n,defaultValue:o,disabled:a,exact:i}=e||{},s=l.default.useRef(o),[c,u]=l.default.useState(r._getWatch(n,s.current));return $pt(()=>r._subscribe({name:n,formState:{values:!0},exact:i,callback:e=>!a&&u(Wpt(n,r._names,e.values||r._formValues,!1,s.current))}),[n,r,a,i]),l.default.useEffect(()=>r._removeUnmounted()),c}({control:o,name:r,defaultValue:_pt(o._formValues,r,_pt(o._defaultValues,r,e.defaultValue)),exact:!0}),c=function(e){const t=Ipt(),{control:r=t.control,disabled:n,name:o,exact:a}=e||{},[i,s]=l.default.useState(r._formState),c=l.default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return $pt(()=>r._subscribe({name:o,formState:c.current,exact:a,callback:e=>{!n&&s({...r._formState,...e})}}),[o,n,a]),l.default.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),l.default.useMemo(()=>qpt(i,r,c.current,!1),[i,r])}({control:o,name:r,exact:!0}),u=l.default.useRef(e),d=l.default.useRef(o.register(r,{...e.rules,value:s,...wpt(e.disabled)?{disabled:e.disabled}:{}})),p=l.default.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!_pt(c.errors,r)},isDirty:{enumerable:!0,get:()=>!!_pt(c.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!_pt(c.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!_pt(c.validatingFields,r)},error:{enumerable:!0,get:()=>_pt(c.errors,r)}}),[c,r]),h=l.default.useCallback(e=>d.current.onChange({target:{value:fpt(e),name:r},type:Dpt}),[r]),f=l.default.useCallback(()=>d.current.onBlur({target:{value:_pt(o._formValues,r),name:r},type:Cpt}),[r,o._formValues]),m=l.default.useCallback(e=>{const t=_pt(o._fields,r);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[o._fields,r]),v=l.default.useMemo(()=>({name:r,value:s,...wpt(n)||c.disabled?{disabled:c.disabled||n}:{},onChange:h,onBlur:f,ref:m}),[r,n,c.disabled,h,f,m,s]);return l.default.useEffect(()=>{const e=o._options.shouldUnregister||a;o.register(r,{...u.current.rules,...wpt(u.current.disabled)?{disabled:u.current.disabled}:{}});const t=(e,t)=>{const r=_pt(o._fields,e);r&&r._f&&(r._f.mount=t)};if(t(r,!0),e){const e=ypt(_pt(o._options.defaultValues,r));Mpt(o._defaultValues,r,e),xpt(_pt(o._formValues,r))&&Mpt(o._formValues,r,e)}return!i&&o.register(r),()=>{(i?e&&!o._state.action:e)?o.unregister(r):t(r,!1)}},[r,o,i,a]),l.default.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),l.default.useMemo(()=>({field:v,formState:c,fieldState:p}),[v,c,p])}const Ypt=e=>e.render(Upt(e));var Zpt=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},Kpt=e=>Array.isArray(e)?e:[e],Gpt=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},Xpt=e=>dpt(e)||!ppt(e);function Qpt(e,t,r=new WeakSet){if(Xpt(e)||Xpt(t))return e===t;if(upt(e)&&upt(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const n=e[a];if(!o.includes(a))return!1;if("ref"!==a){const e=t[a];if(upt(n)&&upt(e)||hpt(n)&&hpt(e)||Array.isArray(n)&&Array.isArray(e)?!Qpt(n,e,r):n!==e)return!1}}return!0}var Jpt=e=>hpt(e)&&!Object.keys(e).length,eht=e=>"file"===e.type,tht=e=>"function"==typeof e,rht=e=>{if(!vpt)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},nht=e=>"select-multiple"===e.type,oht=e=>"radio"===e.type,aht=e=>rht(e)&&e.isConnected;function iht(e,t){const r=Array.isArray(t)?t:gpt(t)?[t]:kpt(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=xpt(e)?n++:e[t[n++]];return e}(e,r),o=r.length-1,a=r[o];return n&&delete n[a],0!==o&&(hpt(n)&&Jpt(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!xpt(e[t]))return!1;return!0}(n))&&iht(e,r.slice(0,-1)),e}var sht=e=>{for(const t in e)if(tht(e[t]))return!0;return!1};function lht(e,t={}){const r=Array.isArray(e);if(hpt(e)||r)for(const r in e)Array.isArray(e[r])||hpt(e[r])&&!sht(e[r])?(t[r]=Array.isArray(e[r])?[]:{},lht(e[r],t[r])):dpt(e[r])||(t[r]=!0);return t}function cht(e,t,r){const n=Array.isArray(e);if(hpt(e)||n)for(const n in e)Array.isArray(e[n])||hpt(e[n])&&!sht(e[n])?xpt(t)||Xpt(r[n])?r[n]=Array.isArray(e[n])?lht(e[n],[]):{...lht(e[n])}:cht(e[n],dpt(t)?{}:t[n],r[n]):r[n]=!Qpt(e[n],t[n]);return r}var uht=(e,t)=>cht(e,t,lht(t));const dht={value:!1,isValid:!1},pht={value:!0,isValid:!0};var hht=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!xpt(e[0].attributes.value)?xpt(e[0].value)||""===e[0].value?pht:{value:e[0].value,isValid:!0}:pht:dht}return dht},fht=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>xpt(e)?e:t?""===e?NaN:e&&+e:r&&Hpt(e)?new Date(e):n?n(e):e;const mht={isValid:!1,value:null};var vht=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,mht):mht;function yht(e){const t=e.ref;return eht(t)?t.files:oht(t)?vht(e.refs).value:nht(t)?[...t.selectedOptions].map(({value:e})=>e):cpt(t)?hht(e.refs).value:fht(xpt(t.value)?e.ref.value:t.value,e)}var ght=e=>e instanceof RegExp,xht=e=>xpt(e)?e:ght(e)?e.source:hpt(e)?ght(e.value)?e.value.source:e.value:e,bht=e=>({isOnSubmit:!e||e===Ppt,isOnBlur:e===Opt,isOnChange:e===Spt,isOnAll:e===Ept,isOnTouch:e===Tpt});const kht="AsyncFunction";var _ht=e=>!!e&&!!e.validate&&!!(tht(e.validate)&&e.validate.constructor.name===kht||hpt(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===kht)),wht=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const Mht=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const r=_pt(e,o);if(r){const{_f:e,...a}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],o)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(Mht(a,t))break}else if(hpt(a)&&Mht(a,t))break}}};function Cht(e,t,r){const n=_pt(e,r);if(n||gpt(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const n=o.join("."),a=_pt(t,n),i=_pt(e,n);if(a&&!Array.isArray(a)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};if(i&&i.root&&i.root.type)return{name:`${n}.root`,error:i.root};o.pop()}return{name:r}}var jht=(e,t,r)=>{const n=Kpt(_pt(e,r));return Mpt(n,"root",t[r]),Mpt(e,r,n),e},Dht=e=>Hpt(e);function Oht(e,t,r="validate"){if(Dht(e)||Array.isArray(e)&&e.every(Dht)||wpt(e)&&!e)return{type:r,message:Dht(e)?e:"",ref:t}}var Sht=e=>hpt(e)&&!ght(e)?e:{value:e,message:""},Pht=async(e,t,r,n,o,a)=>{const{ref:i,refs:s,required:l,maxLength:c,minLength:u,min:d,max:p,pattern:h,validate:f,name:m,valueAsNumber:v,mount:y}=e._f,g=_pt(r,m);if(!y||t.has(m))return{};const x=s?s[0]:i,b=e=>{o&&x.reportValidity&&(x.setCustomValidity(wpt(e)?"":e||""),x.reportValidity())},k={},_=oht(i),w=cpt(i),M=_||w,C=(v||eht(i))&&xpt(i.value)&&xpt(g)||rht(i)&&""===i.value||""===g||Array.isArray(g)&&!g.length,j=Zpt.bind(null,m,n,k),D=(e,t,r,n=Apt,o=Rpt)=>{const a=e?t:r;k[m]={type:e?n:o,message:a,ref:i,...j(e?n:o,a)}};if(a?!Array.isArray(g)||!g.length:l&&(!M&&(C||dpt(g))||wpt(g)&&!g||w&&!hht(s).isValid||_&&!vht(s).isValid)){const{value:e,message:t}=Dht(l)?{value:!!l,message:l}:Sht(l);if(e&&(k[m]={type:Lpt,message:t,ref:x,...j(Lpt,t)},!n))return b(t),k}if(!(C||dpt(d)&&dpt(p))){let e,t;const r=Sht(p),o=Sht(d);if(dpt(g)||isNaN(g)){const n=i.valueAsDate||new Date(g),a=e=>new Date((new Date).toDateString()+" "+e),s="time"==i.type,l="week"==i.type;Hpt(r.value)&&g&&(e=s?a(g)>a(r.value):l?g>r.value:n>new Date(r.value)),Hpt(o.value)&&g&&(t=s?a(g)<a(o.value):l?g<o.value:n<new Date(o.value))}else{const n=i.valueAsNumber||g&&+g;dpt(r.value)||(e=n>r.value),dpt(o.value)||(t=n<o.value)}if((e||t)&&(D(!!e,r.message,o.message,Npt,zpt),!n))return b(k[m].message),k}if((c||u)&&!C&&(Hpt(g)||a&&Array.isArray(g))){const e=Sht(c),t=Sht(u),r=!dpt(e.value)&&g.length>+e.value,o=!dpt(t.value)&&g.length<+t.value;if((r||o)&&(D(r,e.message,t.message),!n))return b(k[m].message),k}if(h&&!C&&Hpt(g)){const{value:e,message:t}=Sht(h);if(ght(e)&&!g.match(e)&&(k[m]={type:Fpt,message:t,ref:i,...j(Fpt,t)},!n))return b(t),k}if(f)if(tht(f)){const e=Oht(await f(g,r),x);if(e&&(k[m]={...e,...j(Bpt,e.message)},!n))return b(e.message),k}else if(hpt(f)){let e={};for(const t in f){if(!Jpt(e)&&!n)break;const o=Oht(await f[t](g,r),x,t);o&&(e={...o,...j(t,o.message)},b(o.message),n&&(k[m]=e))}if(!Jpt(e)&&(k[m]={ref:x,...e},!n))return k}return b(!0),k};const Tht={mode:Ppt,reValidateMode:Spt,shouldFocusError:!0};function Eht(e={}){let t,r={...Tht,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:tht(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},o={},a=(hpt(r.defaultValues)||hpt(r.values))&&ypt(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:ypt(a),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const p={array:Gpt(),state:Gpt()},h=r.criteriaMode===Ept,f=async e=>{if(!r.disabled&&(u.isValid||d.isValid||e)){const e=r.resolver?Jpt((await x()).errors):await b(o,!0);e!==n.isValid&&p.state.next({isValid:e})}},m=(e,t)=>{!r.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((e||Array.from(l.mount)).forEach(e=>{e&&(t?Mpt(n.validatingFields,e,t):iht(n.validatingFields,e))}),p.state.next({validatingFields:n.validatingFields,isValidating:!Jpt(n.validatingFields)}))},v=(e,t,r,n)=>{const l=_pt(o,e);if(l){const o=_pt(i,e,xpt(r)?_pt(a,e):r);xpt(o)||n&&n.defaultChecked||t?Mpt(i,e,t?o:yht(l._f)):w(e,o),s.mount&&f()}},y=(e,t,o,i,s)=>{let l=!1,c=!1;const h={name:e};if(!r.disabled){if(!o||i){(u.isDirty||d.isDirty)&&(c=n.isDirty,n.isDirty=h.isDirty=k(),l=c!==h.isDirty);const r=Qpt(_pt(a,e),t);c=!!_pt(n.dirtyFields,e),r?iht(n.dirtyFields,e):Mpt(n.dirtyFields,e,!0),h.dirtyFields=n.dirtyFields,l=l||(u.dirtyFields||d.dirtyFields)&&c!==!r}if(o){const t=_pt(n.touchedFields,e);t||(Mpt(n.touchedFields,e,o),h.touchedFields=n.touchedFields,l=l||(u.touchedFields||d.touchedFields)&&t!==o)}l&&s&&p.state.next(h)}return l?h:{}},g=(e,o,a,i)=>{const s=_pt(n.errors,e),l=(u.isValid||d.isValid)&&wpt(o)&&n.isValid!==o;if(r.delayError&&a?(t=(e=>t=>{clearTimeout(c),c=setTimeout(e,t)})(()=>((e,t)=>{Mpt(n.errors,e,t),p.state.next({errors:n.errors})})(e,a)),t(r.delayError)):(clearTimeout(c),t=null,a?Mpt(n.errors,e,a):iht(n.errors,e)),(a?!Qpt(s,a):s)||!Jpt(i)||l){const t={...i,...l&&wpt(o)?{isValid:o}:{},errors:n.errors,name:e};n={...n,...t},p.state.next(t)}},x=async e=>{m(e,!0);const t=await r.resolver(i,r.context,((e,t,r,n)=>{const o={};for(const r of e){const e=_pt(t,r);e&&Mpt(o,r,e._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}})(e||l.mount,o,r.criteriaMode,r.shouldUseNativeValidation));return m(e),t},b=async(e,t,o={valid:!0})=>{for(const a in e){const s=e[a];if(s){const{_f:e,...c}=s;if(e){const c=l.array.has(e.name),d=s._f&&_ht(s._f);d&&u.validatingFields&&m([a],!0);const p=await Pht(s,l.disabled,i,h,r.shouldUseNativeValidation&&!t,c);if(d&&u.validatingFields&&m([a]),p[e.name]&&(o.valid=!1,t))break;!t&&(_pt(p,e.name)?c?jht(n.errors,p,e.name):Mpt(n.errors,e.name,p[e.name]):iht(n.errors,e.name))}!Jpt(c)&&await b(c,t,o)}}return o.valid},k=(e,t)=>!r.disabled&&(e&&t&&Mpt(i,e,t),!Qpt(S(),a)),_=(e,t,r)=>Wpt(e,l,{...s.mount?i:xpt(t)?a:Hpt(e)?{[e]:t}:t},r,t),w=(e,t,r={})=>{const n=_pt(o,e);let a=t;if(n){const r=n._f;r&&(!r.disabled&&Mpt(i,e,fht(t,r)),a=rht(r.ref)&&dpt(t)?"":t,nht(r.ref)?[...r.ref.options].forEach(e=>e.selected=a.includes(e.value)):r.refs?cpt(r.ref)?r.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(Array.isArray(a)?e.checked=!!a.find(t=>t===e.value):e.checked=a===e.value||!!a)}):r.refs.forEach(e=>e.checked=e.value===a):eht(r.ref)?r.ref.value="":(r.ref.value=a,r.ref.type||p.state.next({name:e,values:ypt(i)})))}(r.shouldDirty||r.shouldTouch)&&y(e,a,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&O(e)},M=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const a=t[n],i=e+"."+n,s=_pt(o,i);(l.array.has(e)||hpt(a)||s&&!s._f)&&!upt(a)?M(i,a,r):w(i,a,r)}},C=(e,t,r={})=>{const c=_pt(o,e),h=l.array.has(e),f=ypt(t);Mpt(i,e,f),h?(p.array.next({name:e,values:ypt(i)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&r.shouldDirty&&p.state.next({name:e,dirtyFields:uht(a,i),isDirty:k(e,f)})):!c||c._f||dpt(f)?w(e,f,r):M(e,f,r),wht(e,l)&&p.state.next({...n}),p.state.next({name:s.mount?e:void 0,values:ypt(i)})},j=async e=>{s.mount=!0;const a=e.target;let c=a.name,v=!0;const k=_pt(o,c),_=e=>{v=Number.isNaN(e)||upt(e)&&isNaN(e.getTime())||Qpt(e,_pt(i,c,e))},w=bht(r.mode),M=bht(r.reValidateMode);if(k){let s,C;const j=a.type?yht(k._f):fpt(e),D=e.type===Cpt||e.type===jpt,S=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(k._f)&&!r.resolver&&!_pt(n.errors,c)&&!k._f.deps||((e,t,r,n,o)=>!o.isOnAll&&(!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:!(r?n.isOnChange:o.isOnChange)||e))(D,_pt(n.touchedFields,c),n.isSubmitted,M,w),P=wht(c,l,D);Mpt(i,c,j),D?(k._f.onBlur&&k._f.onBlur(e),t&&t(0)):k._f.onChange&&k._f.onChange(e);const T=y(c,j,D),E=!Jpt(T)||P;if(!D&&p.state.next({name:c,type:e.type,values:ypt(i)}),S)return(u.isValid||d.isValid)&&("onBlur"===r.mode?D&&f():D||f()),E&&p.state.next({name:c,...P?{}:T});if(!D&&P&&p.state.next({...n}),r.resolver){const{errors:e}=await x([c]);if(_(j),v){const t=Cht(n.errors,o,c),r=Cht(e,o,t.name||c);s=r.error,c=r.name,C=Jpt(e)}}else m([c],!0),s=(await Pht(k,l.disabled,i,h,r.shouldUseNativeValidation))[c],m([c]),_(j),v&&(s?C=!1:(u.isValid||d.isValid)&&(C=await b(o,!0)));v&&(k._f.deps&&O(k._f.deps),g(c,C,s,T))}},D=(e,t)=>{if(_pt(n.errors,t)&&e.focus)return e.focus(),1},O=async(e,t={})=>{let a,i;const s=Kpt(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await x(e);if(e)for(const r of e){const e=_pt(t,r);e?Mpt(n.errors,r,e):iht(n.errors,r)}else n.errors=t;return t})(xpt(e)?e:s);a=Jpt(t),i=e?!s.some(e=>_pt(t,e)):a}else e?(i=(await Promise.all(s.map(async e=>{const t=_pt(o,e);return await b(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||n.isValid)&&f()):i=a=await b(o);return p.state.next({...!Hpt(e)||(u.isValid||d.isValid)&&a!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:a}:{},errors:n.errors}),t.shouldFocus&&!i&&Mht(o,D,e?s:l.mount),i},S=e=>{const t={...s.mount?i:a};return xpt(e)?t:Hpt(e)?_pt(t,e):e.map(e=>_pt(t,e))},P=(e,t)=>({invalid:!!_pt((t||n).errors,e),isDirty:!!_pt((t||n).dirtyFields,e),error:_pt((t||n).errors,e),isValidating:!!_pt(n.validatingFields,e),isTouched:!!_pt((t||n).touchedFields,e)}),T=(e,t,r)=>{const a=(_pt(o,e,{_f:{}})._f||{}).ref,i=_pt(n.errors,e)||{},{ref:s,message:l,type:c,...u}=i;Mpt(n.errors,e,{...u,...t,ref:a}),p.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&a&&a.focus&&a.focus()},E=e=>p.state.subscribe({next:t=>{((e,t,r)=>!e||!t||e===t||Kpt(e).some(e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e))))(e.name,t.name,e.exact)&&((e,t,r,n)=>{r(e);const{name:o,...a}=e;return Jpt(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!n||Ept))})(t,e.formState||u,V,e.reRenderRoot)&&e.callback({values:{...i},...n,...t})}}).unsubscribe,N=(e,t={})=>{for(const s of e?Kpt(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||(iht(o,s),iht(i,s)),!t.keepError&&iht(n.errors,s),!t.keepDirty&&iht(n.dirtyFields,s),!t.keepTouched&&iht(n.touchedFields,s),!t.keepIsValidating&&iht(n.validatingFields,s),!r.shouldUnregister&&!t.keepDefaultValue&&iht(a,s);p.state.next({values:ypt(i)}),p.state.next({...n,...t.keepDirty?{isDirty:k()}:{}}),!t.keepIsValid&&f()},z=({disabled:e,name:t})=>{(wpt(e)&&s.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t))},A=(e,t={})=>{let n=_pt(o,e);const i=wpt(t.disabled)||wpt(r.disabled);return Mpt(o,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?z({disabled:wpt(t.disabled)?t.disabled:r.disabled,name:e}):v(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:xht(t.min),max:xht(t.max),minLength:xht(t.minLength),maxLength:xht(t.maxLength),pattern:xht(t.pattern)}:{},name:e,onChange:j,onBlur:j,ref:i=>{if(i){A(e,t),n=_pt(o,e);const r=xpt(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=(e=>oht(e)||cpt(e))(r),l=n._f.refs||[];if(s?l.find(e=>e===r):r===n._f.ref)return;Mpt(o,e,{_f:{...n._f,...s?{refs:[...l.filter(aht),r,...Array.isArray(_pt(a,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),v(e,!1,void 0,r)}else n=_pt(o,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!mpt(l.array,e)||!s.action)&&l.unMount.add(e)}}},R=()=>r.shouldFocusError&&Mht(o,D,l.mount),F=(e,t)=>async a=>{let s;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let c=ypt(i);if(p.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await x();n.errors=e,c=ypt(t)}else await b(o);if(l.disabled.size)for(const e of l.disabled)iht(c,e);if(iht(n.errors,"root"),Jpt(n.errors)){p.state.next({errors:{}});try{await e(c,a)}catch(e){s=e}}else t&&await t({...n.errors},a),R(),setTimeout(R);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Jpt(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},L=(e,t={})=>{const c=e?ypt(e):a,d=ypt(c),h=Jpt(e),f=h?a:d;if(t.keepDefaultValues||(a=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(uht(a,i))]);for(const t of Array.from(e))_pt(n.dirtyFields,t)?Mpt(f,t,_pt(i,t)):C(t,_pt(f,t))}else{if(vpt&&xpt(e))for(const e of l.mount){const t=_pt(o,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(rht(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of l.mount)C(e,_pt(f,e));else o={}}i=r.shouldUnregister?t.keepDefaultValues?ypt(a):{}:ypt(f),p.array.next({values:{...f}}),p.state.next({values:{...f}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!r.shouldUnregister,p.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!h&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||Qpt(e,a))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:h?{}:t.keepDirtyValues?t.keepDefaultValues&&i?uht(a,i):n.dirtyFields:t.keepDefaultValues&&e?uht(a,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},B=(e,t)=>L(tht(e)?e(i):e,t),V=e=>{n={...n,...e}},I={control:{register:A,unregister:N,getFieldState:P,handleSubmit:F,setError:T,_subscribe:E,_runSchema:x,_focusError:R,_getWatch:_,_getDirty:k,_setValid:f,_setFieldArray:(e,t=[],l,c,h=!0,f=!0)=>{if(c&&l&&!r.disabled){if(s.action=!0,f&&Array.isArray(_pt(o,e))){const t=l(_pt(o,e),c.argA,c.argB);h&&Mpt(o,e,t)}if(f&&Array.isArray(_pt(n.errors,e))){const t=l(_pt(n.errors,e),c.argA,c.argB);h&&Mpt(n.errors,e,t),((e,t)=>{!bpt(_pt(e,t)).length&&iht(e,t)})(n.errors,e)}if((u.touchedFields||d.touchedFields)&&f&&Array.isArray(_pt(n.touchedFields,e))){const t=l(_pt(n.touchedFields,e),c.argA,c.argB);h&&Mpt(n.touchedFields,e,t)}(u.dirtyFields||d.dirtyFields)&&(n.dirtyFields=uht(a,i)),p.state.next({name:e,isDirty:k(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Mpt(i,e,t)},_setDisabledField:z,_setErrors:e=>{n.errors=e,p.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>bpt(_pt(s.mount?i:a,e,r.shouldUnregister?_pt(a,e,[]):[])),_reset:L,_resetDefaultValues:()=>tht(r.defaultValues)&&r.defaultValues().then(e=>{B(e,r.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of l.unMount){const t=_pt(o,e);t&&(t._f.refs?t._f.refs.every(e=>!aht(e)):!aht(t._f.ref))&&N(e)}l.unMount=new Set},_disableForm:e=>{wpt(e)&&(p.state.next({disabled:e}),Mht(o,(t,r)=>{const n=_pt(o,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:p,_proxyFormState:u,get _fields(){return o},get _formValues(){return i},get _state(){return s},set _state(e){s=e},get _defaultValues(){return a},get _names(){return l},set _names(e){l=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(s.mount=!0,d={...d,...e.formState},E({...e,formState:d})),trigger:O,register:A,handleSubmit:F,watch:(e,t)=>tht(e)?p.state.subscribe({next:r=>e(_(void 0,t),r)}):_(e,t,!0),setValue:C,getValues:S,reset:B,resetField:(e,t={})=>{_pt(o,e)&&(xpt(t.defaultValue)?C(e,ypt(_pt(a,e))):(C(e,t.defaultValue),Mpt(a,e,ypt(t.defaultValue))),t.keepTouched||iht(n.touchedFields,e),t.keepDirty||(iht(n.dirtyFields,e),n.isDirty=t.defaultValue?k(e,ypt(_pt(a,e))):k()),t.keepError||(iht(n.errors,e),u.isValid&&f()),p.state.next({...n}))},clearErrors:e=>{e&&Kpt(e).forEach(e=>iht(n.errors,e)),p.state.next({errors:e?n.errors:{}})},unregister:N,setError:T,setFocus:(e,t={})=>{const r=_pt(o,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&tht(e.select)&&e.select())}},getFieldState:P};return{...I,formControl:I}}const Nht=(e,t,r)=>{if(e&&"reportValidity"in e){const n=_pt(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},zht=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Nht(n.ref,r,e):n.refs&&n.refs.forEach(t=>Nht(t,r,e))}},Aht=(e,t)=>{t.shouldUseNativeValidation&&zht(e,t);const r={};for(const n in e){const o=_pt(t.fields,n),a=Object.assign(e[n]||{},{ref:o&&o.ref});if(Rht(t.names||Object.keys(e),n)){const e=Object.assign({},_pt(r,n));Mpt(e,"root",a),Mpt(r,n,e)}else Mpt(r,n,a)}return r},Rht=(e,t)=>e.some(e=>e.startsWith(t+"."));var Fht=function(e,t){for(var r={};e.length;){var n=e[0],o=n.code,a=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[i]={message:s.message,type:s.code}}else r[i]={message:a,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=r[i].types,c=l&&l[n.code];r[i]=Zpt(i,t,r,o,c?[].concat(c,n.message):n.message)}e.shift()}return r},Lht=function(e,t,r){return void 0===r&&(r={}),function(n,o,a){try{return Promise.resolve(function(o,i){try{var s=Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return a.shouldUseNativeValidation&&zht({},a),{errors:{},values:r.raw?n:e}})}catch(e){return i(e)}return s&&s.then?s.then(void 0,i):s}(0,function(e){if(function(e){return Array.isArray(null==e?void 0:e.errors)}(e))return{values:{},errors:Aht(Fht(e.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw e}))}catch(e){return Promise.reject(e)}}};const Bht=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Vht=Vut,Iht=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Vht(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(e=>{const t=null==r?void 0:r[e],n=null==a?void 0:a[e];if(null===t)return null;const i=Bht(t)||Bht(n);return o[e][i]}),s=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),l=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...o}=t;return Object.entries(o).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...s}[t]):{...a,...s}[t]===r})?[...e,r,n]:e},[]);return Vht(e,i,l,null==r?void 0:r.class,null==r?void 0:r.className)},qht=Iht("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),$ht=s.forwardRef(({className:e,variant:r,size:n,asChild:o=!1,...a},i)=>t.jsx(o?wlt:"button",{className:zdt(qht({variant:r,size:n,className:e})),ref:i,...a}));$ht.displayName="Button";var Hht=function(){return Hht=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Hht.apply(this,arguments)};function Wht(e,t,r){for(var n,o=0,a=t.length;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function Uht(e){return"multiple"===e.mode}function Yht(e){return"range"===e.mode}function Zht(e){return"single"===e.mode}var Kht={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var Ght=Object.freeze({__proto__:null,formatCaption:function(e,t){return sst(e,"LLLL y",t)},formatDay:function(e,t){return sst(e,"d",t)},formatMonthCaption:function(e,t){return sst(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return sst(e,"cccccc",t)},formatYearCaption:function(e,t){return sst(e,"yyyy",t)}}),Xht=Object.freeze({__proto__:null,labelDay:function(e,t,r){return sst(e,"do MMMM (EEEE)",r)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return sst(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var Qht=e.createContext(void 0);function Jht(e){var r,n,o=e.initialProps,a={captionLayout:"buttons",classNames:Kht,formatters:Ght,labels:Xht,locale:zit,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:"default"},i=function(e){var t=e.fromYear,r=e.toYear,n=e.fromMonth,o=e.toMonth,a=e.fromDate,i=e.toDate;return n?a=kit(n):t&&(a=new Date(t,0,1)),o?i=xit(o):r&&(i=new Date(r,11,31)),{fromDate:a?iit(a):void 0,toDate:i?iit(i):void 0}}(o),s=i.fromDate,l=i.toDate,c=null!==(r=o.captionLayout)&&void 0!==r?r:a.captionLayout;"buttons"!==c&&(!s||!l)&&(c="buttons"),(Zht(o)||Uht(o)||Yht(o))&&(n=o.onSelect);var u=Hht(Hht(Hht({},a),o),{captionLayout:c,classNames:Hht(Hht({},a.classNames),o.classNames),components:Hht({},o.components),formatters:Hht(Hht({},a.formatters),o.formatters),fromDate:s,labels:Hht(Hht({},a.labels),o.labels),mode:o.mode||a.mode,modifiers:Hht(Hht({},a.modifiers),o.modifiers),modifiersClassNames:Hht(Hht({},a.modifiersClassNames),o.modifiersClassNames),onSelect:n,styles:Hht(Hht({},a.styles),o.styles),toDate:l});return t.jsx(Qht.Provider,{value:u,children:e.children})}function eft(){var t=e.useContext(Qht);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}function tft(e){var r=eft(),n=r.locale,o=r.classNames,a=r.styles,i=r.formatters.formatCaption;return t.jsx("div",{className:o.caption_label,style:a.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function rft(e){return t.jsx("svg",Hht({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:t.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function nft(e){var r,n,o=e.onChange,a=e.value,i=e.children,s=e.caption,l=e.className,c=e.style,u=eft(),d=null!==(n=null===(r=u.components)||void 0===r?void 0:r.IconDropdown)&&void 0!==n?n:rft;return t.jsxs("div",{className:l,style:c,children:[t.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),t.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:a,onChange:o,children:i}),t.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[s,t.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function oft(e){var r,n=eft(),o=n.fromDate,a=n.toDate,i=n.styles,s=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,u=n.components,d=n.labels.labelMonthDropdown;if(!o)return t.jsx(t.Fragment,{});if(!a)return t.jsx(t.Fragment,{});var p=[];if(fst(o,a))for(var h=kit(o),f=o.getMonth();f<=a.getMonth();f++)p.push(jst(h,f));else for(h=kit(new Date),f=0;f<=11;f++)p.push(jst(h,f));var m=null!==(r=null==u?void 0:u.Dropdown)&&void 0!==r?r:nft;return t.jsx(m,{name:"months","aria-label":d(),className:c.dropdown_month,style:i.dropdown_month,onChange:function(t){var r=Number(t.target.value),n=jst(kit(e.displayMonth),r);e.onChange(n)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:s}),children:p.map(function(e){return t.jsx("option",{value:e.getMonth(),children:l(e,{locale:s})},e.getMonth())})})}function aft(e){var r,n=e.displayMonth,o=eft(),a=o.fromDate,i=o.toDate,s=o.locale,l=o.styles,c=o.classNames,u=o.components,d=o.formatters.formatYearCaption,p=o.labels.labelYearDropdown,h=[];if(!a)return t.jsx(t.Fragment,{});if(!i)return t.jsx(t.Fragment,{});for(var f=a.getFullYear(),m=i.getFullYear(),v=f;v<=m;v++)h.push(Sst(wit(new Date),v));var y=null!==(r=null==u?void 0:u.Dropdown)&&void 0!==r?r:nft;return t.jsx(y,{name:"years","aria-label":p(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var r=Sst(kit(n),Number(t.target.value));e.onChange(r)},value:n.getFullYear(),caption:d(n,{locale:s}),children:h.map(function(e){return t.jsx("option",{value:e.getFullYear(),children:d(e,{locale:s})},e.getFullYear())})})}function ift(){var t=eft(),r=function(e){var t=e.month,r=e.defaultMonth,n=e.today,o=t||r||n||new Date,a=e.toDate,i=e.fromDate,s=e.numberOfMonths,l=void 0===s?1:s;return a&&mit(a,o)<0&&(o=Gat(a,-1*(l-1))),i&&mit(o,i)<0&&(o=i),kit(o)}(t),n=function(t,r){var n=e.useState(t),o=n[0];return[void 0===r?o:r,n[1]]}(r,t.month),o=n[0],a=n[1];return[o,function(e){var r;if(!t.disableNavigation){var n=kit(e);a(n),null===(r=t.onMonthChange)||void 0===r||r.call(t,n)}}]}var sft=e.createContext(void 0);function lft(e){var r=eft(),n=ift(),o=n[0],a=n[1],i=function(e,t){for(var r=t.reverseMonths,n=t.numberOfMonths,o=kit(e),a=mit(kit(Gat(o,n)),o),i=[],s=0;s<a;s++){var l=Gat(o,s);i.push(l)}return r&&(i=i.reverse()),i}(o,r),s=function(e,t){if(!t.disableNavigation){var r=t.toDate,n=t.pagedNavigation,o=t.numberOfMonths,a=void 0===o?1:o,i=n?a:1,s=kit(e);if(!r)return Gat(s,i);if(!(mit(r,e)<a))return Gat(s,i)}}(o,r),l=function(e,t){if(!t.disableNavigation){var r=t.fromDate,n=t.pagedNavigation,o=t.numberOfMonths,a=n?void 0===o?1:o:1,i=kit(e);if(!r)return Gat(i,-a);if(!(mit(i,r)<=0))return Gat(i,-a)}}(o,r),c=function(e){return i.some(function(t){return hst(e,t)})},u={currentMonth:o,displayMonths:i,goToMonth:a,goToDate:function(e,t){c(e)||(t&&pst(e,t)?a(Gat(e,1+-1*r.numberOfMonths)):a(e))},previousMonth:l,nextMonth:s,isDateDisplayed:c};return t.jsx(sft.Provider,{value:u,children:e.children})}function cft(){var t=e.useContext(sft);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t}function uft(e){var r,n=eft(),o=n.classNames,a=n.styles,i=n.components,s=cft().goToMonth,l=function(t){s(Gat(t,e.displayIndex?-e.displayIndex:0))},c=null!==(r=null==i?void 0:i.CaptionLabel)&&void 0!==r?r:tft,u=t.jsx(c,{id:e.id,displayMonth:e.displayMonth});return t.jsxs("div",{className:o.caption_dropdowns,style:a.caption_dropdowns,children:[t.jsx("div",{className:o.vhidden,children:u}),t.jsx(oft,{onChange:l,displayMonth:e.displayMonth}),t.jsx(aft,{onChange:l,displayMonth:e.displayMonth})]})}function dft(e){return t.jsx("svg",Hht({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function pft(e){return t.jsx("svg",Hht({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var hft=e.forwardRef(function(e,r){var n=eft(),o=n.classNames,a=n.styles,i=[o.button_reset,o.button];e.className&&i.push(e.className);var s=i.join(" "),l=Hht(Hht({},a.button_reset),a.button);return e.style&&Object.assign(l,e.style),t.jsx("button",Hht({},e,{ref:r,type:"button",className:s,style:l}))});function fft(e){var r,n,o=eft(),a=o.dir,i=o.locale,s=o.classNames,l=o.styles,c=o.labels,u=c.labelPrevious,d=c.labelNext,p=o.components;if(!e.nextMonth&&!e.previousMonth)return t.jsx(t.Fragment,{});var h=u(e.previousMonth,{locale:i}),f=[s.nav_button,s.nav_button_previous].join(" "),m=d(e.nextMonth,{locale:i}),v=[s.nav_button,s.nav_button_next].join(" "),y=null!==(r=null==p?void 0:p.IconRight)&&void 0!==r?r:pft,g=null!==(n=null==p?void 0:p.IconLeft)&&void 0!==n?n:dft;return t.jsxs("div",{className:s.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(hft,{name:"previous-month","aria-label":h,className:f,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:"rtl"===a?t.jsx(y,{className:s.nav_icon,style:l.nav_icon}):t.jsx(g,{className:s.nav_icon,style:l.nav_icon})}),!e.hideNext&&t.jsx(hft,{name:"next-month","aria-label":m,className:v,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:"rtl"===a?t.jsx(g,{className:s.nav_icon,style:l.nav_icon}):t.jsx(y,{className:s.nav_icon,style:l.nav_icon})})]})}function mft(e){var r=eft().numberOfMonths,n=cft(),o=n.previousMonth,a=n.nextMonth,i=n.goToMonth,s=n.displayMonths,l=s.findIndex(function(t){return hst(e.displayMonth,t)}),c=0===l,u=l===s.length-1,d=r>1&&(c||!u),p=r>1&&(u||!c);return t.jsx(fft,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:p,nextMonth:a,previousMonth:o,onPreviousClick:function(){o&&i(o)},onNextClick:function(){a&&i(a)}})}function vft(e){var r,n,o=eft(),a=o.classNames,i=o.disableNavigation,s=o.styles,l=o.captionLayout,c=o.components,u=null!==(r=null==c?void 0:c.CaptionLabel)&&void 0!==r?r:tft;return n=i?t.jsx(u,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===l?t.jsx(uft,{displayMonth:e.displayMonth,id:e.id}):"dropdown-buttons"===l?t.jsxs(t.Fragment,{children:[t.jsx(uft,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(mft,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):t.jsxs(t.Fragment,{children:[t.jsx(u,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(mft,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:a.caption,style:s.caption,children:n})}function yft(e){var r=eft(),n=r.footer,o=r.styles,a=r.classNames.tfoot;return n?t.jsx("tfoot",{className:a,style:o.tfoot,children:t.jsx("tr",{children:t.jsx("td",{colSpan:8,children:n})})}):t.jsx(t.Fragment,{})}function gft(){var e=eft(),r=e.classNames,n=e.styles,o=e.showWeekNumber,a=e.locale,i=e.weekStartsOn,s=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=function(e,t,r){for(var n=r?oit(new Date):nit(new Date,{locale:e,weekStartsOn:t}),o=[],a=0;a<7;a++){var i=Kat(n,a);o.push(i)}return o}(a,i,s);return t.jsxs("tr",{style:n.head_row,className:r.head_row,children:[o&&t.jsx("td",{style:n.head_cell,className:r.head_cell}),u.map(function(e,o){return t.jsx("th",{scope:"col",className:r.head_cell,style:n.head_cell,"aria-label":c(e,{locale:a}),children:l(e,{locale:a})},o)})]})}function xft(){var e,r=eft(),n=r.classNames,o=r.styles,a=r.components,i=null!==(e=null==a?void 0:a.HeadRow)&&void 0!==e?e:gft;return t.jsx("thead",{style:o.head,className:n.head,children:t.jsx(i,{})})}function bft(e){var r=eft(),n=r.locale,o=r.formatters.formatDay;return t.jsx(t.Fragment,{children:o(e.date,{locale:n})})}var kft=e.createContext(void 0);function _ft(e){if(!Uht(e.initialProps)){return t.jsx(kft.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(wft,{initialProps:e.initialProps,children:e.children})}function wft(e){var r=e.initialProps,n=e.children,o=r.selected,a=r.min,i=r.max,s={disabled:[]};o&&s.disabled.push(function(e){var t=i&&o.length>i-1,r=o.some(function(t){return hit(t,e)});return!(!t||r)});var l={selected:o,onDayClick:function(e,t,n){var s,l;if((null===(s=r.onDayClick)||void 0===s||s.call(r,e,t,n),!!(!t.selected||!a||(null==o?void 0:o.length)!==a))&&!!(t.selected||!i||(null==o?void 0:o.length)!==i)){var c=o?Wht([],o):[];if(t.selected){var u=c.findIndex(function(t){return hit(e,t)});c.splice(u,1)}else c.push(e);null===(l=r.onSelect)||void 0===l||l.call(r,c,e,t,n)}},modifiers:s};return t.jsx(kft.Provider,{value:l,children:n})}function Mft(){var t=e.useContext(kft);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}var Cft,jft=e.createContext(void 0);function Dft(e){if(!Yht(e.initialProps)){return t.jsx(jft.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(Oft,{initialProps:e.initialProps,children:e.children})}function Oft(e){var r=e.initialProps,n=e.children,o=r.selected,a=o||{},i=a.from,s=a.to,l=r.min,c=r.max,u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],s?(u.range_end=[s],hit(i,s)||(u.range_middle=[{after:i,before:s}])):u.range_end=[i]):s&&(u.range_start=[s],u.range_end=[s]),l&&(i&&!s&&u.disabled.push({after:vst(i,l-1),before:Kat(i,l-1)}),i&&s&&u.disabled.push({after:i,before:Kat(i,l-1)}),!i&&s&&u.disabled.push({after:vst(s,l-1),before:Kat(s,l-1)})),c){if(i&&!s&&(u.disabled.push({before:Kat(i,1-c)}),u.disabled.push({after:Kat(i,c-1)})),i&&s){var d=c-(lit(s,i)+1);u.disabled.push({before:vst(i,d)}),u.disabled.push({after:Kat(s,d)})}!i&&s&&(u.disabled.push({before:Kat(s,1-c)}),u.disabled.push({after:Kat(s,c-1)}))}return t.jsx(jft.Provider,{value:{selected:o,onDayClick:function(e,t,n){var a,i;null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,n);var s=function(e,t){var r=t||{},n=r.from,o=r.to;return n&&o?hit(o,e)&&hit(n,e)?void 0:hit(o,e)?{from:o,to:void 0}:hit(n,e)?void 0:dst(n,e)?{from:e,to:o}:{from:n,to:e}:o?dst(e,o)?{from:o,to:e}:{from:e,to:o}:n?pst(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}(e,o);null===(i=r.onSelect)||void 0===i||i.call(r,s,e,t,n)},modifiers:u},children:n})}function Sft(){var t=e.useContext(jft);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function Pft(e){return Array.isArray(e)?Wht([],e):void 0!==e?[e]:[]}!function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"}(Cft||(Cft={}));var Tft=Cft.Selected,Eft=Cft.Disabled,Nft=Cft.Hidden,zft=Cft.Today,Aft=Cft.RangeEnd,Rft=Cft.RangeMiddle,Fft=Cft.RangeStart,Lft=Cft.Outside;var Bft=e.createContext(void 0);function Vft(e){var r=eft(),n=function(e,t,r){var n,o=((n={})[Tft]=Pft(e.selected),n[Eft]=Pft(e.disabled),n[Nft]=Pft(e.hidden),n[zft]=[e.today],n[Aft]=[],n[Rft]=[],n[Fft]=[],n[Lft]=[],n);return e.fromDate&&o[Eft].push({before:e.fromDate}),e.toDate&&o[Eft].push({after:e.toDate}),Uht(e)?o[Eft]=o[Eft].concat(t.modifiers[Eft]):Yht(e)&&(o[Eft]=o[Eft].concat(r.modifiers[Eft]),o[Fft]=r.modifiers[Fft],o[Rft]=r.modifiers[Rft],o[Aft]=r.modifiers[Aft]),o}(r,Mft(),Sft()),o=function(e){var t={};return Object.entries(e).forEach(function(e){var r=e[0],n=e[1];t[r]=Pft(n)}),t}(r.modifiers),a=Hht(Hht({},n),o);return t.jsx(Bft.Provider,{value:a,children:e.children})}function Ift(){var t=e.useContext(Bft);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function qft(e,t){return t.some(function(t){if("boolean"==typeof t)return t;if(function(e){return fit(e)}(t))return hit(e,t);if(function(e){return Array.isArray(e)&&e.every(fit)}(t))return t.includes(e);if(function(e){return!(!e||"object"!=typeof e||!("from"in e))}(t))return function(e,t){var r,n=t.from,o=t.to;return n&&o?(lit(o,n)<0&&(n=(r=[o,n])[0],o=r[1]),lit(e,n)>=0&&lit(o,e)>=0):o?hit(o,e):!!n&&hit(n,e)}(e,t);if(function(e){return!(!e||"object"!=typeof e||!("dayOfWeek"in e))}(t))return t.dayOfWeek.includes(e.getDay());if(function(e){return!!(e&&"object"==typeof e&&"before"in e&&"after"in e)}(t)){var r=lit(t.before,e)>0,n=lit(t.after,e)<0;return dst(t.before,t.after)?n&&r:r||n}return function(e){return!(!e||"object"!=typeof e||!("after"in e))}(t)?lit(e,t.after)>0:function(e){return!(!e||"object"!=typeof e||!("before"in e))}(t)?lit(t.before,e)>0:"function"==typeof t&&t(e)})}function $ft(e,t,r){var n=Object.keys(t).reduce(function(r,n){var o=t[n];return qft(e,o)&&r.push(n),r},[]),o={};return n.forEach(function(e){return o[e]=!0}),r&&!hst(e,r)&&(o.outside=!0),o}function Hft(e,t){var r=t.moveBy,n=t.direction,o=t.context,a=t.modifiers,i=t.retry,s=void 0===i?{count:0,lastFocused:e}:i,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,p={day:Kat,week:cit,month:Gat,year:uit,startOfWeek:function(e){return o.ISOWeek?oit(e):nit(e,{locale:d,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?Cit(e):Mit(e,{locale:d,weekStartsOn:l})}},h=p[r](e,"after"===n?1:-1);"before"===n&&c?h=dit([c,h]):"after"===n&&u&&(h=pit([u,h]));var f=!0;if(a){var m=$ft(h,a);f=!m.disabled&&!m.hidden}return f?h:s.count>365?s.lastFocused:Hft(h,{moveBy:r,direction:n,context:o,modifiers:a,retry:Hht(Hht({},s),{count:s.count+1})})}var Wft=e.createContext(void 0);function Uft(r){var n=cft(),o=Ift(),a=e.useState(),i=a[0],s=a[1],l=e.useState(),c=l[0],u=l[1],d=function(e,t){for(var r,n,o=kit(e[0]),a=xit(e[e.length-1]),i=o;i<=a;){var s=$ft(i,t);if(s.disabled||s.hidden)i=Kat(i,1);else{if(s.selected)return i;s.today&&!n&&(n=i),r||(r=i),i=Kat(i,1)}}return n||r}(n.displayMonths,o),p=i??(c&&n.isDateDisplayed(c))?c:d,h=function(e){s(e)},f=eft(),m=function(e,t){if(i){var r=Hft(i,{moveBy:e,direction:t,context:f,modifiers:o});hit(i,r)||(n.goToDate(r,i),h(r))}},v={focusedDay:i,focusTarget:p,blur:function(){u(i),s(void 0)},focus:h,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return t.jsx(Wft.Provider,{value:v,children:r.children})}function Yft(){var t=e.useContext(Wft);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}var Zft=e.createContext(void 0);function Kft(e){if(!Zht(e.initialProps)){return t.jsx(Zft.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(Gft,{initialProps:e.initialProps,children:e.children})}function Gft(e){var r=e.initialProps,n=e.children,o={selected:r.selected,onDayClick:function(e,t,n){var o,a,i;null===(o=r.onDayClick)||void 0===o||o.call(r,e,t,n),!t.selected||r.required?null===(i=r.onSelect)||void 0===i||i.call(r,e,e,t,n):null===(a=r.onSelect)||void 0===a||a.call(r,void 0,e,t,n)}};return t.jsx(Zft.Provider,{value:o,children:n})}function Xft(){var t=e.useContext(Zft);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function Qft(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(t){var n=e.modifiersClassNames[t];if(n)r.push(n);else if(function(e){return Object.values(Cft).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&r.push(o)}}),r}function Jft(r,n,o){var a,i,s,l=eft(),c=Yft(),u=function(e,t){return $ft(e,Ift(),t)}(r,n),d=function(e,t){var r=eft(),n=Xft(),o=Mft(),a=Sft(),i=Yft(),s=i.focusDayAfter,l=i.focusDayBefore,c=i.focusWeekAfter,u=i.focusWeekBefore,d=i.blur,p=i.focus,h=i.focusMonthBefore,f=i.focusMonthAfter,m=i.focusYearBefore,v=i.focusYearAfter,y=i.focusStartOfWeek,g=i.focusEndOfWeek,x={onClick:function(i){var s,l,c,u;Zht(r)?null===(s=n.onDayClick)||void 0===s||s.call(n,e,t,i):Uht(r)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,i):Yht(r)?null===(c=a.onDayClick)||void 0===c||c.call(a,e,t,i):null===(u=r.onDayClick)||void 0===u||u.call(r,e,t,i)},onFocus:function(n){var o;p(e),null===(o=r.onDayFocus)||void 0===o||o.call(r,e,t,n)},onBlur:function(n){var o;d(),null===(o=r.onDayBlur)||void 0===o||o.call(r,e,t,n)},onKeyDown:function(n){var o;switch(n.key){case"ArrowLeft":n.preventDefault(),n.stopPropagation(),"rtl"===r.dir?s():l();break;case"ArrowRight":n.preventDefault(),n.stopPropagation(),"rtl"===r.dir?l():s();break;case"ArrowDown":n.preventDefault(),n.stopPropagation(),c();break;case"ArrowUp":n.preventDefault(),n.stopPropagation(),u();break;case"PageUp":n.preventDefault(),n.stopPropagation(),n.shiftKey?m():h();break;case"PageDown":n.preventDefault(),n.stopPropagation(),n.shiftKey?v():f();break;case"Home":n.preventDefault(),n.stopPropagation(),y();break;case"End":n.preventDefault(),n.stopPropagation(),g()}null===(o=r.onDayKeyDown)||void 0===o||o.call(r,e,t,n)},onKeyUp:function(n){var o;null===(o=r.onDayKeyUp)||void 0===o||o.call(r,e,t,n)},onMouseEnter:function(n){var o;null===(o=r.onDayMouseEnter)||void 0===o||o.call(r,e,t,n)},onMouseLeave:function(n){var o;null===(o=r.onDayMouseLeave)||void 0===o||o.call(r,e,t,n)},onPointerEnter:function(n){var o;null===(o=r.onDayPointerEnter)||void 0===o||o.call(r,e,t,n)},onPointerLeave:function(n){var o;null===(o=r.onDayPointerLeave)||void 0===o||o.call(r,e,t,n)},onTouchCancel:function(n){var o;null===(o=r.onDayTouchCancel)||void 0===o||o.call(r,e,t,n)},onTouchEnd:function(n){var o;null===(o=r.onDayTouchEnd)||void 0===o||o.call(r,e,t,n)},onTouchMove:function(n){var o;null===(o=r.onDayTouchMove)||void 0===o||o.call(r,e,t,n)},onTouchStart:function(n){var o;null===(o=r.onDayTouchStart)||void 0===o||o.call(r,e,t,n)}};return x}(r,u),p=function(){var e=eft(),t=Xft(),r=Mft(),n=Sft();return Zht(e)?t.selected:Uht(e)?r.selected:Yht(e)?n.selected:void 0}(),h=!(!l.onDayClick&&"default"===l.mode);e.useEffect(function(){var e;u.outside||c.focusedDay&&h&&hit(c.focusedDay,r)&&(null===(e=o.current)||void 0===e||e.focus())},[c.focusedDay,r,o,h,u.outside]);var f=Qft(l,u).join(" "),m=function(e,t){var r=Hht({},e.styles.day);return Object.keys(t).forEach(function(t){var n;r=Hht(Hht({},r),null===(n=e.modifiersStyles)||void 0===n?void 0:n[t])}),r}(l,u),v=!!(u.outside&&!l.showOutsideDays||u.hidden),y=null!==(s=null===(i=l.components)||void 0===i?void 0:i.DayContent)&&void 0!==s?s:bft,g={style:m,className:f,children:t.jsx(y,{date:r,displayMonth:n,activeModifiers:u}),role:"gridcell"},x=c.focusTarget&&hit(c.focusTarget,r)&&!u.outside,b=c.focusedDay&&hit(c.focusedDay,r),k=Hht(Hht(Hht({},g),((a={disabled:u.disabled,role:"gridcell"})["aria-selected"]=u.selected,a.tabIndex=b||x?0:-1,a)),d);return{isButton:h,isHidden:v,activeModifiers:u,selectedDays:p,buttonProps:k,divProps:g}}function emt(r){var n=e.useRef(null),o=Jft(r.date,r.displayMonth,n);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(hft,Hht({name:"day",ref:n},o.buttonProps)):t.jsx("div",Hht({},o.divProps))}function tmt(e){var r=e.number,n=e.dates,o=eft(),a=o.onWeekNumberClick,i=o.styles,s=o.classNames,l=o.locale,c=o.labels.labelWeekNumber,u=(0,o.formatters.formatWeekNumber)(Number(r),{locale:l});if(!a)return t.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:u});var d=c(Number(r),{locale:l});return t.jsx(hft,{name:"week-number","aria-label":d,className:s.weeknumber,style:i.weeknumber,onClick:function(e){a(r,n,e)},children:u})}function rmt(e){var r,n,o,a=eft(),i=a.styles,s=a.classNames,l=a.showWeekNumber,c=a.components,u=null!==(r=null==c?void 0:c.Day)&&void 0!==r?r:emt,d=null!==(n=null==c?void 0:c.WeekNumber)&&void 0!==n?n:tmt;return l&&(o=t.jsx("td",{className:s.cell,style:i.cell,children:t.jsx(d,{number:e.weekNumber,dates:e.dates})})),t.jsxs("tr",{className:s.row,style:i.row,children:[o,e.dates.map(function(r){return t.jsx("td",{className:s.cell,style:i.cell,role:"presentation",children:t.jsx(u,{displayMonth:e.displayMonth,date:r})},function(e){return Math.trunc(+Yat(e)/1e3)}(r))})]})}function nmt(e,t,r){for(var n=null!=r&&r.ISOWeek?Cit(t):Mit(t,r),o=null!=r&&r.ISOWeek?oit(e):nit(e,r),a=lit(n,o),i=[],s=0;s<=a;s++)i.push(Kat(o,s));var l=i.reduce(function(e,t){var n=null!=r&&r.ISOWeek?Ait(t):Fit(t,r),o=e.find(function(e){return e.weekNumber===n});return o?(o.dates.push(t),e):(e.push({weekNumber:n,dates:[t]}),e)},[]);return l}function omt(e){var r,n,o,a=eft(),i=a.locale,s=a.classNames,l=a.styles,c=a.hideHead,u=a.fixedWeeks,d=a.components,p=a.weekStartsOn,h=a.firstWeekContainsDate,f=a.ISOWeek,m=function(e,t){var r=nmt(kit(e),xit(e),t);if(null!=t&&t.useFixedWeeks){var n=ust(e,t);if(n<6){var o=r[r.length-1],a=o.dates[o.dates.length-1],i=cit(a,6-n),s=nmt(cit(a,1),i,t);r.push.apply(r,s)}}return r}(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:f,locale:i,weekStartsOn:p,firstWeekContainsDate:h}),v=null!==(r=null==d?void 0:d.Head)&&void 0!==r?r:xft,y=null!==(n=null==d?void 0:d.Row)&&void 0!==n?n:rmt,g=null!==(o=null==d?void 0:d.Footer)&&void 0!==o?o:yft;return t.jsxs("table",{id:e.id,className:s.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&t.jsx(v,{}),t.jsx("tbody",{className:s.tbody,style:l.tbody,children:m.map(function(r){return t.jsx(y,{displayMonth:e.displayMonth,dates:r.dates,weekNumber:r.weekNumber},r.weekNumber)})}),t.jsx(g,{displayMonth:e.displayMonth})]})}var amt=typeof window<"u"&&window.document&&window.document.createElement?e.useLayoutEffect:e.useEffect,imt=!1,smt=0;function lmt(){return"react-day-picker-".concat(++smt)}function cmt(r){var n,o,a=eft(),i=a.dir,s=a.classNames,l=a.styles,c=a.components,u=cft().displayMonths,d=function(t){var r,n=t??(imt?lmt():null),o=e.useState(n),a=o[0],i=o[1];return amt(function(){null===a&&i(lmt())},[]),e.useEffect(function(){!1===imt&&(imt=!0)},[]),null!==(r=t??a)&&void 0!==r?r:void 0}(a.id?"".concat(a.id,"-").concat(r.displayIndex):void 0),p=a.id?"".concat(a.id,"-grid-").concat(r.displayIndex):void 0,h=[s.month],f=l.month,m=0===r.displayIndex,v=r.displayIndex===u.length-1,y=!m&&!v;"rtl"===i&&(v=(n=[m,v])[0],m=n[1]),m&&(h.push(s.caption_start),f=Hht(Hht({},f),l.caption_start)),v&&(h.push(s.caption_end),f=Hht(Hht({},f),l.caption_end)),y&&(h.push(s.caption_between),f=Hht(Hht({},f),l.caption_between));var g=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:vft;return t.jsxs("div",{className:h.join(" "),style:f,children:[t.jsx(g,{id:d,displayMonth:r.displayMonth,displayIndex:r.displayIndex}),t.jsx(omt,{id:p,"aria-labelledby":d,displayMonth:r.displayMonth})]},r.displayIndex)}function umt(e){var r=eft(),n=r.classNames,o=r.styles;return t.jsx("div",{className:n.months,style:o.months,children:e.children})}function dmt(r){var n,o,a=r.initialProps,i=eft(),s=Yft(),l=cft(),c=e.useState(!1),u=c[0],d=c[1];e.useEffect(function(){i.initialFocus&&s.focusTarget&&(u||(s.focus(s.focusTarget),d(!0)))},[i.initialFocus,u,s.focus,s.focusTarget,s]);var p=[i.classNames.root,i.className];i.numberOfMonths>1&&p.push(i.classNames.multiple_months),i.showWeekNumber&&p.push(i.classNames.with_weeknumber);var h=Hht(Hht({},i.styles.root),i.style),f=Object.keys(a).filter(function(e){return e.startsWith("data-")}).reduce(function(e,t){var r;return Hht(Hht({},e),((r={})[t]=a[t],r))},{}),m=null!==(o=null===(n=a.components)||void 0===n?void 0:n.Months)&&void 0!==o?o:umt;return t.jsx("div",Hht({className:p.join(" "),style:h,dir:i.dir,id:i.id,nonce:a.nonce,title:a.title,lang:a.lang},f,{children:t.jsx(m,{children:l.displayMonths.map(function(e,r){return t.jsx(cmt,{displayIndex:r,displayMonth:e},r)})})}))}function pmt(e){var r=e.children,n=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["children"]);return t.jsx(Jht,{initialProps:n,children:t.jsx(lft,{children:t.jsx(Kft,{initialProps:n,children:t.jsx(_ft,{initialProps:n,children:t.jsx(Dft,{initialProps:n,children:t.jsx(Vft,{children:t.jsx(Uft,{children:r})})})})})})})}function hmt(e){return t.jsx(pmt,Hht({},e,{children:t.jsx(dmt,{initialProps:e})}))}function fmt({className:e,classNames:r,showOutsideDays:n=!0,...o}){return t.jsx(hmt,{showOutsideDays:n,className:zdt("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:zdt(qht({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:zdt(qht({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...r},components:{IconLeft:({className:e,...r})=>t.jsx(Ust,{className:zdt("h-4 w-4",e),...r}),IconRight:({className:e,...r})=>t.jsx(Yst,{className:zdt("h-4 w-4",e),...r})},...o})}fmt.displayName="Calendar";var mmt="AlertDialog",[vmt,ymt]=flt(mmt,[eut]),gmt=eut(),xmt=e=>{const{__scopeAlertDialog:r,...n}=e,o=gmt(r);return t.jsx(Tut,{...o,...n,modal:!0})};xmt.displayName=mmt;var bmt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=gmt(n);return t.jsx(Eut,{...a,...o,ref:r})});bmt.displayName="AlertDialogTrigger";var kmt=e=>{const{__scopeAlertDialog:r,...n}=e,o=gmt(r);return t.jsx(Nut,{...o,...n})};kmt.displayName="AlertDialogPortal";var _mt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=gmt(n);return t.jsx(zut,{...a,...o,ref:r})});_mt.displayName="AlertDialogOverlay";var wmt="AlertDialogContent",[Mmt,Cmt]=vmt(wmt),jmt=jlt("AlertDialogContent"),Dmt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,children:o,...a}=e,i=gmt(n),l=s.useRef(null),c=hlt(r,l),u=s.useRef(null);return t.jsx(Dut,{contentName:wmt,titleName:Omt,docsSlug:"alert-dialog",children:t.jsx(Mmt,{scope:n,cancelRef:u,children:t.jsxs(Aut,{role:"alertdialog",...i,...a,ref:c,onOpenAutoFocus:ult(a.onOpenAutoFocus,e=>{var t;e.preventDefault(),null==(t=u.current)||t.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[t.jsx(jmt,{children:o}),t.jsx(Amt,{contentRef:l})]})})})});Dmt.displayName=wmt;var Omt="AlertDialogTitle",Smt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=gmt(n);return t.jsx(Rut,{...a,...o,ref:r})});Smt.displayName=Omt;var Pmt="AlertDialogDescription",Tmt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=gmt(n);return t.jsx(Fut,{...a,...o,ref:r})});Tmt.displayName=Pmt;var Emt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=gmt(n);return t.jsx(Lut,{...a,...o,ref:r})});Emt.displayName="AlertDialogAction";var Nmt="AlertDialogCancel",zmt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,{cancelRef:a}=Cmt(Nmt,n),i=gmt(n),s=hlt(r,a);return t.jsx(Lut,{...i,...o,ref:s})});zmt.displayName=Nmt;var Amt=({contentRef:e})=>{const t=`\`${wmt}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${wmt}\` by passing a \`${Pmt}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${wmt}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return s.useEffect(()=>{var r;document.getElementById(null==(r=e.current)?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Rmt=_mt,Fmt=Dmt,Lmt=Emt,Bmt=zmt,Vmt=Smt,Imt=Tmt;const qmt=xmt,$mt=bmt,Hmt=kmt,Wmt=s.forwardRef(({className:e,...r},n)=>t.jsx(Rmt,{className:zdt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r,ref:n}));Wmt.displayName=Rmt.displayName;const Umt=s.forwardRef(({className:e,...r},n)=>t.jsxs(Hmt,{children:[t.jsx(Wmt,{}),t.jsx(Fmt,{ref:n,className:zdt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r})]}));Umt.displayName=Fmt.displayName;const Ymt=({className:e,...r})=>t.jsx("div",{className:zdt("flex flex-col space-y-2 text-center sm:text-left",e),...r});Ymt.displayName="AlertDialogHeader";const Zmt=({className:e,...r})=>t.jsx("div",{className:zdt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});Zmt.displayName="AlertDialogFooter";const Kmt=s.forwardRef(({className:e,...r},n)=>t.jsx(Vmt,{ref:n,className:zdt("text-lg font-semibold",e),...r}));Kmt.displayName=Vmt.displayName;const Gmt=s.forwardRef(({className:e,...r},n)=>t.jsx(Imt,{ref:n,className:zdt("text-sm text-muted-foreground",e),...r}));Gmt.displayName=Imt.displayName;const Xmt=s.forwardRef(({className:e,...r},n)=>t.jsx(Lmt,{ref:n,className:zdt(qht(),e),...r}));Xmt.displayName=Lmt.displayName;const Qmt=s.forwardRef(({className:e,...r},n)=>t.jsx(Bmt,{ref:n,className:zdt(qht({variant:"outline"}),"mt-2 sm:mt-0",e),...r}));function Jmt(e){const r=e+"CollectionProvider",[n,o]=flt(r),[a,i]=n(r,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:r,children:n}=e,o=l.default.useRef(null),i=l.default.useRef(new Map).current;return t.jsx(a,{scope:r,itemMap:i,collectionRef:o,children:n})};s.displayName=r;const c=e+"CollectionSlot",u=_lt(c),d=l.default.forwardRef((e,r)=>{const{scope:n,children:o}=e,a=hlt(r,i(c,n).collectionRef);return t.jsx(u,{ref:a,children:o})});d.displayName=c;const p=e+"CollectionItemSlot",h="data-radix-collection-item",f=_lt(p),m=l.default.forwardRef((e,r)=>{const{scope:n,children:o,...a}=e,s=l.default.useRef(null),c=hlt(r,s),u=i(p,n);return l.default.useEffect(()=>(u.itemMap.set(s,{ref:s,...a}),()=>{u.itemMap.delete(s)})),t.jsx(f,{[h]:"",ref:c,children:o})});return m.displayName=p,[{Provider:s,Slot:d,ItemSlot:m},function(t){const r=i(e+"CollectionConsumer",t);return l.default.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},o]}Qmt.displayName=Bmt.displayName;var evt=s.createContext(void 0);function tvt(e){const t=s.useContext(evt);return e||t||"ltr"}var rvt="rovingFocusGroup.onEntryFocus",nvt={bubbles:!1,cancelable:!0},ovt="RovingFocusGroup",[avt,ivt,svt]=Jmt(ovt),[lvt,cvt]=flt(ovt,[svt]),[uvt,dvt]=lvt(ovt),pvt=s.forwardRef((e,r)=>t.jsx(avt.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(avt.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(hvt,{...e,ref:r})})}));pvt.displayName=ovt;var hvt=s.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...h}=e,f=s.useRef(null),m=hlt(r,f),v=tvt(i),[y,g]=klt({prop:l,defaultProp:c??null,onChange:u,caller:ovt}),[x,b]=s.useState(!1),k=Plt(d),_=ivt(n),w=s.useRef(!1),[M,C]=s.useState(0);return s.useEffect(()=>{const e=f.current;if(e)return e.addEventListener(rvt,k),()=>e.removeEventListener(rvt,k)},[k]),t.jsx(uvt,{scope:n,orientation:o,dir:v,loop:a,currentTabStopId:y,onItemFocus:s.useCallback(e=>g(e),[g]),onItemShiftTab:s.useCallback(()=>b(!0),[]),onFocusableItemAdd:s.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:s.useCallback(()=>C(e=>e-1),[]),children:t.jsx(Olt.div,{tabIndex:x||0===M?-1:0,"data-orientation":o,...h,ref:m,style:{outline:"none",...e.style},onMouseDown:ult(e.onMouseDown,()=>{w.current=!0}),onFocus:ult(e.onFocus,e=>{const t=!w.current;if(e.target===e.currentTarget&&t&&!x){const t=new CustomEvent(rvt,nvt);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=_().filter(e=>e.focusable),t=e.find(e=>e.active),r=e.find(e=>e.id===y),n=[t,r,...e].filter(Boolean).map(e=>e.ref.current);yvt(n,p)}}w.current=!1}),onBlur:ult(e.onBlur,()=>b(!1))})})}),fvt="RovingFocusGroupItem",mvt=s.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:a=!1,tabStopId:i,children:l,...c}=e,u=xlt(),d=i||u,p=dvt(fvt,n),h=p.currentTabStopId===d,f=ivt(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:y}=p;return s.useEffect(()=>{if(o)return m(),()=>v()},[o,m,v]),t.jsx(avt.ItemSlot,{scope:n,id:d,focusable:o,active:a,children:t.jsx(Olt.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:r,onMouseDown:ult(e.onMouseDown,e=>{o?p.onItemFocus(d):e.preventDefault()}),onFocus:ult(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:ult(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return vvt[n]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=p.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>yvt(r))}}),children:"function"==typeof l?l({isCurrentTabStop:h,hasTabStop:null!=y}):l})})});mvt.displayName=fvt;var vvt={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function yvt(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var gvt=pvt,xvt=mvt;function bvt(e){const[t,r]=s.useState(void 0);return vlt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;const n=t[0];let o,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=e.offsetWidth,a=e.offsetHeight;r({width:o,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}function kvt(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var _vt="Radio",[wvt,Mvt]=flt(_vt),[Cvt,jvt]=wvt(_vt),Dvt=s.forwardRef((e,r)=>{const{__scopeRadio:n,name:o,checked:a=!1,required:i,disabled:l,value:c="on",onCheck:u,form:d,...p}=e,[h,f]=s.useState(null),m=hlt(r,e=>f(e)),v=s.useRef(!1),y=!h||(d||!!h.closest("form"));return t.jsxs(Cvt,{scope:n,checked:a,disabled:l,children:[t.jsx(Olt.button,{type:"button",role:"radio","aria-checked":a,"data-state":Tvt(a),"data-disabled":l?"":void 0,disabled:l,value:c,...p,ref:m,onClick:ult(e.onClick,e=>{a||null==u||u(),y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),y&&t.jsx(Pvt,{control:h,bubbles:!v.current,name:o,value:c,checked:a,required:i,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});Dvt.displayName=_vt;var Ovt="RadioIndicator",Svt=s.forwardRef((e,r)=>{const{__scopeRadio:n,forceMount:o,...a}=e,i=jvt(Ovt,n);return t.jsx(Xlt,{present:o||i.checked,children:t.jsx(Olt.span,{"data-state":Tvt(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:r})})});Svt.displayName=Ovt;var Pvt=s.forwardRef(({__scopeRadio:e,control:r,checked:n,bubbles:o=!0,...a},i)=>{const l=s.useRef(null),c=hlt(l,i),u=kvt(n),d=bvt(r);return s.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[u,n,o]),t.jsx(Olt.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:c,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Tvt(e){return e?"checked":"unchecked"}Pvt.displayName="RadioBubbleInput";var Evt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Nvt="RadioGroup",[zvt,Avt]=flt(Nvt,[cvt,Mvt]),Rvt=cvt(),Fvt=Mvt(),[Lvt,Bvt]=zvt(Nvt),Vvt=s.forwardRef((e,r)=>{const{__scopeRadioGroup:n,name:o,defaultValue:a,value:i,required:s=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:p,...h}=e,f=Rvt(n),m=tvt(u),[v,y]=klt({prop:i,defaultProp:a??null,onChange:p,caller:Nvt});return t.jsx(Lvt,{scope:n,name:o,required:s,disabled:l,value:v,onValueChange:y,children:t.jsx(gvt,{asChild:!0,...f,orientation:c,dir:m,loop:d,children:t.jsx(Olt.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":l?"":void 0,dir:m,...h,ref:r})})})});Vvt.displayName=Nvt;var Ivt="RadioGroupItem",qvt=s.forwardRef((e,r)=>{const{__scopeRadioGroup:n,disabled:o,...a}=e,i=Bvt(Ivt,n),l=i.disabled||o,c=Rvt(n),u=Fvt(n),d=s.useRef(null),p=hlt(r,d),h=i.value===a.value,f=s.useRef(!1);return s.useEffect(()=>{const e=e=>{Evt.includes(e.key)&&(f.current=!0)},t=()=>f.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),t.jsx(xvt,{asChild:!0,...c,focusable:!l,active:h,children:t.jsx(Dvt,{disabled:l,required:i.required,checked:h,...u,...a,name:i.name,ref:p,onCheck:()=>i.onValueChange(a.value),onKeyDown:ult(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:ult(a.onFocus,()=>{var e;f.current&&(null==(e=d.current)||e.click())})})})});qvt.displayName=Ivt;var $vt=s.forwardRef((e,r)=>{const{__scopeRadioGroup:n,...o}=e,a=Fvt(n);return t.jsx(Svt,{...a,...o,ref:r})});$vt.displayName="RadioGroupIndicator";var Hvt=Vvt,Wvt=qvt,Uvt=$vt;const Yvt=s.forwardRef(({className:e,...r},n)=>t.jsx(Hvt,{className:zdt("grid gap-2",e),...r,ref:n}));Yvt.displayName=Hvt.displayName;const Zvt=s.forwardRef(({className:e,...r},n)=>t.jsx(Wvt,{ref:n,className:zdt("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:t.jsx(Uvt,{className:"flex items-center justify-center",children:t.jsx(Xst,{className:"h-3.5 w-3.5 fill-primary"})})}));Zvt.displayName=Wvt.displayName;var Kvt=s.forwardRef((e,r)=>t.jsx(Olt.label,{...e,ref:r,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Kvt.displayName="Label";var Gvt=Kvt;const Xvt=Iht("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Qvt=s.forwardRef(({className:e,...r},n)=>t.jsx(Gvt,{ref:n,className:zdt(Xvt(),e),...r}));Qvt.displayName=Gvt.displayName;const Jvt=e=>{const{children:t,...r}=e;return l.default.createElement(Vpt.Provider,{value:r},t)},eyt=s.createContext({}),tyt=({...e})=>t.jsx(eyt.Provider,{value:{name:e.name},children:t.jsx(Ypt,{...e})}),ryt=()=>{const e=s.useContext(eyt),t=s.useContext(nyt),{getFieldState:r,formState:n}=Ipt(),o=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...o}},nyt=s.createContext({}),oyt=s.forwardRef(({className:e,...r},n)=>{const o=s.useId();return t.jsx(nyt.Provider,{value:{id:o},children:t.jsx("div",{ref:n,className:zdt("space-y-2",e),...r})})});oyt.displayName="FormItem";const ayt=s.forwardRef(({className:e,...r},n)=>{const{error:o,formItemId:a}=ryt();return t.jsx(Qvt,{ref:n,className:zdt(o&&"text-destructive",e),htmlFor:a,...r})});ayt.displayName="FormLabel";const iyt=s.forwardRef(({...e},r)=>{const{error:n,formItemId:o,formDescriptionId:a,formMessageId:i}=ryt();return t.jsx(wlt,{ref:r,id:o,"aria-describedby":n?`${a} ${i}`:`${a}`,"aria-invalid":!!n,...e})});iyt.displayName="FormControl";const syt=s.forwardRef(({className:e,...r},n)=>{const{formDescriptionId:o}=ryt();return t.jsx("p",{ref:n,id:o,className:zdt("text-sm text-muted-foreground",e),...r})});syt.displayName="FormDescription";const lyt=s.forwardRef(({className:e,children:r,...n},o)=>{const{error:a,formMessageId:i}=ryt(),s=a?String(null==a?void 0:a.message):r;return s?t.jsx("p",{ref:o,id:i,className:zdt("text-sm font-medium text-destructive",e),...n,children:s}):null});lyt.displayName="FormMessage";const cyt=s.forwardRef(({className:e,type:r,...n},o)=>t.jsx("input",{type:r,className:zdt("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...n}));cyt.displayName="Input";const uyt=["top","right","bottom","left"],dyt=Math.min,pyt=Math.max,hyt=Math.round,fyt=Math.floor,myt=e=>({x:e,y:e}),vyt={left:"right",right:"left",bottom:"top",top:"bottom"},yyt={start:"end",end:"start"};function gyt(e,t,r){return pyt(e,dyt(t,r))}function xyt(e,t){return"function"==typeof e?e(t):e}function byt(e){return e.split("-")[0]}function kyt(e){return e.split("-")[1]}function _yt(e){return"x"===e?"y":"x"}function wyt(e){return"y"===e?"height":"width"}const Myt=new Set(["top","bottom"]);function Cyt(e){return Myt.has(byt(e))?"y":"x"}function jyt(e){return _yt(Cyt(e))}function Dyt(e){return e.replace(/start|end/g,e=>yyt[e])}const Oyt=["left","right"],Syt=["right","left"],Pyt=["top","bottom"],Tyt=["bottom","top"];function Eyt(e,t,r,n){const o=kyt(e);let a=function(e,t,r){switch(e){case"top":case"bottom":return r?t?Syt:Oyt:t?Oyt:Syt;case"left":case"right":return t?Pyt:Tyt;default:return[]}}(byt(e),"start"===r,n);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(Dyt)))),a}function Nyt(e){return e.replace(/left|right|bottom|top/g,e=>vyt[e])}function zyt(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Ayt(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Ryt(e,t,r){let{reference:n,floating:o}=e;const a=Cyt(t),i=jyt(t),s=wyt(i),l=byt(t),c="y"===a,u=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,p=n[s]/2-o[s]/2;let h;switch(l){case"top":h={x:u,y:n.y-o.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-o.width,y:d};break;default:h={x:n.x,y:n.y}}switch(kyt(t)){case"start":h[i]-=p*(r&&c?-1:1);break;case"end":h[i]+=p*(r&&c?-1:1)}return h}async function Fyt(e,t){var r;void 0===t&&(t={});const{x:n,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=xyt(t,e),f=zyt(h),m=s[p?"floating"===d?"reference":"floating":d],v=Ayt(await a.getClippingRect({element:null==(r=await(null==a.isElement?void 0:a.isElement(m)))||r?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,g=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),x=await(null==a.isElement?void 0:a.isElement(g))&&await(null==a.getScale?void 0:a.getScale(g))||{x:1,y:1},b=Ayt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:g,strategy:l}):y);return{top:(v.top-b.top+f.top)/x.y,bottom:(b.bottom-v.bottom+f.bottom)/x.y,left:(v.left-b.left+f.left)/x.x,right:(b.right-v.right+f.right)/x.x}}function Lyt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Byt(e){return uyt.some(t=>e[t]>=0)}const Vyt=new Set(["left","top"]);function Iyt(){return typeof window<"u"}function qyt(e){return Wyt(e)?(e.nodeName||"").toLowerCase():"#document"}function $yt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Hyt(e){var t;return null==(t=(Wyt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Wyt(e){return!!Iyt()&&(e instanceof Node||e instanceof $yt(e).Node)}function Uyt(e){return!!Iyt()&&(e instanceof Element||e instanceof $yt(e).Element)}function Yyt(e){return!!Iyt()&&(e instanceof HTMLElement||e instanceof $yt(e).HTMLElement)}function Zyt(e){return!(!Iyt()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof $yt(e).ShadowRoot)}const Kyt=new Set(["inline","contents"]);function Gyt(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=lgt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Kyt.has(o)}const Xyt=new Set(["table","td","th"]);function Qyt(e){return Xyt.has(qyt(e))}const Jyt=[":popover-open",":modal"];function egt(e){return Jyt.some(t=>{try{return e.matches(t)}catch{return!1}})}const tgt=["transform","translate","scale","rotate","perspective"],rgt=["transform","translate","scale","rotate","perspective","filter"],ngt=["paint","layout","strict","content"];function ogt(e){const t=agt(),r=Uyt(e)?lgt(e):e;return tgt.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||rgt.some(e=>(r.willChange||"").includes(e))||ngt.some(e=>(r.contain||"").includes(e))}function agt(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const igt=new Set(["html","body","#document"]);function sgt(e){return igt.has(qyt(e))}function lgt(e){return $yt(e).getComputedStyle(e)}function cgt(e){return Uyt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ugt(e){if("html"===qyt(e))return e;const t=e.assignedSlot||e.parentNode||Zyt(e)&&e.host||Hyt(e);return Zyt(t)?t.host:t}function dgt(e){const t=ugt(e);return sgt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Yyt(t)&&Gyt(t)?t:dgt(t)}function pgt(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const o=dgt(e),a=o===(null==(n=e.ownerDocument)?void 0:n.body),i=$yt(o);if(a){const e=hgt(i);return t.concat(i,i.visualViewport||[],Gyt(o)?o:[],e&&r?pgt(e):[])}return t.concat(o,pgt(o,[],r))}function hgt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fgt(e){const t=lgt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Yyt(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,s=hyt(r)!==a||hyt(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function mgt(e){return Uyt(e)?e:e.contextElement}function vgt(e){const t=mgt(e);if(!Yyt(t))return myt(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=fgt(t);let i=(a?hyt(r.width):r.width)/n,s=(a?hyt(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const ygt=myt(0);function ggt(e){const t=$yt(e);return agt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ygt}function xgt(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const o=e.getBoundingClientRect(),a=mgt(e);let i=myt(1);t&&(n?Uyt(n)&&(i=vgt(n)):i=vgt(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==$yt(e))&&t}(a,r,n)?ggt(a):myt(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){const e=$yt(a),t=n&&Uyt(n)?$yt(n):n;let r=e,o=hgt(r);for(;o&&n&&t!==r;){const e=vgt(o),t=o.getBoundingClientRect(),n=lgt(o),a=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,r=$yt(o),o=hgt(r)}}return Ayt({width:u,height:d,x:l,y:c})}function bgt(e,t){const r=cgt(e).scrollLeft;return t?t.left+r:xgt(Hyt(e)).left+r}function kgt(e,t,r){void 0===r&&(r=!1);const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-(r?0:bgt(e,n)),y:n.top+t.scrollTop}}const _gt=new Set(["absolute","fixed"]);function wgt(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=$yt(e),n=Hyt(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const e=agt();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}(e,r);else if("document"===t)n=function(e){const t=Hyt(e),r=cgt(e),n=e.ownerDocument.body,o=pyt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=pyt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+bgt(e);const s=-r.scrollTop;return"rtl"===lgt(n).direction&&(i+=pyt(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}(Hyt(e));else if(Uyt(t))n=function(e,t){const r=xgt(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=Yyt(e)?vgt(e):myt(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:n*a.y}}(t,r);else{const r=ggt(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Ayt(n)}function Mgt(e,t){const r=ugt(e);return!(r===t||!Uyt(r)||sgt(r))&&("fixed"===lgt(r).position||Mgt(r,t))}function Cgt(e,t){const r=t.get(e);if(r)return r;let n=pgt(e,[],!1).filter(e=>Uyt(e)&&"body"!==qyt(e)),o=null;const a="fixed"===lgt(e).position;let i=a?ugt(e):e;for(;Uyt(i)&&!sgt(i);){const t=lgt(i),r=ogt(i);!r&&"fixed"===t.position&&(o=null),(a?!r&&!o:!r&&"static"===t.position&&o&&_gt.has(o.position)||Gyt(i)&&!r&&Mgt(e,i))?n=n.filter(e=>e!==i):o=t,i=ugt(i)}return t.set(e,n),n}function jgt(e,t,r){const n=Yyt(t),o=Hyt(t),a="fixed"===r,i=xgt(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=myt(0);function c(){l.x=bgt(o)}if(n||!n&&!a)if(("body"!==qyt(t)||Gyt(o))&&(s=cgt(t)),n){const e=xgt(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();a&&!n&&o&&c();const u=!o||n||a?myt(0):kgt(o,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function Dgt(e){return"static"===lgt(e).position}function Ogt(e,t){if(!Yyt(e)||"fixed"===lgt(e).position)return null;if(t)return t(e);let r=e.offsetParent;return Hyt(e)===r&&(r=r.ownerDocument.body),r}function Sgt(e,t){const r=$yt(e);if(egt(e))return r;if(!Yyt(e)){let t=ugt(e);for(;t&&!sgt(t);){if(Uyt(t)&&!Dgt(t))return t;t=ugt(t)}return r}let n=Ogt(e,t);for(;n&&Qyt(n)&&Dgt(n);)n=Ogt(n,t);return n&&sgt(n)&&Dgt(n)&&!ogt(n)?r:n||function(e){let t=ugt(e);for(;Yyt(t)&&!sgt(t);){if(ogt(t))return t;if(egt(t))return null;t=ugt(t)}return null}(e)||r}const Pgt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a="fixed"===o,i=Hyt(n),s=!!t&&egt(t.floating);if(n===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},c=myt(1);const u=myt(0),d=Yyt(n);if((d||!d&&!a)&&(("body"!==qyt(n)||Gyt(i))&&(l=cgt(n)),Yyt(n))){const e=xgt(n);c=vgt(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const p=!i||d||a?myt(0):kgt(i,l,!0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:r.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:Hyt,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[..."clippingAncestors"===r?egt(t)?[]:Cgt(t,this._c):[].concat(r),n],i=a[0],s=a.reduce((e,r)=>{const n=wgt(t,r,o);return e.top=pyt(n.top,e.top),e.right=dyt(n.right,e.right),e.bottom=dyt(n.bottom,e.bottom),e.left=pyt(n.left,e.left),e},wgt(t,i,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Sgt,getElementRects:async function(e){const t=this.getOffsetParent||Sgt,r=this.getDimensions,n=await r(e.floating);return{reference:jgt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=fgt(e);return{width:t,height:r}},getScale:vgt,isElement:Uyt,isRTL:function(e){return"rtl"===lgt(e).direction}};function Tgt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Egt(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=mgt(e),u=o||a?[...c?pgt(c):[],...pgt(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});const d=c&&s?function(e,t){let r,n=null;const o=Hyt(e);function a(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(s||t(),!p||!h)return;const f={rootMargin:-fyt(d)+"px "+-fyt(o.clientWidth-(u+p))+"px "+-fyt(o.clientHeight-(d+h))+"px "+-fyt(u)+"px",threshold:pyt(0,dyt(1,l))||1};let m=!0;function v(t){const n=t[0].intersectionRatio;if(n!==l){if(!m)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1===n&&!Tgt(c,e.getBoundingClientRect())&&i(),m=!1}try{n=new IntersectionObserver(v,{...f,root:o.ownerDocument})}catch{n=new IntersectionObserver(v,f)}n.observe(e)}(!0),a}(c,r):null;let p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),c&&!l&&h.observe(c),h.observe(t));let f,m=l?xgt(e):null;return l&&function t(){const n=xgt(e);m&&!Tgt(m,n)&&r(),m=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Ngt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:r,platform:n,elements:o}=e,a=await(null==n.isRTL?void 0:n.isRTL(o.floating)),i=byt(r),s=kyt(r),l="y"===Cyt(r),c=Vyt.has(i)?-1:1,u=a&&l?-1:1,d=xyt(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}(t,e);return i===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},zgt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=xyt(e,t),c={x:r,y:n},u=await Fyt(t,l),d=Cyt(byt(o)),p=_yt(d);let h=c[p],f=c[d];if(a){const e="y"===p?"bottom":"right";h=gyt(h+u["y"===p?"top":"left"],h,h-u[e])}if(i){const e="y"===d?"bottom":"right";f=gyt(f+u["y"===d?"top":"left"],f,f-u[e])}const m=s.fn({...t,[p]:h,[d]:f});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[p]:a,[d]:i}}}}}},Agt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...v}=xyt(e,t);if(null!=(r=a.arrow)&&r.alignmentOffset)return{};const y=byt(o),g=Cyt(s),x=byt(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),k=p||(x||!m?[Nyt(s)]:function(e){const t=Nyt(e);return[Dyt(e),t,Dyt(t)]}(s)),_="none"!==f;!p&&_&&k.push(...Eyt(s,m,f,b));const w=[s,...k],M=await Fyt(t,v),C=[];let j=(null==(n=a.flip)?void 0:n.overflows)||[];if(u&&C.push(M[y]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=kyt(e),o=jyt(e),a=wyt(o);let i="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Nyt(i)),[i,Nyt(i)]}(o,i,b);C.push(M[e[0]],M[e[1]])}if(j=[...j,{placement:o,overflows:C}],!C.every(e=>e<=0)){var D,O;const e=((null==(D=a.flip)?void 0:D.index)||0)+1,t=w[e];if(t&&("alignment"!==d||g===Cyt(t)||j.every(e=>e.overflows[0]>0&&Cyt(e.placement)===g)))return{data:{index:e,overflows:j},reset:{placement:t}};let r=null==(O=j.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:O.placement;if(!r)switch(h){case"bestFit":{var S;const e=null==(S=j.filter(e=>{if(_){const t=Cyt(e.placement);return t===g||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:S[0];e&&(r=e);break}case"initialPlacement":r=s}if(o!==r)return{reset:{placement:r}}}return{}}}},Rgt=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=xyt(e,t),u=await Fyt(t,c),d=byt(o),p=kyt(o),h="y"===Cyt(o),{width:f,height:m}=a.floating;let v,y;"top"===d||"bottom"===d?(v=d,y=p===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,v="end"===p?"top":"bottom");const g=m-u.top-u.bottom,x=f-u.left-u.right,b=dyt(m-u[v],g),k=dyt(f-u[y],x),_=!t.middlewareData.shift;let w=b,M=k;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(M=x),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(w=g),_&&!p){const e=pyt(u.left,0),t=pyt(u.right,0),r=pyt(u.top,0),n=pyt(u.bottom,0);h?M=f-2*(0!==e||0!==t?e+t:pyt(u.left,u.right)):w=m-2*(0!==r||0!==n?r+n:pyt(u.top,u.bottom))}await l({...t,availableWidth:M,availableHeight:w});const C=await i.getDimensions(s.floating);return f!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},Fgt=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=xyt(e,t);switch(n){case"referenceHidden":{const e=Lyt(await Fyt(t,{...o,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Byt(e)}}}case"escaped":{const e=Lyt(await Fyt(t,{...o,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:Byt(e)}}}default:return{}}}}},Lgt=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=xyt(e,t)||{};if(null==c)return{};const d=zyt(u),p={x:r,y:n},h=jyt(o),f=wyt(h),m=await i.getDimensions(c),v="y"===h,y=v?"top":"left",g=v?"bottom":"right",x=v?"clientHeight":"clientWidth",b=a.reference[f]+a.reference[h]-p[h]-a.floating[f],k=p[h]-a.reference[h],_=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let w=_?_[x]:0;(!w||!await(null==i.isElement?void 0:i.isElement(_)))&&(w=s.floating[x]||a.floating[f]);const M=b/2-k/2,C=w/2-m[f]/2-1,j=dyt(d[y],C),D=dyt(d[g],C),O=j,S=w-m[f]-D,P=w/2-m[f]/2+M,T=gyt(O,P,S),E=!l.arrow&&null!=kyt(o)&&P!==T&&a.reference[f]/2-(P<O?j:D)-m[f]/2<0,N=E?P<O?P-O:P-S:0;return{[h]:p[h]+N,data:{[h]:T,centerOffset:P-T-N,...E&&{alignmentOffset:N}},reset:E}}}),Bgt=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=xyt(e,t),u={x:r,y:n},d=Cyt(o),p=_yt(d);let h=u[p],f=u[d];const m=xyt(s,t),v="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=a.reference[p]-a.floating[e]+v.mainAxis,r=a.reference[p]+a.reference[e]-v.mainAxis;h<t?h=t:h>r&&(h=r)}if(c){var y,g;const e="y"===p?"width":"height",t=Vyt.has(byt(o)),r=a.reference[d]-a.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:v.crossAxis),n=a.reference[d]+a.reference[e]+(t?0:(null==(g=i.offset)?void 0:g[d])||0)-(t?v.crossAxis:0);f<r?f=r:f>n&&(f=n)}return{[p]:h,[d]:f}}}},Vgt=(e,t,r)=>{const n=new Map,o={platform:Pgt,...r},a={...o.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Ryt(c,n,l),p=n,h={},f=0;for(let r=0;r<s.length;r++){const{name:a,fn:m}=s[r],{x:v,y:y,data:g,reset:x}=await m({x:u,y:d,initialPlacement:n,placement:p,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});u=v??u,d=y??d,h={...h,[a]:{...h[a],...g}},x&&f<=50&&(f++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(c=!0===x.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:u,y:d}=Ryt(c,p,l))),r=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:a})};var Igt=typeof document<"u"?e.useLayoutEffect:function(){};function qgt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!qgt(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!==n--;){const r=o[n];if(!("_owner"===r&&e.$$typeof||qgt(e[r],t[r])))return!1}return!0}return e!=e&&t!=t}function $gt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hgt(e,t){const r=$gt(e);return Math.round(t*r)/r}function Wgt(e){const t=s.useRef(e);return Igt(()=>{t.current=e}),t}const Ugt=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&function(e){return{}.hasOwnProperty.call(e,"current")}(r)?null!=r.current?Lgt({element:r.current,padding:n}).fn(t):{}:r?Lgt({element:r,padding:n}).fn(t):{}}}),Ygt=(e,t)=>({...Ngt(e),options:[e,t]}),Zgt=(e,t)=>({...zgt(e),options:[e,t]}),Kgt=(e,t)=>({...Bgt(e),options:[e,t]}),Ggt=(e,t)=>({...Agt(e),options:[e,t]}),Xgt=(e,t)=>({...Rgt(e),options:[e,t]}),Qgt=(e,t)=>({...Fgt(e),options:[e,t]}),Jgt=(e,t)=>({...Ugt(e),options:[e,t]});var ext=s.forwardRef((e,r)=>{const{children:n,width:o=10,height:a=5,...i}=e;return t.jsx(Olt.svg,{...i,ref:r,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});ext.displayName="Arrow";var txt=ext,rxt="Popper",[nxt,oxt]=flt(rxt),[axt,ixt]=nxt(rxt),sxt=e=>{const{__scopePopper:r,children:n}=e,[o,a]=s.useState(null);return t.jsx(axt,{scope:r,anchor:o,onAnchorChange:a,children:n})};sxt.displayName=rxt;var lxt="PopperAnchor",cxt=s.forwardRef((e,r)=>{const{__scopePopper:n,virtualRef:o,...a}=e,i=ixt(lxt,n),l=s.useRef(null),c=hlt(r,l);return s.useEffect(()=>{i.onAnchorChange((null==o?void 0:o.current)||l.current)}),o?null:t.jsx(Olt.div,{...a,ref:c})});cxt.displayName=lxt;var uxt="PopperContent",[dxt,pxt]=nxt(uxt),hxt=s.forwardRef((e,r)=>{var n,o,a,i,l,c;const{__scopePopper:u,side:p="bottom",sideOffset:h=0,align:f="center",alignOffset:m=0,arrowPadding:v=0,avoidCollisions:y=!0,collisionBoundary:g=[],collisionPadding:x=0,sticky:b="partial",hideWhenDetached:k=!1,updatePositionStrategy:_="optimized",onPlaced:w,...M}=e,C=ixt(uxt,u),[j,D]=s.useState(null),O=hlt(r,e=>D(e)),[S,P]=s.useState(null),T=bvt(S),E=(null==T?void 0:T.width)??0,N=(null==T?void 0:T.height)??0,z=p+("center"!==f?"-"+f:""),A="number"==typeof x?x:{top:0,right:0,bottom:0,left:0,...x},R=Array.isArray(g)?g:[g],F=R.length>0,L={padding:A,boundary:R.filter(yxt),altBoundary:F},{refs:B,floatingStyles:V,placement:I,isPositioned:q,middlewareData:$}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[p,h]=s.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=s.useState(n);qgt(f,n)||m(n);const[v,y]=s.useState(null),[g,x]=s.useState(null),b=s.useCallback(e=>{e!==M.current&&(M.current=e,y(e))},[]),k=s.useCallback(e=>{e!==C.current&&(C.current=e,x(e))},[]),_=a||v,w=i||g,M=s.useRef(null),C=s.useRef(null),j=s.useRef(p),D=null!=c,O=Wgt(c),S=Wgt(o),P=Wgt(u),T=s.useCallback(()=>{if(!M.current||!C.current)return;const e={placement:t,strategy:r,middleware:f};S.current&&(e.platform=S.current),Vgt(M.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};E.current&&!qgt(j.current,t)&&(j.current=t,d.flushSync(()=>{h(t)}))})},[f,t,r,S,P]);Igt(()=>{!1===u&&j.current.isPositioned&&(j.current.isPositioned=!1,h(e=>({...e,isPositioned:!1})))},[u]);const E=s.useRef(!1);Igt(()=>(E.current=!0,()=>{E.current=!1}),[]),Igt(()=>{if(_&&(M.current=_),w&&(C.current=w),_&&w){if(O.current)return O.current(_,w,T);T()}},[_,w,T,O,D]);const N=s.useMemo(()=>({reference:M,floating:C,setReference:b,setFloating:k}),[b,k]),z=s.useMemo(()=>({reference:_,floating:w}),[_,w]),A=s.useMemo(()=>{const e={position:r,left:0,top:0};if(!z.floating)return e;const t=Hgt(z.floating,p.x),n=Hgt(z.floating,p.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...$gt(z.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,z.floating,p.x,p.y]);return s.useMemo(()=>({...p,update:T,refs:N,elements:z,floatingStyles:A}),[p,T,N,z,A])}({strategy:"fixed",placement:z,whileElementsMounted:(...e)=>Egt(...e,{animationFrame:"always"===_}),elements:{reference:C.anchor},middleware:[Ygt({mainAxis:h+N,alignmentAxis:m}),y&&Zgt({mainAxis:!0,crossAxis:!1,limiter:"partial"===b?Kgt():void 0,...L}),y&&Ggt({...L}),Xgt({...L,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),S&&Jgt({element:S,padding:v}),gxt({arrowWidth:E,arrowHeight:N}),k&&Qgt({strategy:"referenceHidden",...L})]}),[H,W]=xxt(I),U=Plt(w);vlt(()=>{q&&(null==U||U())},[q,U]);const Y=null==(n=$.arrow)?void 0:n.x,Z=null==(o=$.arrow)?void 0:o.y,K=0!==(null==(a=$.arrow)?void 0:a.centerOffset),[G,X]=s.useState();return vlt(()=>{j&&X(window.getComputedStyle(j).zIndex)},[j]),t.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:q?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[null==(i=$.transformOrigin)?void 0:i.x,null==(l=$.transformOrigin)?void 0:l.y].join(" "),...(null==(c=$.hide)?void 0:c.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(dxt,{scope:u,placedSide:H,onArrowChange:P,arrowX:Y,arrowY:Z,shouldHideArrow:K,children:t.jsx(Olt.div,{"data-side":H,"data-align":W,...M,ref:O,style:{...M.style,animation:q?void 0:"none"}})})})});hxt.displayName=uxt;var fxt="PopperArrow",mxt={top:"bottom",right:"left",bottom:"top",left:"right"},vxt=s.forwardRef(function(e,r){const{__scopePopper:n,...o}=e,a=pxt(fxt,n),i=mxt[a.placedSide];return t.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t.jsx(txt,{...o,ref:r,style:{...o.style,display:"block"}})})});function yxt(e){return null!==e}vxt.displayName=fxt;var gxt=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o;const{placement:a,rects:i,middlewareData:s}=t,l=0!==(null==(r=s.arrow)?void 0:r.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,p]=xxt(a),h={start:"0%",center:"50%",end:"100%"}[p],f=((null==(n=s.arrow)?void 0:n.x)??0)+c/2,m=((null==(o=s.arrow)?void 0:o.y)??0)+u/2;let v="",y="";return"bottom"===d?(v=l?h:`${f}px`,y=-u+"px"):"top"===d?(v=l?h:`${f}px`,y=`${i.floating.height+u}px`):"right"===d?(v=-u+"px",y=l?h:`${m}px`):"left"===d&&(v=`${i.floating.width+u}px`,y=l?h:`${m}px`),{data:{x:v,y:y}}}});function xxt(e){const[t,r="center"]=e.split("-");return[t,r]}var bxt=sxt,kxt=cxt,_xt=hxt,wxt=vxt,Mxt="Popover",[Cxt,jxt]=flt(Mxt,[oxt]),Dxt=oxt(),[Oxt,Sxt]=Cxt(Mxt),Pxt=e=>{const{__scopePopover:r,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,c=Dxt(r),u=s.useRef(null),[d,p]=s.useState(!1),[h,f]=klt({prop:o,defaultProp:a??!1,onChange:i,caller:Mxt});return t.jsx(bxt,{...c,children:t.jsx(Oxt,{scope:r,contentId:xlt(),triggerRef:u,open:h,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:d,onCustomAnchorAdd:s.useCallback(()=>p(!0),[]),onCustomAnchorRemove:s.useCallback(()=>p(!1),[]),modal:l,children:n})})};Pxt.displayName=Mxt;var Txt="PopoverAnchor",Ext=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Sxt(Txt,n),i=Dxt(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=a;return s.useEffect(()=>(l(),()=>c()),[l,c]),t.jsx(kxt,{...i,...o,ref:r})});Ext.displayName=Txt;var Nxt="PopoverTrigger",zxt=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Sxt(Nxt,n),i=Dxt(n),s=hlt(r,a.triggerRef),l=t.jsx(Olt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Zxt(a.open),...o,ref:s,onClick:ult(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:t.jsx(kxt,{asChild:!0,...i,children:l})});zxt.displayName=Nxt;var Axt="PopoverPortal",[Rxt,Fxt]=Cxt(Axt,{forceMount:void 0}),Lxt=e=>{const{__scopePopover:r,forceMount:n,children:o,container:a}=e,i=Sxt(Axt,r);return t.jsx(Rxt,{scope:r,forceMount:n,children:t.jsx(Xlt,{present:n||i.open,children:t.jsx(Glt,{asChild:!0,container:a,children:o})})})};Lxt.displayName=Axt;var Bxt="PopoverContent",Vxt=s.forwardRef((e,r)=>{const n=Fxt(Bxt,e.__scopePopover),{forceMount:o=n.forceMount,...a}=e,i=Sxt(Bxt,e.__scopePopover);return t.jsx(Xlt,{present:o||i.open,children:i.modal?t.jsx(qxt,{...a,ref:r}):t.jsx($xt,{...a,ref:r})})});Vxt.displayName=Bxt;var Ixt=_lt("PopoverContent.RemoveScroll"),qxt=s.forwardRef((e,r)=>{const n=Sxt(Bxt,e.__scopePopover),o=s.useRef(null),a=hlt(r,o),i=s.useRef(!1);return s.useEffect(()=>{const e=o.current;if(e)return Xct(e)},[]),t.jsx(Hct,{as:Ixt,allowPinchZoom:!0,children:t.jsx(Hxt,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ult(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),i.current||null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:ult(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;i.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:ult(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),$xt=s.forwardRef((e,r)=>{const n=Sxt(Bxt,e.__scopePopover),o=s.useRef(!1),a=s.useRef(!1);return t.jsx(Hxt,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,i;null==(r=e.onCloseAutoFocus)||r.call(e,t),t.defaultPrevented||(o.current||null==(i=n.triggerRef.current)||i.focus(),t.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:t=>{var r,i;null==(r=e.onInteractOutside)||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null==(i=n.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),Hxt=s.forwardRef((e,r)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...p}=e,h=Sxt(Bxt,n),f=Dxt(n);return ect(),t.jsx($lt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:t.jsx(Rlt,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:t.jsx(_xt,{"data-state":Zxt(h.open),role:"dialog",id:h.contentId,...f,...p,ref:r,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Wxt="PopoverClose",Uxt=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Sxt(Wxt,n);return t.jsx(Olt.button,{type:"button",...o,ref:r,onClick:ult(e.onClick,()=>a.onOpenChange(!1))})});Uxt.displayName=Wxt;var Yxt=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Dxt(n);return t.jsx(wxt,{...a,...o,ref:r})});function Zxt(e){return e?"open":"closed"}Yxt.displayName="PopoverArrow";var Kxt=Lxt,Gxt=Vxt;const Xxt=Pxt,Qxt=zxt,Jxt=s.forwardRef(({className:e,align:r="center",sideOffset:n=4,...o},a)=>t.jsx(Kxt,{children:t.jsx(Gxt,{ref:a,align:r,sideOffset:n,className:zdt("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Jxt.displayName=Gxt.displayName;const ebt=s.forwardRef(({className:e,...r},n)=>t.jsx("textarea",{className:zdt("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));ebt.displayName="Textarea";const tbt=e.createContext({});function rbt(t){const r=e.useRef(null);return null===r.current&&(r.current=t()),r.current}const nbt=e.createContext(null),obt=e.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class abt extends s.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function ibt({children:r,isPresent:n}){const o=e.useId(),a=e.useRef(null),i=e.useRef({width:0,height:0,top:0,left:0}),{nonce:l}=e.useContext(obt);return e.useInsertionEffect(()=>{const{width:e,height:t,top:r,left:s}=i.current;if(n||!a.current||!e||!t)return;a.current.dataset.motionPopId=o;const c=document.createElement("style");return l&&(c.nonce=l),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${t}px !important;\n top: ${r}px !important;\n left: ${s}px !important;\n }\n `),()=>{document.head.removeChild(c)}},[n]),t.jsx(abt,{isPresent:n,childRef:a,sizeRef:i,children:s.cloneElement(r,{ref:a})})}const sbt=({children:r,initial:n,isPresent:o,onExitComplete:a,custom:i,presenceAffectsLayout:l,mode:c})=>{const u=rbt(lbt),d=e.useId(),p=e.useCallback(e=>{u.set(e,!0);for(const e of u.values())if(!e)return;a&&a()},[u,a]),h=e.useMemo(()=>({id:d,initial:n,isPresent:o,custom:i,onExitComplete:p,register:e=>(u.set(e,!1),()=>u.delete(e))}),l?[Math.random(),p]:[o,p]);return e.useMemo(()=>{u.forEach((e,t)=>u.set(t,!1))},[o]),s.useEffect(()=>{!o&&!u.size&&a&&a()},[o]),"popLayout"===c&&(r=t.jsx(ibt,{isPresent:o,children:r})),t.jsx(nbt.Provider,{value:h,children:r})};function lbt(){return new Map}function cbt(t=!0){const r=e.useContext(nbt);if(null===r)return[!0,null];const{isPresent:n,onExitComplete:o,register:a}=r,i=e.useId();e.useEffect(()=>{t&&a(i)},[t]);const s=e.useCallback(()=>t&&o&&o(i),[i,o,t]);return!n&&o?[!1,s]:[!0]}const ubt=e=>e.key||"";function dbt(t){const r=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&r.push(t)}),r}const pbt=typeof window<"u",hbt=pbt?e.useLayoutEffect:e.useEffect,fbt=({children:r,custom:n,initial:o=!0,onExitComplete:a,presenceAffectsLayout:i=!0,mode:s="sync",propagate:l=!1})=>{const[c,u]=cbt(l),d=e.useMemo(()=>dbt(r),[r]),p=l&&!c?[]:d.map(ubt),h=e.useRef(!0),f=e.useRef(d),m=rbt(()=>new Map),[v,y]=e.useState(d),[g,x]=e.useState(d);hbt(()=>{h.current=!1,f.current=d;for(let e=0;e<g.length;e++){const t=ubt(g[e]);p.includes(t)?m.delete(t):!0!==m.get(t)&&m.set(t,!1)}},[g,p.length,p.join("-")]);const b=[];if(d!==v){let e=[...d];for(let t=0;t<g.length;t++){const r=g[t],n=ubt(r);p.includes(n)||(e.splice(t,0,r),b.push(r))}return"wait"===s&&b.length&&(e=b),x(dbt(e)),void y(d)}"production"!==process.env.NODE_ENV&&"wait"===s&&g.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}=e.useContext(tbt);return t.jsx(t.Fragment,{children:g.map(e=>{const r=ubt(e),v=!(l&&!c)&&(d===g||p.includes(r));return t.jsx(sbt,{isPresent:v,initial:!(h.current&&!o)&&void 0,custom:v?void 0:n,presenceAffectsLayout:i,mode:s,onExitComplete:v?void 0:()=>{if(!m.has(r))return;m.set(r,!0);let e=!0;m.forEach(t=>{t||(e=!1)}),e&&(null==k||k(),x(f.current),l&&(null==u||u()),a&&a())},children:e},r)})})},mbt=e=>e;let vbt=mbt,ybt=mbt;function gbt(e){let t;return()=>(void 0===t&&(t=e()),t)}"production"!==process.env.NODE_ENV&&(vbt=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},ybt=(e,t)=>{if(!e)throw new Error(t)});const xbt=(e,t,r)=>{const n=t-e;return 0===n?1:(r-e)/n},bbt=e=>1e3*e,kbt=e=>e/1e3,_bt=!1;const wbt=["read","resolveKeyframes","update","preRender","render","postRender"];function Mbt(e,t){let r=!1,n=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,i=wbt.reduce((e,t)=>(e[t]=function(e){let t=new Set,r=new Set,n=!1,o=!1;const a=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(l.schedule(t),e()),t(i)}const l={schedule:(e,o=!1,i=!1)=>{const s=i&&n?t:r;return o&&a.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),a.delete(e)},process:e=>{i=e,n?o=!0:(n=!0,[t,r]=[r,t],t.forEach(s),t.clear(),n=!1,o&&(o=!1,l.process(e)))}};return l}(a),e),{}),{read:s,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:p}=i,h=()=>{const a=performance.now();r=!1,o.delta=n?1e3/60:Math.max(Math.min(a-o.timestamp,40),1),o.timestamp=a,o.isProcessing=!0,s.process(o),l.process(o),c.process(o),u.process(o),d.process(o),p.process(o),o.isProcessing=!1,r&&t&&(n=!1,e(h))};return{schedule:wbt.reduce((t,a)=>{const s=i[a];return t[a]=(t,a=!1,i=!1)=>(r||(r=!0,n=!0,o.isProcessing||e(h)),s.schedule(t,a,i)),t},{}),cancel:e=>{for(let t=0;t<wbt.length;t++)i[wbt[t]].cancel(e)},state:o,steps:i}}const{schedule:Cbt,cancel:jbt,state:Dbt,steps:Obt}=Mbt(typeof requestAnimationFrame<"u"?requestAnimationFrame:mbt,!0),Sbt=e.createContext({strict:!1}),Pbt={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"]},Tbt={};for(const e in Pbt)Tbt[e]={isEnabled:t=>Pbt[e].some(e=>!!t[e])};const Ebt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Nbt(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ebt.has(e)}let zbt=e=>!Nbt(e);try{!function(e){e&&(zbt=t=>t.startsWith("on")?!Nbt(t):e(t))}(require("@emotion/is-prop-valid").default)}catch{}const Abt=new Set;function Rbt(e,t,r){e||Abt.has(t)||(console.warn(t),Abt.add(t))}function Fbt(e){if(typeof Proxy>"u")return e;const t=new Map;return new Proxy((...t)=>("production"!==process.env.NODE_ENV&&Rbt(!1,"motion() is deprecated. Use motion.create() instead."),e(...t)),{get:(r,n)=>"create"===n?e:(t.has(n)||t.set(n,e(n)),t.get(n))})}const Lbt=e.createContext({});function Bbt(e){return"string"==typeof e||Array.isArray(e)}function Vbt(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const Ibt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],qbt=["initial",...Ibt];function $bt(e){return Vbt(e.animate)||qbt.some(t=>Bbt(e[t]))}function Hbt(e){return!(!$bt(e)&&!e.variants)}function Wbt(t){const{initial:r,animate:n}=function(e,t){if($bt(e)){const{initial:t,animate:r}=e;return{initial:!1===t||Bbt(t)?t:void 0,animate:Bbt(r)?r:void 0}}return!1!==e.inherit?t:{}}(t,e.useContext(Lbt));return e.useMemo(()=>({initial:r,animate:n}),[Ubt(r),Ubt(n)])}function Ubt(e){return Array.isArray(e)?e.join(" "):e}const Ybt=Symbol.for("motionComponentSymbol");function Zbt(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Kbt(t,r,n){return e.useCallback(e=>{e&&t.onMount&&t.onMount(e),r&&(e?r.mount(e):r.unmount()),n&&("function"==typeof n?n(e):Zbt(n)&&(n.current=e))},[r])}const Gbt=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Xbt="data-"+Gbt("framerAppearId"),{schedule:Qbt}=Mbt(queueMicrotask,!1),Jbt=e.createContext({});function ekt(t,r,n,o,a){var i,s;const{visualElement:l}=e.useContext(Lbt),c=e.useContext(Sbt),u=e.useContext(nbt),d=e.useContext(obt).reducedMotion,p=e.useRef(null);o=o||c.renderer,!p.current&&o&&(p.current=o(t,{visualState:r,parent:l,props:n,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:d}));const h=p.current,f=e.useContext(Jbt);h&&!h.projection&&a&&("html"===h.type||"svg"===h.type)&&function(e,t,r,n){const{layoutId:o,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:c}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:tkt(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:!!i||s&&Zbt(s),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:c})}(p.current,n,a,f);const m=e.useRef(!1);e.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const v=n[Xbt],y=e.useRef(!!v&&!(null!==(i=window.MotionHandoffIsComplete)&&void 0!==i&&i.call(window,v))&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,v)));return hbt(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Qbt.render(h.render),y.current&&h.animationState&&h.animationState.animateChanges())}),e.useEffect(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,v)}),y.current=!1))}),h}function tkt(e){if(e)return!1!==e.options.allowProjection?e.projection:tkt(e.parent)}function rkt({preloadedFeatures:r,createVisualElement:n,useRender:o,useVisualState:a,Component:i}){var s,l;function c(s,l){let c;const u={...e.useContext(obt),...s,layoutId:nkt(s)},{isStatic:d}=u,p=Wbt(s),h=a(s,d);if(!d&&pbt){!function(t,r){const n=e.useContext(Sbt).strict;if("production"!==process.env.NODE_ENV&&r&&n){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?vbt(!1,e):ybt(!1,e)}}(u,r);const t=function(e){const{drag:t,layout:r}=Tbt;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:null!=t&&t.isEnabled(e)||null!=r&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}(u);c=t.MeasureLayout,p.visualElement=ekt(i,h,u,n,t.ProjectionNode)}return t.jsxs(Lbt.Provider,{value:p,children:[c&&p.visualElement?t.jsx(c,{visualElement:p.visualElement,...u}):null,o(i,s,Kbt(h,p.visualElement,l),h,d,p.visualElement)]})}r&&function(e){for(const t in e)Tbt[t]={...Tbt[t],...e[t]}}(r),c.displayName=`motion.${"string"==typeof i?i:`create(${null!==(l=null!==(s=i.displayName)&&void 0!==s?s:i.name)&&void 0!==l?l:""})`}`;const u=e.forwardRef(c);return u[Ybt]=i,u}function nkt({layoutId:t}){const r=e.useContext(tbt).id;return r&&void 0!==t?r+"-"+t:t}const okt=["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 akt(e){return"string"==typeof e&&!e.includes("-")&&!!(okt.indexOf(e)>-1||/[A-Z]/u.test(e))}function ikt(e){const t=[{},{}];return null==e||e.values.forEach((e,r)=>{t[0][r]=e.get(),t[1][r]=e.getVelocity()}),t}function skt(e,t,r,n){if("function"==typeof t){const[o,a]=ikt(n);t=t(void 0!==r?r:e.custom,o,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,a]=ikt(n);t=t(void 0!==r?r:e.custom,o,a)}return t}const lkt=e=>Array.isArray(e),ckt=e=>lkt(e)?e[e.length-1]||0:e,ukt=e=>!(!e||!e.getVelocity);function dkt(e){const t=ukt(e)?e.get():e;return(e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const pkt=t=>(r,n)=>{const o=e.useContext(Lbt),a=e.useContext(nbt),i=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:r},n,o,a){const i={latestValues:hkt(n,o,a,e),renderState:t()};return r&&(i.onMount=e=>r({props:n,current:e,...i}),i.onUpdate=e=>r(e)),i}(t,r,o,a);return n?i():rbt(i)};function hkt(e,t,r,n){const o={},a=n(e,{});for(const e in a)o[e]=dkt(a[e]);let{initial:i,animate:s}=e;const l=$bt(e),c=Hbt(e);t&&c&&!l&&!1!==e.inherit&&(void 0===i&&(i=t.initial),void 0===s&&(s=t.animate));let u=!!r&&!1===r.initial;u=u||!1===i;const d=u?s:i;if(d&&"boolean"!=typeof d&&!Vbt(d)){const t=Array.isArray(d)?d:[d];for(let r=0;r<t.length;r++){const n=skt(e,t[r]);if(n){const{transitionEnd:e,transition:t,...r}=n;for(const e in r){let t=r[e];if(Array.isArray(t)){t=t[u?t.length-1:0]}null!==t&&(o[e]=t)}for(const t in e)o[t]=e[t]}}}return o}const fkt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],mkt=new Set(fkt),vkt=e=>t=>"string"==typeof t&&t.startsWith(e),ykt=vkt("--"),gkt=vkt("var(--"),xkt=e=>!!gkt(e)&&bkt.test(e.split("/*")[0].trim()),bkt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,kkt=(e,t)=>t&&"number"==typeof e?t.transform(e):e,_kt=(e,t,r)=>r>t?t:r<e?e:r,wkt={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Mkt={...wkt,transform:e=>_kt(0,1,e)},Ckt={...wkt,default:1},jkt=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Dkt=jkt("deg"),Okt=jkt("%"),Skt=jkt("px"),Pkt=jkt("vh"),Tkt=jkt("vw"),Ekt={...Okt,parse:e=>Okt.parse(e)/100,transform:e=>Okt.transform(100*e)},Nkt={borderWidth:Skt,borderTopWidth:Skt,borderRightWidth:Skt,borderBottomWidth:Skt,borderLeftWidth:Skt,borderRadius:Skt,radius:Skt,borderTopLeftRadius:Skt,borderTopRightRadius:Skt,borderBottomRightRadius:Skt,borderBottomLeftRadius:Skt,width:Skt,maxWidth:Skt,height:Skt,maxHeight:Skt,top:Skt,right:Skt,bottom:Skt,left:Skt,padding:Skt,paddingTop:Skt,paddingRight:Skt,paddingBottom:Skt,paddingLeft:Skt,margin:Skt,marginTop:Skt,marginRight:Skt,marginBottom:Skt,marginLeft:Skt,backgroundPositionX:Skt,backgroundPositionY:Skt},zkt={rotate:Dkt,rotateX:Dkt,rotateY:Dkt,rotateZ:Dkt,scale:Ckt,scaleX:Ckt,scaleY:Ckt,scaleZ:Ckt,skew:Dkt,skewX:Dkt,skewY:Dkt,distance:Skt,translateX:Skt,translateY:Skt,translateZ:Skt,x:Skt,y:Skt,z:Skt,perspective:Skt,transformPerspective:Skt,opacity:Mkt,originX:Ekt,originY:Ekt,originZ:Skt},Akt={...wkt,transform:Math.round},Rkt={...Nkt,...zkt,zIndex:Akt,size:Skt,fillOpacity:Mkt,strokeOpacity:Mkt,numOctaves:Akt},Fkt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Lkt=fkt.length;function Bkt(e,t,r){const{style:n,vars:o,transformOrigin:a}=e;let i=!1,s=!1;for(const e in t){const r=t[e];if(mkt.has(e))i=!0;else if(ykt(e))o[e]=r;else{const t=kkt(r,Rkt[e]);e.startsWith("origin")?(s=!0,a[e]=t):n[e]=t}}if(t.transform||(i||r?n.transform=function(e,t,r){let n="",o=!0;for(let a=0;a<Lkt;a++){const i=fkt[a],s=e[i];if(void 0===s)continue;let l=!0;if(l="number"==typeof s?s===(i.startsWith("scale")?1:0):0===parseFloat(s),!l||r){const e=kkt(s,Rkt[i]);l||(o=!1,n+=`${Fkt[i]||i}(${e}) `),r&&(t[i]=e)}}return n=n.trim(),r?n=r(t,o?"":n):o&&(n="none"),n}(t,e.transform,r):n.transform&&(n.transform="none")),s){const{originX:e="50%",originY:t="50%",originZ:r=0}=a;n.transformOrigin=`${e} ${t} ${r}`}}const Vkt={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ikt={offset:"strokeDashoffset",array:"strokeDasharray"};function qkt(e,t,r){return"string"==typeof e?e:Skt.transform(t+r*e)}function $kt(e,{attrX:t,attrY:r,attrScale:n,originX:o,originY:a,pathLength:i,pathSpacing:s=1,pathOffset:l=0,...c},u,d){if(Bkt(e,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:p,style:h,dimensions:f}=e;p.transform&&(f&&(h.transform=p.transform),delete p.transform),f&&(void 0!==o||void 0!==a||h.transform)&&(h.transformOrigin=function(e,t,r){return`${qkt(t,e.x,e.width)} ${qkt(r,e.y,e.height)}`}(f,void 0!==o?o:.5,void 0!==a?a:.5)),void 0!==t&&(p.x=t),void 0!==r&&(p.y=r),void 0!==n&&(p.scale=n),void 0!==i&&function(e,t,r=1,n=0,o=!0){e.pathLength=1;const a=o?Vkt:Ikt;e[a.offset]=Skt.transform(-n);const i=Skt.transform(t),s=Skt.transform(r);e[a.array]=`${i} ${s}`}(p,i,s,l,!1)}const Hkt=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Wkt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Ukt=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Ykt(e,{style:t,vars:r},n,o){Object.assign(e.style,t,o&&o.getProjectionStyles(n));for(const t in r)e.style.setProperty(t,r[t])}const Zkt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Kkt(e,t,r,n){Ykt(e,t,void 0,n);for(const r in t.attrs)e.setAttribute(Zkt.has(r)?r:Gbt(r),t.attrs[r])}const Gkt={};function Xkt(e,{layout:t,layoutId:r}){return mkt.has(e)||e.startsWith("origin")||(t||void 0!==r)&&(!!Gkt[e]||"opacity"===e)}function Qkt(e,t,r){var n;const{style:o}=e,a={};for(const i in o)(ukt(o[i])||t.style&&ukt(t.style[i])||Xkt(i,e)||void 0!==(null===(n=null==r?void 0:r.getValue(i))||void 0===n?void 0:n.liveStyle))&&(a[i]=o[i]);return a}function Jkt(e,t,r){const n=Qkt(e,t,r);for(const r in e)if(ukt(e[r])||ukt(t[r])){n[-1!==fkt.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=e[r]}return n}const e_t=["x","y","width","height","cx","cy","r"],t_t={useVisualState:pkt({scrapeMotionValuesFromProps:Jkt,createRenderState:Wkt,onUpdate:({props:e,prevProps:t,current:r,renderState:n,latestValues:o})=>{if(!r)return;let a=!!e.drag;if(!a)for(const e in o)if(mkt.has(e)){a=!0;break}if(!a)return;let i=!t;if(t)for(let r=0;r<e_t.length;r++){const n=e_t[r];e[n]!==t[n]&&(i=!0)}i&&Cbt.read(()=>{(function(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}})(r,n),Cbt.render(()=>{$kt(n,o,Ukt(r.tagName),e.transformTemplate),Kkt(r,n)})})}})},r_t={useVisualState:pkt({scrapeMotionValuesFromProps:Qkt,createRenderState:Hkt})};function n_t(e,t,r){for(const n in t)!ukt(t[n])&&!Xkt(n,r)&&(e[n]=t[n])}function o_t(t,r){const n={};return n_t(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},r){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return Bkt(e,r,t),Object.assign({},e.vars,e.style)},[r])}(t,r)),n}function a_t(e,t){const r={},n=o_t(e,t);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}function i_t(t,r,n,o){const a=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return $kt(e,r,Ukt(o),t.transformTemplate),{...e.attrs,style:{...e.style}}},[r]);if(t.style){const e={};n_t(e,t.style,t),a.style={...e,...a.style}}return a}function s_t(t=!1){return(r,n,o,{latestValues:a},i)=>{const s=(akt(r)?i_t:a_t)(n,a,i,r),l=function(e,t,r){const n={};for(const o in e)"values"===o&&"object"==typeof e.values||(zbt(o)||!0===r&&Nbt(o)||!t&&!Nbt(o)||e.draggable&&o.startsWith("onDrag"))&&(n[o]=e[o]);return n}(n,"string"==typeof r,t),c=r!==e.Fragment?{...l,...s,ref:o}:{},{children:u}=n,d=e.useMemo(()=>ukt(u)?u.get():u,[u]);return e.createElement(r,{...c,children:d})}}function l_t(e,t){return function(r,{forwardMotionProps:n}={forwardMotionProps:!1}){return rkt({...akt(r)?t_t:r_t,preloadedFeatures:e,useRender:s_t(n),createVisualElement:t,Component:r})}}function c_t(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function u_t(e,t,r){const n=e.getProps();return skt(n,t,void 0!==r?r:n.custom,e)}const d_t=gbt(()=>void 0!==window.ScrollTimeline);class p_t{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=t}attachTimeline(e,t){const r=this.animations.map(r=>d_t()&&r.attachTimeline?r.attachTimeline(e):"function"==typeof t?t(r):void 0);return()=>{r.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class h_t extends p_t{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function f_t(e,t){return e?e[t]||e.default||e:void 0}const m_t=2e4;function v_t(e){let t=0;let r=e.next(t);for(;!r.done&&t<m_t;)t+=50,r=e.next(t);return t>=m_t?1/0:t}function y_t(e){return"function"==typeof e}function g_t(e,t){e.timeline=t,e.onfinish=null}const x_t=e=>Array.isArray(e)&&"number"==typeof e[0],b_t={linearEasing:void 0};function k_t(e,t){const r=gbt(e);return()=>{var e;return null!==(e=b_t[t])&&void 0!==e?e:r()}}const __t=k_t(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),w_t=(e,t,r=10)=>{let n="";const o=Math.max(Math.round(t/r),2);for(let t=0;t<o;t++)n+=e(xbt(0,o-1,t))+", ";return`linear(${n.substring(0,n.length-2)})`};function M_t(e){return!!("function"==typeof e&&__t()||!e||"string"==typeof e&&(e in j_t||__t())||x_t(e)||Array.isArray(e)&&e.every(M_t))}const C_t=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,j_t={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:C_t([0,.65,.55,1]),circOut:C_t([.55,0,1,.45]),backIn:C_t([.31,.01,.66,-.59]),backOut:C_t([.33,1.53,.69,.99])};function D_t(e,t){if(e)return"function"==typeof e&&__t()?w_t(e,t):x_t(e)?C_t(e):Array.isArray(e)?e.map(e=>D_t(e,t)||j_t.easeOut):j_t[e]}const O_t={x:!1,y:!1};function S_t(){return O_t.x||O_t.y}function P_t(e,t){const r=function(e){if(e instanceof Element)return[e];if("string"==typeof e){const t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e)}(e),n=new AbortController;return[r,{passive:!0,...t,signal:n.signal},()=>n.abort()]}function T_t(e){return t=>{"touch"===t.pointerType||S_t()||e(t)}}const E_t=(e,t)=>!!t&&(e===t||E_t(e,t.parentElement)),N_t=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,z_t=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const A_t=new WeakSet;function R_t(e){return t=>{"Enter"===t.key&&e(t)}}function F_t(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function L_t(e){return N_t(e)&&!S_t()}function B_t(e,t,r={}){const[n,o,a]=P_t(e,r),i=e=>{const n=e.currentTarget;if(!L_t(e)||A_t.has(n))return;A_t.add(n);const a=t(e),i=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),L_t(e)&&A_t.has(n)&&(A_t.delete(n),"function"==typeof a&&a(e,{success:t}))},s=e=>{i(e,r.useGlobalTarget||E_t(n,e.target))},l=e=>{i(e,!1)};window.addEventListener("pointerup",s,o),window.addEventListener("pointercancel",l,o)};return n.forEach(e=>{!function(e){return z_t.has(e.tagName)||-1!==e.tabIndex}(e)&&null===e.getAttribute("tabindex")&&(e.tabIndex=0),(r.useGlobalTarget?window:e).addEventListener("pointerdown",i,o),e.addEventListener("focus",e=>((e,t)=>{const r=e.currentTarget;if(!r)return;const n=R_t(()=>{if(A_t.has(r))return;F_t(r,"down");const e=R_t(()=>{F_t(r,"up")});r.addEventListener("keyup",e,t),r.addEventListener("blur",()=>F_t(r,"cancel"),t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)})(e,o),o)}),a}const V_t=new Set(["width","height","top","left","right","bottom",...fkt]);let I_t;function q_t(){I_t=void 0}const $_t={now:()=>(void 0===I_t&&$_t.set(Dbt.isProcessing||_bt?Dbt.timestamp:performance.now()),I_t),set:e=>{I_t=e,queueMicrotask(q_t)}};function H_t(e,t){-1===e.indexOf(t)&&e.push(t)}function W_t(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}class U_t{constructor(){this.subscriptions=[]}add(e){return H_t(this.subscriptions,e),()=>W_t(this.subscriptions,e)}notify(e,t,r){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](e,t,r);else for(let o=0;o<n;o++){const n=this.subscriptions[o];n&&n(e,t,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Y_t(e,t){return t?e*(1e3/t):0}class Z_t{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const r=$_t.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=$_t.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(e=>!isNaN(parseFloat(e)))(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return"production"!==process.env.NODE_ENV&&Rbt(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new U_t);const r=this.events[e].add(t);return"change"===e?()=>{r(),Cbt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,r){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=$_t.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Y_t(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),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(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function K_t(e,t){return new Z_t(e,t)}function G_t(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,K_t(r))}function X_t(e,t){const r=e.getValue("willChange");if(function(e){return!(!ukt(e)||!e.add)}(r))return r.add(t)}function Q_t(e){return e.props[Xbt]}const J_t=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e;function ewt(e,t,r,n){if(e===t&&r===n)return mbt;const o=t=>function(e,t,r,n,o){let a,i,s=0;do{i=t+(r-t)/2,a=J_t(i,n,o)-e,a>0?r=i:t=i}while(Math.abs(a)>1e-7&&++s<12);return i}(t,0,1,e,r);return e=>0===e||1===e?e:J_t(o(e),t,n)}const twt=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,rwt=e=>t=>1-e(1-t),nwt=ewt(.33,1.53,.69,.99),owt=rwt(nwt),awt=twt(owt),iwt=e=>(e*=2)<1?.5*owt(e):.5*(2-Math.pow(2,-10*(e-1))),swt=e=>1-Math.sin(Math.acos(e)),lwt=rwt(swt),cwt=twt(swt),uwt=e=>/^0[^.\s]+$/u.test(e);function dwt(e){return"number"==typeof e?0===e:null===e||("none"===e||"0"===e||uwt(e))}const pwt=e=>Math.round(1e5*e)/1e5,hwt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const fwt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,mwt=(e,t)=>r=>!!("string"==typeof r&&fwt.test(r)&&r.startsWith(e)||t&&!function(e){return null==e}(r)&&Object.prototype.hasOwnProperty.call(r,t)),vwt=(e,t,r)=>n=>{if("string"!=typeof n)return n;const[o,a,i,s]=n.match(hwt);return{[e]:parseFloat(o),[t]:parseFloat(a),[r]:parseFloat(i),alpha:void 0!==s?parseFloat(s):1}},ywt={...wkt,transform:e=>Math.round((e=>_kt(0,255,e))(e))},gwt={test:mwt("rgb","red"),parse:vwt("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+ywt.transform(e)+", "+ywt.transform(t)+", "+ywt.transform(r)+", "+pwt(Mkt.transform(n))+")"};const xwt={test:mwt("#"),parse:function(e){let t="",r="",n="",o="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),o=e.substring(4,5),t+=t,r+=r,n+=n,o+=o),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}},transform:gwt.transform},bwt={test:mwt("hsl","hue"),parse:vwt("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Okt.transform(pwt(t))+", "+Okt.transform(pwt(r))+", "+pwt(Mkt.transform(n))+")"},kwt={test:e=>gwt.test(e)||xwt.test(e)||bwt.test(e),parse:e=>gwt.test(e)?gwt.parse(e):bwt.test(e)?bwt.parse(e):xwt.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?gwt.transform(e):bwt.transform(e)},_wt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const wwt="number",Mwt="color",Cwt=/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 jwt(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},o=[];let a=0;const i=t.replace(Cwt,e=>(kwt.test(e)?(n.color.push(a),o.push(Mwt),r.push(kwt.parse(e))):e.startsWith("var(")?(n.var.push(a),o.push("var"),r.push(e)):(n.number.push(a),o.push(wwt),r.push(parseFloat(e))),++a,"${}")).split("${}");return{values:r,split:i,indexes:n,types:o}}function Dwt(e){return jwt(e).values}function Owt(e){const{split:t,types:r}=jwt(e),n=t.length;return e=>{let o="";for(let a=0;a<n;a++)if(o+=t[a],void 0!==e[a]){const t=r[a];o+=t===wwt?pwt(e[a]):t===Mwt?kwt.transform(e[a]):e[a]}return o}}const Swt=e=>"number"==typeof e?0:e;const Pwt={test:function(e){var t,r;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(hwt))||void 0===t?void 0:t.length)||0)+((null===(r=e.match(_wt))||void 0===r?void 0:r.length)||0)>0},parse:Dwt,createTransformer:Owt,getAnimatableNone:function(e){const t=Dwt(e);return Owt(e)(t.map(Swt))}},Twt=new Set(["brightness","contrast","saturate","opacity"]);function Ewt(e){const[t,r]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[n]=r.match(hwt)||[];if(!n)return e;const o=r.replace(n,"");let a=Twt.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+o+")"}const Nwt=/\b([a-z-]*)\(.*?\)/gu,zwt={...Pwt,getAnimatableNone:e=>{const t=e.match(Nwt);return t?t.map(Ewt).join(" "):e}},Awt={...Rkt,color:kwt,backgroundColor:kwt,outlineColor:kwt,fill:kwt,stroke:kwt,borderColor:kwt,borderTopColor:kwt,borderRightColor:kwt,borderBottomColor:kwt,borderLeftColor:kwt,filter:zwt,WebkitFilter:zwt},Rwt=e=>Awt[e];function Fwt(e,t){let r=Rwt(e);return r!==zwt&&(r=Pwt),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const Lwt=new Set(["auto","none","0"]);const Bwt=e=>e===wkt||e===Skt,Vwt=(e,t)=>parseFloat(e.split(", ")[t]),Iwt=(e,t)=>(r,{transform:n})=>{if("none"===n||!n)return 0;const o=n.match(/^matrix3d\((.+)\)$/u);if(o)return Vwt(o[1],t);{const t=n.match(/^matrix\((.+)\)$/u);return t?Vwt(t[1],e):0}},qwt=new Set(["x","y","z"]),$wt=fkt.filter(e=>!qwt.has(e));const Hwt={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),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:Iwt(4,13),y:Iwt(5,14)};Hwt.translateX=Hwt.x,Hwt.translateY=Hwt.y;const Wwt=new Set;let Uwt=!1,Ywt=!1;function Zwt(){if(Ywt){const e=Array.from(Wwt).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),r=new Map;t.forEach(e=>{const t=function(e){const t=[];return $wt.forEach(r=>{const n=e.getValue(r);void 0!==n&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=r.get(e);t&&t.forEach(([t,r])=>{var n;null===(n=e.getValue(t))||void 0===n||n.set(r)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}Ywt=!1,Uwt=!1,Wwt.forEach(e=>e.complete()),Wwt.clear()}function Kwt(){Wwt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ywt=!0)})}class Gwt{constructor(e,t,r,n,o,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=r,this.motionValue=n,this.element=o,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Wwt.add(this),Uwt||(Uwt=!0,Cbt.read(Kwt),Cbt.resolveKeyframes(Zwt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:r,motionValue:n}=this;for(let o=0;o<e.length;o++)if(null===e[o])if(0===o){const o=null==n?void 0:n.get(),a=e[e.length-1];if(void 0!==o)e[0]=o;else if(r&&t){const n=r.readValue(t,a);null!=n&&(e[0]=n)}void 0===e[0]&&(e[0]=a),n&&void 0===o&&n.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Wwt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Wwt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Xwt=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Qwt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Jwt(e,t,r=1){ybt(r<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[n,o]=function(e){const t=Qwt.exec(e);if(!t)return[,];const[,r,n,o]=t;return[`--${r??n}`,o]}(e);if(!n)return;const a=window.getComputedStyle(t).getPropertyValue(n);if(a){const e=a.trim();return Xwt(e)?parseFloat(e):e}return xkt(o)?Jwt(o,t,r+1):o}const eMt=e=>t=>t.test(e),tMt=[wkt,Skt,Okt,Dkt,Tkt,Pkt,{test:e=>"auto"===e,parse:e=>e}],rMt=e=>tMt.find(eMt(e));class nMt extends Gwt{constructor(e,t,r,n,o){super(e,t,r,n,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:r}=this;if(!t||!t.current)return;super.readKeyframes();for(let r=0;r<e.length;r++){let n=e[r];if("string"==typeof n&&(n=n.trim(),xkt(n))){const o=Jwt(n,t.current);void 0!==o&&(e[r]=o),r===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!V_t.has(r)||2!==e.length)return;const[n,o]=e,a=rMt(n),i=rMt(o);if(a!==i)if(Bwt(a)&&Bwt(i))for(let t=0;t<e.length;t++){const r=e[t];"string"==typeof r&&(e[t]=parseFloat(r))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,r=[];for(let t=0;t<e.length;t++)dwt(e[t])&&r.push(t);r.length&&function(e,t,r){let n,o=0;for(;o<e.length&&!n;){const t=e[o];"string"==typeof t&&!Lwt.has(t)&&jwt(t).values.length&&(n=e[o]),o++}if(n&&r)for(const o of t)e[o]=Fwt(r,n)}(e,r,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:r}=this;if(!e||!e.current)return;"height"===r&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Hwt[r](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const n=t[t.length-1];void 0!==n&&e.getValue(r,n).jump(n,!1)}measureEndState(){var e;const{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const o=t.getValue(r);o&&o.jump(this.measuredOrigin,!1);const a=n.length-1,i=n[a];n[a]=Hwt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),!(null===(e=this.removedTransforms)||void 0===e)&&e.length&&this.removedTransforms.forEach(([e,r])=>{t.getValue(e).set(r)}),this.resolveNoneKeyframes()}}const oMt=(e,t)=>"zIndex"!==t&&!("number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Pwt.test(e)&&"0"!==e||e.startsWith("url(")));const aMt=e=>null!==e;function iMt(e,{repeat:t,repeatType:r="loop"},n){const o=e.filter(aMt),a=t&&"loop"!==r&&t%2==1?0:o.length-1;return a&&void 0!==n?n:o[a]}class sMt{constructor({autoplay:e=!0,delay:t=0,type:r="keyframes",repeat:n=0,repeatDelay:o=0,repeatType:a="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=$_t.now(),this.options={autoplay:e,delay:t,type:r,repeat:n,repeatDelay:o,repeatType:a,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&(Kwt(),Zwt()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=$_t.now(),this.hasAttemptedResolve=!0;const{name:r,type:n,velocity:o,delay:a,onComplete:i,onUpdate:s,isGenerator:l}=this.options;if(!l&&!function(e,t,r,n){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const a=e[e.length-1],i=oMt(o,t),s=oMt(a,t);return vbt(i===s,`You are trying to animate ${t} from "${o}" to "${a}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${a} via the \`style\` property.`),!(!i||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}(e)||("spring"===r||y_t(r))&&n)}(e,r,n,o)){if(!a)return s&&s(iMt(e,this.options,t)),i&&i(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(e,t);!1!==c&&(this._resolved={keyframes:e,finalKeyframe:t,...c},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const lMt=(e,t,r)=>e+(t-e)*r;function cMt(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function uMt(e,t){return r=>r>0?t:e}const dMt=(e,t,r)=>{const n=e*e,o=r*(t*t-n)+n;return o<0?0:Math.sqrt(o)},pMt=[xwt,gwt,bwt];function hMt(e){const t=(e=>pMt.find(t=>t.test(e)))(e);if(vbt(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let r=t.parse(e);return t===bwt&&(r=function({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,r/=100;let o=0,a=0,i=0;if(t/=100){const n=r<.5?r*(1+t):r+t-r*t,s=2*r-n;o=cMt(s,n,e+1/3),a=cMt(s,n,e),i=cMt(s,n,e-1/3)}else o=a=i=r;return{red:Math.round(255*o),green:Math.round(255*a),blue:Math.round(255*i),alpha:n}}(r)),r}const fMt=(e,t)=>{const r=hMt(e),n=hMt(t);if(!r||!n)return uMt(e,t);const o={...r};return e=>(o.red=dMt(r.red,n.red,e),o.green=dMt(r.green,n.green,e),o.blue=dMt(r.blue,n.blue,e),o.alpha=lMt(r.alpha,n.alpha,e),gwt.transform(o))},mMt=(e,t)=>r=>t(e(r)),vMt=(...e)=>e.reduce(mMt),yMt=new Set(["none","hidden"]);function gMt(e,t){return r=>lMt(e,t,r)}function xMt(e){return"number"==typeof e?gMt:"string"==typeof e?xkt(e)?uMt:kwt.test(e)?fMt:_Mt:Array.isArray(e)?bMt:"object"==typeof e?kwt.test(e)?fMt:kMt:uMt}function bMt(e,t){const r=[...e],n=r.length,o=e.map((e,r)=>xMt(e)(e,t[r]));return e=>{for(let t=0;t<n;t++)r[t]=o[t](e);return r}}function kMt(e,t){const r={...e,...t},n={};for(const o in r)void 0!==e[o]&&void 0!==t[o]&&(n[o]=xMt(e[o])(e[o],t[o]));return e=>{for(const t in n)r[t]=n[t](e);return r}}const _Mt=(e,t)=>{const r=Pwt.createTransformer(t),n=jwt(e),o=jwt(t);return n.indexes.var.length===o.indexes.var.length&&n.indexes.color.length===o.indexes.color.length&&n.indexes.number.length>=o.indexes.number.length?yMt.has(e)&&!o.values.length||yMt.has(t)&&!n.values.length?function(e,t){return yMt.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}(e,t):vMt(bMt(function(e,t){var r;const n=[],o={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const i=t.types[a],s=e.indexes[i][o[i]],l=null!==(r=e.values[s])&&void 0!==r?r:0;n[a]=l,o[i]++}return n}(n,o),o.values),r):(vbt(!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.`),uMt(e,t))};function wMt(e,t,r){return"number"==typeof e&&"number"==typeof t&&"number"==typeof r?lMt(e,t,r):xMt(e)(e,t)}function MMt(e,t,r){const n=Math.max(t-5,0);return Y_t(r-e(n),t-n)}const CMt=100,jMt=10,DMt=1,OMt=0,SMt=800,PMt=.3,TMt=.3,EMt={granular:.01,default:2},NMt={granular:.005,default:.5},zMt=.01,AMt=10,RMt=.05,FMt=1,LMt=.001;function BMt({duration:e=SMt,bounce:t=PMt,velocity:r=OMt,mass:n=DMt}){let o,a;vbt(e<=bbt(AMt),"Spring duration must be 10 seconds or less");let i=1-t;i=_kt(RMt,FMt,i),e=_kt(zMt,AMt,kbt(e)),i<1?(o=t=>{const n=t*i,o=n*e,a=n-r,s=IMt(t,i),l=Math.exp(-o);return LMt-a/s*l},a=t=>{const n=t*i*e,a=n*r+r,s=Math.pow(i,2)*Math.pow(t,2)*e,l=Math.exp(-n),c=IMt(Math.pow(t,2),i);return(-o(t)+LMt>0?-1:1)*((a-s)*l)/c}):(o=t=>Math.exp(-t*e)*((t-r)*e+1)-LMt,a=t=>Math.exp(-t*e)*(e*e*(r-t)));const s=function(e,t,r){let n=r;for(let r=1;r<VMt;r++)n-=e(n)/t(n);return n}(o,a,5/e);if(e=bbt(e),isNaN(s))return{stiffness:CMt,damping:jMt,duration:e};{const t=Math.pow(s,2)*n;return{stiffness:t,damping:2*i*Math.sqrt(n*t),duration:e}}}const VMt=12;function IMt(e,t){return e*Math.sqrt(1-t*t)}const qMt=["duration","bounce"],$Mt=["stiffness","damping","mass"];function HMt(e,t){return t.some(t=>void 0!==e[t])}function WMt(e=TMt,t=PMt){const r="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:o}=r;const a=r.keyframes[0],i=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:u,duration:d,velocity:p,isResolvedFromDuration:h}=function(e){let t={velocity:OMt,stiffness:CMt,damping:jMt,mass:DMt,isResolvedFromDuration:!1,...e};if(!HMt(e,$Mt)&&HMt(e,qMt))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(1.2*r),o=n*n,a=2*_kt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:DMt,stiffness:o,damping:a}}else{const r=BMt(e);t={...t,...r,mass:DMt},t.isResolvedFromDuration=!0}return t}({...r,velocity:-kbt(r.velocity||0)}),f=p||0,m=c/(2*Math.sqrt(l*u)),v=i-a,y=kbt(Math.sqrt(l/u)),g=Math.abs(v)<5;let x;if(n||(n=g?EMt.granular:EMt.default),o||(o=g?NMt.granular:NMt.default),m<1){const e=IMt(y,m);x=t=>{const r=Math.exp(-m*y*t);return i-r*((f+m*y*v)/e*Math.sin(e*t)+v*Math.cos(e*t))}}else if(1===m)x=e=>i-Math.exp(-y*e)*(v+(f+y*v)*e);else{const e=y*Math.sqrt(m*m-1);x=t=>{const r=Math.exp(-m*y*t),n=Math.min(e*t,300);return i-r*((f+m*y*v)*Math.sinh(n)+e*v*Math.cosh(n))/e}}const b={calculatedDuration:h&&d||null,next:e=>{const t=x(e);if(h)s.done=e>=d;else{let r=0;m<1&&(r=0===e?bbt(f):MMt(x,e,t));const a=Math.abs(r)<=n,l=Math.abs(i-t)<=o;s.done=a&&l}return s.value=s.done?i:t,s},toString:()=>{const e=Math.min(v_t(b),m_t),t=w_t(t=>b.next(e*t).value,e,30);return e+"ms "+t}};return b}function UMt({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:i,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],p={done:!1,value:d},h=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let f=r*t;const m=d+f,v=void 0===i?m:i(m);v!==m&&(f=v-d);const y=e=>-f*Math.exp(-e/n),g=e=>v+y(e),x=e=>{const t=y(e),r=g(e);p.done=Math.abs(t)<=c,p.value=p.done?v:r};let b,k;const _=e=>{(e=>void 0!==s&&e<s||void 0!==l&&e>l)(p.value)&&(b=e,k=WMt({keyframes:[p.value,h(p.value)],velocity:MMt(g,e,p.value),damping:o,stiffness:a,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return!k&&void 0===b&&(t=!0,x(e),_(e)),void 0!==b&&e>=b?k.next(e-b):(!t&&x(e),p)}}}const YMt=ewt(.42,0,1,1),ZMt=ewt(0,0,.58,1),KMt=ewt(.42,0,.58,1),GMt={linear:mbt,easeIn:YMt,easeInOut:KMt,easeOut:ZMt,circIn:swt,circInOut:cwt,circOut:lwt,backIn:owt,backInOut:awt,backOut:nwt,anticipate:iwt},XMt=e=>{if(x_t(e)){ybt(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,r,n,o]=e;return ewt(t,r,n,o)}return"string"==typeof e?(ybt(void 0!==GMt[e],`Invalid easing type '${e}'`),GMt[e]):e};function QMt(e,t,{clamp:r=!0,ease:n,mixer:o}={}){const a=e.length;if(ybt(a===t.length,"Both input and output ranges must be the same length"),1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,r){const n=[],o=r||wMt,a=e.length-1;for(let r=0;r<a;r++){let a=o(e[r],e[r+1]);if(t){const e=Array.isArray(t)?t[r]||mbt:t;a=vMt(e,a)}n.push(a)}return n}(t,n,o),l=s.length,c=r=>{if(i&&r<e[0])return t[0];let n=0;if(l>1)for(;n<e.length-2&&!(r<e[n+1]);n++);const o=xbt(e[n],e[n+1],r);return s[n](o)};return r?t=>c(_kt(e[0],e[a-1],t)):c}function JMt(e){const t=[0];return function(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=xbt(0,t,n);e.push(lMt(r,1,o))}}(t,e.length-1),t}function eCt(e,t){return e.map(()=>t||KMt).splice(0,e.length-1)}function tCt({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(n)?n.map(XMt):XMt(n),a={done:!1,value:t[0]},i=function(e,t){return e.map(e=>e*t)}(r&&r.length===t.length?r:JMt(t),e),s=QMt(i,t,{ease:Array.isArray(o)?o:eCt(t,o)});return{calculatedDuration:e,next:t=>(a.value=s(t),a.done=t>=e,a)}}const rCt=e=>{const t=({timestamp:t})=>e(t);return{start:()=>Cbt.update(t,!0),stop:()=>jbt(t),now:()=>Dbt.isProcessing?Dbt.timestamp:$_t.now()}},nCt={decay:UMt,inertia:UMt,tween:tCt,keyframes:tCt,spring:WMt},oCt=e=>e/100;class aCt extends sMt{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:r,element:n,keyframes:o}=this.options,a=(null==n?void 0:n.KeyframeResolver)||Gwt;this.resolver=new a(o,(e,t)=>this.onKeyframesResolved(e,t),t,r,n),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:r=0,repeatDelay:n=0,repeatType:o,velocity:a=0}=this.options,i=y_t(t)?t:nCt[t]||tCt;let s,l;i!==tCt&&"number"!=typeof e[0]&&("production"!==process.env.NODE_ENV&&ybt(2===e.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),s=vMt(oCt,wMt(e[0],e[1])),e=[0,100]);const c=i({...this.options,keyframes:e});"mirror"===o&&(l=i({...this.options,keyframes:[...e].reverse(),velocity:-a})),null===c.calculatedDuration&&(c.calculatedDuration=v_t(c));const{calculatedDuration:u}=c,d=u+n;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:s,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(r+1)-n}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:r}=this;if(!r){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:n,generator:o,mirroredGenerator:a,mapPercentToKeyframes:i,keyframes:s,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=r;if(null===this.startTime)return o.next(0);const{delay:d,repeat:p,repeatType:h,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const v=this.currentTime-d*(this.speed>=0?1:-1),y=this.speed>=0?v<0:v>c;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let g=this.currentTime,x=o;if(p){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),r=e%1;!r&&e>=1&&(r=1),1===r&&t--,t=Math.min(t,p+1),!!(t%2)&&("reverse"===h?(r=1-r,f&&(r-=f/u)):"mirror"===h&&(x=a)),g=_kt(0,1,r)*u}const b=y?{done:!1,value:s[0]}:x.next(g);i&&(b.value=i(b.value));let{done:k}=b;!y&&null!==l&&(k=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&k);return _&&void 0!==n&&(b.value=iMt(s,this.options,n)),m&&m(b.value),_&&this.finish(),b}get duration(){const{resolved:e}=this;return e?kbt(e.calculatedDuration):0}get time(){return kbt(this.currentTime)}set time(e){e=bbt(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=kbt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=rCt,onPlay:t,startTime:r}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),t&&t();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=n):this.startTime=r??this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const iCt=new Set(["opacity","clipPath","filter","transform"]);function sCt(e,t,r,{delay:n=0,duration:o=300,repeat:a=0,repeatType:i="loop",ease:s="easeInOut",times:l}={}){const c={[t]:r};l&&(c.offset=l);const u=D_t(s,o);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:n,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:a+1,direction:"reverse"===i?"alternate":"normal"})}const lCt=gbt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const cCt={anticipate:iwt,backInOut:awt,circInOut:cwt};class uCt extends sMt{constructor(e){super(e);const{name:t,motionValue:r,element:n,keyframes:o}=this.options;this.resolver=new nMt(o,(e,t)=>this.onKeyframesResolved(e,t),t,r,n),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:r=300,times:n,ease:o,type:a,motionValue:i,name:s,startTime:l}=this.options;if(!i.owner||!i.owner.current)return!1;if("string"==typeof o&&__t()&&function(e){return e in cCt}(o)&&(o=cCt[o]),function(e){return y_t(e.type)||"spring"===e.type||!M_t(e.ease)}(this.options)){const{onComplete:t,onUpdate:i,motionValue:s,element:l,...c}=this.options,u=function(e,t){const r=new aCt({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:e[0]};const o=[];let a=0;for(;!n.done&&a<2e4;)n=r.sample(a),o.push(n.value),a+=10;return{times:void 0,keyframes:o,duration:a-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),r=u.duration,n=u.times,o=u.ease,a="keyframes"}const c=sCt(i.owner.current,s,e,{...this.options,duration:r,times:n,ease:o});return c.startTime=l??this.calcStartTime(),this.pendingTimeline?(g_t(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:r}=this.options;i.set(iMt(e,this.options,t)),r&&r(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:r,times:n,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return kbt(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return kbt(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:r}=t;r.currentTime=bbt(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:r}=t;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return mbt;const{animation:r}=t;g_t(r,e)}else this.pendingTimeline=e;return mbt}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:r,duration:n,type:o,ease:a,times:i}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:s,element:l,...c}=this.options,u=new aCt({...c,keyframes:r,duration:n,type:o,ease:a,times:i,isGenerator:!0}),d=bbt(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:s}=this.options;s&&s(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:r,repeatDelay:n,repeatType:o,damping:a,type:i}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:s,transformTemplate:l}=t.owner.getProps();return lCt()&&r&&iCt.has(r)&&!s&&!l&&!n&&"mirror"!==o&&0!==a&&"inertia"!==i}}const dCt={type:"spring",stiffness:500,damping:25,restSpeed:10},pCt={type:"keyframes",duration:.8},hCt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},fCt=(e,{keyframes:t})=>t.length>2?pCt:mkt.has(e)?e.startsWith("scale")?(e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}))(t[1]):dCt:hCt;const mCt=(e,t,r,n={},o,a)=>i=>{const s=f_t(n,e)||{},l=s.delay||n.delay||0;let{elapsed:c=0}=n;c-=bbt(l);let u={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:o};(function({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:o,repeat:a,repeatType:i,repeatDelay:s,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(s)||(u={...u,...fCt(e,u)}),u.duration&&(u.duration=bbt(u.duration)),u.repeatDelay&&(u.repeatDelay=bbt(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),d&&!a&&void 0!==t.get()){const e=iMt(u.keyframes,s);if(void 0!==e)return Cbt.update(()=>{u.onUpdate(e),u.onComplete()}),new h_t([])}return!a&&uCt.supports(u)?new uCt(u):new aCt(u)};function vCt({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&!0!==t[r];return t[r]=!1,n}function yCt(e,t,{delay:r=0,transitionOverride:n,type:o}={}){var a;let{transition:i=e.getDefaultTransition(),transitionEnd:s,...l}=t;n&&(i=n);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const n=e.getValue(t,null!==(a=e.latestValues[t])&&void 0!==a?a:null),o=l[t];if(void 0===o||u&&vCt(u,t))continue;const s={delay:r,...f_t(i||{},t)};let d=!1;if(window.MotionHandoffAnimation){const r=Q_t(e);if(r){const e=window.MotionHandoffAnimation(r,t,Cbt);null!==e&&(s.startTime=e,d=!0)}}X_t(e,t),n.start(mCt(t,n,o,e.shouldReduceMotion&&V_t.has(t)?{type:!1}:s,e,d));const p=n.animation;p&&c.push(p)}return s&&Promise.all(c).then(()=>{Cbt.update(()=>{s&&function(e,t){const r=u_t(e,t);let{transitionEnd:n={},transition:o={},...a}=r||{};a={...a,...n};for(const t in a)G_t(e,t,ckt(a[t]))}(e,s)})}),c}function gCt(e,t,r={}){var n;const o=u_t(e,t,"exit"===r.type?null===(n=e.presenceContext)||void 0===n?void 0:n.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=o||{};r.transitionOverride&&(a=r.transitionOverride);const i=o?()=>Promise.all(yCt(e,o,r)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(n=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:s}=a;return function(e,t,r=0,n=0,o=1,a){const i=[],s=(e.variantChildren.size-1)*n,l=1===o?(e=0)=>e*n:(e=0)=>s-e*n;return Array.from(e.variantChildren).sort(xCt).forEach((e,n)=>{e.notify("AnimationStart",t),i.push(gCt(e,t,{...a,delay:r+l(n)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(i)}(e,t,o+n,i,s,r)}:()=>Promise.resolve(),{when:l}=a;if(l){const[e,t]="beforeChildren"===l?[i,s]:[s,i];return e().then(()=>t())}return Promise.all([i(),s(r.delay)])}function xCt(e,t){return e.sortNodePosition(t)}const bCt=qbt.length;function kCt(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&kCt(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let r=0;r<bCt;r++){const n=qbt[r],o=e.props[n];(Bbt(o)||!1===o)&&(t[n]=o)}return t}const _Ct=[...Ibt].reverse(),wCt=Ibt.length;function MCt(e){return t=>Promise.all(t.map(({animation:t,options:r})=>function(e,t,r={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map(t=>gCt(e,t,r));n=Promise.all(o)}else if("string"==typeof t)n=gCt(e,t,r);else{const o="function"==typeof t?u_t(e,t,r.custom):t;n=Promise.all(yCt(e,o,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}(e,t,r)))}function CCt(e){let t=MCt(e),r=OCt(),n=!0;const o=t=>(r,n)=>{var o;const a=u_t(e,n,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(a){const{transition:e,transitionEnd:t,...n}=a;r={...r,...n,...t}}return r};function a(a){const{props:i}=e,s=kCt(e.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<wCt;t++){const p=_Ct[t],h=r[p],f=void 0!==i[p]?i[p]:s[p],m=Bbt(f),v=p===a?h.isActive:null;!1===v&&(d=t);let y=f===s[p]&&f!==i[p]&&m;if(y&&n&&e.manuallyAnimateOnMount&&(y=!1),h.protectedKeys={...u},!h.isActive&&null===v||!f&&!h.prevProp||Vbt(f)||"boolean"==typeof f)continue;const g=jCt(h.prevProp,f);let x=g||p===a&&h.isActive&&!y&&m||t>d&&m,b=!1;const k=Array.isArray(f)?f:[f];let _=k.reduce(o(p),{});!1===v&&(_={});const{prevResolvedValues:w={}}=h,M={...w,..._},C=t=>{x=!0,c.has(t)&&(b=!0,c.delete(t)),h.needsAnimating[t]=!0;const r=e.getValue(t);r&&(r.liveStyle=!1)};for(const e in M){const t=_[e],r=w[e];if(u.hasOwnProperty(e))continue;let n=!1;n=lkt(t)&&lkt(r)?!c_t(t,r):t!==r,n?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):h.protectedKeys[e]=!0}h.prevProp=f,h.prevResolvedValues=_,h.isActive&&(u={...u,..._}),n&&e.blockInitialAnimation&&(x=!1),x&&(!y||!g||b)&&l.push(...k.map(e=>({animation:e,options:{type:p}})))}if(c.size){const t={};c.forEach(r=>{const n=e.getBaseTarget(r),o=e.getValue(r);o&&(o.liveStyle=!0),t[r]=n??null}),l.push({animation:t})}let p=!!l.length;return n&&(!1===i.initial||i.initial===i.animate)&&!e.manuallyAnimateOnMount&&(p=!1),n=!1,p?t(l):Promise.resolve()}return{animateChanges:a,setActive:function(t,n){var o;if(r[t].isActive===n)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach(e=>{var r;return null===(r=e.animationState)||void 0===r?void 0:r.setActive(t,n)}),r[t].isActive=n;const i=a(t);for(const e in r)r[e].protectedKeys={};return i},setAnimateFunction:function(r){t=r(e)},getState:()=>r,reset:()=>{r=OCt(),n=!0}}}function jCt(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!c_t(t,e)}function DCt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function OCt(){return{animate:DCt(!0),whileInView:DCt(),whileHover:DCt(),whileTap:DCt(),whileDrag:DCt(),whileFocus:DCt(),exit:DCt()}}class SCt{constructor(e){this.isMounted=!1,this.node=e}update(){}}let PCt=0;const TCt={animation:{Feature:class extends SCt{constructor(e){super(e),e.animationState||(e.animationState=CCt(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Vbt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends SCt{constructor(){super(...arguments),this.id=PCt++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const n=this.node.animationState.setActive("exit",!e);t&&!e&&n.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}};function ECt(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function NCt(e){return{point:{x:e.pageX,y:e.pageY}}}function zCt(e,t,r,n){return ECt(e,t,(e=>t=>N_t(t)&&e(t,NCt(t)))(r),n)}const ACt=(e,t)=>Math.abs(e-t);class RCt{constructor(e,t,{transformPagePoint:r,contextWindow:n,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=BCt(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,r=function(e,t){const r=ACt(e.x,t.x),n=ACt(e.y,t.y);return Math.sqrt(r**2+n**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!r)return;const{point:n}=e,{timestamp:o}=Dbt;this.history.push({...n,timestamp:o});const{onStart:a,onMove:i}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),i&&i(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=FCt(t,this.transformPagePoint),Cbt.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:r,onSessionEnd:n,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const a=BCt("pointercancel"===e.type?this.lastMoveEventInfo:FCt(t,this.transformPagePoint),this.history);this.startEvent&&r&&r(e,a),n&&n(e,a)},!N_t(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=r,this.contextWindow=n||window;const a=FCt(NCt(e),this.transformPagePoint),{point:i}=a,{timestamp:s}=Dbt;this.history=[{...i,timestamp:s}];const{onSessionStart:l}=t;l&&l(e,BCt(a,this.history)),this.removeListeners=vMt(zCt(this.contextWindow,"pointermove",this.handlePointerMove),zCt(this.contextWindow,"pointerup",this.handlePointerUp),zCt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),jbt(this.updatePoint)}}function FCt(e,t){return t?{point:t(e.point)}:e}function LCt(e,t){return{x:e.x-t.x,y:e.y-t.y}}function BCt({point:e},t){return{point:e,delta:LCt(e,ICt(t)),offset:LCt(e,VCt(t)),velocity:qCt(t,.1)}}function VCt(e){return e[0]}function ICt(e){return e[e.length-1]}function qCt(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const o=ICt(e);for(;r>=0&&(n=e[r],!(o.timestamp-n.timestamp>bbt(t)));)r--;if(!n)return{x:0,y:0};const a=kbt(o.timestamp-n.timestamp);if(0===a)return{x:0,y:0};const i={x:(o.x-n.x)/a,y:(o.y-n.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function $Ct(e){return e.max-e.min}function HCt(e,t,r,n=.5){e.origin=n,e.originPoint=lMt(t.min,t.max,e.origin),e.scale=$Ct(r)/$Ct(t),e.translate=lMt(r.min,r.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function WCt(e,t,r,n){HCt(e.x,t.x,r.x,n?n.originX:void 0),HCt(e.y,t.y,r.y,n?n.originY:void 0)}function UCt(e,t,r){e.min=r.min+t.min,e.max=e.min+$Ct(t)}function YCt(e,t,r){e.min=t.min-r.min,e.max=e.min+$Ct(t)}function ZCt(e,t,r){YCt(e.x,t.x,r.x),YCt(e.y,t.y,r.y)}function KCt(e,t,r){return{min:void 0!==t?e.min+t:void 0,max:void 0!==r?e.max+r-(e.max-e.min):void 0}}function GCt(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}const XCt=.35;function QCt(e,t,r){return{min:JCt(e,t),max:JCt(e,r)}}function JCt(e,t){return"number"==typeof e?e:e[t]||0}const ejt=()=>({x:{min:0,max:0},y:{min:0,max:0}});function tjt(e){return[e("x"),e("y")]}function rjt({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function njt(e){return void 0===e||1===e}function ojt({scale:e,scaleX:t,scaleY:r}){return!njt(e)||!njt(t)||!njt(r)}function ajt(e){return ojt(e)||ijt(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ijt(e){return sjt(e.x)||sjt(e.y)}function sjt(e){return e&&"0%"!==e}function ljt(e,t,r){return r+t*(e-r)}function cjt(e,t,r,n,o){return void 0!==o&&(e=ljt(e,o,n)),ljt(e,r,n)+t}function ujt(e,t=0,r=1,n,o){e.min=cjt(e.min,t,r,n,o),e.max=cjt(e.max,t,r,n,o)}function djt(e,{x:t,y:r}){ujt(e.x,t.translate,t.scale,t.originPoint),ujt(e.y,r.translate,r.scale,r.originPoint)}const pjt=.999999999999,hjt=1.0000000000001;function fjt(e,t){e.min=e.min+t,e.max=e.max+t}function mjt(e,t,r,n,o=.5){ujt(e,t,r,lMt(e.min,e.max,o),n)}function vjt(e,t){mjt(e.x,t.x,t.scaleX,t.scale,t.originX),mjt(e.y,t.y,t.scaleY,t.scale,t.originY)}function yjt(e,t){return rjt(function(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}(e.getBoundingClientRect(),t))}const gjt=({current:e})=>e?e.ownerDocument.defaultView:null,xjt=new WeakMap;class bjt{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;const{dragSnapToOrigin:n}=this.getProps();this.panSession=new RCt(e,{onSessionStart:e=>{const{dragSnapToOrigin:r}=this.getProps();r?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(NCt(e).point)},onStart:(e,t)=>{const{drag:r,dragPropagation:n,onDragStart:o}=this.getProps();if(r&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){return"x"===e||"y"===e?O_t[e]?null:(O_t[e]=!0,()=>{O_t[e]=!1}):O_t.x||O_t.y?null:(O_t.x=O_t.y=!0,()=>{O_t.x=O_t.y=!1})}(r),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),tjt(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Okt.test(t)){const{projection:r}=this.visualElement;if(r&&r.layout){const n=r.layout.layoutBox[e];n&&(t=$Ct(n)*(parseFloat(t)/100))}}this.originPoint[e]=t}),o&&Cbt.postRender(()=>o(e,t)),X_t(this.visualElement,"transform");const{animationState:a}=this.visualElement;a&&a.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:r,dragDirectionLock:n,onDirectionLock:o,onDrag:a}=this.getProps();if(!r&&!this.openDragLock)return;const{offset:i}=t;if(n&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}(i),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,i),this.updateAxis("y",t.point,i),this.visualElement.render(),a&&a(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>tjt(e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:n,contextWindow:gjt(this.visualElement)})}stop(e,t){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:n}=t;this.startAnimation(n);const{onDragEnd:o}=this.getProps();o&&Cbt.postRender(()=>o(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,r){const{drag:n}=this.getProps();if(!r||!kjt(e,n,this.currentDirection))return;const o=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:r},n){return void 0!==t&&e<t?e=n?lMt(t,e,n.min):Math.max(e,t):void 0!==r&&e>r&&(e=n?lMt(r,e,n.max):Math.min(e,r)),e}(a,this.constraints[e],this.elastic[e])),o.set(a)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&Zbt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(e,{top:t,left:r,bottom:n,right:o}){return{x:KCt(e.x,r,o),y:KCt(e.y,t,n)}}(n.layoutBox,t),this.elastic=function(e=XCt){return!1===e?e=0:!0===e&&(e=XCt),{x:QCt(e,"left","right"),y:QCt(e,"top","bottom")}}(r),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&tjt(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const r={};return void 0!==t.min&&(r.min=t.min-e.min),void 0!==t.max&&(r.max=t.max-e.min),r}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Zbt(e))return!1;const r=e.current;ybt(null!==r,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:n}=this.visualElement;if(!n||!n.layout)return!1;const o=function(e,t,r){const n=yjt(e,r),{scroll:o}=t;return o&&(fjt(n.x,o.offset.x),fjt(n.y,o.offset.y)),n}(r,n.root,this.visualElement.getTransformPagePoint());let a=function(e,t){return{x:GCt(e.x,t.x),y:GCt(e.y,t.y)}}(n.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=rjt(e))}return a}startAnimation(e){const{drag:t,dragMomentum:r,dragElastic:n,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:i}=this.getProps(),s=this.constraints||{},l=tjt(i=>{if(!kjt(i,t,this.currentDirection))return;let l=s&&s[i]||{};a&&(l={min:0,max:0});const c=n?200:1e6,u=n?40:1e7,d={type:"inertia",velocity:r?e[i]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(i,d)});return Promise.all(l).then(i)}startAxisValueAnimation(e,t){const r=this.getAxisMotionValue(e);return X_t(this.visualElement,e),r.start(mCt(e,r,0,t,this.visualElement,!1))}stopAnimation(){tjt(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){tjt(e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()})}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps();return r[t]||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){tjt(t=>{const{drag:r}=this.getProps();if(!kjt(t,r,this.currentDirection))return;const{projection:n}=this.visualElement,o=this.getAxisMotionValue(t);if(n&&n.layout){const{min:r,max:a}=n.layout.layoutBox[t];o.set(e[t]-lMt(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:r}=this.visualElement;if(!Zbt(t)||!r||!this.constraints)return;this.stopAnimation();const n={x:0,y:0};tjt(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const r=t.get();n[e]=function(e,t){let r=.5;const n=$Ct(e),o=$Ct(t);return o>n?r=xbt(t.min,t.max-n,e.min):n>o&&(r=xbt(e.min,e.max-o,t.min)),_kt(0,1,r)}({min:r,max:r},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),tjt(t=>{if(!kjt(t,e,null))return;const r=this.getAxisMotionValue(t),{min:o,max:a}=this.constraints[t];r.set(lMt(o,a,n[t]))})}addListeners(){if(!this.visualElement.current)return;xjt.set(this.visualElement,this);const e=zCt(this.visualElement.current,"pointerdown",e=>{const{drag:t,dragListener:r=!0}=this.getProps();t&&r&&this.start(e)}),t=()=>{const{dragConstraints:e}=this.getProps();Zbt(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,n=r.addEventListener("measure",t);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Cbt.read(t);const o=ECt(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(tjt(t=>{const r=this.getAxisMotionValue(t);r&&(this.originPoint[t]+=e[t].translate,r.set(r.get()+e[t].translate))}),this.visualElement.render())});return()=>{o(),e(),n(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:n=!1,dragConstraints:o=!1,dragElastic:a=XCt,dragMomentum:i=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:n,dragConstraints:o,dragElastic:a,dragMomentum:i}}}function kjt(e,t,r){return!(!0!==t&&t!==e||null!==r&&r!==e)}const _jt=e=>(t,r)=>{e&&Cbt.postRender(()=>e(t,r))};const wjt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Mjt(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Cjt={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Skt.test(e))return e;e=parseFloat(e)}return`${Mjt(e,t.target.x)}% ${Mjt(e,t.target.y)}%`}},jjt={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,o=Pwt.parse(e);if(o.length>5)return n;const a=Pwt.createTransformer(e),i="number"!=typeof o[0]?1:0,s=r.x.scale*t.x,l=r.y.scale*t.y;o[0+i]/=s,o[1+i]/=l;const c=lMt(s,l,.5);return"number"==typeof o[2+i]&&(o[2+i]/=c),"number"==typeof o[3+i]&&(o[3+i]/=c),a(o)}};class Djt extends e.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:n}=this.props,{projection:o}=e;(function(e){Object.assign(Gkt,e)})(Sjt),o&&(t.group&&t.group.add(o),r&&r.register&&n&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),wjt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:r,drag:n,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,n||e.layoutDependency!==t||void 0===t?a.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?a.promote():a.relegate()||Cbt.postRender(()=>{const e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Qbt.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:n}=e;n&&(n.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(n),r&&r.deregister&&r.deregister(n))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ojt(r){const[n,o]=cbt(),a=e.useContext(tbt);return t.jsx(Djt,{...r,layoutGroup:a,switchLayoutGroup:e.useContext(Jbt),isPresent:n,safeToRemove:o})}const Sjt={borderRadius:{...Cjt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Cjt,borderTopRightRadius:Cjt,borderBottomLeftRadius:Cjt,borderBottomRightRadius:Cjt,boxShadow:jjt};const Pjt=(e,t)=>e.depth-t.depth;class Tjt{constructor(){this.children=[],this.isDirty=!1}add(e){H_t(this.children,e),this.isDirty=!0}remove(e){W_t(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Pjt),this.isDirty=!1,this.children.forEach(e)}}const Ejt=["TopLeft","TopRight","BottomLeft","BottomRight"],Njt=Ejt.length,zjt=e=>"string"==typeof e?parseFloat(e):e,Ajt=e=>"number"==typeof e||Skt.test(e);function Rjt(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Fjt=Bjt(0,.5,lwt),Ljt=Bjt(.5,.95,mbt);function Bjt(e,t,r){return n=>n<e?0:n>t?1:r(xbt(e,t,n))}function Vjt(e,t){e.min=t.min,e.max=t.max}function Ijt(e,t){Vjt(e.x,t.x),Vjt(e.y,t.y)}function qjt(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function $jt(e,t,r,n,o){return e=ljt(e-=t,1/r,n),void 0!==o&&(e=ljt(e,1/o,n)),e}function Hjt(e,t,[r,n,o],a,i){!function(e,t=0,r=1,n=.5,o,a=e,i=e){if(Okt.test(t)&&(t=parseFloat(t),t=lMt(i.min,i.max,t/100)-i.min),"number"!=typeof t)return;let s=lMt(a.min,a.max,n);e===a&&(s-=t),e.min=$jt(e.min,t,r,s,o),e.max=$jt(e.max,t,r,s,o)}(e,t[r],t[n],t[o],t.scale,a,i)}const Wjt=["x","scaleX","originX"],Ujt=["y","scaleY","originY"];function Yjt(e,t,r,n){Hjt(e.x,t,Wjt,r?r.x:void 0,n?n.x:void 0),Hjt(e.y,t,Ujt,r?r.y:void 0,n?n.y:void 0)}function Zjt(e){return 0===e.translate&&1===e.scale}function Kjt(e){return Zjt(e.x)&&Zjt(e.y)}function Gjt(e,t){return e.min===t.min&&e.max===t.max}function Xjt(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Qjt(e,t){return Xjt(e.x,t.x)&&Xjt(e.y,t.y)}function Jjt(e){return $Ct(e.x)/$Ct(e.y)}function eDt(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class tDt{constructor(){this.members=[]}add(e){H_t(this.members,e),e.scheduleRender()}remove(e){if(W_t(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex(t=>e===t);if(0===t)return!1;let r;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){r=t;break}}return!!r&&(this.promote(r),!0)}promote(e,t){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:n}=e.options;!1===n&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:r}=e;t.onExitComplete&&t.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const rDt={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},nDt=typeof window<"u"&&void 0!==window.MotionDebug,oDt=["","X","Y","Z"],aDt={visibility:"hidden"};let iDt=0;function sDt(e,t,r,n){const{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),n&&(n[e]=0))}function lDt(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=Q_t(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:t,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",Cbt,!(t||n))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&lDt(n)}function cDt({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:o}){return class{constructor(e={},r=(null==t?void 0:t())){this.id=iDt++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,nDt&&(rDt.totalNodes=rDt.resolvedTargetDeltas=rDt.recalculatedProjection=0),this.nodes.forEach(pDt),this.nodes.forEach(xDt),this.nodes.forEach(bDt),this.nodes.forEach(hDt),nDt&&window.MotionDebug.record(rDt)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Tjt)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new U_t),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const r=this.eventHandlers.get(e);r&&r.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,r=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=function(e){return e instanceof SVGElement&&"svg"!==e.tagName}(t),this.instance=t;const{layoutId:n,layout:o,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),r&&(o||n)&&(this.isLayoutDirty=!0),e){let r;const n=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,r&&r(),r=function(e,t){const r=$_t.now(),n=({timestamp:o})=>{const a=o-r;a>=t&&(jbt(n),e(a-t))};return Cbt.read(n,!0),()=>jbt(n)}(n,250),wjt.hasAnimatedSinceResize&&(wjt.hasAnimatedSinceResize=!1,this.nodes.forEach(gDt))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&a&&(n||o)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:r,layout:n})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||a.getDefaultTransition()||jDt,{onLayoutAnimationStart:i,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!Qjt(this.targetLayout,n)||r,c=!t&&r;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...f_t(o,"layout"),onPlay:i,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||gDt(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,jbt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(kDt),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&lDt(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){const t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:t,layout:r}=this.options;if(void 0===t&&!r)return;const n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(mDt);this.isUpdating||this.nodes.forEach(vDt),this.isUpdating=!1,this.nodes.forEach(yDt),this.nodes.forEach(uDt),this.nodes.forEach(dDt),this.clearAllSnapshots();const e=$_t.now();Dbt.delta=_kt(0,1e3/60,e-Dbt.timestamp),Dbt.timestamp=e,Dbt.isProcessing=!0,Obt.update.process(Dbt),Obt.preRender.process(Dbt),Obt.render.process(Dbt),Dbt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Qbt.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(fDt),this.sharedNodes.forEach(_Dt)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Cbt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Cbt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!(this.instance&&(this.updateScroll(),this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty)))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!(!this.options.layoutScroll||!this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){const t=n(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Kjt(this.projectionDelta),r=this.getTransformTemplate(),n=r?r(this.latestValues,""):void 0,a=n!==this.prevTransformTemplateValue;e&&(t||ajt(this.latestValues)||a)&&(o(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let r=this.removeElementScroll(t);return e&&(r=this.removeTransform(r)),function(e){SDt(e.x),SDt(e.y)}(r),{animationId:this.root.animationId,measuredBox:t,layoutBox:r,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const r=t.measureViewportBox();if(!(null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)&&!this.path.some(TDt)){const{scroll:e}=this.root;e&&(fjt(r.x,e.offset.x),fjt(r.y,e.offset.y))}return r}removeElementScroll(e){var t;const r={x:{min:0,max:0},y:{min:0,max:0}};if(Ijt(r,e),null!==(t=this.scroll)&&void 0!==t&&t.wasRoot)return r;for(let t=0;t<this.path.length;t++){const n=this.path[t],{scroll:o,options:a}=n;n!==this.root&&o&&a.layoutScroll&&(o.wasRoot&&Ijt(r,e),fjt(r.x,o.offset.x),fjt(r.y,o.offset.y))}return r}applyTransform(e,t=!1){const r={x:{min:0,max:0},y:{min:0,max:0}};Ijt(r,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&vjt(r,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),ajt(n.latestValues)&&vjt(r,n.latestValues)}return ajt(this.latestValues)&&vjt(r,this.latestValues),r}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};Ijt(t,e);for(let e=0;e<this.path.length;e++){const r=this.path[e];if(!r.instance||!ajt(r.latestValues))continue;ojt(r.latestValues)&&r.updateSnapshot();const n=ejt();Ijt(n,r.measurePageBox()),Yjt(t,r.latestValues,r.snapshot?r.snapshot.layoutBox:void 0,n)}return ajt(this.latestValues)&&Yjt(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Dbt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const r=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=r.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=r.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=r.isSharedProjectionDirty);const n=!!this.resumingFrom||this!==r;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||null!==(t=this.parent)&&void 0!==t&&t.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:o,layoutId:a}=this.options;if(this.layout&&(o||a)){if(this.resolvedRelativeTargetAt=Dbt.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},ZCt(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),Ijt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),function(e,t,r){UCt(e.x,t.x,r.x),UCt(e.y,t.y,r.y)}(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ijt(this.target,this.layout.layoutBox),djt(this.target,this.targetDelta)):Ijt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&!!e.resumingFrom==!!this.resumingFrom&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},ZCt(this.relativeTargetOrigin,this.target,e.target),Ijt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}nDt&&rDt.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!ojt(this.parent.latestValues)&&!ijt(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!(!(this.relativeTarget||this.targetDelta||this.options.layoutRoot)||!this.layout)}calcProjection(){var e;const t=this.getLead(),r=!!this.resumingFrom||this!==t;let n=!0;if((this.isProjectionDirty||!(null===(e=this.parent)||void 0===e)&&e.isProjectionDirty)&&(n=!1),r&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Dbt.timestamp&&(n=!1),n)return;const{layout:o,layoutId:a}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!a)return;Ijt(this.layoutCorrected,this.layout.layoutBox);const i=this.treeScale.x,s=this.treeScale.y;(function(e,t,r,n=!1){const o=r.length;if(!o)return;let a,i;t.x=t.y=1;for(let s=0;s<o;s++){a=r[s],i=a.projectionDelta;const{visualElement:o}=a.options;o&&o.props.style&&"contents"===o.props.style.display||(n&&a.options.layoutScroll&&a.scroll&&a!==a.root&&vjt(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,djt(e,i)),n&&ajt(a.latestValues)&&vjt(e,a.latestValues))}t.x<hjt&&t.x>pjt&&(t.x=1),t.y<hjt&&t.y>pjt&&(t.y=1)})(this.layoutCorrected,this.treeScale,this.path,r),t.layout&&!t.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(qjt(this.prevProjectionDelta.x,this.projectionDelta.x),qjt(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),WCt(this.projectionDelta,this.layoutCorrected,l,this.latestValues),(this.treeScale.x!==i||this.treeScale.y!==s||!eDt(this.projectionDelta.x,this.prevProjectionDelta.x)||!eDt(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),nDt&&rDt.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const r=this.snapshot,n=r?r.latestValues:{},o={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const i={x:{min:0,max:0},y:{min:0,max:0}},s=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=!(!s||c||!0!==this.options.crossfade||this.path.some(CDt));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const r=t/1e3;wDt(a.x,e.x,r),wDt(a.y,e.y,r),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ZCt(i,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,r,n){MDt(e.x,t.x,r.x,n),MDt(e.y,t.y,r.y,n)}(this.relativeTarget,this.relativeTargetOrigin,i,r),d&&function(e,t){return Gjt(e.x,t.x)&&Gjt(e.y,t.y)}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Ijt(d,this.relativeTarget)),s&&(this.animationValues=o,function(e,t,r,n,o,a){o?(e.opacity=lMt(0,void 0!==r.opacity?r.opacity:1,Fjt(n)),e.opacityExit=lMt(void 0!==t.opacity?t.opacity:1,0,Ljt(n))):a&&(e.opacity=lMt(void 0!==t.opacity?t.opacity:1,void 0!==r.opacity?r.opacity:1,n));for(let o=0;o<Njt;o++){const a=`border${Ejt[o]}Radius`;let i=Rjt(t,a),s=Rjt(r,a);void 0===i&&void 0===s||(i||(i=0),s||(s=0),0===i||0===s||Ajt(i)===Ajt(s)?(e[a]=Math.max(lMt(zjt(i),zjt(s),n),0),(Okt.test(s)||Okt.test(i))&&(e[a]+="%")):e[a]=s)}(t.rotate||r.rotate)&&(e.rotate=lMt(t.rotate||0,r.rotate||0,n))}(o,n,this.latestValues,r,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=r},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(jbt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Cbt.update(()=>{wjt.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,r){const n=ukt(e)?e:K_t(e);return n.start(mCt("",n,t,r)),n.animation}(0,1e3,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:r,layout:n,latestValues:o}=e;if(t&&r&&n){if(this!==e&&this.layout&&n&&PDt(this.options.animationType,this.layout.layoutBox,n.layoutBox)){r=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=$Ct(this.layout.layoutBox.x);r.x.min=e.target.x.min,r.x.max=r.x.min+t;const n=$Ct(this.layout.layoutBox.y);r.y.min=e.target.y.min,r.y.max=r.y.min+n}Ijt(t,r),vjt(t,o),WCt(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new tDt),this.sharedNodes.get(e).add(t);const r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:r}={}){const n=this.getStack();n&&n.promote(this,r),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:r}=e;if((r.z||r.rotate||r.rotateX||r.rotateY||r.rotateZ||r.skewX||r.skewY)&&(t=!0),!t)return;const n={};r.z&&sDt("z",e,n,this.animationValues);for(let t=0;t<oDt.length;t++)sDt(`rotate${oDt[t]}`,e,n,this.animationValues),sDt(`skew${oDt[t]}`,e,n,this.animationValues);e.render();for(const t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}getProjectionStyles(e){var t,r;if(!this.instance||this.isSVG)return;if(!this.isVisible)return aDt;const n={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,n.opacity="",n.pointerEvents=dkt(null==e?void 0:e.pointerEvents)||"",n.transform=o?o(this.latestValues,""):"none",n;const a=this.getLead();if(!this.projectionDelta||!this.layout||!a.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=dkt(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!ajt(this.latestValues)&&(t.transform=o?o({},""):"none",this.hasProjected=!1),t}const i=a.animationValues||a.latestValues;this.applyTransformsToTarget(),n.transform=function(e,t,r){let n="";const o=e.x.translate/t.x,a=e.y.translate/t.y,i=(null==r?void 0:r.z)||0;if((o||a||i)&&(n=`translate3d(${o}px, ${a}px, ${i}px) `),(1!==t.x||1!==t.y)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:a,skewX:i,skewY:s}=r;e&&(n=`perspective(${e}px) ${n}`),t&&(n+=`rotate(${t}deg) `),o&&(n+=`rotateX(${o}deg) `),a&&(n+=`rotateY(${a}deg) `),i&&(n+=`skewX(${i}deg) `),s&&(n+=`skewY(${s}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==s||1!==l)&&(n+=`scale(${s}, ${l})`),n||"none"}(this.projectionDeltaWithTransform,this.treeScale,i),o&&(n.transform=o(i,n.transform));const{x:s,y:l}=this.projectionDelta;n.transformOrigin=`${100*s.origin}% ${100*l.origin}% 0`,a.animationValues?n.opacity=a===this?null!==(r=null!==(t=i.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==r?r:1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n.opacity=a===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0;for(const e in Gkt){if(void 0===i[e])continue;const{correct:t,applyTo:r}=Gkt[e],o="none"===n.transform?i[e]:t(i[e],a);if(r){const e=r.length;for(let t=0;t<e;t++)n[r[t]]=o}else n[e]=o}return this.options.layoutId&&(n.pointerEvents=a===this?dkt(null==e?void 0:e.pointerEvents)||"":"none"),n}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(mDt),this.root.sharedNodes.clear()}}}function uDt(e){e.updateLayout()}function dDt(e){var t;const r=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:n}=e.layout,{animationType:o}=e.options,a=r.source!==e.layout.source;"size"===o?tjt(e=>{const n=a?r.measuredBox[e]:r.layoutBox[e],o=$Ct(n);n.min=t[e].min,n.max=n.min+o}):PDt(o,r.layoutBox,t)&&tjt(n=>{const o=a?r.measuredBox[n]:r.layoutBox[n],i=$Ct(t[n]);o.max=o.min+i,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[n].max=e.relativeTarget[n].min+i)});const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};WCt(i,t,r.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};a?WCt(s,e.applyTransform(n,!0),r.measuredBox):WCt(s,t,r.layoutBox);const l=!Kjt(i);let c=!1;if(!e.resumeFrom){const n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:o,layout:a}=n;if(o&&a){const i={x:{min:0,max:0},y:{min:0,max:0}};ZCt(i,r.layoutBox,o.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};ZCt(s,t,a.layoutBox),Qjt(i,s)||(c=!0),n.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=i,e.relativeParent=n)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:r,delta:s,layoutDelta:i,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function pDt(e){nDt&&rDt.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function hDt(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function fDt(e){e.clearSnapshot()}function mDt(e){e.clearMeasurements()}function vDt(e){e.isLayoutDirty=!1}function yDt(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function gDt(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function xDt(e){e.resolveTargetDelta()}function bDt(e){e.calcProjection()}function kDt(e){e.resetSkewAndRotation()}function _Dt(e){e.removeLeadSnapshot()}function wDt(e,t,r){e.translate=lMt(t.translate,0,r),e.scale=lMt(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function MDt(e,t,r,n){e.min=lMt(t.min,r.min,n),e.max=lMt(t.max,r.max,n)}function CDt(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const jDt={duration:.45,ease:[.4,0,.1,1]},DDt=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ODt=DDt("applewebkit/")&&!DDt("chrome/")?Math.round:mbt;function SDt(e){e.min=ODt(e.min),e.max=ODt(e.max)}function PDt(e,t,r){return"position"===e||"preserve-aspect"===e&&!function(e,t,r){return Math.abs(e-t)<=r}(Jjt(t),Jjt(r),.2)}function TDt(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const EDt=cDt({attachResizeListener:(e,t)=>ECt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),NDt={current:void 0},zDt=cDt({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!NDt.current){const e=new EDt({});e.mount(window),e.setOptions({layoutScroll:!0}),NDt.current=e}return NDt.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position}),ADt={pan:{Feature:class extends SCt{constructor(){super(...arguments),this.removePointerDownListener=mbt}onPointerDown(e){this.session=new RCt(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:gjt(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:_jt(e),onStart:_jt(t),onMove:r,onEnd:(e,t)=>{delete this.session,n&&Cbt.postRender(()=>n(e,t))}}}mount(){this.removePointerDownListener=zCt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends SCt{constructor(e){super(e),this.removeGroupControls=mbt,this.removeListeners=mbt,this.controls=new bjt(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||mbt}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:zDt,MeasureLayout:Ojt}};function RDt(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover","Start"===r);const o=n["onHover"+r];o&&Cbt.postRender(()=>o(t,NCt(t)))}function FDt(e,t,r){const{props:n}=e;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap","Start"===r);const o=n["onTap"+("End"===r?"":r)];o&&Cbt.postRender(()=>o(t,NCt(t)))}const LDt=new WeakMap,BDt=new WeakMap,VDt=e=>{const t=LDt.get(e.target);t&&t(e)},IDt=e=>{e.forEach(VDt)};function qDt(e,t,r){const n=function({root:e,...t}){const r=e||document;BDt.has(r)||BDt.set(r,{});const n=BDt.get(r),o=JSON.stringify(t);return n[o]||(n[o]=new IntersectionObserver(IDt,{root:e,...t})),n[o]}(t);return LDt.set(e,r),n.observe(e),()=>{LDt.delete(e),n.unobserve(e)}}const $Dt={some:0,all:1};const HDt={inView:{Feature:class extends SCt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:r,amount:n="some",once:o}=e,a={root:t?t.current:void 0,rootMargin:r,threshold:"number"==typeof n?n:$Dt[n]};return qDt(this.node.current,a,e=>{const{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,o&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:r,onViewportLeave:n}=this.node.getProps(),a=t?r:n;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends SCt{mount(){const{current:e}=this.node;e&&(this.unmount=B_t(e,e=>(FDt(this.node,e,"Start"),(e,{success:t})=>FDt(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends SCt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=vMt(ECt(this.node.current,"focus",()=>this.onFocus()),ECt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends SCt{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,r={}){const[n,o,a]=P_t(e,r),i=T_t(e=>{const{target:r}=e,n=t(e);if("function"!=typeof n||!r)return;const a=T_t(e=>{n(e),r.removeEventListener("pointerleave",a)});r.addEventListener("pointerleave",a,o)});return n.forEach(e=>{e.addEventListener("pointerenter",i,o)}),a}(e,e=>(RDt(this.node,e,"Start"),e=>RDt(this.node,e,"End"))))}unmount(){}}}},WDt={layout:{ProjectionNode:zDt,MeasureLayout:Ojt}},UDt={current:null},YDt={current:!1};const ZDt=[...tMt,kwt,Pwt],KDt=new WeakMap;const GDt=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class XDt{scrapeMotionValuesFromProps(e,t,r){return{}}constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:n,blockInitialAnimation:o,visualState:a},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Gwt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=$_t.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Cbt.render(this.render,!1,!0))};const{latestValues:s,renderState:l,onUpdate:c}=a;this.onUpdate=c,this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=i,this.blockInitialAnimation=!!o,this.isControllingVariants=$bt(t),this.isVariantNode=Hbt(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!(!e||!e.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in d){const t=d[e];void 0!==s[e]&&ukt(t)&&t.set(s[e],!1)}}mount(e){this.current=e,KDt.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),YDt.current||function(){if(YDt.current=!0,pbt)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>UDt.current=e.matches;e.addListener(t),t()}else UDt.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||UDt.current),"production"!==process.env.NODE_ENV&&Rbt(!0!==this.shouldReduceMotion,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){KDt.delete(this.current),this.projection&&this.projection.unmount(),jbt(this.notifyUpdate),jbt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=mkt.has(e),n=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&Cbt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=t.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{n(),o(),a&&a(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Tbt){const t=Tbt[e];if(!t)continue;const{isEnabled:r,Feature:n}=t;if(!this.features[e]&&n&&r(this.props)&&(this.features[e]=new n(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<GDt.length;t++){const r=GDt[t];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const n=e["on"+r];n&&(this.propEventSubscriptions[r]=this.on(r,n))}this.prevMotionValues=function(e,t,r){for(const n in t){const o=t[n],a=r[n];if(ukt(o))e.addValue(n,o),"development"===process.env.NODE_ENV&&Rbt("11.18.2"===o.version,`Attempting to mix Motion versions ${o.version} with 11.18.2 may not work as expected.`);else if(ukt(a))e.addValue(n,K_t(o,{owner:e}));else if(a!==o)if(e.hasValue(n)){const t=e.getValue(n);!0===t.liveStyle?t.jump(o):t.hasAnimated||t.set(o)}else{const t=e.getStaticValue(n);e.addValue(n,K_t(void 0!==t?t:o,{owner:e}))}}for(const n in r)void 0===t[n]&&e.removeValue(n);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const r=this.values.get(e);t!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return void 0===r&&void 0!==t&&(r=K_t(null===t?void 0:t,{owner:this}),this.addValue(e,r)),r}readValue(e,t){var r;let n=void 0===this.latestValues[e]&&this.current?null!==(r=this.getBaseTargetFromProps(this.props,e))&&void 0!==r?r:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=n&&("string"==typeof n&&(Xwt(n)||uwt(n))?n=parseFloat(n):!(e=>ZDt.find(eMt(e)))(n)&&Pwt.test(t)&&(n=Fwt(e,t)),this.setBaseTarget(e,ukt(n)?n.get():n)),ukt(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:r}=this.props;let n;if("string"==typeof r||"object"==typeof r){const o=skt(this.props,r,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(n=o[e])}if(r&&void 0!==n)return n;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||ukt(o)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new U_t),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class QDt extends XDt{constructor(){super(...arguments),this.KeyframeResolver=nMt}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:r}){delete t[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ukt(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class JDt extends QDt{constructor(){super(...arguments),this.type="html",this.renderInstance=Ykt}readValueFromInstance(e,t){if(mkt.has(t)){const e=Rwt(t);return e&&e.default||0}{const r=function(e){return window.getComputedStyle(e)}(e),n=(ykt(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return yjt(e,t)}build(e,t,r){Bkt(e,t,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,r){return Qkt(e,t,r)}}class eOt extends QDt{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ejt}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(mkt.has(t)){const e=Rwt(t);return e&&e.default||0}return t=Zkt.has(t)?t:Gbt(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,r){return Jkt(e,t,r)}build(e,t,r){$kt(e,t,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,r,n){Kkt(e,t,0,n)}mount(e){this.isSVGTag=Ukt(e.tagName),super.mount(e)}}const tOt=(t,r)=>akt(t)?new eOt(r):new JDt(r,{allowProjection:t!==e.Fragment}),rOt=Fbt(l_t({...TCt,...HDt,...ADt,...WDt},tOt)),nOt=e.forwardRef(({value:e,onChange:r,...n},o)=>{const a=t=>{const[n,o]=e.split(":").map(Number);let a=n,i=o;"up"===t?(i+=15,i>=60&&(i=0,a=(a+1)%24)):(i-=15,i<0&&(i=45,a=(a-1+24)%24));const s=`${String(a).padStart(2,"0")}:${String(i).padStart(2,"0")}`;r(s)};return t.jsxs("div",{className:"relative",children:[t.jsx(cyt,{type:"time",ref:o,value:e,onChange:e=>r(e.target.value),...n,className:"pr-8"}),t.jsxs("div",{className:"absolute right-1 top-1 bottom-1 flex flex-col justify-center",children:[t.jsx($ht,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4",onClick:()=>a("up"),children:t.jsx(Zst,{className:"h-3 w-3"})}),t.jsx($ht,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4",onClick:()=>a("down"),children:t.jsx(Wst,{className:"h-3 w-3"})})]})]})});function oOt(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function aOt(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;return JSON.stringify(Object.keys(e.breakpoints||{}))===JSON.stringify(Object.keys(t.breakpoints||{}))&&r.every(r=>{const n=e[r],o=t[r];return"function"==typeof n?`${n}`==`${o}`:oOt(n)&&oOt(o)?aOt(n,o):n===o})}function iOt(e){return e.concat().sort((e,t)=>e.name>t.name?1:-1).map(e=>e.options)}function sOt(e){return"number"==typeof e}function lOt(e){return"string"==typeof e}function cOt(e){return"boolean"==typeof e}function uOt(e){return"[object Object]"===Object.prototype.toString.call(e)}function dOt(e){return Math.abs(e)}function pOt(e){return Math.sign(e)}function hOt(e,t){return dOt(e-t)}function fOt(e){return xOt(e).map(Number)}function mOt(e){return e[vOt(e)]}function vOt(e){return Math.max(0,e.length-1)}function yOt(e,t){return t===vOt(e)}function gOt(e,t=0){return Array.from(Array(e),(e,r)=>t+r)}function xOt(e){return Object.keys(e)}function bOt(e,t){return[e,t].reduce((e,t)=>(xOt(t).forEach(r=>{const n=e[r],o=t[r],a=uOt(n)&&uOt(o);e[r]=a?bOt(n,o):o}),e),{})}function kOt(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function _Ot(){let e=[];const t={add:function(r,n,o,a={passive:!0}){let i;if("addEventListener"in r)r.addEventListener(n,o,a),i=()=>r.removeEventListener(n,o,a);else{const e=r;e.addListener(o),i=()=>e.removeListener(o)}return e.push(i),t},clear:function(){e=e.filter(e=>e())}};return t}function wOt(e,t,r,n){const o=_Ot(),a=1e3/60;let i=null,s=0,l=0;function c(e){if(!l)return;i||(i=e,r(),r());const o=e-i;for(i=e,s+=o;s>=a;)r(),s-=a;n(s/a),l&&(l=t.requestAnimationFrame(c))}function u(){t.cancelAnimationFrame(l),i=null,s=0,l=0}return{init:function(){o.add(e,"visibilitychange",()=>{e.hidden&&(i=null,s=0)})},destroy:function(){u(),o.clear()},start:function(){l||(l=t.requestAnimationFrame(c))},stop:u,update:r,render:n}}function MOt(e=0,t=0){const r=dOt(e-t);function n(t){return t<e}function o(e){return e>t}function a(e){return n(e)||o(e)}return{length:r,max:t,min:e,constrain:function(r){return a(r)?n(r)?e:t:r},reachedAny:a,reachedMax:o,reachedMin:n,removeOffset:function(e){return r?e-r*Math.ceil((e-t)/r):e}}}function COt(e,t,r){const{constrain:n}=MOt(0,e),o=e+1;let a=i(t);function i(e){return r?dOt((o+e)%o):n(e)}function s(){return a}function l(){return COt(e,s(),r)}const c={get:s,set:function(e){return a=i(e),c},add:function(e){return l().set(s()+e)},clone:l};return c}function jOt(e,t,r,n,o,a,i,s,l,c,u,d,p,h,f,m,v,y,g){const{cross:x,direction:b}=e,k=["INPUT","SELECT","TEXTAREA"],_={passive:!1},w=_Ot(),M=_Ot(),C=MOt(50,225).constrain(h.measure(20)),j={mouse:300,touch:400},D={mouse:500,touch:600},O=f?43:25;let S=!1,P=0,T=0,E=!1,N=!1,z=!1,A=!1;function R(e){if(!kOt(e,n)&&e.touches.length>=2)return F(e);const t=a.readPoint(e),r=a.readPoint(e,x),i=hOt(t,P),l=hOt(r,T);if(!(N||A||e.cancelable&&(N=i>l,N)))return F(e);const u=a.pointerMove(e);i>m&&(z=!0),c.useFriction(.3).useDuration(.75),s.start(),o.add(b(u)),e.preventDefault()}function F(e){const t=u.byDistance(0,!1).index!==d.get(),r=a.pointerUp(e)*(f?D:j)[A?"mouse":"touch"],n=function(e,t){const r=d.add(-1*pOt(e)),n=u.byDistance(e,!f).distance;return f||dOt(e)<C?n:v&&t?.5*n:u.byIndex(r.get(),0).distance}(b(r),t),o=function(e,t){if(0===e||0===t||dOt(e)<=dOt(t))return 0;const r=hOt(dOt(e),dOt(t));return dOt(r/e)}(r,n),i=O-10*o,s=y+o/50;N=!1,E=!1,M.clear(),c.useDuration(i).useFriction(s),l.distance(n,!f),A=!1,p.emit("pointerUp")}function L(e){z&&(e.stopPropagation(),e.preventDefault(),z=!1)}return{init:function(e){if(!g)return;function s(s){(cOt(g)||g(e,s))&&function(e){const s=kOt(e,n);A=s,z=f&&s&&!e.buttons&&S,S=hOt(o.get(),i.get())>=2,(!s||0===e.button)&&(function(e){const t=e.nodeName||"";return k.includes(t)}(e.target)||(E=!0,a.pointerDown(e),c.useFriction(0).useDuration(0),o.set(i),function(){const e=A?r:t;M.add(e,"touchmove",R,_).add(e,"touchend",F).add(e,"mousemove",R,_).add(e,"mouseup",F)}(),P=a.readPoint(e),T=a.readPoint(e,x),p.emit("pointerDown")))}(s)}const l=t;w.add(l,"dragstart",e=>e.preventDefault(),_).add(l,"touchmove",()=>{},_).add(l,"touchend",()=>{}).add(l,"touchstart",s).add(l,"mousedown",s).add(l,"touchcancel",F).add(l,"contextmenu",F).add(l,"click",L,!0)},destroy:function(){w.clear(),M.clear()},pointerDown:function(){return E}}}function DOt(e,t){let r,n;function o(e){return e.timeStamp}function a(r,n){const o="client"+("x"===(n||e.scroll)?"X":"Y");return(kOt(r,t)?r:r.touches[0])[o]}return{pointerDown:function(e){return r=e,n=e,a(e)},pointerMove:function(e){const t=a(e)-a(n),i=o(e)-o(r)>170;return n=e,i&&(r=e),t},pointerUp:function(e){if(!r||!n)return 0;const t=a(n)-a(r),i=o(e)-o(r),s=o(e)-o(n)>170,l=t/i;return i&&!s&&dOt(l)>.1?l:0},readPoint:a}}function OOt(e,t,r,n,o,a,i){const s=[e].concat(n);let l,c,u=[],d=!1;function p(e){return o.measureSize(i.measure(e))}return{init:function(o){a&&(c=p(e),u=n.map(p),l=new ResizeObserver(r=>{(cOt(a)||a(o,r))&&function(r){for(const a of r){if(d)return;const r=a.target===e,i=n.indexOf(a.target),s=r?c:u[i];if(dOt(p(r?e:n[i])-s)>=.5){o.reInit(),t.emit("resize");break}}}(r)}),r.requestAnimationFrame(()=>{s.forEach(e=>l.observe(e))}))},destroy:function(){d=!0,l&&l.disconnect()}}}function SOt(e,t,r,n,o){const a=o.measure(10),i=o.measure(50),s=MOt(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(r.get())||!e.reachedAny(t.get()))}return{shouldConstrain:c,constrain:function(o){if(!c())return;const l=e.reachedMin(t.get())?"min":"max",u=dOt(e[l]-t.get()),d=r.get()-t.get(),p=s.constrain(u/i);r.subtract(d*p),!o&&dOt(d)<a&&(r.set(e.constrain(r.get())),n.useDuration(25).useBaseFriction())},toggleActive:function(e){l=!e}}}function POt(e,t,r,n){const o=t.min+.1,a=t.max+.1,{reachedMin:i,reachedMax:s}=MOt(o,a);return{loop:function(t){if(!function(e){return 1===e?s(r.get()):-1===e&&i(r.get())}(t))return;const o=e*(-1*t);n.forEach(e=>e.add(o))}}}function TOt(e,t,r,n,o){const{reachedAny:a,removeOffset:i,constrain:s}=n;function l(e){return e.concat().sort((e,t)=>dOt(e)-dOt(t))[0]}function c(t,n){const o=[t,t+r,t-r];if(!e)return t;if(!n)return l(o);const a=o.filter(e=>pOt(e)===n);return a.length?l(a):mOt(o)-r}return{byDistance:function(r,n){const l=o.get()+r,{index:u,distance:d}=function(r){const n=e?i(r):s(r),o=t.map((e,t)=>({diff:c(e-n,0),index:t})).sort((e,t)=>dOt(e.diff)-dOt(t.diff)),{index:a}=o[0];return{index:a,distance:n}}(l),p=!e&&a(l);return!n||p?{index:u,distance:r}:{index:u,distance:r+c(t[u]-d,0)}},byIndex:function(e,r){return{index:e,distance:c(t[e]-o.get(),r)}},shortcut:c}}function EOt(e,t,r,n,o,a,i,s){const l={passive:!0,capture:!0};let c=0;function u(e){"Tab"===e.code&&(c=(new Date).getTime())}return{init:function(d){s&&(a.add(document,"keydown",u,!1),t.forEach((t,u)=>{a.add(t,"focus",t=>{(cOt(s)||s(d,t))&&function(t){if((new Date).getTime()-c>10)return;i.emit("slideFocusStart"),e.scrollLeft=0;const a=r.findIndex(e=>e.includes(t));sOt(a)&&(o.useDuration(0),n.index(a,0),i.emit("slideFocus"))}(u)},l)}))}}}function NOt(e){let t=e;function r(e){return sOt(e)?e:e.get()}return{get:function(){return t},set:function(e){t=r(e)},add:function(e){t+=r(e)},subtract:function(e){t-=r(e)}}}function zOt(e,t){const r="x"===e.scroll?function(e){return`translate3d(${e}px,0px,0px)`}:function(e){return`translate3d(0px,${e}px,0px)`},n=t.style;let o=null,a=!1;return{clear:function(){a||(n.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){if(a)return;const i=function(e){return Math.round(100*e)/100}(e.direction(t));i!==o&&(n.transform=r(i),o=i)},toggleActive:function(e){a=!e}}}function AOt(e,t,r,n,o,a,i,s,l){const c=fOt(o),u=fOt(o).reverse(),d=function(){const e=i[0],t=h(u,e);return f(t,r,!1)}().concat(function(){const e=t-i[0]-1,n=h(c,e);return f(n,-r,!0)}());function p(e,t){return e.reduce((e,t)=>e-o[t],t)}function h(e,t){return e.reduce((e,r)=>p(e,t)>0?e.concat([r]):e,[])}function f(o,i,c){const u=function(e){return a.map((r,o)=>({start:r-n[o]+.5+e,end:r+t-.5+e}))}(i);return o.map(t=>{const n=c?0:-r,o=c?r:0,a=c?"end":"start",i=u[t][a];return{index:t,loopPoint:i,slideLocation:NOt(-1),translate:zOt(e,l[t]),target:()=>s.get()>i?n:o}})}return{canLoop:function(){return d.every(({index:e})=>{const r=c.filter(t=>t!==e);return p(r,t)<=.1})},clear:function(){d.forEach(e=>e.translate.clear())},loop:function(){d.forEach(e=>{const{target:t,translate:r,slideLocation:n}=e,o=t();o!==n.get()&&(r.to(o),n.set(o))})},loopPoints:d}}function ROt(e,t,r){let n,o=!1;return{init:function(a){r&&(n=new MutationObserver(e=>{o||(cOt(r)||r(a,e))&&function(e){for(const r of e)if("childList"===r.type){a.reInit(),t.emit("slidesChanged");break}}(e)}),n.observe(e,{childList:!0}))},destroy:function(){n&&n.disconnect(),o=!0}}}function FOt(e,t,r,n){const o={};let a,i=null,s=null,l=!1;return{init:function(){a=new IntersectionObserver(e=>{l||(e.forEach(e=>{const r=t.indexOf(e.target);o[r]=e}),i=null,s=null,r.emit("slidesInView"))},{root:e.parentElement,threshold:n}),t.forEach(e=>a.observe(e))},destroy:function(){a&&a.disconnect(),l=!0},get:function(e=!0){if(e&&i)return i;if(!e&&s)return s;const t=function(e){return xOt(o).reduce((t,r)=>{const n=parseInt(r),{isIntersecting:a}=o[n];return(e&&a||!e&&!a)&&t.push(n),t},[])}(e);return e&&(i=t),e||(s=t),t}}}function LOt(e,t,r,n,o,a,i,s,l){const{startEdge:c,endEdge:u,direction:d}=e,p=sOt(r);return{groupSlides:function(e){return p?function(e,t){return fOt(e).filter(e=>e%t===0).map(r=>e.slice(r,r+t))}(e,r):function(e){return e.length?fOt(e).reduce((r,p,h)=>{const f=mOt(r)||0,m=0===f,v=p===vOt(e),y=o[c]-a[f][c],g=o[c]-a[p][u],x=!n&&m?d(i):0,b=dOt(g-(!n&&v?d(s):0)-(y+x));return h&&b>t+l&&r.push(p),v&&r.push(e.length),r},[]).map((t,r,n)=>{const o=Math.max(n[r-1]||0);return e.slice(o,t)}):[]}(e)}}}function BOt(e,t,r,n,o,a,i){const{align:s,axis:l,direction:c,startIndex:u,loop:d,duration:p,dragFree:h,dragThreshold:f,inViewThreshold:m,slidesToScroll:v,skipSnaps:y,containScroll:g,watchResize:x,watchSlides:b,watchDrag:k,watchFocus:_}=a,w={measure:function(e){const{offsetTop:t,offsetLeft:r,offsetWidth:n,offsetHeight:o}=e;return{top:t,right:r+n,bottom:t+o,left:r,width:n,height:o}}},M=w.measure(t),C=r.map(w.measure),j=function(e,t){const r="rtl"===t,n="y"===e,o=!n&&r?-1:1;return{scroll:n?"y":"x",cross:n?"x":"y",startEdge:n?"top":r?"right":"left",endEdge:n?"bottom":r?"left":"right",measureSize:function(e){const{height:t,width:r}=e;return n?t:r},direction:function(e){return e*o}}}(l,c),D=j.measureSize(M),O=function(e){return{measure:function(t){return e*(t/100)}}}(D),S=function(e,t){const r={start:function(){return 0},center:function(e){return n(e)/2},end:n};function n(e){return t-e}return{measure:function(n,o){return lOt(e)?r[e](n):e(t,n,o)}}}(s,D),P=!d&&!!g,T=d||!!g,{slideSizes:E,slideSizesWithGaps:N,startGap:z,endGap:A}=function(e,t,r,n,o,a){const{measureSize:i,startEdge:s,endEdge:l}=e,c=r[0]&&o,u=function(){if(!c)return 0;const e=r[0];return dOt(t[s]-e[s])}(),d=function(){if(!c)return 0;const e=a.getComputedStyle(mOt(n));return parseFloat(e.getPropertyValue(`margin-${l}`))}(),p=r.map(i),h=r.map((e,t,r)=>{const n=!t,o=yOt(r,t);return n?p[t]+u:o?p[t]+d:r[t+1][s]-e[s]}).map(dOt);return{slideSizes:p,slideSizesWithGaps:h,startGap:u,endGap:d}}(j,M,C,r,T,o),R=LOt(j,D,v,d,M,C,z,A,2),{snaps:F,snapsAligned:L}=function(e,t,r,n,o){const{startEdge:a,endEdge:i}=e,{groupSlides:s}=o,l=s(n).map(e=>mOt(e)[i]-e[0][a]).map(dOt).map(t.measure),c=n.map(e=>r[a]-e[a]).map(e=>-dOt(e)),u=s(c).map(e=>e[0]).map((e,t)=>e+l[t]);return{snaps:c,snapsAligned:u}}(j,S,M,C,R),B=-mOt(F)+mOt(N),{snapsContained:V,scrollContainLimit:I}=function(e,t,r,n,o){const a=MOt(-t+e,0),i=r.map((e,t)=>{const{min:n,max:o}=a,i=a.constrain(e),s=!t,l=yOt(r,t);return s?o:l||c(n,i)?n:c(o,i)?o:i}).map(e=>parseFloat(e.toFixed(3))),s=function(){const e=i[0],t=mOt(i);return MOt(i.lastIndexOf(e),i.indexOf(t)+1)}(),l=function(){if(t<=e+o)return[a.max];if("keepSnaps"===n)return i;const{min:r,max:l}=s;return i.slice(r,l)}();function c(e,t){return hOt(e,t)<=1}return{snapsContained:l,scrollContainLimit:s}}(D,B,L,g,2),q=P?V:L,{limit:$}=function(e,t,r){const n=t[0];return{limit:MOt(r?n-e:mOt(t),n)}}(B,q,d),H=COt(vOt(q),u,d),W=H.clone(),U=fOt(r),Y=wOt(n,o,()=>(({dragHandler:e,scrollBody:t,scrollBounds:r,options:{loop:n}})=>{n||r.constrain(e.pointerDown()),t.seek()})(se),e=>(({scrollBody:e,translate:t,location:r,offsetLocation:n,previousLocation:o,scrollLooper:a,slideLooper:i,dragHandler:s,animation:l,eventHandler:c,scrollBounds:u,options:{loop:d}},p)=>{const h=e.settled(),f=!u.shouldConstrain(),m=d?h:h&&f,v=m&&!s.pointerDown();v&&l.stop();const y=r.get()*p+o.get()*(1-p);n.set(y),d&&(a.loop(e.direction()),i.loop()),t.to(n.get()),v&&c.emit("settle"),m||c.emit("scroll")})(se,e)),Z=q[H.get()],K=NOt(Z),G=NOt(Z),X=NOt(Z),Q=NOt(Z),J=function(e,t,r,n,o,a){let i=0,s=0,l=o,c=a,u=e.get(),d=0;function p(e){return l=e,f}function h(e){return c=e,f}const f={direction:function(){return s},duration:function(){return l},velocity:function(){return i},seek:function(){const t=n.get()-e.get();let o=0;return l?(r.set(e),i+=t/l,i*=c,u+=i,e.add(i),o=u-d):(i=0,r.set(n),e.set(n),o=t),s=pOt(o),d=u,f},settled:function(){return dOt(n.get()-t.get())<.001},useBaseFriction:function(){return h(a)},useBaseDuration:function(){return p(o)},useFriction:h,useDuration:p};return f}(K,X,G,Q,p,.68),ee=TOt(d,q,B,$,Q),te=function(e,t,r,n,o,a,i){function s(o){const s=o.distance,l=o.index!==t.get();a.add(s),s&&(n.duration()?e.start():(e.update(),e.render(1),e.update())),l&&(r.set(t.get()),t.set(o.index),i.emit("select"))}return{distance:function(e,t){s(o.byDistance(e,t))},index:function(e,r){const n=t.clone().set(e);s(o.byIndex(n.get(),r))}}}(Y,H,W,J,ee,Q,i),re=function(e){const{max:t,length:r}=e;return{get:function(e){return r?(e-t)/-r:0}}}($),ne=_Ot(),oe=FOt(t,r,i,m),{slideRegistry:ae}=function(e,t,r,n,o,a){const{groupSlides:i}=o,{min:s,max:l}=n,c=function(){const n=i(a),o=!e||"keepSnaps"===t;return 1===r.length?[a]:o?n:n.slice(s,l).map((e,t,r)=>{const n=!t,o=yOt(r,t);return n?gOt(mOt(r[0])+1):o?gOt(vOt(a)-mOt(r)[0]+1,mOt(r)[0]):e})}();return{slideRegistry:c}}(P,g,q,I,R,U),ie=EOt(e,r,ae,te,J,ne,i,_),se={ownerDocument:n,ownerWindow:o,eventHandler:i,containerRect:M,slideRects:C,animation:Y,axis:j,dragHandler:jOt(j,e,n,o,Q,DOt(j,o),K,Y,te,J,ee,H,i,O,h,f,y,.68,k),eventStore:ne,percentOfView:O,index:H,indexPrevious:W,limit:$,location:K,offsetLocation:X,previousLocation:G,options:a,resizeHandler:OOt(t,i,o,r,j,x,w),scrollBody:J,scrollBounds:SOt($,X,Q,J,O),scrollLooper:POt(B,$,X,[K,X,G,Q]),scrollProgress:re,scrollSnapList:q.map(re.get),scrollSnaps:q,scrollTarget:ee,scrollTo:te,slideLooper:AOt(j,D,B,E,N,F,q,X,r),slideFocus:ie,slidesHandler:ROt(t,i,b),slidesInView:oe,slideIndexes:U,slideRegistry:ae,slidesToScroll:R,target:Q,translate:zOt(j,t)};return se}nOt.displayName="TimeInput";const VOt={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function IOt(e){function t(e,t){return bOt(e,t||{})}return{mergeOptions:t,optionsAtMedia:function(r){const n=r.breakpoints||{},o=xOt(n).filter(t=>e.matchMedia(t).matches).map(e=>n[e]).reduce((e,r)=>t(e,r),{});return t(r,o)},optionsMediaQueries:function(t){return t.map(e=>xOt(e.breakpoints||{})).reduce((e,t)=>e.concat(t),[]).map(e.matchMedia)}}}function qOt(e,t,r){const n=e.ownerDocument,o=n.defaultView,a=IOt(o),i=function(e){let t=[];return{init:function(r,n){return t=n.filter(({options:t})=>!1!==e.optionsAtMedia(t).active),t.forEach(t=>t.init(r,e)),n.reduce((e,t)=>Object.assign(e,{[t.name]:t}),{})},destroy:function(){t=t.filter(e=>e.destroy())}}}(a),s=_Ot(),l=function(){let e,t={};function r(e){return t[e]||[]}const n={init:function(t){e=t},emit:function(t){return r(t).forEach(r=>r(e,t)),n},off:function(e,o){return t[e]=r(e).filter(e=>e!==o),n},on:function(e,o){return t[e]=r(e).concat([o]),n},clear:function(){t={}}};return n}(),{mergeOptions:c,optionsAtMedia:u,optionsMediaQueries:d}=a,{on:p,off:h,emit:f}=l,m=j;let v,y,g,x,b=!1,k=c(VOt,qOt.globalOptions),_=c(k),w=[];function M(t){const r=BOt(e,g,x,n,o,t,l);if(t.loop&&!r.slideLooper.canLoop()){return M(Object.assign({},t,{loop:!1}))}return r}function C(t,r){b||(k=c(k,t),_=u(k),w=r||w,function(){const{container:t,slides:r}=_;g=(lOt(t)?e.querySelector(t):t)||e.children[0];const n=lOt(r)?g.querySelectorAll(r):r;x=[].slice.call(n||g.children)}(),v=M(_),d([k,...w.map(({options:e})=>e)]).forEach(e=>s.add(e,"change",j)),_.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(P),v.eventHandler.init(P),v.resizeHandler.init(P),v.slidesHandler.init(P),v.options.loop&&v.slideLooper.loop(),g.offsetParent&&x.length&&v.dragHandler.init(P),y=i.init(P,w)))}function j(e,t){const r=S();D(),C(c({startIndex:r},e),t),l.emit("reInit")}function D(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),i.destroy(),s.clear()}function O(e,t,r){!_.active||b||(v.scrollBody.useBaseFriction().useDuration(!0===t?0:_.duration),v.scrollTo.index(e,r||0))}function S(){return v.index.get()}const P={canScrollNext:function(){return v.index.add(1).get()!==S()},canScrollPrev:function(){return v.index.add(-1).get()!==S()},containerNode:function(){return g},internalEngine:function(){return v},destroy:function(){b||(b=!0,s.clear(),D(),l.emit("destroy"),l.clear())},off:h,on:p,emit:f,plugins:function(){return y},previousScrollSnap:function(){return v.indexPrevious.get()},reInit:m,rootNode:function(){return e},scrollNext:function(e){O(v.index.add(1).get(),e,-1)},scrollPrev:function(e){O(v.index.add(-1).get(),e,1)},scrollProgress:function(){return v.scrollProgress.get(v.offsetLocation.get())},scrollSnapList:function(){return v.scrollSnapList},scrollTo:O,selectedScrollSnap:S,slideNodes:function(){return x},slidesInView:function(){return v.slidesInView.get()},slidesNotInView:function(){return v.slidesInView.get(!1)}};return C(t,r),setTimeout(()=>l.emit("init"),0),P}function $Ot(t={},r=[]){const n=e.useRef(t),o=e.useRef(r),[a,i]=e.useState(),[s,l]=e.useState(),c=e.useCallback(()=>{a&&a.reInit(n.current,o.current)},[a]);return e.useEffect(()=>{aOt(n.current,t)||(n.current=t,c())},[t,c]),e.useEffect(()=>{(function(e,t){if(e.length!==t.length)return!1;const r=iOt(e),n=iOt(t);return r.every((e,t)=>aOt(e,n[t]))})(o.current,r)||(o.current=r,c())},[r,c]),e.useEffect(()=>{if(typeof window<"u"&&window.document&&window.document.createElement&&s){qOt.globalOptions=$Ot.globalOptions;const e=qOt(s,n.current,o.current);return i(e),()=>e.destroy()}i(void 0)},[s,i]),[l,a]}qOt.globalOptions=void 0,$Ot.globalOptions=void 0;const HOt=s.createContext(null);function WOt(){const e=s.useContext(HOt);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const UOt=s.forwardRef(({orientation:e="horizontal",opts:r,setApi:n,plugins:o,className:a,children:i,...l},c)=>{const[u,d]=$Ot({...r,axis:"horizontal"===e?"x":"y"},o),[p,h]=s.useState(!1),[f,m]=s.useState(!1),v=s.useCallback(e=>{e&&(h(e.canScrollPrev()),m(e.canScrollNext()))},[]),y=s.useCallback(()=>{null==d||d.scrollPrev()},[d]),g=s.useCallback(()=>{null==d||d.scrollNext()},[d]),x=s.useCallback(e=>{"ArrowLeft"===e.key?(e.preventDefault(),y()):"ArrowRight"===e.key&&(e.preventDefault(),g())},[y,g]);return s.useEffect(()=>{!d||!n||n(d)},[d,n]),s.useEffect(()=>{if(d)return v(d),d.on("reInit",v),d.on("select",v),()=>{null==d||d.off("select",v)}},[d,v]),t.jsx(HOt.Provider,{value:{carouselRef:u,api:d,opts:r,orientation:e||("y"===(null==r?void 0:r.axis)?"vertical":"horizontal"),scrollPrev:y,scrollNext:g,canScrollPrev:p,canScrollNext:f},children:t.jsx("div",{ref:c,onKeyDownCapture:x,className:zdt("relative",a),role:"region","aria-roledescription":"carousel",...l,children:i})})});UOt.displayName="Carousel";const YOt=s.forwardRef(({className:e,...r},n)=>{const{carouselRef:o,orientation:a}=WOt();return t.jsx("div",{ref:o,className:"overflow-hidden",children:t.jsx("div",{ref:n,className:zdt("flex","horizontal"===a?"-ml-4":"-mt-4 flex-col",e),...r})})});YOt.displayName="CarouselContent";const ZOt=s.forwardRef(({className:e,...r},n)=>{const{orientation:o}=WOt();return t.jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:zdt("min-w-0 shrink-0 grow-0 basis-full","horizontal"===o?"pl-4":"pt-4",e),...r})});ZOt.displayName="CarouselItem";const KOt=s.forwardRef(({className:e,variant:r="outline",size:n="icon",...o},a)=>{const{orientation:i,scrollPrev:s,canScrollPrev:l}=WOt();return t.jsxs($ht,{ref:a,variant:r,size:n,className:zdt("absolute h-8 w-8 rounded-full","horizontal"===i?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...o,children:[t.jsx(Rst,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Previous slide"})]})});KOt.displayName="CarouselPrevious";const GOt=s.forwardRef(({className:e,variant:r="outline",size:n="icon",...o},a)=>{const{orientation:i,scrollNext:s,canScrollNext:l}=WOt();return t.jsxs($ht,{ref:a,variant:r,size:n,className:zdt("absolute h-8 w-8 rounded-full","horizontal"===i?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...o,children:[t.jsx(Fst,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Next slide"})]})});GOt.displayName="CarouselNext";const XOt=({form:e,translations:r})=>{const n=[{label:r.timePresetAllDay,start:"00:00",end:"23:59"},{label:r.timePresetEarlyMorning,start:"06:00",end:"09:00"},{label:r.timePresetMorning,start:"09:00",end:"12:00"},{label:r.timePresetLunch,start:"12:00",end:"13:00"},{label:r.timePresetEarlyAfternoon,start:"13:00",end:"15:00"},{label:r.timePresetLateAfternoon,start:"15:00",end:"17:00"},{label:r.timePresetEvening,start:"17:00",end:"20:00"},{label:r.timePresetNight,start:"20:00",end:"23:00"}];return t.jsx("div",{className:"pt-2 pb-1",children:t.jsxs(UOt,{className:"w-full max-w-xs mx-auto sm:px-0",children:[t.jsx(YOt,{className:"",children:n.map(r=>t.jsx(ZOt,{className:"basis-1/3",children:t.jsx(rOt.div,{whileHover:{scale:1},whileTap:{scale:.95},children:t.jsx($ht,{type:"button",variant:"outline",size:"sm",onClick:()=>(t=>{e.setValue("startTime",t.start),e.setValue("endTime",t.end)})(r),className:zdt("w-full text-xs h-5 mx-auto flex",e.watch("startTime")===r.start&&e.watch("endTime")===r.end?"bg-primary text-primary-foreground":""),children:t.jsx("span",{className:"text-[10px] sm:text-xs",children:r.label})})})},r.label))}),t.jsx(KOt,{className:"flex",type:"button"}),t.jsx(GOt,{className:"flex",type:"button"})]})})};var QOt="Switch",[JOt,eSt]=flt(QOt),[tSt,rSt]=JOt(QOt),nSt=s.forwardRef((e,r)=>{const{__scopeSwitch:n,name:o,checked:a,defaultChecked:i,required:l,disabled:c,value:u="on",onCheckedChange:d,form:p,...h}=e,[f,m]=s.useState(null),v=hlt(r,e=>m(e)),y=s.useRef(!1),g=!f||(p||!!f.closest("form")),[x,b]=klt({prop:a,defaultProp:i??!1,onChange:d,caller:QOt});return t.jsxs(tSt,{scope:n,checked:x,disabled:c,children:[t.jsx(Olt.button,{type:"button",role:"switch","aria-checked":x,"aria-required":l,"data-state":sSt(x),"data-disabled":c?"":void 0,disabled:c,value:u,...h,ref:v,onClick:ult(e.onClick,e=>{b(e=>!e),g&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),g&&t.jsx(iSt,{control:f,bubbles:!y.current,name:o,value:u,checked:x,required:l,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})});nSt.displayName=QOt;var oSt="SwitchThumb",aSt=s.forwardRef((e,r)=>{const{__scopeSwitch:n,...o}=e,a=rSt(oSt,n);return t.jsx(Olt.span,{"data-state":sSt(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:r})});aSt.displayName=oSt;var iSt=s.forwardRef(({__scopeSwitch:e,control:r,checked:n,bubbles:o=!0,...a},i)=>{const l=s.useRef(null),c=hlt(l,i),u=kvt(n),d=bvt(r);return s.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[u,n,o]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:c,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function sSt(e){return e?"checked":"unchecked"}iSt.displayName="SwitchBubbleInput";var lSt=nSt,cSt=aSt;const uSt=s.forwardRef(({className:e,...r},n)=>t.jsx(lSt,{className:zdt("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...r,ref:n,children:t.jsx(cSt,{className:zdt("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));function dSt(e,[t,r]){return Math.min(r,Math.max(t,e))}uSt.displayName=lSt.displayName;var pSt=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),hSt=s.forwardRef((e,r)=>t.jsx(Olt.span,{...e,ref:r,style:{...pSt,...e.style}}));hSt.displayName="VisuallyHidden";var fSt=hSt,mSt=[" ","Enter","ArrowUp","ArrowDown"],vSt=[" ","Enter"],ySt="Select",[gSt,xSt,bSt]=Jmt(ySt),[kSt,_St]=flt(ySt,[bSt,oxt]),wSt=oxt(),[MSt,CSt]=kSt(ySt),[jSt,DSt]=kSt(ySt),OSt=e=>{const{__scopeSelect:r,children:n,open:o,defaultOpen:a,onOpenChange:i,value:l,defaultValue:c,onValueChange:u,dir:d,name:p,autoComplete:h,disabled:f,required:m,form:v}=e,y=wSt(r),[g,x]=s.useState(null),[b,k]=s.useState(null),[_,w]=s.useState(!1),M=tvt(d),[C,j]=klt({prop:o,defaultProp:a??!1,onChange:i,caller:ySt}),[D,O]=klt({prop:l,defaultProp:c,onChange:u,caller:ySt}),S=s.useRef(null),P=!g||(v||!!g.closest("form")),[T,E]=s.useState(new Set),N=Array.from(T).map(e=>e.props.value).join(";");return t.jsx(bxt,{...y,children:t.jsxs(MSt,{required:m,scope:r,trigger:g,onTriggerChange:x,valueNode:b,onValueNodeChange:k,valueNodeHasChildren:_,onValueNodeHasChildrenChange:w,contentId:xlt(),value:D,onValueChange:O,open:C,onOpenChange:j,dir:M,triggerPointerDownPosRef:S,disabled:f,children:[t.jsx(gSt.Provider,{scope:r,children:t.jsx(jSt,{scope:e.__scopeSelect,onNativeOptionAdd:s.useCallback(e=>{E(t=>new Set(t).add(e))},[]),onNativeOptionRemove:s.useCallback(e=>{E(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:n})}),P?t.jsxs(vPt,{"aria-hidden":!0,required:m,tabIndex:-1,name:p,autoComplete:h,value:D,onChange:e=>O(e.target.value),disabled:f,form:v,children:[void 0===D?t.jsx("option",{value:""}):null,Array.from(T)]},N):null]})})};OSt.displayName=ySt;var SSt="SelectTrigger",PSt=s.forwardRef((e,r)=>{const{__scopeSelect:n,disabled:o=!1,...a}=e,i=wSt(n),l=CSt(SSt,n),c=l.disabled||o,u=hlt(r,l.onTriggerChange),d=xSt(n),p=s.useRef("touch"),[h,f,m]=gPt(e=>{const t=d().filter(e=>!e.disabled),r=t.find(e=>e.value===l.value),n=xPt(t,e,r);void 0!==n&&l.onValueChange(n.value)}),v=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(kxt,{asChild:!0,...i,children:t.jsx(Olt.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":yPt(l.value)?"":void 0,...a,ref:u,onClick:ult(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&v(e)}),onPointerDown:ult(a.onPointerDown,e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(v(e),e.preventDefault())}),onKeyDown:ult(a.onKeyDown,e=>{const t=""!==h.current;!(e.ctrlKey||e.altKey||e.metaKey)&&1===e.key.length&&f(e.key),(!t||" "!==e.key)&&mSt.includes(e.key)&&(v(),e.preventDefault())})})})});PSt.displayName=SSt;var TSt="SelectValue",ESt=s.forwardRef((e,r)=>{const{__scopeSelect:n,className:o,style:a,children:i,placeholder:s="",...l}=e,c=CSt(TSt,n),{onValueNodeHasChildrenChange:u}=c,d=void 0!==i,p=hlt(r,c.onValueNodeChange);return vlt(()=>{u(d)},[u,d]),t.jsx(Olt.span,{...l,ref:p,style:{pointerEvents:"none"},children:yPt(c.value)?t.jsx(t.Fragment,{children:s}):i})});ESt.displayName=TSt;var NSt=s.forwardRef((e,r)=>{const{__scopeSelect:n,children:o,...a}=e;return t.jsx(Olt.span,{"aria-hidden":!0,...a,ref:r,children:o||"▼"})});NSt.displayName="SelectIcon";var zSt=e=>t.jsx(Glt,{asChild:!0,...e});zSt.displayName="SelectPortal";var ASt="SelectContent",RSt=s.forwardRef((e,r)=>{const n=CSt(ASt,e.__scopeSelect),[o,a]=s.useState();if(vlt(()=>{a(new DocumentFragment)},[]),!n.open){const r=o;return r?d.createPortal(t.jsx(LSt,{scope:e.__scopeSelect,children:t.jsx(gSt.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),r):null}return t.jsx(ISt,{...e,ref:r})});RSt.displayName=ASt;var FSt=10,[LSt,BSt]=kSt(ASt),VSt=_lt("SelectContent.RemoveScroll"),ISt=s.forwardRef((e,r)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:v,hideWhenDetached:y,avoidCollisions:g,...x}=e,b=CSt(ASt,n),[k,_]=s.useState(null),[w,M]=s.useState(null),C=hlt(r,e=>_(e)),[j,D]=s.useState(null),[O,S]=s.useState(null),P=xSt(n),[T,E]=s.useState(!1),N=s.useRef(!1);s.useEffect(()=>{if(k)return Xct(k)},[k]),ect();const z=s.useCallback(e=>{const[t,...r]=P().map(e=>e.ref.current),[n]=r.slice(-1),o=document.activeElement;for(const r of e)if(r===o||(null==r||r.scrollIntoView({block:"nearest"}),r===t&&w&&(w.scrollTop=0),r===n&&w&&(w.scrollTop=w.scrollHeight),null==r||r.focus(),document.activeElement!==o))return},[P,w]),A=s.useCallback(()=>z([j,k]),[z,j,k]);s.useEffect(()=>{T&&A()},[T,A]);const{onOpenChange:R,triggerPointerDownPosRef:F}=b;s.useEffect(()=>{if(k){let e={x:0,y:0};const t=t=>{var r,n;e={x:Math.abs(Math.round(t.pageX)-((null==(r=F.current)?void 0:r.x)??0)),y:Math.abs(Math.round(t.pageY)-((null==(n=F.current)?void 0:n.y)??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():k.contains(r.target)||R(!1),document.removeEventListener("pointermove",t),F.current=null};return null!==F.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[k,R,F]),s.useEffect(()=>{const e=()=>R(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[R]);const[L,B]=gPt(e=>{const t=P().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=xPt(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),V=s.useCallback((e,t,r)=>{const n=!N.current&&!r;(void 0!==b.value&&b.value===t||n)&&(D(e),n&&(N.current=!0))},[b.value]),I=s.useCallback(()=>null==k?void 0:k.focus(),[k]),q=s.useCallback((e,t,r)=>{const n=!N.current&&!r;(void 0!==b.value&&b.value===t||n)&&S(e)},[b.value]),$="popper"===o?$St:qSt,H=$===$St?{side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:v,hideWhenDetached:y,avoidCollisions:g}:{};return t.jsx(LSt,{scope:n,content:k,viewport:w,onViewportChange:M,itemRefCallback:V,selectedItem:j,onItemLeave:I,itemTextRefCallback:q,focusSelectedItem:A,selectedItemText:O,position:o,isPositioned:T,searchRef:L,children:t.jsx(Hct,{as:VSt,allowPinchZoom:!0,children:t.jsx($lt,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ult(a,e=>{var t;null==(t=b.trigger)||t.focus({preventScroll:!0}),e.preventDefault()}),children:t.jsx(Rlt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:t.jsx($,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...x,...H,onPlaced:()=>E(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:ult(x.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),!t&&1===e.key.length&&B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=P().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>z(t)),e.preventDefault()}})})})})})})});ISt.displayName="SelectContentImpl";var qSt=s.forwardRef((e,r)=>{const{__scopeSelect:n,onPlaced:o,...a}=e,i=CSt(ASt,n),l=BSt(ASt,n),[c,u]=s.useState(null),[d,p]=s.useState(null),h=hlt(r,e=>p(e)),f=xSt(n),m=s.useRef(!1),v=s.useRef(!0),{viewport:y,selectedItem:g,selectedItemText:x,focusSelectedItem:b}=l,k=s.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&d&&y&&g&&x){const e=i.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),r=i.valueNode.getBoundingClientRect(),n=x.getBoundingClientRect();if("rtl"!==i.dir){const o=n.left-t.left,a=r.left-o,i=e.left-a,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-FSt,d=dSt(a,[FSt,Math.max(FSt,u-l)]);c.style.minWidth=s+"px",c.style.left=d+"px"}else{const o=t.right-n.right,a=window.innerWidth-r.right-o,i=window.innerWidth-e.right-a,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-FSt,d=dSt(a,[FSt,Math.max(FSt,u-l)]);c.style.minWidth=s+"px",c.style.right=d+"px"}const a=f(),s=window.innerHeight-2*FSt,l=y.scrollHeight,u=window.getComputedStyle(d),p=parseInt(u.borderTopWidth,10),h=parseInt(u.paddingTop,10),v=parseInt(u.borderBottomWidth,10),b=p+h+l+parseInt(u.paddingBottom,10)+v,k=Math.min(5*g.offsetHeight,b),_=window.getComputedStyle(y),w=parseInt(_.paddingTop,10),M=parseInt(_.paddingBottom,10),C=e.top+e.height/2-FSt,j=s-C,D=g.offsetHeight/2,O=p+h+(g.offsetTop+D),S=b-O;if(O<=C){const e=a.length>0&&g===a[a.length-1].ref.current;c.style.bottom="0px";const t=d.clientHeight-y.offsetTop-y.offsetHeight,r=O+Math.max(j,D+(e?M:0)+t+v);c.style.height=r+"px"}else{const e=a.length>0&&g===a[0].ref.current;c.style.top="0px";const t=Math.max(C,p+y.offsetTop+(e?w:0)+D)+S;c.style.height=t+"px",y.scrollTop=O-C+y.offsetTop}c.style.margin=`${FSt}px 0`,c.style.minHeight=k+"px",c.style.maxHeight=s+"px",null==o||o(),requestAnimationFrame(()=>m.current=!0)}},[f,i.trigger,i.valueNode,c,d,y,g,x,i.dir,o]);vlt(()=>k(),[k]);const[_,w]=s.useState();vlt(()=>{d&&w(window.getComputedStyle(d).zIndex)},[d]);const M=s.useCallback(e=>{e&&!0===v.current&&(k(),null==b||b(),v.current=!1)},[k,b]);return t.jsx(HSt,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:M,children:t.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:t.jsx(Olt.div,{...a,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});qSt.displayName="SelectItemAlignedPosition";var $St=s.forwardRef((e,r)=>{const{__scopeSelect:n,align:o="start",collisionPadding:a=FSt,...i}=e,s=wSt(n);return t.jsx(_xt,{...s,...i,ref:r,align:o,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});$St.displayName="SelectPopperPosition";var[HSt,WSt]=kSt(ASt,{}),USt="SelectViewport",YSt=s.forwardRef((e,r)=>{const{__scopeSelect:n,nonce:o,...a}=e,i=BSt(USt,n),l=WSt(USt,n),c=hlt(r,i.onViewportChange),u=s.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),t.jsx(gSt.Slot,{scope:n,children:t.jsx(Olt.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:ult(a.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=l;if(null!=n&&n.current&&r){const e=Math.abs(u.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*FSt,o=parseFloat(r.style.minHeight),a=parseFloat(r.style.height),i=Math.max(o,a);if(i<n){const o=i+e,a=Math.min(n,o),s=o-a;r.style.height=a+"px","0px"===r.style.bottom&&(t.scrollTop=s>0?s:0,r.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});YSt.displayName=USt;var ZSt="SelectGroup",[KSt,GSt]=kSt(ZSt),XSt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=xlt();return t.jsx(KSt,{scope:n,id:a,children:t.jsx(Olt.div,{role:"group","aria-labelledby":a,...o,ref:r})})});XSt.displayName=ZSt;var QSt="SelectLabel",JSt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=GSt(QSt,n);return t.jsx(Olt.div,{id:a.id,...o,ref:r})});JSt.displayName=QSt;var ePt="SelectItem",[tPt,rPt]=kSt(ePt),nPt=s.forwardRef((e,r)=>{const{__scopeSelect:n,value:o,disabled:a=!1,textValue:i,...l}=e,c=CSt(ePt,n),u=BSt(ePt,n),d=c.value===o,[p,h]=s.useState(i??""),[f,m]=s.useState(!1),v=hlt(r,e=>{var t;return null==(t=u.itemRefCallback)?void 0:t.call(u,e,o,a)}),y=xlt(),g=s.useRef("touch"),x=()=>{a||(c.onValueChange(o),c.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(tPt,{scope:n,value:o,disabled:a,textId:y,isSelected:d,onItemTextChange:s.useCallback(e=>{h(t=>t||((null==e?void 0:e.textContent)??"").trim())},[]),children:t.jsx(gSt.ItemSlot,{scope:n,value:o,disabled:a,textValue:p,children:t.jsx(Olt.div,{role:"option","aria-labelledby":y,"data-highlighted":f?"":void 0,"aria-selected":d&&f,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:v,onFocus:ult(l.onFocus,()=>m(!0)),onBlur:ult(l.onBlur,()=>m(!1)),onClick:ult(l.onClick,()=>{"mouse"!==g.current&&x()}),onPointerUp:ult(l.onPointerUp,()=>{"mouse"===g.current&&x()}),onPointerDown:ult(l.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:ult(l.onPointerMove,e=>{var t;g.current=e.pointerType,a?null==(t=u.onItemLeave)||t.call(u):"mouse"===g.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ult(l.onPointerLeave,e=>{var t;e.currentTarget===document.activeElement&&(null==(t=u.onItemLeave)||t.call(u))}),onKeyDown:ult(l.onKeyDown,e=>{var t;""!==(null==(t=u.searchRef)?void 0:t.current)&&" "===e.key||(vSt.includes(e.key)&&x()," "===e.key&&e.preventDefault())})})})})});nPt.displayName=ePt;var oPt="SelectItemText",aPt=s.forwardRef((e,r)=>{const{__scopeSelect:n,className:o,style:a,...i}=e,l=CSt(oPt,n),c=BSt(oPt,n),u=rPt(oPt,n),p=DSt(oPt,n),[h,f]=s.useState(null),m=hlt(r,e=>f(e),u.onItemTextChange,e=>{var t;return null==(t=c.itemTextRefCallback)?void 0:t.call(c,e,u.value,u.disabled)}),v=null==h?void 0:h.textContent,y=s.useMemo(()=>t.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:g,onNativeOptionRemove:x}=p;return vlt(()=>(g(y),()=>x(y)),[g,x,y]),t.jsxs(t.Fragment,{children:[t.jsx(Olt.span,{id:u.textId,...i,ref:m}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?d.createPortal(i.children,l.valueNode):null]})});aPt.displayName=oPt;var iPt="SelectItemIndicator",sPt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e;return rPt(iPt,n).isSelected?t.jsx(Olt.span,{"aria-hidden":!0,...o,ref:r}):null});sPt.displayName=iPt;var lPt="SelectScrollUpButton",cPt=s.forwardRef((e,r)=>{const n=BSt(lPt,e.__scopeSelect),o=WSt(lPt,e.__scopeSelect),[a,i]=s.useState(!1),l=hlt(r,o.onScrollButtonChange);return vlt(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;i(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),a?t.jsx(pPt,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});cPt.displayName=lPt;var uPt="SelectScrollDownButton",dPt=s.forwardRef((e,r)=>{const n=BSt(uPt,e.__scopeSelect),o=WSt(uPt,e.__scopeSelect),[a,i]=s.useState(!1),l=hlt(r,o.onScrollButtonChange);return vlt(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;i(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),a?t.jsx(pPt,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});dPt.displayName=uPt;var pPt=s.forwardRef((e,r)=>{const{__scopeSelect:n,onAutoScroll:o,...a}=e,i=BSt("SelectScrollButton",n),l=s.useRef(null),c=xSt(n),u=s.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return s.useEffect(()=>()=>u(),[u]),vlt(()=>{var e;const t=c().find(e=>e.ref.current===document.activeElement);null==(e=null==t?void 0:t.ref.current)||e.scrollIntoView({block:"nearest"})},[c]),t.jsx(Olt.div,{"aria-hidden":!0,...a,ref:r,style:{flexShrink:0,...a.style},onPointerDown:ult(a.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(o,50))}),onPointerMove:ult(a.onPointerMove,()=>{var e;null==(e=i.onItemLeave)||e.call(i),null===l.current&&(l.current=window.setInterval(o,50))}),onPointerLeave:ult(a.onPointerLeave,()=>{u()})})}),hPt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e;return t.jsx(Olt.div,{"aria-hidden":!0,...o,ref:r})});hPt.displayName="SelectSeparator";var fPt="SelectArrow",mPt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=wSt(n),i=CSt(fPt,n),s=BSt(fPt,n);return i.open&&"popper"===s.position?t.jsx(wxt,{...a,...o,ref:r}):null});mPt.displayName=fPt;var vPt=s.forwardRef(({__scopeSelect:e,value:r,...n},o)=>{const a=s.useRef(null),i=hlt(o,a),l=kvt(r);return s.useEffect(()=>{const e=a.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[l,r]),t.jsx(Olt.select,{...n,style:{...pSt,...n.style},ref:i,defaultValue:r})});function yPt(e){return""===e||void 0===e}function gPt(e){const t=Plt(e),r=s.useRef(""),n=s.useRef(0),o=s.useCallback(e=>{const o=r.current+e;t(o),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),a=s.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,a]}function xPt(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(o,0));1===n.length&&(a=a.filter(e=>e!==r));const i=a.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}vPt.displayName="SelectBubbleInput";var bPt=PSt,kPt=NSt,_Pt=zSt,wPt=RSt,MPt=YSt,CPt=JSt,jPt=nPt,DPt=aPt,OPt=sPt,SPt=cPt,PPt=dPt,TPt=hPt;const EPt=OSt,NPt=ESt,zPt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(bPt,{ref:o,className:zdt("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[r,t.jsx(kPt,{asChild:!0,children:t.jsx(Wst,{className:"h-4 w-4 opacity-50"})})]}));zPt.displayName=bPt.displayName;const APt=s.forwardRef(({className:e,...r},n)=>t.jsx(SPt,{ref:n,className:zdt("flex cursor-default items-center justify-center py-1",e),...r,children:t.jsx(Zst,{className:"h-4 w-4"})}));APt.displayName=SPt.displayName;const RPt=s.forwardRef(({className:e,...r},n)=>t.jsx(PPt,{ref:n,className:zdt("flex cursor-default items-center justify-center py-1",e),...r,children:t.jsx(Wst,{className:"h-4 w-4"})}));RPt.displayName=PPt.displayName;const FPt=s.forwardRef(({className:e,children:r,position:n="popper",...o},a)=>t.jsx(_Pt,{children:t.jsxs(wPt,{ref:a,className:zdt("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o,children:[t.jsx(APt,{}),t.jsx(MPt,{className:zdt("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),t.jsx(RPt,{})]})}));FPt.displayName=wPt.displayName;const LPt=s.forwardRef(({className:e,...r},n)=>t.jsx(CPt,{ref:n,className:zdt("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...r}));LPt.displayName=CPt.displayName;const BPt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(jPt,{ref:o,className:zdt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(OPt,{children:t.jsx(Hst,{className:"h-4 w-4"})})}),t.jsx(DPt,{children:r})]}));BPt.displayName=jPt.displayName;const VPt=s.forwardRef(({className:e,...r},n)=>t.jsx(TPt,{ref:n,className:zdt("-mx-1 my-1 h-px bg-muted",e),...r}));VPt.displayName=TPt.displayName;const IPt=(e,t,r,n)=>{if(!n||!mst(e,{start:t,end:r}))return!1;switch(n){case"daily":return!0;case"weekly":return cst(e)===cst(t);case"monthly":return e.getDate()===t.getDate();default:return!1}},qPt=({field:r,form:n,translations:o})=>{const[a,i]=e.useState(0),[s,l]=e.useState(""),[c,u]=e.useState({}),d=n.getValues("startDate"),p=n.getValues("endDate"),h=n.getValues("isRepeatingInterval")||"daily",f=bit({start:d,end:p}).filter(e=>{const t=h;return"daily"===t||("weekly"===t?e.getDay()===d.getDay():"monthly"===t&&e.getDate()===d.getDate())}),m=r.value||[],v=m.filter(e=>f.some(t=>hit(e,t)));m.length!==v.length&&setTimeout(()=>{r.onChange(v)},0);const y=e=>e.length>=f.length;if("daily"===h)return t.jsx(fmt,{mode:"multiple",selected:r.value||[],onSelect:e=>{e&&y(e)?tpt.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range"):r.onChange(e||[])},fromDate:d,toDate:p,defaultMonth:d,className:"rounded-md border"});const g=f.reduce((e,t)=>{const r=sst(t,"yyyy-MM");return e[r]||(e[r]=[]),e[r].push(t),e},{}),x=Object.entries(g).sort(([e],[t])=>e.localeCompare(t));if(0===Object.keys(c).length&&x.length>0){const e={};x.forEach(([t],r)=>{e[t]=0===r}),u(e)}const b=""===s.trim()?x:x.filter(e=>{const t=e[1][0];return`${o.monthNames[t.getMonth()]} ${sst(t,"yyyy")}`.toLowerCase().includes(s.toLowerCase())}),k=Math.ceil(b.length/2),_=b.slice(2*a,2*(a+1));return t.jsxs("div",{className:"rounded-md p-1 w-[300px] overflow-y-auto",children:[t.jsx("div",{className:"text-center font-medium mb-2 text-sm",children:"weekly"===h?o.weeklyIntervalLabel.replace("{dayName}",o.fullDayNames[d.getDay()]).replace("{startDate}",`${sst(d,"dd")} ${o.monthNames[d.getMonth()].slice(0,3)}`).replace("{endDate}",`${sst(p,"dd")} ${o.monthNames[p.getMonth()].slice(0,3)} ${sst(p,"yyyy")}`):o.monthlyIntervalLabel.replace("{dayOfMonth}",sst(d,"do")).replace("{startDate}",o.monthNames[d.getMonth()].slice(0,3)).replace("{endDate}",`${o.monthNames[p.getMonth()].slice(0,3)} ${sst(p,"yyyy")}`)}),t.jsxs("div",{className:"flex gap-2 mb-2",children:[t.jsx("div",{className:"flex-grow",children:t.jsx(cyt,{type:"text",placeholder:o.searchMonthPlaceholder,value:s,onChange:e=>{l(e.target.value),i(0)},className:"h-7 text-xs"})}),b.length>0&&t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx($ht,{type:"button",variant:"outline",size:"sm",className:"h-7 w-7 p-0",onClick:()=>{i(e=>Math.max(e-1,0))},disabled:0===a,children:"←"}),t.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[a+1,"/",Math.max(1,k)]}),t.jsx($ht,{type:"button",variant:"outline",size:"sm",className:"h-7 w-7 p-0",onClick:()=>{i(e=>Math.min(e+1,k-1))},disabled:a>=k-1,children:"→"})]})]}),0===f.length?t.jsx("div",{className:"text-center text-muted-foreground py-1 text-xs",children:o.noMatchingDates}):0===b.length?t.jsx("div",{className:"text-center text-muted-foreground py-1 text-xs",children:o.noSearchResults.replace("{query}",s)}):t.jsx("div",{children:_.map(([e,n])=>{const a=n[0],i=`${o.monthNames[a.getMonth()]} ${sst(a,"yyyy")}`,s=c[e],l=n.filter(e=>v.some(t=>hit(t,e))).length;return t.jsxs("div",{className:"mb-2 border rounded-md overflow-hidden",children:[t.jsxs("div",{className:"py-1 px-2 bg-muted flex justify-between items-center cursor-pointer text-xs",onClick:()=>(e=>{u(t=>({...t,[e]:!t[e]}))})(e),children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("span",{className:"mr-1 flex items-center justify-center w-4",children:s?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m6 9 6 6 6-6"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m9 18 6-6-6-6"})})}),t.jsx("span",{className:"font-medium",children:i}),t.jsx("span",{className:"ml-1 text-muted-foreground",children:o.ofExcluded.replace("{count}",l.toString()).replace("{total}",n.length.toString())})]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx($ht,{type:"button",variant:"outline",size:"sm",className:"h-5 text-[10px] px-1",onClick:e=>{e.stopPropagation(),(e=>{const t=v,n=e.filter(e=>!t.some(t=>hit(t,e))),a=[...t,...n];y(a)?tpt.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range"):r.onChange(a)})(n)},children:o.selectAll}),t.jsx($ht,{type:"button",variant:"outline",size:"sm",className:"h-5 text-[10px] px-1",onClick:e=>{e.stopPropagation(),(e=>{const t=v.filter(t=>!e.some(e=>hit(e,t)));r.onChange(t)})(n)},disabled:0===l,children:o.clearAll})]})]}),s&&t.jsx("div",{className:"p-1 flex flex-wrap gap-1 bg-background",children:n.map(e=>{const n=v.some(t=>hit(t,e));return t.jsx($ht,{type:"button",variant:n?"default":"outline",className:"h-6 px-1 text-[10px]",onClick:()=>{const t=v;if(n)r.onChange(t.filter(t=>!hit(t,e)));else{const n=[...t,e];if(y(n))return void tpt.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range");r.onChange(n)}},children:sst(e,o.dateButtonFormat)},e.toISOString())})})]},e)})})]})},$Pt=({form:r,translations:n,showRepeatToggle:o})=>{const[a,i]=e.useState(!1);e.useState(()=>{const e=r.getValues("isRepeatingExcludedDates");e&&e.length>0&&i(!0)});return o?t.jsx(rOt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},children:t.jsxs(oyt,{className:"flex flex-col rounded-lg border p-4 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ayt,{className:"text-base flex items-center cursor-pointer",children:[t.jsx(qst,{className:"mr-2 h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"leading-tight",children:n.repeatingEventQuestion})]}),t.jsx(fbt,{mode:"wait",children:r.watch("isRepeating")&&t.jsx(rOt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2,ease:"easeInOut"},children:t.jsx(syt,{className:"text-xs leading-normal max-w-[90%]",children:((e,t,r,o,a,i)=>{const s=e=>sst(e,"MMM d"),l=n.fullDayNames[e.getDay()],c="enUS"===n.language?sst(e,"do"):e.getDate().toString(),u=s(e),d=fst(e,t)?s(t):(e=>sst(e,"MMM d, yyyy"))(t),p=`${r} - ${o}`;let h="";switch(a||"daily"){case"daily":h=n.repeatDailyDescription.replace("{timeRange}",p).replace("{startDate}",u).replace("{endDate}",d);break;case"weekly":h=n.repeatWeeklyDescription.replace("{dayName}",l).replace("{timeRange}",p).replace("{startDate}",u).replace("{endDate}",d);break;case"monthly":h=n.repeatMonthlyDescription.replace("{dayOfMonth}",c).replace("{timeRange}",p).replace("{startDate}",u).replace("{endDate}",d)}if(i&&i.length>0){const e=i.length;h+=` (${n.withExcludedDates.replace("{count}",e.toString()).replace("{s}",e>1?"s":"")})`}return h})(r.watch("startDate"),r.watch("endDate"),r.watch("startTime"),r.watch("endTime"),r.watch("isRepeatingInterval"),r.watch("isRepeatingExcludedDates"))})})})]}),t.jsx(tyt,{control:r.control,name:"isRepeating",render:({field:e})=>t.jsx(iyt,{children:t.jsx(uSt,{checked:e.value,onCheckedChange:t=>{e.onChange(t),t||(i(!1),r.setValue("isRepeatingExcludedDates",[]))},className:"flex-shrink-0"})})})]}),t.jsx(fbt,{children:r.watch("isRepeating")&&t.jsx(rOt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},children:t.jsxs("div",{className:"space-y-4",children:[t.jsx(tyt,{control:r.control,name:"isRepeatingInterval",render:({field:e})=>t.jsxs(EPt,{onValueChange:t=>{t!==e.value&&(r.setValue("isRepeatingExcludedDates",[]),i(!1)),e.onChange(t)},value:e.value||"daily",children:[t.jsx(iyt,{children:t.jsx(zPt,{className:"w-full",children:t.jsx(NPt,{})})}),t.jsxs(FPt,{children:[t.jsx(BPt,{value:"daily",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(Bst,{className:"mr-2 h-4 w-4"}),n.repeatDaily]})}),t.jsx(BPt,{value:"weekly",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(qst,{className:"mr-2 h-4 w-4"}),n.repeatWeekly]})}),t.jsx(BPt,{value:"monthly",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(Vst,{className:"mr-2 h-4 w-4"}),n.repeatMonthly]})})]})]})}),t.jsxs("div",{className:"flex items-center justify-between mt-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ayt,{className:"flex items-center text-sm cursor-pointer",children:[t.jsx(Kst,{className:"mr-2 h-3 w-3"}),n.excludedDates]}),t.jsx(syt,{className:"text-xs",children:n.excludedDatesDescription})]}),t.jsx(uSt,{checked:a,onCheckedChange:e=>{i(e),e||r.setValue("isRepeatingExcludedDates",[])},className:"flex-shrink-0"})]}),t.jsx(fbt,{children:a&&t.jsx(rOt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.05,ease:"easeInOut"},className:"mt-4",children:t.jsx(tyt,{control:r.control,name:"isRepeatingExcludedDates",render:({field:e})=>t.jsx(oyt,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs(Xxt,{children:[t.jsx(Qxt,{asChild:!0,children:t.jsxs($ht,{variant:"outline",className:"w-full justify-start text-left font-normal text-sm h-9",type:"button",children:[t.jsx(Vst,{className:"mr-2 h-4 w-4"}),n.selectDatesToExclude]})}),t.jsx(Jxt,{className:"w-auto p-0 max-w-[320px]",align:"start",children:t.jsx(qPt,{field:e,form:r,translations:n})})]}),t.jsx(fbt,{children:"daily"===r.watch("isRepeatingInterval")&&t.jsxs(rOt.div,{initial:{opacity:0,height:0,overflow:"hidden"},animate:{opacity:1,height:"auto",overflow:"visible"},exit:{opacity:0,height:0,overflow:"hidden"},transition:{duration:.015,ease:"easeInOut"},className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx(syt,{className:"text-xs mb-0",children:n.skipDays}),t.jsx($ht,{type:"button",variant:"destructive",size:"sm",className:"text-xs h-5 mr-3",disabled:!((r.watch("isRepeatingExcludedDates")||[]).length>0),onClick:()=>{r.setValue("isRepeatingExcludedDates",[])},children:n.clearAll})]}),t.jsx("div",{children:t.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:n.dayNames.map((e,o)=>{const a=o,i=r.watch("isRepeatingExcludedDates")||[],s=bit({start:r.getValues("startDate"),end:r.getValues("endDate")}).filter(e=>e.getDay()===a),l=s.length>0,c=l&&s.every(e=>i.some(t=>hit(t,e)));return t.jsx($ht,{type:"button",variant:c?"default":"outline",size:"sm",className:zdt("w-8 h-8 p-0 text-center flex items-center justify-center",0===a||6===a?"font-medium":"",l?"":"opacity-50 cursor-not-allowed"),disabled:!l,onClick:()=>{if(!l)return;const e=r.getValues("startDate"),t=r.getValues("endDate"),o=bit({start:e,end:t}),i=o.filter(e=>e.getDay()===a);let s=[...r.getValues("isRepeatingExcludedDates")||[]];if(c)s=s.filter(e=>!i.some(t=>hit(t,e)));else{i.forEach(e=>{s.some(t=>hit(t,e))||s.push(e)});const r="daily",a=o.filter(n=>IPt(n,e,t,r));if(s.length>=a.length)return void tpt.error(n.errorCannotExcludeAllDates)}r.setValue("isRepeatingExcludedDates",s)},children:e.charAt(0)},o)})})})]})}),e.value&&e.value.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:e.value.map((r,n)=>t.jsxs(rOt.div,{className:"bg-secondary text-secondary-foreground rounded-md px-2 py-1 text-xs flex items-center",initial:{opacity:0,scale:.6,y:15,rotateX:-10},animate:{opacity:1,scale:1,y:0,rotateX:0},whileHover:{scale:1.05},transition:{type:"spring",stiffness:500,damping:30,delay:0},children:[sst(r,"MMM d, yyyy"),t.jsxs($ht,{type:"button",variant:"ghost",size:"sm",className:"h-4 w-4 p-0 ml-1",onClick:()=>{const t=[...e.value||[]];t.splice(n,1),e.onChange(t)},children:[t.jsx("span",{className:"sr-only",children:"Remove"}),"×"]})]},r.toISOString()))}),t.jsx(lyt,{})]})})})})})]})})})]})}):null},HPt=({open:e,editType:r,onEditTypeChange:n,onConfirm:o,onClose:a,translations:i})=>t.jsx(qmt,{open:e,children:t.jsxs(Umt,{className:"max-w-[425px]",children:[t.jsxs(Ymt,{children:[t.jsxs(Kmt,{className:"flex items-center",children:[t.jsx(Ist,{className:"mr-2 h-5 w-5 text-primary"}),i.editRecurringEventTitle]}),t.jsx(Gmt,{className:"text-left",children:i.editRecurringEventDescription}),t.jsx("div",{className:"h-2"}),t.jsx("div",{className:"mt-4 space-y-4",children:t.jsx(Yvt,{defaultValue:"all",value:r,onValueChange:e=>n(e),children:t.jsx("div",{className:"space-y-4",children:[{value:"single",label:i.editThisOccurrence,description:i.editThisOccurrenceDescription},{value:"future",label:i.editThisAndFuture,description:i.editThisAndFutureDescription},{value:"all",label:i.editAllOccurrences,description:i.editAllOccurrencesDescription}].map(e=>t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(Zvt,{value:e.value,id:`edit-${e.value}`}),t.jsxs(Qvt,{htmlFor:`edit-${e.value}`,className:"flex flex-col flex-1 items-start cursor-pointer",children:[t.jsx("span",{className:"leading-none",children:e.label}),t.jsx("span",{className:"text-sm text-muted-foreground mt-1",children:e.description})]})]},e.value))})})}),t.jsx("div",{className:"h-2"})]}),t.jsxs(Zmt,{children:[t.jsx(Qmt,{onClick:a,children:i.cancel}),t.jsxs(Xmt,{onClick:o,className:"w-full sm:w-auto",children:[t.jsx(Ist,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),i.save]})]})]})});var WPt,UPt;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(WPt||(WPt={})),(UPt||(UPt={})).mergeShapes=(e,t)=>({...e,...t});const YPt=WPt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ZPt=e=>{switch(typeof e){case"undefined":return YPt.undefined;case"string":return YPt.string;case"number":return Number.isNaN(e)?YPt.nan:YPt.number;case"boolean":return YPt.boolean;case"function":return YPt.function;case"bigint":return YPt.bigint;case"symbol":return YPt.symbol;case"object":return Array.isArray(e)?YPt.array:null===e?YPt.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?YPt.promise:typeof Map<"u"&&e instanceof Map?YPt.map:typeof Set<"u"&&e instanceof Set?YPt.set:typeof Date<"u"&&e instanceof Date?YPt.date:YPt.object;default:return YPt.unknown}},KPt=WPt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class GPt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const o of e.issues)if("invalid_union"===o.code)o.unionErrors.map(n);else if("invalid_return_type"===o.code)n(o.returnTypeError);else if("invalid_arguments"===o.code)n(o.argumentsError);else if(0===o.path.length)r._errors.push(t(o));else{let e=r,n=0;for(;n<o.path.length;){const r=o.path[n];n===o.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(o))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof GPt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,WPt.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}GPt.create=e=>new GPt(e);const XPt=(e,t)=>{let r;switch(e.code){case KPt.invalid_type:r=e.received===YPt.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case KPt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,WPt.jsonStringifyReplacer)}`;break;case KPt.unrecognized_keys:r=`Unrecognized key(s) in object: ${WPt.joinValues(e.keys,", ")}`;break;case KPt.invalid_union:r="Invalid input";break;case KPt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${WPt.joinValues(e.options)}`;break;case KPt.invalid_enum_value:r=`Invalid enum value. Expected ${WPt.joinValues(e.options)}, received '${e.received}'`;break;case KPt.invalid_arguments:r="Invalid function arguments";break;case KPt.invalid_return_type:r="Invalid function return type";break;case KPt.invalid_date:r="Invalid date";break;case KPt.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:WPt.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case KPt.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case KPt.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case KPt.custom:r="Invalid input";break;case KPt.invalid_intersection_types:r="Intersection results could not be merged";break;case KPt.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case KPt.not_finite:r="Number must be finite";break;default:r=t.defaultError,WPt.assertNever(e)}return{message:r}};let QPt=XPt;function JPt(e,t){const r=QPt,n=(e=>{const{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...o.path||[]],i={...o,path:a};if(void 0!==o.message)return{...o,path:a,message:o.message};let s="";const l=n.filter(e=>!!e).slice().reverse();for(const e of l)s=e(i,{data:t,defaultError:s}).message;return{...o,path:a,message:s}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===XPt?void 0:XPt].filter(e=>!!e)});e.common.issues.push(n)}class eTt{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return tTt;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return eTt.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:o}=n;if("aborted"===t.status||"aborted"===o.status)return tTt;"dirty"===t.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"!==t.value&&(typeof o.value<"u"||n.alwaysSet)&&(r[t.value]=o.value)}return{status:e.value,value:r}}}const tTt=Object.freeze({status:"aborted"}),rTt=e=>({status:"dirty",value:e}),nTt=e=>({status:"valid",value:e}),oTt=e=>"aborted"===e.status,aTt=e=>"dirty"===e.status,iTt=e=>"valid"===e.status,sTt=e=>typeof Promise<"u"&&e instanceof Promise;var lTt;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(lTt||(lTt={}));class cTt{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const uTt=(e,t)=>{if(iTt(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new GPt(e.common.issues);return this._error=t,this._error}}};function dTt(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:o}:{errorMap:(t,o)=>{const{message:a}=e;return"invalid_enum_value"===t.code?{message:a??o.defaultError}:typeof o.data>"u"?{message:a??n??o.defaultError}:"invalid_type"!==t.code?{message:o.defaultError}:{message:a??r??o.defaultError}},description:o}}class pTt{get description(){return this._def.description}_getType(e){return ZPt(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ZPt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new eTt,ctx:{common:e.parent.common,data:e.data,parsedType:ZPt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(sTt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(null==t?void 0:t.async)??!1,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ZPt(e)},n=this._parseSync({data:e,path:r.path,parent:r});return uTt(r,n)}"~validate"(e){var t,r;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ZPt(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:n});return iTt(t)?{value:t.value}:{issues:n.common.issues}}catch(e){null!=(r=null==(t=null==e?void 0:e.message)?void 0:t.toLowerCase())&&r.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(e=>iTt(e)?{value:e.value}:{issues:n.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ZPt(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(sTt(n)?n:Promise.resolve(n));return uTt(r,o)}refine(e,t){const r=e=>"string"==typeof t||typeof t>"u"?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{const o=e(t),a=()=>n.addIssue({code:KPt.custom,...r(t)});return typeof Promise<"u"&&o instanceof Promise?o.then(e=>!!e||(a(),!1)):!!o||(a(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new uEt({schema:this,typeName:xEt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return dEt.create(this,this._def)}nullable(){return pEt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return KTt.create(this)}promise(){return cEt.create(this,this._def)}or(e){return QTt.create([this,e],this._def)}and(e){return eEt.create(this,e,this._def)}transform(e){return new uEt({...dTt(this._def),schema:this,typeName:xEt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new hEt({...dTt(this._def),innerType:this,defaultValue:t,typeName:xEt.ZodDefault})}brand(){return new vEt({typeName:xEt.ZodBranded,type:this,...dTt(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new fEt({...dTt(this._def),innerType:this,catchValue:t,typeName:xEt.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return yEt.create(this,e)}readonly(){return gEt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const hTt=/^c[^\s-]{8,}$/i,fTt=/^[0-9a-z]+$/,mTt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vTt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,yTt=/^[a-z0-9_-]{21}$/i,gTt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,xTt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,bTt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let kTt;const _Tt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,wTt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,MTt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,CTt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,jTt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,DTt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,OTt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",STt=new RegExp(`^${OTt}$`);function PTt(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function TTt(e){return new RegExp(`^${PTt(e)}$`)}function ETt(e){let t=`${OTt}T${PTt(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function NTt(e,t){return!(("v4"!==t&&t||!_Tt.test(e))&&("v6"!==t&&t||!MTt.test(e)))}function zTt(e,t){if(!gTt.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!("object"!=typeof o||null===o||"typ"in o&&"JWT"!==(null==o?void 0:o.typ)||!o.alg||t&&o.alg!==t)}catch{return!1}}function ATt(e,t){return!(("v4"!==t&&t||!wTt.test(e))&&("v6"!==t&&t||!CTt.test(e)))}class RTt extends pTt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==YPt.string){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.string,received:t.parsedType}),tTt}const t=new eTt;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const o=e.data.length>n.value,a=e.data.length<n.value;(o||a)&&(r=this._getOrReturnCtx(e,r),o?JPt(r,{code:KPt.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):a&&JPt(r,{code:KPt.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)bTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"email",code:KPt.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)kTt||(kTt=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),kTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"emoji",code:KPt.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)vTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"uuid",code:KPt.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)yTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"nanoid",code:KPt.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)hTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"cuid",code:KPt.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)fTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"cuid2",code:KPt.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)mTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"ulid",code:KPt.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),JPt(r,{validation:"url",code:KPt.invalid_string,message:n.message}),t.dirty()}else"regex"===n.kind?(n.regex.lastIndex=0,n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"regex",code:KPt.invalid_string,message:n.message}),t.dirty())):"trim"===n.kind?e.data=e.data.trim():"includes"===n.kind?e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty()):"toLowerCase"===n.kind?e.data=e.data.toLowerCase():"toUpperCase"===n.kind?e.data=e.data.toUpperCase():"startsWith"===n.kind?e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty()):"endsWith"===n.kind?e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty()):"datetime"===n.kind?ETt(n).test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.invalid_string,validation:"datetime",message:n.message}),t.dirty()):"date"===n.kind?STt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.invalid_string,validation:"date",message:n.message}),t.dirty()):"time"===n.kind?TTt(n).test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.invalid_string,validation:"time",message:n.message}),t.dirty()):"duration"===n.kind?xTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"duration",code:KPt.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?NTt(e.data,n.version)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"ip",code:KPt.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?zTt(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"jwt",code:KPt.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?ATt(e.data,n.version)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"cidr",code:KPt.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?jTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"base64",code:KPt.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?DTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"base64url",code:KPt.invalid_string,message:n.message}),t.dirty()):WPt.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:KPt.invalid_string,...lTt.errToObj(r)})}_addCheck(e){return new RTt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...lTt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...lTt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...lTt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...lTt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...lTt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...lTt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...lTt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...lTt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...lTt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...lTt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...lTt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...lTt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...lTt.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,offset:(null==e?void 0:e.offset)??!1,local:(null==e?void 0:e.local)??!1,...lTt.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,...lTt.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...lTt.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...lTt.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...lTt.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...lTt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...lTt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...lTt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...lTt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...lTt.errToObj(t)})}nonempty(e){return this.min(1,lTt.errToObj(e))}trim(){return new RTt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new RTt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new RTt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function FTt(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}RTt.create=e=>new RTt({checks:[],typeName:xEt.ZodString,coerce:(null==e?void 0:e.coerce)??!1,...dTt(e)});class LTt extends pTt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==YPt.number){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.number,received:t.parsedType}),tTt}let t;const r=new eTt;for(const n of this._def.checks)"int"===n.kind?WPt.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==FTt(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.not_finite,message:n.message}),r.dirty()):WPt.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,lTt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,lTt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,lTt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,lTt.toString(t))}setLimit(e,t,r,n){return new LTt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:lTt.toString(n)}]})}_addCheck(e){return new LTt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:lTt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:lTt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:lTt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:lTt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:lTt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:lTt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:lTt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:lTt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:lTt.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&WPt.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}LTt.create=e=>new LTt({checks:[],typeName:xEt.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...dTt(e)});class BTt extends pTt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==YPt.bigint)return this._getInvalidInput(e);let t;const r=new eTt;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):WPt.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.bigint,received:t.parsedType}),tTt}gte(e,t){return this.setLimit("min",e,!0,lTt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,lTt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,lTt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,lTt.toString(t))}setLimit(e,t,r,n){return new BTt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:lTt.toString(n)}]})}_addCheck(e){return new BTt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:lTt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:lTt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:lTt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:lTt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:lTt.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}BTt.create=e=>new BTt({checks:[],typeName:xEt.ZodBigInt,coerce:(null==e?void 0:e.coerce)??!1,...dTt(e)});class VTt extends pTt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==YPt.boolean){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.boolean,received:t.parsedType}),tTt}return nTt(e.data)}}VTt.create=e=>new VTt({typeName:xEt.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...dTt(e)});class ITt extends pTt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==YPt.date){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.date,received:t.parsedType}),tTt}if(Number.isNaN(e.data.getTime())){return JPt(this._getOrReturnCtx(e),{code:KPt.invalid_date}),tTt}const t=new eTt;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):WPt.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ITt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:lTt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:lTt.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ITt.create=e=>new ITt({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:xEt.ZodDate,...dTt(e)});class qTt extends pTt{_parse(e){if(this._getType(e)!==YPt.symbol){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.symbol,received:t.parsedType}),tTt}return nTt(e.data)}}qTt.create=e=>new qTt({typeName:xEt.ZodSymbol,...dTt(e)});class $Tt extends pTt{_parse(e){if(this._getType(e)!==YPt.undefined){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.undefined,received:t.parsedType}),tTt}return nTt(e.data)}}$Tt.create=e=>new $Tt({typeName:xEt.ZodUndefined,...dTt(e)});class HTt extends pTt{_parse(e){if(this._getType(e)!==YPt.null){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.null,received:t.parsedType}),tTt}return nTt(e.data)}}HTt.create=e=>new HTt({typeName:xEt.ZodNull,...dTt(e)});class WTt extends pTt{constructor(){super(...arguments),this._any=!0}_parse(e){return nTt(e.data)}}WTt.create=e=>new WTt({typeName:xEt.ZodAny,...dTt(e)});class UTt extends pTt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return nTt(e.data)}}UTt.create=e=>new UTt({typeName:xEt.ZodUnknown,...dTt(e)});class YTt extends pTt{_parse(e){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.never,received:t.parsedType}),tTt}}YTt.create=e=>new YTt({typeName:xEt.ZodNever,...dTt(e)});class ZTt extends pTt{_parse(e){if(this._getType(e)!==YPt.undefined){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.void,received:t.parsedType}),tTt}return nTt(e.data)}}ZTt.create=e=>new ZTt({typeName:xEt.ZodVoid,...dTt(e)});class KTt extends pTt{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==YPt.array)return JPt(t,{code:KPt.invalid_type,expected:YPt.array,received:t.parsedType}),tTt;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(e||o)&&(JPt(t,{code:e?KPt.too_big:KPt.too_small,minimum:o?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(JPt(t,{code:KPt.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(JPt(t,{code:KPt.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new cTt(t,e,t.path,r)))).then(e=>eTt.mergeArray(r,e));const o=[...t.data].map((e,r)=>n.type._parseSync(new cTt(t,e,t.path,r)));return eTt.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new KTt({...this._def,minLength:{value:e,message:lTt.toString(t)}})}max(e,t){return new KTt({...this._def,maxLength:{value:e,message:lTt.toString(t)}})}length(e,t){return new KTt({...this._def,exactLength:{value:e,message:lTt.toString(t)}})}nonempty(e){return this.min(1,e)}}function GTt(e){if(e instanceof XTt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=dEt.create(GTt(n))}return new XTt({...e._def,shape:()=>t})}return e instanceof KTt?new KTt({...e._def,type:GTt(e.element)}):e instanceof dEt?dEt.create(GTt(e.unwrap())):e instanceof pEt?pEt.create(GTt(e.unwrap())):e instanceof tEt?tEt.create(e.items.map(e=>GTt(e))):e}KTt.create=(e,t)=>new KTt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xEt.ZodArray,...dTt(t)});class XTt extends pTt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=WPt.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==YPt.object){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.object,received:t.parsedType}),tTt}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof YTt&&"strip"===this._def.unknownKeys))for(const e in r.data)o.includes(e)||a.push(e);const i=[];for(const e of o){const t=n[e],o=r.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new cTt(r,o,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof YTt){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of a)i.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)a.length>0&&(JPt(r,{code:KPt.unrecognized_keys,keys:a}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of a){const n=r.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new cTt(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of i){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>eTt.mergeObjectSync(t,e)):eTt.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return lTt.errToObj,new XTt({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,o;const a=(null==(o=(n=this._def).errorMap)?void 0:o.call(n,t,r).message)??r.defaultError;return"unrecognized_keys"===t.code?{message:lTt.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new XTt({...this._def,unknownKeys:"strip"})}passthrough(){return new XTt({...this._def,unknownKeys:"passthrough"})}extend(e){return new XTt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new XTt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:xEt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new XTt({...this._def,catchall:e})}pick(e){const t={};for(const r of WPt.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new XTt({...this._def,shape:()=>t})}omit(e){const t={};for(const r of WPt.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new XTt({...this._def,shape:()=>t})}deepPartial(){return GTt(this)}partial(e){const t={};for(const r of WPt.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new XTt({...this._def,shape:()=>t})}required(e){const t={};for(const r of WPt.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof dEt;)e=e._def.innerType;t[r]=e}return new XTt({...this._def,shape:()=>t})}keyof(){return iEt(WPt.objectKeys(this.shape))}}XTt.create=(e,t)=>new XTt({shape:()=>e,unknownKeys:"strip",catchall:YTt.create(),typeName:xEt.ZodObject,...dTt(t)}),XTt.strictCreate=(e,t)=>new XTt({shape:()=>e,unknownKeys:"strict",catchall:YTt.create(),typeName:xEt.ZodObject,...dTt(t)}),XTt.lazycreate=(e,t)=>new XTt({shape:e,unknownKeys:"strip",catchall:YTt.create(),typeName:xEt.ZodObject,...dTt(t)});class QTt extends pTt{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map(e=>new GPt(e.ctx.common.issues));return JPt(t,{code:KPt.invalid_union,unionErrors:r}),tTt});{let e;const n=[];for(const o of r){const r={...t,common:{...t.common,issues:[]},parent:null},a=o._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"===a.status&&!e&&(e={result:a,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const o=n.map(e=>new GPt(e));return JPt(t,{code:KPt.invalid_union,unionErrors:o}),tTt}}get options(){return this._def.options}}function JTt(e,t){const r=ZPt(e),n=ZPt(t);if(e===t)return{valid:!0,data:e};if(r===YPt.object&&n===YPt.object){const r=WPt.objectKeys(t),n=WPt.objectKeys(e).filter(e=>-1!==r.indexOf(e)),o={...e,...t};for(const r of n){const n=JTt(e[r],t[r]);if(!n.valid)return{valid:!1};o[r]=n.data}return{valid:!0,data:o}}if(r===YPt.array&&n===YPt.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const o=JTt(e[n],t[n]);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}return r===YPt.date&&n===YPt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}QTt.create=(e,t)=>new QTt({options:e,typeName:xEt.ZodUnion,...dTt(t)});class eEt extends pTt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(oTt(e)||oTt(n))return tTt;const o=JTt(e.value,n.value);return o.valid?((aTt(e)||aTt(n))&&t.dirty(),{status:t.value,value:o.data}):(JPt(r,{code:KPt.invalid_intersection_types}),tTt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}eEt.create=(e,t,r)=>new eEt({left:e,right:t,typeName:xEt.ZodIntersection,...dTt(r)});class tEt extends pTt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==YPt.array)return JPt(r,{code:KPt.invalid_type,expected:YPt.array,received:r.parsedType}),tTt;if(r.data.length<this._def.items.length)return JPt(r,{code:KPt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),tTt;!this._def.rest&&r.data.length>this._def.items.length&&(JPt(r,{code:KPt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new cTt(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>eTt.mergeArray(t,e)):eTt.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new tEt({...this._def,rest:e})}}tEt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tEt({items:e,typeName:xEt.ZodTuple,rest:null,...dTt(t)})};class rEt extends pTt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==YPt.map)return JPt(r,{code:KPt.invalid_type,expected:YPt.map,received:r.parsedType}),tTt;const n=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([e,t],a)=>({key:n._parse(new cTt(r,e,r.path,[a,"key"])),value:o._parse(new cTt(r,t,r.path,[a,"value"]))}));if(r.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const r of a){const n=await r.key,o=await r.value;if("aborted"===n.status||"aborted"===o.status)return tTt;("dirty"===n.status||"dirty"===o.status)&&t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}})}{const e=new Map;for(const r of a){const n=r.key,o=r.value;if("aborted"===n.status||"aborted"===o.status)return tTt;("dirty"===n.status||"dirty"===o.status)&&t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}}}}rEt.create=(e,t,r)=>new rEt({valueType:t,keyType:e,typeName:xEt.ZodMap,...dTt(r)});class nEt extends pTt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==YPt.set)return JPt(r,{code:KPt.invalid_type,expected:YPt.set,received:r.parsedType}),tTt;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(JPt(r,{code:KPt.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(JPt(r,{code:KPt.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const o=this._def.valueType;function a(e){const r=new Set;for(const n of e){if("aborted"===n.status)return tTt;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const i=[...r.data.values()].map((e,t)=>o._parse(new cTt(r,e,r.path,t)));return r.common.async?Promise.all(i).then(e=>a(e)):a(i)}min(e,t){return new nEt({...this._def,minSize:{value:e,message:lTt.toString(t)}})}max(e,t){return new nEt({...this._def,maxSize:{value:e,message:lTt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}nEt.create=(e,t)=>new nEt({valueType:e,minSize:null,maxSize:null,typeName:xEt.ZodSet,...dTt(t)});class oEt extends pTt{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}oEt.create=(e,t)=>new oEt({getter:e,typeName:xEt.ZodLazy,...dTt(t)});class aEt extends pTt{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return JPt(t,{received:t.data,code:KPt.invalid_literal,expected:this._def.value}),tTt}return{status:"valid",value:e.data}}get value(){return this._def.value}}function iEt(e,t){return new sEt({values:e,typeName:xEt.ZodEnum,...dTt(t)})}aEt.create=(e,t)=>new aEt({value:e,typeName:xEt.ZodLiteral,...dTt(t)});class sEt extends pTt{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return JPt(t,{expected:WPt.joinValues(r),received:t.parsedType,code:KPt.invalid_type}),tTt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return JPt(t,{received:t.data,code:KPt.invalid_enum_value,options:r}),tTt}return nTt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return sEt.create(e,{...this._def,...t})}exclude(e,t=this._def){return sEt.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}sEt.create=iEt;class lEt extends pTt{_parse(e){const t=WPt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==YPt.string&&r.parsedType!==YPt.number){const e=WPt.objectValues(t);return JPt(r,{expected:WPt.joinValues(e),received:r.parsedType,code:KPt.invalid_type}),tTt}if(this._cache||(this._cache=new Set(WPt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=WPt.objectValues(t);return JPt(r,{received:r.data,code:KPt.invalid_enum_value,options:e}),tTt}return nTt(e.data)}get enum(){return this._def.values}}lEt.create=(e,t)=>new lEt({values:e,typeName:xEt.ZodNativeEnum,...dTt(t)});class cEt extends pTt{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==YPt.promise&&!1===t.common.async)return JPt(t,{code:KPt.invalid_type,expected:YPt.promise,received:t.parsedType}),tTt;const r=t.parsedType===YPt.promise?t.data:Promise.resolve(t.data);return nTt(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}cEt.create=(e,t)=>new cEt({type:e,typeName:xEt.ZodPromise,...dTt(t)});class uEt extends pTt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xEt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:e=>{JPt(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===n.type){const e=n.transform(r.data,o);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return tTt;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?tTt:"dirty"===n.status||"dirty"===t.value?rTt(n.value):n});{if("aborted"===t.value)return tTt;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?tTt:"dirty"===n.status||"dirty"===t.value?rTt(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,o);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?tTt:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?tTt:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!iTt(e))return tTt;const a=n.transform(e.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>iTt(e)?Promise.resolve(n.transform(e.value,o)).then(e=>({status:t.value,value:e})):tTt)}WPt.assertNever(n)}}uEt.create=(e,t,r)=>new uEt({schema:e,typeName:xEt.ZodEffects,effect:t,...dTt(r)}),uEt.createWithPreprocess=(e,t,r)=>new uEt({schema:t,effect:{type:"preprocess",transform:e},typeName:xEt.ZodEffects,...dTt(r)});class dEt extends pTt{_parse(e){return this._getType(e)===YPt.undefined?nTt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}dEt.create=(e,t)=>new dEt({innerType:e,typeName:xEt.ZodOptional,...dTt(t)});class pEt extends pTt{_parse(e){return this._getType(e)===YPt.null?nTt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}pEt.create=(e,t)=>new pEt({innerType:e,typeName:xEt.ZodNullable,...dTt(t)});class hEt extends pTt{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===YPt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}hEt.create=(e,t)=>new hEt({innerType:e,typeName:xEt.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...dTt(t)});class fEt extends pTt{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return sTt(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new GPt(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new GPt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}fEt.create=(e,t)=>new fEt({innerType:e,typeName:xEt.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...dTt(t)});class mEt extends pTt{_parse(e){if(this._getType(e)!==YPt.nan){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.nan,received:t.parsedType}),tTt}return{status:"valid",value:e.data}}}mEt.create=e=>new mEt({typeName:xEt.ZodNaN,...dTt(e)});class vEt extends pTt{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class yEt extends pTt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?tTt:"dirty"===e.status?(t.dirty(),rTt(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?tTt:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new yEt({in:e,out:t,typeName:xEt.ZodPipeline})}}class gEt extends pTt{_parse(e){const t=this._def.innerType._parse(e),r=e=>(iTt(e)&&(e.value=Object.freeze(e.value)),e);return sTt(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}var xEt;gEt.create=(e,t)=>new gEt({innerType:e,typeName:xEt.ZodReadonly,...dTt(t)}),function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(xEt||(xEt={}));const bEt=RTt.create,kEt=VTt.create,_Et=ITt.create;YTt.create;const wEt=KTt.create,MEt=XTt.create;QTt.create,eEt.create,tEt.create;const CEt=sEt.create;cEt.create,dEt.create,pEt.create;const jEt=CEt(["daily","weekly","monthly"]),DEt=e=>MEt({id:bEt().optional(),title:bEt().min(1,e.validations.eventNameRequired),description:bEt().optional(),startDate:_Et(),endDate:_Et(),startTime:bEt().regex(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/,e.validations.invalidTimeFormat),endTime:bEt().regex(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/,e.validations.invalidTimeFormat),color:bEt().min(1,e.validations.colorRequired),isRepeating:kEt(),isRepeatingInterval:jEt.default("daily").optional(),isRepeatingExcludedDates:wEt(_Et()).optional()}).refine(e=>{const t=new Date(`${e.startDate.toDateString()} ${e.startTime}`),r=new Date(`${e.endDate.toDateString()} ${e.endTime}`);if(e.isRepeating){const t=new Date(`2000-01-01 ${e.startTime}`);return new Date(`2000-01-01 ${e.endTime}`)>=t}return r>t},{message:e.validations.endTimeBeforeStart,path:["endTime"]}),OEt=({event:r,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:i,open:s,dateFromViewClick:c,translations:u})=>{const[d,p]=e.useState(!1),[h,f]=e.useState(!1),[m,v]=e.useState(!1),[y,g]=e.useState(!1),[x,b]=e.useState(!1),[k,_]=e.useState("single"),[w,M]=e.useState("all"),[C,j]=e.useState(!1),D=function(e={}){const t=l.default.useRef(void 0),r=l.default.useRef(void 0),[n,o]=l.default.useState({isDirty:!1,isValidating:!1,isLoading:tht(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:tht(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!tht(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:r,...o}=Eht(e);t.current={...o,formState:n}}const a=t.current.control;return a._options=e,$pt(()=>{const e=a._subscribe({formState:a._proxyFormState,callback:()=>o({...a._formState}),reRenderRoot:!0});return o(e=>({...e,isReady:!0})),a._formState.isReady=!0,e},[a]),l.default.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),l.default.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),l.default.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),l.default.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),l.default.useEffect(()=>{if(a._proxyFormState.isDirty){const e=a._getDirty();e!==n.isDirty&&a._subjects.state.next({isDirty:e})}},[a,n.isDirty]),l.default.useEffect(()=>{e.values&&!Qpt(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),r.current=e.values,o(e=>({...e}))):a._resetDefaultValues()},[a,e.values]),l.default.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=qpt(n,a),t.current}({resolver:Lht(DEt(u)),defaultValues:{id:(null==r?void 0:r.id)||"",title:(null==r?void 0:r.title)||"",description:(null==r?void 0:r.description)||"",startDate:(null==r?void 0:r.startDate)||new Date,endDate:(null==r?void 0:r.endDate)||new Date,startTime:(null==r?void 0:r.startTime)||"09:00",endTime:(null==r?void 0:r.endTime)||"10:00",color:(null==r?void 0:r.color)||"blue",isRepeating:(null==r?void 0:r.isRepeating)||!1,isRepeatingInterval:(null==r?void 0:r.isRepeatingInterval)||"daily",isRepeatingExcludedDates:(null==r?void 0:r.isRepeatingExcludedDates)||[]}});if(e.useEffect(()=>{const e=D.getValues("startDate"),t=D.getValues("endDate"),r=e.toDateString()===t.toDateString();f(!r)},[D,s]),e.useEffect(()=>{D.reset({title:(null==r?void 0:r.title)||"",description:(null==r?void 0:r.description)||"",startDate:(null==r?void 0:r.startDate)||new Date,endDate:(null==r?void 0:r.endDate)||new Date,startTime:(null==r?void 0:r.startTime)||"09:00",endTime:(null==r?void 0:r.endTime)||"10:00",color:(null==r?void 0:r.color)||"blue",isRepeating:(null==r?void 0:r.isRepeating)||!1,isRepeatingInterval:(null==r?void 0:r.isRepeatingInterval)||"daily",isRepeatingExcludedDates:(null==r?void 0:r.isRepeatingExcludedDates)||[]})},[D,s,r]),e.useEffect(()=>{const e=D.watch((e,{name:t})=>{if("startDate"===t||"endDate"===t){const t=e.startDate,r=e.endDate;t>r&&D.setValue("endDate",t);const n=t.toDateString()===r.toDateString();f(!n),n&&D.setValue("isRepeating",!1)}});return()=>e.unsubscribe()},[D]),!u)return console.error("Translations are required for PopupContent"),null;const O=async e=>{var t;p(!0);try{if(null==r||!r.id){const t={startDate:e.startDate,endDate:e.endDate,title:e.title,startTime:e.startTime,endTime:e.endTime,description:e.description,color:e.color,isRepeating:e.isRepeating,isRepeatingInterval:e.isRepeatingInterval||"daily",isRepeatingExcludedDates:e.isRepeatingExcludedDates||[]};return void await Promise.resolve(n(t))}if(!0!==r.isRepeating){console.log("Updating non-repeating event");const t={...r,startDate:e.startDate,endDate:e.endDate,title:e.title,startTime:e.startTime,endTime:e.endTime,description:e.description,color:e.color,isRepeating:e.isRepeating,isRepeatingInterval:e.isRepeatingInterval||"daily",isRepeatingExcludedDates:e.isRepeatingExcludedDates||[]};return void(o&&await Promise.resolve(o(t)))}const a=c||r.startDate||new Date;switch(w){case"single":{const t=new Date(a.getFullYear(),a.getMonth(),a.getDate()),i=(r.isRepeatingExcludedDates||[]).map(e=>{if(e instanceof Date)return new Date(e.getFullYear(),e.getMonth(),e.getDate());try{const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate())}catch{return null}}).filter(e=>null!==e),s=t.toDateString();if(!i.some(e=>e.toDateString()===s)){const e={...r,isRepeatingExcludedDates:[...i,t]};o&&await Promise.resolve(o(e))}const l={title:e.title,description:e.description,startDate:t,endDate:t,startTime:e.startTime,endTime:e.endTime,color:e.color,isRepeating:!1,isRepeatingInterval:"daily",isRepeatingExcludedDates:[]};await Promise.resolve(n(l));break}case"future":if(a.toDateString()===(null==(t=r.startDate)?void 0:t.toDateString())){const t={...r,...e};o&&await Promise.resolve(o(t))}else{const t=new Date(a);t.setDate(t.getDate()-1);const i={...r,endDate:t};o&&await Promise.resolve(o(i));const s={title:e.title,description:e.description,startDate:a,endDate:e.endDate,startTime:e.startTime,endTime:e.endTime,color:e.color,isRepeating:!0,isRepeatingInterval:e.isRepeatingInterval||"daily",isRepeatingExcludedDates:e.isRepeatingExcludedDates||[]};await Promise.resolve(n(s))}break;case"all":{const t={...r,...e};o&&await Promise.resolve(o(t));break}}}catch(e){console.error("Error saving event:",e),tpt.error("Error saving event")}finally{p(!1),null==i||i()}};return t.jsxs(Bdt,{className:"sm:max-w-[425px] w-full max-h-[90vh] overflow-y-auto",children:[t.jsxs(Vdt,{children:[t.jsxs(qdt,{className:"text-lg sm:text-xl flex items-center",children:[t.jsx(Ist,{className:"mr-2 h-5 w-5"}),null!=r&&r.id?u.editEvent:u.addEvent]}),t.jsx($dt,{className:"text-sm sm:text-base",children:null!=r&&r.id?u.editEventDescription:u.createEventDescription})]}),t.jsxs(Jvt,{...D,children:[t.jsx(HPt,{open:C,onClose:()=>j(!1),editType:w,onEditTypeChange:e=>M(e),onConfirm:()=>{j(!1),D.handleSubmit(O)()},translations:u}),t.jsxs("form",{onSubmit:e=>{var t,n,o,a;if(e.preventDefault(),null!=r&&r.id&&!0===r.isRepeating){const e=D.getValues(),i=(null==(t=e.startDate)?void 0:t.getTime())!==(null==(n=r.startDate)?void 0:n.getTime()),s=(null==(o=e.endDate)?void 0:o.getTime())!==(null==(a=r.endDate)?void 0:a.getTime()),l=e.isRepeating!==r.isRepeating,c=e.isRepeatingInterval!==(r.isRepeatingInterval||"daily"),u=e.isRepeatingExcludedDates||[],d=r.isRepeatingExcludedDates||[],p=JSON.stringify(u),h=JSON.stringify(d);if(!(i||s||l||c||p!==h||C||e.title===r.title&&e.description===r.description&&e.color===r.color&&e.startTime===r.startTime&&e.endTime===r.endTime))return void j(!0)}D.handleSubmit(O)(e)},className:"space-y-4",children:[t.jsx(tyt,{control:D.control,name:"title",render:({field:e})=>t.jsxs(oyt,{children:[t.jsx(ayt,{children:u.eventTitle}),t.jsx(iyt,{children:t.jsx(cyt,{placeholder:u.eventTitle,...e,autoFocus:!r})}),t.jsx(lyt,{})]})}),t.jsx(tyt,{control:D.control,name:"description",render:({field:e})=>t.jsxs(oyt,{children:[t.jsx(ayt,{children:u.eventDescription}),t.jsx(iyt,{children:t.jsx(ebt,{placeholder:u.eventDescription,...e})}),t.jsx(lyt,{})]})}),t.jsx(XOt,{form:D,translations:u}),t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(tyt,{control:D.control,name:"startDate",render:({field:e})=>t.jsxs(oyt,{className:"flex-1",children:[t.jsx(ayt,{children:u.eventDate}),t.jsxs(Xxt,{open:m,onOpenChange:v,children:[t.jsx(Qxt,{asChild:!0,children:t.jsx(iyt,{children:t.jsxs($ht,{variant:"outline",className:"w-full justify-start text-left font-normal",children:[t.jsx(Vst,{className:"mr-2 h-4 w-4"}),e.value?sst(e.value,"PPP"):t.jsx("span",{children:u.pickADate})]})})}),t.jsx(Jxt,{className:"w-auto p-0",children:t.jsx(fmt,{mode:"single",selected:e.value,onSelect:t=>{e.onChange(t),v(!1)},defaultMonth:e.value||new Date})})]}),t.jsx(lyt,{})]})}),t.jsx(tyt,{control:D.control,name:"startTime",render:({field:e})=>t.jsxs(oyt,{className:"flex-1",children:[t.jsx(ayt,{children:u.eventStartTime}),t.jsx(iyt,{children:t.jsx(nOt,{value:e.value,onChange:e.onChange})}),t.jsx(lyt,{})]})})]}),t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(tyt,{control:D.control,name:"endDate",render:({field:e})=>t.jsxs(oyt,{className:"flex-1",children:[t.jsx(ayt,{children:u.eventEndDate}),t.jsxs(Xxt,{open:y,onOpenChange:g,children:[t.jsx(Qxt,{asChild:!0,children:t.jsx(iyt,{children:t.jsxs($ht,{variant:"outline",className:"w-full justify-start text-left font-normal",children:[t.jsx(Vst,{className:"mr-2 h-4 w-4"}),e.value?sst(e.value,"PPP"):t.jsx("span",{children:u.pickADate})]})})}),t.jsx(Jxt,{className:"w-auto p-0",children:t.jsx(fmt,{mode:"single",selected:e.value,onSelect:t=>{if(!t)return;const r=D.getValues("startDate"),n=new Date(r.getFullYear(),r.getMonth(),r.getDate()),o=new Date(t.getFullYear(),t.getMonth(),t.getDate());o>n?(e.onChange(t),g(!1)):o<n?tpt.error(u.errorEndDateBeforeStart):(e.onChange(t),g(!1))},fromDate:D.getValues("startDate"),defaultMonth:e.value||new Date})})]}),t.jsx(lyt,{})]})}),t.jsx(tyt,{control:D.control,name:"endTime",render:({field:e})=>t.jsxs(oyt,{className:"flex-1",children:[t.jsx(ayt,{children:u.eventEndTime}),t.jsx(iyt,{children:t.jsx(nOt,{value:e.value,onChange:e.onChange})}),t.jsx(lyt,{})]})})]}),t.jsx(fbt,{children:t.jsx($Pt,{form:D,translations:u,showRepeatToggle:h})}),t.jsx(tyt,{control:D.control,name:"color",render:({field:e})=>t.jsxs(oyt,{children:[t.jsx(ayt,{children:u.eventColor}),t.jsxs(EPt,{onValueChange:e.onChange,defaultValue:e.value,children:[t.jsx(iyt,{children:t.jsx(zPt,{children:t.jsx(NPt,{placeholder:u.selectAColor})})}),t.jsx(FPt,{children:Bat.map(e=>t.jsx(BPt,{value:e.value,children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:`w-4 h-4 rounded-full mr-2 ${e.class}`}),e.label]})},e.value))})]}),t.jsx(lyt,{})]})}),t.jsxs(Idt,{className:"flex flex-col space-y-3 sm:space-y-0 sm:flex-row sm:justify-between items-center w-full",children:[(null==r?void 0:r.id)&&t.jsx("div",{className:"w-full sm:w-auto",children:t.jsxs(qmt,{children:[t.jsx($mt,{asChild:!0,children:t.jsx($ht,{disabled:x,type:"button",variant:"destructive",size:"sm",className:"w-full gap-1 h-10 sm:w-auto bg-red-600 dark:bg-red-800 hover:bg-red-500 dark:hover:bg-red-900 text-xs sm:text-sm",children:x?t.jsxs(t.Fragment,{children:[t.jsx(alt,{className:"h-4 w-4 animate-spin"}),u.deleting]}):t.jsxs(t.Fragment,{children:[t.jsx(llt,{className:"h-4 w-4"}),u.delete]})})}),t.jsxs(Umt,{className:"max-w-[425px]",children:[t.jsxs(Ymt,{children:[t.jsxs(Kmt,{className:"flex items-center",children:[t.jsx(Kst,{className:"mr-2 h-5 w-5 text-red-500"}),null!=r&&r.isRepeating?u.repeatEventDeleteTitle:u.confirmDelete]}),t.jsx(Gmt,{className:"text-left",children:null!=r&&r.isRepeating?u.repeatEventDeleteDescription:u.confirmDeleteDescription}),t.jsx("div",{className:"h-2"}),(null==r?void 0:r.isRepeating)&&t.jsx("div",{className:"mt-4 space-y-4",children:t.jsx(Yvt,{defaultValue:"single",onValueChange:e=>_(e),children:t.jsx("div",{className:"space-y-4",children:[{value:"single",label:u.deleteThisOccurrence,description:u.deleteThisOccurrenceDescription},{value:"future",label:u.deleteThisAndFuture,description:u.deleteThisAndFutureDescription},{value:"all",label:u.deleteAllOccurrences,description:u.deleteAllOccurrencesDescription}].map(e=>t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(Zvt,{value:e.value,id:e.value}),t.jsxs(Qvt,{htmlFor:e.value,className:"flex flex-col flex-1 items-start cursor-pointer",children:[t.jsx("span",{className:"leading-none",children:e.label}),t.jsx("span",{className:"text-sm text-muted-foreground mt-1",children:e.description})]})]},e.value))})})}),t.jsx("div",{className:"h-2"})]}),t.jsxs(Zmt,{children:[t.jsx(Qmt,{children:u.cancel}),t.jsxs(Xmt,{onClick:async()=>{var e;if(null==r||!r.id)throw Error("Missing Event Id");b(!0);try{const t=c||r.startDate||new Date;if(!r.isRepeating||"all"===k)return void(a&&await Promise.resolve(a(r.id)));if("single"===k){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate()),n=(r.isRepeatingExcludedDates||[]).map(e=>{if(e instanceof Date)return new Date(e.getFullYear(),e.getMonth(),e.getDate());try{const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate())}catch{return null}}).filter(e=>null!==e),a=e.toDateString(),i=n.some(e=>e.toDateString()===a)?n:[...n,e],s={...r,id:r.id,isRepeatingExcludedDates:i};o&&await Promise.resolve(o(s))}else if("future"===k)if(t.toDateString()===(null==(e=r.startDate)?void 0:e.toDateString()))a&&await Promise.resolve(a(r.id));else{const e=new Date(t);e.setDate(e.getDate()-1);const n={...r,id:r.id,endDate:e};o&&await Promise.resolve(o(n))}}finally{b(!1),null==i||i()}},className:"w-full sm:w-auto bg-red-600 dark:bg-red-800 hover:bg-red-500 dark:hover:bg-red-900 sm:text-sm dark:text-white",children:[t.jsx(llt,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),u.delete]})]})]})]})}),t.jsxs("div",{className:"flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2 w-full",children:[t.jsx($ht,{type:"button",variant:"outline",onClick:i,className:"w-full sm:w-1/2 text-xs sm:text-sm",children:u.cancel}),t.jsx($ht,{type:"submit",className:"w-full sm:w-1/2 text-xs sm:text-sm",disabled:d,children:d?t.jsxs(t.Fragment,{children:[t.jsx(alt,{className:"h-4 w-4 animate-spin"}),u.saving]}):u.save})]})]})]})]})]})},SEt=({translations:e,children:r,isDisabled:n=!1})=>r?t.jsx(Rdt,{asChild:!0,disabled:n,children:r}):t.jsx(Rdt,{asChild:!0,children:t.jsxs($ht,{variant:"default",size:"sm",className:"w-full gap-0 sm:w-auto text-xs sm:text-sm",disabled:n,children:[t.jsx(Ist,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),e.addEvent]})}),PEt=({event:r,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:i,onOpenChange:s,dateFromViewClick:l,children:c,isDisabled:u=!1,translations:d})=>{const[p,h]=e.useState(!1),f=e=>{u||(h(e),null==s||s(e),e||null==i||i())};return t.jsxs(Adt,{open:p,onOpenChange:f,children:[t.jsx(SEt,{translations:d,isDisabled:u,children:c}),t.jsx(OEt,{event:r,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:()=>f(!1),dateFromViewClick:l,open:p,translations:d})]})};var TEt=["Enter"," "],EEt=["ArrowUp","PageDown","End"],NEt=["ArrowDown","PageUp","Home",...EEt],zEt={ltr:[...TEt,"ArrowRight"],rtl:[...TEt,"ArrowLeft"]},AEt={ltr:["ArrowLeft"],rtl:["ArrowRight"]},REt="Menu",[FEt,LEt,BEt]=Jmt(REt),[VEt,IEt]=flt(REt,[BEt,oxt,cvt]),qEt=oxt(),$Et=cvt(),[HEt,WEt]=VEt(REt),[UEt,YEt]=VEt(REt),ZEt=e=>{const{__scopeMenu:r,open:n=!1,children:o,dir:a,onOpenChange:i,modal:l=!0}=e,c=qEt(r),[u,d]=s.useState(null),p=s.useRef(!1),h=Plt(i),f=tvt(a);return s.useEffect(()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),t.jsx(bxt,{...c,children:t.jsx(HEt,{scope:r,open:n,onOpenChange:h,content:u,onContentChange:d,children:t.jsx(UEt,{scope:r,onClose:s.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:f,modal:l,children:o})})})};ZEt.displayName=REt;var KEt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e,a=qEt(n);return t.jsx(kxt,{...a,...o,ref:r})});KEt.displayName="MenuAnchor";var GEt="MenuPortal",[XEt,QEt]=VEt(GEt,{forceMount:void 0}),JEt=e=>{const{__scopeMenu:r,forceMount:n,children:o,container:a}=e,i=WEt(GEt,r);return t.jsx(XEt,{scope:r,forceMount:n,children:t.jsx(Xlt,{present:n||i.open,children:t.jsx(Glt,{asChild:!0,container:a,children:o})})})};JEt.displayName=GEt;var eNt="MenuContent",[tNt,rNt]=VEt(eNt),nNt=s.forwardRef((e,r)=>{const n=QEt(eNt,e.__scopeMenu),{forceMount:o=n.forceMount,...a}=e,i=WEt(eNt,e.__scopeMenu),s=YEt(eNt,e.__scopeMenu);return t.jsx(FEt.Provider,{scope:e.__scopeMenu,children:t.jsx(Xlt,{present:o||i.open,children:t.jsx(FEt.Slot,{scope:e.__scopeMenu,children:s.modal?t.jsx(oNt,{...a,ref:r}):t.jsx(aNt,{...a,ref:r})})})})}),oNt=s.forwardRef((e,r)=>{const n=WEt(eNt,e.__scopeMenu),o=s.useRef(null),a=hlt(r,o);return s.useEffect(()=>{const e=o.current;if(e)return Xct(e)},[]),t.jsx(sNt,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ult(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),aNt=s.forwardRef((e,r)=>{const n=WEt(eNt,e.__scopeMenu);return t.jsx(sNt,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),iNt=_lt("MenuContent.ScrollLock"),sNt=s.forwardRef((e,r)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:m,disableOutsideScroll:v,...y}=e,g=WEt(eNt,n),x=YEt(eNt,n),b=qEt(n),k=$Et(n),_=LEt(n),[w,M]=s.useState(null),C=s.useRef(null),j=hlt(r,C,g.onContentChange),D=s.useRef(0),O=s.useRef(""),S=s.useRef(0),P=s.useRef(null),T=s.useRef("right"),E=s.useRef(0),N=v?Hct:s.Fragment,z=v?{as:iNt,allowPinchZoom:!0}:void 0,A=e=>{var t,r;const n=O.current+e,o=_().filter(e=>!e.disabled),a=document.activeElement,i=null==(t=o.find(e=>e.ref.current===a))?void 0:t.textValue,s=function(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(o,0));1===n.length&&(a=a.filter(e=>e!==r));const i=a.find(e=>e.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}(o.map(e=>e.textValue),n,i),l=null==(r=o.find(e=>e.textValue===s))?void 0:r.ref.current;(function e(t){O.current=t,window.clearTimeout(D.current),""!==t&&(D.current=window.setTimeout(()=>e(""),1e3))})(n),l&&setTimeout(()=>l.focus())};s.useEffect(()=>()=>window.clearTimeout(D.current),[]),ect();const R=s.useCallback(e=>{var t,r;return T.current===(null==(t=P.current)?void 0:t.side)&&function(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return function(e,t){const{x:r,y:n}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,u=s.x,d=s.y;c>n!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(o=!o)}return o}(r,t)}(e,null==(r=P.current)?void 0:r.area)},[]);return t.jsx(tNt,{scope:n,searchRef:O,onItemEnter:s.useCallback(e=>{R(e)&&e.preventDefault()},[R]),onItemLeave:s.useCallback(e=>{var t;R(e)||(null==(t=C.current)||t.focus(),M(null))},[R]),onTriggerLeave:s.useCallback(e=>{R(e)&&e.preventDefault()},[R]),pointerGraceTimerRef:S,onPointerGraceIntentChange:s.useCallback(e=>{P.current=e},[]),children:t.jsx(N,{...z,children:t.jsx($lt,{asChild:!0,trapped:a,onMountAutoFocus:ult(i,e=>{var t;e.preventDefault(),null==(t=C.current)||t.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:t.jsx(Rlt,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:m,children:t.jsx(gvt,{asChild:!0,...k,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:w,onCurrentTabStopIdChange:M,onEntryFocus:ult(u,e=>{x.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:t.jsx(_xt,{role:"menu","aria-orientation":"vertical","data-state":NNt(g.open),"data-radix-menu-content":"",dir:x.dir,...b,...y,ref:j,style:{outline:"none",...y.style},onKeyDown:ult(y.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&A(e.key));const o=C.current;if(e.target!==o||!NEt.includes(e.key))return;e.preventDefault();const a=_().filter(e=>!e.disabled).map(e=>e.ref.current);EEt.includes(e.key)&&a.reverse(),function(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(a)}),onBlur:ult(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current="")}),onPointerMove:ult(e.onPointerMove,RNt(e=>{const t=e.target,r=E.current!==e.clientX;if(e.currentTarget.contains(t)&&r){const t=e.clientX>E.current?"right":"left";T.current=t,E.current=e.clientX}}))})})})})})})});nNt.displayName=eNt;var lNt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(Olt.div,{role:"group",...o,ref:r})});lNt.displayName="MenuGroup";var cNt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(Olt.div,{...o,ref:r})});cNt.displayName="MenuLabel";var uNt="MenuItem",dNt="menu.itemSelect",pNt=s.forwardRef((e,r)=>{const{disabled:n=!1,onSelect:o,...a}=e,i=s.useRef(null),l=YEt(uNt,e.__scopeMenu),c=rNt(uNt,e.__scopeMenu),u=hlt(r,i),d=s.useRef(!1);return t.jsx(hNt,{...a,ref:u,disabled:n,onClick:ult(e.onClick,()=>{const e=i.current;if(!n&&e){const t=new CustomEvent(dNt,{bubbles:!0,cancelable:!0});e.addEventListener(dNt,e=>null==o?void 0:o(e),{once:!0}),Slt(e,t),t.defaultPrevented?d.current=!1:l.onClose()}}),onPointerDown:t=>{var r;null==(r=e.onPointerDown)||r.call(e,t),d.current=!0},onPointerUp:ult(e.onPointerUp,e=>{var t;d.current||null==(t=e.currentTarget)||t.click()}),onKeyDown:ult(e.onKeyDown,e=>{const t=""!==c.searchRef.current;n||t&&" "===e.key||TEt.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});pNt.displayName=uNt;var hNt=s.forwardRef((e,r)=>{const{__scopeMenu:n,disabled:o=!1,textValue:a,...i}=e,l=rNt(uNt,n),c=$Et(n),u=s.useRef(null),d=hlt(r,u),[p,h]=s.useState(!1),[f,m]=s.useState("");return s.useEffect(()=>{const e=u.current;e&&m((e.textContent??"").trim())},[i.children]),t.jsx(FEt.ItemSlot,{scope:n,disabled:o,textValue:a??f,children:t.jsx(xvt,{asChild:!0,...c,focusable:!o,children:t.jsx(Olt.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:ult(e.onPointerMove,RNt(e=>{o?l.onItemLeave(e):(l.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ult(e.onPointerLeave,RNt(e=>l.onItemLeave(e))),onFocus:ult(e.onFocus,()=>h(!0)),onBlur:ult(e.onBlur,()=>h(!1))})})})}),fNt=s.forwardRef((e,r)=>{const{checked:n=!1,onCheckedChange:o,...a}=e;return t.jsx(_Nt,{scope:e.__scopeMenu,checked:n,children:t.jsx(pNt,{role:"menuitemcheckbox","aria-checked":zNt(n)?"mixed":n,...a,ref:r,"data-state":ANt(n),onSelect:ult(a.onSelect,()=>null==o?void 0:o(!!zNt(n)||!n),{checkForDefaultPrevented:!1})})})});fNt.displayName="MenuCheckboxItem";var mNt="MenuRadioGroup",[vNt,yNt]=VEt(mNt,{value:void 0,onValueChange:()=>{}}),gNt=s.forwardRef((e,r)=>{const{value:n,onValueChange:o,...a}=e,i=Plt(o);return t.jsx(vNt,{scope:e.__scopeMenu,value:n,onValueChange:i,children:t.jsx(lNt,{...a,ref:r})})});gNt.displayName=mNt;var xNt="MenuRadioItem",bNt=s.forwardRef((e,r)=>{const{value:n,...o}=e,a=yNt(xNt,e.__scopeMenu),i=n===a.value;return t.jsx(_Nt,{scope:e.__scopeMenu,checked:i,children:t.jsx(pNt,{role:"menuitemradio","aria-checked":i,...o,ref:r,"data-state":ANt(i),onSelect:ult(o.onSelect,()=>{var e;return null==(e=a.onValueChange)?void 0:e.call(a,n)},{checkForDefaultPrevented:!1})})})});bNt.displayName=xNt;var kNt="MenuItemIndicator",[_Nt,wNt]=VEt(kNt,{checked:!1}),MNt=s.forwardRef((e,r)=>{const{__scopeMenu:n,forceMount:o,...a}=e,i=wNt(kNt,n);return t.jsx(Xlt,{present:o||zNt(i.checked)||!0===i.checked,children:t.jsx(Olt.span,{...a,ref:r,"data-state":ANt(i.checked)})})});MNt.displayName=kNt;var CNt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(Olt.div,{role:"separator","aria-orientation":"horizontal",...o,ref:r})});CNt.displayName="MenuSeparator";var jNt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e,a=qEt(n);return t.jsx(wxt,{...a,...o,ref:r})});jNt.displayName="MenuArrow";var[DNt,ONt]=VEt("MenuSub"),SNt="MenuSubTrigger",PNt=s.forwardRef((e,r)=>{const n=WEt(SNt,e.__scopeMenu),o=YEt(SNt,e.__scopeMenu),a=ONt(SNt,e.__scopeMenu),i=rNt(SNt,e.__scopeMenu),l=s.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},p=s.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return s.useEffect(()=>p,[p]),s.useEffect(()=>{const e=c.current;return()=>{window.clearTimeout(e),u(null)}},[c,u]),t.jsx(KEt,{asChild:!0,...d,children:t.jsx(hNt,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":NNt(n.open),...e,ref:plt(r,a.onTriggerChange),onClick:t=>{var r;null==(r=e.onClick)||r.call(e,t),!e.disabled&&!t.defaultPrevented&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ult(e.onPointerMove,RNt(t=>{i.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:ult(e.onPointerLeave,RNt(e=>{var t,r;p();const o=null==(t=n.content)?void 0:t.getBoundingClientRect();if(o){const t=null==(r=n.content)?void 0:r.dataset.side,a="right"===t,s=a?-5:5,l=o[a?"left":"right"],u=o[a?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+s,y:e.clientY},{x:l,y:o.top},{x:u,y:o.top},{x:u,y:o.bottom},{x:l,y:o.bottom}],side:t}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ult(e.onKeyDown,t=>{var r;const a=""!==i.searchRef.current;e.disabled||a&&" "===t.key||zEt[o.dir].includes(t.key)&&(n.onOpenChange(!0),null==(r=n.content)||r.focus(),t.preventDefault())})})})});PNt.displayName=SNt;var TNt="MenuSubContent",ENt=s.forwardRef((e,r)=>{const n=QEt(eNt,e.__scopeMenu),{forceMount:o=n.forceMount,...a}=e,i=WEt(eNt,e.__scopeMenu),l=YEt(eNt,e.__scopeMenu),c=ONt(TNt,e.__scopeMenu),u=s.useRef(null),d=hlt(r,u);return t.jsx(FEt.Provider,{scope:e.__scopeMenu,children:t.jsx(Xlt,{present:o||i.open,children:t.jsx(FEt.Slot,{scope:e.__scopeMenu,children:t.jsx(sNt,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;l.isUsingKeyboardRef.current&&(null==(t=u.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:ult(e.onFocusOutside,e=>{e.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ult(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:ult(e.onKeyDown,e=>{var t;const r=e.currentTarget.contains(e.target),n=AEt[l.dir].includes(e.key);r&&n&&(i.onOpenChange(!1),null==(t=c.trigger)||t.focus(),e.preventDefault())})})})})})});function NNt(e){return e?"open":"closed"}function zNt(e){return"indeterminate"===e}function ANt(e){return zNt(e)?"indeterminate":e?"checked":"unchecked"}function RNt(e){return t=>"mouse"===t.pointerType?e(t):void 0}ENt.displayName=TNt;var FNt=ZEt,LNt=KEt,BNt=JEt,VNt=nNt,INt=lNt,qNt=cNt,$Nt=pNt,HNt=fNt,WNt=gNt,UNt=bNt,YNt=MNt,ZNt=CNt,KNt=jNt,GNt=PNt,XNt=ENt,QNt="DropdownMenu",[JNt,ezt]=flt(QNt,[IEt]),tzt=IEt(),[rzt,nzt]=JNt(QNt),ozt=e=>{const{__scopeDropdownMenu:r,children:n,dir:o,open:a,defaultOpen:i,onOpenChange:l,modal:c=!0}=e,u=tzt(r),d=s.useRef(null),[p,h]=klt({prop:a,defaultProp:i??!1,onChange:l,caller:QNt});return t.jsx(rzt,{scope:r,triggerId:xlt(),triggerRef:d,contentId:xlt(),open:p,onOpenChange:h,onOpenToggle:s.useCallback(()=>h(e=>!e),[h]),modal:c,children:t.jsx(FNt,{...u,open:p,onOpenChange:h,dir:o,modal:c,children:n})})};ozt.displayName=QNt;var azt="DropdownMenuTrigger",izt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...a}=e,i=nzt(azt,n),s=tzt(n);return t.jsx(LNt,{asChild:!0,...s,children:t.jsx(Olt.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...a,ref:plt(r,i.triggerRef),onPointerDown:ult(e.onPointerDown,e=>{!o&&0===e.button&&!1===e.ctrlKey&&(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:ult(e.onKeyDown,e=>{o||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});izt.displayName=azt;var szt=e=>{const{__scopeDropdownMenu:r,...n}=e,o=tzt(r);return t.jsx(BNt,{...o,...n})};szt.displayName="DropdownMenuPortal";var lzt="DropdownMenuContent",czt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=nzt(lzt,n),i=tzt(n),l=s.useRef(!1);return t.jsx(VNt,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...o,ref:r,onCloseAutoFocus:ult(e.onCloseAutoFocus,e=>{var t;l.current||null==(t=a.triggerRef.current)||t.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:ult(e.onInteractOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!a.modal||n)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});czt.displayName=lzt;var uzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(INt,{...a,...o,ref:r})});uzt.displayName="DropdownMenuGroup";var dzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(qNt,{...a,...o,ref:r})});dzt.displayName="DropdownMenuLabel";var pzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx($Nt,{...a,...o,ref:r})});pzt.displayName="DropdownMenuItem";var hzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(HNt,{...a,...o,ref:r})});hzt.displayName="DropdownMenuCheckboxItem";var fzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(WNt,{...a,...o,ref:r})});fzt.displayName="DropdownMenuRadioGroup";var mzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(UNt,{...a,...o,ref:r})});mzt.displayName="DropdownMenuRadioItem";var vzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(YNt,{...a,...o,ref:r})});vzt.displayName="DropdownMenuItemIndicator";var yzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(ZNt,{...a,...o,ref:r})});yzt.displayName="DropdownMenuSeparator";var gzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(KNt,{...a,...o,ref:r})});gzt.displayName="DropdownMenuArrow";var xzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(GNt,{...a,...o,ref:r})});xzt.displayName="DropdownMenuSubTrigger";var bzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(XNt,{...a,...o,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});bzt.displayName="DropdownMenuSubContent";var kzt=szt,_zt=czt,wzt=dzt,Mzt=pzt,Czt=hzt,jzt=mzt,Dzt=vzt,Ozt=yzt,Szt=xzt,Pzt=bzt;const Tzt=ozt,Ezt=izt,Nzt=s.forwardRef(({className:e,inset:r,children:n,...o},a)=>t.jsxs(Szt,{ref:a,className:zdt("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",e),...o,children:[n,t.jsx(Yst,{className:"ml-auto"})]}));Nzt.displayName=Szt.displayName;const zzt=s.forwardRef(({className:e,...r},n)=>t.jsx(Pzt,{ref:n,className:zdt("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));zzt.displayName=Pzt.displayName;const Azt=s.forwardRef(({className:e,sideOffset:r=4,...n},o)=>t.jsx(kzt,{children:t.jsx(_zt,{ref:o,sideOffset:r,className:zdt("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Azt.displayName=_zt.displayName;const Rzt=s.forwardRef(({className:e,inset:r,...n},o)=>t.jsx(Mzt,{ref:o,className:zdt("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",e),...n}));Rzt.displayName=Mzt.displayName;const Fzt=s.forwardRef(({className:e,children:r,checked:n,...o},a)=>t.jsxs(Czt,{ref:a,className:zdt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Dzt,{children:t.jsx(Hst,{className:"h-4 w-4"})})}),r]}));Fzt.displayName=Czt.displayName;const Lzt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(jzt,{ref:o,className:zdt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Dzt,{children:t.jsx(Xst,{className:"h-2 w-2 fill-current"})})}),r]}));Lzt.displayName=jzt.displayName;const Bzt=s.forwardRef(({className:e,inset:r,...n},o)=>t.jsx(wzt,{ref:o,className:zdt("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",e),...n}));Bzt.displayName=wzt.displayName;const Vzt=s.forwardRef(({className:e,...r},n)=>t.jsx(Ozt,{ref:n,className:zdt("-mx-1 my-1 h-px bg-muted",e),...r}));Vzt.displayName=Ozt.displayName;const Izt=({isFilterOpen:e,setIsFilterOpen:r,selectedColors:n,toggleColorSelection:o,currentConfig:a})=>t.jsxs(Tzt,{open:e,onOpenChange:r,children:[t.jsx(Ezt,{asChild:!0,children:t.jsx($ht,{variant:"outline",size:"sm",className:"w-20 overflow-hidden",children:t.jsx(fbt,{mode:"wait",children:t.jsxs(rOt.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:[t.jsx(elt,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"text-xs font-medium",children:e?a.localization.filtering:a.localization.filter})]},e?"open":"closed")})})}),t.jsxs(Azt,{children:[t.jsx(Bzt,{children:a.localization.filterByColor}),t.jsx(Vzt,{}),Bat.map(e=>t.jsx(Fzt,{checked:n.includes(e.value),onCheckedChange:()=>o(e.value),onSelect:e=>{e.preventDefault()},children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:`w-4 h-4 rounded-full mr-2 ${e.class}`}),e.label]})},e.value)),t.jsx(Vzt,{}),t.jsx($ht,{variant:"ghost",size:"sm",onClick:()=>r(!1),className:"w-full justify-center h-8 text-sm",children:a.localization.close})]})]});function qzt(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}var $zt=["color"],Hzt=e.forwardRef(function(t,r){var n=t.color,o=void 0===n?"currentColor":n,a=qzt(t,$zt);return e.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),e.createElement("path",{d:"M4.5 1C4.77614 1 5 1.22386 5 1.5V2H10V1.5C10 1.22386 10.2239 1 10.5 1C10.7761 1 11 1.22386 11 1.5V2H12.5C13.3284 2 14 2.67157 14 3.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V3.5C1 2.67157 1.67157 2 2.5 2H4V1.5C4 1.22386 4.22386 1 4.5 1ZM10 3V3.5C10 3.77614 10.2239 4 10.5 4C10.7761 4 11 3.77614 11 3.5V3H12.5C12.7761 3 13 3.22386 13 3.5V5H2V3.5C2 3.22386 2.22386 3 2.5 3H4V3.5C4 3.77614 4.22386 4 4.5 4C4.77614 4 5 3.77614 5 3.5V3H10ZM2 6V12.5C2 12.7761 2.22386 13 2.5 13H12.5C12.7761 13 13 12.7761 13 12.5V6H2ZM7 7.5C7 7.22386 7.22386 7 7.5 7C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8C7.22386 8 7 7.77614 7 7.5ZM9.5 7C9.22386 7 9 7.22386 9 7.5C9 7.77614 9.22386 8 9.5 8C9.77614 8 10 7.77614 10 7.5C10 7.22386 9.77614 7 9.5 7ZM11 7.5C11 7.22386 11.2239 7 11.5 7C11.7761 7 12 7.22386 12 7.5C12 7.77614 11.7761 8 11.5 8C11.2239 8 11 7.77614 11 7.5ZM11.5 9C11.2239 9 11 9.22386 11 9.5C11 9.77614 11.2239 10 11.5 10C11.7761 10 12 9.77614 12 9.5C12 9.22386 11.7761 9 11.5 9ZM9 9.5C9 9.22386 9.22386 9 9.5 9C9.77614 9 10 9.22386 10 9.5C10 9.77614 9.77614 10 9.5 10C9.22386 10 9 9.77614 9 9.5ZM7.5 9C7.22386 9 7 9.22386 7 9.5C7 9.77614 7.22386 10 7.5 10C7.77614 10 8 9.77614 8 9.5C8 9.22386 7.77614 9 7.5 9ZM5 9.5C5 9.22386 5.22386 9 5.5 9C5.77614 9 6 9.22386 6 9.5C6 9.77614 5.77614 10 5.5 10C5.22386 10 5 9.77614 5 9.5ZM3.5 9C3.22386 9 3 9.22386 3 9.5C3 9.77614 3.22386 10 3.5 10C3.77614 10 4 9.77614 4 9.5C4 9.22386 3.77614 9 3.5 9ZM3 11.5C3 11.2239 3.22386 11 3.5 11C3.77614 11 4 11.2239 4 11.5C4 11.7761 3.77614 12 3.5 12C3.22386 12 3 11.7761 3 11.5ZM5.5 11C5.22386 11 5 11.2239 5 11.5C5 11.7761 5.22386 12 5.5 12C5.77614 12 6 11.7761 6 11.5C6 11.2239 5.77614 11 5.5 11ZM7 11.5C7 11.2239 7.22386 11 7.5 11C7.77614 11 8 11.2239 8 11.5C8 11.7761 7.77614 12 7.5 12C7.22386 12 7 11.7761 7 11.5ZM9.5 11C9.22386 11 9 11.2239 9 11.5C9 11.7761 9.22386 12 9.5 12C9.77614 12 10 11.7761 10 11.5C10 11.2239 9.77614 11 9.5 11Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),Wzt=["color"],Uzt=e.forwardRef(function(t,r){var n=t.color,o=void 0===n?"currentColor":n,a=qzt(t,Wzt);return e.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),e.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),Yzt=["color"],Zzt=e.forwardRef(function(t,r){var n=t.color,o=void 0===n?"currentColor":n,a=qzt(t,Yzt);return e.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),e.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),Kzt=.999,Gzt=/[\\\/_+.#"@\[\(\{&]/,Xzt=/[\\\/_+.#"@\[\(\{&]/g,Qzt=/[\s-]/,Jzt=/[\s-]/g;function eAt(e,t,r,n,o,a,i){if(a===t.length)return o===e.length?1:.99;var s=`${o},${a}`;if(void 0!==i[s])return i[s];for(var l,c,u,d,p=n.charAt(a),h=r.indexOf(p,o),f=0;h>=0;)(l=eAt(e,t,r,n,h+1,a+1,i))>f&&(h===o?l*=1:Gzt.test(e.charAt(h-1))?(l*=.8,(u=e.slice(o,h-1).match(Xzt))&&o>0&&(l*=Math.pow(Kzt,u.length))):Qzt.test(e.charAt(h-1))?(l*=.9,(d=e.slice(o,h-1).match(Jzt))&&o>0&&(l*=Math.pow(Kzt,d.length))):(l*=.17,o>0&&(l*=Math.pow(Kzt,h-o))),e.charAt(h)!==t.charAt(a)&&(l*=.9999)),(l<.1&&r.charAt(h-1)===n.charAt(a+1)||n.charAt(a+1)===n.charAt(a)&&r.charAt(h-1)!==n.charAt(a))&&(.1*(c=eAt(e,t,r,n,h+1,a+2,i))>l&&(l=.1*c)),l>f&&(f=l),h=r.indexOf(p,h+1);return i[s]=f,f}function tAt(e){return e.toLowerCase().replace(Jzt," ")}function rAt(e,t,r){return eAt(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,tAt(e),tAt(t),0,0,{})}function nAt(){return nAt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nAt.apply(null,arguments)}function oAt(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function aAt(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}function iAt(...t){return e.useCallback(aAt(...t),t)}function sAt(...t){const r=t[0];if(1===t.length)return r;const n=()=>{const n=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const o=n.reduce((e,{useScope:r,scopeName:n})=>({...e,...r(t)[`__scope${n}`]}),{});return e.useMemo(()=>({[`__scope${r.scopeName}`]:o}),[o])}};return n.scopeName=r.scopeName,n}const lAt=null!=globalThis&&globalThis.document?e.useLayoutEffect:()=>{},cAt=s.useId||(()=>{});let uAt=0;function dAt(e){const[t,r]=s.useState(cAt());return lAt(()=>{r(e=>e??String(uAt++))},[e]),e||(t?`radix-${t}`:"")}function pAt(t){const r=e.useRef(t);return e.useEffect(()=>{r.current=t}),e.useMemo(()=>(...e)=>{var t;return null===(t=r.current)||void 0===t?void 0:t.call(r,...e)},[])}function hAt({prop:t,defaultProp:r,onChange:n=()=>{}}){const[o,a]=function({defaultProp:t,onChange:r}){const n=e.useState(t),[o]=n,a=e.useRef(o),i=pAt(r);return e.useEffect(()=>{a.current!==o&&(i(o),a.current=o)},[o,a,i]),n}({defaultProp:r,onChange:n}),i=void 0!==t,s=i?t:o,l=pAt(n),c=e.useCallback(e=>{if(i){const r="function"==typeof e?e(t):e;r!==t&&l(r)}else a(e)},[i,t,a,l]);return[s,c]}const fAt=e.forwardRef((t,r)=>{const{children:n,...o}=t,a=e.Children.toArray(n),i=a.find(yAt);if(i){const t=i.props.children,n=a.map(r=>r===i?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:r);return e.createElement(mAt,nAt({},o,{ref:r}),e.isValidElement(t)?e.cloneElement(t,void 0,n):null)}return e.createElement(mAt,nAt({},o,{ref:r}),n)});fAt.displayName="Slot";const mAt=e.forwardRef((t,r)=>{const{children:n,...o}=t;return e.isValidElement(n)?e.cloneElement(n,{...gAt(o,n.props),ref:r?aAt(r,n.ref):n.ref}):e.Children.count(n)>1?e.Children.only(null):null});mAt.displayName="SlotClone";const vAt=({children:t})=>e.createElement(e.Fragment,null,t);function yAt(t){return e.isValidElement(t)&&t.type===vAt}function gAt(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{a(...e),o(...e)}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}const xAt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((t,r)=>{const n=e.forwardRef((t,n)=>{const{asChild:o,...a}=t,i=o?fAt:r;return e.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),e.createElement(i,nAt({},a,{ref:n}))});return n.displayName=`Primitive.${r}`,{...t,[r]:n}},{});const bAt="dismissableLayer.update",kAt="dismissableLayer.pointerDownOutside",_At="dismissableLayer.focusOutside";let wAt;const MAt=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),CAt=e.forwardRef((t,r)=>{var n;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=t,d=e.useContext(MAt),[p,h]=e.useState(null),f=null!==(n=null==p?void 0:p.ownerDocument)&&void 0!==n?n:null==globalThis?void 0:globalThis.document,[,m]=e.useState({}),v=iAt(r,e=>h(e)),y=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(g),b=p?y.indexOf(p):-1,k=d.layersWithOutsidePointerEventsDisabled.size>0,_=b>=x,w=function(t,r=(null==globalThis?void 0:globalThis.document)){const n=pAt(t),o=e.useRef(!1),a=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let t=function(){DAt(kAt,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",a.current),a.current=t,r.addEventListener("click",a.current,{once:!0})):t()}else r.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",a.current)}},[r,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));!_||r||(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())},f),M=function(t,r=(null==globalThis?void 0:globalThis.document)){const n=pAt(t),o=e.useRef(!1);return e.useEffect(()=>{const e=e=>{e.target&&!o.current&&DAt(_At,n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())},f);return function(t,r=(null==globalThis?void 0:globalThis.document)){const n=pAt(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return r.addEventListener("keydown",e),()=>r.removeEventListener("keydown",e)},[n,r])}(e=>{b===d.layers.size-1&&(null==a||a(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},f),e.useEffect(()=>{if(p)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(wAt=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),jAt(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=wAt)}},[p,f,o,d]),e.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),jAt())},[p,d]),e.useEffect(()=>{const e=()=>m({});return document.addEventListener(bAt,e),()=>document.removeEventListener(bAt,e)},[]),e.createElement(xAt.div,nAt({},u,{ref:v,style:{pointerEvents:k?_?"auto":"none":void 0,...t.style},onFocusCapture:oAt(t.onFocusCapture,M.onFocusCapture),onBlurCapture:oAt(t.onBlurCapture,M.onBlurCapture),onPointerDownCapture:oAt(t.onPointerDownCapture,w.onPointerDownCapture)}))});function jAt(){const e=new CustomEvent(bAt);document.dispatchEvent(e)}function DAt(e,t,n,{discrete:o}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),o?function(e,t){e&&r.flushSync(()=>e.dispatchEvent(t))}(a,i):a.dispatchEvent(i)}const OAt="focusScope.autoFocusOnMount",SAt="focusScope.autoFocusOnUnmount",PAt={bubbles:!1,cancelable:!0},TAt=e.forwardRef((t,r)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=t,[l,c]=e.useState(null),u=pAt(a),d=pAt(i),p=e.useRef(null),h=iAt(r,e=>c(e)),f=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(o){let e=function(e){if(f.paused||!l)return;const t=e.target;l.contains(t)?p.current=t:AAt(p.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||AAt(p.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&AAt(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[o,l,f.paused]),e.useEffect(()=>{if(l){RAt.add(f);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(OAt,PAt);l.addEventListener(OAt,u),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(AAt(n,{select:t}),document.activeElement!==r)return}(function(e){return e.filter(e=>"A"!==e.tagName)}(EAt(l)),{select:!0}),document.activeElement===e&&AAt(l))}return()=>{l.removeEventListener(OAt,u),setTimeout(()=>{const t=new CustomEvent(SAt,PAt);l.addEventListener(SAt,d),l.dispatchEvent(t),t.defaultPrevented||AAt(e??document.body,{select:!0}),l.removeEventListener(SAt,d),RAt.remove(f)},0)}}},[l,u,d,f]);const m=e.useCallback(e=>{if(!n&&!o||f.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[o,a]=function(e){const t=EAt(e),r=NAt(t,e),n=NAt(t.reverse(),e);return[r,n]}(t);o&&a?e.shiftKey||r!==a?e.shiftKey&&r===o&&(e.preventDefault(),n&&AAt(a,{select:!0})):(e.preventDefault(),n&&AAt(o,{select:!0})):r===t&&e.preventDefault()}},[n,o,f.paused]);return e.createElement(xAt.div,nAt({tabIndex:-1},s,{ref:h,onKeyDown:m}))});function EAt(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function NAt(e,t){for(const r of e)if(!zAt(r,{upTo:t}))return r}function zAt(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function AAt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const RAt=function(){let e=[];return{add(t){const r=e[0];t!==r&&(null==r||r.pause()),e=FAt(e,t),e.unshift(t)},remove(t){var r;e=FAt(e,t),null===(r=e[0])||void 0===r||r.resume()}}}();function FAt(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}const LAt=e.forwardRef((t,r)=>{var n;const{container:o=(null==globalThis||null===(n=globalThis.document)||void 0===n?void 0:n.body),...a}=t;return o?u.default.createPortal(e.createElement(xAt.div,nAt({},a,{ref:r})),o):null});const BAt=t=>{const{present:n,children:o}=t,a=function(t){const[n,o]=e.useState(),a=e.useRef({}),i=e.useRef(t),s=e.useRef("none"),l=t?"mounted":"unmounted",[c,u]=function(t,r){return e.useReducer((e,t)=>r[e][t]??e,t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=VAt(a.current);s.current="mounted"===c?e:"none"},[c]),lAt(()=>{const e=a.current,r=i.current;if(r!==t){const n=s.current,o=VAt(e);t?u("MOUNT"):"none"===o||"none"===(null==e?void 0:e.display)?u("UNMOUNT"):u(r&&n!==o?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,u]),lAt(()=>{if(n){const e=e=>{const t=VAt(a.current).includes(e.animationName);e.target===n&&t&&r.flushSync(()=>u("ANIMATION_END"))},t=e=>{e.target===n&&(s.current=VAt(a.current))};return n.addEventListener("animationstart",t),n.addEventListener("animationcancel",e),n.addEventListener("animationend",e),()=>{n.removeEventListener("animationstart",t),n.removeEventListener("animationcancel",e),n.removeEventListener("animationend",e)}}u("ANIMATION_END")},[n,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:e.useCallback(e=>{e&&(a.current=getComputedStyle(e)),o(e)},[])}}(n),i="function"==typeof o?o({present:a.isPresent}):e.Children.only(o),s=iAt(a.ref,i.ref);return"function"==typeof o||a.isPresent?e.cloneElement(i,{ref:s}):null};function VAt(e){return(null==e?void 0:e.animationName)||"none"}BAt.displayName="Presence";let IAt=0;function qAt(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var $At=pct(),HAt=function(){},WAt=s.forwardRef(function(e,t){var r=s.useRef(null),n=s.useState({onScrollCapture:HAt,onWheelCapture:HAt,onTouchMoveCapture:HAt}),o=n[0],a=n[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,f=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,g=void 0===y?"div":y,x=nct(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),b=h,k=uct([r,t]),_=rct(rct({},x),o);return s.createElement(s.Fragment,null,d&&s.createElement(b,{sideCar:$At,removeScrollBar:u,shards:p,noIsolation:f,inert:m,setCallbacks:a,allowPinchZoom:!!v,lockRef:r}),i?s.cloneElement(s.Children.only(l),rct(rct({},_),{ref:k})):s.createElement(g,rct({},_,{className:c,ref:k}),l))});WAt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},WAt.classNames={fullWidth:ict,zeroRight:act};var UAt=!1;if(typeof window<"u")try{var YAt=Object.defineProperty({},"passive",{get:function(){return UAt=!0,!0}});window.addEventListener("test",YAt,YAt),window.removeEventListener("test",YAt,YAt)}catch{UAt=!1}var ZAt=!!UAt&&{passive:!1},KAt=function(e,t){var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},GAt=function(e,t){var r=t;do{if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host),XAt(e,r)){var n=QAt(e,r);if(n[1]>n[2])return!0}r=r.parentNode}while(r&&r!==document.body);return!1},XAt=function(e,t){return"v"===e?function(e){return KAt(e,"overflowY")}(t):function(e){return KAt(e,"overflowX")}(t)},QAt=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},JAt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eRt=function(e){return[e.deltaX,e.deltaY]},tRt=function(e){return e&&"current"in e?e.current:e},rRt=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},nRt=0,oRt=[];const aRt=fct($At,function(e){var t=s.useRef([]),r=s.useRef([0,0]),n=s.useRef(),o=s.useState(nRt++)[0],a=s.useState(function(){return bct()})[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=oct([e.lockRef.current],(e.shards||[]).map(tRt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=s.useCallback(function(e,t){if("touches"in e&&2===e.touches.length)return!i.current.allowPinchZoom;var o,a=JAt(e),s=r.current,l="deltaX"in e?e.deltaX:s[0]-a[0],c="deltaY"in e?e.deltaY:s[1]-a[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=GAt(d,u);if(!p)return!0;if(p?o=d:(o="v"===d?"h":"v",p=GAt(d,u)),!p)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=o),!o)return!0;var h=n.current||o;return function(e,t,r,n){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,s=t.contains(i),l=!1,c=a>0,u=0,d=0;do{var p=QAt(e,i),h=p[0],f=p[1]-p[2]-o*h;(h||f)&&XAt(e,i)&&(u+=f,d+=h),i=i.parentNode}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&0===u||!c&&0===d)&&(l=!0),l}(h,t,e,"h"===h?l:c)},[]),c=s.useCallback(function(e){var r=e;if(oRt.length&&oRt[oRt.length-1]===a){var n="deltaY"in r?eRt(r):JAt(r),o=t.current.filter(function(e){return e.name===r.type&&e.target===r.target&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,n)})[0];if(o&&o.should)return void(r.cancelable&&r.preventDefault());if(!o){var s=(i.current.shards||[]).map(tRt).filter(Boolean).filter(function(e){return e.contains(r.target)});(s.length>0?l(r,s[0]):!i.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=s.useCallback(function(e,r,n,o){var a={name:e,delta:r,target:n,should:o};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){r.current=JAt(e),n.current=void 0},[]),p=s.useCallback(function(t){u(t.type,eRt(t),t.target,l(t,e.lockRef.current))},[]),h=s.useCallback(function(t){u(t.type,JAt(t),t.target,l(t,e.lockRef.current))},[]);s.useEffect(function(){return oRt.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,ZAt),document.addEventListener("touchmove",c,ZAt),document.addEventListener("touchstart",d,ZAt),function(){oRt=oRt.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,ZAt),document.removeEventListener("touchmove",c,ZAt),document.removeEventListener("touchstart",d,ZAt)}},[]);var f=e.removeScrollBar,m=e.inert;return s.createElement(s.Fragment,null,m?s.createElement(a,{styles:rRt(o)}):null,f?s.createElement(Oct,{gapMode:"margin"}):null)});var iRt=s.forwardRef(function(e,t){return s.createElement(WAt,rct({},e,{ref:t,sideCar:aRt}))});iRt.classNames=WAt.classNames;const sRt="Dialog",[lRt,cRt]=function(t,r=[]){let n=[];const o=()=>{const r=n.map(t=>e.createContext(t));return function(n){const o=(null==n?void 0:n[t])||r;return e.useMemo(()=>({[`__scope${t}`]:{...n,[t]:o}}),[n,o])}};return o.scopeName=t,[function(r,o){const a=e.createContext(o),i=n.length;function s(r){const{scope:n,children:o,...s}=r,l=(null==n?void 0:n[t][i])||a,c=e.useMemo(()=>s,Object.values(s));return e.createElement(l.Provider,{value:c},o)}return n=[...n,o],s.displayName=r+"Provider",[s,function(n,s){const l=(null==s?void 0:s[t][i])||a,c=e.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${n}\` must be used within \`${r}\``)}]},sAt(o,...r)]}(sRt),[uRt,dRt]=lRt(sRt),pRt="DialogPortal",[hRt,fRt]=lRt(pRt,{forceMount:void 0}),mRt="DialogOverlay",vRt=e.forwardRef((t,r)=>{const n=fRt(mRt,t.__scopeDialog),{forceMount:o=n.forceMount,...a}=t,i=dRt(mRt,t.__scopeDialog);return i.modal?e.createElement(BAt,{present:o||i.open},e.createElement(yRt,nAt({},a,{ref:r}))):null}),yRt=e.forwardRef((t,r)=>{const{__scopeDialog:n,...o}=t,a=dRt(mRt,n);return e.createElement(iRt,{as:fAt,allowPinchZoom:!0,shards:[a.contentRef]},e.createElement(xAt.div,nAt({"data-state":wRt(a.open)},o,{ref:r,style:{pointerEvents:"auto",...o.style}})))}),gRt="DialogContent",xRt=e.forwardRef((t,r)=>{const n=fRt(gRt,t.__scopeDialog),{forceMount:o=n.forceMount,...a}=t,i=dRt(gRt,t.__scopeDialog);return e.createElement(BAt,{present:o||i.open},i.modal?e.createElement(bRt,nAt({},a,{ref:r})):e.createElement(kRt,nAt({},a,{ref:r})))}),bRt=e.forwardRef((t,r)=>{const n=dRt(gRt,t.__scopeDialog),o=e.useRef(null),a=iAt(r,n.contentRef,o);return e.useEffect(()=>{const e=o.current;if(e)return Xct(e)},[]),e.createElement(_Rt,nAt({},t,{ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oAt(t.onCloseAutoFocus,e=>{var t;e.preventDefault(),null===(t=n.triggerRef.current)||void 0===t||t.focus()}),onPointerDownOutside:oAt(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:oAt(t.onFocusOutside,e=>e.preventDefault())}))}),kRt=e.forwardRef((t,r)=>{const n=dRt(gRt,t.__scopeDialog),o=e.useRef(!1),a=e.useRef(!1);return e.createElement(_Rt,nAt({},t,{ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{var r,i;(null===(r=t.onCloseAutoFocus)||void 0===r||r.call(t,e),e.defaultPrevented)||(o.current||null===(i=n.triggerRef.current)||void 0===i||i.focus(),e.preventDefault());o.current=!1,a.current=!1},onInteractOutside:e=>{var r,i;null===(r=t.onInteractOutside)||void 0===r||r.call(t,e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const s=e.target;(null===(i=n.triggerRef.current)||void 0===i?void 0:i.contains(s))&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}}))}),_Rt=e.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=t,l=dRt(gRt,n),c=iAt(r,e.useRef(null));return e.useEffect(()=>{var e,t;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=r[0])&&void 0!==e?e:qAt()),document.body.insertAdjacentElement("beforeend",null!==(t=r[1])&&void 0!==t?t:qAt()),IAt++,()=>{1===IAt&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),IAt--}},[]),e.createElement(e.Fragment,null,e.createElement(TAt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i},e.createElement(CAt,nAt({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":wRt(l.open)},s,{ref:c,onDismiss:()=>l.onOpenChange(!1)}))),!1)});function wRt(e){return e?"open":"closed"}const MRt=t=>{const{__scopeDialog:r,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=t,l=e.useRef(null),c=e.useRef(null),[u=!1,d]=hAt({prop:o,defaultProp:a,onChange:i});return e.createElement(uRt,{scope:r,triggerRef:l,contentRef:c,contentId:dAt(),titleId:dAt(),descriptionId:dAt(),open:u,onOpenChange:d,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),modal:s},n)},CRt=t=>{const{__scopeDialog:r,forceMount:n,children:o,container:a}=t,i=dRt(pRt,r);return e.createElement(hRt,{scope:r,forceMount:n},e.Children.map(o,t=>e.createElement(BAt,{present:n||i.open},e.createElement(LAt,{asChild:!0,container:a},t))))},jRt=vRt,DRt=xRt;var ORt='[cmdk-group=""]',SRt='[cmdk-group-items=""]',PRt='[cmdk-item=""]',TRt=`${PRt}:not([aria-disabled="true"])`,ERt="cmdk-item-select",NRt="data-value",zRt=(e,t,r)=>rAt(e,t,r),ARt=s.createContext(void 0),RRt=()=>s.useContext(ARt),FRt=s.createContext(void 0),LRt=()=>s.useContext(FRt),BRt=s.createContext(void 0),VRt=s.forwardRef((e,t)=>{let r=eFt(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",filtered:{count:0,items:new Map,groups:new Set}}}),n=eFt(()=>new Set),o=eFt(()=>new Map),a=eFt(()=>new Map),i=eFt(()=>new Set),l=QRt(e),{label:c,children:u,value:d,onValueChange:p,filter:h,shouldFilter:f,loop:m,disablePointerSelection:v=!1,vimBindings:y=!0,...g}=e,x=s.useId(),b=s.useId(),k=s.useId(),_=s.useRef(null),w=oFt();JRt(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,M.emit()}},[d]),JRt(()=>{w(6,P)},[]);let M=s.useMemo(()=>({subscribe:e=>(i.current.add(e),()=>i.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var o,a,i;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)S(),D(),w(1,O);else if("value"===e&&(n||w(5,P),void 0!==(null==(o=l.current)?void 0:o.value))){let e=t??"";return void(null==(i=(a=l.current).onValueChange)||i.call(a,e))}M.emit()}},emit:()=>{i.current.forEach(e=>e())}}),[]),C=s.useMemo(()=>({value:(e,t,n)=>{var o;t!==(null==(o=a.current.get(e))?void 0:o.value)&&(a.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,j(t,n)),w(2,()=>{D(),M.emit()}))},item:(e,t)=>(n.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),w(3,()=>{S(),D(),r.current.value||O(),M.emit()}),()=>{a.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=T();w(4,()=>{S(),(null==t?void 0:t.getAttribute("id"))===e&&O(),M.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{a.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],disablePointerSelection:v,listId:x,inputId:k,labelId:b,listInnerRef:_}),[]);function j(e,t){var n,o;let a=null!=(o=null==(n=l.current)?void 0:n.filter)?o:zRt;return e?a(e,r.current.search,t):0}function D(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=o.current.get(r),a=0;n.forEach(t=>{let r=e.get(t);a=Math.max(r,a)}),t.push([r,a])});let n=_.current;E().sort((t,r)=>{var n,o;let a=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(o=e.get(a))?o:0)}).forEach(e=>{let t=e.closest(SRt);t?t.appendChild(e.parentElement===t?e:e.closest(`${SRt} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${SRt} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=_.current.querySelector(`${ORt}[${NRt}="${encodeURIComponent(e[0])}"]`);null==t||t.parentElement.appendChild(t)})}function O(){let e=E().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(NRt);M.setState("value",t||void 0)}function S(){var e,t,i,s;if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let c=0;for(let o of n.current){let n=j(null!=(t=null==(e=a.current.get(o))?void 0:e.value)?t:"",null!=(s=null==(i=a.current.get(o))?void 0:i.keywords)?s:[]);r.current.filtered.items.set(o,n),n>0&&c++}for(let[e,t]of o.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function P(){var e,t,r;let n=T();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(ORt))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function T(){var e;return null==(e=_.current)?void 0:e.querySelector(`${PRt}[aria-selected="true"]`)}function E(){var e;return Array.from(null==(e=_.current)?void 0:e.querySelectorAll(TRt))}function N(e){let t=E()[e];t&&M.setState("value",t.getAttribute(NRt))}function z(e){var t;let r=T(),n=E(),o=n.findIndex(e=>e===r),a=n[o+e];null!=(t=l.current)&&t.loop&&(a=o+e<0?n[n.length-1]:o+e===n.length?n[0]:n[o+e]),a&&M.setState("value",a.getAttribute(NRt))}function A(e){let t,r=T(),n=null==r?void 0:r.closest(ORt);for(;n&&!t;)n=e>0?GRt(n,ORt):XRt(n,ORt),t=null==n?void 0:n.querySelector(TRt);t?M.setState("value",t.getAttribute(NRt)):z(e)}let R=()=>N(E().length-1),F=e=>{e.preventDefault(),e.metaKey?R():e.altKey?A(1):z(1)},L=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?A(-1):z(-1)};return s.createElement(xAt.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=g.onKeyDown)||t.call(g,e),!e.defaultPrevented)switch(e.key){case"n":case"j":y&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":y&&e.ctrlKey&&L(e);break;case"ArrowUp":L(e);break;case"Home":e.preventDefault(),N(0);break;case"End":e.preventDefault(),R();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=T();if(t){let e=new Event(ERt);t.dispatchEvent(e)}}}}},s.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:iFt},c),aFt(e,e=>s.createElement(FRt.Provider,{value:M},s.createElement(ARt.Provider,{value:C},e))))}),IRt=s.forwardRef((e,t)=>{var r,n;let o=s.useId(),a=s.useRef(null),i=s.useContext(BRt),l=RRt(),c=QRt(e),u=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==i?void 0:i.forceMount;JRt(()=>{if(!u)return l.item(o,null==i?void 0:i.id)},[u]);let d=nFt(o,a,[e.value,e.children,a],e.keywords),p=LRt(),h=rFt(e=>e.value&&e.value===d.current),f=rFt(e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0));function m(){var e,t;v(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function v(){p.setState("value",d.current,!0)}if(s.useEffect(()=>{let t=a.current;if(t&&!e.disabled)return t.addEventListener(ERt,m),()=>t.removeEventListener(ERt,m)},[f,e.onSelect,e.disabled]),!f)return null;let{disabled:y,value:g,onSelect:x,forceMount:b,keywords:k,..._}=e;return s.createElement(xAt.div,{ref:tFt([a,t]),..._,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!h,"data-disabled":!!y,"data-selected":!!h,onPointerMove:y||l.disablePointerSelection?void 0:v,onClick:y?void 0:m},e.children)}),qRt=s.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:o,...a}=e,i=s.useId(),l=s.useRef(null),c=s.useRef(null),u=s.useId(),d=RRt(),p=rFt(e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(i)));JRt(()=>d.group(i),[]),nFt(i,l,[e.value,e.heading,c]);let h=s.useMemo(()=>({id:i,forceMount:o}),[o]);return s.createElement(xAt.div,{ref:tFt([l,t]),...a,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&s.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),aFt(e,e=>s.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},s.createElement(BRt.Provider,{value:h},e))))}),$Rt=s.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,o=s.useRef(null),a=rFt(e=>!e.search);return r||a?s.createElement(xAt.div,{ref:tFt([o,t]),...n,"cmdk-separator":"",role:"separator"}):null}),HRt=s.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,o=null!=e.value,a=LRt(),i=rFt(e=>e.search),l=rFt(e=>e.value),c=RRt(),u=s.useMemo(()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${PRt}[${NRt}="${encodeURIComponent(l)}"]`);return null==t?void 0:t.getAttribute("id")},[]);return s.useEffect(()=>{null!=e.value&&a.setState("search",e.value)},[e.value]),s.createElement(xAt.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":u,id:c.inputId,type:"text",value:o?e.value:i,onChange:e=>{o||a.setState("search",e.target.value),null==r||r(e.target.value)}})}),WRt=s.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,a=s.useRef(null),i=s.useRef(null),l=RRt();return s.useEffect(()=>{if(i.current&&a.current){let e,t=i.current,r=a.current,n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}},[]),s.createElement(xAt.div,{ref:tFt([a,t]),...o,"cmdk-list":"",role:"listbox","aria-label":n,id:l.listId},aFt(e,e=>s.createElement("div",{ref:tFt([i,l.listInnerRef]),"cmdk-list-sizer":""},e)))}),URt=s.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:a,container:i,...l}=e;return s.createElement(MRt,{open:r,onOpenChange:n},s.createElement(CRt,{container:i},s.createElement(jRt,{"cmdk-overlay":"",className:o}),s.createElement(DRt,{"aria-label":e.label,"cmdk-dialog":"",className:a},s.createElement(VRt,{ref:t,...l}))))}),YRt=s.forwardRef((e,t)=>rFt(e=>0===e.filtered.count)?s.createElement(xAt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),ZRt=s.forwardRef((e,t)=>{let{progress:r,children:n,label:o="Loading...",...a}=e;return s.createElement(xAt.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},aFt(e,e=>s.createElement("div",{"aria-hidden":!0},e)))}),KRt=Object.assign(VRt,{List:WRt,Item:IRt,Input:HRt,Group:qRt,Separator:$Rt,Dialog:URt,Empty:YRt,Loading:ZRt});function GRt(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function XRt(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function QRt(e){let t=s.useRef(e);return JRt(()=>{t.current=e}),t}var JRt=typeof window>"u"?s.useEffect:s.useLayoutEffect;function eFt(e){let t=s.useRef();return void 0===t.current&&(t.current=e()),t}function tFt(e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}function rFt(e){let t=LRt(),r=()=>e(t.snapshot());return s.useSyncExternalStore(t.subscribe,r,r)}function nFt(e,t,r,n=[]){let o=s.useRef(),a=RRt();return JRt(()=>{var i;let s=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=n.map(e=>e.trim());a.value(e,s,l),null==(i=t.current)||i.setAttribute(NRt,s),o.current=s}),o}var oFt=()=>{let[e,t]=s.useState(),r=eFt(()=>new Map);return JRt(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function aFt({asChild:e,children:t},r){return e&&s.isValidElement(t)?s.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},r(t.props.children)):r(t)}var iFt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const sFt=s.forwardRef(({className:e,...r},n)=>t.jsx(KRt,{ref:n,className:zdt("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));sFt.displayName=KRt.displayName;const lFt=s.forwardRef(({className:e,...r},n)=>t.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[t.jsx(slt,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),t.jsx(KRt.Input,{ref:n,className:zdt("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]}));lFt.displayName=KRt.Input.displayName;const cFt=s.forwardRef(({className:e,...r},n)=>t.jsx(KRt.List,{ref:n,className:zdt("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));cFt.displayName=KRt.List.displayName;const uFt=s.forwardRef((e,r)=>t.jsx(KRt.Empty,{ref:r,className:"py-6 text-center text-sm",...e}));uFt.displayName=KRt.Empty.displayName;const dFt=s.forwardRef(({className:e,...r},n)=>t.jsx(KRt.Group,{ref:n,className:zdt("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...r}));dFt.displayName=KRt.Group.displayName;const pFt=s.forwardRef(({className:e,...r},n)=>t.jsx(KRt.Separator,{ref:n,className:zdt("-mx-1 h-px bg-border",e),...r}));pFt.displayName=KRt.Separator.displayName;const hFt=s.forwardRef(({className:e,...r},n)=>t.jsx(KRt.Item,{ref:n,className:zdt("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...r}));hFt.displayName=KRt.Item.displayName;const fFt=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},mFt=({day:e,weekday:r,translations:n})=>{const o=(e=>["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].indexOf(e))(r),a=n.dayNames[o];return t.jsxs("div",{className:"flex items-center w-full",children:[t.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground italic whitespace-nowrap mr-1 sm:mr-2 pl-4",children:a}),t.jsxs("span",{className:"text-xs sm:text-sm font-medium truncate flex-grow text-center",children:[e,fFt(parseInt(e))]})]})};function vFt({className:e,selectedDate:r,onDateChange:n,isAnimating:o,direction:a,translations:i}){const[l,c]=s.useState(!1),u=s.useMemo(()=>(e=>bit({start:kit(e),end:xit(e)}).map(e=>({dayNumber:sst(e,"d"),weekday:sst(e,"EEE"),value:sst(e,"yyyy-MM-dd"),date:e})))(r),[r]),d=u.find(e=>sst(e.date,"yyyy-MM-dd")===sst(r,"yyyy-MM-dd"));return t.jsxs(Xxt,{open:l,onOpenChange:c,children:[t.jsx(Qxt,{asChild:!0,children:t.jsxs($ht,{variant:"outline",role:"combobox","aria-expanded":l,"aria-label":i.selectDate,className:zdt("w-[120px] sm:w-[159px] justify-between border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",e),children:[t.jsx(fbt,{mode:"wait",children:t.jsx(rOt.div,{initial:!!o&&{y:"down"===a?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===a?-10:10,opacity:0},transition:{duration:.2},className:"w-full",children:d?t.jsx(mFt,{day:d.dayNumber,weekday:d.weekday,translations:i}):t.jsx("span",{className:"text-xs sm:text-sm",children:i.selectDate})},null==d?void 0:d.value)}),t.jsx(Uzt,{className:"ml-1 sm:ml-2 h-4 w-4 sm:h-4 sm:w-4 shrink-0 opacity-50"})]})}),t.jsx(Jxt,{className:"w-[120px] sm:w-[161px] p-0",children:t.jsxs(sFt,{children:[t.jsx(lFt,{placeholder:`${i.search} ${i.day.toLowerCase()}...`,className:"text-xs sm:text-sm"}),t.jsxs(cFt,{className:"max-h-[300px] overflow-y-auto",children:[t.jsx(uFt,{children:i.noEvents}),t.jsx(dFt,{children:u.map(e=>t.jsxs(hFt,{onSelect:()=>{n(e.date),c(!1)},className:"text-xs sm:text-sm",children:[t.jsx(mFt,{day:e.dayNumber,weekday:e.weekday,translations:i}),t.jsx(Zzt,{className:zdt("ml-auto h-4 w-4 sm:h-4 sm:w-4",(null==d?void 0:d.value)===e.value?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}function yFt({className:e,selectedMonth:r,onMonthChange:n,onDateChange:o,isAnimating:a,direction:i,translations:l,currentDate:c}){const[u,d]=s.useState(!1),p=l.monthNames.map(e=>({label:e,value:e.toLowerCase().slice(0,3)}));return t.jsxs(Xxt,{open:u,onOpenChange:d,children:[t.jsx(Qxt,{asChild:!0,children:t.jsxs($ht,{variant:"outline",role:"combobox","aria-expanded":u,"aria-label":l.selectDate,className:zdt("w-[110px] sm:w-[151px] justify-center border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",e),children:[t.jsx(Hzt,{className:"hidden sm:inline-block mr-2 h-4 w-4"}),t.jsx(fbt,{mode:"wait",children:t.jsx(rOt.p,{className:"text-xs sm:text-sm flex-grow text-center",initial:!!a&&{y:"down"===i?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===i?-10:10,opacity:0},transition:{duration:.2},children:r.label},r.value)}),t.jsx(Uzt,{className:"hidden sm:inline-block ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),t.jsx(Jxt,{className:"w-[110px] sm:w-[151px] p-0",children:t.jsxs(sFt,{children:[t.jsx(lFt,{placeholder:l.search,className:"text-xs sm:text-sm"}),t.jsxs(cFt,{children:[t.jsx(uFt,{className:"text-xs sm:text-sm",children:l.noEvents}),t.jsx(dFt,{children:p.map(e=>t.jsxs(hFt,{onSelect:()=>(e=>{const t=c.getDate(),r=c.getFullYear(),a=p.findIndex(t=>t.value===e.value),i=new Date(r,a,t);i.getDate()!==t&&i.setMonth(a+1,0),n(e),o&&o(i),d(!1)})(e),className:"text-xs sm:text-sm",children:[e.label,t.jsx(Zzt,{className:zdt("ml-auto h-4 w-4 sm:h-4 sm:w-4",r.value===e.value?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}function gFt({className:r,currentYear:n,onYearChange:o,onDateChange:a,currentDate:i,isAnimating:s,direction:l}){const[c,u]=e.useState(!1),[d,p]=e.useState(n),[h,f]=e.useState(n.toString());e.useEffect(()=>{p(n),f(n.toString())},[n]);const m=e=>{if(e>=1900&&e<=3100){const t=i.getDate(),r=i.getMonth(),n=new Date(e,r,t);n.getMonth()!==r&&n.setDate(0),p(e),f(e.toString()),o(e),a&&a(n)}},v=e=>{m(d+e)};return t.jsxs(Xxt,{open:c,onOpenChange:u,children:[t.jsx(Qxt,{asChild:!0,children:t.jsx($ht,{variant:"outline",role:"combobox","aria-expanded":c,"aria-label":"Select a year",className:zdt("w-[70px] sm:w-[71px] justify-center border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",r),children:t.jsx(fbt,{mode:"wait",children:t.jsx(rOt.p,{className:"text-xs sm:text-sm",initial:!!s&&{y:"down"===l?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===l?-10:10,opacity:0},transition:{duration:.2},children:d},d)})})}),t.jsx(Jxt,{className:"w-[90px] sm:w-[130px] p-2",children:t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsx($ht,{variant:"ghost",size:"sm",className:"w-full h-8",onClick:()=>v(1),children:t.jsx(Zst,{className:"h-4 w-4 sm:h-4 sm:w-4"})}),t.jsx(cyt,{type:"text",value:h,onChange:e=>{const t=e.target.value;f(t);const r=parseInt(t,10);!isNaN(r)&&r>=1900&&r<=2100&&m(r)},onBlur:()=>{h!==d.toString()&&f(d.toString())},className:"w-full text-center text-xs sm:text-sm h-8"}),t.jsx($ht,{variant:"ghost",size:"sm",className:"w-full h-8",onClick:()=>v(-1),children:t.jsx(Wst,{className:"h-4 w-4 sm:h-4 sm:w-4"})})]})})]})}const xFt=({currentDate:e,currentView:r,handlePrevious:n,handleNext:o,lastUpdated:a,animationDirection:i,months:s,handleDayChange:l,handleMonthChange:c,handleYearChange:u,currentConfig:d})=>t.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[t.jsx($ht,{variant:"ghost",onClick:n,size:"icon",className:"h-8 w-8 sm:h-10 sm:w-10",children:t.jsx(Ust,{className:"h-4 w-4"})}),t.jsxs(fbt,{mode:"sync",children:["day"===r&&t.jsx(rOt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(vFt,{translations:d.localization,className:"font-semibold text-sm sm:text-lg",selectedDate:e,onDateChange:l,isAnimating:"day"===a,direction:i})},"day-switcher"),"year"!==r&&t.jsx(rOt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(yFt,{className:"font-semibold text-sm sm:text-lg",selectedMonth:s[e.getMonth()],onMonthChange:c,onDateChange:l,isAnimating:"month"===a,direction:i,translations:d.localization,currentDate:e})},"month-switcher"),t.jsx(rOt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(gFt,{className:"font-semibold text-sm sm:text-lg",currentYear:e.getFullYear(),onYearChange:u,onDateChange:l,currentDate:e,isAnimating:"year"===a,direction:i})},"year-switcher")]}),t.jsx($ht,{variant:"ghost",onClick:o,size:"icon",className:"h-8 w-8 sm:h-10 sm:w-10",children:t.jsx(Yst,{className:"h-4 w-4"})})]});var[bFt,kFt]=flt("Tooltip",[oxt]),_Ft=oxt(),wFt="TooltipProvider",MFt=700,CFt="tooltip.open",[jFt,DFt]=bFt(wFt),OFt=e=>{const{__scopeTooltip:r,delayDuration:n=MFt,skipDelayDuration:o=300,disableHoverableContent:a=!1,children:i}=e,l=s.useRef(!0),c=s.useRef(!1),u=s.useRef(0);return s.useEffect(()=>{const e=u.current;return()=>window.clearTimeout(e)},[]),t.jsx(jFt,{scope:r,isOpenDelayedRef:l,delayDuration:n,onOpen:s.useCallback(()=>{window.clearTimeout(u.current),l.current=!1},[]),onClose:s.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>l.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:s.useCallback(e=>{c.current=e},[]),disableHoverableContent:a,children:i})};OFt.displayName=wFt;var SFt="Tooltip",[PFt,TFt]=bFt(SFt),EFt=e=>{const{__scopeTooltip:r,children:n,open:o,defaultOpen:a,onOpenChange:i,disableHoverableContent:l,delayDuration:c}=e,u=DFt(SFt,e.__scopeTooltip),d=_Ft(r),[p,h]=s.useState(null),f=xlt(),m=s.useRef(0),v=l??u.disableHoverableContent,y=c??u.delayDuration,g=s.useRef(!1),[x,b]=klt({prop:o,defaultProp:a??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(CFt))):u.onClose(),null==i||i(e)},caller:SFt}),k=s.useMemo(()=>x?g.current?"delayed-open":"instant-open":"closed",[x]),_=s.useCallback(()=>{window.clearTimeout(m.current),m.current=0,g.current=!1,b(!0)},[b]),w=s.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b(!1)},[b]),M=s.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{g.current=!0,b(!0),m.current=0},y)},[y,b]);return s.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),t.jsx(bxt,{...d,children:t.jsx(PFt,{scope:r,contentId:f,open:x,stateAttribute:k,trigger:p,onTriggerChange:h,onTriggerEnter:s.useCallback(()=>{u.isOpenDelayedRef.current?M():_()},[u.isOpenDelayedRef,M,_]),onTriggerLeave:s.useCallback(()=>{v?w():(window.clearTimeout(m.current),m.current=0)},[w,v]),onOpen:_,onClose:w,disableHoverableContent:v,children:n})})};EFt.displayName=SFt;var NFt="TooltipTrigger",zFt=s.forwardRef((e,r)=>{const{__scopeTooltip:n,...o}=e,a=TFt(NFt,n),i=DFt(NFt,n),l=_Ft(n),c=hlt(r,s.useRef(null),a.onTriggerChange),u=s.useRef(!1),d=s.useRef(!1),p=s.useCallback(()=>u.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),t.jsx(kxt,{asChild:!0,...l,children:t.jsx(Olt.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...o,ref:c,onPointerMove:ult(e.onPointerMove,e=>{"touch"!==e.pointerType&&!d.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:ult(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:ult(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:ult(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:ult(e.onBlur,a.onClose),onClick:ult(e.onClick,a.onClose)})})});zFt.displayName=NFt;var[AFt,RFt]=bFt("TooltipPortal",{forceMount:void 0}),FFt="TooltipContent",LFt=s.forwardRef((e,r)=>{const n=RFt(FFt,e.__scopeTooltip),{forceMount:o=n.forceMount,side:a="top",...i}=e,s=TFt(FFt,e.__scopeTooltip);return t.jsx(Xlt,{present:o||s.open,children:s.disableHoverableContent?t.jsx($Ft,{side:a,...i,ref:r}):t.jsx(BFt,{side:a,...i,ref:r})})}),BFt=s.forwardRef((e,r)=>{const n=TFt(FFt,e.__scopeTooltip),o=DFt(FFt,e.__scopeTooltip),a=s.useRef(null),i=hlt(r,a),[l,c]=s.useState(null),{trigger:u,onClose:d}=n,p=a.current,{onPointerInTransitChange:h}=o,f=s.useCallback(()=>{c(null),h(!1)},[h]),m=s.useCallback((e,t)=>{const r=e.currentTarget,n={x:e.clientX,y:e.clientY},o=function(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}(n,r.getBoundingClientRect()),a=function(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}(n,o),i=function(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}(t.getBoundingClientRect()),s=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const r=[];for(let t=e.length-1;t>=0;t--){const n=e[t];for(;r.length>=2;){const e=r[r.length-1],t=r[r.length-2];if(!((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x)))break;r.pop()}r.push(n)}return r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}(t)}([...a,...i]);c(s),h(!0)},[h]);return s.useEffect(()=>()=>f(),[f]),s.useEffect(()=>{if(u&&p){const e=e=>m(e,p),t=e=>m(e,u);return u.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[u,p,m,f]),s.useEffect(()=>{if(l){const e=e=>{const t=e.target,r={x:e.clientX,y:e.clientY},n=(null==u?void 0:u.contains(t))||(null==p?void 0:p.contains(t)),o=!function(e,t){const{x:r,y:n}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,u=s.x,d=s.y;c>n!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(o=!o)}return o}(r,l);n?f():o&&(f(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[u,p,l,d,f]),t.jsx($Ft,{...e,ref:i})}),[VFt,IFt]=bFt(SFt,{isInside:!1}),qFt=jlt("TooltipContent"),$Ft=s.forwardRef((e,r)=>{const{__scopeTooltip:n,children:o,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...c}=e,u=TFt(FFt,n),d=_Ft(n),{onClose:p}=u;return s.useEffect(()=>(document.addEventListener(CFt,p),()=>document.removeEventListener(CFt,p)),[p]),s.useEffect(()=>{if(u.trigger){const e=e=>{const t=e.target;null!=t&&t.contains(u.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,p]),t.jsx(Rlt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:t.jsxs(_xt,{"data-state":u.stateAttribute,...d,...c,ref:r,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(qFt,{children:o}),t.jsx(VFt,{scope:n,isInside:!0,children:t.jsx(fSt,{id:u.contentId,role:"tooltip",children:a||o})})]})})});LFt.displayName=FFt;var HFt="TooltipArrow",WFt=s.forwardRef((e,r)=>{const{__scopeTooltip:n,...o}=e,a=_Ft(n);return IFt(HFt,n).isInside?null:t.jsx(wxt,{...a,...o,ref:r})});WFt.displayName=HFt;var UFt=LFt;const YFt=OFt,ZFt=EFt,KFt=zFt,GFt=s.forwardRef(({className:e,sideOffset:r=4,...n},o)=>t.jsx(UFt,{ref:o,sideOffset:r,className:zdt("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));GFt.displayName=UFt.displayName;const XFt=({isListView:e,setIsListView:r,currentConfig:n})=>t.jsx(YFt,{children:t.jsxs(ZFt,{children:[t.jsx(KFt,{asChild:!0,children:t.jsx($ht,{variant:"outline",size:"sm",onClick:()=>r(!e),className:"flex items-center space-x-1 w-10 h-10 justify-center overflow-hidden",children:t.jsx(fbt,{mode:"wait",children:t.jsx(rOt.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:e?t.jsx($st,{className:"h-4 w-4"}):t.jsx(nlt,{className:"h-4 w-4"})},e?"list":"calendar")})})}),t.jsx(GFt,{children:t.jsx("p",{children:e?n.localization.displayCalendar:n.localization.displayList})})]})}),QFt=({is24HourFormat:e,isTimeFormatChanging:r,toggleTimeFormat:n})=>t.jsx($ht,{variant:"outline",size:"sm",onClick:n,disabled:r,className:"flex items-center space-x-1 w-20 justify-center overflow-hidden",children:t.jsx(fbt,{mode:"wait",children:t.jsxs(rOt.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:[t.jsx(Qst,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"text-xs font-medium",children:e?"24h":"12h"})]},e?"24h":"12h")})}),JFt=({handleTodayClick:e,isTodayDisabled:r,getTodayButtonText:n})=>t.jsx($ht,{variant:"outline",size:"sm",onClick:e,disabled:r,className:"flex items-center space-x-1 w-28 h-10 justify-center overflow-hidden",children:t.jsx(fbt,{mode:"wait",children:t.jsxs(rOt.div,{className:"flex items-center space-x-1",initial:{opacity:0},animate:{opacity:[0,1.05,1]},transition:{duration:.2,times:[0,.8,1]},children:[t.jsx($st,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{children:n()})]},n())})}),eLt=({currentView:e,setCurrentView:r,viewOptions:n,currentConfig:o})=>t.jsx("div",{className:"inline-flex items-center rounded-md border border-input bg-transparent p-1 w-full sm:w-[240px]",children:t.jsx(YFt,{children:n.map(n=>{const a=n.icon,i=e===n.value;return t.jsxs(ZFt,{children:[t.jsx(KFt,{asChild:!0,children:t.jsx(rOt.div,{className:"relative flex-grow",initial:!1,animate:{flex:i?2:1},transition:{duration:.2},children:t.jsx($ht,{variant:i?"secondary":"ghost",size:"sm",className:zdt("relative h-8 w-full overflow-hidden transition-colors",i?"bg-secondary text-secondary-foreground":"hover:bg-secondary/50 hover:text-secondary-foreground",!i&&"cursor-pointer"),onClick:()=>r(n.value),children:t.jsxs("div",{className:"flex items-center justify-center space-x-1 w-full",children:[t.jsx(a,{className:zdt("h-4 w-4 flex-shrink-0",i?"text-primary":"text-muted-foreground")}),t.jsx(fbt,{children:i&&t.jsx(rOt.span,{className:"text-xs font-medium whitespace-nowrap overflow-hidden",initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.2},children:n.label})})]})})})}),t.jsx(GFt,{children:t.jsx("p",{children:`${o.localization.viewBy} ${n.label}`})})]},n.value)})})}),tLt=({currentDate:r,currentView:n,handlePrevious:o,handleNext:a,handleTodayClick:i,toggleTimeFormat:s,setCurrentView:l,isTimeFormatChanging:c,use24HourFormat:u,lastUpdated:d,animationDirection:p,months:h,handleDayChange:f,handleMonthChange:m,handleYearChange:v,currentConfig:y,onEventAdd:g,onEventDelete:x,isListView:b,setIsListView:k,selectedColors:_,setSelectedColors:w})=>{const[M,C]=e.useState(!1);(({handleNext:t,handlePrevious:r})=>{const[n,o]=e.useState(0),[a,i]=e.useState(!1);e.useEffect(()=>{const e=e=>{if("ArrowLeft"===e.key||"ArrowRight"===e.key){e.preventDefault();const s=Date.now();!a&&s-n>200&&(i(!0),o(s),"ArrowLeft"===e.key?r():t())}},s=e=>{("ArrowLeft"===e.key||"ArrowRight"===e.key)&&i(!1)};return window.addEventListener("keydown",e),window.addEventListener("keyup",s),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",s)}},[t,r,a,n])})({handleNext:a,handlePrevious:o});const j=[{value:"day",label:y.localization.day,icon:olt},{value:"week",label:y.localization.week,icon:Jst},{value:"month",label:y.localization.month,icon:tlt},{value:"year",label:y.localization.year,icon:rlt}];return t.jsxs("div",{className:"flex flex-col lg:flex-row justify-between items-center mb-4 space-y-4 sm:space-y-0",children:[t.jsx(xFt,{currentDate:r,currentView:n,handlePrevious:o,handleNext:a,lastUpdated:d,animationDirection:p,months:h,handleDayChange:f,handleMonthChange:m,handleYearChange:v,currentConfig:y}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 w-full sm:w-auto",children:[t.jsx(QFt,{is24HourFormat:u,isTimeFormatChanging:c,toggleTimeFormat:s}),t.jsx(Izt,{isFilterOpen:M,setIsFilterOpen:C,selectedColors:_,toggleColorSelection:e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},currentConfig:y}),t.jsx(JFt,{handleTodayClick:i,isTodayDisabled:(()=>{const e=new Date;switch(n){case"day":return hit(r,e);case"week":return hit(nit(r,{weekStartsOn:u?1:0}),nit(e,{weekStartsOn:u?1:0}));case"month":return hst(r,e);case"year":return r.getFullYear()===e.getFullYear();default:return!1}})(),getTodayButtonText:()=>{switch(n){case"day":default:return y.localization.today;case"week":return y.localization.thisWeek;case"month":return y.localization.thisMonth;case"year":return y.localization.thisYear}}}),t.jsx(XFt,{isListView:b,setIsListView:k,currentConfig:y}),t.jsx(eLt,{currentView:n,setCurrentView:l,viewOptions:j,currentConfig:y}),t.jsx(PEt,{translations:y.localization,event:(()=>{switch(n){case"day":default:return{startDate:r,endDate:r};case"week":return{startDate:nit(r,{weekStartsOn:u?1:0}),endDate:Mit(r,{weekStartsOn:u?1:0})}}})(),onAddEvent:g,onDeleteEvent:x})]})]})},rLt=({currentView:t,currentDate:r,onDateRangeChange:n,is24HourFormat:o})=>{const a=e.useRef(r),i=e.useRef(t),s=e.useCallback(()=>{let e,n;switch(t){case"day":default:e=iit(r),n=git(r);break;case"week":e=nit(r,{weekStartsOn:o?1:0}),n=Mit(r,{weekStartsOn:o?1:0});break;case"month":e=kit(r),n=xit(r);break;case"year":e=wit(r),n=_it(r)}return{startDate:e,endDate:n}},[t,r,o]),l=e.useCallback(()=>{if(t!==i.current)return!0;const e=a.current;switch(t){case"day":return!hit(r,e);case"week":return!function(e,t,r){return+nit(e,r)==+nit(t,r)}(r,e,{weekStartsOn:o?1:0});case"month":return!hst(r,e);case"year":return!fst(r,e);default:return!0}},[t,r,o]);e.useEffect(()=>{(async()=>{if(n&&l()){const{startDate:e,endDate:o}=s();await n(e,o),a.current=r,i.current=t}})()},[t,r,n,s,l])},nLt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:zdt("rounded-lg border bg-card text-card-foreground shadow-sm",e),...r}));nLt.displayName="Card";const oLt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:zdt("flex flex-col space-y-1.5 p-6",e),...r}));oLt.displayName="CardHeader";const aLt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:zdt("text-2xl font-semibold leading-none tracking-tight",e),...r}));aLt.displayName="CardTitle";const iLt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:zdt("text-sm text-muted-foreground",e),...r}));iLt.displayName="CardDescription";const sLt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:zdt("p-6 pt-0",e),...r}));sLt.displayName="CardContent";const lLt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:zdt("flex items-center p-6 pt-0",e),...r}));lLt.displayName="CardFooter";var cLt="ScrollArea",[uLt,dLt]=flt(cLt),[pLt,hLt]=uLt(cLt),fLt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,type:o="hover",dir:a,scrollHideDelay:i=600,...l}=e,[c,u]=s.useState(null),[d,p]=s.useState(null),[h,f]=s.useState(null),[m,v]=s.useState(null),[y,g]=s.useState(null),[x,b]=s.useState(0),[k,_]=s.useState(0),[w,M]=s.useState(!1),[C,j]=s.useState(!1),D=hlt(r,e=>u(e)),O=tvt(a);return t.jsx(pLt,{scope:n,type:o,dir:O,scrollHideDelay:i,scrollArea:c,viewport:d,onViewportChange:p,content:h,onContentChange:f,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:w,onScrollbarXEnabledChange:M,scrollbarY:y,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:j,onCornerWidthChange:b,onCornerHeightChange:_,children:t.jsx(Olt.div,{dir:O,...l,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});fLt.displayName=cLt;var mLt="ScrollAreaViewport",vLt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,children:o,nonce:a,...i}=e,l=hLt(mLt,n),c=hlt(r,s.useRef(null),l.onViewportChange);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),t.jsx(Olt.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:t.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});vLt.displayName=mLt;var yLt="ScrollAreaScrollbar",gLt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=hLt(yLt,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=a,c="horizontal"===e.orientation;return s.useEffect(()=>(c?i(!0):l(!0),()=>{c?i(!1):l(!1)}),[c,i,l]),"hover"===a.type?t.jsx(xLt,{...o,ref:r,forceMount:n}):"scroll"===a.type?t.jsx(bLt,{...o,ref:r,forceMount:n}):"auto"===a.type?t.jsx(kLt,{...o,ref:r,forceMount:n}):"always"===a.type?t.jsx(_Lt,{...o,ref:r}):null});gLt.displayName=yLt;var xLt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=hLt(yLt,e.__scopeScrollArea),[i,l]=s.useState(!1);return s.useEffect(()=>{const e=a.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),l(!0)},n=()=>{t=window.setTimeout(()=>l(!1),a.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[a.scrollArea,a.scrollHideDelay]),t.jsx(Xlt,{present:n||i,children:t.jsx(kLt,{"data-state":i?"visible":"hidden",...o,ref:r})})}),bLt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=hLt(yLt,e.__scopeScrollArea),i="horizontal"===e.orientation,l=ILt(()=>u("SCROLL_END"),100),[c,u]=function(e,t){return s.useReducer((e,r)=>t[e][r]??e,e)}("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if("idle"===c){const e=window.setTimeout(()=>u("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,a.scrollHideDelay,u]),s.useEffect(()=>{const e=a.viewport,t=i?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(u("SCROLL"),l()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[a.viewport,i,u,l]),t.jsx(Xlt,{present:n||"hidden"!==c,children:t.jsx(_Lt,{"data-state":"hidden"===c?"hidden":"visible",...o,ref:r,onPointerEnter:ult(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:ult(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),kLt=s.forwardRef((e,r)=>{const n=hLt(yLt,e.__scopeScrollArea),{forceMount:o,...a}=e,[i,l]=s.useState(!1),c="horizontal"===e.orientation,u=ILt(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;l(c?e:t)}},10);return qLt(n.viewport,u),qLt(n.content,u),t.jsx(Xlt,{present:o||i,children:t.jsx(_Lt,{"data-state":i?"visible":"hidden",...a,ref:r})})}),_Lt=s.forwardRef((e,r)=>{const{orientation:n="vertical",...o}=e,a=hLt(yLt,e.__scopeScrollArea),i=s.useRef(null),l=s.useRef(0),[c,u]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=ALt(c.viewport,c.content),p={...o,sizes:c,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:e=>i.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function h(e,t){return function(e,t,r,n="ltr"){const o=RLt(r),a=o/2,i=t||a,s=o-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-s,u=r.content-r.viewport,d="ltr"===n?[0,u]:[-1*u,0];return LLt([l,c],d)(e)}(e,l.current,c,t)}return"horizontal"===n?t.jsx(wLt,{...p,ref:r,onThumbPositionChange:()=>{if(a.viewport&&i.current){const e=FLt(a.viewport.scrollLeft,c,a.dir);i.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=h(e,a.dir))}}):"vertical"===n?t.jsx(MLt,{...p,ref:r,onThumbPositionChange:()=>{if(a.viewport&&i.current){const e=FLt(a.viewport.scrollTop,c);i.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=h(e))}}):null}),wLt=s.forwardRef((e,r)=>{const{sizes:n,onSizesChange:o,...a}=e,i=hLt(yLt,e.__scopeScrollArea),[l,c]=s.useState(),u=s.useRef(null),d=hlt(r,u,i.onScrollbarXChange);return s.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),t.jsx(DLt,{"data-orientation":"horizontal",...a,ref:d,sizes:n,style:{bottom:0,left:"rtl"===i.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===i.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":RLt(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(i.viewport){const n=i.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),BLt(n,r)&&t.preventDefault()}},onResize:()=>{u.current&&i.viewport&&l&&o({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:zLt(l.paddingLeft),paddingEnd:zLt(l.paddingRight)}})}})}),MLt=s.forwardRef((e,r)=>{const{sizes:n,onSizesChange:o,...a}=e,i=hLt(yLt,e.__scopeScrollArea),[l,c]=s.useState(),u=s.useRef(null),d=hlt(r,u,i.onScrollbarYChange);return s.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),t.jsx(DLt,{"data-orientation":"vertical",...a,ref:d,sizes:n,style:{top:0,right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":RLt(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(i.viewport){const n=i.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),BLt(n,r)&&t.preventDefault()}},onResize:()=>{u.current&&i.viewport&&l&&o({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:zLt(l.paddingTop),paddingEnd:zLt(l.paddingBottom)}})}})}),[CLt,jLt]=uLt(yLt),DLt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:a,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:h,...f}=e,m=hLt(yLt,n),[v,y]=s.useState(null),g=hlt(r,e=>y(e)),x=s.useRef(null),b=s.useRef(""),k=m.viewport,_=o.content-o.viewport,w=Plt(p),M=Plt(u),C=ILt(h,10);function j(e){if(x.current){const t=e.clientX-x.current.left,r=e.clientY-x.current.top;d({x:t,y:r})}}return s.useEffect(()=>{const e=e=>{const t=e.target;(null==v?void 0:v.contains(t))&&w(e,_)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[k,v,_,w]),s.useEffect(M,[o,M]),qLt(v,C),qLt(m.content,C),t.jsx(CLt,{scope:n,scrollbar:v,hasThumb:a,onThumbChange:Plt(i),onThumbPointerUp:Plt(l),onThumbPositionChange:M,onThumbPointerDown:Plt(c),children:t.jsx(Olt.div,{...f,ref:g,style:{position:"absolute",...f.style},onPointerDown:ult(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),x.current=v.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),j(e))}),onPointerMove:ult(e.onPointerMove,j),onPointerUp:ult(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=b.current,m.viewport&&(m.viewport.style.scrollBehavior=""),x.current=null})})})}),OLt="ScrollAreaThumb",SLt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=jLt(OLt,e.__scopeScrollArea);return t.jsx(Xlt,{present:n||a.hasThumb,children:t.jsx(PLt,{ref:r,...o})})}),PLt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,style:o,...a}=e,i=hLt(OLt,n),l=jLt(OLt,n),{onThumbPositionChange:c}=l,u=hlt(r,e=>l.onThumbChange(e)),d=s.useRef(void 0),p=ILt(()=>{d.current&&(d.current(),d.current=void 0)},100);return s.useEffect(()=>{const e=i.viewport;if(e){const t=()=>{if(p(),!d.current){const t=VLt(e,c);d.current=t,c()}};return c(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[i.viewport,p,c]),t.jsx(Olt.div,{"data-state":l.hasThumb?"visible":"hidden",...a,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:ult(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;l.onThumbPointerDown({x:r,y:n})}),onPointerUp:ult(e.onPointerUp,l.onThumbPointerUp)})});SLt.displayName=OLt;var TLt="ScrollAreaCorner",ELt=s.forwardRef((e,r)=>{const n=hLt(TLt,e.__scopeScrollArea),o=!(!n.scrollbarX||!n.scrollbarY);return"scroll"!==n.type&&o?t.jsx(NLt,{...e,ref:r}):null});ELt.displayName=TLt;var NLt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,...o}=e,a=hLt(TLt,n),[i,l]=s.useState(0),[c,u]=s.useState(0),d=!(!i||!c);return qLt(a.scrollbarX,()=>{var e;const t=(null==(e=a.scrollbarX)?void 0:e.offsetHeight)||0;a.onCornerHeightChange(t),u(t)}),qLt(a.scrollbarY,()=>{var e;const t=(null==(e=a.scrollbarY)?void 0:e.offsetWidth)||0;a.onCornerWidthChange(t),l(t)}),d?t.jsx(Olt.div,{...o,ref:r,style:{width:i,height:c,position:"absolute",right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:0,...e.style}}):null});function zLt(e){return e?parseInt(e,10):0}function ALt(e,t){const r=e/t;return isNaN(r)?0:r}function RLt(e){const t=ALt(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function FLt(e,t,r="ltr"){const n=RLt(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,i=t.content-t.viewport,s=a-n,l=dSt(e,"ltr"===r?[0,i]:[-1*i,0]);return LLt([0,i],[0,s])(l)}function LLt(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function BLt(e,t){return e>0&&e<t}var VLt=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const a={left:e.scrollLeft,top:e.scrollTop},i=r.left!==a.left,s=r.top!==a.top;(i||s)&&t(),r=a,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function ILt(e,t){const r=Plt(e),n=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(n.current),[]),s.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function qLt(e,t){const r=Plt(t);vlt(()=>{let t=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}var $Lt=fLt,HLt=vLt,WLt=ELt;const ULt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs($Lt,{ref:o,className:zdt("relative overflow-hidden",e),...n,children:[t.jsx(HLt,{className:"h-full w-full rounded-[inherit]",children:r}),t.jsx(YLt,{}),t.jsx(WLt,{})]}));ULt.displayName=$Lt.displayName;const YLt=s.forwardRef(({className:e,orientation:r="vertical",...n},o)=>t.jsx(gLt,{ref:o,orientation:r,className:zdt("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:t.jsx(SLt,{className:"relative flex-1 rounded-full bg-border"})}));YLt.displayName=gLt.displayName;const ZLt=(e,t)=>{const[r,n]=e.split(":").map(Number),o=Dst(Ost(new Date,n),r);return t?sst(o,"HH:mm"):sst(o,"h:mm").toLowerCase()+sst(o,"a").toLowerCase()},KLt=(e,t,r)=>r?sst(Dst(e,t),"HH:mm"):sst(Dst(e,t),"h a").toLowerCase(),GLt=e=>{const t=Bat.find(t=>t.value===e);return t?t.class:Bat[0].class},XLt=({className:e,style:r})=>t.jsx(rOt.div,{className:zdt("bg-gray-50 dark:bg-transparent rounded-md overflow-hidden relative",e),style:r,initial:{opacity:.4},animate:{opacity:[.4,.5,.4]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},children:t.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-gray-200 dark:via-muted-foreground to-transparent skeleton-shimmer"})}),QLt=({filteredEvents:e,currentDate:r,hoverLineRef:n,hoverTimeRef:o,setClickedTime:a,currentConfig:i,isAddEventPopupOpen:s,onEventAdd:l,onEventUpdate:c,onEventDelete:u,is24HourFormat:d,clickedTime:p,currentTimeLineRef:h,currentTimeTop:f,isLoading:m,setIsAddEventPopupOpen:v,onDateRangeChange:y})=>{var g,x;const b=e.filter(e=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,r)))&&IPt(r,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?mst(r,{start:iit(e.startDate),end:git(e.endDate)}):hit(e.startDate,r)),k=Array.from({length:24},(e,t)=>t),_=(e,t)=>{if(e.isRepeating){const r=`${ZLt(e.startTime,d)} - ${ZLt(e.endTime,d)}`,n=sst(e.startDate,"MMM d"),o=sst(e.endDate||e.startDate,"MMM d"),a=sst(t,"EEEE"),s=sst(t,"do");switch(e.isRepeatingInterval||"daily"){case"daily":default:return i.localization.repeatDailyDescription.replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o);case"weekly":return i.localization.repeatWeeklyDescription.replace("{dayName}",a).replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o);case"monthly":return i.localization.repeatMonthlyDescription.replace("{dayOfMonth}",s).replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o)}}else if(e.endDate&&!hit(e.startDate,e.endDate)){const r=Math.floor(vit(git(e.endDate),iit(e.startDate)))+1,n=Math.floor(vit(iit(t),iit(e.startDate)))+1;return i.localization.dayXofY.replace("{x}",n.toString()).replace("{y}",r.toString())}return null},w=b.reduce((e,t)=>{const n="00:00"===t.startTime&&"23:59"===t.endTime,o=t.endDate&&!hit(t.startDate,t.endDate);return t.isRepeating?n?e.repeatingFullDayEvents.push(t):e.regularEvents.push(t):o?hit(t.startDate,r)?e.multiDayEvents.push({...t,isStart:!0}):hit(t.endDate,r)?e.multiDayEvents.push({...t,isEnd:!0}):e.multiDayEvents.push({...t,isMiddle:!0}):n?e.fullDayEvents.push(t):e.regularEvents.push(t),e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}),M=[...w.repeatingFullDayEvents,...w.multiDayEvents,...w.fullDayEvents],C=w.regularEvents,{sortedEvents:j,eventPositions:D,maxColumn:O}=(e=>{const t=e.sort((e,t)=>{const n=yst(`${sst(r,"yyyy-MM-dd")}T${e.startTime}`),o=yst(`${sst(r,"yyyy-MM-dd")}T${t.startTime}`);return n.getTime()-o.getTime()}),n={};let o=0;const a=(e,t)=>{const n=yst(`${sst(r,"yyyy-MM-dd")}T${e.startTime}`),o=yst(`${sst(r,"yyyy-MM-dd")}T${e.endTime}`),a=yst(`${sst(r,"yyyy-MM-dd")}T${t.startTime}`);return n<yst(`${sst(r,"yyyy-MM-dd")}T${t.endTime}`)&&a<o};return t.forEach((e,r)=>{let i=0,s=!1;for(let o=0;o<r;o++)a(e,t[o])&&(i=Math.max(i,n[t[o].id].column+1),s=!0);n[e.id]={column:i,span:1},s&&(o=Math.max(o,i))}),0===o?(t.forEach(e=>{n[e.id]={column:0,span:1}}),{sortedEvents:t,eventPositions:n,maxColumn:1}):(t.forEach(e=>{if(n[e.id].column<o){let r=1;for(;r+n[e.id].column<=o&&!t.some(t=>n[t.id].column===n[e.id].column+r&&a(e,t));)r++;n[e.id].span=r}}),{sortedEvents:t,eventPositions:n,maxColumn:o+1})})(C),S=({event:e,currentDate:r})=>t.jsx(PEt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:r,translations:i.localization,children:t.jsxs("div",{className:zdt(GLt(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}})(),"min-h-[44px]"),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsxs("div",{className:"text-xs font-medium",children:[ZLt(e.startTime,d)," - ",ZLt(e.endTime,d)]})]}),t.jsx("div",{className:"text-xs italic",children:_(e,r||new Date)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),P=({event:e,currentDate:r})=>t.jsx(PEt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:r,translations:i.localization,children:t.jsxs("div",{className:zdt(GLt(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[44px]",e.isStart&&["border-l-4","border-l-black/70 dark:border-l-white/50"],e.isEnd&&["border-r-4","border-r-black/70 dark:border-r-white/50"],e.isMiddle&&"border-x-0"),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsx("div",{className:"text-xs font-medium",children:e.isStart?`${i.localization.starts}: ${ZLt(e.startTime,d)}`:e.isEnd?`${i.localization.ends}: ${ZLt(e.endTime,d)}`:i.localization.allDay})]}),t.jsx("div",{className:"text-xs italic",children:_(e,r||new Date)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),T=({event:e})=>t.jsx(PEt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:r,translations:i.localization,children:t.jsxs("div",{className:zdt(GLt(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[44px]","border-l-4 border-r-4","border-black/70 dark:border-white/50"),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsx("div",{className:"text-xs font-medium",children:i.localization.allDay})]}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),E=({event:e,currentDate:r,index:n})=>e.isRepeating?t.jsx(S,{event:e,currentDate:r,index:n}):e.endDate&&!hit(e.startDate,e.endDate)?t.jsx(P,{event:e,currentDate:r,index:n}):t.jsx(T,{event:e,index:n});return t.jsxs(nLt,{className:"pb-4 pl-4 pr-4",children:[t.jsxs("div",{className:"sticky top-0 bg-background z-20 pt-4 pb-1",children:[t.jsx("h2",{className:"text-xl font-bold mb-4",children:`${i.localization.monthNames[r.getMonth()]} ${r.getDate()}, ${r.getFullYear()}`}),M.length>0&&t.jsxs("div",{className:"mb-4",children:[t.jsxs("h3",{className:"text-sm font-semibold mb-2",children:[i.localization.fullDayEvents," (",M.length,")"]}),M.map((e,n)=>t.jsx(rOt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.05*n},className:"space-y-2 mb-1",children:t.jsx(E,{event:e,currentDate:r,index:n},e.id)},e.id))]})]}),t.jsx(ULt,{className:"px-4 h-[570px]",children:t.jsxs("div",{className:"relative mt-2 mb-2",children:[t.jsx("div",{className:"absolute left-0 w-16 z-10 bg-background",children:t.jsx(PEt,{translations:i.localization,onAddEvent:l,event:{startDate:r,endDate:r,startTime:p||sst(new Date,"HH:mm"),endTime:p?eit(yst(`2000-01-01T${p}`),1).toTimeString().slice(0,5):sst(eit(new Date,1),"HH:mm")},children:t.jsx("div",{onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top;let a,i,s;if(e.ctrlKey){const e=15*Math.round(r/64*60/15);a=Math.floor(e/60),i=e%60,s=e/60*64}else a=Math.floor(r/64),i=Math.floor(r%64/64*60),s=r;const l=`${a.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`;n.current&&(n.current.style.top=`${s}px`,n.current.style.display="block"),o.current&&(o.current.textContent=l)},onMouseLeave:()=>{n.current&&(n.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=Math.floor(r/64),o=Math.floor(r%64/64*60),i=`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`;a(i)},children:k.map(e=>t.jsx("div",{className:"cursor-pointer h-16 pr-2 text-right text-sm text-muted-foreground",children:KLt(r,e,d)},`hour-${e}`))})})}),t.jsxs("div",{className:"ml-16 relative",onDoubleClick:e=>{if(s||!i.dayView.enableDoubleClickToAddEvent)return;const t=e.currentTarget.getBoundingClientRect(),n=e.clientY-t.top,o=Math.floor(n/(16/15)),a=Math.floor(o/60),c=o%60,u=`${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`,d=`${(a+1).toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;l({title:"",startDate:r,endDate:r,startTime:u,endTime:d,color:"blue",isRepeating:!1})},children:[k.map(e=>t.jsx("div",{className:"h-16 border-t border-border"},e)),!(null!=(g=i.dayView)&&g.hideHoverLine)&&t.jsx("div",{ref:n,className:"absolute left-0 right-0 h-px bg-primary z-40 pointer-events-none",style:{display:"none"},children:t.jsx("span",{ref:o,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})}),hit(r,new Date)&&!(null!=(x=i.dayView)&&x.hideTimeline)&&t.jsx("div",{ref:h,className:"absolute left-0 right-0 h-px bg-red-500 z-30 pointer-events-none",style:{top:`${f}px`},children:t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:sst(new Date,"HH:mm")})}),m&&y&&Array.from({length:10}).map((e,r)=>t.jsx(XLt,{className:"absolute top-0 left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r)),j.map((e,n)=>{const o=yst(`${sst(r,"yyyy-MM-dd")}T${e.startTime}`),a=yst(`${sst(r,"yyyy-MM-dd")}T${e.endTime}`),s=60*o.getHours()+o.getMinutes(),p=60*a.getHours()+a.getMinutes()-s,{column:h,span:f}=D[e.id],m=f/O*100,y=h/O*100,g=_(e,r);return t.jsx(PEt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,onOpenChange:v,dateFromViewClick:r,translations:i.localization,children:t.jsxs(rOt.div,{className:zdt(GLt(e.color),"absolute px-2 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{if(!e.isRepeating)return"";switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}})()),style:{top:s*(16/15)+"px",height:`${Math.max(p*(16/15),24)}px`,left:`${y}%`,width:`${m}%`,zIndex:n+1},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*n},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||i.localization.untitledEvent}),t.jsxs("div",{className:"text-xs",children:[ZLt(e.startTime,d)," - ",ZLt(e.endTime,d)]}),e.description&&t.jsx("div",{className:"text-xs font-semibold truncate",children:e.description}),g&&t.jsx("div",{className:"text-xs italic",children:g})]})},`${e.id}-${e.startTime}`)})]})]})})]})},JLt=({events:r,date:n,addEvent:o,updateEvent:a,getEventColor:i,onDelete:s,children:l,onOpenChange:c,preSelectedColor:u,is24HourFormat:d,translations:p})=>{const[h,f]=e.useState(null),[m,v]=e.useState(!1),y=e=>{h&&(a(e),f(null))},g=e=>{const t=e.endDate&&!hit(e.startDate,e.endDate),r=hit(e.startDate,n),o=e.endDate&&hit(e.endDate,n),a=t&&!r&&!o,s=e.isRepeating?zdt("border-2 dark:border border-dashed border-opacity-50",r&&"border-l-solid border-l-2 border-l-black/90 dark:border-l-white/50",o&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",a&&"border-x-0"):zdt(r&&"border-l-4 border-l-black/70 dark:border-l-white/50",o&&"border-r-4 border-r-black/70 dark:border-r-white/50",a&&"border-x-0");return zdt(i(e.color),"p-2 rounded cursor-pointer hover:opacity-80 transition-opacity w-full text-left","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",s)},x=e=>{const t=hit(e.startDate,n),r=e.endDate&&hit(e.endDate,n);return!t||e.endDate&&!hit(e.startDate,e.endDate)?t?`Starts ${ZLt(e.startTime,d)}`:r?e.isRepeating?`Ends today (${ZLt(e.startTime,d)} - ${ZLt(e.endTime,d)})`:`Ends ${ZLt(e.endTime,d)}`:e.isRepeating?`${ZLt(e.startTime,d)} - ${ZLt(e.endTime,d)}`:"All day":`${ZLt(e.startTime,d)} - ${ZLt(e.endTime,d)}`};return t.jsxs(Adt,{open:m,onOpenChange:v,children:[t.jsx(Rdt,{asChild:!0,children:l}),t.jsxs(Bdt,{className:"sm:max-w-[425px]",children:[t.jsx(Vdt,{children:t.jsx(qdt,{children:sst(n,"MMMM d, yyyy")})}),t.jsx(ULt,{className:"h-[300px] mt-4",children:t.jsx("div",{className:"space-y-2 pr-4 flex flex-col items-center pl-6",children:r.sort((e,t)=>new Date(`${sst(n,"yyyy-MM-dd")}T${e.startTime}`).getTime()-new Date(`${sst(n,"yyyy-MM-dd")}T${t.startTime}`).getTime()).map(e=>t.jsx(PEt,{event:e,onAddEvent:o,onUpdateEvent:y,onDeleteEvent:s,onOpenChange:c,dateFromViewClick:n,translations:p,children:t.jsxs("div",{className:g(e),onClick:()=>(e=>{f(e),v(!0)})(e),children:[e.title&&t.jsx("div",{className:"font-semibold truncate",children:e.title}),t.jsx("div",{className:"text-xs",children:x(e)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id))})}),t.jsxs("div",{className:"mt-4 flex justify-between items-center",children:[t.jsx(PEt,{translations:p,event:{startDate:n,endDate:n,color:u},onAddEvent:o,dateFromViewClick:n,children:t.jsxs($ht,{variant:"outline",className:"flex-grow mr-2",children:[t.jsx(Gst,{className:"mr-2 h-4 w-4"}),p.addEvent]})}),t.jsx($ht,{variant:"outline",onClick:()=>{f(null),v(!1)},children:"Close"})]})]})]})},eBt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,onEventAdd:a,onEventUpdate:i,onEventDelete:s,isLoading:l,hoverLineRef:c,hoverTimeRef:u,clickedTime:d,setClickedTime:p,currentTimeLineRef:h,currentTimeTop:f,isAddEventPopupOpen:m,setIsAddEventPopupOpen:v,onDateRangeChange:y})=>{var g,x;const b=Array.from(new Set(e.map(e=>e.color))).sort((e,t)=>{const r=Bat.findIndex(t=>t.value===e),n=Bat.findIndex(e=>e.value===t);return r-n}),k=e.filter(e=>{const t=iit(e.startDate),n=iit(r);return e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,n)))&&IPt(n,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?mst(n,{start:t,end:git(e.endDate)}):hit(t,n)}),_=Array.from({length:24},(e,t)=>({hour:t,label:KLt(r,t,o)})),w=e=>{if(!e.isRepeating)return zdt(e.isStart&&"border-l-4 border-l-black/70 dark:border-l-white/50",e.isEnd&&"border-r-4 border-r-black/70 dark:border-r-white/50",e.isMiddle&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}},M=e=>{if(!e.isRepeating)return zdt(e.isStart&&"border-l-4 border-l-black/70 dark:border-l-white/50",e.isEnd&&"border-r-4 border-r-black/70 dark:border-r-white/50",e.isMiddle&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}};return t.jsx(nLt,{className:"",children:t.jsxs(ULt,{className:"h-[600px]",children:[t.jsxs("div",{className:"flex pl-2 pr-2",children:[t.jsxs("div",{className:"sticky left-0 z-30 w-16 bg-background border-r border-border h-full",children:[t.jsx("div",{className:"sticky top-0 z-[200] bg-background h-12 border-b border-border"}),t.jsx("div",{className:"sticky top-12 z-[200] bg-background h-[3.1rem] flex items-center justify-end pr-4 text-sm text-muted-foreground border-b border-border",children:n.localization.allDay}),t.jsx(PEt,{onAddEvent:a,onDeleteEvent:s,event:{startDate:r,endDate:r,startTime:d||sst(new Date,"HH:mm"),endTime:sst(eit(d?yst(`2000-01-01T${d}`):new Date,1),"HH:mm"),color:null!=b&&b.length?b[0]:void 0},translations:n.localization,children:t.jsx("div",{onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=r+96;let o,a,i;if(e.ctrlKey){const e=15*Math.round(r/64*60/15);o=Math.floor(e/60),a=e%60,i=e/60*64+96}else o=Math.floor(r/64),a=Math.floor(r%64/64*60),i=n;o=Math.max(0,Math.min(23,o)),a=Math.max(0,Math.min(59,a));const s=`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`;c.current&&(c.current.style.top=`${i}px`,c.current.style.display="block"),u.current&&(u.current.textContent=s)},onMouseLeave:()=>{c.current&&(c.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=Math.floor(r/64),o=Math.floor(r%64/64*60),a=`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`;p(a)},children:_.map(({hour:e,label:r})=>t.jsx("div",{className:"h-16 flex items-center justify-end pr-4 text-sm text-muted-foreground cursor-pointer",children:t.jsx("span",{className:"mt-[-46px]",children:r})},e))})})]}),t.jsx("div",{className:"flex-1 relative",children:t.jsxs("div",{className:"grid pb-4",style:{gridTemplateColumns:`repeat(${b.length}, 1fr)`},children:[!(null!=(g=n.dayView)&&g.hideHoverLine)&&t.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{zIndex:150},children:t.jsx("div",{ref:c,className:"absolute left-0 right-0 h-px bg-primary",style:{display:"none"},children:t.jsx("span",{ref:u,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})})}),hit(r,new Date)&&!(null!=(x=n.dayView)&&x.hideTimeline)&&t.jsx("div",{ref:h,className:"absolute left-0 right-0 h-px bg-red-500 pointer-events-none",style:{top:`${f}px`,zIndex:30},children:t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:sst(new Date,"HH:mm")})}),b.map(e=>{const c=Bat.find(t=>t.value===e),u=k.filter(t=>t.color===e),{allDayEvents:d,regularEvents:p}=(e=>e.reduce((e,t)=>{const n="00:00"===t.startTime&&"23:59"===t.endTime,o=t.endDate&&!hit(t.startDate,t.endDate);return n?o?hit(t.startDate,r)?e.allDayEvents.push({...t,isStart:!0}):hit(t.endDate,r)?e.allDayEvents.push({...t,isEnd:!0}):e.allDayEvents.push({...t,isMiddle:!0}):e.allDayEvents.push(t):e.regularEvents.push(t),e},{allDayEvents:[],regularEvents:[]}))(u),{events:h,totalColumns:f}=(e=>{const t=e.map(e=>{const t="00:00"===e.startTime&&"23:59"===e.endTime,n=t?0:60*parseInt(e.startTime.split(":")[0])+parseInt(e.startTime.split(":")[1]),o=t?1440:60*parseInt(e.endTime.split(":")[0])+parseInt(e.endTime.split(":")[1]),a=e.endDate&&!hit(e.startDate,e.endDate),i=a&&hit(e.startDate,r),s=a&&hit(e.endDate,r);return{...e,isAllDay:t,startMinutes:n,endMinutes:o,column:0,width:1,isStart:i,isEnd:s,isMiddle:a&&!i&&!s}}).sort((e,t)=>e.isAllDay&&!t.isAllDay?-1:!e.isAllDay&&t.isAllDay?1:e.startMinutes-t.startMinutes),n=[];return t.forEach(e=>{let r=0;for(;;){if(!t.some(t=>t.column===r&&e!==t&&!(e.startMinutes>=t.endMinutes||e.endMinutes<=t.startMinutes))){e.column=r,n[r]=(n[r]||0)+1;break}r++}}),t.forEach(e=>{let r=1,o=e.column+1;for(;o<n.length&&!t.some(t=>t.column===o&&!(e.startMinutes>=t.endMinutes||e.endMinutes<=t.startMinutes));)r++,o++;e.width=r}),{events:t,totalColumns:Math.max(...n.map((e,t)=>t+1),1)}})(p),g=(e,t)=>{const r="00:00"===e.startTime&&"23:59"===e.endTime;if(e.isRepeating&&!r){const r=iit(e.startDate),o=iit(e.endDate||e.startDate);let a,i;switch(e.isRepeatingInterval||"daily"){case"weekly":a=Math.floor(vit(o,r)/7)+1,i=Math.floor(vit(t,r)/7)+1;break;case"monthly":a=12*(o.getFullYear()-r.getFullYear())+o.getMonth()-r.getMonth()+1,i=12*(t.getFullYear()-r.getFullYear())+t.getMonth()-r.getMonth()+1;break;default:a=vit(o,r)+1,i=vit(t,r)+1}return n.localization.repeatXofY.replace("{x}",i.toString()).replace("{y}",a.toString())}};return t.jsxs("div",{className:"relative border-r border-border flex-1",children:[t.jsx("div",{className:"sticky top-0 z-50 bg-background h-12 flex items-center justify-center border-b border-border",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:zdt("w-3 h-3 rounded-full flex-shrink-0 hidden sm:block text-center",null==c?void 0:c.class)}),t.jsx("div",{className:"max-w-[150px] sm:max-w-[200px]",children:t.jsxs("span",{className:"relative font-medium text-sm sm:text-base group",children:[t.jsxs("span",{className:"block truncate",children:[null==c?void 0:c.label,u.length>0&&` (${u.length})`]}),t.jsx("span",{className:zdt("absolute bottom-0 left-0 w-full h-[2px] sm:hidden",null==c?void 0:c.class)})]})})]})}),t.jsx("div",{className:"sticky top-12 z-50 bg-background min-h-[50px] border-b border-border",children:d.length<=1?d.map(e=>t.jsx("div",{className:"px-1 py-0.5",children:t.jsx(PEt,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:s,dateFromViewClick:r,translations:n.localization,children:t.jsx(rOt.div,{className:zdt(GLt(e.color),"rounded px-2 py-1 mb-0.5 last:mb-0 cursor-pointer","hover:bg-opacity-40 dark:hover:bg-opacity-40 transition-colors",w(e)),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:t.jsxs("div",{className:"max-w-28 md:max-w-48",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||n.localization.untitledEvent}),t.jsx("div",{className:"text-xs font-medium truncate",children:e.isStart?`${n.localization.starts}: ${ZLt(e.startTime,o)}`:e.isEnd?`${n.localization.ends}: ${ZLt(e.endTime,o)}`:null})]}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description}),g(e,r)&&t.jsx("div",{className:"text-xs italic",children:g(e,r)})]})})},e.id)})):t.jsx("div",{className:"px-1 py-0.5",children:t.jsx(JLt,{events:d,date:r,addEvent:a,updateEvent:i,is24HourFormat:o,getEventColor:GLt,onDelete:s,translations:n.localization,preSelectedColor:e,children:t.jsxs(rOt.div,{className:zdt(GLt(d[0].color),"rounded px-2 py-1 cursor-pointer group","hover:bg-opacity-40 dark:hover:bg-opacity-40 transition-colors","border border-dashed border-opacity-50"),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:[t.jsx("div",{className:"flex items-center justify-between",children:t.jsxs("span",{className:"text-xs font-medium",children:[d.length," ",n.localization.allDay]})}),t.jsxs("div",{className:"text-xs mt-0.5 truncate max-w-24 sm:max-w-44",children:[d.slice(0,3).map(e=>e.title||n.localization.untitledEvent).join(", "),d.length>3&&`, +${d.length-3} more`]})]})})})}),t.jsxs("div",{className:"relative",onDoubleClick:t=>((e,t)=>{if(m||!n.dayView.enableDoubleClickToAddEvent)return;const o=e.currentTarget.getBoundingClientRect(),i=e.clientY-o.top,s=Math.floor(i/(16/15)),l=Math.floor(s/60),c=s%60,u=`${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`,d=`${(l+1).toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;a({title:"",startDate:r,endDate:r,startTime:u,endTime:d,color:t,isRepeating:!1})})(t,e),children:[_.map(({hour:e})=>t.jsx("div",{className:"h-16 border-b border-border"},e)),l&&y&&Array.from({length:10}).map((e,r)=>t.jsx(XLt,{className:"absolute left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r)),t.jsx("div",{className:"absolute inset-0",children:h.map((e,l)=>{const c=e.column*(100/f),u=e.width*(100/f);return t.jsx(PEt,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:s,onOpenChange:v,dateFromViewClick:r,translations:n.localization,children:t.jsxs(rOt.div,{className:zdt(GLt(e.color),"absolute px-2 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",M(e)),style:{top:e.startMinutes*(16/15)+"px",height:`${Math.max((e.endMinutes-e.startMinutes)*(16/15),24)}px`,left:`${c}%`,width:`${u}%`},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*l},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||n.localization.untitledEvent}),t.jsx("div",{className:"text-xs",children:e.isStart?`${n.localization.starts}: ${ZLt(e.startTime,o)}`:e.isEnd?`${n.localization.ends}: ${ZLt(e.endTime,o)}`:`${ZLt(e.startTime,o)} - ${ZLt(e.endTime,o)}`}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description}),(e.isRepeating||e.isStart||e.isEnd||e.isMiddle)&&t.jsx("div",{className:"text-xs italic",children:g(e,r)})]})},e.id)})})]})]},e)})]})})]}),t.jsx(YLt,{orientation:"horizontal"})]})})},tBt=({filteredEvents:e,currentDate:r,currentConfig:n,isLoading:o,is24HourFormat:a,clickedTime:i,currentTimeTop:s,hoverLineRef:l,hoverTimeRef:c,currentTimeLineRef:u,setClickedTime:d,onEventAdd:p,onEventUpdate:h,onEventDelete:f,onDateRangeChange:m,isAddEventPopupOpen:v,setIsAddEventPopupOpen:y})=>{var g;const x={filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:a,onEventAdd:p,onEventUpdate:h,onEventDelete:f,hoverLineRef:l,hoverTimeRef:c,clickedTime:i,setClickedTime:d,currentTimeLineRef:u,currentTimeTop:s,isLoading:o,isAddEventPopupOpen:v,setIsAddEventPopupOpen:y,onDateRangeChange:m};return t.jsx(t.Fragment,{children:"resource"===(null==(g=n.dayView)?void 0:g.viewType)?t.jsx(eBt,{...x}):t.jsx(QLt,{...x})})},rBt=({filteredEvents:e,currentDate:r,is24HourFormat:n,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,isAddEventPopupOpen:l,currentConfig:c,setCurrentDate:u,setCurrentView:d,onEventUpdate:p,onEventDelete:h,onEventAdd:f,setIsAddEventPopupOpen:m,isLoading:v,currentTimeLineRef:y,currentTimeTop:g,onDateRangeChange:x})=>{var b,k;const _=nit(r,{weekStartsOn:n?1:0}),w=Mit(r,{weekStartsOn:n?1:0}),M=bit({start:_,end:w}),C=Array.from({length:24},(e,t)=>t),j=Fit(_,{weekStartsOn:n?1:0}),D=(e,t)=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,t)))&&IPt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const r=iit(e.startDate),n=git(e.endDate||e.startDate);return mst(t,{start:r,end:n})},O=e.filter(e=>e.isRepeating?M.some(t=>IPt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily")):mst(e.startDate,{start:_,end:w})||e.endDate&&mst(e.endDate,{start:_,end:w})),S=O.reduce((e,t)=>{const r="00:00"===t.startTime&&"23:59"===t.endTime,n=t.endDate&&!hit(t.startDate,t.endDate);return t.isRepeating?r?e.repeatingFullDayEvents.push(t):e.regularEvents.push(t):n?e.multiDayEvents.push(t):r?e.fullDayEvents.push(t):e.regularEvents.push(t),e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}),P=[...S.repeatingFullDayEvents,...S.multiDayEvents,...S.fullDayEvents],T=({event:e,day:r})=>{var n,o,a;const i=e.endDate&&!hit(e.startDate,e.endDate),s=hit(e.startDate,r),l=e.endDate&&hit(e.endDate,r),u=i&&!s&&!l;return t.jsx(PEt,{event:e,onAddEvent:f,onUpdateEvent:p,onDeleteEvent:h,dateFromViewClick:r,translations:c.localization,children:t.jsxs("div",{className:zdt(GLt(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[24px] text-xs",(()=>{if(!e.isRepeating)return zdt(s&&"border-l-4 border-l-black/70 dark:border-l-white/50",l&&"border-r-4 border-r-black/70 dark:border-r-white/50",u&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return zdt("border border-dashed border-opacity-50",s&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50",l&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",u&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})()),children:[t.jsx("div",{className:"font-semibold truncate",children:e.title||"Untitled Event"}),e.description&&t.jsx("div",{className:"truncate",children:e.description}),e.isRepeating&&t.jsx("div",{className:"text-[10px] opacity-75",children:"daily"===e.isRepeatingInterval?null==(n=c.localization)?void 0:n.repeatDaily:"weekly"===e.isRepeatingInterval?null==(o=c.localization)?void 0:o.repeatWeekly:null==(a=c.localization)?void 0:a.repeatMonthly})]})},e.id)};return t.jsxs(nLt,{className:"p-4",children:[P.length>0&&t.jsxs("div",{className:"mb-4 relative z-20",children:[t.jsx("div",{className:"grid grid-cols-8 gap-0",children:M.map(e=>t.jsx("div",{className:"text-center text-xs font-semibold"},e.toString()))}),t.jsxs("div",{className:"grid grid-cols-8 gap-0 relative",children:[t.jsx("div",{className:"absolute left-0 top-0 bottom-2 w-[12.5%] flex items-center justify-center z-10",children:t.jsxs("div",{className:"text-xs truncate font-semibold whitespace-nowrap",children:[c.localization.fullDayEvents," (",P.length,")"]})}),P.map((e,r)=>t.jsxs(rOt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.05*r},className:"col-span-8 grid grid-cols-8 gap-0 mb-1",children:[t.jsx("div",{className:"w-[12.5%]"}),M.map(r=>t.jsx("div",{className:"min-h-[24px] px-1",children:mst(r,{start:e.startDate,end:e.endDate||e.startDate})&&t.jsx(T,{event:e,day:r})},`${e.id}-${r.toString()}`))]},e.id))]})]}),t.jsx(ULt,{className:"h-[600px]",children:t.jsxs("div",{className:"relative mb-2",children:[t.jsxs("div",{className:"grid grid-cols-8 gap-0",children:[t.jsx(PEt,{event:{startDate:_,endDate:w,startTime:s||sst(new Date,"HH:mm"),endTime:sst(eit(s?yst(`2000-01-01T${s}`):new Date,1),"HH:mm"),isRepeating:!0},onAddEvent:f,dateFromViewClick:_,translations:c.localization,children:t.jsxs("div",{className:"sticky top-0 left-0 z-30 bg-background",onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top-48,n=Math.max(0,r);let i,s,l;if(e.ctrlKey){const e=15*Math.round(n/64*60/15);i=Math.floor(e/60),s=e%60,l=e/60*64}else i=Math.floor(n/64),s=Math.floor(n%64/64*60),l=n;const c=`${i.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`;o.current&&(o.current.style.top=`${l+48}px`,o.current.style.display="block"),a.current&&(a.current.textContent=c)},onMouseLeave:()=>{o.current&&(o.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top-48,n=Math.max(0,r),o=Math.floor(n/64),a=Math.floor(n%64/64*60),s=`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`;i(s)},children:[t.jsx("div",{className:"sticky top-0 left-0 bg-background h-12 border-b border-r border-border flex items-center justify-center",children:t.jsxs("span",{className:"text-xs font-semibold text-muted-foreground bg-background",children:["Week ",j]})}),C.map(e=>t.jsx("div",{className:"cursor-pointer h-16 pr-2 text-center text-sm text-muted-foreground border-r border-border",children:KLt(r,e,n)},e))]})}),t.jsx("div",{className:"col-span-7 relative z-20",children:t.jsxs("div",{className:"grid grid-cols-7 gap-0",children:[M.map((e,r)=>{const o=S.regularEvents.filter(t=>D(t,e)),{sortedEvents:a,eventPositions:i,maxColumn:s}=((e,t)=>{const r=e.filter(e=>D(e,t)).sort((e,r)=>{const n=yst(`${sst(t,"yyyy-MM-dd")}T${e.startTime}`),o=yst(`${sst(t,"yyyy-MM-dd")}T${r.startTime}`);return n.getTime()-o.getTime()}),n={};let o=0;const a=(e,r)=>{const n=yst(`${sst(t,"yyyy-MM-dd")}T${e.startTime}`),o=yst(`${sst(t,"yyyy-MM-dd")}T${e.endTime}`),a=yst(`${sst(t,"yyyy-MM-dd")}T${r.startTime}`);return n<yst(`${sst(t,"yyyy-MM-dd")}T${r.endTime}`)&&a<o};return r.forEach((e,t)=>{let i=0,s=!1;for(let o=0;o<t;o++)a(e,r[o])&&(i=Math.max(i,n[r[o].id].column+1),s=!0);n[e.id]={column:i,span:1},s&&(o=Math.max(o,i))}),0===o?(r.forEach(e=>{n[e.id]={column:0,span:1}}),{sortedEvents:r,eventPositions:n,maxColumn:1}):(r.forEach(e=>{if(n[e.id].column<o){let t=1;for(;t+n[e.id].column<=o&&!r.some(r=>n[r.id].column===n[e.id].column+t&&a(e,r));)t++;n[e.id].span=t}}),{sortedEvents:r,eventPositions:n,maxColumn:o+1})})(o,e);return t.jsxs("div",{className:"relative",onDoubleClick:()=>(e=>{l||c.weekView.enableDoubleClickToShiftViewToDaily&&(u(e),d("day"))})(e),children:[t.jsx("div",{className:"sticky top-0 z-30 bg-background h-12 flex items-center justify-center border-b border-border",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-xs font-semibold",children:c.localization.dayNames[e.getDay()].slice(0,3)}),t.jsx("div",{className:"text-sm "+(hit(e,new Date)?"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center mx-auto":""),children:sst(e,"d")})]})}),t.jsxs("div",{className:"relative h-[calc(100%-3rem)]",children:[C.map((e,r)=>t.jsx("div",{className:zdt("h-16",0!==r&&"border-t border-border",r===C.length-1&&"border-b border-border")},e)),a.map((r,o)=>{const{top:a,height:l}=((e,t)=>{const r=yst(`${sst(e.startDate,"yyyy-MM-dd")}T${e.startTime}`),n=yst(`${sst(e.endDate||e.startDate,"yyyy-MM-dd")}T${e.endTime}`),o=iit(t),a=git(t);let i,s;e.isRepeating?(i=Ost(Dst(t,r.getHours()),r.getMinutes()),s=Ost(Dst(t,n.getHours()),n.getMinutes())):(i=dit([r,o]),s=pit([n,a]));const l=i.getHours()+i.getMinutes()/60;return{top:64*l,height:64*(s.getHours()+s.getMinutes()/60-l)}})(r,e),{column:u,span:d}=i[r.id],v=d/s*100,y=u/s*100,g=((e,t)=>{var r,n,o,a,i,s;if(!e.isRepeating){if(e.endDate&&!hit(e.startDate,e.endDate)){const r=Math.floor(vit(git(e.endDate),iit(e.startDate)))+1;return`Day ${Math.floor(vit(iit(t),iit(e.startDate)))+1} of ${r}`}return null}switch(e.isRepeatingInterval||"daily"){case"daily":{const a=Math.floor(vit(yst(`${sst(e.endDate||e.startDate,"yyyy-MM-dd")}T${e.endTime}`),yst(`${sst(e.startDate,"yyyy-MM-dd")}T${e.startTime}`)))+1,i=bit({start:iit(e.startDate),end:iit(e.endDate||e.startDate)}),s=(null==(r=e.isRepeatingExcludedDates)?void 0:r.filter(e=>i.some(t=>hit(t,e))).length)||0,l=a-s,u=bit({start:iit(e.startDate),end:iit(t)}),d=(null==(n=e.isRepeatingExcludedDates)?void 0:n.filter(e=>u.some(t=>hit(t,e))).length)||0,p=Math.floor(vit(iit(t),iit(e.startDate)))+1-d;return`${null==(o=c.localization)?void 0:o.repeatDaily} ${p} of ${l}`}case"weekly":{const e=cst(t),r=null==(a=c.localization)?void 0:a.dayNames[e];return`${null==(i=c.localization)?void 0:i.repeatWeekly} ${r}`}case"monthly":return`${null==(s=c.localization)?void 0:s.repeatMonthly} ${sst(t,"do")}`;default:return null}})(r,e),x=hit(r.startDate,e),b=r.endDate&&hit(r.endDate,e);return t.jsx(PEt,{event:r,onAddEvent:f,onUpdateEvent:p,onDeleteEvent:h,onOpenChange:m,dateFromViewClick:e,translations:c.localization,children:t.jsxs(rOt.div,{className:zdt(GLt(r.color),"absolute px-1 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40",r.isRepeating&&"border border-dashed border-opacity-50",x&&"border-l-1 border-l-black/70 dark:border-l-white/30",b&&"border-r-1 border-r-black/70 dark:border-r-white/30"),style:{top:`${a}px`,height:`${Math.max(l,24)}px`,left:`${y}%`,width:`${v}%`,zIndex:o+1},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*o},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:r.title||"Untitled Event"}),t.jsxs("div",{className:"text-xs",children:[ZLt(r.startTime,n)," - ",ZLt(r.endTime,n)]}),g&&t.jsx("div",{className:"text-xs italic",children:g})]})},`${r.id}-${e.toISOString()}`)}),v&&x&&Array.from({length:10}).map((e,r)=>t.jsx(XLt,{className:"absolute top-0 left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r))]}),r<M.length-1&&t.jsx("div",{className:"absolute top-12 right-0 w-px h-[calc(100%-3rem)] bg-border"})]},e.toString())}),t.jsx("div",{className:"absolute top-0 right-0 w-px h-full bg-border"})]})})]}),!(null!=(b=c.weekView)&&b.hideHoverLine)&&t.jsx("div",{ref:o,className:"absolute left-[12.5%] right-0 h-px bg-primary z-50 pointer-events-none",style:{display:"none"},children:t.jsx("span",{ref:a,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})}),M.some(e=>hit(e,new Date))&&!(null!=(k=c.weekView)&&k.hideTimeline)&&t.jsxs("div",{ref:y,className:"absolute left-[12.5%] right-0 h-px bg-red-500 z-40 pointer-events-none",style:{top:`${g+48}px`},children:[t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:sst(new Date,"HH:mm")}),M.map((e,r)=>hit(e,new Date)&&t.jsx("div",{className:"absolute h-4 w-[1px] bg-red-500 transform -translate-y-1/2 opacity-75",style:{left:100/7*r+"%",boxShadow:"0 0 4px rgba(239, 68, 68, 0.5)"}},e.toString()))]})]})})]})},nBt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,onEventAdd:a,onEventUpdate:i,onEventDelete:s,isLoading:l,setCurrentDate:c,setCurrentView:u,isAddEventPopupOpen:d,setIsAddEventPopupOpen:p,onDateRangeChange:h})=>{var f;const m=nit(r,{weekStartsOn:o?1:0}),v=bit({start:m,end:Mit(r,{weekStartsOn:o?1:0})}),y=Fit(m,{weekStartsOn:o?1:0}),g=Array.from(new Set(e.map(e=>e.color))).sort((e,t)=>Bat.findIndex(t=>t.value===e)-Bat.findIndex(e=>e.value===t)),x=(e,t)=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,t)))&&IPt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?mst(t,{start:iit(e.startDate),end:git(e.endDate)}):hit(e.startDate,t),b=e=>{d||n.weekView.enableDoubleClickToShiftViewToDaily&&(c(e),u("day"))},k=(null==(f=n.weekView)?void 0:f.resourceDisplayMode)||"row",_=(e,r,l)=>{const c=((e,t)=>{if(e.isRepeating){if("weekly"===e.isRepeatingInterval||"monthly"===e.isRepeatingInterval)return"single";const r=hit(e.startDate,t),n=e.endDate&&hit(e.endDate,t);return r&&n?"single":r?"start":n?"end":"middle"}const r=hit(e.startDate,t),n=e.endDate&&hit(e.endDate,t);return e.endDate?r&&n?"single":r?"start":n?"end":"middle":"single"})(e,r),u=((e,t)=>{if(!e.isRepeating)return zdt("start"===t&&"border-l-4 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-4 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return zdt("border border-dashed border-opacity-50","start"===t&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})(e,c),d=e.isRepeating||"single"===c||"start"===c&&!e.isRepeating||"end"===c&&!e.isRepeating;return t.jsx(PEt,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:s,onOpenChange:p,dateFromViewClick:r,translations:n.localization,children:t.jsxs(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.1*l},className:zdt(GLt(e.color),"mb-1 last:mb-0 px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-50 dark:hover:bg-opacity-60","flex items-center justify-between gap-1",u),children:[t.jsx("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap flex-1 text-xs",children:e.title||n.localization.untitledEvent}),d&&t.jsx("span",{className:"text-[10px] opacity-75 whitespace-nowrap",children:e.isRepeating||"end"!==c?ZLt(e.startTime,o):`ends ${ZLt(e.endTime,o)}`})]})},e.id)},w=(e,r,l)=>e.length<=3?t.jsx(PEt,{event:{startDate:r,endDate:r,color:l},onAddEvent:e=>a({...e}),onOpenChange:p,translations:n.localization,children:t.jsxs(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"group",children:[t.jsx($ht,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2 md:hidden",children:"+"}),t.jsxs($ht,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2 hidden md:block opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:["+ ",n.localization.addEvent]})]})}):t.jsx(JLt,{events:e,addEvent:a,updateEvent:i,onDelete:s,date:r,is24HourFormat:o,getEventColor:GLt,preSelectedColor:l,translations:n.localization,children:t.jsx(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:t.jsxs($ht,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2",children:["+",e.length-3," ",n.localization.more]})})});return t.jsx(nLt,{className:"h-full flex flex-col overflow-hidden",children:t.jsxs(ULt,{className:"flex-1 h-[calc(100vh-200px)]",children:[t.jsx("div",{className:"min-w-[768px] relative",children:t.jsx("div",{className:"relative",children:"row"===k?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sticky top-0 z-30 bg-background grid grid-cols-8 gap-0",style:{gridTemplateColumns:`90px repeat(${v.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"text-xs font-semibold text-center text-muted-foreground",children:[t.jsx("span",{className:"truncate",children:"Week"})," ",y]})}),v.map(e=>t.jsx("div",{className:"border-b border-r border-border p-2 last:border-r-0 h-[50px] flex items-center justify-center",onDoubleClick:()=>b(e),children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-xs font-semibold",children:n.localization.dayNames[e.getDay()].slice(0,3)}),t.jsx("div",{className:zdt("text-sm",hit(e,new Date)&&"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center mx-auto"),children:sst(e,"d")})]})},e.toString()))]}),g.map(r=>{const n=Bat.find(e=>e.value===r);return t.jsxs("div",{className:"grid gap-0",style:{gridTemplateColumns:`90px repeat(${v.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 flex items-center justify-center h-[125px]",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:zdt("w-4 h-4 md:w-5 md:h-5 rounded-full flex-shrink-0",null==n?void 0:n.class)}),t.jsx("span",{className:"text-xs md:text-sm font-medium truncate max-w-[60px]",children:null==n?void 0:n.label})]})}),v.map(n=>{const o=e.filter(e=>e.color===r&&x(e,n));return t.jsxs("div",{className:"border-b border-r border-border p-2 h-[125px] last:border-r-0 relative group overflow-hidden",onDoubleClick:()=>b(n),children:[t.jsxs("div",{className:"relative z-10 h-full flex flex-col",children:[t.jsx("div",{className:"flex-1 overflow-auto",children:o.slice(0,(o.length,3)).map((e,t)=>_(e,n,t))}),t.jsx("div",{className:"mt-auto",children:w(o,n,r)})]}),l&&h&&t.jsx(XLt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"})]},`${r}-${n.toString()}`)})]},r)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sticky top-0 z-30 bg-background grid gap-0",style:{gridTemplateColumns:`90px repeat(${g.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"text-xs font-semibold text-center text-muted-foreground",children:[t.jsx("span",{className:"truncate",children:"Week"})," ",y]})}),g.map(e=>{const r=Bat.find(t=>t.value===e);return t.jsx("div",{className:"border-b border-r border-border p-2 last:border-r-0 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center justify-center",children:[t.jsx("div",{className:zdt("w-4 h-4 rounded-full",null==r?void 0:r.class)}),t.jsx("div",{className:"text-xs font-medium mt-1 truncate max-w-[90px] text-center",children:null==r?void 0:r.label})]})},e)})]}),v.map(r=>t.jsxs("div",{className:"grid gap-0",style:{gridTemplateColumns:`90px repeat(${g.length}, minmax(120px, 1fr))`},children:[t.jsxs("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 flex flex-col items-center justify-center h-[125px]",onDoubleClick:()=>b(r),children:[t.jsx("div",{className:"font-semibold text-sm",children:n.localization.dayNames[r.getDay()].slice(0,3)}),t.jsx("div",{className:zdt("text-base w-7 h-7 flex items-center justify-center",hit(r,new Date)&&"bg-primary text-primary-foreground rounded-full"),children:sst(r,"d")})]}),g.map(n=>{const o=e.filter(e=>e.color===n&&x(e,r));return t.jsxs("div",{className:"border-b border-r border-border p-2 h-[125px] last:border-r-0 relative group overflow-hidden",onDoubleClick:()=>b(r),children:[t.jsxs("div",{className:"relative z-10 h-full flex flex-col",children:[t.jsx("div",{className:"flex-1 overflow-auto",children:o.slice(0,(o.length,3)).map((e,t)=>_(e,r,t))}),t.jsx("div",{className:"mt-auto",children:w(o,r,n)})]}),l&&h&&t.jsx(XLt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"})]},`${r.toString()}-${n}`)})]},r.toString()))]})})}),t.jsx(YLt,{orientation:"horizontal"})]})})},oBt=({filteredEvents:e,currentDate:r,is24HourFormat:n,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,isAddEventPopupOpen:l,currentConfig:c,setCurrentDate:u,setCurrentView:d,onEventUpdate:p,onEventDelete:h,onEventAdd:f,setIsAddEventPopupOpen:m,isLoading:v,currentTimeLineRef:y,currentTimeTop:g,onDateRangeChange:x})=>{var b;const k={filteredEvents:e,currentDate:r,currentConfig:c,is24HourFormat:n,onEventAdd:f,onEventUpdate:p,onEventDelete:h,isLoading:v,isAddEventPopupOpen:l,setIsAddEventPopupOpen:m,setCurrentDate:u,setCurrentView:d,onDateRangeChange:x};return t.jsx(t.Fragment,{children:"resource"===(null==(b=c.weekView)?void 0:b.viewType)?t.jsx(nBt,{...k}):t.jsx(rBt,{...k,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,currentTimeLineRef:y,currentTimeTop:g})})},aBt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,setIsAddEventPopupOpen:a,isAddEventPopupOpen:i,setCurrentDate:s,setCurrentView:l,onEventUpdate:c,onEventDelete:u,onEventAdd:d,isLoading:p,onDateRangeChange:h})=>{var f;const m=kit(r),v=xit(r),y=null==(f=n.monthView)?void 0:f.showOnlyCurrentMonth,g=cst(m),x=new Date,b=n.localization.dayNames;let k,_;if(y)k=bit({start:m,end:v}),_=[...b.slice(g),...b.slice(0,g)];else{const e=o?1:0;k=bit({start:nit(m,{weekStartsOn:e}),end:Mit(v,{weekStartsOn:e})}),_=o?[...b.slice(1),b[0]]:b}return t.jsx(nLt,{className:"p-2 sm:p-4",children:t.jsx(ULt,{children:t.jsxs("div",{className:"grid grid-cols-7 gap-1 sm:gap-2",children:[_.map(e=>t.jsx("div",{className:"text-center font-medium text-xs sm:text-sm",children:e},e)),k.map(f=>{const m=hst(f,r);if(y&&!m)return t.jsx("div",{},f.toString());const v=e.filter(e=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,f)))&&IPt(f,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):hit(e.startDate,f)||e.endDate&&mst(f,{start:e.startDate,end:e.endDate})),g=((e,t)=>e.reduce((e,r)=>{const n="00:00"===r.startTime&&"23:59"===r.endTime,o=r.endDate&&!hit(r.startDate,r.endDate);if(r.isRepeating){if(r.isRepeatingExcludedDates&&r.isRepeatingExcludedDates.some(e=>hit(e,t)))return e;if(IPt(t,r.startDate,r.endDate||r.startDate,r.isRepeatingInterval||"daily")){let o;o="weekly"===r.isRepeatingInterval||"monthly"===r.isRepeatingInterval||hit(r.startDate,t)?"start":r.endDate&&hit(r.endDate,t)?"end":"middle",n?e.repeatingFullDayEvents.push({...r,position:o}):e.regularEvents.push({...r,position:o})}}else if(o){let n;hit(r.startDate,t)?n="start":hit(r.endDate,t)?n="end":mst(t,{start:r.startDate,end:r.endDate})&&(n="middle"),n&&e.multiDayEvents.push({...r,position:n})}else n?e.fullDayEvents.push(r):e.regularEvents.push(r);return e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}))(v,f),b=[...g.repeatingFullDayEvents,...g.multiDayEvents,...g.fullDayEvents],k=g.regularEvents,_=hit(f,x);let w=[],M=0;return b.length>0?(w.push(b[0]),M=b.length-1+k.length):k.length>0&&(w.push(k[0]),M=k.length-1),M>0?w=w.slice(0,1):k.length>1&&w.length<2&&w.push(k[1]),t.jsxs("div",{className:zdt("p-1 sm:p-2 h-[80px] sm:h-[130px] border rounded relative group flex flex-col",!m&&!y&&"bg-muted/50"),onDoubleClick:()=>(e=>{i||n.monthView.enableDoubleClickToShiftViewToWeekly&&(s(e),l("week"))})(f),children:[t.jsx("div",{className:zdt("font-semibold mb-1 w-5 h-5 sm:w-6 sm:h-6 flex items-center justify-center text-xs sm:text-sm",_&&"bg-primary text-primary-foreground rounded-full"),children:sst(f,"d")}),t.jsxs("div",{className:"flex-grow overflow-hidden",children:[p&&h&&t.jsx(XLt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),w.map((e,r)=>((e,r,i)=>{const s="position"in e,l=s&&"start"===e.position,p=s&&"end"===e.position,h=s&&"middle"===e.position;return t.jsx(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.05*r},children:t.jsx(PEt,{event:e,onAddEvent:d,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:i,onOpenChange:a,translations:n.localization,children:t.jsxs("div",{className:zdt(GLt(e.color),"p-1 text-[8px] h-10 sm:text-xs rounded mb-1 cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{if(!e.isRepeating)return zdt(l&&"border-l-4 border-l-black/70 dark:border-l-white/50",p&&"border-r-4 border-r-black/70 dark:border-r-white/50",h&&"border-x-0");switch(e.isRepeatingInterval){case"daily":return zdt("border border-dashed border-opacity-50",l&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50",p&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",h&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})()),children:[t.jsx("div",{className:"font-semibold truncate",children:e.title||"Untitled Event"}),!s&&t.jsxs("div",{className:"hidden sm:block truncate",children:[ZLt(e.startTime,o)," - ",ZLt(e.endTime,o)]}),s&&!e.isRepeating&&t.jsx("div",{className:"hidden sm:block truncate",children:e.description&&t.jsx("div",{className:"truncate",children:e.description})}),e.isRepeating&&t.jsxs("div",{className:"hidden sm:block truncate",children:[ZLt(e.startTime,o)," - ",ZLt(e.endTime,o)]})]})})},`${e.id}-${r}`)})(e,r,f)),0===v.length&&t.jsx(PEt,{translations:n.localization,onOpenChange:a,onAddEvent:d,event:{startDate:f,endDate:f},onDeleteEvent:u,children:t.jsx($ht,{variant:"ghost",size:"sm",className:"w-full h-1/2 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground transition-opacity truncate px-0.5 sm:px-2 sm:opacity-0 sm:group-hover:opacity-100",children:t.jsx("span",{className:"hidden sm:inline ml-1",children:n.localization.addEvent})})})]}),M>0&&t.jsx(JLt,{translations:n.localization,events:v,date:f,addEvent:d,updateEvent:c,onDelete:u,is24HourFormat:o,getEventColor:GLt,onOpenChange:a,children:t.jsx(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2},children:t.jsxs($ht,{variant:"ghost",size:"sm",className:"w-full gap-1 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground mt-auto sm:mt-1 truncate px-0.5 sm:px-2 h-5 sm:h-8",children:[t.jsxs("span",{children:["+",M]}),t.jsxs("span",{className:"hidden sm:inline",children:[" ",n.localization.more]})]})})}),1===v.length&&t.jsx(PEt,{translations:n.localization,onOpenChange:a,onAddEvent:d,event:{startDate:f},onDeleteEvent:u,children:t.jsxs($ht,{variant:"ghost",size:"sm",className:"w-full gap-1 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground mt-auto sm:mt-1 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity truncate px-0.5 sm:px-2 ",children:[t.jsx("span",{className:"font-bold",children:"+"}),t.jsx("span",{className:"hidden sm:inline",children:n.localization.addEvent})]})})]},f.toString())})]})})})},iBt=({filteredEvents:e,onEventUpdate:r,onEventDelete:n,onEventAdd:o,isLoading:a,currentDate:i,currentConfig:s,is24HourFormat:l,isAddEventPopupOpen:c,setCurrentDate:u,setCurrentView:d,setIsAddEventPopupOpen:p,onDateRangeChange:h})=>{var f;const m=kit(i),v=xit(i),y=null==(f=s.monthView)?void 0:f.showOnlyCurrentMonth,g=cst(m),x=new Date,b=s.localization.dayNames;let k,_;if(y)k=bit({start:m,end:v}),_=[...b.slice(g),...b.slice(0,g)];else{const e=l?1:0,t=nit(m,{weekStartsOn:e}),r=Mit(v,{weekStartsOn:e});k=bit({start:t,end:r}),_=l?[...b.slice(1),b[0]]:b}const w=Math.ceil(k.length/7);return t.jsx(nLt,{className:"p-2 sm:p-4",children:t.jsx(ULt,{children:t.jsxs("div",{className:"w-full",children:[t.jsx("div",{className:"grid grid-cols-7 border-b",children:_.map(e=>t.jsx("div",{className:"text-center font-medium text-xs sm:text-sm p-2",children:e},e))}),Array.from({length:w}).map((f,m)=>{const v=k.slice(7*m,7*(m+1));return t.jsx("div",{className:"grid grid-cols-7",children:v.map((f,m)=>{const v=hit(f,x),g=hst(f,i),b=(t=>e.filter(e=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,t)))&&IPt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const r=iit(e.startDate),n=git(e.endDate||e.startDate);return mst(t,{start:r,end:n})}).sort((e,t)=>new Date(e.startDate).getTime()+(e.startTime?36e5*parseFloat(e.startTime.replace(":",".")):0)-(new Date(t.startDate).getTime()+(t.startTime?36e5*parseFloat(t.startTime.replace(":",".")):0))))(f);return y&&!g?t.jsx("div",{},f.toString()):t.jsxs("div",{className:zdt("group min-h-[145px] border-b border-r p-1 relative","transition-colors duration-200",!g&&"bg-muted/50",0===m&&"border-l"),onDoubleClick:()=>(e=>{c||s.monthView.enableDoubleClickToShiftViewToWeekly&&(u(e),d("week"))})(f),children:[a&&h&&t.jsx(XLt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:zdt("font-semibold w-6 h-6 flex items-center justify-center text-xs sm:text-sm rounded-full",v&&"bg-primary text-primary-foreground"),children:sst(f,"d")}),t.jsx(PEt,{translations:s.localization,onOpenChange:p,onAddEvent:o,event:{startDate:f,endDate:f},dateFromViewClick:f,onDeleteEvent:n,children:t.jsx($ht,{variant:"ghost",size:"sm",className:"h-6 text-xs text-muted-foreground px-2 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",children:t.jsx("span",{className:"ml-1 hidden sm:inline",children:s.localization.addEvent})})})]}),t.jsxs("div",{className:"space-y-1 mt-1 overflow-y-auto",children:[b.slice(0,b.length>4?3:4).map((e,a)=>{const i=((e,t)=>{if(e.isRepeating){if("weekly"===e.isRepeatingInterval||"monthly"===e.isRepeatingInterval)return"single";const r=hit(e.startDate,t),n=e.endDate&&hit(e.endDate,t);return r&&n?"single":r?"start":n?"end":"middle"}const r=hit(e.startDate,t),n=e.endDate&&hit(e.endDate,t);return e.endDate?r&&n?"single":r?"start":n?"end":"middle":"single"})(e,f),c=((e,t)=>{if(!e.isRepeating)return zdt("start"===t&&"border-l-4 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-4 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return zdt("border border-dashed border-opacity-50","start"===t&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})(e,i),u=e.isRepeating||"single"===i||"start"===i&&!e.isRepeating||"end"===i&&!e.isRepeating;return t.jsx(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.05*a},children:t.jsx(PEt,{translations:s.localization,onAddEvent:o,onUpdateEvent:r,event:e,dateFromViewClick:f,onDeleteEvent:n,onOpenChange:p,children:t.jsxs("div",{className:zdt(GLt(e.color),"text-xs p-1 min-h-[24px] rounded cursor-pointer","hover:opacity-80 transition-opacity","flex items-center justify-between gap-1",c),children:[t.jsx("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap flex-1",children:e.title}),u&&t.jsx("span",{className:"text-[10px] opacity-75 whitespace-nowrap",children:e.isRepeating||"end"!==i?ZLt(e.startTime,l):`ends ${ZLt(e.endTime,l)}`})]})})},`${e.id}-${a}`)}),b.length>4&&t.jsx(JLt,{translations:s.localization,events:b,date:f,addEvent:o,updateEvent:r,onDelete:n,is24HourFormat:l,getEventColor:GLt,onOpenChange:p,children:t.jsx(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2},children:t.jsxs($ht,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2",children:["+",b.length-3," ",s.localization.more]})})})]})]},f.toString())})},m)})]})})})},sBt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,setIsAddEventPopupOpen:a,isAddEventPopupOpen:i,setCurrentDate:s,setCurrentView:l,onEventUpdate:c,onEventDelete:u,onEventAdd:d,isLoading:p,onDateRangeChange:h})=>{var f;return t.jsx(t.Fragment,{children:"detailed"===(null==(f=n.monthView)?void 0:f.viewType)?t.jsx(iBt,{filteredEvents:e,currentDate:r,is24HourFormat:o,isAddEventPopupOpen:i,currentConfig:n,setCurrentDate:s,setCurrentView:l,onEventAdd:d,onEventUpdate:c,onEventDelete:u,setIsAddEventPopupOpen:a,isLoading:p,onDateRangeChange:h}):t.jsx(aBt,{filteredEvents:e,currentDate:r,is24HourFormat:o,isAddEventPopupOpen:i,currentConfig:n,setCurrentDate:s,setCurrentView:l,onEventAdd:d,onEventUpdate:c,onEventDelete:u,setIsAddEventPopupOpen:a,isLoading:p,onDateRangeChange:h})})},lBt=({currentConfig:e,currentDate:r,filteredEvents:n,isAddEventPopupOpen:o,setCurrentDate:a,setCurrentView:i,is24HourFormat:s,isLoading:l,onEventAdd:c,onEventUpdate:u,onEventDelete:d,setIsAddEventPopupOpen:p,onDateRangeChange:h})=>{const f=function(e){const t=Yat(e.start),r=Yat(e.end);let n=+t>+r;const o=n?+t:+r,a=n?r:t;a.setHours(0,0,0,0),a.setDate(1);const i=[];for(;+a<=o;)i.push(Yat(a)),a.setMonth(a.getMonth()+1);return n?i.reverse():i}({start:wit(r),end:_it(r)}),m=s?1:0,v=s?e.localization.dayNames.slice(1).concat(e.localization.dayNames[0]):e.localization.dayNames;return t.jsx(nLt,{className:"p-4",children:t.jsx(ULt,{children:t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:[l&&h&&t.jsx(XLt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),f.map(r=>{const l=kit(r),h=bit({start:l,end:xit(r)}),f=(cst(l)-m+7)%7;return t.jsxs("div",{className:"border rounded p-2",onDoubleClick:()=>(t=>{o||e.yearView.enableDoubleClickToShiftViewToMonthly&&(a(t),i("month"))})(r),children:[t.jsx("h3",{className:"text-lg font-semibold mb-2 text-center",children:e.localization.monthNames[r.getMonth()]}),t.jsxs("div",{className:"grid grid-cols-7 gap-1",children:[v.map((e,n)=>t.jsxs("div",{className:"text-center text-xs text-muted-foreground",children:[t.jsx("span",{className:"hidden sm:inline",children:e}),t.jsx("span",{className:"sm:hidden",children:e.charAt(0)})]},`${r.toString()}-${e}-${n}`)),Array.from({length:f}).map((e,r)=>t.jsx("div",{className:"h-6 w-6"},`empty-start-${r}`)),h.map(r=>{const o=(e=>n.filter(t=>{if(t.isRepeating)return(!t.isRepeatingExcludedDates||!t.isRepeatingExcludedDates.some(t=>hit(t,e)))&&IPt(e,t.startDate,t.endDate||t.startDate,t.isRepeatingInterval||"daily");const r=iit(t.startDate),n=git(t.endDate||t.startDate);return mst(e,{start:r,end:n})}).map(e=>GLt(e.color)))(r),a=hit(r,new Date),i=n.filter(e=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,r)))&&IPt(r,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const t=iit(e.startDate),n=git(e.endDate||e.startDate);return mst(r,{start:t,end:n})});return t.jsx(JLt,{events:i,addEvent:c,updateEvent:u,onDelete:d,onOpenChange:p,date:r,is24HourFormat:s,getEventColor:GLt,translations:e.localization,children:t.jsx("div",{className:zdt("h-6 w-6 flex items-center justify-center text-xs cursor-pointer","text-foreground"),children:t.jsxs("div",{className:zdt("h-5 w-5 flex items-center justify-center rounded-full relative","transition-all duration-200 ease-in-out",a&&"bg-accent text-accent-foreground",o.length>0?"hover:scale-150 hover:z-10":"hover:bg-gray-200 dark:hover:bg-gray-700"),children:[o.length>0?t.jsx("div",{className:"absolute inset-0 rounded-full overflow-hidden",children:o.map((e,n)=>t.jsx("div",{className:`absolute inset-0 ${e}`,style:{backgroundColor:e.split(" ")[1],clipPath:`polygon(${n*(100/o.length)}% 0%, ${(n+1)*(100/o.length)}% 0%, ${(n+1)*(100/o.length)}% 100%, ${n*(100/o.length)}% 100%)`}},`${r.toString()}-${n}`))}):t.jsx("div",{className:"absolute inset-0 rounded-full transition-opacity opacity-0 hover:opacity-100 bg-gray-200 dark:bg-gray-700"}),t.jsx("time",{dateTime:sst(r,"yyyy-MM-dd"),className:"relative z-10",children:sst(r,"d")})]})})},r.toString())})]})]},r.toString())})]})})})},cBt=({filteredEvents:e,currentView:r,currentDate:n,listSearchTerm:o,setListSearchTerm:a,currentConfig:i,onEventUpdate:s,onEventDelete:l,onEventAdd:c,is24HourFormat:u,isLoading:d})=>{let p,h;switch(r){case"day":default:p=iit(n),h=git(n);break;case"week":p=nit(n),h=Mit(n);break;case"month":p=kit(n),h=xit(n);break;case"year":p=wit(n),h=_it(n)}const f=e.filter(e=>{if(e.isRepeating){const t=()=>bit({start:p,end:h}).some(t=>(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,t)))&&IPt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"));return"day"===r?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,n)))&&IPt(n,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):t()}if("day"===r){const t=iit(e.startDate),r=git(e.endDate||e.startDate);return mst(n,{start:t,end:r})}return mst(e.startDate,{start:p,end:h})||e.endDate&&mst(e.endDate,{start:p,end:h})}).filter(e=>e.title.toLowerCase().includes(o.toLowerCase())||e.description&&e.description.toLowerCase().includes(o.toLowerCase())).sort((e,t)=>function(e,t){const r=Yat(e),n=Yat(t),o=r.getTime()-n.getTime();return o<0?-1:o>0?1:o}(e.startDate,t.startDate));return t.jsxs(nLt,{className:"p-4",children:[t.jsx(rOt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3},className:"mb-4",children:t.jsxs("div",{className:"relative",children:[t.jsx(fbt,{initial:!1,mode:"wait",children:o?t.jsx(rOt.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute left-2.5 top-[0.6rem] transform -translate-y-1/2 flex items-center justify-center",children:t.jsx($ht,{variant:"ghost",size:"icon",className:"h-5 w-5 p-0",onClick:()=>a(""),children:t.jsx(clt,{className:"h-4 w-4 text-muted-foreground"})})},"clearButton"):t.jsx(rOt.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute left-2.5 top-[0.75rem] transform -translate-y-1/2 flex items-center justify-center",children:t.jsx(slt,{className:"h-4 w-4 text-muted-foreground"})},"searchIcon")}),t.jsx(cyt,{type:"text",placeholder:i.localization.searchEvents,value:o,onChange:e=>a(e.target.value),className:"pl-10 pr-4 py-2 w-full"})]})}),t.jsxs(ULt,{className:"h-[600px]",children:[t.jsx(fbt,{initial:!0,children:f.map(e=>{const{dateInfo:r,isMultiDay:o,isOutOfRange:a,isRepeating:d}=(e=>{const t=iit(e.startDate),r=git(e.endDate||e.startDate),n=!hit(t,r),o=t<p||r>h,a=e.isRepeating;let s="";if(a&&(e.isRepeatingInterval,1)){const t=`${ZLt(e.startTime,u)} - ${ZLt(e.endTime,u)}`,r=sst(e.startDate,"MMM d"),n=sst(e.endDate||e.startDate,"MMM d, yyyy"),o=sst(e.startDate,"EEEE"),a=sst(e.startDate,"do");switch(e.isRepeatingInterval||"daily"){case"daily":s=i.localization.repeatDailyDescription.replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n);break;case"weekly":s=i.localization.repeatWeeklyDescription.replace("{dayName}",o).replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n);break;case"monthly":s=i.localization.repeatMonthlyDescription.replace("{dayOfMonth}",a).replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n)}}else s=`${sst(t,"MMM d")}`,n&&(s+=` - ${sst(r,"MMM d")}`);return{dateInfo:s,isMultiDay:n,isOutOfRange:o,isRepeating:a}})(e);return t.jsx(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,height:0},transition:{duration:.3},children:t.jsx(PEt,{event:e,onAddEvent:c,onUpdateEvent:s,onDeleteEvent:l,dateFromViewClick:n,translations:i.localization,children:t.jsxs("div",{className:zdt("p-2 rounded-lg cursor-pointer mb-2",GLt(e.color),"hover:opacity-80 transition-opacity",e.isRepeating&&"border border-dashed border-opacity-50"),children:[t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"font-semibold",children:r}),t.jsxs("div",{className:"flex items-center space-x-2",children:[d&&t.jsx(YFt,{children:t.jsxs(ZFt,{children:[t.jsx(KFt,{children:t.jsx(ilt,{className:"h-4 w-4"})}),t.jsx(GFt,{children:t.jsx("p",{children:i.localization.repeatingEvent})})]})}),o&&!d&&t.jsx(YFt,{children:t.jsxs(ZFt,{children:[t.jsx(KFt,{children:t.jsx($st,{className:"h-4 w-4"})}),t.jsx(GFt,{children:t.jsx("p",{children:i.localization.multiDayEvent})})]})}),a&&t.jsx(YFt,{children:t.jsxs(ZFt,{children:[t.jsx(KFt,{children:t.jsx(Lst,{className:"h-4 w-4"})}),t.jsx(GFt,{children:t.jsx("p",{children:i.localization.extendsOutOfRange})})]})}),t.jsxs("span",{children:[ZLt(e.startTime,u)," - ",ZLt(e.endTime,u)]})]})]}),t.jsx("h3",{className:"text-lg font-bold mt-2",children:e.title||"Untitled Event"}),e.description&&t.jsx("p",{className:"mt-1 text-sm",children:e.description})]})})},e.id)})}),!d&&0===f.length&&t.jsx(rOt.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-8",children:o?i.localization.noEvents:`${i.localization.noEvents} ${i.localization[r]}`})]})]})},uBt=({currentView:r,isListView:n,animationDirection:o,currentDate:a,filteredEvents:i,listSearchTerm:s,setListSearchTerm:l,currentConfig:c,onEventUpdate:u,onEventDelete:d,isLoading:p,onEventAdd:h,is24HourFormat:f,setCurrentDate:m,setCurrentView:v,onDateRangeChange:y})=>{const[g,x]=e.useState(!1),[b,k]=e.useState(null),_=e.useRef(null),w=e.useRef(null),M=e.useRef(null),C=(()=>{const[t,r]=e.useState(0);return e.useEffect(()=>{const e=()=>{const e=new Date,t=(60*e.getHours()+e.getMinutes())*(16/15);r(t)};e();const t=setInterval(e,6e4);return()=>clearInterval(t)},[]),t})();rLt({currentView:r,currentDate:a,onDateRangeChange:y,is24HourFormat:f});const j={filteredEvents:i,currentDate:a,currentConfig:c,onEventUpdate:u,onEventDelete:d,onEventAdd:h,is24HourFormat:f,isLoading:p},D={isAddEventPopupOpen:g,setIsAddEventPopupOpen:x,onDateRangeChange:y},O={hoverLineRef:_,hoverTimeRef:w},S={clickedTime:b,setClickedTime:k},P={currentTimeLineRef:M,currentTimeTop:C},T={setCurrentDate:m,setCurrentView:v};return t.jsx(fbt,{mode:"wait",children:t.jsx(rOt.div,{initial:{opacity:0,y:"up"===o?-20:"down"===o?20:0},animate:{opacity:1,x:0,y:0},exit:{opacity:0,y:"up"===o?20:"down"===o?-20:0},transition:{duration:.1},className:"h-full",children:n?t.jsx(cBt,{...j,currentView:r,listSearchTerm:s,setListSearchTerm:l}):t.jsxs(t.Fragment,{children:["day"===r&&t.jsx(tBt,{...j,...D,...O,...S,...P}),"week"===r&&t.jsx(oBt,{...j,...D,...O,...S,...P,...T}),"month"===r&&t.jsx(sBt,{...j,...D,...T}),"year"===r&&t.jsx(lBt,{...j,...D,...T})]})},`${r}-${a.toISOString()}`)})},dBt={language:"enUS",today:"Today",thisWeek:"This Week",thisMonth:"This Month",thisYear:"This Year",dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],fullDayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],viewBy:"View by",day:"Day",week:"Week",month:"Month",year:"Year",list:"List",addEvent:"Add Event",editEvent:"Edit Event",deleteEvent:"Delete Event",eventTitle:"Event Title",eventDescription:"Description",eventColor:"Event Resource",eventDate:"Date",eventStartTime:"Start Time",eventEndTime:"End Time",eventEndDate:"End Date",eventIsRepeating:"Repeating Event",eventAdded:"Event added",eventUpdated:"Event updated",eventDeleted:"Event deleted",eventRestored:"Event restored",eventUpdateUndone:"Event update undone",failedToAddEvent:"Failed to add event",failedToUpdateEvent:"Failed to update event",failedToDeleteEvent:"Failed to delete event",failedToFetchEvents:"Failed to fetch events",errorCannotExcludeAllDates:"Cannot exclude all dates in the range",save:"Save",saving:"Saving",cancel:"Cancel",delete:"Delete",deleting:"Deleting",undo:"Undo",tryAgain:"Try again",close:"Close",search:"Search",searchEvents:"Search events...",noEvents:"No events",allDay:"All Day",fullDayEvents:"Full-Day Events",loadingEvents:"Loading events...",filterByColor:"Filter by Resource",filter:"Filter",filtering:"Filtering",more:"more",use24HourFormat:"Use 24-hour format",repeatingEvent:"Repeating event",multiDayEvent:"Multi-day event",extendsOutOfRange:"Extends beyond current view",displayCalendar:"Display Calendar",displayList:"Display List",dayXofY:"Day {x} of {y}",repeatXofY:"#{x} of {y}",starts:"Starts",ends:"Ends",untitledEvent:"Untitled Event",repeatDaily:"Daily",repeatWeekly:"Weekly",repeatMonthly:"Monthly",repeatingEventQuestion:"Repeating Event?",repeatDailyDescription:"Repeats daily at {timeRange} from {startDate} to {endDate}",repeatWeeklyDescription:"Repeats every {dayName} at {timeRange} from {startDate} to {endDate}",repeatMonthlyDescription:"Repeats on the {dayOfMonth} of each month at {timeRange} from {startDate} to {endDate}",withExcludedDates:"with {count} excluded date{s}",excludedDates:"Excluded Dates?",excludedDatesDescription:"Select dates to exclude from the recurring pattern",skipDays:"Skip Days:",clearAll:"Clear All",selectDatesToExclude:"Select dates to exclude",selectAll:"Select All",noMatchingDates:"No dates match this repeat pattern",noSearchResults:'No matches found for "{query}"',searchMonthPlaceholder:"Search month...",ofExcluded:"{count} of {total} excluded",pageCount:"{current}/{total}",weeklyIntervalLabel:"{dayName}s ({startDate} - {endDate})",monthlyIntervalLabel:"{dayOfMonth} of each month ({startDate} - {endDate})",dateButtonFormat:"MMM d",editEventDescription:"Edit your event details.",createEventDescription:"Create a new event in your calendar.",timePresetAllDay:"All Day",timePresetEarlyMorning:"Early Morning",timePresetMorning:"Morning",timePresetLunch:"Lunch",timePresetEarlyAfternoon:"Early Afternoon",timePresetLateAfternoon:"Late Afternoon",timePresetEvening:"Evening",timePresetNight:"Night",selectDate:"Pick a date",selectColor:"Select a color",confirmDelete:"Are you sure?",confirmDeleteDescription:"Do you want to delete this event?",repeatEventDeleteTitle:"Delete Repeating Event",repeatEventDeleteDescription:"This is a repeating event. What would you like to delete?",deleteThisOccurrence:"Delete only this occurrence",deleteThisAndFuture:"Delete this and all future occurrences",deleteAllOccurrences:"Delete all occurrences",deleteThisOccurrenceDescription:"Only this specific date will be removed",deleteThisAndFutureDescription:"This and all future dates will be removed",deleteAllOccurrencesDescription:"The entire repeating event will be removed",editRecurringEventTitle:"Edit Recurring Event",editRecurringEventDescription:"This is a recurring event. Would you like to edit all occurrences, just this one, or this and future occurrences?",editThisOccurrence:"Edit this occurrence only",editThisOccurrenceDescription:"Make changes only to this specific event occurrence",editThisAndFuture:"Edit this and future occurrences",editThisAndFutureDescription:"Make changes to this and all future occurrences",editAllOccurrences:"Edit all occurrences",editAllOccurrencesDescription:"Make changes to all occurrences of this event",from:"from",to:"to",pickADate:"Pick a date",errorEndDateBeforeStart:"End date cannot be before start date",selectAColor:"Select a color",validations:{eventNameRequired:"Event name is required",invalidTimeFormat:"Invalid time format",colorRequired:"Color is required",endTimeBeforeStart:"End time can't be before start time"}},pBt={defaultView:"month",use24HourFormatByDefault:!0,dayView:{enableDoubleClickToAddEvent:!1,viewType:"regular"},weekView:{enableDoubleClickToShiftViewToDaily:!1,viewType:"regular"},monthView:{enableDoubleClickToShiftViewToWeekly:!1,viewType:"basic"},yearView:{enableDoubleClickToShiftViewToMonthly:!1},localization:{...dBt}},hBt=({config:r,events:n,isLoading:o=!1,onEventAdd:a,onEventUpdate:i,onEventDelete:s,onDateRangeChange:l})=>{const c={...pBt,...r},u=Pst({config:{defaultView:c.defaultView||"month",use24HourFormatByDefault:c.use24HourFormatByDefault||!1},translations:c.localization}),[d,p]=e.useState(!1),[h,f]=e.useState(""),[m,v]=e.useState(Bat.map(e=>e.value)),y=n.filter(e=>m.includes(e.color)),g=(()=>{const[t,r]=e.useState(!1);return e.useEffect(()=>{r("ontouchstart"in window||navigator.maxTouchPoints>0)},[]),t})(),x=Uat({onSwipedLeft:()=>u.handleNext(),onSwipedRight:()=>u.handlePrevious(),preventScrollOnSwipe:!1,trackMouse:!1,delta:{left:100,right:100},swipeDuration:150,touchEventOptions:{passive:!0},trackTouch:!0}),b={...u,currentConfig:c,onEventAdd:a,onEventDelete:s,isListView:d};return t.jsxs("div",{...g?x:{},children:[t.jsx(tLt,{...b,setIsListView:p,selectedColors:m,setSelectedColors:v}),t.jsx(uBt,{...b,is24HourFormat:u.use24HourFormat,filteredEvents:y,listSearchTerm:h,setListSearchTerm:f,onEventUpdate:i,isLoading:o,onDateRangeChange:l})]})};function fBt({config:t={},initialEvents:r=[],onEventAdd:n,onEventUpdate:o,onEventDelete:a,onDateRangeChange:i}){var s,l;const[c,u]=e.useState(r),[d,p]=e.useState(!1),h=e.useRef(null),f=e.useRef(null),m=(null==(s=t.calendarConfig)?void 0:s.localization)||dBt,v=async(e,r)=>{var o;let a;try{a=n?await n(e):{...e,id:Date.now().toString()+Math.random().toString(36).substring(2,7)},u(e=>[...e,a]),f.current=a,r?tpt.success(m.eventRestored):tpt.success(m.eventAdded,{action:{label:m.undo,onClick:()=>g(a.id,!0)}})}catch(n){console.error("Error adding event:",n),tpt.error(m.failedToAddEvent,!1!==(null==(o=t.events)?void 0:o.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>v(e,r)}}:void 0)}},y=async(e,r)=>{var n;try{o&&await o(e),u(t=>t.map(t=>t.id===e.id?e:t)),r?tpt.success(m.eventRestored):tpt.success(m.eventUpdated,{action:{label:m.undo,onClick:()=>y(c.find(t=>t.id===e.id),!0)}})}catch(o){console.error("Error updating event:",o),tpt.error(m.failedToUpdateEvent,!1!==(null==(n=t.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>y(e,r)}}:void 0)}},g=async(e,r)=>{var n;if(!e)return;const o=r?f.current:c.find(t=>t.id===e);if(o)try{a&&await a(e),u(t=>t.filter(t=>t.id!==e)),r?tpt.success(m.eventDeleted):tpt.success(m.eventDeleted,{action:{label:m.undo,onClick:()=>v(o,!0)}})}catch(o){console.error("Error deleting event:",o),tpt.error(m.failedToDeleteEvent,!1!==(null==(n=t.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>g(e,r)}}:void 0)}else console.error(`Event with id ${e} not found`)},x=function(t,r,n){const o=e.useRef(),a=e.useRef(null),i=e.useCallback(()=>{var e;o.current&&(clearTimeout(o.current),o.current=void 0,null==(e=null==n?void 0:n.onCancel)||e.call(n),a.current&&(a.current(),a.current=null))},[n]);return e.useEffect(()=>()=>i(),[i]),e.useCallback((...e)=>{var s;return r?(i(),null==(s=null==n?void 0:n.onDebounce)||s.call(n),new Promise(n=>{a.current=n,o.current=setTimeout(async()=>{await t(...e),a.current=null,n()},r)})):t(...e)},[t,r,n,i])}(async(e,r)=>{var n;if(!i)return;h.current&&h.current.abort();const o=new AbortController;h.current=o;try{p(!0);const t=await i(e,r,o.signal);h.current===o&&u(e=>[...e,...t])}catch(o){if(o instanceof DOMException&&"AbortError"===o.name)return;console.error("Error fetching events:",o),tpt.error(m.failedToFetchEvents,!1!==(null==(n=t.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>x(e,r)}}:void 0)}finally{h.current===o&&(p(!1),h.current=null)}},null==(l=t.events)?void 0:l.debounceTimeOnViewOrDateChange,{onDebounce:()=>{}});return{events:c,isLoading:d,addEvent:v,updateEvent:y,deleteEvent:g,onViewOrDateChange:x}}new Date((new Date).getFullYear(),(new Date).getMonth(),7),new Date((new Date).getFullYear(),(new Date).getMonth(),7),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),12),new Date((new Date).getFullYear(),(new Date).getMonth(),12),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),17),new Date((new Date).getFullYear(),(new Date).getMonth(),17),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+3),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),25),new Date((new Date).getFullYear(),(new Date).getMonth(),25),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()-1),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+3);var mBt=function(e){var t=e.configurationItemInfo,r=h(e,["configurationItemInfo"]),n=fBt({initialEvents:r.events||[],onEventAdd:function(e){return f(void 0,void 0,void 0,function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,null===(t=r.onEventCreate)||void 0===t?void 0:t.call(r,e)];case 1:return n.sent(),[2,p(p({},e),{id:Date.now().toString()})]}})})},onEventUpdate:function(e){return f(void 0,void 0,void 0,function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,null===(t=r.onEventUpdate)||void 0===t?void 0:t.call(r,e)];case 1:return n.sent(),[2,e]}})})},onEventDelete:r.onEventDelete,onDateRangeChange:r.onDateRangeChange}),o=n.events,a=n.isLoading,i=n.addEvent,s=n.updateEvent,l=n.deleteEvent,c=n.onViewOrDateChange;return Me(jp,p({sx:p({width:"100%",height:"100%"},r.css)},t,{className:"fec-wrapper"},{children:Me(hBt,{events:o,isLoading:a,config:r.config,onEventAdd:i,onEventUpdate:s,onEventDelete:l,onDateRangeChange:c})}))},vBt={exports:{}};const yBt={AED:"د.إ",AFN:"؋",ALL:"L",AMD:"֏",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"FBu",BMD:"$",BND:"$",BOB:"$b",BOV:"BOV",BRL:"R$",BSD:"$",BTC:"₿",BTN:"Nu.",BWP:"P",BYN:"Br",BYR:"Br",BZD:"BZ$",CAD:"$",CDF:"FC",CHE:"CHE",CHF:"CHF",CHW:"CHW",CLF:"CLF",CLP:"$",CNH:"¥",CNY:"¥",COP:"$",COU:"COU",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fdj",DKK:"kr",DOP:"RD$",DZD:"دج",EEK:"kr",EGP:"£",ERN:"Nfk",ETB:"Br",ETH:"Ξ",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GGP:"£",GHC:"₵",GHS:"GH₵",GIP:"£",GMD:"D",GNF:"FG",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",IMP:"£",INR:"₹",IQD:"ع.د",IRR:"﷼",ISK:"kr",JEP:"£",JMD:"J$",JOD:"JD",JPY:"¥",KES:"KSh",KGS:"лв",KHR:"៛",KMF:"CF",KPW:"₩",KRW:"₩",KWD:"KD",KYD:"$",KZT:"₸",LAK:"₭",LBP:"£",LKR:"₨",LRD:"$",LSL:"M",LTC:"Ł",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MRO:"UM",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MXV:"MXV",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"﷼",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PYG:"Gs",QAR:"﷼",RMB:"¥",RON:"lei",RSD:"Дин.",RUB:"₽",RWF:"R₣",SAR:"﷼",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"S$",SHP:"£",SLL:"Le",SOS:"S",SRD:"$",SSP:"£",STD:"Db",STN:"Db",SVC:"$",SYP:"£",SZL:"E",THB:"฿",TJS:"SM",TMT:"T",TND:"د.ت",TOP:"T$",TRL:"₤",TRY:"₺",TTD:"TT$",TVD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"$",UYI:"UYI",UYU:"$U",UYW:"UYW",UZS:"лв",VEF:"Bs",VES:"Bs.S",VND:"₫",VUV:"VT",WST:"WS$",XAF:"FCFA",XBT:"Ƀ",XCD:"$",XOF:"CFA",XPF:"₣",XSU:"Sucre",XUA:"XUA",YER:"﷼",ZAR:"R",ZMW:"ZK",ZWD:"Z$",ZWL:"$"};vBt.exports=function(e){if("string"!=typeof e)return;const t=e.toUpperCase();return Object.prototype.hasOwnProperty.call(yBt,t)?yBt[t]:void 0},vBt.exports.currencySymbolMap=yBt;var gBt=function(t){var r,n,o=t.required,a=void 0!==o&&o,i=t.requiredErrorText,s=void 0===i?"This field is required":i,l=t.validationErrorText,c=void 0===l?"Invalid numeric value":l,u=t.isDisplayOnly,d=void 0!==u&&u,h=t.backgroundColor,f=t.textAlign,m=void 0===f?"left":f,v=t.textColor,y=void 0===v?"inherit":v,g=t.fontSize,x=void 0===g?"16px":g,b=t.fontFamily,k=void 0===b?"inherit":b,_=t.fontWeight,w=void 0===_?"normal":_,M=t.borderColor,C=t.marginLeft,j=void 0===C?"0":C,D=t.marginTop,O=void 0===D?"0":D,S=t.marginRight,P=void 0===S?"0":S,T=t.marginBottom,E=void 0===T?"0":T,N=t.paddingLeft,z=void 0===N?"0":N,A=t.paddingTop,R=void 0===A?"0":A,F=t.paddingRight,L=void 0===F?"0":F,B=t.paddingBottom,V=void 0===B?"0":B,I=t.width,q=t.height,$=t.minHeight,H=t.maxHeight,W=t.minWidth,U=t.maxWidth,Y=t.text,Z=t.placeholderText,K=t.configurationItemInfo,G=t.name,X=t.numericPrecision,Q=void 0===X?"1":X,J=t.currency,ee=t.placement,te=void 0===ee?"left":ee,re=t.sourceDataModelField,ne=WS(),oe=null==ne?void 0:ne.control,ae=KBt().localStateObject,ie=JBt().stateConfig,se=ae||ie,le=e.useState(""),ce=le[0],ue=le[1],de=!!oe&&!!G,pe=re?null===(r=null==se?void 0:se[re])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==pe&&(de?ne.setValue(G,pe):ue(String(null!=pe?pe:"")))},[pe,de,ne,G]);var he=Number.isFinite(+Q)&&+Q>0?+Q:1,fe=J?null!==(n=vBt.exports(J.toUpperCase()))&&void 0!==n?n:J.toUpperCase():"",me={required:!!a&&s,pattern:{value:/^-?\d+(?:\.\d+)?$/,message:c}},ve=p(p(p(p(p(p(p({backgroundColor:h,color:y,fontSize:x,fontFamily:k,fontWeight:w},I&&{width:I}),q&&{height:q}),W&&{minWidth:W}),U&&{maxWidth:U}),$&&{minHeight:$}),H&&{maxHeight:H}),{"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:M},"&:hover fieldset":{borderColor:M},"&.Mui-focused fieldset":{borderColor:M},"&.Mui-disabled fieldset":{borderColor:M}},"& .MuiOutlinedInput-input":{textAlign:m,paddingLeft:z,paddingTop:R,paddingRight:L,paddingBottom:V}}),ye={color:y,"&.Mui-focused":{color:y}},ge={marginLeft:j,marginTop:O,marginRight:P,marginBottom:E,display:"inline-flex",flexDirection:"column"},xe=fe?Me("span",p({style:{color:y,fontWeight:w}},{children:fe})):null;if(d){var be=de?ne.watch(G):pe,ke=null!=be?be:"-";return Ce(jp,p({sx:p(p(p(p(p(p(p({},ge),I&&{width:I}),q&&{height:q}),W&&{minWidth:W}),U&&{maxWidth:U}),$&&{minHeight:$}),H&&{maxHeight:H})},K,{children:[Y&&Me(nm,p({sx:{fontSize:x,fontFamily:k,fontWeight:w,color:y,marginLeft:0}},{children:Y})),Me(qc,p({sx:{fontSize:x,fontFamily:k,fontWeight:w,color:y,backgroundColor:h,paddingLeft:z,paddingTop:R,paddingRight:L,paddingBottom:V,border:"1px solid ".concat(M||"#ccc"),borderRadius:"4px",minWidth:"100px"}},{children:"left"===te?"".concat(fe).concat(ke):"".concat(ke).concat(fe)}))]}))}var _e=function(e,t){return Me(Qb,p({type:"number",label:Y,required:a,placeholder:Z,variant:"outlined",sx:ge,inputProps:{step:he},slotProps:{input:{sx:ve,style:{textAlign:m}},inputLabel:{sx:ye}},InputProps:{startAdornment:"left"===te&&xe?Me(Mm,p({position:"start"},{children:xe})):void 0,endAdornment:"right"===te&&xe?Me(Mm,p({position:"end"},{children:xe})):void 0},error:!!t,helperText:t||null},e,K))};return de?Me(QS,{name:G,rules:me,control:oe,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return _e(r,null===(t=n.error)||void 0===t?void 0:t.message)}}):_e({value:ce,onChange:function(e){return ue(e.target.value)}})},xBt=e.forwardRef(function(e,t){var r=e.inputRef,n=h(e,["inputRef"]);return Me($k,p({},n,{ref:function(e){"function"==typeof r&&r(e?e.inputElement:null)},mask:k_,guide:!0,placeholderChar:" "}))}),bBt=function(e){var t=e.masked,r=e.errorMsg,n=e.inputSx,o=e.labelSx,a=h(e,["masked","errorMsg","inputSx","labelSx"]);return Me(Qb,p({},a,{variant:"outlined",error:!!r,helperText:r||null,type:"text",slotProps:{input:p({sx:n},t?{inputComponent:xBt}:{}),inputLabel:{sx:o}}}))},kBt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"Email is required":s,c=t.validationErrorText,u=void 0===c?"Invalid email address":c,d=t.text,h=t.placeholderText,f=t.masked,m=void 0!==f&&f,v=t.multiLine,y=void 0!==v&&v,g=t.backgroundColor,x=t.borderColor,b=t.color,k=void 0===b?"inherit":b,_=t.fontSize,w=void 0===_?"16px":_,M=t.fontFamily,C=void 0===M?"inherit":M,j=t.fontWeight,D=void 0===j?"normal":j,O=t.textAlign,S=void 0===O?"left":O,P=t.marginLeft,T=void 0===P?"0":P,E=t.marginTop,N=void 0===E?"0":E,z=t.marginRight,A=void 0===z?"0":z,R=t.marginBottom,F=void 0===R?"0":R,L=t.paddingLeft,B=void 0===L?"0":L,V=t.paddingTop,I=void 0===V?"0":V,q=t.paddingRight,$=void 0===q?"0":q,H=t.paddingBottom,W=void 0===H?"0":H,U=t.width,Y=t.height,Z=t.minHeight,K=t.maxHeight,G=t.minWidth,X=t.maxWidth,Q=t.name,J=t.sourceDataModelField,ee=t.configurationItemInfo,te=WS(),re=null==te?void 0:te.control,ne=!(!re||!Q),oe=KBt().localStateObject,ae=JBt().stateConfig,ie=oe||ae,se=J?null===(r=null==ie?void 0:ie[J])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==se&&ne&&te.setValue(Q,se)},[se]);var le=e.useState("");le[0],le[1];var ce={required:!!i&&l,pattern:{value:/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([^<>()[\]\\.,;:\s@"]+\.)+[^<>()[\]\\.,;:\s@"]{2,})$/,message:u}};if(o){var ue=(ne?te.watch(Q)||"":se)||h||"-";return Ce("div",p({style:p(p(p({display:"inline-flex",flexDirection:"column",marginLeft:T,marginTop:N,marginRight:A,marginBottom:F},U&&{width:U}),Y&&{height:Y}),{minHeight:Z,maxHeight:K,minWidth:G,maxWidth:X})},ee,{children:[d&&Me(nm,p({sx:{fontSize:w,fontFamily:C,fontWeight:D,color:k,marginLeft:0,marginBottom:"4px"}},{children:d})),Me(qc,p({sx:{fontSize:w,fontFamily:C,fontWeight:D,color:k,paddingLeft:B,paddingTop:I,paddingRight:$,paddingBottom:W,backgroundColor:g,border:"1px solid ".concat(x||"#ccc"),borderRadius:"4px",minWidth:"120px",textAlign:S}},{children:ue}))]}))}var de=p(p(p(p(p(p(p({backgroundColor:g,color:k,fontSize:w,fontFamily:C,fontWeight:D},U&&{width:U}),Y&&{height:Y}),G&&{minWidth:G}),X&&{maxWidth:X}),Z&&{minHeight:Z}),K&&{maxHeight:K}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"& .MuiOutlinedInput-input":{textAlign:S,paddingLeft:B,paddingTop:I,paddingRight:$,paddingBottom:W}}),pe={color:k,"&.Mui-focused":{color:k}},he=y?3:1;if(ne)return Me("div",p({style:{marginLeft:T,marginTop:N,marginRight:A,marginBottom:F}},{children:Me(QS,{name:Q,rules:ce,control:re,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return Me(bBt,p({masked:m,required:i,errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,inputSx:de,labelSx:pe,label:d,placeholder:h,multiline:y,minRows:he,value:r.value||"",onChange:r.onChange},ee||{}))}})}));var fe=e.useState(""),me=fe[0],ve=fe[1];return Me("div",p({style:{marginLeft:T,marginTop:N,marginRight:A,marginBottom:F}},{children:Me(bBt,p({masked:m,required:i,errorMsg:void 0,inputSx:de,labelSx:pe,label:d,placeholder:h,multiline:y,minRows:he,value:me,onChange:function(e){return ve(e.target.value)}},ee||{}))}))},_Bt=function(e){return{justifyContent:e.textAlign||"flex-start",backgroundColor:e.backgroundColor,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,paddingLeft:e.paddingLeft}},wBt=function(t){var r,n=t.popover,o=void 0===n||n,a=t.items,i=t.marginTop,s=void 0===i?"0":i,l=t.marginRight,c=void 0===l?"0":l,u=t.marginBottom,d=void 0===u?"0":u,h=t.marginLeft,f=void 0===h?"0":h,m=t.paddingTop,v=void 0===m?"0":m,y=t.paddingRight,g=void 0===y?"0":y,x=t.paddingBottom,b=void 0===x?"0":x,k=t.paddingLeft,_=void 0===k?"0":k,w=t.cornerRadius,M=void 0===w?"4px":w,C=t.backgroundColor,j=void 0===C?"#fff":C,D=t.width,O=void 0===D?"100%":D,S=t.height,P=void 0===S?"auto":S,T=t.borderColor,E=void 0===T?"#ccc":T,N=t.borderWeight,z=void 0===N?"1px":N,A=t.buttonText,R=void 0===A?"Open Menu":A,F=t.buttonVariant,L=void 0===F?"contained":F,B=t.buttonTextColor,V=t.buttonFontSize,I=t.buttonFontWeight,q=t.buttonFontFamily,$=t.buttonDisabled,H=void 0!==$&&$,W=t.buttonGap,U=void 0===W?0:W,Y=t.buttonStartIcon,Z=t.buttonEndIcon,K=t.buttonCornerRadius,G=void 0===K?"0":K,X=t.buttonMarginTop,Q=void 0===X?"0":X,J=t.buttonMarginRight,ee=void 0===J?"0":J,te=t.buttonMarginBottom,re=void 0===te?"0":te,ne=t.buttonMarginLeft,oe=void 0===ne?"0":ne,ae=t.buttonPaddingTop,ie=void 0===ae?"0":ae,se=t.buttonPaddingRight,le=void 0===se?"0":se,ce=t.buttonPaddingBottom,ue=void 0===ce?"0":ce,de=t.buttonPaddingLeft,pe=void 0===de?"0":de,he=t.buttonIconOnly,fe=t.buttonElevation,ve=t.buttonFillColor,ye=t.buttonFillColorDisabled,ge=t.buttonFillColorHover,xe=t.buttonFillColorPressed,be=t.buttonBorderColor,ke=t.buttonBorderColorDisabled,_e=t.buttonBorderColorHover,we=t.buttonBorderColorPressed,je=t.buttonTextColorDisabled,De=t.buttonTextColorHover,Oe=t.buttonTextColorPressed,Se=t.buttonColor,Pe=void 0===Se?"#1976d2":Se,Te=t.anchorOriginVertical,Ee=void 0===Te?"bottom":Te,Ne=t.anchorOriginHorizontal,ze=void 0===Ne?"left":Ne,Ae=t.transformOriginVertical,Re=void 0===Ae?"top":Ae,Fe=t.transformOriginHorizontal,Le=void 0===Fe?"left":Fe,Be=t.elevation,Ve=void 0===Be?3:Be,Ie=t.moleculeId,qe=t.configurationItemInfo,$e=me(),He=KBt(),We=He.isConfigurationMode,Ue=He.selectedConfigurationItemId,Ye=He.onConfigurationItemClicked,Ze=He.onInternalNavigation,Ke=e.useState(null),Ge=Ke[0],Xe=Ke[1],Qe=e.useState(!1),Je=Qe[0],et=Qe[1],tt=Boolean(We&&(Ue===Ie||a.some(function(e){return e.id===Ue}))),rt=function(){return et(!1)},nt=p({marginTop:s,marginRight:c,marginBottom:d,marginLeft:f,paddingTop:v,paddingRight:g,paddingBottom:b,paddingLeft:_},o?{display:"inline-block",zIndex:null===(r=null==$e?void 0:$e.zIndex)||void 0===r?void 0:r.drawer}:{width:O,height:P,backgroundColor:j,display:"block",overflow:"hidden",border:"".concat(z," solid ").concat(E),borderRadius:M});return o?Ce(jp,{children:[Me(L2e,{ref:Xe,text:R,variant:L,moleculeId:Ie,textColor:B,fontSize:V,fontWeight:I,fontFamily:q,disabled:H,gap:U,startIcon:Y,endIcon:Z,onClick:function(){return et(!0)},marginTop:Q,marginRight:ee,marginBottom:re,marginLeft:oe,paddingTop:ie,paddingRight:le,paddingBottom:ue,paddingLeft:pe,borderRadius:G,iconOnly:he,elevation:fe,fillColor:ve||Pe,fillColorDisabled:ye,fillColorHover:ge,fillColorPressed:xe,borderColor:be,borderColorDisabled:ke,borderColorHover:_e,borderColorPressed:we,textColorDisabled:je,textColorHover:De,textColorPressed:Oe,configurationItemInfo:qe}),Me(Pv,p({open:We?tt:Je,variant:"menu",anchorEl:Ge,disablePortal:!0,disableScrollLock:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,onClose:rt,anchorOrigin:{vertical:Ee,horizontal:ze},transformOrigin:{vertical:Re,horizontal:Le},elevation:Ve,slotProps:{paper:{sx:{backgroundColor:j}}},sx:nt},{children:a.map(function(e){var t=Ue===e.id,r={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},n=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!1)}:void 0,o=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!0)}:void 0,a=We?{onClick:n,onDoubleClick:o,"data-organism-id":e.id,css:n4e({theme:$e,selected:t})}:{};return Ce(Av,p({sx:_Bt(e),onClick:function(){var t,r;(null==e?void 0:e.link)&&(cot(e.link)?null==Ze||Ze(null===(t=e.link)||void 0===t?void 0:t.internalLink):lot(null===(r=e.link)||void 0===r?void 0:r.externalLink)),rt()},disabled:e.disabled},a,{children:[e.startIcon&&Me(N2e,{iconName:e.startIcon,color:e.textColor}),Me(qc,p({sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",width:"100%",textAlign:e.textAlign||"left"}},{children:e.text})),e.endIcon&&Me(N2e,{iconName:e.endIcon,color:e.textColor})]}),e.id)})}))]}):Me(zl,p({id:Ie,sx:nt,elevation:Ve},qe,{children:Me(Im,p({disablePadding:!0},{children:a.map(function(e){var t=Ue===e.id,r={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},n=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!1)}:void 0,o=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!0)}:void 0,a=We?{onClick:n,onDoubleClick:o,"data-organism-id":e.id,css:n4e({theme:$e,selected:t})}:{};return Ce(Ym,p({disabled:e.disabled,sx:_Bt(e),onClick:function(){var t,r;(null==e?void 0:e.link)&&(cot(e.link)?null==Ze||Ze(null===(t=e.link)||void 0===t?void 0:t.internalLink):lot(null===(r=e.link)||void 0===r?void 0:r.externalLink))}},a,{children:[e.startIcon&&Me(N2e,{iconName:e.startIcon,color:e.textColor}),Me(sv,{primary:Me(qc,p({sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",textAlign:e.textAlign||"left"}},{children:e.text}))}),e.endIcon&&Me(N2e,{iconName:e.endIcon,color:e.textColor})]}),e.id)})}))}))};var MBt=function(e){var t=e.errorMsg,r=e.stepValue,n=e.minValue,o=e.allowNegative,a=e.inputSx,i=e.labelSx,s=h(e,["errorMsg","stepValue","minValue","allowNegative","inputSx","labelSx"]);return Me(Qb,p({},s,{variant:"outlined",type:"number",error:!!t,helperText:t||null,inputProps:{step:r,min:o?void 0:n},slotProps:{input:{sx:a},inputLabel:{sx:i}}}))},CBt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"This field is required":s,c=t.validationErrorText,u=void 0===c?"Invalid numeric value":c,d=t.text,h=t.placeholderText,f=t.backgroundColor,m=t.borderColor,v=t.textColor,y=void 0===v?"#000":v,g=t.fontSize,x=t.fontFamily,b=t.fontWeight,k=t.allowNegative,_=void 0!==k&&k,w=t.numericPrecision,M=void 0===w?"1":w,C=t.name,j=t.sourceDataModelField,D=t.marginLeft,O=void 0===D?"0":D,S=t.marginTop,P=void 0===S?"0":S,T=t.marginRight,E=void 0===T?"0":T,N=t.marginBottom,z=void 0===N?"0":N,A=t.paddingLeft,R=void 0===A?"0":A,F=t.paddingTop,L=void 0===F?"0":F,B=t.paddingRight,V=void 0===B?"0":B,I=t.paddingBottom,q=void 0===I?"0":I,$=t.width,H=t.height,W=t.configurationItemInfo;t._textAlign;var U=t.minHeight,Y=t.maxHeight,Z=t.minWidth,K=t.maxWidth,G=WS(),X=null==G?void 0:G.control,Q=!(!X||!C),J=KBt().localStateObject,ee=JBt().stateConfig,te=J||ee,re=j?null===(r=null==te?void 0:te[j])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==re&&Q&&G.setValue(C,re)},[re]);var ne=e.useState(""),oe=ne[0],ae=ne[1],ie=parseFloat(M),se=_?void 0:0,le={required:!!i&&l,pattern:{value:_?/^-?\d*(\.\d+)?$/:/^\d*(\.\d+)?$/,message:u}};if(_||(le.min={value:0,message:"Value cannot be less than zero"}),o){var ce="",ue=(ce=Q?G.watch(C)||"":re)?function(e,t,r){if(!e)return"";var n=parseFloat(e);if(Number.isNaN(n))return e;if(!r&&n<0)return"0";if(t){var o=(t.split(".")[1]||"").length;if(o>0)return n.toFixed(o)}return e}(ce,M,_):h||"-";return Ce("div",p({style:p(p(p(p(p(p({display:"inline-flex",flexDirection:"column",marginLeft:O,marginTop:P,marginRight:E,marginBottom:z},$&&{width:$}),H&&{height:H}),Z&&{minWidth:Z}),K&&{maxWidth:K}),U&&{minHeight:U}),Y&&{maxHeight:Y})},W,{children:[d&&Me(nm,p({sx:{fontSize:g,fontFamily:x,fontWeight:b,color:y,marginBottom:"4px"}},{children:d})),Me(qc,p({sx:{fontSize:g,fontFamily:x,fontWeight:b,color:y,paddingLeft:R,paddingTop:L,paddingRight:V,paddingBottom:q,backgroundColor:f,border:"1px solid ".concat(m||"#ccc"),borderRadius:"4px",minWidth:"60px"}},{children:ue}))]}))}var de=p(p(p(p(p(p(p({backgroundColor:f,color:y,fontSize:g,fontFamily:x,fontWeight:b},$&&{width:$}),H&&{height:H}),Z&&{minWidth:Z}),K&&{maxWidth:K}),U&&{minHeight:U}),Y&&{maxHeight:Y}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"}}),pe={color:y,"&.Mui-focused":{color:y}};return Me(If,p({required:i,sx:{marginLeft:O,marginTop:P,marginRight:E,marginBottom:z,width:"fit-content"}},W,Q?{children:Me(QS,{name:C,rules:le,control:X,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return Me(MBt,{errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,label:d,placeholder:h,stepValue:ie,minValue:se,allowNegative:_,inputSx:de,labelSx:pe,value:r.value||"",onChange:function(e){return r.onChange(e.target.value)}})}})}:{children:Me(MBt,{errorMsg:void 0,label:d,placeholder:h,stepValue:ie,minValue:se,allowNegative:_,inputSx:de,labelSx:pe,value:oe,onChange:function(e){return ae(e.target.value)}})}))},jBt=["+"," ","(",/[0-9]/,/[0-9]/,/[0-9]/,")"," ",/[0-9]/,/[0-9]/,/[0-9]/,"-",/[0-9]/,/[0-9]/,/[0-9]/,/[0-9]/],DBt=e.forwardRef(function(e,t){var r=e.inputRef,n=h(e,["inputRef"]);return Me($k,p({},n,{ref:function(e){"function"==typeof r&&r(e?e.inputElement:null)},mask:jBt,guide:!0,placeholderChar:" "}))});var OBt,SBt,PBt,TBt,EBt,NBt,zBt,ABt,RBt,FBt,LBt,BBt,VBt=function(e){var t=e.masked,r=e.errorMsg,n=e.inputSx,o=e.labelSx,a=h(e,["masked","errorMsg","inputSx","labelSx"]);return Me(Qb,p({},a,{variant:"outlined",error:!!r,helperText:r||null,slotProps:{input:p({sx:n},t?{inputComponent:DBt}:{}),inputLabel:{sx:o}}}))},IBt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"Phone is required":s,c=t.validationErrorText,u=void 0===c?"Invalid phone number":c,d=t.text,h=t.placeholderText,f=t.masked,m=void 0===f||f;t.multiLine;var v=t.backgroundColor,y=t.borderColor,g=t.textColor,x=void 0===g?"#000":g,b=t.fontSize,k=t.fontFamily,_=t.fontWeight;t.textAlign;var w=t.marginLeft,M=void 0===w?"0":w,C=t.marginTop,j=void 0===C?"0":C,D=t.marginRight,O=void 0===D?"0":D,S=t.marginBottom,P=void 0===S?"0":S,T=t.paddingLeft,E=void 0===T?"0":T,N=t.paddingTop,z=void 0===N?"0":N,A=t.paddingRight,R=void 0===A?"0":A,F=t.paddingBottom,L=void 0===F?"0":F,B=t.width,V=t.height,I=t.minHeight,q=t.maxHeight,$=t.minWidth,H=t.maxWidth,W=t.name,U=t.sourceDataModelField,Y=t.configurationItemInfo,Z=WS(),K=null==Z?void 0:Z.control,G=!(!K||!W),X=KBt().localStateObject,Q=JBt().stateConfig,J=X||Q,ee=U?null===(r=null==J?void 0:J[U])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==ee&&G&&Z.setValue(W,ee)},[ee]);var te=e.useState(""),re=te[0],ne=te[1],oe={required:!!i&&l,pattern:{value:/^\d{10}$/,message:u}};if(o){var ae="";ae=G?Z.watch(W)||"":ee;var ie=m?function(e){var t=(null!=e?e:"").replace(/\D+/g,"");if(!t)return"";var r="",n=0;return D_.forEach(function(e){"string"==typeof e?r+=e:n<t.length?(r+=t[n],n+=1):r+="_"}),r}(ae):ae,se=ie||h||"-";return Ce("div",p({style:p(p(p(p(p(p({display:"inline-flex",flexDirection:"column",marginLeft:M,marginTop:j,marginRight:O,marginBottom:P},B&&{width:B}),V&&{height:V}),$&&{minWidth:$}),H&&{maxWidth:H}),I&&{minHeight:I}),q&&{maxHeight:q})},Y,{children:[d&&Me(nm,p({sx:{fontSize:b,fontFamily:k,fontWeight:_,color:x,marginLeft:0,marginBottom:"4px"}},{children:d})),Me(qc,p({sx:{fontSize:b,fontFamily:k,fontWeight:_,color:x,paddingLeft:E,paddingTop:z,paddingRight:R,paddingBottom:L,backgroundColor:v,border:"1px solid ".concat(y||"#ccc"),borderRadius:"4px",minWidth:"120px"}},{children:se}))]}))}var le=p(p(p(p(p(p(p({backgroundColor:v,color:x,fontSize:b,fontFamily:k,fontWeight:_},B&&{width:B}),V&&{height:V}),$&&{minWidth:$}),H&&{maxWidth:H}),I&&{minHeight:I}),q&&{maxHeight:q}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"}}),ce={color:x,"&.Mui-focused":{color:x}},ue={marginLeft:M,marginTop:j,marginRight:O,marginBottom:P,width:"fit-content"};return Me(If,p({required:i,sx:ue},Y,G?{children:Me(QS,{name:W,rules:oe,control:K,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return Me(VBt,{masked:m,errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,inputSx:le,labelSx:ce,label:d,placeholder:h,value:r.value||"",onChange:function(e){var t,n,o=(null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:"").toString().replace(/\D+/g,"");r.onChange(o)}})}})}:{children:Me(VBt,{masked:m,errorMsg:void 0,inputSx:le,labelSx:ce,label:d,placeholder:h,value:re,onChange:function(e){var t,r,n=(null!==(r=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==r?r:"").toString();ne(n.replace(/\D+/g,""))}})}))},qBt=function(t){var r=t.items,n=t.onTabChange,o=t.activeTabKey,a=t.isMobile,i=void 0!==a&&a,s=t.marginTop,l=t.marginRight,c=t.marginBottom,u=t.marginLeft,d=t.paddingTop,h=t.paddingRight,f=t.paddingBottom,m=t.paddingLeft,v=t.buttonPaddingTop,y=t.buttonPaddingRight,g=t.buttonPaddingBottom,x=t.buttonPaddingLeft,b=t.width,k=t.height,_=t.backgroundColor,w=t.borderRadius,M=t.elevation,C=void 0===M?1:M,j=t.gap,D=t.indicatorVisible,O=void 0===D||D,S=t.indicatorColor,P=t.lineWidth,T=void 0===P?"2px":P,E=t.orientation,N=void 0===E?"horizontal":E,z=t.activeTextColor,A=void 0===z?"#1976d2":z,R=t.inactiveTextColor,F=void 0===R?"#000":R,L=t.fontSize,B=t.fontWeight,V=t.fontFamily,I=t.wrapText,q=t.textAlign,$=t.iconName,H=t.iconColor,W=t.iconSize,U=t.iconPlacement,Y=void 0===U?"left":U,Z=t.hoverTextColor,K=t.itemBorder,G=t.itemBorderRadius,X=t.itemBackgroundColor,Q=t.itemSelectedBackgroundColor,J=t.itemHoverBackgroundColor,ee=t.selectedItemElevation,te=void 0===ee?0:ee,re=t.itemDisableRipple,ne=t.configurationItemInfo,oe=me(),ae=KBt(),ie=ae.isConfigurationMode,se=ae.onConfigurationItemClicked,le=ae.selectedConfigurationItemId,ce=e.useState(null),ue=ce[0],de=ce[1],pe=function(){return de(null)},he={marginTop:s,marginRight:l,marginBottom:c,marginLeft:u,paddingTop:d,paddingRight:h,paddingBottom:f,paddingLeft:m,width:b,height:k,backgroundColor:_,borderRadius:w,display:"flex",overflow:"visible !important"},fe=function(e){var t=e?A:F,r=e&&Q||X;return{color:t,fontSize:L,fontWeight:B,fontFamily:V,textAlign:q,whiteSpace:I?"normal":"nowrap",border:K,borderRadius:G,backgroundColor:r,boxShadow:e?oe.shadows[te]:void 0,paddingTop:v,paddingRight:y,paddingBottom:g,paddingLeft:x,"&:hover":{color:Z||t,backgroundColor:J||r}}},ve=function(e){null==n||n({newTabKey:e.tabKey,link:e.link})},ye=function(e){if(!ie)return{};var t=e.id===le,r={entityId:e.id,entity:"molecule_item",entityType:"tabs_item"};return{onClick:function(e){e.stopPropagation(),null==se||se(r,!1)},onDoubleClick:function(e){e.stopPropagation(),null==se||se(r,!0)},"data-organism-id":e.id,css:n4e({theme:oe,selected:t})}};if(i)return Ce(zl,p({elevation:C,style:he},ne,{children:[Me(_c,p({onClick:function(e){return de(e.currentTarget)}},{children:Me(N2e,{size:W,color:H,iconName:$})})),Me(Pv,p({anchorEl:ue,open:Boolean(ue),onClose:pe},{children:r.map(function(e){var t=e.tabKey===o,r=fe(t);return Ce(Av,p({onClick:function(){ve(e),pe()},sx:p(p({},r),{display:"flex",alignItems:"center"})},ye(e),{children:[e.iconName&&Me(N2e,{iconName:e.iconName,sx:{fontSize:L,color:t?A:F,mr:1}}),Me(jp,p({component:"span"},{children:e.label}))]}),e.id)})}))]}));var ge=r.findIndex(function(e){return e.tabKey===o});return Me(zl,p({elevation:C,style:he},ne,{children:Me(Ob,p({value:ge<0?0:ge,onChange:function(e,t){return ie?null:ve(r[t])},orientation:N,sx:{overflow:"visible","& .MuiTabs-flexContainer":{gap:j}},TabIndicatorProps:{style:O?{height:T,borderRadius:w,backgroundColor:S||A}:{display:"none"}}},{children:r.map(function(e){var t=e.tabKey===o,r=p(p({},fe(t)),{"&.Mui-selected":{color:t?A:F}});return Me(ob,p({label:e.label,disableRipple:re,sx:p(p({},r),{textTransform:"none"}),onClick:function(){return ve(e)},iconPosition:"right"===Y?"end":"start",icon:e.iconName?Me(N2e,{iconName:e.iconName,sx:{fontSize:L,color:t?A:F}}):void 0},ye(e)),e.id)})}))}))},$Bt=function(t){var r,n,o,a=t.id,i=t.type,s=t.name,l=t.form,c=t.config;t.formData;var u=t.isMobile,d=t.children,v=t.tabsProps,y=t.properties,g=t.organismLibraryMoleculeId,x=me(),b=u||ok("xs"),k=KBt(),_=k.formId,w=k.isPreview,M=void 0!==w&&w,C=k.validations,j=k.submitHandler,D=k.isConfigurationMode,O=k.onConfigurationItemClicked,S=k.selectedConfigurationItemId,P=k.currentStyleProperties,T=k.currentContentProperties,E=k.onInternalNavigation,N=KBt().localStateObject,z=JBt().stateConfig,A=N||z,R=(null===(r=null==c?void 0:c.props)||void 0===r?void 0:r.dataCaptureName)||(null===(n=null==y?void 0:y.dataCapture)||void 0===n?void 0:n.dataCaptureName)||a,F=null===(o=null==y?void 0:y.dataCapture)||void 0===o?void 0:o.sourceDataModelFieldId,L=S===a,B=ZBt(),V=B.setActivePopUpById,I=B.setDrawerVisible,q=B.onCloseModal,$=B.onCloseDrawer,H=function(e){var t=e.stateListenerId,r=KBt().localStateObject,n=JBt().stateConfig,o=r||n,a=!0,i=!1;if(!t)return{isStateDisabled:i,isStateVisible:a};var s=(null==o?void 0:o[t])||{},l=s||{},c=l.visible,u=void 0===c||c,d=l.disabled,p=void 0!==d&&d;return t in o&&(a=Boolean(u),i=Boolean(p)),{isStateDisabled:i,isStateVisible:a,stateValue:s}}({stateListenerId:a}),W=H.isStateDisabled,U=H.isStateVisible,Y=e.useMemo(function(){return{entityType:i,entity:"molecule",entityName:s,entityId:a,organismLibraryMoleculeId:g}},[i,s,a,g]),Z=e.useCallback(function(e){null==e||e.stopPropagation(),O(Y,!1)},[O,Y]),K=e.useCallback(function(e){null==e||e.stopPropagation(),O(Y,!0)},[O,Y]),G=D?{onClick:Z,onDoubleClick:K,"data-configuration-id":a,css:n4e({theme:x,selected:L})}:{},X=D||W;if(!U)return null;return function(){var e,t,r,n,o,s,u,g,x;switch(i){case"simple_text":var k=Aat(O={text:null==y?void 0:y.text},T,N=["text"],L).text,w=Rat(null==c?void 0:c.props,P,L);return Me(tot,p({},w,{text:(null==k?void 0:k.text)||"",htmlElementId:a,configurationsItemInfo:G}));case"text":var O={text:null==y?void 0:y.text},N=Object.keys(O);k=Aat(O,T,N,L).text,w=Rat(null==c?void 0:c.props,P,L);return Me(eot,p({},k,w,{htmlElementId:a,configurationItemInfo:G}));case"consent":var z=Aat(y,T,[],L);w=Rat(null==c?void 0:c.props,P,L)||{};return Me(s4e,p({},w,{htmlElementId:a,properties:z,configurationItemInfo:G}));case"signup_password_fields":O={text:null==y?void 0:y.text,subText:null==y?void 0:y.subText,placeholderText:null==y?void 0:y.placeholderText,subPlaceholderText:null==y?void 0:y.subPlaceholderText,validationText:null==y?void 0:y.validationText},N=Object.keys(O);var B=Aat(O,T,N,L),H=Rat(null==c?void 0:c.props,P,L),U=H.state,Y=H.gap,Z=h(H,["state","gap"]);return Me(Mot,{gap:Y,inputProps:Z,validations:C||[],htmlElementId:a,validationState:U,overridesProperties:B,configurationItemInfo:G});case"stepper":var K=Rat(null==c?void 0:c.props,P,L),Q=null==d?void 0:d.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a=h(r,["properties","config"]),i={title:null==n?void 0:n.title,subText:null==n?void 0:n.subText},s=Object.keys(i),l=Aat(i,T,s,t),c=l.title,u=l.subText,d=Rat(null==o?void 0:o.props,P,t);return p(p(p({},a),d),{title:(null==c?void 0:c.text)||"",subText:(null==u?void 0:u.text)||""})});return Me(tat,p({},K,{items:Q||[],isMobile:b,moleculeId:a,configurationItemInfo:G}));case"checklist":var J=Rat(null==c?void 0:c.props,P,L)||{},ee=null==d?void 0:d.map(function(e){var t,r,n,o,a,i=S===e.id,s=e||{},l=s.properties,c=s.config,u=h(s,["properties","config"]);switch(e.type){case"checklist_item":var d={label:null==l?void 0:l.label,objectState:null==l?void 0:l.objectState},f=Object.keys(d),m=Aat(d,T,f,i),v=Rat(null==c?void 0:c.props,P,i)||{},y=(null===(t=m.label)||void 0===t?void 0:t.text)||"",g=!!(null===(r=m.objectState)||void 0===r?void 0:r.pmiObjectId);return p(p(p({},u),v),{type:"checklist_item",label:y,textColor:v.textColor||"#000",fontSize:v.fontSize||"14px",fontFamily:v.fontFamily||"inherit",fontWeight:v.fontWeight||"normal",textAlign:v.textAlign||"left",isSystemDriven:g,disabled:g,interacted:(null===(n=null==A?void 0:A[e.id])||void 0===n?void 0:n.interacted)||"unchecked"});case"divider_item":v=Rat(null==c?void 0:c.props,P,i)||{};return p(p(p({},u),v),{type:"divider_item"});case"text_item":d={text:null==l?void 0:l.text},f=Object.keys(d),m=Aat(d,T,f,i),v=Rat(null==c?void 0:c.props,P,i)||{};var x=(null===(o=m.text)||void 0===o?void 0:o.text)||"";return p(p(p({},u),v),{type:"text_item",text:x});case"rich_text_item":d={text:null==l?void 0:l.text},f=Object.keys(d),m=Aat(d,T,f,i),v=Rat(null==c?void 0:c.props,P,i)||{},x=(null===(a=m.text)||void 0===a?void 0:a.text)||xVt;return p(p(p({},u),v),{type:"rich_text_item",text:x});default:return p(p({},u),{type:e.type})}});return Me(a4e,p({},J,{items:ee||[],moleculeId:a,configurationItemInfo:G}));case"accordion":var te=Rat(null==c?void 0:c.props,P,L);ee=null==d?void 0:d.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a=h(r,["properties","config"]),i={text:null==n?void 0:n.text,subText:null==n?void 0:n.subText,bodyText:null==n?void 0:n.bodyText},s=Object.keys(i),l=Aat(i,T,s,t),c=l.text,u=l.subText,d=l.bodyText,f=Rat(null==o?void 0:o.props,P,t);return p(p(p({},a),f),{text:(null==c?void 0:c.text)||"",subText:(null==u?void 0:u.text)||"",bodyText:(null==d?void 0:d.text)||""})});return Me(Fat,p({},te,{items:ee||[],moleculeId:a,configurationItemInfo:G}));case"menu":O={text:null==y?void 0:y.text,disabled:null==y?void 0:y.disabled},N=Object.keys(O);var re=Aat(O,T,N,L),ne=re.text,oe=re.disabled,ae=Rat(null==c?void 0:c.props,P,L);ee=null==d?void 0:d.map(function(e){var t,r=S===e.id,n=e||{},o=n.properties,a=n.config,i=h(n,["properties","config"]),s={disabled:o&&"disabled"in o?o.disabled:void 0,text:o&&"text"in o?o.text:void 0,link:o&&"link"in o?o.link:void 0},l=Object.keys(s),c=Aat(s,T,l,r),u=c.text,d=c.disabled,f=c.link,m=Rat(null==a?void 0:a.props,P,r);return p(p(p({},i),m),{disabled:(null==A?void 0:A[e.id])?null===(t=null==A?void 0:A[e.id])||void 0===t?void 0:t.disabled:(null==d?void 0:d.value)||(null==m?void 0:m.disabled)||!1,text:(null==u?void 0:u.text)||"Menu Item",link:f})});return Me(wBt,p({},ae,{items:ee||[],moleculeId:a,buttonText:(null==ne?void 0:ne.text)||"Open Menu",configurationItemInfo:G,buttonDisabled:(null==A?void 0:A[a])?null===(e=null==A?void 0:A[a])||void 0===e?void 0:e.disabled:(null==oe?void 0:oe.value)||(null==ae?void 0:ae.disabled)||!1}));case"tabs":w=Rat(null==c?void 0:c.props,P,L);var ie=null==d?void 0:d.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a={label:null==n?void 0:n.label,link:null==n?void 0:n.link},i=Object.keys(a),s=Aat(a,T,i,t),l=s.label,c=s.link,u=Rat(null==o?void 0:o.props,P,t);return p(p({},u),{id:e.id,tabKey:cot(c)?sot(rot,null==c?void 0:c.internalLink):void 0,label:(null==l?void 0:l.text)||"",link:c})}),se=null==v?void 0:v.tabs.map(function(e){var t=e.text,r=h(e,["text"]);return p(p({},r),{label:t||""})}),le=Boolean(null==w?void 0:w.isTabsSystemDerived),ce=le?se:ie,ue=(null==v?void 0:v.activeTabKey)||(null===(t=null==ce?void 0:ce[0])||void 0===t?void 0:t.tabKey)||"";return Me(qBt,p({},w,{items:ce||[],isMobile:b,moleculeId:a,activeTabKey:ue,configurationItemInfo:G,onTabChange:D?void 0:function(e){var t,r=e.newTabKey,n=e.link;le?null===(t=null==v?void 0:v.onTabChange)||void 0===t||t.call(v,r):cot(n)?null==E||E((null==n?void 0:n.internalLink)||""):lot(null==n?void 0:n.externalLink)}}));case"divider":w=Rat(null==c?void 0:c.props,P,L);return Me(Xnt,p({moleculeId:a,configurationItemInfo:G},w));case"link":O={text:null==y?void 0:y.text,link:null==y?void 0:y.link},N=Object.keys(O);var de=Aat(O,T,N,L),pe=(k=de.text,de.link);w=Rat(null==c?void 0:c.props,P,L);return Me(bot,p({moleculeId:a},w,{type:null==pe?void 0:pe.type,src:X?void 0:dot(pe,M)||"",text:(null==k?void 0:k.text)||"",disabled:(null==w?void 0:w.disabled)||W,configurationItemInfo:G}));case"video":O={video:null==y?void 0:y.video,coverImage:null==y?void 0:y.coverImage},N=Object.keys(O);var he=Aat(O,T,N,L),fe=he.video,me=he.coverImage;w=Rat(null==c?void 0:c.props,P,L);return Me(iat,p({},w,{moleculeId:a,poster:null===(r=null==me?void 0:me.imageFile)||void 0===r?void 0:r.url,src:null!==(s=null!==(n=null==fe?void 0:fe.videoSource)&&void 0!==n?n:null===(o=null==fe?void 0:fe.videoFile)||void 0===o?void 0:o.url)&&void 0!==s?s:"",configurationItemInfo:G}));case"badge":w=Rat(null==c?void 0:c.props,P,L);return Me(A2e,p({},w,{configurationItemInfo:G}));case"alert":O={text:null==y?void 0:y.text,subText:null==y?void 0:y.subText},N=Object.keys(O);var ve=Aat(O,T,N,L),ye=(k=ve.text,ve.subText);w=Rat(null==c?void 0:c.props,P,L);return Me(z2e,p({text:(null==k?void 0:k.text)||"",subText:(null==ye?void 0:ye.text)||""},w,{configurationItemInfo:G}));case"chip":O={text:null==y?void 0:y.text},N=Object.keys(O),k=Aat(O,T,N,L).text,w=Rat(null==c?void 0:c.props,P,L);return Me(i4e,p({text:(null==k?void 0:k.text)||""},w,{configurationItemInfo:G}));case"email_display_field":case"email_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var ge=Aat(O,T,N,L),xe=(k=ge.text,ge.placeholderText),be=ge.required,ke=ge.requiredErrorText,_e=ge.validationErrorText;w=Rat(null==c?void 0:c.props,P,L);return Me(kBt,p({name:R,text:(null==k?void 0:k.text)||"",placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F,required:null==be?void 0:be.value,isDisplayOnly:"email_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text},w,{configurationItemInfo:G}));case"phone_number_display_field":case"phone_number_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Ce=Aat(O,T,N,L);k=Ce.text,xe=Ce.placeholderText,be=Ce.required,ke=Ce.requiredErrorText,_e=Ce.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(IBt,p({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F,isDisplayOnly:"phone_number_display_field"===i},w,{configurationItemInfo:G}));case"numeric_display_field":case"numeric_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var je=Aat(O,T,N,L);k=je.text,xe=je.placeholderText,be=je.required,ke=je.requiredErrorText,_e=je.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(CBt,p({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"numeric_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F},w,{configurationItemInfo:G}));case"currency_display_field":case"currency_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var De=Aat(O,T,N,L);k=De.text,xe=De.placeholderText,be=De.required,ke=De.requiredErrorText,_e=De.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(gBt,p({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"currency_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F},w,{configurationItemInfo:G}));case"basic_text_display_field":case"basic_text_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Oe=Aat(O,T,N,L);k=Oe.text,xe=Oe.placeholderText,be=Oe.required,ke=Oe.requiredErrorText,_e=Oe.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(F2e,p({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"basic_text_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F},w,{configurationItemInfo:G}));case"rating_display_field":case"rating":O={text:null==y?void 0:y.text,dataCapture:null==y?void 0:y.dataCapture,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Se=Aat(O,T,N,L);k=Se.text,be=Se.required,ke=Se.requiredErrorText,_e=Se.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(qot,p({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F,isDisplayOnly:"rating_display_field"===i},w,{configurationItemInfo:G}));case"switch_display_field":case"switch":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Pe=Aat(O,T,N,L);k=Pe.text,be=Pe.required,ke=Pe.requiredErrorText,_e=Pe.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(nat,p({name:R,moleculeId:a,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"switch_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F},w,{configurationItemInfo:G}));case"slider_display_field":case"slider":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,placeholderText:null==y?void 0:y.placeholderText,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Te=Aat(O,T,N,L);k=Te.text,be=Te.required,ke=Te.requiredErrorText,_e=Te.validationErrorText,xe=Te.placeholderText,w=Rat(null==c?void 0:c.props,P,L);return Me(eat,p({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"slider_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:null==xe?void 0:xe.text,sourceDataModelField:F},w,{configurationItemInfo:G}));case"date_display_field":case"date_picker":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,placeholderText:null==y?void 0:y.placeholderText,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Ee=Aat(O,T,N,L);k=Ee.text,be=Ee.required,xe=Ee.placeholderText,ke=Ee.requiredErrorText,_e=Ee.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(W4e,p({dateAdapter:jat},{children:Me(Gnt,p({moleculeId:a,name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,placeholderText:(null==xe?void 0:xe.text)||"",isDisplayOnly:"date_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F},w,{configurationItemInfo:G}))}));case"time_picker_display":case"time_picker":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText,required:null==y?void 0:y.required},N=Object.keys(O);var Ne=Aat(O,T,N,L),ze=(k=Ne.text,xe=Ne.placeholderText,ke=Ne.requiredErrorText,_e=Ne.validationErrorText,be=Ne.required,Rat(null==c?void 0:c.props,P,L));return Me(W4e,p({dateAdapter:jat},{children:Me(aat,p({},ze,{name:R,text:(null==k?void 0:k.text)||"",placeholderText:(null==xe?void 0:xe.text)||"",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,isDisplayOnly:"time_picker_display"===i,sourceDataModelField:F,configurationItemInfo:G}))}));case"select_display_field":case"select":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,placeholderText:null==y?void 0:y.placeholderText,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Ae=Aat(O,T,N,L);k=Ae.text,be=Ae.required,xe=Ae.placeholderText,ke=Ae.requiredErrorText,_e=Ae.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(Hot,p({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"select_display_field"===i,placeholderText:(null==xe?void 0:xe.text)||"",requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F},w,{configurationItemInfo:G}));case"image":O={image:null==y?void 0:y.image,link:null==y?void 0:y.link},N=Object.keys(O);var Re=Aat(O,T,N,L),Fe=Re.image,Le=Re.link,Be=(w=Rat(null==c?void 0:c.props,P,L),(null==Fe?void 0:Fe.imageSource)||(null===(u=null==Fe?void 0:Fe.imageFile)||void 0===u?void 0:u.url)||"");return Me(Qnt,p({},w,{src:Be,onClick:function(){return cot(Le)?null==E?void 0:E((null==Le?void 0:Le.internalLink)||""):lot(null==Le?void 0:Le.externalLink)},moleculeId:a,configurationItemInfo:G}));case"button":O={text:null==y?void 0:y.text,action:null==y?void 0:y.action},N=Object.keys(O);var Ve=Aat(O,T,N,L),Ie=(k=Ve.text,Ve.action),qe=(w=Rat(null==c?void 0:c.props,P,L),(null==Ie?void 0:Ie.action)||{}),$e=qe.link,He=qe.popup,We=qe.download,Ue=qe.submit,Ye={link:function(){return cot($e)?E(null==$e?void 0:$e.internalLink):lot(null==$e?void 0:$e.externalLink)},popup:function(){(null==He?void 0:He.id)&&V(null==He?void 0:He.id)},drawer:function(){I(!0)},download:function(){return We?function(e,t){return void 0===e&&(e=""),void 0===t&&(t="Downloaded file"),f(void 0,void 0,void 0,function(){var r,n,o,a;return m(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,fetch(e)];case 1:return[4,i.sent().blob()];case 2:return r=i.sent(),n=URL.createObjectURL(r),(o=document.createElement("a")).href=n,o.download=t,o.click(),URL.revokeObjectURL(n),[3,4];case 3:return a=i.sent(),gqt({message:"Failed to download the file: ".concat(a),type:"error"}),[3,4];case 4:return[2]}})})}(We.url,We.name):gqt({message:"File not found to download",type:"warning"})},submit:null==l?void 0:l.handleSubmit(function(e){return f(void 0,void 0,void 0,function(){var t,r,n,o;return m(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),_?[4,null==j?void 0:j({formId:_,data:e})]:[3,2];case 1:a.sent(),(t=null===(n=null==Ue?void 0:Ue.onSuccess)||void 0===n?void 0:n.link)&&(cot(t)?null==E||E(t.internalLink||""):lot(t.externalLink)),l.reset(),a.label=2;case 2:return[3,4];case 3:return a.sent(),(r=null===(o=null==Ue?void 0:Ue.onError)||void 0===o?void 0:o.link)&&(cot(r)?null==E||E(r.internalLink||""):lot(r.externalLink)),[3,4];case 4:return[2]}})})}),reset:function(){return null==l?void 0:l.reset()},destroy:function(){null==l||l.reset(),null==q||q(),null==$||$()}};return Me(L2e,p({moleculeId:a,text:(null==k?void 0:k.text)||""},w,{disabled:(null==w?void 0:w.disabled)||W,onClick:null==Ye?void 0:Ye[(null===(g=null==Ie?void 0:Ie.action)||void 0===g?void 0:g.type)||"link"],configurationItemInfo:G}));case"avatar":w=Rat(null==c?void 0:c.props,P,L);return Me(Lat,p({},w,{sourceDataModelField:F,configurationItemInfo:G}));case"calendar":w=Rat(null==c?void 0:c.props,P,L);return Me(mBt,p({},w,{configurationItemInfo:G}));case"drawer":O={text:null==y?void 0:y.text,disabled:null==y?void 0:y.disabled},N=Object.keys(O);var Ze=Aat(O,T,N,L),Ke=Ze.text,Ge=Ze.disabled,Xe=Rat(null==c?void 0:c.props,P,L);ee=null==d?void 0:d.map(function(e){var t,r,n,o,a,i,s,l,c,u=S===e.id,d=e||{},f=d.properties,m=d.config,v=h(d,["properties","config"]),y={},g=[];switch(e.type){case"menu_item":var x=f;y={disabled:null==x?void 0:x.disabled,text:null==x?void 0:x.text,link:null==x?void 0:x.link},g=Object.keys(y);break;case"text_item":var b=f;y={text:null==b?void 0:b.text},g=Object.keys(y);break;case"rich_text_item":var k=f;y={text:null==k?void 0:k.text},g=Object.keys(y);break;case"image_item":var _=f;y={image:null==_?void 0:_.image,alt:null==_?void 0:_.alt,link:null==_?void 0:_.link},g=Object.keys(y);break;default:y={},g=[]}var w=Aat(y,T,g,u),M=Rat(null==m?void 0:m.props,P,u),C=p(p({},v),M);switch(e.type){case"menu_item":return p(p({},C),{disabled:(null==A?void 0:A[e.id])?null===(t=null==A?void 0:A[e.id])||void 0===t?void 0:t.disabled:(null===(r=null==w?void 0:w.disabled)||void 0===r?void 0:r.value)||(null==M?void 0:M.disabled)||!1,text:(null===(n=null==w?void 0:w.text)||void 0===n?void 0:n.text)||"Menu Item",link:null==w?void 0:w.link});case"text_item":return p(p({},C),{text:(null===(o=null==w?void 0:w.text)||void 0===o?void 0:o.text)||""});case"rich_text_item":return p(p({},C),{text:(null===(a=null==w?void 0:w.text)||void 0===a?void 0:a.text)||xVt});case"image_item":var j=(null===(i=null==w?void 0:w.image)||void 0===i?void 0:i.imageSource)||(null===(l=null===(s=null==w?void 0:w.image)||void 0===s?void 0:s.imageFile)||void 0===l?void 0:l.url)||"";return p(p({},C),{src:j,alt:(null===(c=null==w?void 0:w.alt)||void 0===c?void 0:c.text)||"Drawer image",link:null==w?void 0:w.link});default:return C}});return Me(xot,p({},Xe,{items:ee||[],moleculeId:a,buttonText:(null==Ke?void 0:Ke.text)||(null==Xe?void 0:Xe.buttonText),buttonDisabled:(null==A?void 0:A[a])?null===(x=null==A?void 0:A[a])||void 0===x?void 0:x.disabled:(null==Ge?void 0:Ge.value)||(null==Xe?void 0:Xe.disabled)||!1,configurationItemInfo:G}));case"speed_dial":var Qe=Rat(null==c?void 0:c.props,P,L);ee=null==d?void 0:d.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a=h(r,["properties","config"]),i={link:null==n?void 0:n.link,text:null==n?void 0:n.text},s=Object.keys(i),l=Aat(i,T,s,t),c=Rat(null==o?void 0:o.props,P,t);return p(p({},a),{config:{props:p(p(p({},null==o?void 0:o.props),c),{tooltipText:(null==c?void 0:c.tooltipText)||""})},properties:{link:(null==l?void 0:l.link)||(null==n?void 0:n.link),text:(null==l?void 0:l.text)||(null==n?void 0:n.text)}})});return Me(yat,p({},Qe,{items:ee||[],moleculeId:a,configurationItemInfo:G}));case"checkbox":case"checkbox_display":O={label:null==y?void 0:y.label,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Je=Aat(O,T,N,L),et=Je.label;be=Je.required,ke=Je.requiredErrorText,_e=Je.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(hat,p({name:R,moleculeId:a,label:(null==et?void 0:et.text)||"",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F,isDisplayOnly:"checkbox_display"===i},w,{configurationItemInfo:G}));case"binary_radio_buttons":case"binary_radio_buttons_display":O={confirmText:null==y?void 0:y.confirmText,rejectText:null==y?void 0:y.rejectText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var tt=Aat(O,T,N,L),rt=tt.confirmText,nt=tt.rejectText;be=tt.required,ke=tt.requiredErrorText,_e=tt.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(pat,p({name:R,moleculeId:a,confirmText:(null==rt?void 0:rt.text)||"Yes",rejectText:(null==nt?void 0:nt.text)||"No",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F,isDisplayOnly:"binary_radio_buttons_display"===i},w,{configurationItemInfo:G}));default:return Me(we,{children:"There is no such type of molecule yet."})}}()},HBt=function(t){var r=t.item,n=t.activeChildrenIds,o=e.useState(),a=o[0],i=o[1],s=e.useMemo(function(){return n.map(function(e){var t=r.items.find(function(t){return t.id===e});return t?function(e){var t,r,n,o=(null===(r=null===(t=e.config)||void 0===t?void 0:t.props)||void 0===r?void 0:r.formStepProps)||{};return p(p({},e),{config:p(p({},e.config),{props:p(p({},null===(n=e.config)||void 0===n?void 0:n.props),{formStepProps:p(p({},o),{order:0})})})})}(t):void 0}).filter(Boolean)},[n,r]);return e.useEffect(function(){i(function(){return p(p({},r),{items:s})})},[r]),a},WBt=function(t){var r=t.config,n=t.tabsProps,o=t.id,a=t.type,i=t.items,s=t.metadata,l=t.formData,c=t.setFormData,u=t.isMobile,d=t.properties,h=t.isConfigurationMode,f=void 0!==h&&h,m=e.useState(),v=m[0],y=m[1];if(!i||!i.length)return null;var g=u||ok("xs");return Me(XBt,p({userInitials:"UN",logOutHandler:function(){return console.log("log out")},goToAccountInfo:function(){return console.log("account info page")}},{children:Me(dS,p({organismMetadata:s,organismId:o,initItems:i,organismBodyId:o,submitHandler:function(e){return new Promise(function(t){setTimeout(function(){t(alert(JSON.stringify(e,null,2)))},600)})},formId:o,isConfigurationMode:f,onConfigurationItemHandler:function(e){y(null==e?void 0:e.entityId)},selectedConfigurationItemId:v},{children:Me(YBt,{item:{id:o,type:a,items:i,config:r,metadata:s,properties:d,instance:"container"},formData:l,tabsProps:n,isMobile:g,setFormData:c})}))}),"".concat(o,".").concat(g?"mobile":"desktop"))},UBt=function(e){var t=e.formData,r=e.setFormData,n=e.isMobile,o=h(e,["formData","setFormData","isMobile"]),a=HBt(o);return a?Me(WBt,p({},a,{isMobile:n,formData:t,setFormData:r})):null},YBt=e.memo(function(t){var r,n=t.item,o=t.tabsProps,a=t.formData,i=t.setFormData,s=t.isMobile,l=t.parentId,c=WS(),u=JBt().stateConfig,d=KBt(),h=d.organismMetadata,f=d.localStateObject||u;if("molecule"===n.instance)return Me(LP,p({additionalInfo:"molecule: ".concat(n.id)},{children:Me($Bt,p({},n,{form:c,isMobile:s,formData:a,parentId:l,tabsProps:o,setFormData:i,metadata:p(p({},n.metadata),{stateListenerId:(null==h?void 0:h.stateListenerId)||n.id})}))}));if(!n.items||!n.items.length)return null;var m="form"===n.type&&(null===(r=n.config.props)||void 0===r?void 0:r.activeChildrenIds)||[];if(m.length)return Me(LP,p({additionalInfo:"form: ".concat(n.id)},{children:Me(UBt,{item:n,activeChildrenIds:m,formData:a,setFormData:i,isMobile:s})}));var v=e.useMemo(function(){var e;return null===(e=n.items)||void 0===e?void 0:e.filter(function(e){var t,r,n,o,a,i=null===(n=null===(r=null===(t=e.config)||void 0===t?void 0:t.props)||void 0===r?void 0:r.visible)||void 0===n||n,s=null===(a=null===(o=null==f?void 0:f[e.id])||void 0===o?void 0:o.visible)||void 0===a||a;return i&&s})},[n.items,f]);return Me(LP,p({additionalInfo:"container: ".concat(n.id)},{children:Me(bat,p({},n,{isMobile:s,config:n.config?p(p({},n.config),{props:n.config.props||{},wide:n.config.wide||{},compact:n.config.compact||{}}):{props:{},wide:{},compact:{}}},{children:null==v?void 0:v.map(function(e){return Me(YBt,{item:e,parentId:e.id,formData:a,setFormData:i,isMobile:s,tabsProps:o},e.id)})}))}))}),ZBt=function(){return e.useContext(lS)},KBt=function(){return e.useContext(cS)},GBt=e.createContext({userInitials:"",logOutHandler:function(){return null},goToAccountInfo:function(){return null},username:""}),XBt=function(t){var r=t.children,n=t.goToAccountInfo,o=t.userInitials,a=t.logOutHandler,i=t.username,s=e.useMemo(function(){return{logOutHandler:a,goToAccountInfo:n,userInitials:o,username:i}},[a,n,o,i]);return Me(GBt.Provider,p({value:s},{children:r}))},QBt=e.createContext({stateConfig:{},stateHandler:function(){return null},authenticated:!1}),JBt=function(){return e.useContext(QBt)},eVt=function(){return e.useContext(GN)},tVt={pickList:{get:function(e){return f(void 0,void 0,void 0,function(){return m(this,function(e){return[2,{data:[]}]})})}},calendar:{createEvent:function(){return f(void 0,void 0,void 0,function(){return m(this,function(e){return[2]})})},updateEvent:function(){return f(void 0,void 0,void 0,function(){return m(this,function(e){return[2]})})},deleteEvent:function(){return f(void 0,void 0,void 0,function(){return m(this,function(e){return[2]})})},getEvents:function(){return f(void 0,void 0,void 0,function(){return m(this,function(e){return[2,[]]})})}}},rVt=e.createContext(tVt),nVt=function(){var t=e.useContext(rVt);if(!t)throw new Error("useApi must be used within ApiProvider");return t},oVt=function(e,t){var r=e.replace(/\D+/g,"");if(!r)return"";var n="",o=0;return t.reduce(function(e,t){return"string"==typeof t?n+=t:o<r.length&&(n+=r[o],o+=1),e},""),n},aVt=function(e,t){try{var r=new Date(e);if(Number.isNaN(r.getTime()))return e;var n=void 0,o=void 0,a=void 0;switch("string"==typeof e&&(e.endsWith("Z")||e.includes("+")||e.includes("T"))?(n=String(r.getUTCMonth()+1).padStart(2,"0"),o=String(r.getUTCDate()).padStart(2,"0"),a=r.getUTCFullYear()):(n=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0"),a=r.getFullYear()),t){case"DD/MM/YYYY":return"".concat(o,"/").concat(n,"/").concat(a);case"MM/YYYY":return"".concat(n,"/").concat(a);case"YYYY/MM/DD":return"".concat(a,"/").concat(n,"/").concat(o);default:return"".concat(n,"/").concat(o,"/").concat(a)}}catch(t){return e}},iVt=function(e){var t,r=e.variable,n=e.stateObject;e.children;var o,a=(null==r?void 0:r.dataModelField)||{},i=a.defaultValue,s=a.dataModelFieldId,l=a.pmiObjectName,c=a.dataFieldName,u=a.dataType,d=a.format,p="[".concat(l," - ").concat(c,"]");if(!n||!s)return Me(we,{children:p});try{o=null===(t=null==n?void 0:n[s])||void 0===t?void 0:t.value}catch(e){o=null}if(!o&&0!==o)return Me(we,{children:i||p});var h=String(o);if("date"===u){var f="MM/DD/YYYY";switch(d){case"day_month_year_date":f="DD/MM/YYYY";break;case"month_day_year_date":default:f="MM/DD/YYYY";break;case"year_month_day_date":f="YYYY/MM/DD";break;case"month_year_date":f="MM/YYYY"}h=aVt(h,f)}else if(d)switch(d){case"phone_number":h=oVt(h,D_);break;case"us_zip_code":case"zip_code":h=oVt(h,__);break;case"day_month_year_date":h=aVt(h,"DD/MM/YYYY");break;case"month_day_year_date":h=aVt(h,"MM/DD/YYYY");break;case"year_month_day_date":h=aVt(h,"YYYY/MM/DD");break;case"month_year_date":h=aVt(h,"MM/YYYY");break;case"numeric":var m=Number(o);h=Number.isNaN(m)?String(o):String(m);break;case"integer":var v=Number(o);h=Number.isNaN(v)?String(o):String(Math.floor(v));break;case"email":case"text":case"string":case"any":default:h=String(o);break;case"password":h="*".repeat(String(o).length)}return Me(we,{children:h})},sVt=function(t){var r,n,o,a,i,s,l,c,u,d=t.attributes,h=t.children,f=t.element,m=e.useContext(lO),v=e.useContext(GO),y=KBt().localStateObject,g=JBt().stateConfig,x=y||g,b={padding:"1px 3px",margin:"0 1px",verticalAlign:"baseline",display:"inline-block",borderRadius:"3px",backgroundColor:"#f0f0f0",border:"1px solid #ddd",fontSize:"0.95em",boxShadow:m&&v?"0 0 0 2px #B4D5FF":"none"};(null===(r=f.children[0])||void 0===r?void 0:r.bold)&&(b.fontWeight="bold"),(null===(n=f.children[0])||void 0===n?void 0:n.italic)&&(b.fontStyle="italic"),(null===(o=f.children[0])||void 0===o?void 0:o.color)&&(b.color=f.children[0].color),(null===(a=f.children[0])||void 0===a?void 0:a.fontSize)&&(b.fontSize=f.children[0].fontSize),(null===(i=f.children[0])||void 0===i?void 0:i.fontFamily)&&(b.fontFamily=f.children[0].fontFamily),(null===(s=f.children[0])||void 0===s?void 0:s.letterSpacing)&&(b.letterSpacing=f.children[0].letterSpacing),(null===(l=f.children[0])||void 0===l?void 0:l.lineHeight)&&(b.lineHeight=f.children[0].lineHeight);var k=Me(iVt,p({variable:f.variablePayload,stateObject:x,leaf:{text:""}},{children:h}));return Ce("span",p({},d,{contentEditable:!1,style:b},{children:[Me("div",p({contentEditable:!1},{children:Ce(e.Fragment,{children:["[",(null===(c=f.children[0])||void 0===c?void 0:c.underline)?Me("u",{children:k}):(null===(u=f.children[0])||void 0===u?void 0:u.strikethrough)?Me("s",{children:k}):k,"]"]})})),h]}))},lVt=function(e){var t=e.element,r=e.attributes,n=e.children;switch(t.type){case"headingOne":return Me("h1",p({},r,{children:n}));case"headingTwo":return Me("h2",p({},r,{children:n}));case"headingThree":return Me("h3",p({},r,{children:n}));case"blockquote":return Me("blockquote",p({},r,{children:n}));case"alignLeft":return Me(cVt,p({style:{textAlign:"left"}},r,{children:n}));case"alignCenter":return Me(cVt,p({style:{textAlign:"center"}},r,{children:n}));case"alignRight":return Me(cVt,p({style:{textAlign:"right"}},r,{children:n}));case"justify":return Me(cVt,p({style:{textAlign:"justify"}},r,{children:n}));case"listItem":return Me("li",p({},r,{children:n}));case"orderedList":return Me(uVt,p({},r,{children:n}));case"unorderedList":return Me(dVt,p({},r,{children:n}));case"variable":return Me(sVt,{attributes:r,children:n,element:t});default:return Me("p",p({},r,{children:n}))}},cVt=rt.div(OBt||(OBt=y(["\n display: block;\n width: 100%;\n"],["\n display: block;\n width: 100%;\n"]))),uVt=rt.ol(SBt||(SBt=y(["\n list-style-type: decimal;\n list-style-position: inside;\n margin: 0;\n padding: 0;\n"],["\n list-style-type: decimal;\n list-style-position: inside;\n margin: 0;\n padding: 0;\n"]))),dVt=rt.ul(PBt||(PBt=y(["\n list-style-type: disc;\n list-style-position: inside;\n margin: 0;\n padding: 0;\n"],["\n list-style-type: disc;\n list-style-position: inside;\n margin: 0;\n padding: 0;\n"]))),pVt=rt.span(EBt||(EBt=y(["\n ","\n"],["\n ","\n"])),function(e){var t=e.$color,r=e.$backgroundColor,n=e.$fontSize,o=e.$fontFamily,a=e.$letterSpacing,i=e.$lineHeight;return Ye(TBt||(TBt=y(["\n ","\n ","\n ","\n ","\n ","\n ","\n "],["\n ","\n ","\n ","\n ","\n ","\n ","\n "])),t&&"\n color: ".concat(t," !important;\n &, & *, & span, & a, & [contenteditable] { /* Added for aggressive color override */\n color: ").concat(t," !important;\n }\n "),r&&"background-color: ".concat(r," !important;"),n&&"font-size: ".concat(n," !important;"),o&&"\n font-family: ".concat(o," !important;\n \n /* More aggressive font-family overrides */\n &, & *, & span, & a, & [contenteditable] {\n font-family: ").concat(o," !important;\n }\n "),a&&"letter-spacing: ".concat(a," !important;"),i&&"line-height: ".concat(i," !important;"))}),hVt=function(e){var t,r,n,o=e.leaf,a=e.children,i=e.attributes,s=sS(),l=s.showAnnotations,c=s.annotationsList,u=s.isMLRReview,d=KBt(),h=d.isPreview;if(d.localStateObject,JBt().stateConfig,o.tag){var f=c.tags.findIndex(function(e){var t,r=e.id;return(null===(t=o.tag)||void 0===t?void 0:t.id)===r})+1;u&&l&&f&&(a=Ce(ox,p({component:"span",display:"inline-flex",direction:"row",alignItems:"center",gap:.5,id:fVt},((t={})["data-".concat(vVt)]=null===(n=o.tag)||void 0===n?void 0:n.id,t),{children:[Me("span",p({style:{backgroundColor:"#FFF0D0B5"}},{children:a})),Me(zk,{index:c.tags.findIndex(function(e){var t,r,n=e.id,a=e.label;return(null===(t=o.tag)||void 0===t?void 0:t.id)===n||(null===(r=o.tag)||void 0===r?void 0:r.label)===a})+1,type:"message"})]})))}if(o.bold&&(a=Me("span",p({style:{fontWeight:"bold"}},{children:a}))),o.strikethrough&&(a=Me("s",{children:a})),o.italic&&(a=Me("span",p({style:{fontStyle:"italic"}},{children:a}))),o.underline&&(a=Me("u",{children:a})),(o.color||o.bgColor||o.fontSize||o.fontFamily||o.letterSpacing||o.lineHeight)&&(a=Me(pVt,p({$color:o.color,$backgroundColor:o.bgColor,$fontSize:o.fontSize,$fontFamily:o.fontFamily,$letterSpacing:o.letterSpacing,$lineHeight:o.lineHeight},{children:a}))),o.communicationLink){var m=o.communicationLink,v=m.type,y=m.url,g="internalLink"===v,x=g?uot(y,h):y,b=c.links.findIndex(function(e){return y===e.url&&o.text===e.text})+1;a=Me(we,{children:u&&l&&b?Ce(ox,p({component:"span",display:"inline-flex",alignItems:"center",gap:.2,marginBottom:.2,id:mVt},(r={},r["data-".concat(yVt)]=y,r["data-".concat(gVt)]=o.text,r),{children:[Me(pVt,p({$fontSize:o.fontSize,$fontFamily:o.fontFamily,$letterSpacing:o.letterSpacing,$lineHeight:o.lineHeight,$color:o.color||Te.colors.blue},{children:Me("a",p({},i,{href:x,target:g?"_self":"_blank"},{children:a}))})),Me(zk,{index:b,type:"link"})]})):Me(pVt,p({$fontSize:o.fontSize,$fontFamily:o.fontFamily,$letterSpacing:o.letterSpacing,$lineHeight:o.lineHeight,$color:o.color||Te.colors.blue},{children:Me("a",p({},i,{href:x,target:g?"_self":"_blank"},{children:a}))}))})}return Me("span",p({},i,{children:a}))},fVt="matrix-message",mVt="communication-link",vVt="matrix-message-id",yVt="communication-link-url",gVt="communication-link-text",xVt=[{type:"paragraph",children:[{text:""}]}],bVt=function(t){var r=t.value;t.numberOfLines;var n=e.useMemo(function(){return function(e){var t=e.isInline,r=e.isVoid,n=e.markableVoid;return e.isInline=function(e){return"variable"===e.type||t(e)},e.isVoid=function(e){return"variable"===e.type||r(e)},e.markableVoid=function(e){return"variable"===e.type||n(e)},e}(oS((()=>{var e={children:[],operations:[],selection:null,marks:null,isInline:()=>!1,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:t=>{for(var r of LM.pathRefs(e))ZM.transform(r,t);for(var n of LM.pointRefs(e))QM.transform(n,t);for(var o of LM.rangeRefs(e))rC.transform(o,t);var a,i,s=Zw.get(e)||[],l=Kw.get(e)||new Set,c=e=>{if(e){var t=e.join(",");i.has(t)||(i.add(t),a.push(e))}};if(YM.operationCanTransformPath(t))for(var u of(a=[],i=new Set,s))c(YM.transform(u,t));else a=s,i=l;var d=e.getDirtyPaths(t);for(var p of d)c(p);Zw.set(e,a),Kw.set(e,i),OC.transform(e,t),e.operations.push(t),LM.normalize(e),"set_selection"===t.type&&(e.marks=null),Gw.get(e)||(Gw.set(e,!0),Promise.resolve().then(()=>{Gw.set(e,!1),e.onChange(),e.operations=[]}))},addMark:(t,r)=>{var{selection:n,markableVoid:o}=e;if(n){var a=(t,r)=>{if(!uC.isText(t))return!1;var[n,o]=LM.parent(e,r);return!e.isVoid(n)||e.markableVoid(n)},i=tC.isExpanded(n),s=!1;if(!i){var[l,c]=LM.node(e,n);if(l&&a(l,c)){var[u]=LM.parent(e,c);s=u&&e.markableVoid(u)}}if(i||s)OC.setNodes(e,{[t]:r},{match:a,split:!0,voids:!0});else{var d=rM(rM({},LM.marks(e)||{}),{},{[t]:r});e.marks=d,Gw.get(e)||e.onChange()}}},deleteBackward:t=>{var{selection:r}=e;r&&tC.isCollapsed(r)&&OC.delete(e,{unit:t,reverse:!0})},deleteForward:t=>{var{selection:r}=e;r&&tC.isCollapsed(r)&&OC.delete(e,{unit:t})},deleteFragment:t=>{var{selection:r}=e;r&&tC.isExpanded(r)&&OC.delete(e,{reverse:"backward"===t})},getFragment:()=>{var{selection:t}=e;return t?$M.fragment(e,t):[]},insertBreak:()=>{OC.splitNodes(e,{always:!0})},insertSoftBreak:()=>{OC.splitNodes(e,{always:!0})},insertFragment:t=>{OC.insertFragment(e,t)},insertNode:t=>{OC.insertNodes(e,t)},insertText:t=>{var{selection:r,marks:n}=e;if(r){if(n){var o=rM({text:t},n);OC.insertNodes(e,o)}else OC.insertText(e,t);e.marks=null}},normalizeNode:t=>{var[r,n]=t;if(!uC.isText(r))if(EM.isElement(r)&&0===r.children.length)OC.insertNodes(e,{text:""},{at:n.concat(0),voids:!0});else for(var o=!LM.isEditor(r)&&EM.isElement(r)&&(e.isInline(r)||0===r.children.length||uC.isText(r.children[0])||e.isInline(r.children[0])),a=0,i=0;i<r.children.length;i++,a++){var s=$M.get(e,n);if(!uC.isText(s)){var l=r.children[i],c=s.children[a-1],u=i===r.children.length-1;(uC.isText(l)||EM.isElement(l)&&e.isInline(l))!==o?(OC.removeNodes(e,{at:n.concat(a),voids:!0}),a--):EM.isElement(l)?e.isInline(l)&&(null!=c&&uC.isText(c)?u&&(OC.insertNodes(e,{text:""},{at:n.concat(a+1),voids:!0}),a++):(OC.insertNodes(e,{text:""},{at:n.concat(a),voids:!0}),a++)):null!=c&&uC.isText(c)&&(uC.equals(l,c,{loose:!0})?(OC.mergeNodes(e,{at:n.concat(a),voids:!0}),a--):""===c.text?(OC.removeNodes(e,{at:n.concat(a-1),voids:!0}),a--):""===l.text&&(OC.removeNodes(e,{at:n.concat(a),voids:!0}),a--))}}},removeMark:t=>{var{selection:r}=e;if(r){var n=(t,r)=>{if(!uC.isText(t))return!1;var[n,o]=LM.parent(e,r);return!e.isVoid(n)||e.markableVoid(n)},o=tC.isExpanded(r),a=!1;if(!o){var[i,s]=LM.node(e,r);if(i&&n(i,s)){var[l]=LM.parent(e,s);a=l&&e.markableVoid(l)}}if(o||a)OC.unsetNodes(e,t,{match:n,split:!0,voids:!0});else{var c=rM({},LM.marks(e)||{});delete c[t],e.marks=c,Gw.get(e)||e.onChange()}}},getDirtyPaths:e=>{switch(e.type){case"insert_text":case"remove_text":case"set_node":var{path:t}=e;return YM.levels(t);case"insert_node":var{node:r,path:n}=e,o=YM.levels(n),a=uC.isText(r)?[]:Array.from($M.nodes(r),e=>{var[,t]=e;return n.concat(t)});return[...o,...a];case"merge_node":var{path:i}=e;return[...YM.ancestors(i),YM.previous(i)];case"move_node":var{path:s,newPath:l}=e;if(YM.equals(s,l))return[];var c=[],u=[];for(var d of YM.ancestors(s)){var p=YM.transform(d,e);c.push(p)}for(var h of YM.ancestors(l)){var f=YM.transform(h,e);u.push(f)}var m=u[u.length-1],v=l[l.length-1],y=m.concat(v);return[...c,...u,y];case"remove_node":var{path:g}=e;return[...YM.ancestors(g)];case"split_node":var{path:x}=e;return[...YM.levels(x),YM.next(x)];default:return[]}}};return e})()))},[]),o=xVt;if(null==r||"string"!=typeof r)o=xVt;else{var a=r.replace(/\\/g,"");try{o=JSON.parse(r)}catch(e){console.error(e,"Value was parsed incorrectly. Trying to parse it...");try{o=JSON.parse(a)}catch(e){console.error(e,"Most probably that it's not possible to parse this value")}}}return Me(JO,p({editor:n,value:o},{children:Me(IO,{readOnly:!0,renderLeaf:function(e){return Me(hVt,p({},e))},placeholder:o===xVt?"No content available":"",renderElement:function(e){return Me(lVt,p({},e))}})}),JSON.stringify(o))},kVt=rt.div(NBt||(NBt=y(["\n ",";\n\n ",";\n"],["\n ",";\n\n ",";\n"])),function(e){var t=e.theme.colors,r=e.hasError,n=e.disabled,o=e.isOpen,a=e.isEditMode;return"\n .select-wrapper {\n text-align: left;\n border: ".concat(a?"1px solid ".concat(t.gray3):"none",";\n position: relative;\n border-radius: ").concat(sizes.S,"px;\n &:hover,\n &:active,\n &:focus {\n border-color: ").concat(t.gray2,";\n }\n\n .select-input {\n padding: ").concat(a?"10px ".concat(sizes.S,"px 10px ").concat(sizes.M,"px"):"0",";\n display: flex;\n user-select: none;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n cursor: ").concat(a?"pointer":"default",";\n\n .icon-container {\n max-height: 33px;\n transform: rotate(0deg);\n transition: transform 0.2s ease-in-out;\n ").concat(o&&"transform: rotate(180deg);","\n }\n }\n\n ").concat(n&&"\n border-color: ".concat(t.gray4," !important;\n cursor: not-allowed;\n .select-input {\n background-color: ").concat(t.gray4,";\n pointer-events: none;\n .selected-text-value {\n color: ").concat(t.gray3,";\n }\n .icon-container {\n svg path {\n stroke: ").concat(t.gray3,";\n }\n }\n }\n "),"\n \n ").concat(r&&"\n border-color: ".concat(t.red," !important;\n .select-input {\n .selected-text-value {\n color: ").concat(t.red,";\n }\n .icon-container {\n svg path {\n stroke: ").concat(t.red,";\n }\n }\n }\n "),"\n ")},function(e){return e.$styles}),_Vt=rt.div(zBt||(zBt=y(["\n ",";\n"],["\n ",";\n"])),function(e){var t=e.theme,r=t.colors,n=t.sizes;return"\n position: absolute;\n width: 100%;\n border-radius: ".concat(n.S,"px;\n padding: ").concat(n.L,"px ").concat(n.M,"px;\n box-shadow: 0 0 ").concat(n.XL,"px 0 #0000001a;\n overflow: auto;\n max-height: 150px;\n z-index: 10;\n transform: translateY(").concat(n.S,"px);\n background-color: ").concat(r.white,";\n ")}),wVt=rt.div(ABt||(ABt=y(["\n width: 100%;\n cursor: pointer;\n ",";\n"],["\n width: 100%;\n cursor: pointer;\n ",";\n"])),function(e){var t=e.theme,r=t.sizes,n=t.colors,o=t.fonts,a=e.$selected;return"\n border-radius: ".concat(r.S,"px;\n &:hover {\n background-color: ").concat(n.gray5,";\n }\n padding: ").concat(r.S,"px ").concat(r.M,"px;\n ").concat(o.M,";\n color: ").concat(n.gray2,";\n ").concat(a&&"\n background-color: ".concat(n.gray4," !important;\n color: ").concat(n.black,";\n "),";\n ")}),MVt=function(e,t){void 0===t&&(t=!1);var r=e||{},n=r.horizontalPadding,o=void 0===n?0:n,a=r.verticalPadding,i=void 0===a?0:a,s=r.selectedTextColor,l=r.selectedTextFontSize,c=r.placeholderTextColor,u=r.placeholderTextFontSize,d=r.styles,p=r.wrapperStyles;return Ye(FBt||(FBt=y(["\n ",";\n "],["\n ",";\n "])),function(e){var r=e.theme.colors;return Ye(RBt||(RBt=y(["\n .select-wrapper {\n .select-input {\n ",";\n .selected-text-value {\n ",";\n }\n ",";\n }\n ",";\n }\n "],["\n .select-wrapper {\n .select-input {\n ",";\n .selected-text-value {\n ",";\n }\n ",";\n }\n ",";\n }\n "])),i||o?"padding: ".concat(i,"px ").concat(o,"px;"):"",t?"\n ".concat(s?"color: ".concat(r[s]||s,";"):"",";\n ").concat(l?"font-size: ".concat(l,"px;"):"",";\n "):"\n ".concat(c?"color: ".concat(r[c]||c,";"):"",";\n ").concat(u?"font-size: ".concat(u,"px;"):"",";\n "),d,p)})},CVt=Ze(LBt||(LBt=y(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"],["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]))),jVt=rt.div(BBt||(BBt=y(["\n border: 0.2em solid rgba(0, 0, 0, 0.1);\n border-top: 0.2em solid ",";\n border-radius: 50%;\n width: ","px;\n height: ","px;\n animation: "," 0.6s linear infinite;\n"],["\n border: 0.2em solid rgba(0, 0, 0, 0.1);\n border-top: 0.2em solid ",";\n border-radius: 50%;\n width: ","px;\n height: ","px;\n animation: "," 0.6s linear infinite;\n"])),function(e){var t=e.theme,r=e.color,n=void 0===r?"secondary":r;return t.colors[n]},function(e){var t=e.theme,r=e.size;return r?t.sizes[r]:12},function(e){var t=e.theme,r=e.size;return r?t.sizes[r]:12},CVt);function DVt(e,t){if(null==e)return{};var r,n,o=$s(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function OVt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function SVt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?OVt(Object(r),!0).forEach(function(t){ort(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OVt(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function PVt(e,t){this.v=e,this.k=t}function TVt(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}TVt=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){TVt(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},TVt(e,t,r,n)}function EVt(){
9573
+ */function ult(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function dlt(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function plt(...e){return t=>{let r=!1;const n=e.map(e=>{const n=dlt(e,t);return!r&&"function"==typeof n&&(r=!0),n});if(r)return()=>{for(let t=0;t<n.length;t++){const r=n[t];"function"==typeof r?r():dlt(e[t],null)}}}}function hlt(...e){return s.useCallback(plt(...e),e)}function flt(e,r=[]){let n=[];const o=()=>{const t=n.map(e=>s.createContext(e));return function(r){const n=(null==r?void 0:r[e])||t;return s.useMemo(()=>({[`__scope${e}`]:{...r,[e]:n}}),[r,n])}};return o.scopeName=e,[function(r,o){const a=s.createContext(o),i=n.length;n=[...n,o];const l=r=>{var n;const{scope:o,children:l,...c}=r,u=(null==(n=null==o?void 0:o[e])?void 0:n[i])||a,d=s.useMemo(()=>c,Object.values(c));return t.jsx(u.Provider,{value:d,children:l})};return l.displayName=r+"Provider",[l,function(t,n){var l;const c=(null==(l=null==n?void 0:n[e])?void 0:l[i])||a,u=s.useContext(c);if(u)return u;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${r}\``)}]},mlt(o,...r)]}function mlt(...e){const t=e[0];if(1===e.length)return t;const r=()=>{const r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){const n=r.reduce((t,{useScope:r,scopeName:n})=>({...t,...r(e)[`__scope${n}`]}),{});return s.useMemo(()=>({[`__scope${t.scopeName}`]:n}),[n])}};return r.scopeName=t.scopeName,r}var vlt=null!=globalThis&&globalThis.document?s.useLayoutEffect:()=>{},ylt=s[" useId ".trim().toString()]||(()=>{}),glt=0;function xlt(e){const[t,r]=s.useState(ylt());return vlt(()=>{r(e=>e??String(glt++))},[e]),t?`radix-${t}`:""}var blt=s[" useInsertionEffect ".trim().toString()]||vlt;function klt({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[o,a,i]=function({defaultProp:e,onChange:t}){const[r,n]=s.useState(e),o=s.useRef(r),a=s.useRef(t);return blt(()=>{a.current=t},[t]),s.useEffect(()=>{var e;o.current!==r&&(null==(e=a.current)||e.call(a,r),o.current=r)},[r,o]),[r,n,a]}({defaultProp:t,onChange:r}),l=void 0!==e,c=l?e:o;{const t=s.useRef(void 0!==e);s.useEffect(()=>{const e=t.current;e!==l&&console.warn(`${n} is changing from ${e?"controlled":"uncontrolled"} to ${l?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=l},[l,n])}const u=s.useCallback(t=>{var r;if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&(null==(r=i.current)||r.call(i,n))}else a(t)},[l,e,a,i]);return[c,u]}function _lt(e){const r=Mlt(e),n=s.forwardRef((e,n)=>{const{children:o,...a}=e,i=s.Children.toArray(o),l=i.find(Dlt);if(l){const e=l.props.children,o=i.map(t=>t===l?s.Children.count(e)>1?s.Children.only(null):s.isValidElement(e)?e.props.children:null:t);return t.jsx(r,{...a,ref:n,children:s.isValidElement(e)?s.cloneElement(e,void 0,o):null})}return t.jsx(r,{...a,ref:n,children:o})});return n.displayName=`${e}.Slot`,n}var wlt=_lt("Slot");function Mlt(e){const t=s.forwardRef((e,t)=>{const{children:r,...n}=e;if(s.isValidElement(r)){const e=function(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=n&&"isReactWarning"in n&&n.isReactWarning;return o?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,o=n&&"isReactWarning"in n&&n.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}(r),o=function(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}(n,r.props);return r.type!==s.Fragment&&(o.ref=t?plt(t,e):e),s.cloneElement(r,o)}return s.Children.count(r)>1?s.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Clt=Symbol("radix.slottable");function jlt(e){const r=({children:e})=>t.jsx(t.Fragment,{children:e});return r.displayName=`${e}.Slottable`,r.__radixId=Clt,r}function Dlt(e){return s.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===Clt}var Olt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{const n=_lt(`Primitive.${r}`),o=s.forwardRef((e,o)=>{const{asChild:a,...i}=e,s=a?n:r;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:o})});return o.displayName=`Primitive.${r}`,{...e,[r]:o}},{});function Slt(e,t){e&&d.flushSync(()=>e.dispatchEvent(t))}function Plt(e){const t=s.useRef(e);return s.useEffect(()=>{t.current=e}),s.useMemo(()=>(...e)=>{var r;return null==(r=t.current)?void 0:r.call(t,...e)},[])}var Tlt,Elt="dismissableLayer.update",Nlt="dismissableLayer.pointerDownOutside",zlt="dismissableLayer.focusOutside",Alt=s.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Rlt=s.forwardRef((e,r)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:l,onDismiss:c,...u}=e,d=s.useContext(Alt),[p,h]=s.useState(null),f=(null==p?void 0:p.ownerDocument)??(null==globalThis?void 0:globalThis.document),[,m]=s.useState({}),v=hlt(r,e=>h(e)),y=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(g),b=p?y.indexOf(p):-1,k=d.layersWithOutsidePointerEventsDisabled.size>0,_=b>=x,w=function(e,t=(null==globalThis?void 0:globalThis.document)){const r=Plt(e),n=s.useRef(!1),o=s.useRef(()=>{});return s.useEffect(()=>{const e=e=>{if(e.target&&!n.current){let n=function(){Blt(Nlt,r,a,{discrete:!0})};const a={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=n,t.addEventListener("click",o.current,{once:!0})):n()}else t.removeEventListener("click",o.current);n.current=!1},a=window.setTimeout(()=>{t.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(a),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));!_||r||(null==a||a(e),null==l||l(e),e.defaultPrevented||null==c||c())},f),M=function(e,t=(null==globalThis?void 0:globalThis.document)){const r=Plt(e),n=s.useRef(!1);return s.useEffect(()=>{const e=e=>{e.target&&!n.current&&Blt(zlt,r,{originalEvent:e},{discrete:!1})};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())},f);return function(e,t=(null==globalThis?void 0:globalThis.document)){const r=Plt(e);s.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{b===d.layers.size-1&&(null==o||o(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},f),s.useEffect(()=>{if(p)return n&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(Tlt=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),Llt(),()=>{n&&1===d.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=Tlt)}},[p,f,n,d]),s.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),Llt())},[p,d]),s.useEffect(()=>{const e=()=>m({});return document.addEventListener(Elt,e),()=>document.removeEventListener(Elt,e)},[]),t.jsx(Olt.div,{...u,ref:v,style:{pointerEvents:k?_?"auto":"none":void 0,...e.style},onFocusCapture:ult(e.onFocusCapture,M.onFocusCapture),onBlurCapture:ult(e.onBlurCapture,M.onBlurCapture),onPointerDownCapture:ult(e.onPointerDownCapture,w.onPointerDownCapture)})});Rlt.displayName="DismissableLayer";var Flt=s.forwardRef((e,r)=>{const n=s.useContext(Alt),o=s.useRef(null),a=hlt(r,o);return s.useEffect(()=>{const e=o.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),t.jsx(Olt.div,{...e,ref:a})});function Llt(){const e=new CustomEvent(Elt);document.dispatchEvent(e)}function Blt(e,t,r,{discrete:n}){const o=r.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&o.addEventListener(e,t,{once:!0}),n?Slt(o,a):o.dispatchEvent(a)}Flt.displayName="DismissableLayerBranch";var Vlt="focusScope.autoFocusOnMount",Ilt="focusScope.autoFocusOnUnmount",qlt={bubbles:!1,cancelable:!0},$lt=s.forwardRef((e,r)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...l}=e,[c,u]=s.useState(null),d=Plt(a),p=Plt(i),h=s.useRef(null),f=hlt(r,e=>u(e)),m=s.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;s.useEffect(()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?h.current=t:Ylt(h.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||Ylt(h.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&Ylt(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return c&&n.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[o,c,m.paused]),s.useEffect(()=>{if(c){Zlt.add(m);const e=document.activeElement;if(!c.contains(e)){const t=new CustomEvent(Vlt,qlt);c.addEventListener(Vlt,d),c.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ylt(n,{select:t}),document.activeElement!==r)return}(function(e){return e.filter(e=>"A"!==e.tagName)}(Hlt(c)),{select:!0}),document.activeElement===e&&Ylt(c))}return()=>{c.removeEventListener(Vlt,d),setTimeout(()=>{const t=new CustomEvent(Ilt,qlt);c.addEventListener(Ilt,p),c.dispatchEvent(t),t.defaultPrevented||Ylt(e??document.body,{select:!0}),c.removeEventListener(Ilt,p),Zlt.remove(m)},0)}}},[c,d,p,m]);const v=s.useCallback(e=>{if(!n&&!o||m.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[o,a]=function(e){const t=Hlt(e),r=Wlt(t,e),n=Wlt(t.reverse(),e);return[r,n]}(t);o&&a?e.shiftKey||r!==a?e.shiftKey&&r===o&&(e.preventDefault(),n&&Ylt(a,{select:!0})):(e.preventDefault(),n&&Ylt(o,{select:!0})):r===t&&e.preventDefault()}},[n,o,m.paused]);return t.jsx(Olt.div,{tabIndex:-1,...l,ref:f,onKeyDown:v})});function Hlt(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function Wlt(e,t){for(const r of e)if(!Ult(r,{upTo:t}))return r}function Ult(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function Ylt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}$lt.displayName="FocusScope";var Zlt=function(){let e=[];return{add(t){const r=e[0];t!==r&&(null==r||r.pause()),e=Klt(e,t),e.unshift(t)},remove(t){var r;e=Klt(e,t),null==(r=e[0])||r.resume()}}}();function Klt(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}var Glt=s.forwardRef((e,r)=>{var n;const{container:o,...a}=e,[i,l]=s.useState(!1);vlt(()=>l(!0),[]);const c=o||i&&(null==(n=null==globalThis?void 0:globalThis.document)?void 0:n.body);return c?u.default.createPortal(t.jsx(Olt.div,{...a,ref:r}),c):null});Glt.displayName="Portal";var Xlt=e=>{const{present:t,children:r}=e,n=function(e){const[t,r]=s.useState(),n=s.useRef(null),o=s.useRef(e),a=s.useRef("none"),i=e?"mounted":"unmounted",[l,c]=function(e,t){return s.useReducer((e,r)=>t[e][r]??e,e)}(i,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return s.useEffect(()=>{const e=Qlt(n.current);a.current="mounted"===l?e:"none"},[l]),vlt(()=>{const t=n.current,r=o.current;if(r!==e){const n=a.current,i=Qlt(t);e?c("MOUNT"):"none"===i||"none"===(null==t?void 0:t.display)?c("UNMOUNT"):c(r&&n!==i?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,c]),vlt(()=>{if(t){let e;const r=t.ownerDocument.defaultView??window,i=a=>{const i=Qlt(n.current).includes(a.animationName);if(a.target===t&&i&&(c("ANIMATION_END"),!o.current)){const n=t.style.animationFillMode;t.style.animationFillMode="forwards",e=r.setTimeout(()=>{"forwards"===t.style.animationFillMode&&(t.style.animationFillMode=n)})}},s=e=>{e.target===t&&(a.current=Qlt(n.current))};return t.addEventListener("animationstart",s),t.addEventListener("animationcancel",i),t.addEventListener("animationend",i),()=>{r.clearTimeout(e),t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",i),t.removeEventListener("animationend",i)}}c("ANIMATION_END")},[t,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:s.useCallback(e=>{n.current=e?getComputedStyle(e):null,r(e)},[])}}(t),o="function"==typeof r?r({present:n.isPresent}):s.Children.only(r),a=hlt(n.ref,function(e){var t,r;let n=null==(t=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:t.get,o=n&&"isReactWarning"in n&&n.isReactWarning;return o?e.ref:(n=null==(r=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:r.get,o=n&&"isReactWarning"in n&&n.isReactWarning,o?e.props.ref:e.props.ref||e.ref)}(o));return"function"==typeof r||n.isPresent?s.cloneElement(o,{ref:a}):null};function Qlt(e){return(null==e?void 0:e.animationName)||"none"}Xlt.displayName="Presence";var Jlt=0;function ect(){s.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??tct()),document.body.insertAdjacentElement("beforeend",e[1]??tct()),Jlt++,()=>{1===Jlt&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Jlt--}},[])}function tct(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var rct=function(){return rct=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},rct.apply(this,arguments)};function nct(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}function oct(e,t,r){if(r||2===arguments.length)for(var n,o=0,a=t.length;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}var act="right-scroll-bar-position",ict="width-before-scroll-bar";function sct(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var lct=typeof window<"u"?s.useLayoutEffect:s.useEffect,cct=new WeakMap;function uct(t,r){var n=function(t,r){var n=e.useState(function(){return{value:t,callback:r,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=r,n.facade}(null,function(e){return t.forEach(function(t){return sct(t,e)})});return lct(function(){var e=cct.get(n);if(e){var r=new Set(e),o=new Set(t),a=n.current;r.forEach(function(e){o.has(e)||sct(e,null)}),o.forEach(function(e){r.has(e)||sct(e,a)})}cct.set(n,t)},[t]),n}function dct(e){return e}function pct(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=dct);var r=[],n=!1,o={read:function(){if(n)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return r.length?r[r.length-1]:e},useMedium:function(e){var o=t(e,n);return r.push(o),function(){r=r.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(n=!0;r.length;){var t=r;r=[],t.forEach(e)}r={push:function(t){return e(t)},filter:function(){return r}}},assignMedium:function(e){n=!0;var t=[];if(r.length){var o=r;r=[],o.forEach(e),t=r}var a=function(){var r=t;t=[],r.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),r={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),r}}}};return o}(null);return t.options=rct({async:!0,ssr:!1},e),t}var hct=function(e){var t=e.sideCar,r=nct(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw new Error("Sidecar medium not found");return s.createElement(n,rct({},r))};function fct(e,t){return e.useMedium(t),hct}hct.isSideCarExport=!0;var mct=pct(),vct=function(){},yct=s.forwardRef(function(e,t){var r=s.useRef(null),n=s.useState({onScrollCapture:vct,onWheelCapture:vct,onTouchMoveCapture:vct}),o=n[0],a=n[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,f=e.noRelative,m=e.noIsolation,v=e.inert,y=e.allowPinchZoom,g=e.as,x=void 0===g?"div":g,b=e.gapMode,k=nct(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),_=h,w=uct([r,t]),M=rct(rct({},k),o);return s.createElement(s.Fragment,null,d&&s.createElement(_,{sideCar:mct,removeScrollBar:u,shards:p,noRelative:f,noIsolation:m,inert:v,setCallbacks:a,allowPinchZoom:!!y,lockRef:r,gapMode:b}),i?s.cloneElement(s.Children.only(l),rct(rct({},M),{ref:w})):s.createElement(x,rct({},M,{className:c,ref:w}),l))});yct.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},yct.classNames={fullWidth:ict,zeroRight:act};function gct(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var xct=function(){var e=0,t=null;return{add:function(r){0==e&&(t=gct())&&(function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,r),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},bct=function(){var e=function(){var e=xct();return function(t,r){s.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}}();return function(t){var r=t.styles,n=t.dynamic;return e(r,n),null}},kct={left:0,top:0,right:0,gap:0},_ct=function(e){return parseInt(e||"",10)||0},wct=function(e){if(void 0===e&&(e="margin"),typeof window>"u")return kct;var t=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[_ct(r),_ct(n),_ct(o)]}(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Mct=bct(),Cct="data-scroll-locked",jct=function(e,t,r,n){var o=e.left,a=e.top,i=e.right,s=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(s,"px ").concat(n,";\n }\n body[").concat(Cct,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(act," {\n right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(ict," {\n margin-right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(act," .").concat(act," {\n right: 0 ").concat(n,";\n }\n \n .").concat(ict," .").concat(ict," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(Cct,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},Dct=function(){var e=parseInt(document.body.getAttribute(Cct)||"0",10);return isFinite(e)?e:0},Oct=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;s.useEffect(function(){return document.body.setAttribute(Cct,(Dct()+1).toString()),function(){var e=Dct()-1;e<=0?document.body.removeAttribute(Cct):document.body.setAttribute(Cct,e.toString())}},[]);var a=s.useMemo(function(){return wct(o)},[o]);return s.createElement(Mct,{styles:jct(a,!t,o,r?"":"!important")})},Sct=!1;if(typeof window<"u")try{var Pct=Object.defineProperty({},"passive",{get:function(){return Sct=!0,!0}});window.addEventListener("test",Pct,Pct),window.removeEventListener("test",Pct,Pct)}catch{Sct=!1}var Tct=!!Sct&&{passive:!1},Ect=function(e,t){if(!(e instanceof Element))return!1;var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},Nct=function(e,t){var r=t.ownerDocument,n=t;do{if(typeof ShadowRoot<"u"&&n instanceof ShadowRoot&&(n=n.host),zct(e,n)){var o=Act(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},zct=function(e,t){return"v"===e?function(e){return Ect(e,"overflowY")}(t):function(e){return Ect(e,"overflowX")}(t)},Act=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},Rct=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Fct=function(e){return[e.deltaX,e.deltaY]},Lct=function(e){return e&&"current"in e?e.current:e},Bct=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Vct=0,Ict=[];function qct(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const $ct=fct(mct,function(e){var t=s.useRef([]),r=s.useRef([0,0]),n=s.useRef(),o=s.useState(Vct++)[0],a=s.useState(bct)[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=oct([e.lockRef.current],(e.shards||[]).map(Lct),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=s.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!i.current.allowPinchZoom;var o,a=Rct(e),s=r.current,l="deltaX"in e?e.deltaX:s[0]-a[0],c="deltaY"in e?e.deltaY:s[1]-a[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=Nct(d,u);if(!p)return!0;if(p?o=d:(o="v"===d?"h":"v",p=Nct(d,u)),!p)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=o),!o)return!0;var h=n.current||o;return function(e,t,r,n){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,s=t.contains(i),l=!1,c=a>0,u=0,d=0;do{if(!i)break;var p=Act(e,i),h=p[0],f=p[1]-p[2]-o*h;(h||f)&&zct(e,i)&&(u+=f,d+=h);var m=i.parentNode;i=m&&m.nodeType===Node.DOCUMENT_FRAGMENT_NODE?m.host:m}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&Math.abs(u)<1||!c&&Math.abs(d)<1)&&(l=!0),l}(h,t,e,"h"===h?l:c)},[]),c=s.useCallback(function(e){var r=e;if(Ict.length&&Ict[Ict.length-1]===a){var n="deltaY"in r?Fct(r):Rct(r),o=t.current.filter(function(e){return e.name===r.type&&(e.target===r.target||r.target===e.shadowParent)&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,n)})[0];if(o&&o.should)return void(r.cancelable&&r.preventDefault());if(!o){var s=(i.current.shards||[]).map(Lct).filter(Boolean).filter(function(e){return e.contains(r.target)});(s.length>0?l(r,s[0]):!i.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=s.useCallback(function(e,r,n,o){var a={name:e,delta:r,target:n,should:o,shadowParent:qct(n)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){r.current=Rct(e),n.current=void 0},[]),p=s.useCallback(function(t){u(t.type,Fct(t),t.target,l(t,e.lockRef.current))},[]),h=s.useCallback(function(t){u(t.type,Rct(t),t.target,l(t,e.lockRef.current))},[]);s.useEffect(function(){return Ict.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Tct),document.addEventListener("touchmove",c,Tct),document.addEventListener("touchstart",d,Tct),function(){Ict=Ict.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,Tct),document.removeEventListener("touchmove",c,Tct),document.removeEventListener("touchstart",d,Tct)}},[]);var f=e.removeScrollBar,m=e.inert;return s.createElement(s.Fragment,null,m?s.createElement(a,{styles:Bct(o)}):null,f?s.createElement(Oct,{noRelative:e.noRelative,gapMode:e.gapMode}):null)});var Hct=s.forwardRef(function(e,t){return s.createElement(yct,rct({},e,{ref:t,sideCar:$ct}))});Hct.classNames=yct.classNames;var Wct=new WeakMap,Uct=new WeakMap,Yct={},Zct=0,Kct=function(e){return e&&(e.host||Kct(e.parentNode))},Gct=function(e,t,r,n){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var r=Kct(t);return r&&e.contains(r)?r:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return!!e})}(t,Array.isArray(e)?e:[e]);Yct[r]||(Yct[r]=new WeakMap);var a=Yct[r],i=[],s=new Set,l=new Set(o),c=function(e){!e||s.has(e)||(s.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){!e||l.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(n),o=null!==t&&"false"!==t,l=(Wct.get(e)||0)+1,c=(a.get(e)||0)+1;Wct.set(e,l),a.set(e,c),i.push(e),1===l&&o&&Uct.set(e,!0),1===c&&e.setAttribute(r,"true"),o||e.setAttribute(n,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),Zct++,function(){i.forEach(function(e){var t=Wct.get(e)-1,o=a.get(e)-1;Wct.set(e,t),a.set(e,o),t||(Uct.has(e)||e.removeAttribute(n),Uct.delete(e)),o||e.removeAttribute(r)}),--Zct||(Wct=new WeakMap,Wct=new WeakMap,Uct=new WeakMap,Yct={})}},Xct=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=function(e){return typeof document>"u"?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live], script"))),Gct(n,o,r,"aria-hidden")):function(){return null}},Qct="Dialog",[Jct,eut]=flt(Qct),[tut,rut]=Jct(Qct),nut=e=>{const{__scopeDialog:r,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:l=!0}=e,c=s.useRef(null),u=s.useRef(null),[d,p]=klt({prop:o,defaultProp:a??!1,onChange:i,caller:Qct});return t.jsx(tut,{scope:r,triggerRef:c,contentRef:u,contentId:xlt(),titleId:xlt(),descriptionId:xlt(),open:d,onOpenChange:p,onOpenToggle:s.useCallback(()=>p(e=>!e),[p]),modal:l,children:n})};nut.displayName=Qct;var out="DialogTrigger",aut=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=rut(out,n),i=hlt(r,a.triggerRef);return t.jsx(Olt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Cut(a.open),...o,ref:i,onClick:ult(e.onClick,a.onOpenToggle)})});aut.displayName=out;var iut="DialogPortal",[sut,lut]=Jct(iut,{forceMount:void 0}),cut=e=>{const{__scopeDialog:r,forceMount:n,children:o,container:a}=e,i=rut(iut,r);return t.jsx(sut,{scope:r,forceMount:n,children:s.Children.map(o,e=>t.jsx(Xlt,{present:n||i.open,children:t.jsx(Glt,{asChild:!0,container:a,children:e})}))})};cut.displayName=iut;var uut="DialogOverlay",dut=s.forwardRef((e,r)=>{const n=lut(uut,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=rut(uut,e.__scopeDialog);return i.modal?t.jsx(Xlt,{present:o||i.open,children:t.jsx(hut,{...a,ref:r})}):null});dut.displayName=uut;var put=_lt("DialogOverlay.RemoveScroll"),hut=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=rut(uut,n);return t.jsx(Hct,{as:put,allowPinchZoom:!0,shards:[a.contentRef],children:t.jsx(Olt.div,{"data-state":Cut(a.open),...o,ref:r,style:{pointerEvents:"auto",...o.style}})})}),fut="DialogContent",mut=s.forwardRef((e,r)=>{const n=lut(fut,e.__scopeDialog),{forceMount:o=n.forceMount,...a}=e,i=rut(fut,e.__scopeDialog);return t.jsx(Xlt,{present:o||i.open,children:i.modal?t.jsx(vut,{...a,ref:r}):t.jsx(yut,{...a,ref:r})})});mut.displayName=fut;var vut=s.forwardRef((e,r)=>{const n=rut(fut,e.__scopeDialog),o=s.useRef(null),a=hlt(r,n.contentRef,o);return s.useEffect(()=>{const e=o.current;if(e)return Xct(e)},[]),t.jsx(gut,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ult(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:ult(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:ult(e.onFocusOutside,e=>e.preventDefault())})}),yut=s.forwardRef((e,r)=>{const n=rut(fut,e.__scopeDialog),o=s.useRef(!1),a=s.useRef(!1);return t.jsx(gut,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,i;null==(r=e.onCloseAutoFocus)||r.call(e,t),t.defaultPrevented||(o.current||null==(i=n.triggerRef.current)||i.focus(),t.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:t=>{var r,i;null==(r=e.onInteractOutside)||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null==(i=n.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),gut=s.forwardRef((e,r)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...l}=e,c=rut(fut,n),u=s.useRef(null),d=hlt(r,u);return ect(),t.jsxs(t.Fragment,{children:[t.jsx($lt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:t.jsx(Rlt,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":Cut(c.open),...l,ref:d,onDismiss:()=>c.onOpenChange(!1)})}),t.jsxs(t.Fragment,{children:[t.jsx(Sut,{titleId:c.titleId}),t.jsx(Put,{contentRef:u,descriptionId:c.descriptionId})]})]})}),xut="DialogTitle",but=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=rut(xut,n);return t.jsx(Olt.h2,{id:a.titleId,...o,ref:r})});but.displayName=xut;var kut="DialogDescription",_ut=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=rut(kut,n);return t.jsx(Olt.p,{id:a.descriptionId,...o,ref:r})});_ut.displayName=kut;var wut="DialogClose",Mut=s.forwardRef((e,r)=>{const{__scopeDialog:n,...o}=e,a=rut(wut,n);return t.jsx(Olt.button,{type:"button",...o,ref:r,onClick:ult(e.onClick,()=>a.onOpenChange(!1))})});function Cut(e){return e?"open":"closed"}Mut.displayName=wut;var jut="DialogTitleWarning",[Dut,Out]=function(e,r){const n=s.createContext(r),o=e=>{const{children:r,...o}=e,a=s.useMemo(()=>o,Object.values(o));return t.jsx(n.Provider,{value:a,children:r})};return o.displayName=e+"Provider",[o,function(t){const o=s.useContext(n);if(o)return o;if(void 0!==r)return r;throw new Error(`\`${t}\` must be used within \`${e}\``)}]}(jut,{contentName:fut,titleName:xut,docsSlug:"dialog"}),Sut=({titleId:e})=>{const t=Out(jut),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return s.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},Put=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Out("DialogDescriptionWarning").contentName}}.`;return s.useEffect(()=>{var n;const o=null==(n=e.current)?void 0:n.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},Tut=nut,Eut=aut,Nut=cut,zut=dut,Aut=mut,Rut=but,Fut=_ut,Lut=Mut;function But(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=But(e[t]))&&(n&&(n+=" "),n+=r)}else for(r in e)e[r]&&(n&&(n+=" "),n+=r);return n}function Vut(){for(var e,t,r=0,n="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=But(e))&&(n&&(n+=" "),n+=t);return n}const Iut=e=>{const t=Wut(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:e=>{const r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),qut(r,t)||Hut(e)},getConflictingClassGroupIds:(e,t)=>{const o=r[e]||[];return t&&n[e]?[...o,...n[e]]:o}}},qut=(e,t)=>{var r;if(0===e.length)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),a=o?qut(e.slice(1),o):void 0;if(a)return a;if(0===t.validators.length)return;const i=e.join("-");return null==(r=t.validators.find(({validator:e})=>e(i)))?void 0:r.classGroupId},$ut=/^\[(.+)\]$/,Hut=e=>{if($ut.test(e)){const t=$ut.exec(e)[1],r=null==t?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},Wut=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return Kut(Object.entries(e.classGroups),r).forEach(([e,r])=>{Uut(r,n,e,t)}),n},Uut=(e,t,r,n)=>{e.forEach(e=>{if("string"==typeof e){return void((""===e?t:Yut(t,e)).classGroupId=r)}if("function"==typeof e)return Zut(e)?void Uut(e(n),t,r,n):void t.validators.push({validator:e,classGroupId:r});Object.entries(e).forEach(([e,o])=>{Uut(o,Yut(t,e),r,n)})})},Yut=(e,t)=>{let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r},Zut=e=>e.isThemeGetter,Kut=(e,t)=>t?e.map(([e,r])=>{const n=r.map(e=>"string"==typeof e?t+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,r])=>[t+e,r])):e);return[e,n]}):e,Gut=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(o,a)=>{r.set(o,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(o(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):o(e,t)}}},Xut=e=>{const{separator:t,experimentalParseClassName:r}=e,n=1===t.length,o=t[0],a=t.length,i=e=>{const r=[];let i,s=0,l=0;for(let c=0;c<e.length;c++){let u=e[c];if(0===s){if(u===o&&(n||e.slice(c,c+a)===t)){r.push(e.slice(l,c)),l=c+a;continue}if("/"===u){i=c;continue}}"["===u?s++:"]"===u&&s--}const c=0===r.length?e:e.substring(l),u=c.startsWith("!");return{modifiers:r,hasImportantModifier:u,baseClassName:u?c.substring(1):c,maybePostfixModifierPosition:i&&i>l?i-l:void 0}};return r?e=>r({className:e,parseClassName:i}):i},Qut=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)}),t.push(...r.sort()),t},Jut=/\s+/;function edt(){let e,t,r=0,n="";for(;r<arguments.length;)(e=arguments[r++])&&(t=tdt(e))&&(n&&(n+=" "),n+=t);return n}const tdt=e=>{if("string"==typeof e)return e;let t,r="";for(let n=0;n<e.length;n++)e[n]&&(t=tdt(e[n]))&&(r&&(r+=" "),r+=t);return r};function rdt(e,...t){let r,n,o,a=function(s){const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:Gut(e.cacheSize),parseClassName:Xut(e),...Iut(e)}))(l),n=r.cache.get,o=r.cache.set,a=i,i(s)};function i(e){const t=n(e);if(t)return t;const a=((e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,a=[],i=e.trim().split(Jut);let s="";for(let e=i.length-1;e>=0;e-=1){const t=i[e],{modifiers:l,hasImportantModifier:c,baseClassName:u,maybePostfixModifierPosition:d}=r(t);let p=!!d,h=n(p?u.substring(0,d):u);if(!h){if(!p){s=t+(s.length>0?" "+s:s);continue}if(h=n(u),!h){s=t+(s.length>0?" "+s:s);continue}p=!1}const f=Qut(l).join(":"),m=c?f+"!":f,v=m+h;if(a.includes(v))continue;a.push(v);const y=o(h,p);for(let e=0;e<y.length;++e){const t=y[e];a.push(m+t)}s=t+(s.length>0?" "+s:s)}return s})(e,r);return o(e,a),a}return function(){return a(edt.apply(null,arguments))}}const ndt=e=>{const t=t=>t[e]||[];return t.isThemeGetter=!0,t},odt=/^\[(?:([a-z-]+):)?(.+)\]$/i,adt=/^\d+\/\d+$/,idt=new Set(["px","full","screen"]),sdt=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ldt=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,cdt=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,udt=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ddt=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,pdt=e=>fdt(e)||idt.has(e)||adt.test(e),hdt=e=>Ddt(e,"length",Odt),fdt=e=>!!e&&!Number.isNaN(Number(e)),mdt=e=>Ddt(e,"number",fdt),vdt=e=>!!e&&Number.isInteger(Number(e)),ydt=e=>e.endsWith("%")&&fdt(e.slice(0,-1)),gdt=e=>odt.test(e),xdt=e=>sdt.test(e),bdt=new Set(["length","size","percentage"]),kdt=e=>Ddt(e,bdt,Sdt),_dt=e=>Ddt(e,"position",Sdt),wdt=new Set(["image","url"]),Mdt=e=>Ddt(e,wdt,Tdt),Cdt=e=>Ddt(e,"",Pdt),jdt=()=>!0,Ddt=(e,t,r)=>{const n=odt.exec(e);return!!n&&(n[1]?"string"==typeof t?n[1]===t:t.has(n[1]):r(n[2]))},Odt=e=>ldt.test(e)&&!cdt.test(e),Sdt=()=>!1,Pdt=e=>udt.test(e),Tdt=e=>ddt.test(e),Edt=()=>{const e=ndt("colors"),t=ndt("spacing"),r=ndt("blur"),n=ndt("brightness"),o=ndt("borderColor"),a=ndt("borderRadius"),i=ndt("borderSpacing"),s=ndt("borderWidth"),l=ndt("contrast"),c=ndt("grayscale"),u=ndt("hueRotate"),d=ndt("invert"),p=ndt("gap"),h=ndt("gradientColorStops"),f=ndt("gradientColorStopPositions"),m=ndt("inset"),v=ndt("margin"),y=ndt("opacity"),g=ndt("padding"),x=ndt("saturate"),b=ndt("scale"),k=ndt("sepia"),_=ndt("skew"),w=ndt("space"),M=ndt("translate"),C=()=>["auto",gdt,t],j=()=>[gdt,t],D=()=>["",pdt,hdt],O=()=>["auto",fdt,gdt],S=()=>["","0",gdt],P=()=>[fdt,gdt];return{cacheSize:500,separator:":",theme:{colors:[jdt],spacing:[pdt,hdt],blur:["none","",xdt,gdt],brightness:P(),borderColor:[e],borderRadius:["none","","full",xdt,gdt],borderSpacing:j(),borderWidth:D(),contrast:P(),grayscale:S(),hueRotate:P(),invert:S(),gap:j(),gradientColorStops:[e],gradientColorStopPositions:[ydt,hdt],inset:C(),margin:C(),opacity:P(),padding:j(),saturate:P(),scale:P(),sepia:S(),skew:P(),space:j(),translate:j()},classGroups:{aspect:[{aspect:["auto","square","video",gdt]}],container:["container"],columns:[{columns:[xdt]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",gdt]}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",vdt,gdt]}],basis:[{basis:C()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",gdt]}],grow:[{grow:S()}],shrink:[{shrink:S()}],order:[{order:["first","last","none",vdt,gdt]}],"grid-cols":[{"grid-cols":[jdt]}],"col-start-end":[{col:["auto",{span:["full",vdt,gdt]},gdt]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[jdt]}],"row-start-end":[{row:["auto",{span:[vdt,gdt]},gdt]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",gdt]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",gdt]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal","start","end","center","between","around","evenly","stretch"]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[v]}],mx:[{mx:[v]}],my:[{my:[v]}],ms:[{ms:[v]}],me:[{me:[v]}],mt:[{mt:[v]}],mr:[{mr:[v]}],mb:[{mb:[v]}],ml:[{ml:[v]}],"space-x":[{"space-x":[w]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[w]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",gdt,t]}],"min-w":[{"min-w":[gdt,t,"min","max","fit"]}],"max-w":[{"max-w":[gdt,t,"none","full","min","max","fit","prose",{screen:[xdt]},xdt]}],h:[{h:[gdt,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[gdt,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[gdt,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[gdt,t,"auto","min","max","fit"]}],"font-size":[{text:["base",xdt,hdt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",mdt]}],"font-family":[{font:[jdt]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",gdt]}],"line-clamp":[{"line-clamp":["none",fdt,mdt]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",pdt,gdt]}],"list-image":[{"list-image":["none",gdt]}],"list-style-type":[{list:["none","disc","decimal",gdt]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","none","wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",pdt,hdt]}],"underline-offset":[{"underline-offset":["auto",pdt,gdt]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:j()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",gdt]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",gdt]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top",_dt]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",kdt]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Mdt]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[f]}],"gradient-via-pos":[{via:[f]}],"gradient-to-pos":[{to:[f]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[a]}],"rounded-s":[{"rounded-s":[a]}],"rounded-e":[{"rounded-e":[a]}],"rounded-t":[{"rounded-t":[a]}],"rounded-r":[{"rounded-r":[a]}],"rounded-b":[{"rounded-b":[a]}],"rounded-l":[{"rounded-l":[a]}],"rounded-ss":[{"rounded-ss":[a]}],"rounded-se":[{"rounded-se":[a]}],"rounded-ee":[{"rounded-ee":[a]}],"rounded-es":[{"rounded-es":[a]}],"rounded-tl":[{"rounded-tl":[a]}],"rounded-tr":[{"rounded-tr":[a]}],"rounded-br":[{"rounded-br":[a]}],"rounded-bl":[{"rounded-bl":[a]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:["solid","dashed","dotted","double","none","hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:["solid","dashed","dotted","double","none"]}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["","solid","dashed","dotted","double","none"]}],"outline-offset":[{"outline-offset":[pdt,gdt]}],"outline-w":[{outline:[pdt,hdt]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[pdt,hdt]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",xdt,Cdt]}],"shadow-color":[{shadow:[jdt]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",xdt,gdt]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[u]}],invert:[{invert:[d]}],saturate:[{saturate:[x]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[u]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[i]}],"border-spacing-x":[{"border-spacing-x":[i]}],"border-spacing-y":[{"border-spacing-y":[i]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",gdt]}],duration:[{duration:P()}],ease:[{ease:["linear","in","out","in-out",gdt]}],delay:[{delay:P()}],animate:[{animate:["none","spin","ping","pulse","bounce",gdt]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[b]}],"scale-x":[{"scale-x":[b]}],"scale-y":[{"scale-y":[b]}],rotate:[{rotate:[vdt,gdt]}],"translate-x":[{"translate-x":[M]}],"translate-y":[{"translate-y":[M]}],"skew-x":[{"skew-x":[_]}],"skew-y":[{"skew-y":[_]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",gdt]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",gdt]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":j()}],"scroll-mx":[{"scroll-mx":j()}],"scroll-my":[{"scroll-my":j()}],"scroll-ms":[{"scroll-ms":j()}],"scroll-me":[{"scroll-me":j()}],"scroll-mt":[{"scroll-mt":j()}],"scroll-mr":[{"scroll-mr":j()}],"scroll-mb":[{"scroll-mb":j()}],"scroll-ml":[{"scroll-ml":j()}],"scroll-p":[{"scroll-p":j()}],"scroll-px":[{"scroll-px":j()}],"scroll-py":[{"scroll-py":j()}],"scroll-ps":[{"scroll-ps":j()}],"scroll-pe":[{"scroll-pe":j()}],"scroll-pt":[{"scroll-pt":j()}],"scroll-pr":[{"scroll-pr":j()}],"scroll-pb":[{"scroll-pb":j()}],"scroll-pl":[{"scroll-pl":j()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",gdt]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[pdt,hdt,mdt]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Ndt=rdt(Edt);function zdt(...e){return Ndt(Vut(e))}const Adt=Tut,Rdt=Eut,Fdt=Nut,Ldt=s.forwardRef(({className:e,...r},n)=>t.jsx(zut,{ref:n,className:zdt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r}));Ldt.displayName=zut.displayName;const Bdt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(Fdt,{children:[t.jsx(Ldt,{}),t.jsxs(Aut,{ref:o,className:zdt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[r,t.jsxs(Lut,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[t.jsx(clt,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Bdt.displayName=Aut.displayName;const Vdt=({className:e,...r})=>t.jsx("div",{className:zdt("flex flex-col space-y-1.5 text-center sm:text-left",e),...r});Vdt.displayName="DialogHeader";const Idt=({className:e,...r})=>t.jsx("div",{className:zdt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});Idt.displayName="DialogFooter";const qdt=s.forwardRef(({className:e,...r},n)=>t.jsx(Rut,{ref:n,className:zdt("text-lg font-semibold leading-none tracking-tight",e),...r}));qdt.displayName=Rut.displayName;const $dt=s.forwardRef(({className:e,...r},n)=>t.jsx(Fut,{ref:n,className:zdt("text-sm text-muted-foreground",e),...r}));$dt.displayName=Fut.displayName;var Hdt=Array(12).fill(0),Wdt=({visible:e,className:t})=>l.default.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},l.default.createElement("div",{className:"sonner-spinner"},Hdt.map((e,t)=>l.default.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),Udt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Ydt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),Zdt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Kdt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},l.default.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Gdt=l.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},l.default.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),l.default.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),Xdt=1,Qdt=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,o="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:Xdt++,a=this.toasts.find(e=>e.id===o),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(o)&&this.dismissedToasts.delete(o),a?this.toasts=this.toasts.map(t=>t.id===o?(this.publish({...t,...e,id:o,title:r}),{...t,...e,id:o,dismissible:i,title:r}):t):this.addToast({title:r,...n,dismissible:i,id:o}),o},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{if(!t)return;let r;void 0!==t.loading&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let n,o=e instanceof Promise?e:e(),a=void 0!==r,i=o.then(async e=>{if(n=["resolve",e],l.default.isValidElement(e))a=!1,this.create({id:r,type:"default",message:e});else if(Jdt(e)&&!e.ok){a=!1;let n="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,o="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description;this.create({id:r,type:"error",message:n,description:o})}else if(void 0!==t.success){a=!1;let n="function"==typeof t.success?await t.success(e):t.success,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"success",message:n,description:o})}}).catch(async e=>{if(n=["reject",e],void 0!==t.error){a=!1;let n="function"==typeof t.error?await t.error(e):t.error,o="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"error",message:n,description:o})}}).finally(()=>{var e;a&&(this.dismiss(r),r=void 0),null==(e=t.finally)||e.call(t)}),s=()=>new Promise((e,t)=>i.then(()=>"reject"===n[0]?t(n[1]):e(n[1])).catch(t));return"string"!=typeof r&&"number"!=typeof r?{unwrap:s}:Object.assign(r,{unwrap:s})},this.custom=(e,t)=>{let r=(null==t?void 0:t.id)||Xdt++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},Jdt=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,ept=(e,t)=>{let r=(null==t?void 0:t.id)||Xdt++;return Qdt.addToast({title:e,...t,id:r}),r},tpt=Object.assign(ept,{success:Qdt.success,info:Qdt.info,warning:Qdt.warning,error:Qdt.error,custom:Qdt.custom,message:Qdt.message,promise:Qdt.promise,dismiss:Qdt.dismiss,loading:Qdt.loading},{getHistory:()=>Qdt.toasts,getToasts:()=>Qdt.getActiveToasts()});function rpt(e){return void 0!==e.label}!function(e,{insertAt:t}={}){if(typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n');var npt=3,opt=14;function apt(...e){return e.filter(Boolean).join(" ")}var ipt=t=>{var r,n,o,a,i,s,c,u,d,p,h;let{invert:f,toast:m,unstyled:v,interacting:y,setHeights:g,visibleToasts:x,heights:b,index:k,toasts:_,expanded:w,removeToast:M,defaultRichColors:C,closeButton:j,style:D,cancelButtonStyle:O,actionButtonStyle:S,className:P="",descriptionClassName:T="",duration:E,position:N,gap:z,loadingIcon:A,expandByDefault:R,classNames:F,icons:L,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:V}=t,[I,q]=l.default.useState(null),[$,H]=l.default.useState(null),[W,U]=l.default.useState(!1),[Y,Z]=l.default.useState(!1),[K,G]=l.default.useState(!1),[X,Q]=l.default.useState(!1),[J,ee]=l.default.useState(!1),[te,re]=l.default.useState(0),[ne,oe]=l.default.useState(0),ae=l.default.useRef(m.duration||E||4e3),ie=l.default.useRef(null),se=l.default.useRef(null),le=0===k,ce=k+1<=x,ue=m.type,de=!1!==m.dismissible,pe=m.className||"",he=m.descriptionClassName||"",fe=l.default.useMemo(()=>b.findIndex(e=>e.toastId===m.id)||0,[b,m.id]),me=l.default.useMemo(()=>{var e;return null!=(e=m.closeButton)?e:j},[m.closeButton,j]),ve=l.default.useMemo(()=>m.duration||E||4e3,[m.duration,E]),ye=l.default.useRef(0),ge=l.default.useRef(0),xe=l.default.useRef(0),be=l.default.useRef(null),[ke,_e]=N.split("-"),we=l.default.useMemo(()=>b.reduce((e,t,r)=>r>=fe?e:e+t.height,0),[b,fe]),Me=(()=>{let[e,t]=l.default.useState(document.hidden);return l.default.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),Ce=m.invert||f,je="loading"===ue;ge.current=l.default.useMemo(()=>fe*z+we,[fe,we]),l.default.useEffect(()=>{ae.current=ve},[ve]),l.default.useEffect(()=>{U(!0)},[]),l.default.useEffect(()=>{let e=se.current;if(e){let t=e.getBoundingClientRect().height;return oe(t),g(e=>[{toastId:m.id,height:t,position:m.position},...e]),()=>g(e=>e.filter(e=>e.toastId!==m.id))}},[g,m.id]),l.default.useLayoutEffect(()=>{if(!W)return;let e=se.current,t=e.style.height;e.style.height="auto";let r=e.getBoundingClientRect().height;e.style.height=t,oe(r),g(e=>e.find(e=>e.toastId===m.id)?e.map(e=>e.toastId===m.id?{...e,height:r}:e):[{toastId:m.id,height:r,position:m.position},...e])},[W,m.title,m.description,g,m.id]);let De=l.default.useCallback(()=>{Z(!0),re(ge.current),g(e=>e.filter(e=>e.toastId!==m.id)),setTimeout(()=>{M(m)},200)},[m,M,g,ge]);return l.default.useEffect(()=>{if(m.promise&&"loading"===ue||m.duration===1/0||"loading"===m.type)return;let e;return w||y||V&&Me?(()=>{if(xe.current<ye.current){let e=(new Date).getTime()-ye.current;ae.current=ae.current-e}xe.current=(new Date).getTime()})():ae.current!==1/0&&(ye.current=(new Date).getTime(),e=setTimeout(()=>{var e;null==(e=m.onAutoClose)||e.call(m,m),De()},ae.current)),()=>clearTimeout(e)},[w,y,m,ue,V,Me,De]),l.default.useEffect(()=>{m.delete&&De()},[De,m.delete]),l.default.createElement("li",{tabIndex:0,ref:se,className:apt(P,pe,null==F?void 0:F.toast,null==(r=null==m?void 0:m.classNames)?void 0:r.toast,null==F?void 0:F.default,null==F?void 0:F[ue],null==(n=null==m?void 0:m.classNames)?void 0:n[ue]),"data-sonner-toast":"","data-rich-colors":null!=(o=m.richColors)?o:C,"data-styled":!(m.jsx||m.unstyled||v),"data-mounted":W,"data-promise":!!m.promise,"data-swiped":J,"data-removed":Y,"data-visible":ce,"data-y-position":ke,"data-x-position":_e,"data-index":k,"data-front":le,"data-swiping":K,"data-dismissible":de,"data-type":ue,"data-invert":Ce,"data-swipe-out":X,"data-swipe-direction":$,"data-expanded":!!(w||R&&W),style:{"--index":k,"--toasts-before":k,"--z-index":_.length-k,"--offset":`${Y?te:ge.current}px`,"--initial-height":R?"auto":`${ne}px`,...D,...m.style},onDragEnd:()=>{G(!1),q(null),be.current=null},onPointerDown:e=>{je||!de||(ie.current=new Date,re(ge.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(G(!0),be.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,r,n;if(X||!de)return;be.current=null;let o=Number((null==(e=se.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),a=Number((null==(t=se.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),i=(new Date).getTime()-(null==(r=ie.current)?void 0:r.getTime()),s="x"===I?o:a,l=Math.abs(s)/i;if(Math.abs(s)>=20||l>.11)return re(ge.current),null==(n=m.onDismiss)||n.call(m,m),H("x"===I?o>0?"right":"left":a>0?"down":"up"),De(),Q(!0),void ee(!1);G(!1),q(null)},onPointerMove:e=>{var r,n,o,a;if(!be.current||!de||(null==(r=window.getSelection())?void 0:r.toString().length)>0)return;let i=e.clientY-be.current.y,s=e.clientX-be.current.x,l=null!=(n=t.swipeDirections)?n:function(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}(N);!I&&(Math.abs(s)>1||Math.abs(i)>1)&&q(Math.abs(s)>Math.abs(i)?"x":"y");let c={x:0,y:0};"y"===I?(l.includes("top")||l.includes("bottom"))&&(l.includes("top")&&i<0||l.includes("bottom")&&i>0)&&(c.y=i):"x"===I&&(l.includes("left")||l.includes("right"))&&(l.includes("left")&&s<0||l.includes("right")&&s>0)&&(c.x=s),(Math.abs(c.x)>0||Math.abs(c.y)>0)&&ee(!0),null==(o=se.current)||o.style.setProperty("--swipe-amount-x",`${c.x}px`),null==(a=se.current)||a.style.setProperty("--swipe-amount-y",`${c.y}px`)}},me&&!m.jsx?l.default.createElement("button",{"aria-label":B,"data-disabled":je,"data-close-button":!0,onClick:je||!de?()=>{}:()=>{var e;De(),null==(e=m.onDismiss)||e.call(m,m)},className:apt(null==F?void 0:F.closeButton,null==(a=null==m?void 0:m.classNames)?void 0:a.closeButton)},null!=(i=null==L?void 0:L.close)?i:Gdt):null,m.jsx||e.isValidElement(m.title)?m.jsx?m.jsx:"function"==typeof m.title?m.title():m.title:l.default.createElement(l.default.Fragment,null,ue||m.icon||m.promise?l.default.createElement("div",{"data-icon":"",className:apt(null==F?void 0:F.icon,null==(s=null==m?void 0:m.classNames)?void 0:s.icon)},m.promise||"loading"===m.type&&!m.icon?m.icon||(null!=L&&L.loading?l.default.createElement("div",{className:apt(null==F?void 0:F.loader,null==(Oe=null==m?void 0:m.classNames)?void 0:Oe.loader,"sonner-loader"),"data-visible":"loading"===ue},L.loading):A?l.default.createElement("div",{className:apt(null==F?void 0:F.loader,null==(Se=null==m?void 0:m.classNames)?void 0:Se.loader,"sonner-loader"),"data-visible":"loading"===ue},A):l.default.createElement(Wdt,{className:apt(null==F?void 0:F.loader,null==(Pe=null==m?void 0:m.classNames)?void 0:Pe.loader),visible:"loading"===ue})):null,"loading"!==m.type?m.icon||(null==L?void 0:L[ue])||(e=>{switch(e){case"success":return Udt;case"info":return Zdt;case"warning":return Ydt;case"error":return Kdt;default:return null}})(ue):null):null,l.default.createElement("div",{"data-content":"",className:apt(null==F?void 0:F.content,null==(c=null==m?void 0:m.classNames)?void 0:c.content)},l.default.createElement("div",{"data-title":"",className:apt(null==F?void 0:F.title,null==(u=null==m?void 0:m.classNames)?void 0:u.title)},"function"==typeof m.title?m.title():m.title),m.description?l.default.createElement("div",{"data-description":"",className:apt(T,he,null==F?void 0:F.description,null==(d=null==m?void 0:m.classNames)?void 0:d.description)},"function"==typeof m.description?m.description():m.description):null),e.isValidElement(m.cancel)?m.cancel:m.cancel&&rpt(m.cancel)?l.default.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||O,onClick:e=>{var t,r;rpt(m.cancel)&&de&&(null==(r=(t=m.cancel).onClick)||r.call(t,e),De())},className:apt(null==F?void 0:F.cancelButton,null==(p=null==m?void 0:m.classNames)?void 0:p.cancelButton)},m.cancel.label):null,e.isValidElement(m.action)?m.action:m.action&&rpt(m.action)?l.default.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||S,onClick:e=>{var t,r;rpt(m.action)&&(null==(r=(t=m.action).onClick)||r.call(t,e),!e.defaultPrevented&&De())},className:apt(null==F?void 0:F.actionButton,null==(h=null==m?void 0:m.classNames)?void 0:h.actionButton)},m.action.label):null));var Oe,Se,Pe};function spt(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}function lpt(e,t){let r={};return[e,t].forEach((e,t)=>{let n=1===t,o=n?"--mobile-offset":"--offset",a=n?"16px":"32px";function i(e){["top","right","bottom","left"].forEach(t=>{r[`${o}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?i(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?r[`${o}-${t}`]=a:r[`${o}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):i(a)}),r}e.forwardRef(function(e,t){let{invert:r,position:n="bottom-right",hotkey:o=["altKey","KeyT"],expand:a,closeButton:i,className:s,offset:c,mobileOffset:d,theme:p="light",richColors:h,duration:f,style:m,visibleToasts:v=npt,toastOptions:y,dir:g=spt(),gap:x=opt,loadingIcon:b,icons:k,containerAriaLabel:_="Notifications",pauseWhenPageIsHidden:w}=e,[M,C]=l.default.useState([]),j=l.default.useMemo(()=>Array.from(new Set([n].concat(M.filter(e=>e.position).map(e=>e.position)))),[M,n]),[D,O]=l.default.useState([]),[S,P]=l.default.useState(!1),[T,E]=l.default.useState(!1),[N,z]=l.default.useState("system"!==p?p:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),A=l.default.useRef(null),R=o.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=l.default.useRef(null),L=l.default.useRef(!1),B=l.default.useCallback(e=>{C(t=>{var r;return null!=(r=t.find(t=>t.id===e.id))&&r.delete||Qdt.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return l.default.useEffect(()=>Qdt.subscribe(e=>{e.dismiss?C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t)):setTimeout(()=>{u.default.flushSync(()=>{C(t=>{let r=t.findIndex(t=>t.id===e.id);return-1!==r?[...t.slice(0,r),{...t[r],...e},...t.slice(r+1)]:[e,...t]})})})}),[]),l.default.useEffect(()=>{if("system"!==p)return void z(p);if("system"===p&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?z("dark"):z("light")),typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{z(e?"dark":"light")})}catch{e.addListener(({matches:e})=>{try{z(e?"dark":"light")}catch(e){console.error(e)}})}},[p]),l.default.useEffect(()=>{M.length<=1&&P(!1)},[M]),l.default.useEffect(()=>{let e=e=>{var t,r;o.every(t=>e[t]||e.code===t)&&(P(!0),null==(t=A.current)||t.focus()),"Escape"===e.code&&(document.activeElement===A.current||null!=(r=A.current)&&r.contains(document.activeElement))&&P(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[o]),l.default.useEffect(()=>{if(A.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,L.current=!1)}},[A.current]),l.default.createElement("section",{ref:t,"aria-label":`${_} ${R}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},j.map((t,n)=>{var o;let[u,p]=t.split("-");return M.length?l.default.createElement("ol",{key:t,dir:"auto"===g?spt():g,tabIndex:-1,ref:A,className:s,"data-sonner-toaster":!0,"data-theme":N,"data-y-position":u,"data-lifted":S&&M.length>1&&!a,"data-x-position":p,style:{"--front-toast-height":`${(null==(o=D[0])?void 0:o.height)||0}px`,"--width":"356px","--gap":`${x}px`,...m,...lpt(c,d)},onBlur:e=>{L.current&&!e.currentTarget.contains(e.relatedTarget)&&(L.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||L.current||(L.current=!0,F.current=e.relatedTarget)},onMouseEnter:()=>P(!0),onMouseMove:()=>P(!0),onMouseLeave:()=>{T||P(!1)},onDragEnd:()=>P(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||E(!0)},onPointerUp:()=>E(!1)},M.filter(e=>!e.position&&0===n||e.position===t).map((n,o)=>{var s,c;return l.default.createElement(ipt,{key:n.id,icons:k,index:o,toast:n,defaultRichColors:h,duration:null!=(s=null==y?void 0:y.duration)?s:f,className:null==y?void 0:y.className,descriptionClassName:null==y?void 0:y.descriptionClassName,invert:r,visibleToasts:v,closeButton:null!=(c=null==y?void 0:y.closeButton)?c:i,interacting:T,position:t,style:null==y?void 0:y.style,unstyled:null==y?void 0:y.unstyled,classNames:null==y?void 0:y.classNames,cancelButtonStyle:null==y?void 0:y.cancelButtonStyle,actionButtonStyle:null==y?void 0:y.actionButtonStyle,removeToast:B,toasts:M.filter(e=>e.position==n.position),heights:D.filter(e=>e.position==n.position),setHeights:O,expandByDefault:a,gap:x,loadingIcon:b,expanded:S,pauseWhenPageIsHidden:w,swipeDirections:e.swipeDirections})})):null}))});var cpt=e=>"checkbox"===e.type,upt=e=>e instanceof Date,dpt=e=>null==e;const ppt=e=>"object"==typeof e;var hpt=e=>!dpt(e)&&!Array.isArray(e)&&ppt(e)&&!upt(e),fpt=e=>hpt(e)&&e.target?cpt(e.target)?e.target.checked:e.target.value:e,mpt=(e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)),vpt=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ypt(e){let t;const r=Array.isArray(e),n=typeof FileList<"u"&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else{if(vpt&&(e instanceof Blob||n)||!r&&!hpt(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return hpt(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=ypt(e[r]));else t=e}return t}var gpt=e=>/^\w*$/.test(e),xpt=e=>void 0===e,bpt=e=>Array.isArray(e)?e.filter(Boolean):[],kpt=e=>bpt(e.replace(/["|']|\]/g,"").split(/\.|\[/)),_pt=(e,t,r)=>{if(!t||!hpt(e))return r;const n=(gpt(t)?[t]:kpt(t)).reduce((e,t)=>dpt(e)?e:e[t],e);return xpt(n)||n===e?xpt(e[t])?r:e[t]:n},wpt=e=>"boolean"==typeof e,Mpt=(e,t,r)=>{let n=-1;const o=gpt(t)?[t]:kpt(t),a=o.length,i=a-1;for(;++n<a;){const t=o[n];let a=r;if(n!==i){const r=e[t];a=hpt(r)||Array.isArray(r)?r:isNaN(+o[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=a,e=e[t]}};const Cpt="blur",jpt="focusout",Dpt="change",Opt="onBlur",Spt="onChange",Ppt="onSubmit",Tpt="onTouched",Ept="all",Npt="max",zpt="min",Apt="maxLength",Rpt="minLength",Fpt="pattern",Lpt="required",Bpt="validate",Vpt=l.default.createContext(null);Vpt.displayName="HookFormContext";const Ipt=()=>l.default.useContext(Vpt);var qpt=(e,t,r,n=!0)=>{const o={defaultValues:t._defaultValues};for(const a in e)Object.defineProperty(o,a,{get:()=>{const o=a;return t._proxyFormState[o]!==Ept&&(t._proxyFormState[o]=!n||Ept),r&&(r[o]=!0),e[o]}});return o};const $pt=typeof window<"u"?s.useLayoutEffect:s.useEffect;var Hpt=e=>"string"==typeof e,Wpt=(e,t,r,n,o)=>Hpt(e)?(n&&t.watch.add(e),_pt(r,e,o)):Array.isArray(e)?e.map(e=>(n&&t.watch.add(e),_pt(r,e))):(n&&(t.watchAll=!0),r);function Upt(e){const t=Ipt(),{name:r,disabled:n,control:o=t.control,shouldUnregister:a}=e,i=mpt(o._names.array,r),s=function(e){const t=Ipt(),{control:r=t.control,name:n,defaultValue:o,disabled:a,exact:i}=e||{},s=l.default.useRef(o),[c,u]=l.default.useState(r._getWatch(n,s.current));return $pt(()=>r._subscribe({name:n,formState:{values:!0},exact:i,callback:e=>!a&&u(Wpt(n,r._names,e.values||r._formValues,!1,s.current))}),[n,r,a,i]),l.default.useEffect(()=>r._removeUnmounted()),c}({control:o,name:r,defaultValue:_pt(o._formValues,r,_pt(o._defaultValues,r,e.defaultValue)),exact:!0}),c=function(e){const t=Ipt(),{control:r=t.control,disabled:n,name:o,exact:a}=e||{},[i,s]=l.default.useState(r._formState),c=l.default.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return $pt(()=>r._subscribe({name:o,formState:c.current,exact:a,callback:e=>{!n&&s({...r._formState,...e})}}),[o,n,a]),l.default.useEffect(()=>{c.current.isValid&&r._setValid(!0)},[r]),l.default.useMemo(()=>qpt(i,r,c.current,!1),[i,r])}({control:o,name:r,exact:!0}),u=l.default.useRef(e),d=l.default.useRef(o.register(r,{...e.rules,value:s,...wpt(e.disabled)?{disabled:e.disabled}:{}})),p=l.default.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!_pt(c.errors,r)},isDirty:{enumerable:!0,get:()=>!!_pt(c.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!_pt(c.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!_pt(c.validatingFields,r)},error:{enumerable:!0,get:()=>_pt(c.errors,r)}}),[c,r]),h=l.default.useCallback(e=>d.current.onChange({target:{value:fpt(e),name:r},type:Dpt}),[r]),f=l.default.useCallback(()=>d.current.onBlur({target:{value:_pt(o._formValues,r),name:r},type:Cpt}),[r,o._formValues]),m=l.default.useCallback(e=>{const t=_pt(o._fields,r);t&&e&&(t._f.ref={focus:()=>e.focus&&e.focus(),select:()=>e.select&&e.select(),setCustomValidity:t=>e.setCustomValidity(t),reportValidity:()=>e.reportValidity()})},[o._fields,r]),v=l.default.useMemo(()=>({name:r,value:s,...wpt(n)||c.disabled?{disabled:c.disabled||n}:{},onChange:h,onBlur:f,ref:m}),[r,n,c.disabled,h,f,m,s]);return l.default.useEffect(()=>{const e=o._options.shouldUnregister||a;o.register(r,{...u.current.rules,...wpt(u.current.disabled)?{disabled:u.current.disabled}:{}});const t=(e,t)=>{const r=_pt(o._fields,e);r&&r._f&&(r._f.mount=t)};if(t(r,!0),e){const e=ypt(_pt(o._options.defaultValues,r));Mpt(o._defaultValues,r,e),xpt(_pt(o._formValues,r))&&Mpt(o._formValues,r,e)}return!i&&o.register(r),()=>{(i?e&&!o._state.action:e)?o.unregister(r):t(r,!1)}},[r,o,i,a]),l.default.useEffect(()=>{o._setDisabledField({disabled:n,name:r})},[n,r,o]),l.default.useMemo(()=>({field:v,formState:c,fieldState:p}),[v,c,p])}const Ypt=e=>e.render(Upt(e));var Zpt=(e,t,r,n,o)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:o||!0}}:{},Kpt=e=>Array.isArray(e)?e:[e],Gpt=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}},Xpt=e=>dpt(e)||!ppt(e);function Qpt(e,t,r=new WeakSet){if(Xpt(e)||Xpt(t))return e===t;if(upt(e)&&upt(t))return e.getTime()===t.getTime();const n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;if(r.has(e)||r.has(t))return!0;r.add(e),r.add(t);for(const a of n){const n=e[a];if(!o.includes(a))return!1;if("ref"!==a){const e=t[a];if(upt(n)&&upt(e)||hpt(n)&&hpt(e)||Array.isArray(n)&&Array.isArray(e)?!Qpt(n,e,r):n!==e)return!1}}return!0}var Jpt=e=>hpt(e)&&!Object.keys(e).length,eht=e=>"file"===e.type,tht=e=>"function"==typeof e,rht=e=>{if(!vpt)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},nht=e=>"select-multiple"===e.type,oht=e=>"radio"===e.type,aht=e=>rht(e)&&e.isConnected;function iht(e,t){const r=Array.isArray(t)?t:gpt(t)?[t]:kpt(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=xpt(e)?n++:e[t[n++]];return e}(e,r),o=r.length-1,a=r[o];return n&&delete n[a],0!==o&&(hpt(n)&&Jpt(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!xpt(e[t]))return!1;return!0}(n))&&iht(e,r.slice(0,-1)),e}var sht=e=>{for(const t in e)if(tht(e[t]))return!0;return!1};function lht(e,t={}){const r=Array.isArray(e);if(hpt(e)||r)for(const r in e)Array.isArray(e[r])||hpt(e[r])&&!sht(e[r])?(t[r]=Array.isArray(e[r])?[]:{},lht(e[r],t[r])):dpt(e[r])||(t[r]=!0);return t}function cht(e,t,r){const n=Array.isArray(e);if(hpt(e)||n)for(const n in e)Array.isArray(e[n])||hpt(e[n])&&!sht(e[n])?xpt(t)||Xpt(r[n])?r[n]=Array.isArray(e[n])?lht(e[n],[]):{...lht(e[n])}:cht(e[n],dpt(t)?{}:t[n],r[n]):r[n]=!Qpt(e[n],t[n]);return r}var uht=(e,t)=>cht(e,t,lht(t));const dht={value:!1,isValid:!1},pht={value:!0,isValid:!0};var hht=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!xpt(e[0].attributes.value)?xpt(e[0].value)||""===e[0].value?pht:{value:e[0].value,isValid:!0}:pht:dht}return dht},fht=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>xpt(e)?e:t?""===e?NaN:e&&+e:r&&Hpt(e)?new Date(e):n?n(e):e;const mht={isValid:!1,value:null};var vht=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,mht):mht;function yht(e){const t=e.ref;return eht(t)?t.files:oht(t)?vht(e.refs).value:nht(t)?[...t.selectedOptions].map(({value:e})=>e):cpt(t)?hht(e.refs).value:fht(xpt(t.value)?e.ref.value:t.value,e)}var ght=e=>e instanceof RegExp,xht=e=>xpt(e)?e:ght(e)?e.source:hpt(e)?ght(e.value)?e.value.source:e.value:e,bht=e=>({isOnSubmit:!e||e===Ppt,isOnBlur:e===Opt,isOnChange:e===Spt,isOnAll:e===Ept,isOnTouch:e===Tpt});const kht="AsyncFunction";var _ht=e=>!!e&&!!e.validate&&!!(tht(e.validate)&&e.validate.constructor.name===kht||hpt(e.validate)&&Object.values(e.validate).find(e=>e.constructor.name===kht)),wht=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some(t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length))));const Mht=(e,t,r,n)=>{for(const o of r||Object.keys(e)){const r=_pt(e,o);if(r){const{_f:e,...a}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],o)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(Mht(a,t))break}else if(hpt(a)&&Mht(a,t))break}}};function Cht(e,t,r){const n=_pt(e,r);if(n||gpt(r))return{error:n,name:r};const o=r.split(".");for(;o.length;){const n=o.join("."),a=_pt(t,n),i=_pt(e,n);if(a&&!Array.isArray(a)&&r!==n)return{name:r};if(i&&i.type)return{name:n,error:i};if(i&&i.root&&i.root.type)return{name:`${n}.root`,error:i.root};o.pop()}return{name:r}}var jht=(e,t,r)=>{const n=Kpt(_pt(e,r));return Mpt(n,"root",t[r]),Mpt(e,r,n),e},Dht=e=>Hpt(e);function Oht(e,t,r="validate"){if(Dht(e)||Array.isArray(e)&&e.every(Dht)||wpt(e)&&!e)return{type:r,message:Dht(e)?e:"",ref:t}}var Sht=e=>hpt(e)&&!ght(e)?e:{value:e,message:""},Pht=async(e,t,r,n,o,a)=>{const{ref:i,refs:s,required:l,maxLength:c,minLength:u,min:d,max:p,pattern:h,validate:f,name:m,valueAsNumber:v,mount:y}=e._f,g=_pt(r,m);if(!y||t.has(m))return{};const x=s?s[0]:i,b=e=>{o&&x.reportValidity&&(x.setCustomValidity(wpt(e)?"":e||""),x.reportValidity())},k={},_=oht(i),w=cpt(i),M=_||w,C=(v||eht(i))&&xpt(i.value)&&xpt(g)||rht(i)&&""===i.value||""===g||Array.isArray(g)&&!g.length,j=Zpt.bind(null,m,n,k),D=(e,t,r,n=Apt,o=Rpt)=>{const a=e?t:r;k[m]={type:e?n:o,message:a,ref:i,...j(e?n:o,a)}};if(a?!Array.isArray(g)||!g.length:l&&(!M&&(C||dpt(g))||wpt(g)&&!g||w&&!hht(s).isValid||_&&!vht(s).isValid)){const{value:e,message:t}=Dht(l)?{value:!!l,message:l}:Sht(l);if(e&&(k[m]={type:Lpt,message:t,ref:x,...j(Lpt,t)},!n))return b(t),k}if(!(C||dpt(d)&&dpt(p))){let e,t;const r=Sht(p),o=Sht(d);if(dpt(g)||isNaN(g)){const n=i.valueAsDate||new Date(g),a=e=>new Date((new Date).toDateString()+" "+e),s="time"==i.type,l="week"==i.type;Hpt(r.value)&&g&&(e=s?a(g)>a(r.value):l?g>r.value:n>new Date(r.value)),Hpt(o.value)&&g&&(t=s?a(g)<a(o.value):l?g<o.value:n<new Date(o.value))}else{const n=i.valueAsNumber||g&&+g;dpt(r.value)||(e=n>r.value),dpt(o.value)||(t=n<o.value)}if((e||t)&&(D(!!e,r.message,o.message,Npt,zpt),!n))return b(k[m].message),k}if((c||u)&&!C&&(Hpt(g)||a&&Array.isArray(g))){const e=Sht(c),t=Sht(u),r=!dpt(e.value)&&g.length>+e.value,o=!dpt(t.value)&&g.length<+t.value;if((r||o)&&(D(r,e.message,t.message),!n))return b(k[m].message),k}if(h&&!C&&Hpt(g)){const{value:e,message:t}=Sht(h);if(ght(e)&&!g.match(e)&&(k[m]={type:Fpt,message:t,ref:i,...j(Fpt,t)},!n))return b(t),k}if(f)if(tht(f)){const e=Oht(await f(g,r),x);if(e&&(k[m]={...e,...j(Bpt,e.message)},!n))return b(e.message),k}else if(hpt(f)){let e={};for(const t in f){if(!Jpt(e)&&!n)break;const o=Oht(await f[t](g,r),x,t);o&&(e={...o,...j(t,o.message)},b(o.message),n&&(k[m]=e))}if(!Jpt(e)&&(k[m]={ref:x,...e},!n))return k}return b(!0),k};const Tht={mode:Ppt,reValidateMode:Spt,shouldFocusError:!0};function Eht(e={}){let t,r={...Tht,...e},n={submitCount:0,isDirty:!1,isReady:!1,isLoading:tht(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},o={},a=(hpt(r.defaultValues)||hpt(r.values))&&ypt(r.defaultValues||r.values)||{},i=r.shouldUnregister?{}:ypt(a),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let d={...u};const p={array:Gpt(),state:Gpt()},h=r.criteriaMode===Ept,f=async e=>{if(!r.disabled&&(u.isValid||d.isValid||e)){const e=r.resolver?Jpt((await x()).errors):await b(o,!0);e!==n.isValid&&p.state.next({isValid:e})}},m=(e,t)=>{!r.disabled&&(u.isValidating||u.validatingFields||d.isValidating||d.validatingFields)&&((e||Array.from(l.mount)).forEach(e=>{e&&(t?Mpt(n.validatingFields,e,t):iht(n.validatingFields,e))}),p.state.next({validatingFields:n.validatingFields,isValidating:!Jpt(n.validatingFields)}))},v=(e,t,r,n)=>{const l=_pt(o,e);if(l){const o=_pt(i,e,xpt(r)?_pt(a,e):r);xpt(o)||n&&n.defaultChecked||t?Mpt(i,e,t?o:yht(l._f)):w(e,o),s.mount&&f()}},y=(e,t,o,i,s)=>{let l=!1,c=!1;const h={name:e};if(!r.disabled){if(!o||i){(u.isDirty||d.isDirty)&&(c=n.isDirty,n.isDirty=h.isDirty=k(),l=c!==h.isDirty);const r=Qpt(_pt(a,e),t);c=!!_pt(n.dirtyFields,e),r?iht(n.dirtyFields,e):Mpt(n.dirtyFields,e,!0),h.dirtyFields=n.dirtyFields,l=l||(u.dirtyFields||d.dirtyFields)&&c!==!r}if(o){const t=_pt(n.touchedFields,e);t||(Mpt(n.touchedFields,e,o),h.touchedFields=n.touchedFields,l=l||(u.touchedFields||d.touchedFields)&&t!==o)}l&&s&&p.state.next(h)}return l?h:{}},g=(e,o,a,i)=>{const s=_pt(n.errors,e),l=(u.isValid||d.isValid)&&wpt(o)&&n.isValid!==o;if(r.delayError&&a?(t=(e=>t=>{clearTimeout(c),c=setTimeout(e,t)})(()=>((e,t)=>{Mpt(n.errors,e,t),p.state.next({errors:n.errors})})(e,a)),t(r.delayError)):(clearTimeout(c),t=null,a?Mpt(n.errors,e,a):iht(n.errors,e)),(a?!Qpt(s,a):s)||!Jpt(i)||l){const t={...i,...l&&wpt(o)?{isValid:o}:{},errors:n.errors,name:e};n={...n,...t},p.state.next(t)}},x=async e=>{m(e,!0);const t=await r.resolver(i,r.context,((e,t,r,n)=>{const o={};for(const r of e){const e=_pt(t,r);e&&Mpt(o,r,e._f)}return{criteriaMode:r,names:[...e],fields:o,shouldUseNativeValidation:n}})(e||l.mount,o,r.criteriaMode,r.shouldUseNativeValidation));return m(e),t},b=async(e,t,o={valid:!0})=>{for(const a in e){const s=e[a];if(s){const{_f:e,...c}=s;if(e){const c=l.array.has(e.name),d=s._f&&_ht(s._f);d&&u.validatingFields&&m([a],!0);const p=await Pht(s,l.disabled,i,h,r.shouldUseNativeValidation&&!t,c);if(d&&u.validatingFields&&m([a]),p[e.name]&&(o.valid=!1,t))break;!t&&(_pt(p,e.name)?c?jht(n.errors,p,e.name):Mpt(n.errors,e.name,p[e.name]):iht(n.errors,e.name))}!Jpt(c)&&await b(c,t,o)}}return o.valid},k=(e,t)=>!r.disabled&&(e&&t&&Mpt(i,e,t),!Qpt(S(),a)),_=(e,t,r)=>Wpt(e,l,{...s.mount?i:xpt(t)?a:Hpt(e)?{[e]:t}:t},r,t),w=(e,t,r={})=>{const n=_pt(o,e);let a=t;if(n){const r=n._f;r&&(!r.disabled&&Mpt(i,e,fht(t,r)),a=rht(r.ref)&&dpt(t)?"":t,nht(r.ref)?[...r.ref.options].forEach(e=>e.selected=a.includes(e.value)):r.refs?cpt(r.ref)?r.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(Array.isArray(a)?e.checked=!!a.find(t=>t===e.value):e.checked=a===e.value||!!a)}):r.refs.forEach(e=>e.checked=e.value===a):eht(r.ref)?r.ref.value="":(r.ref.value=a,r.ref.type||p.state.next({name:e,values:ypt(i)})))}(r.shouldDirty||r.shouldTouch)&&y(e,a,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&O(e)},M=(e,t,r)=>{for(const n in t){if(!t.hasOwnProperty(n))return;const a=t[n],i=e+"."+n,s=_pt(o,i);(l.array.has(e)||hpt(a)||s&&!s._f)&&!upt(a)?M(i,a,r):w(i,a,r)}},C=(e,t,r={})=>{const c=_pt(o,e),h=l.array.has(e),f=ypt(t);Mpt(i,e,f),h?(p.array.next({name:e,values:ypt(i)}),(u.isDirty||u.dirtyFields||d.isDirty||d.dirtyFields)&&r.shouldDirty&&p.state.next({name:e,dirtyFields:uht(a,i),isDirty:k(e,f)})):!c||c._f||dpt(f)?w(e,f,r):M(e,f,r),wht(e,l)&&p.state.next({...n}),p.state.next({name:s.mount?e:void 0,values:ypt(i)})},j=async e=>{s.mount=!0;const a=e.target;let c=a.name,v=!0;const k=_pt(o,c),_=e=>{v=Number.isNaN(e)||upt(e)&&isNaN(e.getTime())||Qpt(e,_pt(i,c,e))},w=bht(r.mode),M=bht(r.reValidateMode);if(k){let s,C;const j=a.type?yht(k._f):fpt(e),D=e.type===Cpt||e.type===jpt,S=!(e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate))(k._f)&&!r.resolver&&!_pt(n.errors,c)&&!k._f.deps||((e,t,r,n,o)=>!o.isOnAll&&(!r&&o.isOnTouch?!(t||e):(r?n.isOnBlur:o.isOnBlur)?!e:!(r?n.isOnChange:o.isOnChange)||e))(D,_pt(n.touchedFields,c),n.isSubmitted,M,w),P=wht(c,l,D);Mpt(i,c,j),D?(k._f.onBlur&&k._f.onBlur(e),t&&t(0)):k._f.onChange&&k._f.onChange(e);const T=y(c,j,D),E=!Jpt(T)||P;if(!D&&p.state.next({name:c,type:e.type,values:ypt(i)}),S)return(u.isValid||d.isValid)&&("onBlur"===r.mode?D&&f():D||f()),E&&p.state.next({name:c,...P?{}:T});if(!D&&P&&p.state.next({...n}),r.resolver){const{errors:e}=await x([c]);if(_(j),v){const t=Cht(n.errors,o,c),r=Cht(e,o,t.name||c);s=r.error,c=r.name,C=Jpt(e)}}else m([c],!0),s=(await Pht(k,l.disabled,i,h,r.shouldUseNativeValidation))[c],m([c]),_(j),v&&(s?C=!1:(u.isValid||d.isValid)&&(C=await b(o,!0)));v&&(k._f.deps&&O(k._f.deps),g(c,C,s,T))}},D=(e,t)=>{if(_pt(n.errors,t)&&e.focus)return e.focus(),1},O=async(e,t={})=>{let a,i;const s=Kpt(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await x(e);if(e)for(const r of e){const e=_pt(t,r);e?Mpt(n.errors,r,e):iht(n.errors,r)}else n.errors=t;return t})(xpt(e)?e:s);a=Jpt(t),i=e?!s.some(e=>_pt(t,e)):a}else e?(i=(await Promise.all(s.map(async e=>{const t=_pt(o,e);return await b(t&&t._f?{[e]:t}:t)}))).every(Boolean),(i||n.isValid)&&f()):i=a=await b(o);return p.state.next({...!Hpt(e)||(u.isValid||d.isValid)&&a!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:a}:{},errors:n.errors}),t.shouldFocus&&!i&&Mht(o,D,e?s:l.mount),i},S=e=>{const t={...s.mount?i:a};return xpt(e)?t:Hpt(e)?_pt(t,e):e.map(e=>_pt(t,e))},P=(e,t)=>({invalid:!!_pt((t||n).errors,e),isDirty:!!_pt((t||n).dirtyFields,e),error:_pt((t||n).errors,e),isValidating:!!_pt(n.validatingFields,e),isTouched:!!_pt((t||n).touchedFields,e)}),T=(e,t,r)=>{const a=(_pt(o,e,{_f:{}})._f||{}).ref,i=_pt(n.errors,e)||{},{ref:s,message:l,type:c,...u}=i;Mpt(n.errors,e,{...u,...t,ref:a}),p.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&a&&a.focus&&a.focus()},E=e=>p.state.subscribe({next:t=>{((e,t,r)=>!e||!t||e===t||Kpt(e).some(e=>e&&(r?e===t:e.startsWith(t)||t.startsWith(e))))(e.name,t.name,e.exact)&&((e,t,r,n)=>{r(e);const{name:o,...a}=e;return Jpt(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find(e=>t[e]===(!n||Ept))})(t,e.formState||u,V,e.reRenderRoot)&&e.callback({values:{...i},...n,...t})}}).unsubscribe,N=(e,t={})=>{for(const s of e?Kpt(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||(iht(o,s),iht(i,s)),!t.keepError&&iht(n.errors,s),!t.keepDirty&&iht(n.dirtyFields,s),!t.keepTouched&&iht(n.touchedFields,s),!t.keepIsValidating&&iht(n.validatingFields,s),!r.shouldUnregister&&!t.keepDefaultValue&&iht(a,s);p.state.next({values:ypt(i)}),p.state.next({...n,...t.keepDirty?{isDirty:k()}:{}}),!t.keepIsValid&&f()},z=({disabled:e,name:t})=>{(wpt(e)&&s.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t))},A=(e,t={})=>{let n=_pt(o,e);const i=wpt(t.disabled)||wpt(r.disabled);return Mpt(o,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?z({disabled:wpt(t.disabled)?t.disabled:r.disabled,name:e}):v(e,!0,t.value),{...i?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:xht(t.min),max:xht(t.max),minLength:xht(t.minLength),maxLength:xht(t.maxLength),pattern:xht(t.pattern)}:{},name:e,onChange:j,onBlur:j,ref:i=>{if(i){A(e,t),n=_pt(o,e);const r=xpt(i.value)&&i.querySelectorAll&&i.querySelectorAll("input,select,textarea")[0]||i,s=(e=>oht(e)||cpt(e))(r),l=n._f.refs||[];if(s?l.find(e=>e===r):r===n._f.ref)return;Mpt(o,e,{_f:{...n._f,...s?{refs:[...l.filter(aht),r,...Array.isArray(_pt(a,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),v(e,!1,void 0,r)}else n=_pt(o,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!mpt(l.array,e)||!s.action)&&l.unMount.add(e)}}},R=()=>r.shouldFocusError&&Mht(o,D,l.mount),F=(e,t)=>async a=>{let s;a&&(a.preventDefault&&a.preventDefault(),a.persist&&a.persist());let c=ypt(i);if(p.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await x();n.errors=e,c=ypt(t)}else await b(o);if(l.disabled.size)for(const e of l.disabled)iht(c,e);if(iht(n.errors,"root"),Jpt(n.errors)){p.state.next({errors:{}});try{await e(c,a)}catch(e){s=e}}else t&&await t({...n.errors},a),R(),setTimeout(R);if(p.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Jpt(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},L=(e,t={})=>{const c=e?ypt(e):a,d=ypt(c),h=Jpt(e),f=h?a:d;if(t.keepDefaultValues||(a=c),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(uht(a,i))]);for(const t of Array.from(e))_pt(n.dirtyFields,t)?Mpt(f,t,_pt(i,t)):C(t,_pt(f,t))}else{if(vpt&&xpt(e))for(const e of l.mount){const t=_pt(o,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(rht(e)){const t=e.closest("form");if(t){t.reset();break}}}}if(t.keepFieldsRef)for(const e of l.mount)C(e,_pt(f,e));else o={}}i=r.shouldUnregister?t.keepDefaultValues?ypt(a):{}:ypt(f),p.array.next({values:{...f}}),p.state.next({values:{...f}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!u.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!r.shouldUnregister,p.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!h&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||Qpt(e,a))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:h?{}:t.keepDirtyValues?t.keepDefaultValues&&i?uht(a,i):n.dirtyFields:t.keepDefaultValues&&e?uht(a,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},B=(e,t)=>L(tht(e)?e(i):e,t),V=e=>{n={...n,...e}},I={control:{register:A,unregister:N,getFieldState:P,handleSubmit:F,setError:T,_subscribe:E,_runSchema:x,_focusError:R,_getWatch:_,_getDirty:k,_setValid:f,_setFieldArray:(e,t=[],l,c,h=!0,f=!0)=>{if(c&&l&&!r.disabled){if(s.action=!0,f&&Array.isArray(_pt(o,e))){const t=l(_pt(o,e),c.argA,c.argB);h&&Mpt(o,e,t)}if(f&&Array.isArray(_pt(n.errors,e))){const t=l(_pt(n.errors,e),c.argA,c.argB);h&&Mpt(n.errors,e,t),((e,t)=>{!bpt(_pt(e,t)).length&&iht(e,t)})(n.errors,e)}if((u.touchedFields||d.touchedFields)&&f&&Array.isArray(_pt(n.touchedFields,e))){const t=l(_pt(n.touchedFields,e),c.argA,c.argB);h&&Mpt(n.touchedFields,e,t)}(u.dirtyFields||d.dirtyFields)&&(n.dirtyFields=uht(a,i)),p.state.next({name:e,isDirty:k(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Mpt(i,e,t)},_setDisabledField:z,_setErrors:e=>{n.errors=e,p.state.next({errors:n.errors,isValid:!1})},_getFieldArray:e=>bpt(_pt(s.mount?i:a,e,r.shouldUnregister?_pt(a,e,[]):[])),_reset:L,_resetDefaultValues:()=>tht(r.defaultValues)&&r.defaultValues().then(e=>{B(e,r.resetOptions),p.state.next({isLoading:!1})}),_removeUnmounted:()=>{for(const e of l.unMount){const t=_pt(o,e);t&&(t._f.refs?t._f.refs.every(e=>!aht(e)):!aht(t._f.ref))&&N(e)}l.unMount=new Set},_disableForm:e=>{wpt(e)&&(p.state.next({disabled:e}),Mht(o,(t,r)=>{const n=_pt(o,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach(t=>{t.disabled=n._f.disabled||e}))},0,!1))},_subjects:p,_proxyFormState:u,get _fields(){return o},get _formValues(){return i},get _state(){return s},set _state(e){s=e},get _defaultValues(){return a},get _names(){return l},set _names(e){l=e},get _formState(){return n},get _options(){return r},set _options(e){r={...r,...e}}},subscribe:e=>(s.mount=!0,d={...d,...e.formState},E({...e,formState:d})),trigger:O,register:A,handleSubmit:F,watch:(e,t)=>tht(e)?p.state.subscribe({next:r=>e(_(void 0,t),r)}):_(e,t,!0),setValue:C,getValues:S,reset:B,resetField:(e,t={})=>{_pt(o,e)&&(xpt(t.defaultValue)?C(e,ypt(_pt(a,e))):(C(e,t.defaultValue),Mpt(a,e,ypt(t.defaultValue))),t.keepTouched||iht(n.touchedFields,e),t.keepDirty||(iht(n.dirtyFields,e),n.isDirty=t.defaultValue?k(e,ypt(_pt(a,e))):k()),t.keepError||(iht(n.errors,e),u.isValid&&f()),p.state.next({...n}))},clearErrors:e=>{e&&Kpt(e).forEach(e=>iht(n.errors,e)),p.state.next({errors:e?n.errors:{}})},unregister:N,setError:T,setFocus:(e,t={})=>{const r=_pt(o,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&tht(e.select)&&e.select())}},getFieldState:P};return{...I,formControl:I}}const Nht=(e,t,r)=>{if(e&&"reportValidity"in e){const n=_pt(r,t);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},zht=(e,t)=>{for(const r in t.fields){const n=t.fields[r];n&&n.ref&&"reportValidity"in n.ref?Nht(n.ref,r,e):n.refs&&n.refs.forEach(t=>Nht(t,r,e))}},Aht=(e,t)=>{t.shouldUseNativeValidation&&zht(e,t);const r={};for(const n in e){const o=_pt(t.fields,n),a=Object.assign(e[n]||{},{ref:o&&o.ref});if(Rht(t.names||Object.keys(e),n)){const e=Object.assign({},_pt(r,n));Mpt(e,"root",a),Mpt(r,n,e)}else Mpt(r,n,a)}return r},Rht=(e,t)=>e.some(e=>e.startsWith(t+"."));var Fht=function(e,t){for(var r={};e.length;){var n=e[0],o=n.code,a=n.message,i=n.path.join(".");if(!r[i])if("unionErrors"in n){var s=n.unionErrors[0].errors[0];r[i]={message:s.message,type:s.code}}else r[i]={message:a,type:o};if("unionErrors"in n&&n.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var l=r[i].types,c=l&&l[n.code];r[i]=Zpt(i,t,r,o,c?[].concat(c,n.message):n.message)}e.shift()}return r},Lht=function(e,t,r){return void 0===r&&(r={}),function(n,o,a){try{return Promise.resolve(function(o,i){try{var s=Promise.resolve(e["sync"===r.mode?"parse":"parseAsync"](n,t)).then(function(e){return a.shouldUseNativeValidation&&zht({},a),{errors:{},values:r.raw?n:e}})}catch(e){return i(e)}return s&&s.then?s.then(void 0,i):s}(0,function(e){if(function(e){return Array.isArray(null==e?void 0:e.errors)}(e))return{values:{},errors:Aht(Fht(e.errors,!a.shouldUseNativeValidation&&"all"===a.criteriaMode),a)};throw e}))}catch(e){return Promise.reject(e)}}};const Bht=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,Vht=Vut,Iht=(e,t)=>r=>{var n;if(null==(null==t?void 0:t.variants))return Vht(e,null==r?void 0:r.class,null==r?void 0:r.className);const{variants:o,defaultVariants:a}=t,i=Object.keys(o).map(e=>{const t=null==r?void 0:r[e],n=null==a?void 0:a[e];if(null===t)return null;const i=Bht(t)||Bht(n);return o[e][i]}),s=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{}),l=null==t||null===(n=t.compoundVariants)||void 0===n?void 0:n.reduce((e,t)=>{let{class:r,className:n,...o}=t;return Object.entries(o).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...a,...s}[t]):{...a,...s}[t]===r})?[...e,r,n]:e},[]);return Vht(e,i,l,null==r?void 0:r.class,null==r?void 0:r.className)},qht=Iht("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),$ht=s.forwardRef(({className:e,variant:r,size:n,asChild:o=!1,...a},i)=>t.jsx(o?wlt:"button",{className:zdt(qht({variant:r,size:n,className:e})),ref:i,...a}));$ht.displayName="Button";var Hht=function(){return Hht=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Hht.apply(this,arguments)};function Wht(e,t,r){for(var n,o=0,a=t.length;o<a;o++)(n||!(o in t))&&(n||(n=Array.prototype.slice.call(t,0,o)),n[o]=t[o]);return e.concat(n||Array.prototype.slice.call(t))}function Uht(e){return"multiple"===e.mode}function Yht(e){return"range"===e.mode}function Zht(e){return"single"===e.mode}var Kht={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var Ght=Object.freeze({__proto__:null,formatCaption:function(e,t){return sst(e,"LLLL y",t)},formatDay:function(e,t){return sst(e,"d",t)},formatMonthCaption:function(e,t){return sst(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return sst(e,"cccccc",t)},formatYearCaption:function(e,t){return sst(e,"yyyy",t)}}),Xht=Object.freeze({__proto__:null,labelDay:function(e,t,r){return sst(e,"do MMMM (EEEE)",r)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return sst(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var Qht=e.createContext(void 0);function Jht(e){var r,n,o=e.initialProps,a={captionLayout:"buttons",classNames:Kht,formatters:Ght,labels:Xht,locale:zit,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:"default"},i=function(e){var t=e.fromYear,r=e.toYear,n=e.fromMonth,o=e.toMonth,a=e.fromDate,i=e.toDate;return n?a=kit(n):t&&(a=new Date(t,0,1)),o?i=xit(o):r&&(i=new Date(r,11,31)),{fromDate:a?iit(a):void 0,toDate:i?iit(i):void 0}}(o),s=i.fromDate,l=i.toDate,c=null!==(r=o.captionLayout)&&void 0!==r?r:a.captionLayout;"buttons"!==c&&(!s||!l)&&(c="buttons"),(Zht(o)||Uht(o)||Yht(o))&&(n=o.onSelect);var u=Hht(Hht(Hht({},a),o),{captionLayout:c,classNames:Hht(Hht({},a.classNames),o.classNames),components:Hht({},o.components),formatters:Hht(Hht({},a.formatters),o.formatters),fromDate:s,labels:Hht(Hht({},a.labels),o.labels),mode:o.mode||a.mode,modifiers:Hht(Hht({},a.modifiers),o.modifiers),modifiersClassNames:Hht(Hht({},a.modifiersClassNames),o.modifiersClassNames),onSelect:n,styles:Hht(Hht({},a.styles),o.styles),toDate:l});return t.jsx(Qht.Provider,{value:u,children:e.children})}function eft(){var t=e.useContext(Qht);if(!t)throw new Error("useDayPicker must be used within a DayPickerProvider.");return t}function tft(e){var r=eft(),n=r.locale,o=r.classNames,a=r.styles,i=r.formatters.formatCaption;return t.jsx("div",{className:o.caption_label,style:a.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:i(e.displayMonth,{locale:n})})}function rft(e){return t.jsx("svg",Hht({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:t.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function nft(e){var r,n,o=e.onChange,a=e.value,i=e.children,s=e.caption,l=e.className,c=e.style,u=eft(),d=null!==(n=null===(r=u.components)||void 0===r?void 0:r.IconDropdown)&&void 0!==n?n:rft;return t.jsxs("div",{className:l,style:c,children:[t.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),t.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:a,onChange:o,children:i}),t.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[s,t.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function oft(e){var r,n=eft(),o=n.fromDate,a=n.toDate,i=n.styles,s=n.locale,l=n.formatters.formatMonthCaption,c=n.classNames,u=n.components,d=n.labels.labelMonthDropdown;if(!o)return t.jsx(t.Fragment,{});if(!a)return t.jsx(t.Fragment,{});var p=[];if(fst(o,a))for(var h=kit(o),f=o.getMonth();f<=a.getMonth();f++)p.push(jst(h,f));else for(h=kit(new Date),f=0;f<=11;f++)p.push(jst(h,f));var m=null!==(r=null==u?void 0:u.Dropdown)&&void 0!==r?r:nft;return t.jsx(m,{name:"months","aria-label":d(),className:c.dropdown_month,style:i.dropdown_month,onChange:function(t){var r=Number(t.target.value),n=jst(kit(e.displayMonth),r);e.onChange(n)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:s}),children:p.map(function(e){return t.jsx("option",{value:e.getMonth(),children:l(e,{locale:s})},e.getMonth())})})}function aft(e){var r,n=e.displayMonth,o=eft(),a=o.fromDate,i=o.toDate,s=o.locale,l=o.styles,c=o.classNames,u=o.components,d=o.formatters.formatYearCaption,p=o.labels.labelYearDropdown,h=[];if(!a)return t.jsx(t.Fragment,{});if(!i)return t.jsx(t.Fragment,{});for(var f=a.getFullYear(),m=i.getFullYear(),v=f;v<=m;v++)h.push(Sst(wit(new Date),v));var y=null!==(r=null==u?void 0:u.Dropdown)&&void 0!==r?r:nft;return t.jsx(y,{name:"years","aria-label":p(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var r=Sst(kit(n),Number(t.target.value));e.onChange(r)},value:n.getFullYear(),caption:d(n,{locale:s}),children:h.map(function(e){return t.jsx("option",{value:e.getFullYear(),children:d(e,{locale:s})},e.getFullYear())})})}function ift(){var t=eft(),r=function(e){var t=e.month,r=e.defaultMonth,n=e.today,o=t||r||n||new Date,a=e.toDate,i=e.fromDate,s=e.numberOfMonths,l=void 0===s?1:s;return a&&mit(a,o)<0&&(o=Gat(a,-1*(l-1))),i&&mit(o,i)<0&&(o=i),kit(o)}(t),n=function(t,r){var n=e.useState(t),o=n[0];return[void 0===r?o:r,n[1]]}(r,t.month),o=n[0],a=n[1];return[o,function(e){var r;if(!t.disableNavigation){var n=kit(e);a(n),null===(r=t.onMonthChange)||void 0===r||r.call(t,n)}}]}var sft=e.createContext(void 0);function lft(e){var r=eft(),n=ift(),o=n[0],a=n[1],i=function(e,t){for(var r=t.reverseMonths,n=t.numberOfMonths,o=kit(e),a=mit(kit(Gat(o,n)),o),i=[],s=0;s<a;s++){var l=Gat(o,s);i.push(l)}return r&&(i=i.reverse()),i}(o,r),s=function(e,t){if(!t.disableNavigation){var r=t.toDate,n=t.pagedNavigation,o=t.numberOfMonths,a=void 0===o?1:o,i=n?a:1,s=kit(e);if(!r)return Gat(s,i);if(!(mit(r,e)<a))return Gat(s,i)}}(o,r),l=function(e,t){if(!t.disableNavigation){var r=t.fromDate,n=t.pagedNavigation,o=t.numberOfMonths,a=n?void 0===o?1:o:1,i=kit(e);if(!r)return Gat(i,-a);if(!(mit(i,r)<=0))return Gat(i,-a)}}(o,r),c=function(e){return i.some(function(t){return hst(e,t)})},u={currentMonth:o,displayMonths:i,goToMonth:a,goToDate:function(e,t){c(e)||(t&&pst(e,t)?a(Gat(e,1+-1*r.numberOfMonths)):a(e))},previousMonth:l,nextMonth:s,isDateDisplayed:c};return t.jsx(sft.Provider,{value:u,children:e.children})}function cft(){var t=e.useContext(sft);if(!t)throw new Error("useNavigation must be used within a NavigationProvider");return t}function uft(e){var r,n=eft(),o=n.classNames,a=n.styles,i=n.components,s=cft().goToMonth,l=function(t){s(Gat(t,e.displayIndex?-e.displayIndex:0))},c=null!==(r=null==i?void 0:i.CaptionLabel)&&void 0!==r?r:tft,u=t.jsx(c,{id:e.id,displayMonth:e.displayMonth});return t.jsxs("div",{className:o.caption_dropdowns,style:a.caption_dropdowns,children:[t.jsx("div",{className:o.vhidden,children:u}),t.jsx(oft,{onChange:l,displayMonth:e.displayMonth}),t.jsx(aft,{onChange:l,displayMonth:e.displayMonth})]})}function dft(e){return t.jsx("svg",Hht({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function pft(e){return t.jsx("svg",Hht({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var hft=e.forwardRef(function(e,r){var n=eft(),o=n.classNames,a=n.styles,i=[o.button_reset,o.button];e.className&&i.push(e.className);var s=i.join(" "),l=Hht(Hht({},a.button_reset),a.button);return e.style&&Object.assign(l,e.style),t.jsx("button",Hht({},e,{ref:r,type:"button",className:s,style:l}))});function fft(e){var r,n,o=eft(),a=o.dir,i=o.locale,s=o.classNames,l=o.styles,c=o.labels,u=c.labelPrevious,d=c.labelNext,p=o.components;if(!e.nextMonth&&!e.previousMonth)return t.jsx(t.Fragment,{});var h=u(e.previousMonth,{locale:i}),f=[s.nav_button,s.nav_button_previous].join(" "),m=d(e.nextMonth,{locale:i}),v=[s.nav_button,s.nav_button_next].join(" "),y=null!==(r=null==p?void 0:p.IconRight)&&void 0!==r?r:pft,g=null!==(n=null==p?void 0:p.IconLeft)&&void 0!==n?n:dft;return t.jsxs("div",{className:s.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(hft,{name:"previous-month","aria-label":h,className:f,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:"rtl"===a?t.jsx(y,{className:s.nav_icon,style:l.nav_icon}):t.jsx(g,{className:s.nav_icon,style:l.nav_icon})}),!e.hideNext&&t.jsx(hft,{name:"next-month","aria-label":m,className:v,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:"rtl"===a?t.jsx(g,{className:s.nav_icon,style:l.nav_icon}):t.jsx(y,{className:s.nav_icon,style:l.nav_icon})})]})}function mft(e){var r=eft().numberOfMonths,n=cft(),o=n.previousMonth,a=n.nextMonth,i=n.goToMonth,s=n.displayMonths,l=s.findIndex(function(t){return hst(e.displayMonth,t)}),c=0===l,u=l===s.length-1,d=r>1&&(c||!u),p=r>1&&(u||!c);return t.jsx(fft,{displayMonth:e.displayMonth,hideNext:d,hidePrevious:p,nextMonth:a,previousMonth:o,onPreviousClick:function(){o&&i(o)},onNextClick:function(){a&&i(a)}})}function vft(e){var r,n,o=eft(),a=o.classNames,i=o.disableNavigation,s=o.styles,l=o.captionLayout,c=o.components,u=null!==(r=null==c?void 0:c.CaptionLabel)&&void 0!==r?r:tft;return n=i?t.jsx(u,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===l?t.jsx(uft,{displayMonth:e.displayMonth,id:e.id}):"dropdown-buttons"===l?t.jsxs(t.Fragment,{children:[t.jsx(uft,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(mft,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}):t.jsxs(t.Fragment,{children:[t.jsx(u,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(mft,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:a.caption,style:s.caption,children:n})}function yft(e){var r=eft(),n=r.footer,o=r.styles,a=r.classNames.tfoot;return n?t.jsx("tfoot",{className:a,style:o.tfoot,children:t.jsx("tr",{children:t.jsx("td",{colSpan:8,children:n})})}):t.jsx(t.Fragment,{})}function gft(){var e=eft(),r=e.classNames,n=e.styles,o=e.showWeekNumber,a=e.locale,i=e.weekStartsOn,s=e.ISOWeek,l=e.formatters.formatWeekdayName,c=e.labels.labelWeekday,u=function(e,t,r){for(var n=r?oit(new Date):nit(new Date,{locale:e,weekStartsOn:t}),o=[],a=0;a<7;a++){var i=Kat(n,a);o.push(i)}return o}(a,i,s);return t.jsxs("tr",{style:n.head_row,className:r.head_row,children:[o&&t.jsx("td",{style:n.head_cell,className:r.head_cell}),u.map(function(e,o){return t.jsx("th",{scope:"col",className:r.head_cell,style:n.head_cell,"aria-label":c(e,{locale:a}),children:l(e,{locale:a})},o)})]})}function xft(){var e,r=eft(),n=r.classNames,o=r.styles,a=r.components,i=null!==(e=null==a?void 0:a.HeadRow)&&void 0!==e?e:gft;return t.jsx("thead",{style:o.head,className:n.head,children:t.jsx(i,{})})}function bft(e){var r=eft(),n=r.locale,o=r.formatters.formatDay;return t.jsx(t.Fragment,{children:o(e.date,{locale:n})})}var kft=e.createContext(void 0);function _ft(e){if(!Uht(e.initialProps)){return t.jsx(kft.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(wft,{initialProps:e.initialProps,children:e.children})}function wft(e){var r=e.initialProps,n=e.children,o=r.selected,a=r.min,i=r.max,s={disabled:[]};o&&s.disabled.push(function(e){var t=i&&o.length>i-1,r=o.some(function(t){return hit(t,e)});return!(!t||r)});var l={selected:o,onDayClick:function(e,t,n){var s,l;if((null===(s=r.onDayClick)||void 0===s||s.call(r,e,t,n),!!(!t.selected||!a||(null==o?void 0:o.length)!==a))&&!!(t.selected||!i||(null==o?void 0:o.length)!==i)){var c=o?Wht([],o):[];if(t.selected){var u=c.findIndex(function(t){return hit(e,t)});c.splice(u,1)}else c.push(e);null===(l=r.onSelect)||void 0===l||l.call(r,c,e,t,n)}},modifiers:s};return t.jsx(kft.Provider,{value:l,children:n})}function Mft(){var t=e.useContext(kft);if(!t)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return t}var Cft,jft=e.createContext(void 0);function Dft(e){if(!Yht(e.initialProps)){return t.jsx(jft.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(Oft,{initialProps:e.initialProps,children:e.children})}function Oft(e){var r=e.initialProps,n=e.children,o=r.selected,a=o||{},i=a.from,s=a.to,l=r.min,c=r.max,u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(i?(u.range_start=[i],s?(u.range_end=[s],hit(i,s)||(u.range_middle=[{after:i,before:s}])):u.range_end=[i]):s&&(u.range_start=[s],u.range_end=[s]),l&&(i&&!s&&u.disabled.push({after:vst(i,l-1),before:Kat(i,l-1)}),i&&s&&u.disabled.push({after:i,before:Kat(i,l-1)}),!i&&s&&u.disabled.push({after:vst(s,l-1),before:Kat(s,l-1)})),c){if(i&&!s&&(u.disabled.push({before:Kat(i,1-c)}),u.disabled.push({after:Kat(i,c-1)})),i&&s){var d=c-(lit(s,i)+1);u.disabled.push({before:vst(i,d)}),u.disabled.push({after:Kat(s,d)})}!i&&s&&(u.disabled.push({before:Kat(s,1-c)}),u.disabled.push({after:Kat(s,c-1)}))}return t.jsx(jft.Provider,{value:{selected:o,onDayClick:function(e,t,n){var a,i;null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,n);var s=function(e,t){var r=t||{},n=r.from,o=r.to;return n&&o?hit(o,e)&&hit(n,e)?void 0:hit(o,e)?{from:o,to:void 0}:hit(n,e)?void 0:dst(n,e)?{from:e,to:o}:{from:n,to:e}:o?dst(e,o)?{from:o,to:e}:{from:e,to:o}:n?pst(e,n)?{from:e,to:n}:{from:n,to:e}:{from:e,to:void 0}}(e,o);null===(i=r.onSelect)||void 0===i||i.call(r,s,e,t,n)},modifiers:u},children:n})}function Sft(){var t=e.useContext(jft);if(!t)throw new Error("useSelectRange must be used within a SelectRangeProvider");return t}function Pft(e){return Array.isArray(e)?Wht([],e):void 0!==e?[e]:[]}!function(e){e.Outside="outside",e.Disabled="disabled",e.Selected="selected",e.Hidden="hidden",e.Today="today",e.RangeStart="range_start",e.RangeEnd="range_end",e.RangeMiddle="range_middle"}(Cft||(Cft={}));var Tft=Cft.Selected,Eft=Cft.Disabled,Nft=Cft.Hidden,zft=Cft.Today,Aft=Cft.RangeEnd,Rft=Cft.RangeMiddle,Fft=Cft.RangeStart,Lft=Cft.Outside;var Bft=e.createContext(void 0);function Vft(e){var r=eft(),n=function(e,t,r){var n,o=((n={})[Tft]=Pft(e.selected),n[Eft]=Pft(e.disabled),n[Nft]=Pft(e.hidden),n[zft]=[e.today],n[Aft]=[],n[Rft]=[],n[Fft]=[],n[Lft]=[],n);return e.fromDate&&o[Eft].push({before:e.fromDate}),e.toDate&&o[Eft].push({after:e.toDate}),Uht(e)?o[Eft]=o[Eft].concat(t.modifiers[Eft]):Yht(e)&&(o[Eft]=o[Eft].concat(r.modifiers[Eft]),o[Fft]=r.modifiers[Fft],o[Rft]=r.modifiers[Rft],o[Aft]=r.modifiers[Aft]),o}(r,Mft(),Sft()),o=function(e){var t={};return Object.entries(e).forEach(function(e){var r=e[0],n=e[1];t[r]=Pft(n)}),t}(r.modifiers),a=Hht(Hht({},n),o);return t.jsx(Bft.Provider,{value:a,children:e.children})}function Ift(){var t=e.useContext(Bft);if(!t)throw new Error("useModifiers must be used within a ModifiersProvider");return t}function qft(e,t){return t.some(function(t){if("boolean"==typeof t)return t;if(function(e){return fit(e)}(t))return hit(e,t);if(function(e){return Array.isArray(e)&&e.every(fit)}(t))return t.includes(e);if(function(e){return!(!e||"object"!=typeof e||!("from"in e))}(t))return function(e,t){var r,n=t.from,o=t.to;return n&&o?(lit(o,n)<0&&(n=(r=[o,n])[0],o=r[1]),lit(e,n)>=0&&lit(o,e)>=0):o?hit(o,e):!!n&&hit(n,e)}(e,t);if(function(e){return!(!e||"object"!=typeof e||!("dayOfWeek"in e))}(t))return t.dayOfWeek.includes(e.getDay());if(function(e){return!!(e&&"object"==typeof e&&"before"in e&&"after"in e)}(t)){var r=lit(t.before,e)>0,n=lit(t.after,e)<0;return dst(t.before,t.after)?n&&r:r||n}return function(e){return!(!e||"object"!=typeof e||!("after"in e))}(t)?lit(e,t.after)>0:function(e){return!(!e||"object"!=typeof e||!("before"in e))}(t)?lit(t.before,e)>0:"function"==typeof t&&t(e)})}function $ft(e,t,r){var n=Object.keys(t).reduce(function(r,n){var o=t[n];return qft(e,o)&&r.push(n),r},[]),o={};return n.forEach(function(e){return o[e]=!0}),r&&!hst(e,r)&&(o.outside=!0),o}function Hft(e,t){var r=t.moveBy,n=t.direction,o=t.context,a=t.modifiers,i=t.retry,s=void 0===i?{count:0,lastFocused:e}:i,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,p={day:Kat,week:cit,month:Gat,year:uit,startOfWeek:function(e){return o.ISOWeek?oit(e):nit(e,{locale:d,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?Cit(e):Mit(e,{locale:d,weekStartsOn:l})}},h=p[r](e,"after"===n?1:-1);"before"===n&&c?h=dit([c,h]):"after"===n&&u&&(h=pit([u,h]));var f=!0;if(a){var m=$ft(h,a);f=!m.disabled&&!m.hidden}return f?h:s.count>365?s.lastFocused:Hft(h,{moveBy:r,direction:n,context:o,modifiers:a,retry:Hht(Hht({},s),{count:s.count+1})})}var Wft=e.createContext(void 0);function Uft(r){var n=cft(),o=Ift(),a=e.useState(),i=a[0],s=a[1],l=e.useState(),c=l[0],u=l[1],d=function(e,t){for(var r,n,o=kit(e[0]),a=xit(e[e.length-1]),i=o;i<=a;){var s=$ft(i,t);if(s.disabled||s.hidden)i=Kat(i,1);else{if(s.selected)return i;s.today&&!n&&(n=i),r||(r=i),i=Kat(i,1)}}return n||r}(n.displayMonths,o),p=i??(c&&n.isDateDisplayed(c))?c:d,h=function(e){s(e)},f=eft(),m=function(e,t){if(i){var r=Hft(i,{moveBy:e,direction:t,context:f,modifiers:o});hit(i,r)||(n.goToDate(r,i),h(r))}},v={focusedDay:i,focusTarget:p,blur:function(){u(i),s(void 0)},focus:h,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}};return t.jsx(Wft.Provider,{value:v,children:r.children})}function Yft(){var t=e.useContext(Wft);if(!t)throw new Error("useFocusContext must be used within a FocusProvider");return t}var Zft=e.createContext(void 0);function Kft(e){if(!Zht(e.initialProps)){return t.jsx(Zft.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(Gft,{initialProps:e.initialProps,children:e.children})}function Gft(e){var r=e.initialProps,n=e.children,o={selected:r.selected,onDayClick:function(e,t,n){var o,a,i;null===(o=r.onDayClick)||void 0===o||o.call(r,e,t,n),!t.selected||r.required?null===(i=r.onSelect)||void 0===i||i.call(r,e,e,t,n):null===(a=r.onSelect)||void 0===a||a.call(r,void 0,e,t,n)}};return t.jsx(Zft.Provider,{value:o,children:n})}function Xft(){var t=e.useContext(Zft);if(!t)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return t}function Qft(e,t){var r=[e.classNames.day];return Object.keys(t).forEach(function(t){var n=e.modifiersClassNames[t];if(n)r.push(n);else if(function(e){return Object.values(Cft).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&r.push(o)}}),r}function Jft(r,n,o){var a,i,s,l=eft(),c=Yft(),u=function(e,t){return $ft(e,Ift(),t)}(r,n),d=function(e,t){var r=eft(),n=Xft(),o=Mft(),a=Sft(),i=Yft(),s=i.focusDayAfter,l=i.focusDayBefore,c=i.focusWeekAfter,u=i.focusWeekBefore,d=i.blur,p=i.focus,h=i.focusMonthBefore,f=i.focusMonthAfter,m=i.focusYearBefore,v=i.focusYearAfter,y=i.focusStartOfWeek,g=i.focusEndOfWeek,x={onClick:function(i){var s,l,c,u;Zht(r)?null===(s=n.onDayClick)||void 0===s||s.call(n,e,t,i):Uht(r)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,i):Yht(r)?null===(c=a.onDayClick)||void 0===c||c.call(a,e,t,i):null===(u=r.onDayClick)||void 0===u||u.call(r,e,t,i)},onFocus:function(n){var o;p(e),null===(o=r.onDayFocus)||void 0===o||o.call(r,e,t,n)},onBlur:function(n){var o;d(),null===(o=r.onDayBlur)||void 0===o||o.call(r,e,t,n)},onKeyDown:function(n){var o;switch(n.key){case"ArrowLeft":n.preventDefault(),n.stopPropagation(),"rtl"===r.dir?s():l();break;case"ArrowRight":n.preventDefault(),n.stopPropagation(),"rtl"===r.dir?l():s();break;case"ArrowDown":n.preventDefault(),n.stopPropagation(),c();break;case"ArrowUp":n.preventDefault(),n.stopPropagation(),u();break;case"PageUp":n.preventDefault(),n.stopPropagation(),n.shiftKey?m():h();break;case"PageDown":n.preventDefault(),n.stopPropagation(),n.shiftKey?v():f();break;case"Home":n.preventDefault(),n.stopPropagation(),y();break;case"End":n.preventDefault(),n.stopPropagation(),g()}null===(o=r.onDayKeyDown)||void 0===o||o.call(r,e,t,n)},onKeyUp:function(n){var o;null===(o=r.onDayKeyUp)||void 0===o||o.call(r,e,t,n)},onMouseEnter:function(n){var o;null===(o=r.onDayMouseEnter)||void 0===o||o.call(r,e,t,n)},onMouseLeave:function(n){var o;null===(o=r.onDayMouseLeave)||void 0===o||o.call(r,e,t,n)},onPointerEnter:function(n){var o;null===(o=r.onDayPointerEnter)||void 0===o||o.call(r,e,t,n)},onPointerLeave:function(n){var o;null===(o=r.onDayPointerLeave)||void 0===o||o.call(r,e,t,n)},onTouchCancel:function(n){var o;null===(o=r.onDayTouchCancel)||void 0===o||o.call(r,e,t,n)},onTouchEnd:function(n){var o;null===(o=r.onDayTouchEnd)||void 0===o||o.call(r,e,t,n)},onTouchMove:function(n){var o;null===(o=r.onDayTouchMove)||void 0===o||o.call(r,e,t,n)},onTouchStart:function(n){var o;null===(o=r.onDayTouchStart)||void 0===o||o.call(r,e,t,n)}};return x}(r,u),p=function(){var e=eft(),t=Xft(),r=Mft(),n=Sft();return Zht(e)?t.selected:Uht(e)?r.selected:Yht(e)?n.selected:void 0}(),h=!(!l.onDayClick&&"default"===l.mode);e.useEffect(function(){var e;u.outside||c.focusedDay&&h&&hit(c.focusedDay,r)&&(null===(e=o.current)||void 0===e||e.focus())},[c.focusedDay,r,o,h,u.outside]);var f=Qft(l,u).join(" "),m=function(e,t){var r=Hht({},e.styles.day);return Object.keys(t).forEach(function(t){var n;r=Hht(Hht({},r),null===(n=e.modifiersStyles)||void 0===n?void 0:n[t])}),r}(l,u),v=!!(u.outside&&!l.showOutsideDays||u.hidden),y=null!==(s=null===(i=l.components)||void 0===i?void 0:i.DayContent)&&void 0!==s?s:bft,g={style:m,className:f,children:t.jsx(y,{date:r,displayMonth:n,activeModifiers:u}),role:"gridcell"},x=c.focusTarget&&hit(c.focusTarget,r)&&!u.outside,b=c.focusedDay&&hit(c.focusedDay,r),k=Hht(Hht(Hht({},g),((a={disabled:u.disabled,role:"gridcell"})["aria-selected"]=u.selected,a.tabIndex=b||x?0:-1,a)),d);return{isButton:h,isHidden:v,activeModifiers:u,selectedDays:p,buttonProps:k,divProps:g}}function emt(r){var n=e.useRef(null),o=Jft(r.date,r.displayMonth,n);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(hft,Hht({name:"day",ref:n},o.buttonProps)):t.jsx("div",Hht({},o.divProps))}function tmt(e){var r=e.number,n=e.dates,o=eft(),a=o.onWeekNumberClick,i=o.styles,s=o.classNames,l=o.locale,c=o.labels.labelWeekNumber,u=(0,o.formatters.formatWeekNumber)(Number(r),{locale:l});if(!a)return t.jsx("span",{className:s.weeknumber,style:i.weeknumber,children:u});var d=c(Number(r),{locale:l});return t.jsx(hft,{name:"week-number","aria-label":d,className:s.weeknumber,style:i.weeknumber,onClick:function(e){a(r,n,e)},children:u})}function rmt(e){var r,n,o,a=eft(),i=a.styles,s=a.classNames,l=a.showWeekNumber,c=a.components,u=null!==(r=null==c?void 0:c.Day)&&void 0!==r?r:emt,d=null!==(n=null==c?void 0:c.WeekNumber)&&void 0!==n?n:tmt;return l&&(o=t.jsx("td",{className:s.cell,style:i.cell,children:t.jsx(d,{number:e.weekNumber,dates:e.dates})})),t.jsxs("tr",{className:s.row,style:i.row,children:[o,e.dates.map(function(r){return t.jsx("td",{className:s.cell,style:i.cell,role:"presentation",children:t.jsx(u,{displayMonth:e.displayMonth,date:r})},function(e){return Math.trunc(+Yat(e)/1e3)}(r))})]})}function nmt(e,t,r){for(var n=null!=r&&r.ISOWeek?Cit(t):Mit(t,r),o=null!=r&&r.ISOWeek?oit(e):nit(e,r),a=lit(n,o),i=[],s=0;s<=a;s++)i.push(Kat(o,s));var l=i.reduce(function(e,t){var n=null!=r&&r.ISOWeek?Ait(t):Fit(t,r),o=e.find(function(e){return e.weekNumber===n});return o?(o.dates.push(t),e):(e.push({weekNumber:n,dates:[t]}),e)},[]);return l}function omt(e){var r,n,o,a=eft(),i=a.locale,s=a.classNames,l=a.styles,c=a.hideHead,u=a.fixedWeeks,d=a.components,p=a.weekStartsOn,h=a.firstWeekContainsDate,f=a.ISOWeek,m=function(e,t){var r=nmt(kit(e),xit(e),t);if(null!=t&&t.useFixedWeeks){var n=ust(e,t);if(n<6){var o=r[r.length-1],a=o.dates[o.dates.length-1],i=cit(a,6-n),s=nmt(cit(a,1),i,t);r.push.apply(r,s)}}return r}(e.displayMonth,{useFixedWeeks:!!u,ISOWeek:f,locale:i,weekStartsOn:p,firstWeekContainsDate:h}),v=null!==(r=null==d?void 0:d.Head)&&void 0!==r?r:xft,y=null!==(n=null==d?void 0:d.Row)&&void 0!==n?n:rmt,g=null!==(o=null==d?void 0:d.Footer)&&void 0!==o?o:yft;return t.jsxs("table",{id:e.id,className:s.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&t.jsx(v,{}),t.jsx("tbody",{className:s.tbody,style:l.tbody,children:m.map(function(r){return t.jsx(y,{displayMonth:e.displayMonth,dates:r.dates,weekNumber:r.weekNumber},r.weekNumber)})}),t.jsx(g,{displayMonth:e.displayMonth})]})}var amt=typeof window<"u"&&window.document&&window.document.createElement?e.useLayoutEffect:e.useEffect,imt=!1,smt=0;function lmt(){return"react-day-picker-".concat(++smt)}function cmt(r){var n,o,a=eft(),i=a.dir,s=a.classNames,l=a.styles,c=a.components,u=cft().displayMonths,d=function(t){var r,n=t??(imt?lmt():null),o=e.useState(n),a=o[0],i=o[1];return amt(function(){null===a&&i(lmt())},[]),e.useEffect(function(){!1===imt&&(imt=!0)},[]),null!==(r=t??a)&&void 0!==r?r:void 0}(a.id?"".concat(a.id,"-").concat(r.displayIndex):void 0),p=a.id?"".concat(a.id,"-grid-").concat(r.displayIndex):void 0,h=[s.month],f=l.month,m=0===r.displayIndex,v=r.displayIndex===u.length-1,y=!m&&!v;"rtl"===i&&(v=(n=[m,v])[0],m=n[1]),m&&(h.push(s.caption_start),f=Hht(Hht({},f),l.caption_start)),v&&(h.push(s.caption_end),f=Hht(Hht({},f),l.caption_end)),y&&(h.push(s.caption_between),f=Hht(Hht({},f),l.caption_between));var g=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:vft;return t.jsxs("div",{className:h.join(" "),style:f,children:[t.jsx(g,{id:d,displayMonth:r.displayMonth,displayIndex:r.displayIndex}),t.jsx(omt,{id:p,"aria-labelledby":d,displayMonth:r.displayMonth})]},r.displayIndex)}function umt(e){var r=eft(),n=r.classNames,o=r.styles;return t.jsx("div",{className:n.months,style:o.months,children:e.children})}function dmt(r){var n,o,a=r.initialProps,i=eft(),s=Yft(),l=cft(),c=e.useState(!1),u=c[0],d=c[1];e.useEffect(function(){i.initialFocus&&s.focusTarget&&(u||(s.focus(s.focusTarget),d(!0)))},[i.initialFocus,u,s.focus,s.focusTarget,s]);var p=[i.classNames.root,i.className];i.numberOfMonths>1&&p.push(i.classNames.multiple_months),i.showWeekNumber&&p.push(i.classNames.with_weeknumber);var h=Hht(Hht({},i.styles.root),i.style),f=Object.keys(a).filter(function(e){return e.startsWith("data-")}).reduce(function(e,t){var r;return Hht(Hht({},e),((r={})[t]=a[t],r))},{}),m=null!==(o=null===(n=a.components)||void 0===n?void 0:n.Months)&&void 0!==o?o:umt;return t.jsx("div",Hht({className:p.join(" "),style:h,dir:i.dir,id:i.id,nonce:a.nonce,title:a.title,lang:a.lang},f,{children:t.jsx(m,{children:l.displayMonths.map(function(e,r){return t.jsx(cmt,{displayIndex:r,displayMonth:e},r)})})}))}function pmt(e){var r=e.children,n=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]])}return r}(e,["children"]);return t.jsx(Jht,{initialProps:n,children:t.jsx(lft,{children:t.jsx(Kft,{initialProps:n,children:t.jsx(_ft,{initialProps:n,children:t.jsx(Dft,{initialProps:n,children:t.jsx(Vft,{children:t.jsx(Uft,{children:r})})})})})})})}function hmt(e){return t.jsx(pmt,Hht({},e,{children:t.jsx(dmt,{initialProps:e})}))}function fmt({className:e,classNames:r,showOutsideDays:n=!0,...o}){return t.jsx(hmt,{showOutsideDays:n,className:zdt("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:zdt(qht({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-9 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:"h-9 w-9 text-center text-sm p-0 relative [&:has([aria-selected].day-range-end)]:rounded-r-md [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected])]:bg-accent first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md focus-within:relative focus-within:z-20",day:zdt(qht({variant:"ghost"}),"h-9 w-9 p-0 font-normal aria-selected:opacity-100"),day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...r},components:{IconLeft:({className:e,...r})=>t.jsx(Ust,{className:zdt("h-4 w-4",e),...r}),IconRight:({className:e,...r})=>t.jsx(Yst,{className:zdt("h-4 w-4",e),...r})},...o})}fmt.displayName="Calendar";var mmt="AlertDialog",[vmt,ymt]=flt(mmt,[eut]),gmt=eut(),xmt=e=>{const{__scopeAlertDialog:r,...n}=e,o=gmt(r);return t.jsx(Tut,{...o,...n,modal:!0})};xmt.displayName=mmt;var bmt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=gmt(n);return t.jsx(Eut,{...a,...o,ref:r})});bmt.displayName="AlertDialogTrigger";var kmt=e=>{const{__scopeAlertDialog:r,...n}=e,o=gmt(r);return t.jsx(Nut,{...o,...n})};kmt.displayName="AlertDialogPortal";var _mt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=gmt(n);return t.jsx(zut,{...a,...o,ref:r})});_mt.displayName="AlertDialogOverlay";var wmt="AlertDialogContent",[Mmt,Cmt]=vmt(wmt),jmt=jlt("AlertDialogContent"),Dmt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,children:o,...a}=e,i=gmt(n),l=s.useRef(null),c=hlt(r,l),u=s.useRef(null);return t.jsx(Dut,{contentName:wmt,titleName:Omt,docsSlug:"alert-dialog",children:t.jsx(Mmt,{scope:n,cancelRef:u,children:t.jsxs(Aut,{role:"alertdialog",...i,...a,ref:c,onOpenAutoFocus:ult(a.onOpenAutoFocus,e=>{var t;e.preventDefault(),null==(t=u.current)||t.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[t.jsx(jmt,{children:o}),t.jsx(Amt,{contentRef:l})]})})})});Dmt.displayName=wmt;var Omt="AlertDialogTitle",Smt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=gmt(n);return t.jsx(Rut,{...a,...o,ref:r})});Smt.displayName=Omt;var Pmt="AlertDialogDescription",Tmt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=gmt(n);return t.jsx(Fut,{...a,...o,ref:r})});Tmt.displayName=Pmt;var Emt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,a=gmt(n);return t.jsx(Lut,{...a,...o,ref:r})});Emt.displayName="AlertDialogAction";var Nmt="AlertDialogCancel",zmt=s.forwardRef((e,r)=>{const{__scopeAlertDialog:n,...o}=e,{cancelRef:a}=Cmt(Nmt,n),i=gmt(n),s=hlt(r,a);return t.jsx(Lut,{...i,...o,ref:s})});zmt.displayName=Nmt;var Amt=({contentRef:e})=>{const t=`\`${wmt}\` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the \`${wmt}\` by passing a \`${Pmt}\` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${wmt}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return s.useEffect(()=>{var r;document.getElementById(null==(r=e.current)?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},Rmt=_mt,Fmt=Dmt,Lmt=Emt,Bmt=zmt,Vmt=Smt,Imt=Tmt;const qmt=xmt,$mt=bmt,Hmt=kmt,Wmt=s.forwardRef(({className:e,...r},n)=>t.jsx(Rmt,{className:zdt("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...r,ref:n}));Wmt.displayName=Rmt.displayName;const Umt=s.forwardRef(({className:e,...r},n)=>t.jsxs(Hmt,{children:[t.jsx(Wmt,{}),t.jsx(Fmt,{ref:n,className:zdt("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...r})]}));Umt.displayName=Fmt.displayName;const Ymt=({className:e,...r})=>t.jsx("div",{className:zdt("flex flex-col space-y-2 text-center sm:text-left",e),...r});Ymt.displayName="AlertDialogHeader";const Zmt=({className:e,...r})=>t.jsx("div",{className:zdt("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...r});Zmt.displayName="AlertDialogFooter";const Kmt=s.forwardRef(({className:e,...r},n)=>t.jsx(Vmt,{ref:n,className:zdt("text-lg font-semibold",e),...r}));Kmt.displayName=Vmt.displayName;const Gmt=s.forwardRef(({className:e,...r},n)=>t.jsx(Imt,{ref:n,className:zdt("text-sm text-muted-foreground",e),...r}));Gmt.displayName=Imt.displayName;const Xmt=s.forwardRef(({className:e,...r},n)=>t.jsx(Lmt,{ref:n,className:zdt(qht(),e),...r}));Xmt.displayName=Lmt.displayName;const Qmt=s.forwardRef(({className:e,...r},n)=>t.jsx(Bmt,{ref:n,className:zdt(qht({variant:"outline"}),"mt-2 sm:mt-0",e),...r}));function Jmt(e){const r=e+"CollectionProvider",[n,o]=flt(r),[a,i]=n(r,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:r,children:n}=e,o=l.default.useRef(null),i=l.default.useRef(new Map).current;return t.jsx(a,{scope:r,itemMap:i,collectionRef:o,children:n})};s.displayName=r;const c=e+"CollectionSlot",u=_lt(c),d=l.default.forwardRef((e,r)=>{const{scope:n,children:o}=e,a=hlt(r,i(c,n).collectionRef);return t.jsx(u,{ref:a,children:o})});d.displayName=c;const p=e+"CollectionItemSlot",h="data-radix-collection-item",f=_lt(p),m=l.default.forwardRef((e,r)=>{const{scope:n,children:o,...a}=e,s=l.default.useRef(null),c=hlt(r,s),u=i(p,n);return l.default.useEffect(()=>(u.itemMap.set(s,{ref:s,...a}),()=>{u.itemMap.delete(s)})),t.jsx(f,{[h]:"",ref:c,children:o})});return m.displayName=p,[{Provider:s,Slot:d,ItemSlot:m},function(t){const r=i(e+"CollectionConsumer",t);return l.default.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${h}]`));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},o]}Qmt.displayName=Bmt.displayName;var evt=s.createContext(void 0);function tvt(e){const t=s.useContext(evt);return e||t||"ltr"}var rvt="rovingFocusGroup.onEntryFocus",nvt={bubbles:!1,cancelable:!0},ovt="RovingFocusGroup",[avt,ivt,svt]=Jmt(ovt),[lvt,cvt]=flt(ovt,[svt]),[uvt,dvt]=lvt(ovt),pvt=s.forwardRef((e,r)=>t.jsx(avt.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx(avt.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(hvt,{...e,ref:r})})}));pvt.displayName=ovt;var hvt=s.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,orientation:o,loop:a=!1,dir:i,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...h}=e,f=s.useRef(null),m=hlt(r,f),v=tvt(i),[y,g]=klt({prop:l,defaultProp:c??null,onChange:u,caller:ovt}),[x,b]=s.useState(!1),k=Plt(d),_=ivt(n),w=s.useRef(!1),[M,C]=s.useState(0);return s.useEffect(()=>{const e=f.current;if(e)return e.addEventListener(rvt,k),()=>e.removeEventListener(rvt,k)},[k]),t.jsx(uvt,{scope:n,orientation:o,dir:v,loop:a,currentTabStopId:y,onItemFocus:s.useCallback(e=>g(e),[g]),onItemShiftTab:s.useCallback(()=>b(!0),[]),onFocusableItemAdd:s.useCallback(()=>C(e=>e+1),[]),onFocusableItemRemove:s.useCallback(()=>C(e=>e-1),[]),children:t.jsx(Olt.div,{tabIndex:x||0===M?-1:0,"data-orientation":o,...h,ref:m,style:{outline:"none",...e.style},onMouseDown:ult(e.onMouseDown,()=>{w.current=!0}),onFocus:ult(e.onFocus,e=>{const t=!w.current;if(e.target===e.currentTarget&&t&&!x){const t=new CustomEvent(rvt,nvt);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=_().filter(e=>e.focusable),t=e.find(e=>e.active),r=e.find(e=>e.id===y),n=[t,r,...e].filter(Boolean).map(e=>e.ref.current);yvt(n,p)}}w.current=!1}),onBlur:ult(e.onBlur,()=>b(!1))})})}),fvt="RovingFocusGroupItem",mvt=s.forwardRef((e,r)=>{const{__scopeRovingFocusGroup:n,focusable:o=!0,active:a=!1,tabStopId:i,children:l,...c}=e,u=xlt(),d=i||u,p=dvt(fvt,n),h=p.currentTabStopId===d,f=ivt(n),{onFocusableItemAdd:m,onFocusableItemRemove:v,currentTabStopId:y}=p;return s.useEffect(()=>{if(o)return m(),()=>v()},[o,m,v]),t.jsx(avt.ItemSlot,{scope:n,id:d,focusable:o,active:a,children:t.jsx(Olt.span,{tabIndex:h?0:-1,"data-orientation":p.orientation,...c,ref:r,onMouseDown:ult(e.onMouseDown,e=>{o?p.onItemFocus(d):e.preventDefault()}),onFocus:ult(e.onFocus,()=>p.onItemFocus(d)),onKeyDown:ult(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey)return void p.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,r){const n=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,r);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(n)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(n)))return vvt[n]}(e,p.orientation,p.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let r=f().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)r.reverse();else if("prev"===t||"next"===t){"prev"===t&&r.reverse();const n=r.indexOf(e.currentTarget);r=p.loop?function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(r,n+1):r.slice(n+1)}setTimeout(()=>yvt(r))}}),children:"function"==typeof l?l({isCurrentTabStop:h,hasTabStop:null!=y}):l})})});mvt.displayName=fvt;var vvt={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function yvt(e,t=!1){const r=document.activeElement;for(const n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var gvt=pvt,xvt=mvt;function bvt(e){const[t,r]=s.useState(void 0);return vlt(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;const n=t[0];let o,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=e.offsetWidth,a=e.offsetHeight;r({width:o,height:a})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}function kvt(e){const t=s.useRef({value:e,previous:e});return s.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var _vt="Radio",[wvt,Mvt]=flt(_vt),[Cvt,jvt]=wvt(_vt),Dvt=s.forwardRef((e,r)=>{const{__scopeRadio:n,name:o,checked:a=!1,required:i,disabled:l,value:c="on",onCheck:u,form:d,...p}=e,[h,f]=s.useState(null),m=hlt(r,e=>f(e)),v=s.useRef(!1),y=!h||(d||!!h.closest("form"));return t.jsxs(Cvt,{scope:n,checked:a,disabled:l,children:[t.jsx(Olt.button,{type:"button",role:"radio","aria-checked":a,"data-state":Tvt(a),"data-disabled":l?"":void 0,disabled:l,value:c,...p,ref:m,onClick:ult(e.onClick,e=>{a||null==u||u(),y&&(v.current=e.isPropagationStopped(),v.current||e.stopPropagation())})}),y&&t.jsx(Pvt,{control:h,bubbles:!v.current,name:o,value:c,checked:a,required:i,disabled:l,form:d,style:{transform:"translateX(-100%)"}})]})});Dvt.displayName=_vt;var Ovt="RadioIndicator",Svt=s.forwardRef((e,r)=>{const{__scopeRadio:n,forceMount:o,...a}=e,i=jvt(Ovt,n);return t.jsx(Xlt,{present:o||i.checked,children:t.jsx(Olt.span,{"data-state":Tvt(i.checked),"data-disabled":i.disabled?"":void 0,...a,ref:r})})});Svt.displayName=Ovt;var Pvt=s.forwardRef(({__scopeRadio:e,control:r,checked:n,bubbles:o=!0,...a},i)=>{const l=s.useRef(null),c=hlt(l,i),u=kvt(n),d=bvt(r);return s.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[u,n,o]),t.jsx(Olt.input,{type:"radio","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:c,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function Tvt(e){return e?"checked":"unchecked"}Pvt.displayName="RadioBubbleInput";var Evt=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],Nvt="RadioGroup",[zvt,Avt]=flt(Nvt,[cvt,Mvt]),Rvt=cvt(),Fvt=Mvt(),[Lvt,Bvt]=zvt(Nvt),Vvt=s.forwardRef((e,r)=>{const{__scopeRadioGroup:n,name:o,defaultValue:a,value:i,required:s=!1,disabled:l=!1,orientation:c,dir:u,loop:d=!0,onValueChange:p,...h}=e,f=Rvt(n),m=tvt(u),[v,y]=klt({prop:i,defaultProp:a??null,onChange:p,caller:Nvt});return t.jsx(Lvt,{scope:n,name:o,required:s,disabled:l,value:v,onValueChange:y,children:t.jsx(gvt,{asChild:!0,...f,orientation:c,dir:m,loop:d,children:t.jsx(Olt.div,{role:"radiogroup","aria-required":s,"aria-orientation":c,"data-disabled":l?"":void 0,dir:m,...h,ref:r})})})});Vvt.displayName=Nvt;var Ivt="RadioGroupItem",qvt=s.forwardRef((e,r)=>{const{__scopeRadioGroup:n,disabled:o,...a}=e,i=Bvt(Ivt,n),l=i.disabled||o,c=Rvt(n),u=Fvt(n),d=s.useRef(null),p=hlt(r,d),h=i.value===a.value,f=s.useRef(!1);return s.useEffect(()=>{const e=e=>{Evt.includes(e.key)&&(f.current=!0)},t=()=>f.current=!1;return document.addEventListener("keydown",e),document.addEventListener("keyup",t),()=>{document.removeEventListener("keydown",e),document.removeEventListener("keyup",t)}},[]),t.jsx(xvt,{asChild:!0,...c,focusable:!l,active:h,children:t.jsx(Dvt,{disabled:l,required:i.required,checked:h,...u,...a,name:i.name,ref:p,onCheck:()=>i.onValueChange(a.value),onKeyDown:ult(e=>{"Enter"===e.key&&e.preventDefault()}),onFocus:ult(a.onFocus,()=>{var e;f.current&&(null==(e=d.current)||e.click())})})})});qvt.displayName=Ivt;var $vt=s.forwardRef((e,r)=>{const{__scopeRadioGroup:n,...o}=e,a=Fvt(n);return t.jsx(Svt,{...a,...o,ref:r})});$vt.displayName="RadioGroupIndicator";var Hvt=Vvt,Wvt=qvt,Uvt=$vt;const Yvt=s.forwardRef(({className:e,...r},n)=>t.jsx(Hvt,{className:zdt("grid gap-2",e),...r,ref:n}));Yvt.displayName=Hvt.displayName;const Zvt=s.forwardRef(({className:e,...r},n)=>t.jsx(Wvt,{ref:n,className:zdt("aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",e),...r,children:t.jsx(Uvt,{className:"flex items-center justify-center",children:t.jsx(Xst,{className:"h-3.5 w-3.5 fill-primary"})})}));Zvt.displayName=Wvt.displayName;var Kvt=s.forwardRef((e,r)=>t.jsx(Olt.label,{...e,ref:r,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null==(r=e.onMouseDown)||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));Kvt.displayName="Label";var Gvt=Kvt;const Xvt=Iht("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Qvt=s.forwardRef(({className:e,...r},n)=>t.jsx(Gvt,{ref:n,className:zdt(Xvt(),e),...r}));Qvt.displayName=Gvt.displayName;const Jvt=e=>{const{children:t,...r}=e;return l.default.createElement(Vpt.Provider,{value:r},t)},eyt=s.createContext({}),tyt=({...e})=>t.jsx(eyt.Provider,{value:{name:e.name},children:t.jsx(Ypt,{...e})}),ryt=()=>{const e=s.useContext(eyt),t=s.useContext(nyt),{getFieldState:r,formState:n}=Ipt(),o=r(e.name,n);if(!e)throw new Error("useFormField should be used within <FormField>");const{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...o}},nyt=s.createContext({}),oyt=s.forwardRef(({className:e,...r},n)=>{const o=s.useId();return t.jsx(nyt.Provider,{value:{id:o},children:t.jsx("div",{ref:n,className:zdt("space-y-2",e),...r})})});oyt.displayName="FormItem";const ayt=s.forwardRef(({className:e,...r},n)=>{const{error:o,formItemId:a}=ryt();return t.jsx(Qvt,{ref:n,className:zdt(o&&"text-destructive",e),htmlFor:a,...r})});ayt.displayName="FormLabel";const iyt=s.forwardRef(({...e},r)=>{const{error:n,formItemId:o,formDescriptionId:a,formMessageId:i}=ryt();return t.jsx(wlt,{ref:r,id:o,"aria-describedby":n?`${a} ${i}`:`${a}`,"aria-invalid":!!n,...e})});iyt.displayName="FormControl";const syt=s.forwardRef(({className:e,...r},n)=>{const{formDescriptionId:o}=ryt();return t.jsx("p",{ref:n,id:o,className:zdt("text-sm text-muted-foreground",e),...r})});syt.displayName="FormDescription";const lyt=s.forwardRef(({className:e,children:r,...n},o)=>{const{error:a,formMessageId:i}=ryt(),s=a?String(null==a?void 0:a.message):r;return s?t.jsx("p",{ref:o,id:i,className:zdt("text-sm font-medium text-destructive",e),...n,children:s}):null});lyt.displayName="FormMessage";const cyt=s.forwardRef(({className:e,type:r,...n},o)=>t.jsx("input",{type:r,className:zdt("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:o,...n}));cyt.displayName="Input";const uyt=["top","right","bottom","left"],dyt=Math.min,pyt=Math.max,hyt=Math.round,fyt=Math.floor,myt=e=>({x:e,y:e}),vyt={left:"right",right:"left",bottom:"top",top:"bottom"},yyt={start:"end",end:"start"};function gyt(e,t,r){return pyt(e,dyt(t,r))}function xyt(e,t){return"function"==typeof e?e(t):e}function byt(e){return e.split("-")[0]}function kyt(e){return e.split("-")[1]}function _yt(e){return"x"===e?"y":"x"}function wyt(e){return"y"===e?"height":"width"}const Myt=new Set(["top","bottom"]);function Cyt(e){return Myt.has(byt(e))?"y":"x"}function jyt(e){return _yt(Cyt(e))}function Dyt(e){return e.replace(/start|end/g,e=>yyt[e])}const Oyt=["left","right"],Syt=["right","left"],Pyt=["top","bottom"],Tyt=["bottom","top"];function Eyt(e,t,r,n){const o=kyt(e);let a=function(e,t,r){switch(e){case"top":case"bottom":return r?t?Syt:Oyt:t?Oyt:Syt;case"left":case"right":return t?Pyt:Tyt;default:return[]}}(byt(e),"start"===r,n);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(Dyt)))),a}function Nyt(e){return e.replace(/left|right|bottom|top/g,e=>vyt[e])}function zyt(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Ayt(e){const{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function Ryt(e,t,r){let{reference:n,floating:o}=e;const a=Cyt(t),i=jyt(t),s=wyt(i),l=byt(t),c="y"===a,u=n.x+n.width/2-o.width/2,d=n.y+n.height/2-o.height/2,p=n[s]/2-o[s]/2;let h;switch(l){case"top":h={x:u,y:n.y-o.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:d};break;case"left":h={x:n.x-o.width,y:d};break;default:h={x:n.x,y:n.y}}switch(kyt(t)){case"start":h[i]-=p*(r&&c?-1:1);break;case"end":h[i]+=p*(r&&c?-1:1)}return h}async function Fyt(e,t){var r;void 0===t&&(t={});const{x:n,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:h=0}=xyt(t,e),f=zyt(h),m=s[p?"floating"===d?"reference":"floating":d],v=Ayt(await a.getClippingRect({element:null==(r=await(null==a.isElement?void 0:a.isElement(m)))||r?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:n,y:o,width:i.floating.width,height:i.floating.height}:i.reference,g=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),x=await(null==a.isElement?void 0:a.isElement(g))&&await(null==a.getScale?void 0:a.getScale(g))||{x:1,y:1},b=Ayt(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:g,strategy:l}):y);return{top:(v.top-b.top+f.top)/x.y,bottom:(b.bottom-v.bottom+f.bottom)/x.y,left:(v.left-b.left+f.left)/x.x,right:(b.right-v.right+f.right)/x.x}}function Lyt(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Byt(e){return uyt.some(t=>e[t]>=0)}const Vyt=new Set(["left","top"]);function Iyt(){return typeof window<"u"}function qyt(e){return Wyt(e)?(e.nodeName||"").toLowerCase():"#document"}function $yt(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Hyt(e){var t;return null==(t=(Wyt(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Wyt(e){return!!Iyt()&&(e instanceof Node||e instanceof $yt(e).Node)}function Uyt(e){return!!Iyt()&&(e instanceof Element||e instanceof $yt(e).Element)}function Yyt(e){return!!Iyt()&&(e instanceof HTMLElement||e instanceof $yt(e).HTMLElement)}function Zyt(e){return!(!Iyt()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof $yt(e).ShadowRoot)}const Kyt=new Set(["inline","contents"]);function Gyt(e){const{overflow:t,overflowX:r,overflowY:n,display:o}=lgt(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!Kyt.has(o)}const Xyt=new Set(["table","td","th"]);function Qyt(e){return Xyt.has(qyt(e))}const Jyt=[":popover-open",":modal"];function egt(e){return Jyt.some(t=>{try{return e.matches(t)}catch{return!1}})}const tgt=["transform","translate","scale","rotate","perspective"],rgt=["transform","translate","scale","rotate","perspective","filter"],ngt=["paint","layout","strict","content"];function ogt(e){const t=agt(),r=Uyt(e)?lgt(e):e;return tgt.some(e=>!!r[e]&&"none"!==r[e])||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||rgt.some(e=>(r.willChange||"").includes(e))||ngt.some(e=>(r.contain||"").includes(e))}function agt(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const igt=new Set(["html","body","#document"]);function sgt(e){return igt.has(qyt(e))}function lgt(e){return $yt(e).getComputedStyle(e)}function cgt(e){return Uyt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ugt(e){if("html"===qyt(e))return e;const t=e.assignedSlot||e.parentNode||Zyt(e)&&e.host||Hyt(e);return Zyt(t)?t.host:t}function dgt(e){const t=ugt(e);return sgt(t)?e.ownerDocument?e.ownerDocument.body:e.body:Yyt(t)&&Gyt(t)?t:dgt(t)}function pgt(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);const o=dgt(e),a=o===(null==(n=e.ownerDocument)?void 0:n.body),i=$yt(o);if(a){const e=hgt(i);return t.concat(i,i.visualViewport||[],Gyt(o)?o:[],e&&r?pgt(e):[])}return t.concat(o,pgt(o,[],r))}function hgt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fgt(e){const t=lgt(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const o=Yyt(e),a=o?e.offsetWidth:r,i=o?e.offsetHeight:n,s=hyt(r)!==a||hyt(n)!==i;return s&&(r=a,n=i),{width:r,height:n,$:s}}function mgt(e){return Uyt(e)?e:e.contextElement}function vgt(e){const t=mgt(e);if(!Yyt(t))return myt(1);const r=t.getBoundingClientRect(),{width:n,height:o,$:a}=fgt(t);let i=(a?hyt(r.width):r.width)/n,s=(a?hyt(r.height):r.height)/o;return(!i||!Number.isFinite(i))&&(i=1),(!s||!Number.isFinite(s))&&(s=1),{x:i,y:s}}const ygt=myt(0);function ggt(e){const t=$yt(e);return agt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:ygt}function xgt(e,t,r,n){void 0===t&&(t=!1),void 0===r&&(r=!1);const o=e.getBoundingClientRect(),a=mgt(e);let i=myt(1);t&&(n?Uyt(n)&&(i=vgt(n)):i=vgt(e));const s=function(e,t,r){return void 0===t&&(t=!1),!(!r||t&&r!==$yt(e))&&t}(a,r,n)?ggt(a):myt(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){const e=$yt(a),t=n&&Uyt(n)?$yt(n):n;let r=e,o=hgt(r);for(;o&&n&&t!==r;){const e=vgt(o),t=o.getBoundingClientRect(),n=lgt(o),a=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,r=$yt(o),o=hgt(r)}}return Ayt({width:u,height:d,x:l,y:c})}function bgt(e,t){const r=cgt(e).scrollLeft;return t?t.left+r:xgt(Hyt(e)).left+r}function kgt(e,t,r){void 0===r&&(r=!1);const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-(r?0:bgt(e,n)),y:n.top+t.scrollTop}}const _gt=new Set(["absolute","fixed"]);function wgt(e,t,r){let n;if("viewport"===t)n=function(e,t){const r=$yt(e),n=Hyt(e),o=r.visualViewport;let a=n.clientWidth,i=n.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const e=agt();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:a,height:i,x:s,y:l}}(e,r);else if("document"===t)n=function(e){const t=Hyt(e),r=cgt(e),n=e.ownerDocument.body,o=pyt(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),a=pyt(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let i=-r.scrollLeft+bgt(e);const s=-r.scrollTop;return"rtl"===lgt(n).direction&&(i+=pyt(t.clientWidth,n.clientWidth)-o),{width:o,height:a,x:i,y:s}}(Hyt(e));else if(Uyt(t))n=function(e,t){const r=xgt(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,a=Yyt(e)?vgt(e):myt(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:n*a.y}}(t,r);else{const r=ggt(e);n={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Ayt(n)}function Mgt(e,t){const r=ugt(e);return!(r===t||!Uyt(r)||sgt(r))&&("fixed"===lgt(r).position||Mgt(r,t))}function Cgt(e,t){const r=t.get(e);if(r)return r;let n=pgt(e,[],!1).filter(e=>Uyt(e)&&"body"!==qyt(e)),o=null;const a="fixed"===lgt(e).position;let i=a?ugt(e):e;for(;Uyt(i)&&!sgt(i);){const t=lgt(i),r=ogt(i);!r&&"fixed"===t.position&&(o=null),(a?!r&&!o:!r&&"static"===t.position&&o&&_gt.has(o.position)||Gyt(i)&&!r&&Mgt(e,i))?n=n.filter(e=>e!==i):o=t,i=ugt(i)}return t.set(e,n),n}function jgt(e,t,r){const n=Yyt(t),o=Hyt(t),a="fixed"===r,i=xgt(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=myt(0);function c(){l.x=bgt(o)}if(n||!n&&!a)if(("body"!==qyt(t)||Gyt(o))&&(s=cgt(t)),n){const e=xgt(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();a&&!n&&o&&c();const u=!o||n||a?myt(0):kgt(o,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function Dgt(e){return"static"===lgt(e).position}function Ogt(e,t){if(!Yyt(e)||"fixed"===lgt(e).position)return null;if(t)return t(e);let r=e.offsetParent;return Hyt(e)===r&&(r=r.ownerDocument.body),r}function Sgt(e,t){const r=$yt(e);if(egt(e))return r;if(!Yyt(e)){let t=ugt(e);for(;t&&!sgt(t);){if(Uyt(t)&&!Dgt(t))return t;t=ugt(t)}return r}let n=Ogt(e,t);for(;n&&Qyt(n)&&Dgt(n);)n=Ogt(n,t);return n&&sgt(n)&&Dgt(n)&&!ogt(n)?r:n||function(e){let t=ugt(e);for(;Yyt(t)&&!sgt(t);){if(ogt(t))return t;if(egt(t))return null;t=ugt(t)}return null}(e)||r}const Pgt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e;const a="fixed"===o,i=Hyt(n),s=!!t&&egt(t.floating);if(n===i||s&&a)return r;let l={scrollLeft:0,scrollTop:0},c=myt(1);const u=myt(0),d=Yyt(n);if((d||!d&&!a)&&(("body"!==qyt(n)||Gyt(i))&&(l=cgt(n)),Yyt(n))){const e=xgt(n);c=vgt(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}const p=!i||d||a?myt(0):kgt(i,l,!0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:r.y*c.y-l.scrollTop*c.y+u.y+p.y}},getDocumentElement:Hyt,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e;const a=[..."clippingAncestors"===r?egt(t)?[]:Cgt(t,this._c):[].concat(r),n],i=a[0],s=a.reduce((e,r)=>{const n=wgt(t,r,o);return e.top=pyt(n.top,e.top),e.right=dyt(n.right,e.right),e.bottom=dyt(n.bottom,e.bottom),e.left=pyt(n.left,e.left),e},wgt(t,i,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:Sgt,getElementRects:async function(e){const t=this.getOffsetParent||Sgt,r=this.getDimensions,n=await r(e.floating);return{reference:jgt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:r}=fgt(e);return{width:t,height:r}},getScale:vgt,isElement:Uyt,isRTL:function(e){return"rtl"===lgt(e).direction}};function Tgt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Egt(e,t,r,n){void 0===n&&(n={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=n,c=mgt(e),u=o||a?[...c?pgt(c):[],...pgt(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});const d=c&&s?function(e,t){let r,n=null;const o=Hyt(e);function a(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:d,width:p,height:h}=c;if(s||t(),!p||!h)return;const f={rootMargin:-fyt(d)+"px "+-fyt(o.clientWidth-(u+p))+"px "+-fyt(o.clientHeight-(d+h))+"px "+-fyt(u)+"px",threshold:pyt(0,dyt(1,l))||1};let m=!0;function v(t){const n=t[0].intersectionRatio;if(n!==l){if(!m)return i();n?i(!1,n):r=setTimeout(()=>{i(!1,1e-7)},1e3)}1===n&&!Tgt(c,e.getBoundingClientRect())&&i(),m=!1}try{n=new IntersectionObserver(v,{...f,root:o.ownerDocument})}catch{n=new IntersectionObserver(v,f)}n.observe(e)}(!0),a}(c,r):null;let p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),c&&!l&&h.observe(c),h.observe(t));let f,m=l?xgt(e):null;return l&&function t(){const n=xgt(e);m&&!Tgt(m,n)&&r(),m=n,f=requestAnimationFrame(t)}(),r(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Ngt=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:r,platform:n,elements:o}=e,a=await(null==n.isRTL?void 0:n.isRTL(o.floating)),i=byt(r),s=kyt(r),l="y"===Cyt(r),c=Vyt.has(i)?-1:1,u=a&&l?-1:1,d=xyt(t,e);let{mainAxis:p,crossAxis:h,alignmentAxis:f}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof f&&(h="end"===s?-1*f:f),l?{x:h*u,y:p*c}:{x:p*c,y:h*u}}(t,e);return i===(null==(r=s.offset)?void 0:r.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},zgt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=xyt(e,t),c={x:r,y:n},u=await Fyt(t,l),d=Cyt(byt(o)),p=_yt(d);let h=c[p],f=c[d];if(a){const e="y"===p?"bottom":"right";h=gyt(h+u["y"===p?"top":"left"],h,h-u[e])}if(i){const e="y"===d?"bottom":"right";f=gyt(f+u["y"===d?"top":"left"],f,f-u[e])}const m=s.fn({...t,[p]:h,[d]:f});return{...m,data:{x:m.x-r,y:m.y-n,enabled:{[p]:a,[d]:i}}}}}},Agt=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var r,n;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:h="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:m=!0,...v}=xyt(e,t);if(null!=(r=a.arrow)&&r.alignmentOffset)return{};const y=byt(o),g=Cyt(s),x=byt(s)===s,b=await(null==l.isRTL?void 0:l.isRTL(c.floating)),k=p||(x||!m?[Nyt(s)]:function(e){const t=Nyt(e);return[Dyt(e),t,Dyt(t)]}(s)),_="none"!==f;!p&&_&&k.push(...Eyt(s,m,f,b));const w=[s,...k],M=await Fyt(t,v),C=[];let j=(null==(n=a.flip)?void 0:n.overflows)||[];if(u&&C.push(M[y]),d){const e=function(e,t,r){void 0===r&&(r=!1);const n=kyt(e),o=jyt(e),a=wyt(o);let i="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Nyt(i)),[i,Nyt(i)]}(o,i,b);C.push(M[e[0]],M[e[1]])}if(j=[...j,{placement:o,overflows:C}],!C.every(e=>e<=0)){var D,O;const e=((null==(D=a.flip)?void 0:D.index)||0)+1,t=w[e];if(t&&("alignment"!==d||g===Cyt(t)||j.every(e=>e.overflows[0]>0&&Cyt(e.placement)===g)))return{data:{index:e,overflows:j},reset:{placement:t}};let r=null==(O=j.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:O.placement;if(!r)switch(h){case"bestFit":{var S;const e=null==(S=j.filter(e=>{if(_){const t=Cyt(e.placement);return t===g||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:S[0];e&&(r=e);break}case"initialPlacement":r=s}if(o!==r)return{reset:{placement:r}}}return{}}}},Rgt=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=xyt(e,t),u=await Fyt(t,c),d=byt(o),p=kyt(o),h="y"===Cyt(o),{width:f,height:m}=a.floating;let v,y;"top"===d||"bottom"===d?(v=d,y=p===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,v="end"===p?"top":"bottom");const g=m-u.top-u.bottom,x=f-u.left-u.right,b=dyt(m-u[v],g),k=dyt(f-u[y],x),_=!t.middlewareData.shift;let w=b,M=k;if(null!=(r=t.middlewareData.shift)&&r.enabled.x&&(M=x),null!=(n=t.middlewareData.shift)&&n.enabled.y&&(w=g),_&&!p){const e=pyt(u.left,0),t=pyt(u.right,0),r=pyt(u.top,0),n=pyt(u.bottom,0);h?M=f-2*(0!==e||0!==t?e+t:pyt(u.left,u.right)):w=m-2*(0!==r||0!==n?r+n:pyt(u.top,u.bottom))}await l({...t,availableWidth:M,availableHeight:w});const C=await i.getDimensions(s.floating);return f!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},Fgt=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...o}=xyt(e,t);switch(n){case"referenceHidden":{const e=Lyt(await Fyt(t,{...o,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Byt(e)}}}case"escaped":{const e=Lyt(await Fyt(t,{...o,altBoundary:!0}),r.floating);return{data:{escapedOffsets:e,escaped:Byt(e)}}}default:return{}}}}},Lgt=e=>({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=xyt(e,t)||{};if(null==c)return{};const d=zyt(u),p={x:r,y:n},h=jyt(o),f=wyt(h),m=await i.getDimensions(c),v="y"===h,y=v?"top":"left",g=v?"bottom":"right",x=v?"clientHeight":"clientWidth",b=a.reference[f]+a.reference[h]-p[h]-a.floating[f],k=p[h]-a.reference[h],_=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let w=_?_[x]:0;(!w||!await(null==i.isElement?void 0:i.isElement(_)))&&(w=s.floating[x]||a.floating[f]);const M=b/2-k/2,C=w/2-m[f]/2-1,j=dyt(d[y],C),D=dyt(d[g],C),O=j,S=w-m[f]-D,P=w/2-m[f]/2+M,T=gyt(O,P,S),E=!l.arrow&&null!=kyt(o)&&P!==T&&a.reference[f]/2-(P<O?j:D)-m[f]/2<0,N=E?P<O?P-O:P-S:0;return{[h]:p[h]+N,data:{[h]:T,centerOffset:P-T-N,...E&&{alignmentOffset:N}},reset:E}}}),Bgt=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=xyt(e,t),u={x:r,y:n},d=Cyt(o),p=_yt(d);let h=u[p],f=u[d];const m=xyt(s,t),v="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===p?"height":"width",t=a.reference[p]-a.floating[e]+v.mainAxis,r=a.reference[p]+a.reference[e]-v.mainAxis;h<t?h=t:h>r&&(h=r)}if(c){var y,g;const e="y"===p?"width":"height",t=Vyt.has(byt(o)),r=a.reference[d]-a.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:v.crossAxis),n=a.reference[d]+a.reference[e]+(t?0:(null==(g=i.offset)?void 0:g[d])||0)-(t?v.crossAxis:0);f<r?f=r:f>n&&(f=n)}return{[p]:h,[d]:f}}}},Vgt=(e,t,r)=>{const n=new Map,o={platform:Pgt,...r},a={...o.platform,_c:n};return(async(e,t,r)=>{const{placement:n="bottom",strategy:o="absolute",middleware:a=[],platform:i}=r,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Ryt(c,n,l),p=n,h={},f=0;for(let r=0;r<s.length;r++){const{name:a,fn:m}=s[r],{x:v,y:y,data:g,reset:x}=await m({x:u,y:d,initialPlacement:n,placement:p,strategy:o,middlewareData:h,rects:c,platform:i,elements:{reference:e,floating:t}});u=v??u,d=y??d,h={...h,[a]:{...h[a],...g}},x&&f<=50&&(f++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(c=!0===x.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):x.rects),({x:u,y:d}=Ryt(c,p,l))),r=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:h}})(e,t,{...o,platform:a})};var Igt=typeof document<"u"?e.useLayoutEffect:function(){};function qgt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let r,n,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;0!==n--;)if(!qgt(e[n],t[n]))return!1;return!0}if(o=Object.keys(e),r=o.length,r!==Object.keys(t).length)return!1;for(n=r;0!==n--;)if(!{}.hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!==n--;){const r=o[n];if(!("_owner"===r&&e.$$typeof||qgt(e[r],t[r])))return!1}return!0}return e!=e&&t!=t}function $gt(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hgt(e,t){const r=$gt(e);return Math.round(t*r)/r}function Wgt(e){const t=s.useRef(e);return Igt(()=>{t.current=e}),t}const Ugt=e=>({name:"arrow",options:e,fn(t){const{element:r,padding:n}="function"==typeof e?e(t):e;return r&&function(e){return{}.hasOwnProperty.call(e,"current")}(r)?null!=r.current?Lgt({element:r.current,padding:n}).fn(t):{}:r?Lgt({element:r,padding:n}).fn(t):{}}}),Ygt=(e,t)=>({...Ngt(e),options:[e,t]}),Zgt=(e,t)=>({...zgt(e),options:[e,t]}),Kgt=(e,t)=>({...Bgt(e),options:[e,t]}),Ggt=(e,t)=>({...Agt(e),options:[e,t]}),Xgt=(e,t)=>({...Rgt(e),options:[e,t]}),Qgt=(e,t)=>({...Fgt(e),options:[e,t]}),Jgt=(e,t)=>({...Ugt(e),options:[e,t]});var ext=s.forwardRef((e,r)=>{const{children:n,width:o=10,height:a=5,...i}=e;return t.jsx(Olt.svg,{...i,ref:r,width:o,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:t.jsx("polygon",{points:"0,0 30,0 15,10"})})});ext.displayName="Arrow";var txt=ext,rxt="Popper",[nxt,oxt]=flt(rxt),[axt,ixt]=nxt(rxt),sxt=e=>{const{__scopePopper:r,children:n}=e,[o,a]=s.useState(null);return t.jsx(axt,{scope:r,anchor:o,onAnchorChange:a,children:n})};sxt.displayName=rxt;var lxt="PopperAnchor",cxt=s.forwardRef((e,r)=>{const{__scopePopper:n,virtualRef:o,...a}=e,i=ixt(lxt,n),l=s.useRef(null),c=hlt(r,l);return s.useEffect(()=>{i.onAnchorChange((null==o?void 0:o.current)||l.current)}),o?null:t.jsx(Olt.div,{...a,ref:c})});cxt.displayName=lxt;var uxt="PopperContent",[dxt,pxt]=nxt(uxt),hxt=s.forwardRef((e,r)=>{var n,o,a,i,l,c;const{__scopePopper:u,side:p="bottom",sideOffset:h=0,align:f="center",alignOffset:m=0,arrowPadding:v=0,avoidCollisions:y=!0,collisionBoundary:g=[],collisionPadding:x=0,sticky:b="partial",hideWhenDetached:k=!1,updatePositionStrategy:_="optimized",onPlaced:w,...M}=e,C=ixt(uxt,u),[j,D]=s.useState(null),O=hlt(r,e=>D(e)),[S,P]=s.useState(null),T=bvt(S),E=(null==T?void 0:T.width)??0,N=(null==T?void 0:T.height)??0,z=p+("center"!==f?"-"+f:""),A="number"==typeof x?x:{top:0,right:0,bottom:0,left:0,...x},R=Array.isArray(g)?g:[g],F=R.length>0,L={padding:A,boundary:R.filter(yxt),altBoundary:F},{refs:B,floatingStyles:V,placement:I,isPositioned:q,middlewareData:$}=function(e){void 0===e&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:o,elements:{reference:a,floating:i}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[p,h]=s.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=s.useState(n);qgt(f,n)||m(n);const[v,y]=s.useState(null),[g,x]=s.useState(null),b=s.useCallback(e=>{e!==M.current&&(M.current=e,y(e))},[]),k=s.useCallback(e=>{e!==C.current&&(C.current=e,x(e))},[]),_=a||v,w=i||g,M=s.useRef(null),C=s.useRef(null),j=s.useRef(p),D=null!=c,O=Wgt(c),S=Wgt(o),P=Wgt(u),T=s.useCallback(()=>{if(!M.current||!C.current)return;const e={placement:t,strategy:r,middleware:f};S.current&&(e.platform=S.current),Vgt(M.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==P.current};E.current&&!qgt(j.current,t)&&(j.current=t,d.flushSync(()=>{h(t)}))})},[f,t,r,S,P]);Igt(()=>{!1===u&&j.current.isPositioned&&(j.current.isPositioned=!1,h(e=>({...e,isPositioned:!1})))},[u]);const E=s.useRef(!1);Igt(()=>(E.current=!0,()=>{E.current=!1}),[]),Igt(()=>{if(_&&(M.current=_),w&&(C.current=w),_&&w){if(O.current)return O.current(_,w,T);T()}},[_,w,T,O,D]);const N=s.useMemo(()=>({reference:M,floating:C,setReference:b,setFloating:k}),[b,k]),z=s.useMemo(()=>({reference:_,floating:w}),[_,w]),A=s.useMemo(()=>{const e={position:r,left:0,top:0};if(!z.floating)return e;const t=Hgt(z.floating,p.x),n=Hgt(z.floating,p.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...$gt(z.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,z.floating,p.x,p.y]);return s.useMemo(()=>({...p,update:T,refs:N,elements:z,floatingStyles:A}),[p,T,N,z,A])}({strategy:"fixed",placement:z,whileElementsMounted:(...e)=>Egt(...e,{animationFrame:"always"===_}),elements:{reference:C.anchor},middleware:[Ygt({mainAxis:h+N,alignmentAxis:m}),y&&Zgt({mainAxis:!0,crossAxis:!1,limiter:"partial"===b?Kgt():void 0,...L}),y&&Ggt({...L}),Xgt({...L,apply:({elements:e,rects:t,availableWidth:r,availableHeight:n})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${r}px`),i.setProperty("--radix-popper-available-height",`${n}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),S&&Jgt({element:S,padding:v}),gxt({arrowWidth:E,arrowHeight:N}),k&&Qgt({strategy:"referenceHidden",...L})]}),[H,W]=xxt(I),U=Plt(w);vlt(()=>{q&&(null==U||U())},[q,U]);const Y=null==(n=$.arrow)?void 0:n.x,Z=null==(o=$.arrow)?void 0:o.y,K=0!==(null==(a=$.arrow)?void 0:a.centerOffset),[G,X]=s.useState();return vlt(()=>{j&&X(window.getComputedStyle(j).zIndex)},[j]),t.jsx("div",{ref:B.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:q?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:G,"--radix-popper-transform-origin":[null==(i=$.transformOrigin)?void 0:i.x,null==(l=$.transformOrigin)?void 0:l.y].join(" "),...(null==(c=$.hide)?void 0:c.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(dxt,{scope:u,placedSide:H,onArrowChange:P,arrowX:Y,arrowY:Z,shouldHideArrow:K,children:t.jsx(Olt.div,{"data-side":H,"data-align":W,...M,ref:O,style:{...M.style,animation:q?void 0:"none"}})})})});hxt.displayName=uxt;var fxt="PopperArrow",mxt={top:"bottom",right:"left",bottom:"top",left:"right"},vxt=s.forwardRef(function(e,r){const{__scopePopper:n,...o}=e,a=pxt(fxt,n),i=mxt[a.placedSide];return t.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:t.jsx(txt,{...o,ref:r,style:{...o.style,display:"block"}})})});function yxt(e){return null!==e}vxt.displayName=fxt;var gxt=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o;const{placement:a,rects:i,middlewareData:s}=t,l=0!==(null==(r=s.arrow)?void 0:r.centerOffset),c=l?0:e.arrowWidth,u=l?0:e.arrowHeight,[d,p]=xxt(a),h={start:"0%",center:"50%",end:"100%"}[p],f=((null==(n=s.arrow)?void 0:n.x)??0)+c/2,m=((null==(o=s.arrow)?void 0:o.y)??0)+u/2;let v="",y="";return"bottom"===d?(v=l?h:`${f}px`,y=-u+"px"):"top"===d?(v=l?h:`${f}px`,y=`${i.floating.height+u}px`):"right"===d?(v=-u+"px",y=l?h:`${m}px`):"left"===d&&(v=`${i.floating.width+u}px`,y=l?h:`${m}px`),{data:{x:v,y:y}}}});function xxt(e){const[t,r="center"]=e.split("-");return[t,r]}var bxt=sxt,kxt=cxt,_xt=hxt,wxt=vxt,Mxt="Popover",[Cxt,jxt]=flt(Mxt,[oxt]),Dxt=oxt(),[Oxt,Sxt]=Cxt(Mxt),Pxt=e=>{const{__scopePopover:r,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:l=!1}=e,c=Dxt(r),u=s.useRef(null),[d,p]=s.useState(!1),[h,f]=klt({prop:o,defaultProp:a??!1,onChange:i,caller:Mxt});return t.jsx(bxt,{...c,children:t.jsx(Oxt,{scope:r,contentId:xlt(),triggerRef:u,open:h,onOpenChange:f,onOpenToggle:s.useCallback(()=>f(e=>!e),[f]),hasCustomAnchor:d,onCustomAnchorAdd:s.useCallback(()=>p(!0),[]),onCustomAnchorRemove:s.useCallback(()=>p(!1),[]),modal:l,children:n})})};Pxt.displayName=Mxt;var Txt="PopoverAnchor",Ext=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Sxt(Txt,n),i=Dxt(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=a;return s.useEffect(()=>(l(),()=>c()),[l,c]),t.jsx(kxt,{...i,...o,ref:r})});Ext.displayName=Txt;var Nxt="PopoverTrigger",zxt=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Sxt(Nxt,n),i=Dxt(n),s=hlt(r,a.triggerRef),l=t.jsx(Olt.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":Zxt(a.open),...o,ref:s,onClick:ult(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?l:t.jsx(kxt,{asChild:!0,...i,children:l})});zxt.displayName=Nxt;var Axt="PopoverPortal",[Rxt,Fxt]=Cxt(Axt,{forceMount:void 0}),Lxt=e=>{const{__scopePopover:r,forceMount:n,children:o,container:a}=e,i=Sxt(Axt,r);return t.jsx(Rxt,{scope:r,forceMount:n,children:t.jsx(Xlt,{present:n||i.open,children:t.jsx(Glt,{asChild:!0,container:a,children:o})})})};Lxt.displayName=Axt;var Bxt="PopoverContent",Vxt=s.forwardRef((e,r)=>{const n=Fxt(Bxt,e.__scopePopover),{forceMount:o=n.forceMount,...a}=e,i=Sxt(Bxt,e.__scopePopover);return t.jsx(Xlt,{present:o||i.open,children:i.modal?t.jsx(qxt,{...a,ref:r}):t.jsx($xt,{...a,ref:r})})});Vxt.displayName=Bxt;var Ixt=_lt("PopoverContent.RemoveScroll"),qxt=s.forwardRef((e,r)=>{const n=Sxt(Bxt,e.__scopePopover),o=s.useRef(null),a=hlt(r,o),i=s.useRef(!1);return s.useEffect(()=>{const e=o.current;if(e)return Xct(e)},[]),t.jsx(Hct,{as:Ixt,allowPinchZoom:!0,children:t.jsx(Hxt,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ult(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),i.current||null==(t=n.triggerRef.current)||t.focus()}),onPointerDownOutside:ult(e.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;i.current=n},{checkForDefaultPrevented:!1}),onFocusOutside:ult(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1})})})}),$xt=s.forwardRef((e,r)=>{const n=Sxt(Bxt,e.__scopePopover),o=s.useRef(!1),a=s.useRef(!1);return t.jsx(Hxt,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,i;null==(r=e.onCloseAutoFocus)||r.call(e,t),t.defaultPrevented||(o.current||null==(i=n.triggerRef.current)||i.focus(),t.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:t=>{var r,i;null==(r=e.onInteractOutside)||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(a.current=!0));const s=t.target;(null==(i=n.triggerRef.current)?void 0:i.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),Hxt=s.forwardRef((e,r)=>{const{__scopePopover:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...p}=e,h=Sxt(Bxt,n),f=Dxt(n);return ect(),t.jsx($lt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:t.jsx(Rlt,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>h.onOpenChange(!1),children:t.jsx(_xt,{"data-state":Zxt(h.open),role:"dialog",id:h.contentId,...f,...p,ref:r,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Wxt="PopoverClose",Uxt=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Sxt(Wxt,n);return t.jsx(Olt.button,{type:"button",...o,ref:r,onClick:ult(e.onClick,()=>a.onOpenChange(!1))})});Uxt.displayName=Wxt;var Yxt=s.forwardRef((e,r)=>{const{__scopePopover:n,...o}=e,a=Dxt(n);return t.jsx(wxt,{...a,...o,ref:r})});function Zxt(e){return e?"open":"closed"}Yxt.displayName="PopoverArrow";var Kxt=Lxt,Gxt=Vxt;const Xxt=Pxt,Qxt=zxt,Jxt=s.forwardRef(({className:e,align:r="center",sideOffset:n=4,...o},a)=>t.jsx(Kxt,{children:t.jsx(Gxt,{ref:a,align:r,sideOffset:n,className:zdt("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...o})}));Jxt.displayName=Gxt.displayName;const ebt=s.forwardRef(({className:e,...r},n)=>t.jsx("textarea",{className:zdt("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...r}));ebt.displayName="Textarea";const tbt=e.createContext({});function rbt(t){const r=e.useRef(null);return null===r.current&&(r.current=t()),r.current}const nbt=e.createContext(null),obt=e.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class abt extends s.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function ibt({children:r,isPresent:n}){const o=e.useId(),a=e.useRef(null),i=e.useRef({width:0,height:0,top:0,left:0}),{nonce:l}=e.useContext(obt);return e.useInsertionEffect(()=>{const{width:e,height:t,top:r,left:s}=i.current;if(n||!a.current||!e||!t)return;a.current.dataset.motionPopId=o;const c=document.createElement("style");return l&&(c.nonce=l),document.head.appendChild(c),c.sheet&&c.sheet.insertRule(`\n [data-motion-pop-id="${o}"] {\n position: absolute !important;\n width: ${e}px !important;\n height: ${t}px !important;\n top: ${r}px !important;\n left: ${s}px !important;\n }\n `),()=>{document.head.removeChild(c)}},[n]),t.jsx(abt,{isPresent:n,childRef:a,sizeRef:i,children:s.cloneElement(r,{ref:a})})}const sbt=({children:r,initial:n,isPresent:o,onExitComplete:a,custom:i,presenceAffectsLayout:l,mode:c})=>{const u=rbt(lbt),d=e.useId(),p=e.useCallback(e=>{u.set(e,!0);for(const e of u.values())if(!e)return;a&&a()},[u,a]),h=e.useMemo(()=>({id:d,initial:n,isPresent:o,custom:i,onExitComplete:p,register:e=>(u.set(e,!1),()=>u.delete(e))}),l?[Math.random(),p]:[o,p]);return e.useMemo(()=>{u.forEach((e,t)=>u.set(t,!1))},[o]),s.useEffect(()=>{!o&&!u.size&&a&&a()},[o]),"popLayout"===c&&(r=t.jsx(ibt,{isPresent:o,children:r})),t.jsx(nbt.Provider,{value:h,children:r})};function lbt(){return new Map}function cbt(t=!0){const r=e.useContext(nbt);if(null===r)return[!0,null];const{isPresent:n,onExitComplete:o,register:a}=r,i=e.useId();e.useEffect(()=>{t&&a(i)},[t]);const s=e.useCallback(()=>t&&o&&o(i),[i,o,t]);return!n&&o?[!1,s]:[!0]}const ubt=e=>e.key||"";function dbt(t){const r=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&r.push(t)}),r}const pbt=typeof window<"u",hbt=pbt?e.useLayoutEffect:e.useEffect,fbt=({children:r,custom:n,initial:o=!0,onExitComplete:a,presenceAffectsLayout:i=!0,mode:s="sync",propagate:l=!1})=>{const[c,u]=cbt(l),d=e.useMemo(()=>dbt(r),[r]),p=l&&!c?[]:d.map(ubt),h=e.useRef(!0),f=e.useRef(d),m=rbt(()=>new Map),[v,y]=e.useState(d),[g,x]=e.useState(d);hbt(()=>{h.current=!1,f.current=d;for(let e=0;e<g.length;e++){const t=ubt(g[e]);p.includes(t)?m.delete(t):!0!==m.get(t)&&m.set(t,!1)}},[g,p.length,p.join("-")]);const b=[];if(d!==v){let e=[...d];for(let t=0;t<g.length;t++){const r=g[t],n=ubt(r);p.includes(n)||(e.splice(t,0,r),b.push(r))}return"wait"===s&&b.length&&(e=b),x(dbt(e)),void y(d)}"production"!==process.env.NODE_ENV&&"wait"===s&&g.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}=e.useContext(tbt);return t.jsx(t.Fragment,{children:g.map(e=>{const r=ubt(e),v=!(l&&!c)&&(d===g||p.includes(r));return t.jsx(sbt,{isPresent:v,initial:!(h.current&&!o)&&void 0,custom:v?void 0:n,presenceAffectsLayout:i,mode:s,onExitComplete:v?void 0:()=>{if(!m.has(r))return;m.set(r,!0);let e=!0;m.forEach(t=>{t||(e=!1)}),e&&(null==k||k(),x(f.current),l&&(null==u||u()),a&&a())},children:e},r)})})},mbt=e=>e;let vbt=mbt,ybt=mbt;function gbt(e){let t;return()=>(void 0===t&&(t=e()),t)}"production"!==process.env.NODE_ENV&&(vbt=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},ybt=(e,t)=>{if(!e)throw new Error(t)});const xbt=(e,t,r)=>{const n=t-e;return 0===n?1:(r-e)/n},bbt=e=>1e3*e,kbt=e=>e/1e3,_bt=!1;const wbt=["read","resolveKeyframes","update","preRender","render","postRender"];function Mbt(e,t){let r=!1,n=!0;const o={delta:0,timestamp:0,isProcessing:!1},a=()=>r=!0,i=wbt.reduce((e,t)=>(e[t]=function(e){let t=new Set,r=new Set,n=!1,o=!1;const a=new WeakSet;let i={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(l.schedule(t),e()),t(i)}const l={schedule:(e,o=!1,i=!1)=>{const s=i&&n?t:r;return o&&a.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),a.delete(e)},process:e=>{i=e,n?o=!0:(n=!0,[t,r]=[r,t],t.forEach(s),t.clear(),n=!1,o&&(o=!1,l.process(e)))}};return l}(a),e),{}),{read:s,resolveKeyframes:l,update:c,preRender:u,render:d,postRender:p}=i,h=()=>{const a=performance.now();r=!1,o.delta=n?1e3/60:Math.max(Math.min(a-o.timestamp,40),1),o.timestamp=a,o.isProcessing=!0,s.process(o),l.process(o),c.process(o),u.process(o),d.process(o),p.process(o),o.isProcessing=!1,r&&t&&(n=!1,e(h))};return{schedule:wbt.reduce((t,a)=>{const s=i[a];return t[a]=(t,a=!1,i=!1)=>(r||(r=!0,n=!0,o.isProcessing||e(h)),s.schedule(t,a,i)),t},{}),cancel:e=>{for(let t=0;t<wbt.length;t++)i[wbt[t]].cancel(e)},state:o,steps:i}}const{schedule:Cbt,cancel:jbt,state:Dbt,steps:Obt}=Mbt(typeof requestAnimationFrame<"u"?requestAnimationFrame:mbt,!0),Sbt=e.createContext({strict:!1}),Pbt={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"]},Tbt={};for(const e in Pbt)Tbt[e]={isEnabled:t=>Pbt[e].some(e=>!!t[e])};const Ebt=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Nbt(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ebt.has(e)}let zbt=e=>!Nbt(e);try{!function(e){e&&(zbt=t=>t.startsWith("on")?!Nbt(t):e(t))}(require("@emotion/is-prop-valid").default)}catch{}const Abt=new Set;function Rbt(e,t,r){e||Abt.has(t)||(console.warn(t),Abt.add(t))}function Fbt(e){if(typeof Proxy>"u")return e;const t=new Map;return new Proxy((...t)=>("production"!==process.env.NODE_ENV&&Rbt(!1,"motion() is deprecated. Use motion.create() instead."),e(...t)),{get:(r,n)=>"create"===n?e:(t.has(n)||t.set(n,e(n)),t.get(n))})}const Lbt=e.createContext({});function Bbt(e){return"string"==typeof e||Array.isArray(e)}function Vbt(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const Ibt=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],qbt=["initial",...Ibt];function $bt(e){return Vbt(e.animate)||qbt.some(t=>Bbt(e[t]))}function Hbt(e){return!(!$bt(e)&&!e.variants)}function Wbt(t){const{initial:r,animate:n}=function(e,t){if($bt(e)){const{initial:t,animate:r}=e;return{initial:!1===t||Bbt(t)?t:void 0,animate:Bbt(r)?r:void 0}}return!1!==e.inherit?t:{}}(t,e.useContext(Lbt));return e.useMemo(()=>({initial:r,animate:n}),[Ubt(r),Ubt(n)])}function Ubt(e){return Array.isArray(e)?e.join(" "):e}const Ybt=Symbol.for("motionComponentSymbol");function Zbt(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function Kbt(t,r,n){return e.useCallback(e=>{e&&t.onMount&&t.onMount(e),r&&(e?r.mount(e):r.unmount()),n&&("function"==typeof n?n(e):Zbt(n)&&(n.current=e))},[r])}const Gbt=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Xbt="data-"+Gbt("framerAppearId"),{schedule:Qbt}=Mbt(queueMicrotask,!1),Jbt=e.createContext({});function ekt(t,r,n,o,a){var i,s;const{visualElement:l}=e.useContext(Lbt),c=e.useContext(Sbt),u=e.useContext(nbt),d=e.useContext(obt).reducedMotion,p=e.useRef(null);o=o||c.renderer,!p.current&&o&&(p.current=o(t,{visualState:r,parent:l,props:n,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:d}));const h=p.current,f=e.useContext(Jbt);h&&!h.projection&&a&&("html"===h.type||"svg"===h.type)&&function(e,t,r,n){const{layoutId:o,layout:a,drag:i,dragConstraints:s,layoutScroll:l,layoutRoot:c}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:tkt(e.parent)),e.projection.setOptions({layoutId:o,layout:a,alwaysMeasureLayout:!!i||s&&Zbt(s),visualElement:e,animationType:"string"==typeof a?a:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:c})}(p.current,n,a,f);const m=e.useRef(!1);e.useInsertionEffect(()=>{h&&m.current&&h.update(n,u)});const v=n[Xbt],y=e.useRef(!!v&&!(null!==(i=window.MotionHandoffIsComplete)&&void 0!==i&&i.call(window,v))&&(null===(s=window.MotionHasOptimisedAnimation)||void 0===s?void 0:s.call(window,v)));return hbt(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),Qbt.render(h.render),y.current&&h.animationState&&h.animationState.animateChanges())}),e.useEffect(()=>{h&&(!y.current&&h.animationState&&h.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var e;null===(e=window.MotionHandoffMarkAsComplete)||void 0===e||e.call(window,v)}),y.current=!1))}),h}function tkt(e){if(e)return!1!==e.options.allowProjection?e.projection:tkt(e.parent)}function rkt({preloadedFeatures:r,createVisualElement:n,useRender:o,useVisualState:a,Component:i}){var s,l;function c(s,l){let c;const u={...e.useContext(obt),...s,layoutId:nkt(s)},{isStatic:d}=u,p=Wbt(s),h=a(s,d);if(!d&&pbt){!function(t,r){const n=e.useContext(Sbt).strict;if("production"!==process.env.NODE_ENV&&r&&n){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?vbt(!1,e):ybt(!1,e)}}(u,r);const t=function(e){const{drag:t,layout:r}=Tbt;if(!t&&!r)return{};const n={...t,...r};return{MeasureLayout:null!=t&&t.isEnabled(e)||null!=r&&r.isEnabled(e)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}(u);c=t.MeasureLayout,p.visualElement=ekt(i,h,u,n,t.ProjectionNode)}return t.jsxs(Lbt.Provider,{value:p,children:[c&&p.visualElement?t.jsx(c,{visualElement:p.visualElement,...u}):null,o(i,s,Kbt(h,p.visualElement,l),h,d,p.visualElement)]})}r&&function(e){for(const t in e)Tbt[t]={...Tbt[t],...e[t]}}(r),c.displayName=`motion.${"string"==typeof i?i:`create(${null!==(l=null!==(s=i.displayName)&&void 0!==s?s:i.name)&&void 0!==l?l:""})`}`;const u=e.forwardRef(c);return u[Ybt]=i,u}function nkt({layoutId:t}){const r=e.useContext(tbt).id;return r&&void 0!==t?r+"-"+t:t}const okt=["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 akt(e){return"string"==typeof e&&!e.includes("-")&&!!(okt.indexOf(e)>-1||/[A-Z]/u.test(e))}function ikt(e){const t=[{},{}];return null==e||e.values.forEach((e,r)=>{t[0][r]=e.get(),t[1][r]=e.getVelocity()}),t}function skt(e,t,r,n){if("function"==typeof t){const[o,a]=ikt(n);t=t(void 0!==r?r:e.custom,o,a)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[o,a]=ikt(n);t=t(void 0!==r?r:e.custom,o,a)}return t}const lkt=e=>Array.isArray(e),ckt=e=>lkt(e)?e[e.length-1]||0:e,ukt=e=>!(!e||!e.getVelocity);function dkt(e){const t=ukt(e)?e.get():e;return(e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue))(t)?t.toValue():t}const pkt=t=>(r,n)=>{const o=e.useContext(Lbt),a=e.useContext(nbt),i=()=>function({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:r},n,o,a){const i={latestValues:hkt(n,o,a,e),renderState:t()};return r&&(i.onMount=e=>r({props:n,current:e,...i}),i.onUpdate=e=>r(e)),i}(t,r,o,a);return n?i():rbt(i)};function hkt(e,t,r,n){const o={},a=n(e,{});for(const e in a)o[e]=dkt(a[e]);let{initial:i,animate:s}=e;const l=$bt(e),c=Hbt(e);t&&c&&!l&&!1!==e.inherit&&(void 0===i&&(i=t.initial),void 0===s&&(s=t.animate));let u=!!r&&!1===r.initial;u=u||!1===i;const d=u?s:i;if(d&&"boolean"!=typeof d&&!Vbt(d)){const t=Array.isArray(d)?d:[d];for(let r=0;r<t.length;r++){const n=skt(e,t[r]);if(n){const{transitionEnd:e,transition:t,...r}=n;for(const e in r){let t=r[e];if(Array.isArray(t)){t=t[u?t.length-1:0]}null!==t&&(o[e]=t)}for(const t in e)o[t]=e[t]}}}return o}const fkt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],mkt=new Set(fkt),vkt=e=>t=>"string"==typeof t&&t.startsWith(e),ykt=vkt("--"),gkt=vkt("var(--"),xkt=e=>!!gkt(e)&&bkt.test(e.split("/*")[0].trim()),bkt=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,kkt=(e,t)=>t&&"number"==typeof e?t.transform(e):e,_kt=(e,t,r)=>r>t?t:r<e?e:r,wkt={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},Mkt={...wkt,transform:e=>_kt(0,1,e)},Ckt={...wkt,default:1},jkt=e=>({test:t=>"string"==typeof t&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),Dkt=jkt("deg"),Okt=jkt("%"),Skt=jkt("px"),Pkt=jkt("vh"),Tkt=jkt("vw"),Ekt={...Okt,parse:e=>Okt.parse(e)/100,transform:e=>Okt.transform(100*e)},Nkt={borderWidth:Skt,borderTopWidth:Skt,borderRightWidth:Skt,borderBottomWidth:Skt,borderLeftWidth:Skt,borderRadius:Skt,radius:Skt,borderTopLeftRadius:Skt,borderTopRightRadius:Skt,borderBottomRightRadius:Skt,borderBottomLeftRadius:Skt,width:Skt,maxWidth:Skt,height:Skt,maxHeight:Skt,top:Skt,right:Skt,bottom:Skt,left:Skt,padding:Skt,paddingTop:Skt,paddingRight:Skt,paddingBottom:Skt,paddingLeft:Skt,margin:Skt,marginTop:Skt,marginRight:Skt,marginBottom:Skt,marginLeft:Skt,backgroundPositionX:Skt,backgroundPositionY:Skt},zkt={rotate:Dkt,rotateX:Dkt,rotateY:Dkt,rotateZ:Dkt,scale:Ckt,scaleX:Ckt,scaleY:Ckt,scaleZ:Ckt,skew:Dkt,skewX:Dkt,skewY:Dkt,distance:Skt,translateX:Skt,translateY:Skt,translateZ:Skt,x:Skt,y:Skt,z:Skt,perspective:Skt,transformPerspective:Skt,opacity:Mkt,originX:Ekt,originY:Ekt,originZ:Skt},Akt={...wkt,transform:Math.round},Rkt={...Nkt,...zkt,zIndex:Akt,size:Skt,fillOpacity:Mkt,strokeOpacity:Mkt,numOctaves:Akt},Fkt={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Lkt=fkt.length;function Bkt(e,t,r){const{style:n,vars:o,transformOrigin:a}=e;let i=!1,s=!1;for(const e in t){const r=t[e];if(mkt.has(e))i=!0;else if(ykt(e))o[e]=r;else{const t=kkt(r,Rkt[e]);e.startsWith("origin")?(s=!0,a[e]=t):n[e]=t}}if(t.transform||(i||r?n.transform=function(e,t,r){let n="",o=!0;for(let a=0;a<Lkt;a++){const i=fkt[a],s=e[i];if(void 0===s)continue;let l=!0;if(l="number"==typeof s?s===(i.startsWith("scale")?1:0):0===parseFloat(s),!l||r){const e=kkt(s,Rkt[i]);l||(o=!1,n+=`${Fkt[i]||i}(${e}) `),r&&(t[i]=e)}}return n=n.trim(),r?n=r(t,o?"":n):o&&(n="none"),n}(t,e.transform,r):n.transform&&(n.transform="none")),s){const{originX:e="50%",originY:t="50%",originZ:r=0}=a;n.transformOrigin=`${e} ${t} ${r}`}}const Vkt={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ikt={offset:"strokeDashoffset",array:"strokeDasharray"};function qkt(e,t,r){return"string"==typeof e?e:Skt.transform(t+r*e)}function $kt(e,{attrX:t,attrY:r,attrScale:n,originX:o,originY:a,pathLength:i,pathSpacing:s=1,pathOffset:l=0,...c},u,d){if(Bkt(e,c,d),u)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:p,style:h,dimensions:f}=e;p.transform&&(f&&(h.transform=p.transform),delete p.transform),f&&(void 0!==o||void 0!==a||h.transform)&&(h.transformOrigin=function(e,t,r){return`${qkt(t,e.x,e.width)} ${qkt(r,e.y,e.height)}`}(f,void 0!==o?o:.5,void 0!==a?a:.5)),void 0!==t&&(p.x=t),void 0!==r&&(p.y=r),void 0!==n&&(p.scale=n),void 0!==i&&function(e,t,r=1,n=0,o=!0){e.pathLength=1;const a=o?Vkt:Ikt;e[a.offset]=Skt.transform(-n);const i=Skt.transform(t),s=Skt.transform(r);e[a.array]=`${i} ${s}`}(p,i,s,l,!1)}const Hkt=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),Wkt=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Ukt=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Ykt(e,{style:t,vars:r},n,o){Object.assign(e.style,t,o&&o.getProjectionStyles(n));for(const t in r)e.style.setProperty(t,r[t])}const Zkt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Kkt(e,t,r,n){Ykt(e,t,void 0,n);for(const r in t.attrs)e.setAttribute(Zkt.has(r)?r:Gbt(r),t.attrs[r])}const Gkt={};function Xkt(e,{layout:t,layoutId:r}){return mkt.has(e)||e.startsWith("origin")||(t||void 0!==r)&&(!!Gkt[e]||"opacity"===e)}function Qkt(e,t,r){var n;const{style:o}=e,a={};for(const i in o)(ukt(o[i])||t.style&&ukt(t.style[i])||Xkt(i,e)||void 0!==(null===(n=null==r?void 0:r.getValue(i))||void 0===n?void 0:n.liveStyle))&&(a[i]=o[i]);return a}function Jkt(e,t,r){const n=Qkt(e,t,r);for(const r in e)if(ukt(e[r])||ukt(t[r])){n[-1!==fkt.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=e[r]}return n}const e_t=["x","y","width","height","cx","cy","r"],t_t={useVisualState:pkt({scrapeMotionValuesFromProps:Jkt,createRenderState:Wkt,onUpdate:({props:e,prevProps:t,current:r,renderState:n,latestValues:o})=>{if(!r)return;let a=!!e.drag;if(!a)for(const e in o)if(mkt.has(e)){a=!0;break}if(!a)return;let i=!t;if(t)for(let r=0;r<e_t.length;r++){const n=e_t[r];e[n]!==t[n]&&(i=!0)}i&&Cbt.read(()=>{(function(e,t){try{t.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}})(r,n),Cbt.render(()=>{$kt(n,o,Ukt(r.tagName),e.transformTemplate),Kkt(r,n)})})}})},r_t={useVisualState:pkt({scrapeMotionValuesFromProps:Qkt,createRenderState:Hkt})};function n_t(e,t,r){for(const n in t)!ukt(t[n])&&!Xkt(n,r)&&(e[n]=t[n])}function o_t(t,r){const n={};return n_t(n,t.style||{},t),Object.assign(n,function({transformTemplate:t},r){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return Bkt(e,r,t),Object.assign({},e.vars,e.style)},[r])}(t,r)),n}function a_t(e,t){const r={},n=o_t(e,t);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}function i_t(t,r,n,o){const a=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return $kt(e,r,Ukt(o),t.transformTemplate),{...e.attrs,style:{...e.style}}},[r]);if(t.style){const e={};n_t(e,t.style,t),a.style={...e,...a.style}}return a}function s_t(t=!1){return(r,n,o,{latestValues:a},i)=>{const s=(akt(r)?i_t:a_t)(n,a,i,r),l=function(e,t,r){const n={};for(const o in e)"values"===o&&"object"==typeof e.values||(zbt(o)||!0===r&&Nbt(o)||!t&&!Nbt(o)||e.draggable&&o.startsWith("onDrag"))&&(n[o]=e[o]);return n}(n,"string"==typeof r,t),c=r!==e.Fragment?{...l,...s,ref:o}:{},{children:u}=n,d=e.useMemo(()=>ukt(u)?u.get():u,[u]);return e.createElement(r,{...c,children:d})}}function l_t(e,t){return function(r,{forwardMotionProps:n}={forwardMotionProps:!1}){return rkt({...akt(r)?t_t:r_t,preloadedFeatures:e,useRender:s_t(n),createVisualElement:t,Component:r})}}function c_t(e,t){if(!Array.isArray(t))return!1;const r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function u_t(e,t,r){const n=e.getProps();return skt(n,t,void 0!==r?r:n.custom,e)}const d_t=gbt(()=>void 0!==window.ScrollTimeline);class p_t{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let r=0;r<this.animations.length;r++)this.animations[r][e]=t}attachTimeline(e,t){const r=this.animations.map(r=>d_t()&&r.attachTimeline?r.attachTimeline(e):"function"==typeof t?t(r):void 0);return()=>{r.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class h_t extends p_t{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function f_t(e,t){return e?e[t]||e.default||e:void 0}const m_t=2e4;function v_t(e){let t=0;let r=e.next(t);for(;!r.done&&t<m_t;)t+=50,r=e.next(t);return t>=m_t?1/0:t}function y_t(e){return"function"==typeof e}function g_t(e,t){e.timeline=t,e.onfinish=null}const x_t=e=>Array.isArray(e)&&"number"==typeof e[0],b_t={linearEasing:void 0};function k_t(e,t){const r=gbt(e);return()=>{var e;return null!==(e=b_t[t])&&void 0!==e?e:r()}}const __t=k_t(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),w_t=(e,t,r=10)=>{let n="";const o=Math.max(Math.round(t/r),2);for(let t=0;t<o;t++)n+=e(xbt(0,o-1,t))+", ";return`linear(${n.substring(0,n.length-2)})`};function M_t(e){return!!("function"==typeof e&&__t()||!e||"string"==typeof e&&(e in j_t||__t())||x_t(e)||Array.isArray(e)&&e.every(M_t))}const C_t=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,j_t={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:C_t([0,.65,.55,1]),circOut:C_t([.55,0,1,.45]),backIn:C_t([.31,.01,.66,-.59]),backOut:C_t([.33,1.53,.69,.99])};function D_t(e,t){if(e)return"function"==typeof e&&__t()?w_t(e,t):x_t(e)?C_t(e):Array.isArray(e)?e.map(e=>D_t(e,t)||j_t.easeOut):j_t[e]}const O_t={x:!1,y:!1};function S_t(){return O_t.x||O_t.y}function P_t(e,t){const r=function(e){if(e instanceof Element)return[e];if("string"==typeof e){const t=document.querySelectorAll(e);return t?Array.from(t):[]}return Array.from(e)}(e),n=new AbortController;return[r,{passive:!0,...t,signal:n.signal},()=>n.abort()]}function T_t(e){return t=>{"touch"===t.pointerType||S_t()||e(t)}}const E_t=(e,t)=>!!t&&(e===t||E_t(e,t.parentElement)),N_t=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary,z_t=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const A_t=new WeakSet;function R_t(e){return t=>{"Enter"===t.key&&e(t)}}function F_t(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}function L_t(e){return N_t(e)&&!S_t()}function B_t(e,t,r={}){const[n,o,a]=P_t(e,r),i=e=>{const n=e.currentTarget;if(!L_t(e)||A_t.has(n))return;A_t.add(n);const a=t(e),i=(e,t)=>{window.removeEventListener("pointerup",s),window.removeEventListener("pointercancel",l),L_t(e)&&A_t.has(n)&&(A_t.delete(n),"function"==typeof a&&a(e,{success:t}))},s=e=>{i(e,r.useGlobalTarget||E_t(n,e.target))},l=e=>{i(e,!1)};window.addEventListener("pointerup",s,o),window.addEventListener("pointercancel",l,o)};return n.forEach(e=>{!function(e){return z_t.has(e.tagName)||-1!==e.tabIndex}(e)&&null===e.getAttribute("tabindex")&&(e.tabIndex=0),(r.useGlobalTarget?window:e).addEventListener("pointerdown",i,o),e.addEventListener("focus",e=>((e,t)=>{const r=e.currentTarget;if(!r)return;const n=R_t(()=>{if(A_t.has(r))return;F_t(r,"down");const e=R_t(()=>{F_t(r,"up")});r.addEventListener("keyup",e,t),r.addEventListener("blur",()=>F_t(r,"cancel"),t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)})(e,o),o)}),a}const V_t=new Set(["width","height","top","left","right","bottom",...fkt]);let I_t;function q_t(){I_t=void 0}const $_t={now:()=>(void 0===I_t&&$_t.set(Dbt.isProcessing||_bt?Dbt.timestamp:performance.now()),I_t),set:e=>{I_t=e,queueMicrotask(q_t)}};function H_t(e,t){-1===e.indexOf(t)&&e.push(t)}function W_t(e,t){const r=e.indexOf(t);r>-1&&e.splice(r,1)}class U_t{constructor(){this.subscriptions=[]}add(e){return H_t(this.subscriptions,e),()=>W_t(this.subscriptions,e)}notify(e,t,r){const n=this.subscriptions.length;if(n)if(1===n)this.subscriptions[0](e,t,r);else for(let o=0;o<n;o++){const n=this.subscriptions[o];n&&n(e,t,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Y_t(e,t){return t?e*(1e3/t):0}class Z_t{constructor(e,t={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{const r=$_t.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=$_t.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(e=>!isNaN(parseFloat(e)))(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return"production"!==process.env.NODE_ENV&&Rbt(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new U_t);const r=this.events[e].add(t);return"change"===e?()=>{r(),Cbt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,r){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=$_t.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Y_t(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),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(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function K_t(e,t){return new Z_t(e,t)}function G_t(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,K_t(r))}function X_t(e,t){const r=e.getValue("willChange");if(function(e){return!(!ukt(e)||!e.add)}(r))return r.add(t)}function Q_t(e){return e.props[Xbt]}const J_t=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e;function ewt(e,t,r,n){if(e===t&&r===n)return mbt;const o=t=>function(e,t,r,n,o){let a,i,s=0;do{i=t+(r-t)/2,a=J_t(i,n,o)-e,a>0?r=i:t=i}while(Math.abs(a)>1e-7&&++s<12);return i}(t,0,1,e,r);return e=>0===e||1===e?e:J_t(o(e),t,n)}const twt=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,rwt=e=>t=>1-e(1-t),nwt=ewt(.33,1.53,.69,.99),owt=rwt(nwt),awt=twt(owt),iwt=e=>(e*=2)<1?.5*owt(e):.5*(2-Math.pow(2,-10*(e-1))),swt=e=>1-Math.sin(Math.acos(e)),lwt=rwt(swt),cwt=twt(swt),uwt=e=>/^0[^.\s]+$/u.test(e);function dwt(e){return"number"==typeof e?0===e:null===e||("none"===e||"0"===e||uwt(e))}const pwt=e=>Math.round(1e5*e)/1e5,hwt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const fwt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,mwt=(e,t)=>r=>!!("string"==typeof r&&fwt.test(r)&&r.startsWith(e)||t&&!function(e){return null==e}(r)&&Object.prototype.hasOwnProperty.call(r,t)),vwt=(e,t,r)=>n=>{if("string"!=typeof n)return n;const[o,a,i,s]=n.match(hwt);return{[e]:parseFloat(o),[t]:parseFloat(a),[r]:parseFloat(i),alpha:void 0!==s?parseFloat(s):1}},ywt={...wkt,transform:e=>Math.round((e=>_kt(0,255,e))(e))},gwt={test:mwt("rgb","red"),parse:vwt("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+ywt.transform(e)+", "+ywt.transform(t)+", "+ywt.transform(r)+", "+pwt(Mkt.transform(n))+")"};const xwt={test:mwt("#"),parse:function(e){let t="",r="",n="",o="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),o=e.substring(4,5),t+=t,r+=r,n+=n,o+=o),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}},transform:gwt.transform},bwt={test:mwt("hsl","hue"),parse:vwt("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+Okt.transform(pwt(t))+", "+Okt.transform(pwt(r))+", "+pwt(Mkt.transform(n))+")"},kwt={test:e=>gwt.test(e)||xwt.test(e)||bwt.test(e),parse:e=>gwt.test(e)?gwt.parse(e):bwt.test(e)?bwt.parse(e):xwt.parse(e),transform:e=>"string"==typeof e?e:e.hasOwnProperty("red")?gwt.transform(e):bwt.transform(e)},_wt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const wwt="number",Mwt="color",Cwt=/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 jwt(e){const t=e.toString(),r=[],n={color:[],number:[],var:[]},o=[];let a=0;const i=t.replace(Cwt,e=>(kwt.test(e)?(n.color.push(a),o.push(Mwt),r.push(kwt.parse(e))):e.startsWith("var(")?(n.var.push(a),o.push("var"),r.push(e)):(n.number.push(a),o.push(wwt),r.push(parseFloat(e))),++a,"${}")).split("${}");return{values:r,split:i,indexes:n,types:o}}function Dwt(e){return jwt(e).values}function Owt(e){const{split:t,types:r}=jwt(e),n=t.length;return e=>{let o="";for(let a=0;a<n;a++)if(o+=t[a],void 0!==e[a]){const t=r[a];o+=t===wwt?pwt(e[a]):t===Mwt?kwt.transform(e[a]):e[a]}return o}}const Swt=e=>"number"==typeof e?0:e;const Pwt={test:function(e){var t,r;return isNaN(e)&&"string"==typeof e&&((null===(t=e.match(hwt))||void 0===t?void 0:t.length)||0)+((null===(r=e.match(_wt))||void 0===r?void 0:r.length)||0)>0},parse:Dwt,createTransformer:Owt,getAnimatableNone:function(e){const t=Dwt(e);return Owt(e)(t.map(Swt))}},Twt=new Set(["brightness","contrast","saturate","opacity"]);function Ewt(e){const[t,r]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[n]=r.match(hwt)||[];if(!n)return e;const o=r.replace(n,"");let a=Twt.has(t)?1:0;return n!==r&&(a*=100),t+"("+a+o+")"}const Nwt=/\b([a-z-]*)\(.*?\)/gu,zwt={...Pwt,getAnimatableNone:e=>{const t=e.match(Nwt);return t?t.map(Ewt).join(" "):e}},Awt={...Rkt,color:kwt,backgroundColor:kwt,outlineColor:kwt,fill:kwt,stroke:kwt,borderColor:kwt,borderTopColor:kwt,borderRightColor:kwt,borderBottomColor:kwt,borderLeftColor:kwt,filter:zwt,WebkitFilter:zwt},Rwt=e=>Awt[e];function Fwt(e,t){let r=Rwt(e);return r!==zwt&&(r=Pwt),r.getAnimatableNone?r.getAnimatableNone(t):void 0}const Lwt=new Set(["auto","none","0"]);const Bwt=e=>e===wkt||e===Skt,Vwt=(e,t)=>parseFloat(e.split(", ")[t]),Iwt=(e,t)=>(r,{transform:n})=>{if("none"===n||!n)return 0;const o=n.match(/^matrix3d\((.+)\)$/u);if(o)return Vwt(o[1],t);{const t=n.match(/^matrix\((.+)\)$/u);return t?Vwt(t[1],e):0}},qwt=new Set(["x","y","z"]),$wt=fkt.filter(e=>!qwt.has(e));const Hwt={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),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:Iwt(4,13),y:Iwt(5,14)};Hwt.translateX=Hwt.x,Hwt.translateY=Hwt.y;const Wwt=new Set;let Uwt=!1,Ywt=!1;function Zwt(){if(Ywt){const e=Array.from(Wwt).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),r=new Map;t.forEach(e=>{const t=function(e){const t=[];return $wt.forEach(r=>{const n=e.getValue(r);void 0!==n&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();const t=r.get(e);t&&t.forEach(([t,r])=>{var n;null===(n=e.getValue(t))||void 0===n||n.set(r)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}Ywt=!1,Uwt=!1,Wwt.forEach(e=>e.complete()),Wwt.clear()}function Kwt(){Wwt.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Ywt=!0)})}class Gwt{constructor(e,t,r,n,o,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=r,this.motionValue=n,this.element=o,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Wwt.add(this),Uwt||(Uwt=!0,Cbt.read(Kwt),Cbt.resolveKeyframes(Zwt))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:r,motionValue:n}=this;for(let o=0;o<e.length;o++)if(null===e[o])if(0===o){const o=null==n?void 0:n.get(),a=e[e.length-1];if(void 0!==o)e[0]=o;else if(r&&t){const n=r.readValue(t,a);null!=n&&(e[0]=n)}void 0===e[0]&&(e[0]=a),n&&void 0===o&&n.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Wwt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Wwt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Xwt=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Qwt=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Jwt(e,t,r=1){ybt(r<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[n,o]=function(e){const t=Qwt.exec(e);if(!t)return[,];const[,r,n,o]=t;return[`--${r??n}`,o]}(e);if(!n)return;const a=window.getComputedStyle(t).getPropertyValue(n);if(a){const e=a.trim();return Xwt(e)?parseFloat(e):e}return xkt(o)?Jwt(o,t,r+1):o}const eMt=e=>t=>t.test(e),tMt=[wkt,Skt,Okt,Dkt,Tkt,Pkt,{test:e=>"auto"===e,parse:e=>e}],rMt=e=>tMt.find(eMt(e));class nMt extends Gwt{constructor(e,t,r,n,o){super(e,t,r,n,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:r}=this;if(!t||!t.current)return;super.readKeyframes();for(let r=0;r<e.length;r++){let n=e[r];if("string"==typeof n&&(n=n.trim(),xkt(n))){const o=Jwt(n,t.current);void 0!==o&&(e[r]=o),r===e.length-1&&(this.finalKeyframe=n)}}if(this.resolveNoneKeyframes(),!V_t.has(r)||2!==e.length)return;const[n,o]=e,a=rMt(n),i=rMt(o);if(a!==i)if(Bwt(a)&&Bwt(i))for(let t=0;t<e.length;t++){const r=e[t];"string"==typeof r&&(e[t]=parseFloat(r))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,r=[];for(let t=0;t<e.length;t++)dwt(e[t])&&r.push(t);r.length&&function(e,t,r){let n,o=0;for(;o<e.length&&!n;){const t=e[o];"string"==typeof t&&!Lwt.has(t)&&jwt(t).values.length&&(n=e[o]),o++}if(n&&r)for(const o of t)e[o]=Fwt(r,n)}(e,r,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:r}=this;if(!e||!e.current)return;"height"===r&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Hwt[r](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const n=t[t.length-1];void 0!==n&&e.getValue(r,n).jump(n,!1)}measureEndState(){var e;const{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const o=t.getValue(r);o&&o.jump(this.measuredOrigin,!1);const a=n.length-1,i=n[a];n[a]=Hwt[r](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==i&&void 0===this.finalKeyframe&&(this.finalKeyframe=i),!(null===(e=this.removedTransforms)||void 0===e)&&e.length&&this.removedTransforms.forEach(([e,r])=>{t.getValue(e).set(r)}),this.resolveNoneKeyframes()}}const oMt=(e,t)=>"zIndex"!==t&&!("number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!Pwt.test(e)&&"0"!==e||e.startsWith("url(")));const aMt=e=>null!==e;function iMt(e,{repeat:t,repeatType:r="loop"},n){const o=e.filter(aMt),a=t&&"loop"!==r&&t%2==1?0:o.length-1;return a&&void 0!==n?n:o[a]}class sMt{constructor({autoplay:e=!0,delay:t=0,type:r="keyframes",repeat:n=0,repeatDelay:o=0,repeatType:a="loop",...i}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=$_t.now(),this.options={autoplay:e,delay:t,type:r,repeat:n,repeatDelay:o,repeatType:a,...i},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&(Kwt(),Zwt()),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=$_t.now(),this.hasAttemptedResolve=!0;const{name:r,type:n,velocity:o,delay:a,onComplete:i,onUpdate:s,isGenerator:l}=this.options;if(!l&&!function(e,t,r,n){const o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;const a=e[e.length-1],i=oMt(o,t),s=oMt(a,t);return vbt(i===s,`You are trying to animate ${t} from "${o}" to "${a}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${a} via the \`style\` property.`),!(!i||!s)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}(e)||("spring"===r||y_t(r))&&n)}(e,r,n,o)){if(!a)return s&&s(iMt(e,this.options,t)),i&&i(),void this.resolveFinishedPromise();this.options.duration=0}const c=this.initPlayback(e,t);!1!==c&&(this._resolved={keyframes:e,finalKeyframe:t,...c},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const lMt=(e,t,r)=>e+(t-e)*r;function cMt(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function uMt(e,t){return r=>r>0?t:e}const dMt=(e,t,r)=>{const n=e*e,o=r*(t*t-n)+n;return o<0?0:Math.sqrt(o)},pMt=[xwt,gwt,bwt];function hMt(e){const t=(e=>pMt.find(t=>t.test(e)))(e);if(vbt(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let r=t.parse(e);return t===bwt&&(r=function({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,r/=100;let o=0,a=0,i=0;if(t/=100){const n=r<.5?r*(1+t):r+t-r*t,s=2*r-n;o=cMt(s,n,e+1/3),a=cMt(s,n,e),i=cMt(s,n,e-1/3)}else o=a=i=r;return{red:Math.round(255*o),green:Math.round(255*a),blue:Math.round(255*i),alpha:n}}(r)),r}const fMt=(e,t)=>{const r=hMt(e),n=hMt(t);if(!r||!n)return uMt(e,t);const o={...r};return e=>(o.red=dMt(r.red,n.red,e),o.green=dMt(r.green,n.green,e),o.blue=dMt(r.blue,n.blue,e),o.alpha=lMt(r.alpha,n.alpha,e),gwt.transform(o))},mMt=(e,t)=>r=>t(e(r)),vMt=(...e)=>e.reduce(mMt),yMt=new Set(["none","hidden"]);function gMt(e,t){return r=>lMt(e,t,r)}function xMt(e){return"number"==typeof e?gMt:"string"==typeof e?xkt(e)?uMt:kwt.test(e)?fMt:_Mt:Array.isArray(e)?bMt:"object"==typeof e?kwt.test(e)?fMt:kMt:uMt}function bMt(e,t){const r=[...e],n=r.length,o=e.map((e,r)=>xMt(e)(e,t[r]));return e=>{for(let t=0;t<n;t++)r[t]=o[t](e);return r}}function kMt(e,t){const r={...e,...t},n={};for(const o in r)void 0!==e[o]&&void 0!==t[o]&&(n[o]=xMt(e[o])(e[o],t[o]));return e=>{for(const t in n)r[t]=n[t](e);return r}}const _Mt=(e,t)=>{const r=Pwt.createTransformer(t),n=jwt(e),o=jwt(t);return n.indexes.var.length===o.indexes.var.length&&n.indexes.color.length===o.indexes.color.length&&n.indexes.number.length>=o.indexes.number.length?yMt.has(e)&&!o.values.length||yMt.has(t)&&!n.values.length?function(e,t){return yMt.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}(e,t):vMt(bMt(function(e,t){var r;const n=[],o={color:0,var:0,number:0};for(let a=0;a<t.values.length;a++){const i=t.types[a],s=e.indexes[i][o[i]],l=null!==(r=e.values[s])&&void 0!==r?r:0;n[a]=l,o[i]++}return n}(n,o),o.values),r):(vbt(!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.`),uMt(e,t))};function wMt(e,t,r){return"number"==typeof e&&"number"==typeof t&&"number"==typeof r?lMt(e,t,r):xMt(e)(e,t)}function MMt(e,t,r){const n=Math.max(t-5,0);return Y_t(r-e(n),t-n)}const CMt=100,jMt=10,DMt=1,OMt=0,SMt=800,PMt=.3,TMt=.3,EMt={granular:.01,default:2},NMt={granular:.005,default:.5},zMt=.01,AMt=10,RMt=.05,FMt=1,LMt=.001;function BMt({duration:e=SMt,bounce:t=PMt,velocity:r=OMt,mass:n=DMt}){let o,a;vbt(e<=bbt(AMt),"Spring duration must be 10 seconds or less");let i=1-t;i=_kt(RMt,FMt,i),e=_kt(zMt,AMt,kbt(e)),i<1?(o=t=>{const n=t*i,o=n*e,a=n-r,s=IMt(t,i),l=Math.exp(-o);return LMt-a/s*l},a=t=>{const n=t*i*e,a=n*r+r,s=Math.pow(i,2)*Math.pow(t,2)*e,l=Math.exp(-n),c=IMt(Math.pow(t,2),i);return(-o(t)+LMt>0?-1:1)*((a-s)*l)/c}):(o=t=>Math.exp(-t*e)*((t-r)*e+1)-LMt,a=t=>Math.exp(-t*e)*(e*e*(r-t)));const s=function(e,t,r){let n=r;for(let r=1;r<VMt;r++)n-=e(n)/t(n);return n}(o,a,5/e);if(e=bbt(e),isNaN(s))return{stiffness:CMt,damping:jMt,duration:e};{const t=Math.pow(s,2)*n;return{stiffness:t,damping:2*i*Math.sqrt(n*t),duration:e}}}const VMt=12;function IMt(e,t){return e*Math.sqrt(1-t*t)}const qMt=["duration","bounce"],$Mt=["stiffness","damping","mass"];function HMt(e,t){return t.some(t=>void 0!==e[t])}function WMt(e=TMt,t=PMt){const r="object"!=typeof e?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:n,restDelta:o}=r;const a=r.keyframes[0],i=r.keyframes[r.keyframes.length-1],s={done:!1,value:a},{stiffness:l,damping:c,mass:u,duration:d,velocity:p,isResolvedFromDuration:h}=function(e){let t={velocity:OMt,stiffness:CMt,damping:jMt,mass:DMt,isResolvedFromDuration:!1,...e};if(!HMt(e,$Mt)&&HMt(e,qMt))if(e.visualDuration){const r=e.visualDuration,n=2*Math.PI/(1.2*r),o=n*n,a=2*_kt(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:DMt,stiffness:o,damping:a}}else{const r=BMt(e);t={...t,...r,mass:DMt},t.isResolvedFromDuration=!0}return t}({...r,velocity:-kbt(r.velocity||0)}),f=p||0,m=c/(2*Math.sqrt(l*u)),v=i-a,y=kbt(Math.sqrt(l/u)),g=Math.abs(v)<5;let x;if(n||(n=g?EMt.granular:EMt.default),o||(o=g?NMt.granular:NMt.default),m<1){const e=IMt(y,m);x=t=>{const r=Math.exp(-m*y*t);return i-r*((f+m*y*v)/e*Math.sin(e*t)+v*Math.cos(e*t))}}else if(1===m)x=e=>i-Math.exp(-y*e)*(v+(f+y*v)*e);else{const e=y*Math.sqrt(m*m-1);x=t=>{const r=Math.exp(-m*y*t),n=Math.min(e*t,300);return i-r*((f+m*y*v)*Math.sinh(n)+e*v*Math.cosh(n))/e}}const b={calculatedDuration:h&&d||null,next:e=>{const t=x(e);if(h)s.done=e>=d;else{let r=0;m<1&&(r=0===e?bbt(f):MMt(x,e,t));const a=Math.abs(r)<=n,l=Math.abs(i-t)<=o;s.done=a&&l}return s.value=s.done?i:t,s},toString:()=>{const e=Math.min(v_t(b),m_t),t=w_t(t=>b.next(e*t).value,e,30);return e+"ms "+t}};return b}function UMt({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:o=10,bounceStiffness:a=500,modifyTarget:i,min:s,max:l,restDelta:c=.5,restSpeed:u}){const d=e[0],p={done:!1,value:d},h=e=>void 0===s?l:void 0===l||Math.abs(s-e)<Math.abs(l-e)?s:l;let f=r*t;const m=d+f,v=void 0===i?m:i(m);v!==m&&(f=v-d);const y=e=>-f*Math.exp(-e/n),g=e=>v+y(e),x=e=>{const t=y(e),r=g(e);p.done=Math.abs(t)<=c,p.value=p.done?v:r};let b,k;const _=e=>{(e=>void 0!==s&&e<s||void 0!==l&&e>l)(p.value)&&(b=e,k=WMt({keyframes:[p.value,h(p.value)],velocity:MMt(g,e,p.value),damping:o,stiffness:a,restDelta:c,restSpeed:u}))};return _(0),{calculatedDuration:null,next:e=>{let t=!1;return!k&&void 0===b&&(t=!0,x(e),_(e)),void 0!==b&&e>=b?k.next(e-b):(!t&&x(e),p)}}}const YMt=ewt(.42,0,1,1),ZMt=ewt(0,0,.58,1),KMt=ewt(.42,0,.58,1),GMt={linear:mbt,easeIn:YMt,easeInOut:KMt,easeOut:ZMt,circIn:swt,circInOut:cwt,circOut:lwt,backIn:owt,backInOut:awt,backOut:nwt,anticipate:iwt},XMt=e=>{if(x_t(e)){ybt(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,r,n,o]=e;return ewt(t,r,n,o)}return"string"==typeof e?(ybt(void 0!==GMt[e],`Invalid easing type '${e}'`),GMt[e]):e};function QMt(e,t,{clamp:r=!0,ease:n,mixer:o}={}){const a=e.length;if(ybt(a===t.length,"Both input and output ranges must be the same length"),1===a)return()=>t[0];if(2===a&&t[0]===t[1])return()=>t[1];const i=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());const s=function(e,t,r){const n=[],o=r||wMt,a=e.length-1;for(let r=0;r<a;r++){let a=o(e[r],e[r+1]);if(t){const e=Array.isArray(t)?t[r]||mbt:t;a=vMt(e,a)}n.push(a)}return n}(t,n,o),l=s.length,c=r=>{if(i&&r<e[0])return t[0];let n=0;if(l>1)for(;n<e.length-2&&!(r<e[n+1]);n++);const o=xbt(e[n],e[n+1],r);return s[n](o)};return r?t=>c(_kt(e[0],e[a-1],t)):c}function JMt(e){const t=[0];return function(e,t){const r=e[e.length-1];for(let n=1;n<=t;n++){const o=xbt(0,t,n);e.push(lMt(r,1,o))}}(t,e.length-1),t}function eCt(e,t){return e.map(()=>t||KMt).splice(0,e.length-1)}function tCt({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){const o=(e=>Array.isArray(e)&&"number"!=typeof e[0])(n)?n.map(XMt):XMt(n),a={done:!1,value:t[0]},i=function(e,t){return e.map(e=>e*t)}(r&&r.length===t.length?r:JMt(t),e),s=QMt(i,t,{ease:Array.isArray(o)?o:eCt(t,o)});return{calculatedDuration:e,next:t=>(a.value=s(t),a.done=t>=e,a)}}const rCt=e=>{const t=({timestamp:t})=>e(t);return{start:()=>Cbt.update(t,!0),stop:()=>jbt(t),now:()=>Dbt.isProcessing?Dbt.timestamp:$_t.now()}},nCt={decay:UMt,inertia:UMt,tween:tCt,keyframes:tCt,spring:WMt},oCt=e=>e/100;class aCt extends sMt{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:t,motionValue:r,element:n,keyframes:o}=this.options,a=(null==n?void 0:n.KeyframeResolver)||Gwt;this.resolver=new a(o,(e,t)=>this.onKeyframesResolved(e,t),t,r,n),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:r=0,repeatDelay:n=0,repeatType:o,velocity:a=0}=this.options,i=y_t(t)?t:nCt[t]||tCt;let s,l;i!==tCt&&"number"!=typeof e[0]&&("production"!==process.env.NODE_ENV&&ybt(2===e.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${e}`),s=vMt(oCt,wMt(e[0],e[1])),e=[0,100]);const c=i({...this.options,keyframes:e});"mirror"===o&&(l=i({...this.options,keyframes:[...e].reverse(),velocity:-a})),null===c.calculatedDuration&&(c.calculatedDuration=v_t(c));const{calculatedDuration:u}=c,d=u+n;return{generator:c,mirroredGenerator:l,mapPercentToKeyframes:s,calculatedDuration:u,resolvedDuration:d,totalDuration:d*(r+1)-n}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:r}=this;if(!r){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:n,generator:o,mirroredGenerator:a,mapPercentToKeyframes:i,keyframes:s,calculatedDuration:l,totalDuration:c,resolvedDuration:u}=r;if(null===this.startTime)return o.next(0);const{delay:d,repeat:p,repeatType:h,repeatDelay:f,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-c/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const v=this.currentTime-d*(this.speed>=0?1:-1),y=this.speed>=0?v<0:v>c;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=c);let g=this.currentTime,x=o;if(p){const e=Math.min(this.currentTime,c)/u;let t=Math.floor(e),r=e%1;!r&&e>=1&&(r=1),1===r&&t--,t=Math.min(t,p+1),!!(t%2)&&("reverse"===h?(r=1-r,f&&(r-=f/u)):"mirror"===h&&(x=a)),g=_kt(0,1,r)*u}const b=y?{done:!1,value:s[0]}:x.next(g);i&&(b.value=i(b.value));let{done:k}=b;!y&&null!==l&&(k=this.speed>=0?this.currentTime>=c:this.currentTime<=0);const _=null===this.holdTime&&("finished"===this.state||"running"===this.state&&k);return _&&void 0!==n&&(b.value=iMt(s,this.options,n)),m&&m(b.value),_&&this.finish(),b}get duration(){const{resolved:e}=this;return e?kbt(e.calculatedDuration):0}get time(){return kbt(this.currentTime)}set time(e){e=bbt(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=kbt(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=rCt,onPlay:t,startTime:r}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),t&&t();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=n):this.startTime=r??this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const iCt=new Set(["opacity","clipPath","filter","transform"]);function sCt(e,t,r,{delay:n=0,duration:o=300,repeat:a=0,repeatType:i="loop",ease:s="easeInOut",times:l}={}){const c={[t]:r};l&&(c.offset=l);const u=D_t(s,o);return Array.isArray(u)&&(c.easing=u),e.animate(c,{delay:n,duration:o,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:a+1,direction:"reverse"===i?"alternate":"normal"})}const lCt=gbt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));const cCt={anticipate:iwt,backInOut:awt,circInOut:cwt};class uCt extends sMt{constructor(e){super(e);const{name:t,motionValue:r,element:n,keyframes:o}=this.options;this.resolver=new nMt(o,(e,t)=>this.onKeyframesResolved(e,t),t,r,n),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:r=300,times:n,ease:o,type:a,motionValue:i,name:s,startTime:l}=this.options;if(!i.owner||!i.owner.current)return!1;if("string"==typeof o&&__t()&&function(e){return e in cCt}(o)&&(o=cCt[o]),function(e){return y_t(e.type)||"spring"===e.type||!M_t(e.ease)}(this.options)){const{onComplete:t,onUpdate:i,motionValue:s,element:l,...c}=this.options,u=function(e,t){const r=new aCt({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:e[0]};const o=[];let a=0;for(;!n.done&&a<2e4;)n=r.sample(a),o.push(n.value),a+=10;return{times:void 0,keyframes:o,duration:a-10,ease:"linear"}}(e,c);1===(e=u.keyframes).length&&(e[1]=e[0]),r=u.duration,n=u.times,o=u.ease,a="keyframes"}const c=sCt(i.owner.current,s,e,{...this.options,duration:r,times:n,ease:o});return c.startTime=l??this.calcStartTime(),this.pendingTimeline?(g_t(c,this.pendingTimeline),this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:r}=this.options;i.set(iMt(e,this.options,t)),r&&r(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:r,times:n,type:a,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return kbt(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return kbt(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:r}=t;r.currentTime=bbt(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:r}=t;r.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return mbt;const{animation:r}=t;g_t(r,e)}else this.pendingTimeline=e;return mbt}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:r,duration:n,type:o,ease:a,times:i}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:s,element:l,...c}=this.options,u=new aCt({...c,keyframes:r,duration:n,type:o,ease:a,times:i,isGenerator:!0}),d=bbt(this.time);e.setWithVelocity(u.sample(d-10).value,u.sample(d).value,10)}const{onStop:s}=this.options;s&&s(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:r,repeatDelay:n,repeatType:o,damping:a,type:i}=e;if(!(t&&t.owner&&t.owner.current instanceof HTMLElement))return!1;const{onUpdate:s,transformTemplate:l}=t.owner.getProps();return lCt()&&r&&iCt.has(r)&&!s&&!l&&!n&&"mirror"!==o&&0!==a&&"inertia"!==i}}const dCt={type:"spring",stiffness:500,damping:25,restSpeed:10},pCt={type:"keyframes",duration:.8},hCt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},fCt=(e,{keyframes:t})=>t.length>2?pCt:mkt.has(e)?e.startsWith("scale")?(e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}))(t[1]):dCt:hCt;const mCt=(e,t,r,n={},o,a)=>i=>{const s=f_t(n,e)||{},l=s.delay||n.delay||0;let{elapsed:c=0}=n;c-=bbt(l);let u={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...s,delay:-c,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{i(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:o};(function({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:o,repeat:a,repeatType:i,repeatDelay:s,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(s)||(u={...u,...fCt(e,u)}),u.duration&&(u.duration=bbt(u.duration)),u.repeatDelay&&(u.repeatDelay=bbt(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let d=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(d=!0)),d&&!a&&void 0!==t.get()){const e=iMt(u.keyframes,s);if(void 0!==e)return Cbt.update(()=>{u.onUpdate(e),u.onComplete()}),new h_t([])}return!a&&uCt.supports(u)?new uCt(u):new aCt(u)};function vCt({protectedKeys:e,needsAnimating:t},r){const n=e.hasOwnProperty(r)&&!0!==t[r];return t[r]=!1,n}function yCt(e,t,{delay:r=0,transitionOverride:n,type:o}={}){var a;let{transition:i=e.getDefaultTransition(),transitionEnd:s,...l}=t;n&&(i=n);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const t in l){const n=e.getValue(t,null!==(a=e.latestValues[t])&&void 0!==a?a:null),o=l[t];if(void 0===o||u&&vCt(u,t))continue;const s={delay:r,...f_t(i||{},t)};let d=!1;if(window.MotionHandoffAnimation){const r=Q_t(e);if(r){const e=window.MotionHandoffAnimation(r,t,Cbt);null!==e&&(s.startTime=e,d=!0)}}X_t(e,t),n.start(mCt(t,n,o,e.shouldReduceMotion&&V_t.has(t)?{type:!1}:s,e,d));const p=n.animation;p&&c.push(p)}return s&&Promise.all(c).then(()=>{Cbt.update(()=>{s&&function(e,t){const r=u_t(e,t);let{transitionEnd:n={},transition:o={},...a}=r||{};a={...a,...n};for(const t in a)G_t(e,t,ckt(a[t]))}(e,s)})}),c}function gCt(e,t,r={}){var n;const o=u_t(e,t,"exit"===r.type?null===(n=e.presenceContext)||void 0===n?void 0:n.custom:void 0);let{transition:a=e.getDefaultTransition()||{}}=o||{};r.transitionOverride&&(a=r.transitionOverride);const i=o?()=>Promise.all(yCt(e,o,r)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(n=0)=>{const{delayChildren:o=0,staggerChildren:i,staggerDirection:s}=a;return function(e,t,r=0,n=0,o=1,a){const i=[],s=(e.variantChildren.size-1)*n,l=1===o?(e=0)=>e*n:(e=0)=>s-e*n;return Array.from(e.variantChildren).sort(xCt).forEach((e,n)=>{e.notify("AnimationStart",t),i.push(gCt(e,t,{...a,delay:r+l(n)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(i)}(e,t,o+n,i,s,r)}:()=>Promise.resolve(),{when:l}=a;if(l){const[e,t]="beforeChildren"===l?[i,s]:[s,i];return e().then(()=>t())}return Promise.all([i(),s(r.delay)])}function xCt(e,t){return e.sortNodePosition(t)}const bCt=qbt.length;function kCt(e){if(!e)return;if(!e.isControllingVariants){const t=e.parent&&kCt(e.parent)||{};return void 0!==e.props.initial&&(t.initial=e.props.initial),t}const t={};for(let r=0;r<bCt;r++){const n=qbt[r],o=e.props[n];(Bbt(o)||!1===o)&&(t[n]=o)}return t}const _Ct=[...Ibt].reverse(),wCt=Ibt.length;function MCt(e){return t=>Promise.all(t.map(({animation:t,options:r})=>function(e,t,r={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t)){const o=t.map(t=>gCt(e,t,r));n=Promise.all(o)}else if("string"==typeof t)n=gCt(e,t,r);else{const o="function"==typeof t?u_t(e,t,r.custom):t;n=Promise.all(yCt(e,o,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}(e,t,r)))}function CCt(e){let t=MCt(e),r=OCt(),n=!0;const o=t=>(r,n)=>{var o;const a=u_t(e,n,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(a){const{transition:e,transitionEnd:t,...n}=a;r={...r,...n,...t}}return r};function a(a){const{props:i}=e,s=kCt(e.parent)||{},l=[],c=new Set;let u={},d=1/0;for(let t=0;t<wCt;t++){const p=_Ct[t],h=r[p],f=void 0!==i[p]?i[p]:s[p],m=Bbt(f),v=p===a?h.isActive:null;!1===v&&(d=t);let y=f===s[p]&&f!==i[p]&&m;if(y&&n&&e.manuallyAnimateOnMount&&(y=!1),h.protectedKeys={...u},!h.isActive&&null===v||!f&&!h.prevProp||Vbt(f)||"boolean"==typeof f)continue;const g=jCt(h.prevProp,f);let x=g||p===a&&h.isActive&&!y&&m||t>d&&m,b=!1;const k=Array.isArray(f)?f:[f];let _=k.reduce(o(p),{});!1===v&&(_={});const{prevResolvedValues:w={}}=h,M={...w,..._},C=t=>{x=!0,c.has(t)&&(b=!0,c.delete(t)),h.needsAnimating[t]=!0;const r=e.getValue(t);r&&(r.liveStyle=!1)};for(const e in M){const t=_[e],r=w[e];if(u.hasOwnProperty(e))continue;let n=!1;n=lkt(t)&&lkt(r)?!c_t(t,r):t!==r,n?null!=t?C(e):c.add(e):void 0!==t&&c.has(e)?C(e):h.protectedKeys[e]=!0}h.prevProp=f,h.prevResolvedValues=_,h.isActive&&(u={...u,..._}),n&&e.blockInitialAnimation&&(x=!1),x&&(!y||!g||b)&&l.push(...k.map(e=>({animation:e,options:{type:p}})))}if(c.size){const t={};c.forEach(r=>{const n=e.getBaseTarget(r),o=e.getValue(r);o&&(o.liveStyle=!0),t[r]=n??null}),l.push({animation:t})}let p=!!l.length;return n&&(!1===i.initial||i.initial===i.animate)&&!e.manuallyAnimateOnMount&&(p=!1),n=!1,p?t(l):Promise.resolve()}return{animateChanges:a,setActive:function(t,n){var o;if(r[t].isActive===n)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach(e=>{var r;return null===(r=e.animationState)||void 0===r?void 0:r.setActive(t,n)}),r[t].isActive=n;const i=a(t);for(const e in r)r[e].protectedKeys={};return i},setAnimateFunction:function(r){t=r(e)},getState:()=>r,reset:()=>{r=OCt(),n=!0}}}function jCt(e,t){return"string"==typeof t?t!==e:!!Array.isArray(t)&&!c_t(t,e)}function DCt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function OCt(){return{animate:DCt(!0),whileInView:DCt(),whileHover:DCt(),whileTap:DCt(),whileDrag:DCt(),whileFocus:DCt(),exit:DCt()}}class SCt{constructor(e){this.isMounted=!1,this.node=e}update(){}}let PCt=0;const TCt={animation:{Feature:class extends SCt{constructor(e){super(e),e.animationState||(e.animationState=CCt(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Vbt(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends SCt{constructor(){super(...arguments),this.id=PCt++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const n=this.node.animationState.setActive("exit",!e);t&&!e&&n.then(()=>t(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}};function ECt(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}function NCt(e){return{point:{x:e.pageX,y:e.pageY}}}function zCt(e,t,r,n){return ECt(e,t,(e=>t=>N_t(t)&&e(t,NCt(t)))(r),n)}const ACt=(e,t)=>Math.abs(e-t);class RCt{constructor(e,t,{transformPagePoint:r,contextWindow:n,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const e=BCt(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,r=function(e,t){const r=ACt(e.x,t.x),n=ACt(e.y,t.y);return Math.sqrt(r**2+n**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!r)return;const{point:n}=e,{timestamp:o}=Dbt;this.history.push({...n,timestamp:o});const{onStart:a,onMove:i}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),i&&i(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=FCt(t,this.transformPagePoint),Cbt.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:r,onSessionEnd:n,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const a=BCt("pointercancel"===e.type?this.lastMoveEventInfo:FCt(t,this.transformPagePoint),this.history);this.startEvent&&r&&r(e,a),n&&n(e,a)},!N_t(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=r,this.contextWindow=n||window;const a=FCt(NCt(e),this.transformPagePoint),{point:i}=a,{timestamp:s}=Dbt;this.history=[{...i,timestamp:s}];const{onSessionStart:l}=t;l&&l(e,BCt(a,this.history)),this.removeListeners=vMt(zCt(this.contextWindow,"pointermove",this.handlePointerMove),zCt(this.contextWindow,"pointerup",this.handlePointerUp),zCt(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),jbt(this.updatePoint)}}function FCt(e,t){return t?{point:t(e.point)}:e}function LCt(e,t){return{x:e.x-t.x,y:e.y-t.y}}function BCt({point:e},t){return{point:e,delta:LCt(e,ICt(t)),offset:LCt(e,VCt(t)),velocity:qCt(t,.1)}}function VCt(e){return e[0]}function ICt(e){return e[e.length-1]}function qCt(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null;const o=ICt(e);for(;r>=0&&(n=e[r],!(o.timestamp-n.timestamp>bbt(t)));)r--;if(!n)return{x:0,y:0};const a=kbt(o.timestamp-n.timestamp);if(0===a)return{x:0,y:0};const i={x:(o.x-n.x)/a,y:(o.y-n.y)/a};return i.x===1/0&&(i.x=0),i.y===1/0&&(i.y=0),i}function $Ct(e){return e.max-e.min}function HCt(e,t,r,n=.5){e.origin=n,e.originPoint=lMt(t.min,t.max,e.origin),e.scale=$Ct(r)/$Ct(t),e.translate=lMt(r.min,r.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function WCt(e,t,r,n){HCt(e.x,t.x,r.x,n?n.originX:void 0),HCt(e.y,t.y,r.y,n?n.originY:void 0)}function UCt(e,t,r){e.min=r.min+t.min,e.max=e.min+$Ct(t)}function YCt(e,t,r){e.min=t.min-r.min,e.max=e.min+$Ct(t)}function ZCt(e,t,r){YCt(e.x,t.x,r.x),YCt(e.y,t.y,r.y)}function KCt(e,t,r){return{min:void 0!==t?e.min+t:void 0,max:void 0!==r?e.max+r-(e.max-e.min):void 0}}function GCt(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}const XCt=.35;function QCt(e,t,r){return{min:JCt(e,t),max:JCt(e,r)}}function JCt(e,t){return"number"==typeof e?e:e[t]||0}const ejt=()=>({x:{min:0,max:0},y:{min:0,max:0}});function tjt(e){return[e("x"),e("y")]}function rjt({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function njt(e){return void 0===e||1===e}function ojt({scale:e,scaleX:t,scaleY:r}){return!njt(e)||!njt(t)||!njt(r)}function ajt(e){return ojt(e)||ijt(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ijt(e){return sjt(e.x)||sjt(e.y)}function sjt(e){return e&&"0%"!==e}function ljt(e,t,r){return r+t*(e-r)}function cjt(e,t,r,n,o){return void 0!==o&&(e=ljt(e,o,n)),ljt(e,r,n)+t}function ujt(e,t=0,r=1,n,o){e.min=cjt(e.min,t,r,n,o),e.max=cjt(e.max,t,r,n,o)}function djt(e,{x:t,y:r}){ujt(e.x,t.translate,t.scale,t.originPoint),ujt(e.y,r.translate,r.scale,r.originPoint)}const pjt=.999999999999,hjt=1.0000000000001;function fjt(e,t){e.min=e.min+t,e.max=e.max+t}function mjt(e,t,r,n,o=.5){ujt(e,t,r,lMt(e.min,e.max,o),n)}function vjt(e,t){mjt(e.x,t.x,t.scaleX,t.scale,t.originX),mjt(e.y,t.y,t.scaleY,t.scale,t.originY)}function yjt(e,t){return rjt(function(e,t){if(!t)return e;const r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}(e.getBoundingClientRect(),t))}const gjt=({current:e})=>e?e.ownerDocument.defaultView:null,xjt=new WeakMap;class bjt{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;const{dragSnapToOrigin:n}=this.getProps();this.panSession=new RCt(e,{onSessionStart:e=>{const{dragSnapToOrigin:r}=this.getProps();r?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(NCt(e).point)},onStart:(e,t)=>{const{drag:r,dragPropagation:n,onDragStart:o}=this.getProps();if(r&&!n&&(this.openDragLock&&this.openDragLock(),this.openDragLock=function(e){return"x"===e||"y"===e?O_t[e]?null:(O_t[e]=!0,()=>{O_t[e]=!1}):O_t.x||O_t.y?null:(O_t.x=O_t.y=!0,()=>{O_t.x=O_t.y=!1})}(r),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),tjt(e=>{let t=this.getAxisMotionValue(e).get()||0;if(Okt.test(t)){const{projection:r}=this.visualElement;if(r&&r.layout){const n=r.layout.layoutBox[e];n&&(t=$Ct(n)*(parseFloat(t)/100))}}this.originPoint[e]=t}),o&&Cbt.postRender(()=>o(e,t)),X_t(this.visualElement,"transform");const{animationState:a}=this.visualElement;a&&a.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:r,dragDirectionLock:n,onDirectionLock:o,onDrag:a}=this.getProps();if(!r&&!this.openDragLock)return;const{offset:i}=t;if(n&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}(i),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",t.point,i),this.updateAxis("y",t.point,i),this.visualElement.render(),a&&a(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>tjt(e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:n,contextWindow:gjt(this.visualElement)})}stop(e,t){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:n}=t;this.startAnimation(n);const{onDragEnd:o}=this.getProps();o&&Cbt.postRender(()=>o(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,r){const{drag:n}=this.getProps();if(!r||!kjt(e,n,this.currentDirection))return;const o=this.getAxisMotionValue(e);let a=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(a=function(e,{min:t,max:r},n){return void 0!==t&&e<t?e=n?lMt(t,e,n.min):Math.max(e,t):void 0!==r&&e>r&&(e=n?lMt(r,e,n.max):Math.min(e,r)),e}(a,this.constraints[e],this.elastic[e])),o.set(a)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&Zbt(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(e,{top:t,left:r,bottom:n,right:o}){return{x:KCt(e.x,r,o),y:KCt(e.y,t,n)}}(n.layoutBox,t),this.elastic=function(e=XCt){return!1===e?e=0:!0===e&&(e=XCt),{x:QCt(e,"left","right"),y:QCt(e,"top","bottom")}}(r),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&tjt(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const r={};return void 0!==t.min&&(r.min=t.min-e.min),void 0!==t.max&&(r.max=t.max-e.min),r}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!Zbt(e))return!1;const r=e.current;ybt(null!==r,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:n}=this.visualElement;if(!n||!n.layout)return!1;const o=function(e,t,r){const n=yjt(e,r),{scroll:o}=t;return o&&(fjt(n.x,o.offset.x),fjt(n.y,o.offset.y)),n}(r,n.root,this.visualElement.getTransformPagePoint());let a=function(e,t){return{x:GCt(e.x,t.x),y:GCt(e.y,t.y)}}(n.layout.layoutBox,o);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=rjt(e))}return a}startAnimation(e){const{drag:t,dragMomentum:r,dragElastic:n,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:i}=this.getProps(),s=this.constraints||{},l=tjt(i=>{if(!kjt(i,t,this.currentDirection))return;let l=s&&s[i]||{};a&&(l={min:0,max:0});const c=n?200:1e6,u=n?40:1e7,d={type:"inertia",velocity:r?e[i]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(i,d)});return Promise.all(l).then(i)}startAxisValueAnimation(e,t){const r=this.getAxisMotionValue(e);return X_t(this.visualElement,e),r.start(mCt(e,r,0,t,this.visualElement,!1))}stopAnimation(){tjt(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){tjt(e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()})}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps();return r[t]||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){tjt(t=>{const{drag:r}=this.getProps();if(!kjt(t,r,this.currentDirection))return;const{projection:n}=this.visualElement,o=this.getAxisMotionValue(t);if(n&&n.layout){const{min:r,max:a}=n.layout.layoutBox[t];o.set(e[t]-lMt(r,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:r}=this.visualElement;if(!Zbt(t)||!r||!this.constraints)return;this.stopAnimation();const n={x:0,y:0};tjt(e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const r=t.get();n[e]=function(e,t){let r=.5;const n=$Ct(e),o=$Ct(t);return o>n?r=xbt(t.min,t.max-n,e.min):n>o&&(r=xbt(e.min,e.max-o,t.min)),_kt(0,1,r)}({min:r,max:r},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),tjt(t=>{if(!kjt(t,e,null))return;const r=this.getAxisMotionValue(t),{min:o,max:a}=this.constraints[t];r.set(lMt(o,a,n[t]))})}addListeners(){if(!this.visualElement.current)return;xjt.set(this.visualElement,this);const e=zCt(this.visualElement.current,"pointerdown",e=>{const{drag:t,dragListener:r=!0}=this.getProps();t&&r&&this.start(e)}),t=()=>{const{dragConstraints:e}=this.getProps();Zbt(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,n=r.addEventListener("measure",t);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),Cbt.read(t);const o=ECt(window,"resize",()=>this.scalePositionWithinConstraints()),a=r.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(tjt(t=>{const r=this.getAxisMotionValue(t);r&&(this.originPoint[t]+=e[t].translate,r.set(r.get()+e[t].translate))}),this.visualElement.render())});return()=>{o(),e(),n(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:n=!1,dragConstraints:o=!1,dragElastic:a=XCt,dragMomentum:i=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:n,dragConstraints:o,dragElastic:a,dragMomentum:i}}}function kjt(e,t,r){return!(!0!==t&&t!==e||null!==r&&r!==e)}const _jt=e=>(t,r)=>{e&&Cbt.postRender(()=>e(t,r))};const wjt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Mjt(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Cjt={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!Skt.test(e))return e;e=parseFloat(e)}return`${Mjt(e,t.target.x)}% ${Mjt(e,t.target.y)}%`}},jjt={correct:(e,{treeScale:t,projectionDelta:r})=>{const n=e,o=Pwt.parse(e);if(o.length>5)return n;const a=Pwt.createTransformer(e),i="number"!=typeof o[0]?1:0,s=r.x.scale*t.x,l=r.y.scale*t.y;o[0+i]/=s,o[1+i]/=l;const c=lMt(s,l,.5);return"number"==typeof o[2+i]&&(o[2+i]/=c),"number"==typeof o[3+i]&&(o[3+i]/=c),a(o)}};class Djt extends e.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:n}=this.props,{projection:o}=e;(function(e){Object.assign(Gkt,e)})(Sjt),o&&(t.group&&t.group.add(o),r&&r.register&&n&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),wjt.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:r,drag:n,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,n||e.layoutDependency!==t||void 0===t?a.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?a.promote():a.relegate()||Cbt.postRender(()=>{const e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Qbt.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:n}=e;n&&(n.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(n),r&&r.deregister&&r.deregister(n))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function Ojt(r){const[n,o]=cbt(),a=e.useContext(tbt);return t.jsx(Djt,{...r,layoutGroup:a,switchLayoutGroup:e.useContext(Jbt),isPresent:n,safeToRemove:o})}const Sjt={borderRadius:{...Cjt,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Cjt,borderTopRightRadius:Cjt,borderBottomLeftRadius:Cjt,borderBottomRightRadius:Cjt,boxShadow:jjt};const Pjt=(e,t)=>e.depth-t.depth;class Tjt{constructor(){this.children=[],this.isDirty=!1}add(e){H_t(this.children,e),this.isDirty=!0}remove(e){W_t(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Pjt),this.isDirty=!1,this.children.forEach(e)}}const Ejt=["TopLeft","TopRight","BottomLeft","BottomRight"],Njt=Ejt.length,zjt=e=>"string"==typeof e?parseFloat(e):e,Ajt=e=>"number"==typeof e||Skt.test(e);function Rjt(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const Fjt=Bjt(0,.5,lwt),Ljt=Bjt(.5,.95,mbt);function Bjt(e,t,r){return n=>n<e?0:n>t?1:r(xbt(e,t,n))}function Vjt(e,t){e.min=t.min,e.max=t.max}function Ijt(e,t){Vjt(e.x,t.x),Vjt(e.y,t.y)}function qjt(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function $jt(e,t,r,n,o){return e=ljt(e-=t,1/r,n),void 0!==o&&(e=ljt(e,1/o,n)),e}function Hjt(e,t,[r,n,o],a,i){!function(e,t=0,r=1,n=.5,o,a=e,i=e){if(Okt.test(t)&&(t=parseFloat(t),t=lMt(i.min,i.max,t/100)-i.min),"number"!=typeof t)return;let s=lMt(a.min,a.max,n);e===a&&(s-=t),e.min=$jt(e.min,t,r,s,o),e.max=$jt(e.max,t,r,s,o)}(e,t[r],t[n],t[o],t.scale,a,i)}const Wjt=["x","scaleX","originX"],Ujt=["y","scaleY","originY"];function Yjt(e,t,r,n){Hjt(e.x,t,Wjt,r?r.x:void 0,n?n.x:void 0),Hjt(e.y,t,Ujt,r?r.y:void 0,n?n.y:void 0)}function Zjt(e){return 0===e.translate&&1===e.scale}function Kjt(e){return Zjt(e.x)&&Zjt(e.y)}function Gjt(e,t){return e.min===t.min&&e.max===t.max}function Xjt(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Qjt(e,t){return Xjt(e.x,t.x)&&Xjt(e.y,t.y)}function Jjt(e){return $Ct(e.x)/$Ct(e.y)}function eDt(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class tDt{constructor(){this.members=[]}add(e){H_t(this.members,e),e.scheduleRender()}remove(e){if(W_t(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex(t=>e===t);if(0===t)return!1;let r;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){r=t;break}}return!!r&&(this.promote(r),!0)}promote(e,t){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:n}=e.options;!1===n&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:r}=e;t.onExitComplete&&t.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const rDt={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},nDt=typeof window<"u"&&void 0!==window.MotionDebug,oDt=["","X","Y","Z"],aDt={visibility:"hidden"};let iDt=0;function sDt(e,t,r,n){const{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),n&&(n[e]=0))}function lDt(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const r=Q_t(t);if(window.MotionHasOptimisedAnimation(r,"transform")){const{layout:t,layoutId:n}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",Cbt,!(t||n))}const{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&lDt(n)}function cDt({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:o}){return class{constructor(e={},r=(null==t?void 0:t())){this.id=iDt++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,nDt&&(rDt.totalNodes=rDt.resolvedTargetDeltas=rDt.recalculatedProjection=0),this.nodes.forEach(pDt),this.nodes.forEach(xDt),this.nodes.forEach(bDt),this.nodes.forEach(hDt),nDt&&window.MotionDebug.record(rDt)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Tjt)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new U_t),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){const r=this.eventHandlers.get(e);r&&r.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t,r=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=function(e){return e instanceof SVGElement&&"svg"!==e.tagName}(t),this.instance=t;const{layoutId:n,layout:o,visualElement:a}=this.options;if(a&&!a.current&&a.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),r&&(o||n)&&(this.isLayoutDirty=!0),e){let r;const n=()=>this.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,r&&r(),r=function(e,t){const r=$_t.now(),n=({timestamp:o})=>{const a=o-r;a>=t&&(jbt(n),e(a-t))};return Cbt.read(n,!0),()=>jbt(n)}(n,250),wjt.hasAnimatedSinceResize&&(wjt.hasAnimatedSinceResize=!1,this.nodes.forEach(gDt))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&a&&(n||o)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:r,layout:n})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||a.getDefaultTransition()||jDt,{onLayoutAnimationStart:i,onLayoutAnimationComplete:s}=a.getProps(),l=!this.targetLayout||!Qjt(this.targetLayout,n)||r,c=!t&&r;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||c||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,c);const t={...f_t(o,"layout"),onPlay:i,onComplete:s};(a.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||gDt(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,jbt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(kDt),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&lDt(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){const t=this.path[e];t.shouldResetTransform=!0,t.updateScroll("snapshot"),t.options.layoutRoot&&t.willUpdate(!1)}const{layoutId:t,layout:r}=this.options;if(void 0===t&&!r)return;const n=this.getTransformTemplate();this.prevTransformTemplateValue=n?n(this.latestValues,""):void 0,this.updateSnapshot(),e&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(mDt);this.isUpdating||this.nodes.forEach(vDt),this.isUpdating=!1,this.nodes.forEach(yDt),this.nodes.forEach(uDt),this.nodes.forEach(dDt),this.clearAllSnapshots();const e=$_t.now();Dbt.delta=_kt(0,1e3/60,e-Dbt.timestamp),Dbt.timestamp=e,Dbt.isProcessing=!0,Obt.update.process(Dbt),Obt.preRender.process(Dbt),Obt.render.process(Dbt),Dbt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Qbt.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(fDt),this.sharedNodes.forEach(_Dt)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Cbt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Cbt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!(this.instance&&(this.updateScroll(),this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty)))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();const e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:t}=this.options;t&&t.notify("LayoutMeasure",this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e="measure"){let t=!(!this.options.layoutScroll||!this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t){const t=n(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!o)return;const e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!Kjt(this.projectionDelta),r=this.getTransformTemplate(),n=r?r(this.latestValues,""):void 0,a=n!==this.prevTransformTemplateValue;e&&(t||ajt(this.latestValues)||a)&&(o(this.instance,n),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){const t=this.measurePageBox();let r=this.removeElementScroll(t);return e&&(r=this.removeTransform(r)),function(e){SDt(e.x),SDt(e.y)}(r),{animationId:this.root.animationId,measuredBox:t,layoutBox:r,latestValues:{},source:this.id}}measurePageBox(){var e;const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const r=t.measureViewportBox();if(!(null===(e=this.scroll)||void 0===e?void 0:e.wasRoot)&&!this.path.some(TDt)){const{scroll:e}=this.root;e&&(fjt(r.x,e.offset.x),fjt(r.y,e.offset.y))}return r}removeElementScroll(e){var t;const r={x:{min:0,max:0},y:{min:0,max:0}};if(Ijt(r,e),null!==(t=this.scroll)&&void 0!==t&&t.wasRoot)return r;for(let t=0;t<this.path.length;t++){const n=this.path[t],{scroll:o,options:a}=n;n!==this.root&&o&&a.layoutScroll&&(o.wasRoot&&Ijt(r,e),fjt(r.x,o.offset.x),fjt(r.y,o.offset.y))}return r}applyTransform(e,t=!1){const r={x:{min:0,max:0},y:{min:0,max:0}};Ijt(r,e);for(let e=0;e<this.path.length;e++){const n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&vjt(r,{x:-n.scroll.offset.x,y:-n.scroll.offset.y}),ajt(n.latestValues)&&vjt(r,n.latestValues)}return ajt(this.latestValues)&&vjt(r,this.latestValues),r}removeTransform(e){const t={x:{min:0,max:0},y:{min:0,max:0}};Ijt(t,e);for(let e=0;e<this.path.length;e++){const r=this.path[e];if(!r.instance||!ajt(r.latestValues))continue;ojt(r.latestValues)&&r.updateSnapshot();const n=ejt();Ijt(n,r.measurePageBox()),Yjt(t,r.latestValues,r.snapshot?r.snapshot.layoutBox:void 0,n)}return ajt(this.latestValues)&&Yjt(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:void 0===e.crossfade||e.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Dbt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){var t;const r=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=r.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=r.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=r.isSharedProjectionDirty);const n=!!this.resumingFrom||this!==r;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||null!==(t=this.parent)&&void 0!==t&&t.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:o,layoutId:a}=this.options;if(this.layout&&(o||a)){if(this.resolvedRelativeTargetAt=Dbt.timestamp,!this.targetDelta&&!this.relativeTarget){const e=this.getClosestProjectingParent();e&&e.layout&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},ZCt(this.relativeTargetOrigin,this.layout.layoutBox,e.layout.layoutBox),Ijt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),function(e,t,r){UCt(e.x,t.x,r.x),UCt(e.y,t.y,r.y)}(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Ijt(this.target,this.layout.layoutBox),djt(this.target,this.targetDelta)):Ijt(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const e=this.getClosestProjectingParent();e&&!!e.resumingFrom==!!this.resumingFrom&&!e.options.layoutScroll&&e.target&&1!==this.animationProgress?(this.relativeParent=e,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},ZCt(this.relativeTargetOrigin,this.target,e.target),Ijt(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}nDt&&rDt.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!ojt(this.parent.latestValues)&&!ijt(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!(!(this.relativeTarget||this.targetDelta||this.options.layoutRoot)||!this.layout)}calcProjection(){var e;const t=this.getLead(),r=!!this.resumingFrom||this!==t;let n=!0;if((this.isProjectionDirty||!(null===(e=this.parent)||void 0===e)&&e.isProjectionDirty)&&(n=!1),r&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Dbt.timestamp&&(n=!1),n)return;const{layout:o,layoutId:a}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!a)return;Ijt(this.layoutCorrected,this.layout.layoutBox);const i=this.treeScale.x,s=this.treeScale.y;(function(e,t,r,n=!1){const o=r.length;if(!o)return;let a,i;t.x=t.y=1;for(let s=0;s<o;s++){a=r[s],i=a.projectionDelta;const{visualElement:o}=a.options;o&&o.props.style&&"contents"===o.props.style.display||(n&&a.options.layoutScroll&&a.scroll&&a!==a.root&&vjt(e,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),i&&(t.x*=i.x.scale,t.y*=i.y.scale,djt(e,i)),n&&ajt(a.latestValues)&&vjt(e,a.latestValues))}t.x<hjt&&t.x>pjt&&(t.x=1),t.y<hjt&&t.y>pjt&&(t.y=1)})(this.layoutCorrected,this.treeScale,this.path,r),t.layout&&!t.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(qjt(this.prevProjectionDelta.x,this.projectionDelta.x),qjt(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),WCt(this.projectionDelta,this.layoutCorrected,l,this.latestValues),(this.treeScale.x!==i||this.treeScale.y!==s||!eDt(this.projectionDelta.x,this.prevProjectionDelta.x)||!eDt(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),nDt&&rDt.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(e,t=!1){const r=this.snapshot,n=r?r.latestValues:{},o={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const i={x:{min:0,max:0},y:{min:0,max:0}},s=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=!(!s||c||!0!==this.options.crossfade||this.path.some(CDt));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const r=t/1e3;wDt(a.x,e.x,r),wDt(a.y,e.y,r),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ZCt(i,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(e,t,r,n){MDt(e.x,t.x,r.x,n),MDt(e.y,t.y,r.y,n)}(this.relativeTarget,this.relativeTargetOrigin,i,r),d&&function(e,t){return Gjt(e.x,t.x)&&Gjt(e.y,t.y)}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d={x:{min:0,max:0},y:{min:0,max:0}}),Ijt(d,this.relativeTarget)),s&&(this.animationValues=o,function(e,t,r,n,o,a){o?(e.opacity=lMt(0,void 0!==r.opacity?r.opacity:1,Fjt(n)),e.opacityExit=lMt(void 0!==t.opacity?t.opacity:1,0,Ljt(n))):a&&(e.opacity=lMt(void 0!==t.opacity?t.opacity:1,void 0!==r.opacity?r.opacity:1,n));for(let o=0;o<Njt;o++){const a=`border${Ejt[o]}Radius`;let i=Rjt(t,a),s=Rjt(r,a);void 0===i&&void 0===s||(i||(i=0),s||(s=0),0===i||0===s||Ajt(i)===Ajt(s)?(e[a]=Math.max(lMt(zjt(i),zjt(s),n),0),(Okt.test(s)||Okt.test(i))&&(e[a]+="%")):e[a]=s)}(t.rotate||r.rotate)&&(e.rotate=lMt(t.rotate||0,r.rotate||0,n))}(o,n,this.latestValues,r,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=r},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(jbt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Cbt.update(()=>{wjt.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,r){const n=ukt(e)?e:K_t(e);return n.start(mCt("",n,t,r)),n.animation}(0,1e3,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:r,layout:n,latestValues:o}=e;if(t&&r&&n){if(this!==e&&this.layout&&n&&PDt(this.options.animationType,this.layout.layoutBox,n.layoutBox)){r=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const t=$Ct(this.layout.layoutBox.x);r.x.min=e.target.x.min,r.x.max=r.x.min+t;const n=$Ct(this.layout.layoutBox.y);r.y.min=e.target.y.min,r.y.max=r.y.min+n}Ijt(t,r),vjt(t,o),WCt(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new tDt),this.sharedNodes.get(e).add(t);const r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:r}={}){const n=this.getStack();n&&n.promote(this,r),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:r}=e;if((r.z||r.rotate||r.rotateX||r.rotateY||r.rotateZ||r.skewX||r.skewY)&&(t=!0),!t)return;const n={};r.z&&sDt("z",e,n,this.animationValues);for(let t=0;t<oDt.length;t++)sDt(`rotate${oDt[t]}`,e,n,this.animationValues),sDt(`skew${oDt[t]}`,e,n,this.animationValues);e.render();for(const t in n)e.setStaticValue(t,n[t]),this.animationValues&&(this.animationValues[t]=n[t]);e.scheduleRender()}getProjectionStyles(e){var t,r;if(!this.instance||this.isSVG)return;if(!this.isVisible)return aDt;const n={visibility:""},o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,n.opacity="",n.pointerEvents=dkt(null==e?void 0:e.pointerEvents)||"",n.transform=o?o(this.latestValues,""):"none",n;const a=this.getLead();if(!this.projectionDelta||!this.layout||!a.target){const t={};return this.options.layoutId&&(t.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,t.pointerEvents=dkt(null==e?void 0:e.pointerEvents)||""),this.hasProjected&&!ajt(this.latestValues)&&(t.transform=o?o({},""):"none",this.hasProjected=!1),t}const i=a.animationValues||a.latestValues;this.applyTransformsToTarget(),n.transform=function(e,t,r){let n="";const o=e.x.translate/t.x,a=e.y.translate/t.y,i=(null==r?void 0:r.z)||0;if((o||a||i)&&(n=`translate3d(${o}px, ${a}px, ${i}px) `),(1!==t.x||1!==t.y)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){const{transformPerspective:e,rotate:t,rotateX:o,rotateY:a,skewX:i,skewY:s}=r;e&&(n=`perspective(${e}px) ${n}`),t&&(n+=`rotate(${t}deg) `),o&&(n+=`rotateX(${o}deg) `),a&&(n+=`rotateY(${a}deg) `),i&&(n+=`skewX(${i}deg) `),s&&(n+=`skewY(${s}deg) `)}const s=e.x.scale*t.x,l=e.y.scale*t.y;return(1!==s||1!==l)&&(n+=`scale(${s}, ${l})`),n||"none"}(this.projectionDeltaWithTransform,this.treeScale,i),o&&(n.transform=o(i,n.transform));const{x:s,y:l}=this.projectionDelta;n.transformOrigin=`${100*s.origin}% ${100*l.origin}% 0`,a.animationValues?n.opacity=a===this?null!==(r=null!==(t=i.opacity)&&void 0!==t?t:this.latestValues.opacity)&&void 0!==r?r:1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:n.opacity=a===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0;for(const e in Gkt){if(void 0===i[e])continue;const{correct:t,applyTo:r}=Gkt[e],o="none"===n.transform?i[e]:t(i[e],a);if(r){const e=r.length;for(let t=0;t<e;t++)n[r[t]]=o}else n[e]=o}return this.options.layoutId&&(n.pointerEvents=a===this?dkt(null==e?void 0:e.pointerEvents)||"":"none"),n}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(mDt),this.root.sharedNodes.clear()}}}function uDt(e){e.updateLayout()}function dDt(e){var t;const r=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:n}=e.layout,{animationType:o}=e.options,a=r.source!==e.layout.source;"size"===o?tjt(e=>{const n=a?r.measuredBox[e]:r.layoutBox[e],o=$Ct(n);n.min=t[e].min,n.max=n.min+o}):PDt(o,r.layoutBox,t)&&tjt(n=>{const o=a?r.measuredBox[n]:r.layoutBox[n],i=$Ct(t[n]);o.max=o.min+i,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[n].max=e.relativeTarget[n].min+i)});const i={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};WCt(i,t,r.layoutBox);const s={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};a?WCt(s,e.applyTransform(n,!0),r.measuredBox):WCt(s,t,r.layoutBox);const l=!Kjt(i);let c=!1;if(!e.resumeFrom){const n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:o,layout:a}=n;if(o&&a){const i={x:{min:0,max:0},y:{min:0,max:0}};ZCt(i,r.layoutBox,o.layoutBox);const s={x:{min:0,max:0},y:{min:0,max:0}};ZCt(s,t,a.layoutBox),Qjt(i,s)||(c=!0),n.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=i,e.relativeParent=n)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:r,delta:s,layoutDelta:i,hasLayoutChanged:l,hasRelativeTargetChanged:c})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function pDt(e){nDt&&rDt.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function hDt(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function fDt(e){e.clearSnapshot()}function mDt(e){e.clearMeasurements()}function vDt(e){e.isLayoutDirty=!1}function yDt(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function gDt(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function xDt(e){e.resolveTargetDelta()}function bDt(e){e.calcProjection()}function kDt(e){e.resetSkewAndRotation()}function _Dt(e){e.removeLeadSnapshot()}function wDt(e,t,r){e.translate=lMt(t.translate,0,r),e.scale=lMt(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function MDt(e,t,r,n){e.min=lMt(t.min,r.min,n),e.max=lMt(t.max,r.max,n)}function CDt(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const jDt={duration:.45,ease:[.4,0,.1,1]},DDt=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ODt=DDt("applewebkit/")&&!DDt("chrome/")?Math.round:mbt;function SDt(e){e.min=ODt(e.min),e.max=ODt(e.max)}function PDt(e,t,r){return"position"===e||"preserve-aspect"===e&&!function(e,t,r){return Math.abs(e-t)<=r}(Jjt(t),Jjt(r),.2)}function TDt(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const EDt=cDt({attachResizeListener:(e,t)=>ECt(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),NDt={current:void 0},zDt=cDt({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!NDt.current){const e=new EDt({});e.mount(window),e.setOptions({layoutScroll:!0}),NDt.current=e}return NDt.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position}),ADt={pan:{Feature:class extends SCt{constructor(){super(...arguments),this.removePointerDownListener=mbt}onPointerDown(e){this.session=new RCt(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:gjt(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:_jt(e),onStart:_jt(t),onMove:r,onEnd:(e,t)=>{delete this.session,n&&Cbt.postRender(()=>n(e,t))}}}mount(){this.removePointerDownListener=zCt(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends SCt{constructor(e){super(e),this.removeGroupControls=mbt,this.removeListeners=mbt,this.controls=new bjt(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||mbt}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:zDt,MeasureLayout:Ojt}};function RDt(e,t,r){const{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover","Start"===r);const o=n["onHover"+r];o&&Cbt.postRender(()=>o(t,NCt(t)))}function FDt(e,t,r){const{props:n}=e;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap","Start"===r);const o=n["onTap"+("End"===r?"":r)];o&&Cbt.postRender(()=>o(t,NCt(t)))}const LDt=new WeakMap,BDt=new WeakMap,VDt=e=>{const t=LDt.get(e.target);t&&t(e)},IDt=e=>{e.forEach(VDt)};function qDt(e,t,r){const n=function({root:e,...t}){const r=e||document;BDt.has(r)||BDt.set(r,{});const n=BDt.get(r),o=JSON.stringify(t);return n[o]||(n[o]=new IntersectionObserver(IDt,{root:e,...t})),n[o]}(t);return LDt.set(e,r),n.observe(e),()=>{LDt.delete(e),n.unobserve(e)}}const $Dt={some:0,all:1};const HDt={inView:{Feature:class extends SCt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:r,amount:n="some",once:o}=e,a={root:t?t.current:void 0,rootMargin:r,threshold:"number"==typeof n?n:$Dt[n]};return qDt(this.node.current,a,e=>{const{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,o&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:r,onViewportLeave:n}=this.node.getProps(),a=t?r:n;a&&a(e)})}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends SCt{mount(){const{current:e}=this.node;e&&(this.unmount=B_t(e,e=>(FDt(this.node,e,"Start"),(e,{success:t})=>FDt(this.node,e,t?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends SCt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=vMt(ECt(this.node.current,"focus",()=>this.onFocus()),ECt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends SCt{mount(){const{current:e}=this.node;e&&(this.unmount=function(e,t,r={}){const[n,o,a]=P_t(e,r),i=T_t(e=>{const{target:r}=e,n=t(e);if("function"!=typeof n||!r)return;const a=T_t(e=>{n(e),r.removeEventListener("pointerleave",a)});r.addEventListener("pointerleave",a,o)});return n.forEach(e=>{e.addEventListener("pointerenter",i,o)}),a}(e,e=>(RDt(this.node,e,"Start"),e=>RDt(this.node,e,"End"))))}unmount(){}}}},WDt={layout:{ProjectionNode:zDt,MeasureLayout:Ojt}},UDt={current:null},YDt={current:!1};const ZDt=[...tMt,kwt,Pwt],KDt=new WeakMap;const GDt=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class XDt{scrapeMotionValuesFromProps(e,t,r){return{}}constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:n,blockInitialAnimation:o,visualState:a},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Gwt,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const e=$_t.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Cbt.render(this.render,!1,!0))};const{latestValues:s,renderState:l,onUpdate:c}=a;this.onUpdate=c,this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=i,this.blockInitialAnimation=!!o,this.isControllingVariants=$bt(t),this.isVariantNode=Hbt(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!(!e||!e.current);const{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in d){const t=d[e];void 0!==s[e]&&ukt(t)&&t.set(s[e],!1)}}mount(e){this.current=e,KDt.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),YDt.current||function(){if(YDt.current=!0,pbt)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>UDt.current=e.matches;e.addListener(t),t()}else UDt.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||UDt.current),"production"!==process.env.NODE_ENV&&Rbt(!0!==this.shouldReduceMotion,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){KDt.delete(this.current),this.projection&&this.projection.unmount(),jbt(this.notifyUpdate),jbt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=mkt.has(e),n=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&Cbt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=t.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{n(),o(),a&&a(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in Tbt){const t=Tbt[e];if(!t)continue;const{isEnabled:r,Feature:n}=t;if(!this.features[e]&&n&&r(this.props)&&(this.features[e]=new n(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<GDt.length;t++){const r=GDt[t];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const n=e["on"+r];n&&(this.propEventSubscriptions[r]=this.on(r,n))}this.prevMotionValues=function(e,t,r){for(const n in t){const o=t[n],a=r[n];if(ukt(o))e.addValue(n,o),"development"===process.env.NODE_ENV&&Rbt("11.18.2"===o.version,`Attempting to mix Motion versions ${o.version} with 11.18.2 may not work as expected.`);else if(ukt(a))e.addValue(n,K_t(o,{owner:e}));else if(a!==o)if(e.hasValue(n)){const t=e.getValue(n);!0===t.liveStyle?t.jump(o):t.hasAnimated||t.set(o)}else{const t=e.getStaticValue(n);e.addValue(n,K_t(void 0!==t?t:o,{owner:e}))}}for(const n in r)void 0===t[n]&&e.removeValue(n);return t}(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const r=this.values.get(e);t!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return void 0===r&&void 0!==t&&(r=K_t(null===t?void 0:t,{owner:this}),this.addValue(e,r)),r}readValue(e,t){var r;let n=void 0===this.latestValues[e]&&this.current?null!==(r=this.getBaseTargetFromProps(this.props,e))&&void 0!==r?r:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=n&&("string"==typeof n&&(Xwt(n)||uwt(n))?n=parseFloat(n):!(e=>ZDt.find(eMt(e)))(n)&&Pwt.test(t)&&(n=Fwt(e,t)),this.setBaseTarget(e,ukt(n)?n.get():n)),ukt(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:r}=this.props;let n;if("string"==typeof r||"object"==typeof r){const o=skt(this.props,r,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(n=o[e])}if(r&&void 0!==n)return n;const o=this.getBaseTargetFromProps(this.props,e);return void 0===o||ukt(o)?void 0!==this.initialValues[e]&&void 0===n?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new U_t),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class QDt extends XDt{constructor(){super(...arguments),this.KeyframeResolver=nMt}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:r}){delete t[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;ukt(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class JDt extends QDt{constructor(){super(...arguments),this.type="html",this.renderInstance=Ykt}readValueFromInstance(e,t){if(mkt.has(t)){const e=Rwt(t);return e&&e.default||0}{const r=function(e){return window.getComputedStyle(e)}(e),n=(ykt(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return yjt(e,t)}build(e,t,r){Bkt(e,t,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,r){return Qkt(e,t,r)}}class eOt extends QDt{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ejt}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(mkt.has(t)){const e=Rwt(t);return e&&e.default||0}return t=Zkt.has(t)?t:Gbt(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,r){return Jkt(e,t,r)}build(e,t,r){$kt(e,t,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,r,n){Kkt(e,t,0,n)}mount(e){this.isSVGTag=Ukt(e.tagName),super.mount(e)}}const tOt=(t,r)=>akt(t)?new eOt(r):new JDt(r,{allowProjection:t!==e.Fragment}),rOt=Fbt(l_t({...TCt,...HDt,...ADt,...WDt},tOt)),nOt=e.forwardRef(({value:e,onChange:r,...n},o)=>{const a=t=>{const[n,o]=e.split(":").map(Number);let a=n,i=o;"up"===t?(i+=15,i>=60&&(i=0,a=(a+1)%24)):(i-=15,i<0&&(i=45,a=(a-1+24)%24));const s=`${String(a).padStart(2,"0")}:${String(i).padStart(2,"0")}`;r(s)};return t.jsxs("div",{className:"relative",children:[t.jsx(cyt,{type:"time",ref:o,value:e,onChange:e=>r(e.target.value),...n,className:"pr-8"}),t.jsxs("div",{className:"absolute right-1 top-1 bottom-1 flex flex-col justify-center",children:[t.jsx($ht,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4",onClick:()=>a("up"),children:t.jsx(Zst,{className:"h-3 w-3"})}),t.jsx($ht,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4",onClick:()=>a("down"),children:t.jsx(Wst,{className:"h-3 w-3"})})]})]})});function oOt(e){return function(e){return"[object Object]"===Object.prototype.toString.call(e)}(e)||Array.isArray(e)}function aOt(e,t){const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;return JSON.stringify(Object.keys(e.breakpoints||{}))===JSON.stringify(Object.keys(t.breakpoints||{}))&&r.every(r=>{const n=e[r],o=t[r];return"function"==typeof n?`${n}`==`${o}`:oOt(n)&&oOt(o)?aOt(n,o):n===o})}function iOt(e){return e.concat().sort((e,t)=>e.name>t.name?1:-1).map(e=>e.options)}function sOt(e){return"number"==typeof e}function lOt(e){return"string"==typeof e}function cOt(e){return"boolean"==typeof e}function uOt(e){return"[object Object]"===Object.prototype.toString.call(e)}function dOt(e){return Math.abs(e)}function pOt(e){return Math.sign(e)}function hOt(e,t){return dOt(e-t)}function fOt(e){return xOt(e).map(Number)}function mOt(e){return e[vOt(e)]}function vOt(e){return Math.max(0,e.length-1)}function yOt(e,t){return t===vOt(e)}function gOt(e,t=0){return Array.from(Array(e),(e,r)=>t+r)}function xOt(e){return Object.keys(e)}function bOt(e,t){return[e,t].reduce((e,t)=>(xOt(t).forEach(r=>{const n=e[r],o=t[r],a=uOt(n)&&uOt(o);e[r]=a?bOt(n,o):o}),e),{})}function kOt(e,t){return typeof t.MouseEvent<"u"&&e instanceof t.MouseEvent}function _Ot(){let e=[];const t={add:function(r,n,o,a={passive:!0}){let i;if("addEventListener"in r)r.addEventListener(n,o,a),i=()=>r.removeEventListener(n,o,a);else{const e=r;e.addListener(o),i=()=>e.removeListener(o)}return e.push(i),t},clear:function(){e=e.filter(e=>e())}};return t}function wOt(e,t,r,n){const o=_Ot(),a=1e3/60;let i=null,s=0,l=0;function c(e){if(!l)return;i||(i=e,r(),r());const o=e-i;for(i=e,s+=o;s>=a;)r(),s-=a;n(s/a),l&&(l=t.requestAnimationFrame(c))}function u(){t.cancelAnimationFrame(l),i=null,s=0,l=0}return{init:function(){o.add(e,"visibilitychange",()=>{e.hidden&&(i=null,s=0)})},destroy:function(){u(),o.clear()},start:function(){l||(l=t.requestAnimationFrame(c))},stop:u,update:r,render:n}}function MOt(e=0,t=0){const r=dOt(e-t);function n(t){return t<e}function o(e){return e>t}function a(e){return n(e)||o(e)}return{length:r,max:t,min:e,constrain:function(r){return a(r)?n(r)?e:t:r},reachedAny:a,reachedMax:o,reachedMin:n,removeOffset:function(e){return r?e-r*Math.ceil((e-t)/r):e}}}function COt(e,t,r){const{constrain:n}=MOt(0,e),o=e+1;let a=i(t);function i(e){return r?dOt((o+e)%o):n(e)}function s(){return a}function l(){return COt(e,s(),r)}const c={get:s,set:function(e){return a=i(e),c},add:function(e){return l().set(s()+e)},clone:l};return c}function jOt(e,t,r,n,o,a,i,s,l,c,u,d,p,h,f,m,v,y,g){const{cross:x,direction:b}=e,k=["INPUT","SELECT","TEXTAREA"],_={passive:!1},w=_Ot(),M=_Ot(),C=MOt(50,225).constrain(h.measure(20)),j={mouse:300,touch:400},D={mouse:500,touch:600},O=f?43:25;let S=!1,P=0,T=0,E=!1,N=!1,z=!1,A=!1;function R(e){if(!kOt(e,n)&&e.touches.length>=2)return F(e);const t=a.readPoint(e),r=a.readPoint(e,x),i=hOt(t,P),l=hOt(r,T);if(!(N||A||e.cancelable&&(N=i>l,N)))return F(e);const u=a.pointerMove(e);i>m&&(z=!0),c.useFriction(.3).useDuration(.75),s.start(),o.add(b(u)),e.preventDefault()}function F(e){const t=u.byDistance(0,!1).index!==d.get(),r=a.pointerUp(e)*(f?D:j)[A?"mouse":"touch"],n=function(e,t){const r=d.add(-1*pOt(e)),n=u.byDistance(e,!f).distance;return f||dOt(e)<C?n:v&&t?.5*n:u.byIndex(r.get(),0).distance}(b(r),t),o=function(e,t){if(0===e||0===t||dOt(e)<=dOt(t))return 0;const r=hOt(dOt(e),dOt(t));return dOt(r/e)}(r,n),i=O-10*o,s=y+o/50;N=!1,E=!1,M.clear(),c.useDuration(i).useFriction(s),l.distance(n,!f),A=!1,p.emit("pointerUp")}function L(e){z&&(e.stopPropagation(),e.preventDefault(),z=!1)}return{init:function(e){if(!g)return;function s(s){(cOt(g)||g(e,s))&&function(e){const s=kOt(e,n);A=s,z=f&&s&&!e.buttons&&S,S=hOt(o.get(),i.get())>=2,(!s||0===e.button)&&(function(e){const t=e.nodeName||"";return k.includes(t)}(e.target)||(E=!0,a.pointerDown(e),c.useFriction(0).useDuration(0),o.set(i),function(){const e=A?r:t;M.add(e,"touchmove",R,_).add(e,"touchend",F).add(e,"mousemove",R,_).add(e,"mouseup",F)}(),P=a.readPoint(e),T=a.readPoint(e,x),p.emit("pointerDown")))}(s)}const l=t;w.add(l,"dragstart",e=>e.preventDefault(),_).add(l,"touchmove",()=>{},_).add(l,"touchend",()=>{}).add(l,"touchstart",s).add(l,"mousedown",s).add(l,"touchcancel",F).add(l,"contextmenu",F).add(l,"click",L,!0)},destroy:function(){w.clear(),M.clear()},pointerDown:function(){return E}}}function DOt(e,t){let r,n;function o(e){return e.timeStamp}function a(r,n){const o="client"+("x"===(n||e.scroll)?"X":"Y");return(kOt(r,t)?r:r.touches[0])[o]}return{pointerDown:function(e){return r=e,n=e,a(e)},pointerMove:function(e){const t=a(e)-a(n),i=o(e)-o(r)>170;return n=e,i&&(r=e),t},pointerUp:function(e){if(!r||!n)return 0;const t=a(n)-a(r),i=o(e)-o(r),s=o(e)-o(n)>170,l=t/i;return i&&!s&&dOt(l)>.1?l:0},readPoint:a}}function OOt(e,t,r,n,o,a,i){const s=[e].concat(n);let l,c,u=[],d=!1;function p(e){return o.measureSize(i.measure(e))}return{init:function(o){a&&(c=p(e),u=n.map(p),l=new ResizeObserver(r=>{(cOt(a)||a(o,r))&&function(r){for(const a of r){if(d)return;const r=a.target===e,i=n.indexOf(a.target),s=r?c:u[i];if(dOt(p(r?e:n[i])-s)>=.5){o.reInit(),t.emit("resize");break}}}(r)}),r.requestAnimationFrame(()=>{s.forEach(e=>l.observe(e))}))},destroy:function(){d=!0,l&&l.disconnect()}}}function SOt(e,t,r,n,o){const a=o.measure(10),i=o.measure(50),s=MOt(.1,.99);let l=!1;function c(){return!(l||!e.reachedAny(r.get())||!e.reachedAny(t.get()))}return{shouldConstrain:c,constrain:function(o){if(!c())return;const l=e.reachedMin(t.get())?"min":"max",u=dOt(e[l]-t.get()),d=r.get()-t.get(),p=s.constrain(u/i);r.subtract(d*p),!o&&dOt(d)<a&&(r.set(e.constrain(r.get())),n.useDuration(25).useBaseFriction())},toggleActive:function(e){l=!e}}}function POt(e,t,r,n){const o=t.min+.1,a=t.max+.1,{reachedMin:i,reachedMax:s}=MOt(o,a);return{loop:function(t){if(!function(e){return 1===e?s(r.get()):-1===e&&i(r.get())}(t))return;const o=e*(-1*t);n.forEach(e=>e.add(o))}}}function TOt(e,t,r,n,o){const{reachedAny:a,removeOffset:i,constrain:s}=n;function l(e){return e.concat().sort((e,t)=>dOt(e)-dOt(t))[0]}function c(t,n){const o=[t,t+r,t-r];if(!e)return t;if(!n)return l(o);const a=o.filter(e=>pOt(e)===n);return a.length?l(a):mOt(o)-r}return{byDistance:function(r,n){const l=o.get()+r,{index:u,distance:d}=function(r){const n=e?i(r):s(r),o=t.map((e,t)=>({diff:c(e-n,0),index:t})).sort((e,t)=>dOt(e.diff)-dOt(t.diff)),{index:a}=o[0];return{index:a,distance:n}}(l),p=!e&&a(l);return!n||p?{index:u,distance:r}:{index:u,distance:r+c(t[u]-d,0)}},byIndex:function(e,r){return{index:e,distance:c(t[e]-o.get(),r)}},shortcut:c}}function EOt(e,t,r,n,o,a,i,s){const l={passive:!0,capture:!0};let c=0;function u(e){"Tab"===e.code&&(c=(new Date).getTime())}return{init:function(d){s&&(a.add(document,"keydown",u,!1),t.forEach((t,u)=>{a.add(t,"focus",t=>{(cOt(s)||s(d,t))&&function(t){if((new Date).getTime()-c>10)return;i.emit("slideFocusStart"),e.scrollLeft=0;const a=r.findIndex(e=>e.includes(t));sOt(a)&&(o.useDuration(0),n.index(a,0),i.emit("slideFocus"))}(u)},l)}))}}}function NOt(e){let t=e;function r(e){return sOt(e)?e:e.get()}return{get:function(){return t},set:function(e){t=r(e)},add:function(e){t+=r(e)},subtract:function(e){t-=r(e)}}}function zOt(e,t){const r="x"===e.scroll?function(e){return`translate3d(${e}px,0px,0px)`}:function(e){return`translate3d(0px,${e}px,0px)`},n=t.style;let o=null,a=!1;return{clear:function(){a||(n.transform="",t.getAttribute("style")||t.removeAttribute("style"))},to:function(t){if(a)return;const i=function(e){return Math.round(100*e)/100}(e.direction(t));i!==o&&(n.transform=r(i),o=i)},toggleActive:function(e){a=!e}}}function AOt(e,t,r,n,o,a,i,s,l){const c=fOt(o),u=fOt(o).reverse(),d=function(){const e=i[0],t=h(u,e);return f(t,r,!1)}().concat(function(){const e=t-i[0]-1,n=h(c,e);return f(n,-r,!0)}());function p(e,t){return e.reduce((e,t)=>e-o[t],t)}function h(e,t){return e.reduce((e,r)=>p(e,t)>0?e.concat([r]):e,[])}function f(o,i,c){const u=function(e){return a.map((r,o)=>({start:r-n[o]+.5+e,end:r+t-.5+e}))}(i);return o.map(t=>{const n=c?0:-r,o=c?r:0,a=c?"end":"start",i=u[t][a];return{index:t,loopPoint:i,slideLocation:NOt(-1),translate:zOt(e,l[t]),target:()=>s.get()>i?n:o}})}return{canLoop:function(){return d.every(({index:e})=>{const r=c.filter(t=>t!==e);return p(r,t)<=.1})},clear:function(){d.forEach(e=>e.translate.clear())},loop:function(){d.forEach(e=>{const{target:t,translate:r,slideLocation:n}=e,o=t();o!==n.get()&&(r.to(o),n.set(o))})},loopPoints:d}}function ROt(e,t,r){let n,o=!1;return{init:function(a){r&&(n=new MutationObserver(e=>{o||(cOt(r)||r(a,e))&&function(e){for(const r of e)if("childList"===r.type){a.reInit(),t.emit("slidesChanged");break}}(e)}),n.observe(e,{childList:!0}))},destroy:function(){n&&n.disconnect(),o=!0}}}function FOt(e,t,r,n){const o={};let a,i=null,s=null,l=!1;return{init:function(){a=new IntersectionObserver(e=>{l||(e.forEach(e=>{const r=t.indexOf(e.target);o[r]=e}),i=null,s=null,r.emit("slidesInView"))},{root:e.parentElement,threshold:n}),t.forEach(e=>a.observe(e))},destroy:function(){a&&a.disconnect(),l=!0},get:function(e=!0){if(e&&i)return i;if(!e&&s)return s;const t=function(e){return xOt(o).reduce((t,r)=>{const n=parseInt(r),{isIntersecting:a}=o[n];return(e&&a||!e&&!a)&&t.push(n),t},[])}(e);return e&&(i=t),e||(s=t),t}}}function LOt(e,t,r,n,o,a,i,s,l){const{startEdge:c,endEdge:u,direction:d}=e,p=sOt(r);return{groupSlides:function(e){return p?function(e,t){return fOt(e).filter(e=>e%t===0).map(r=>e.slice(r,r+t))}(e,r):function(e){return e.length?fOt(e).reduce((r,p,h)=>{const f=mOt(r)||0,m=0===f,v=p===vOt(e),y=o[c]-a[f][c],g=o[c]-a[p][u],x=!n&&m?d(i):0,b=dOt(g-(!n&&v?d(s):0)-(y+x));return h&&b>t+l&&r.push(p),v&&r.push(e.length),r},[]).map((t,r,n)=>{const o=Math.max(n[r-1]||0);return e.slice(o,t)}):[]}(e)}}}function BOt(e,t,r,n,o,a,i){const{align:s,axis:l,direction:c,startIndex:u,loop:d,duration:p,dragFree:h,dragThreshold:f,inViewThreshold:m,slidesToScroll:v,skipSnaps:y,containScroll:g,watchResize:x,watchSlides:b,watchDrag:k,watchFocus:_}=a,w={measure:function(e){const{offsetTop:t,offsetLeft:r,offsetWidth:n,offsetHeight:o}=e;return{top:t,right:r+n,bottom:t+o,left:r,width:n,height:o}}},M=w.measure(t),C=r.map(w.measure),j=function(e,t){const r="rtl"===t,n="y"===e,o=!n&&r?-1:1;return{scroll:n?"y":"x",cross:n?"x":"y",startEdge:n?"top":r?"right":"left",endEdge:n?"bottom":r?"left":"right",measureSize:function(e){const{height:t,width:r}=e;return n?t:r},direction:function(e){return e*o}}}(l,c),D=j.measureSize(M),O=function(e){return{measure:function(t){return e*(t/100)}}}(D),S=function(e,t){const r={start:function(){return 0},center:function(e){return n(e)/2},end:n};function n(e){return t-e}return{measure:function(n,o){return lOt(e)?r[e](n):e(t,n,o)}}}(s,D),P=!d&&!!g,T=d||!!g,{slideSizes:E,slideSizesWithGaps:N,startGap:z,endGap:A}=function(e,t,r,n,o,a){const{measureSize:i,startEdge:s,endEdge:l}=e,c=r[0]&&o,u=function(){if(!c)return 0;const e=r[0];return dOt(t[s]-e[s])}(),d=function(){if(!c)return 0;const e=a.getComputedStyle(mOt(n));return parseFloat(e.getPropertyValue(`margin-${l}`))}(),p=r.map(i),h=r.map((e,t,r)=>{const n=!t,o=yOt(r,t);return n?p[t]+u:o?p[t]+d:r[t+1][s]-e[s]}).map(dOt);return{slideSizes:p,slideSizesWithGaps:h,startGap:u,endGap:d}}(j,M,C,r,T,o),R=LOt(j,D,v,d,M,C,z,A,2),{snaps:F,snapsAligned:L}=function(e,t,r,n,o){const{startEdge:a,endEdge:i}=e,{groupSlides:s}=o,l=s(n).map(e=>mOt(e)[i]-e[0][a]).map(dOt).map(t.measure),c=n.map(e=>r[a]-e[a]).map(e=>-dOt(e)),u=s(c).map(e=>e[0]).map((e,t)=>e+l[t]);return{snaps:c,snapsAligned:u}}(j,S,M,C,R),B=-mOt(F)+mOt(N),{snapsContained:V,scrollContainLimit:I}=function(e,t,r,n,o){const a=MOt(-t+e,0),i=r.map((e,t)=>{const{min:n,max:o}=a,i=a.constrain(e),s=!t,l=yOt(r,t);return s?o:l||c(n,i)?n:c(o,i)?o:i}).map(e=>parseFloat(e.toFixed(3))),s=function(){const e=i[0],t=mOt(i);return MOt(i.lastIndexOf(e),i.indexOf(t)+1)}(),l=function(){if(t<=e+o)return[a.max];if("keepSnaps"===n)return i;const{min:r,max:l}=s;return i.slice(r,l)}();function c(e,t){return hOt(e,t)<=1}return{snapsContained:l,scrollContainLimit:s}}(D,B,L,g,2),q=P?V:L,{limit:$}=function(e,t,r){const n=t[0];return{limit:MOt(r?n-e:mOt(t),n)}}(B,q,d),H=COt(vOt(q),u,d),W=H.clone(),U=fOt(r),Y=wOt(n,o,()=>(({dragHandler:e,scrollBody:t,scrollBounds:r,options:{loop:n}})=>{n||r.constrain(e.pointerDown()),t.seek()})(se),e=>(({scrollBody:e,translate:t,location:r,offsetLocation:n,previousLocation:o,scrollLooper:a,slideLooper:i,dragHandler:s,animation:l,eventHandler:c,scrollBounds:u,options:{loop:d}},p)=>{const h=e.settled(),f=!u.shouldConstrain(),m=d?h:h&&f,v=m&&!s.pointerDown();v&&l.stop();const y=r.get()*p+o.get()*(1-p);n.set(y),d&&(a.loop(e.direction()),i.loop()),t.to(n.get()),v&&c.emit("settle"),m||c.emit("scroll")})(se,e)),Z=q[H.get()],K=NOt(Z),G=NOt(Z),X=NOt(Z),Q=NOt(Z),J=function(e,t,r,n,o,a){let i=0,s=0,l=o,c=a,u=e.get(),d=0;function p(e){return l=e,f}function h(e){return c=e,f}const f={direction:function(){return s},duration:function(){return l},velocity:function(){return i},seek:function(){const t=n.get()-e.get();let o=0;return l?(r.set(e),i+=t/l,i*=c,u+=i,e.add(i),o=u-d):(i=0,r.set(n),e.set(n),o=t),s=pOt(o),d=u,f},settled:function(){return dOt(n.get()-t.get())<.001},useBaseFriction:function(){return h(a)},useBaseDuration:function(){return p(o)},useFriction:h,useDuration:p};return f}(K,X,G,Q,p,.68),ee=TOt(d,q,B,$,Q),te=function(e,t,r,n,o,a,i){function s(o){const s=o.distance,l=o.index!==t.get();a.add(s),s&&(n.duration()?e.start():(e.update(),e.render(1),e.update())),l&&(r.set(t.get()),t.set(o.index),i.emit("select"))}return{distance:function(e,t){s(o.byDistance(e,t))},index:function(e,r){const n=t.clone().set(e);s(o.byIndex(n.get(),r))}}}(Y,H,W,J,ee,Q,i),re=function(e){const{max:t,length:r}=e;return{get:function(e){return r?(e-t)/-r:0}}}($),ne=_Ot(),oe=FOt(t,r,i,m),{slideRegistry:ae}=function(e,t,r,n,o,a){const{groupSlides:i}=o,{min:s,max:l}=n,c=function(){const n=i(a),o=!e||"keepSnaps"===t;return 1===r.length?[a]:o?n:n.slice(s,l).map((e,t,r)=>{const n=!t,o=yOt(r,t);return n?gOt(mOt(r[0])+1):o?gOt(vOt(a)-mOt(r)[0]+1,mOt(r)[0]):e})}();return{slideRegistry:c}}(P,g,q,I,R,U),ie=EOt(e,r,ae,te,J,ne,i,_),se={ownerDocument:n,ownerWindow:o,eventHandler:i,containerRect:M,slideRects:C,animation:Y,axis:j,dragHandler:jOt(j,e,n,o,Q,DOt(j,o),K,Y,te,J,ee,H,i,O,h,f,y,.68,k),eventStore:ne,percentOfView:O,index:H,indexPrevious:W,limit:$,location:K,offsetLocation:X,previousLocation:G,options:a,resizeHandler:OOt(t,i,o,r,j,x,w),scrollBody:J,scrollBounds:SOt($,X,Q,J,O),scrollLooper:POt(B,$,X,[K,X,G,Q]),scrollProgress:re,scrollSnapList:q.map(re.get),scrollSnaps:q,scrollTarget:ee,scrollTo:te,slideLooper:AOt(j,D,B,E,N,F,q,X,r),slideFocus:ie,slidesHandler:ROt(t,i,b),slidesInView:oe,slideIndexes:U,slideRegistry:ae,slidesToScroll:R,target:Q,translate:zOt(j,t)};return se}nOt.displayName="TimeInput";const VOt={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function IOt(e){function t(e,t){return bOt(e,t||{})}return{mergeOptions:t,optionsAtMedia:function(r){const n=r.breakpoints||{},o=xOt(n).filter(t=>e.matchMedia(t).matches).map(e=>n[e]).reduce((e,r)=>t(e,r),{});return t(r,o)},optionsMediaQueries:function(t){return t.map(e=>xOt(e.breakpoints||{})).reduce((e,t)=>e.concat(t),[]).map(e.matchMedia)}}}function qOt(e,t,r){const n=e.ownerDocument,o=n.defaultView,a=IOt(o),i=function(e){let t=[];return{init:function(r,n){return t=n.filter(({options:t})=>!1!==e.optionsAtMedia(t).active),t.forEach(t=>t.init(r,e)),n.reduce((e,t)=>Object.assign(e,{[t.name]:t}),{})},destroy:function(){t=t.filter(e=>e.destroy())}}}(a),s=_Ot(),l=function(){let e,t={};function r(e){return t[e]||[]}const n={init:function(t){e=t},emit:function(t){return r(t).forEach(r=>r(e,t)),n},off:function(e,o){return t[e]=r(e).filter(e=>e!==o),n},on:function(e,o){return t[e]=r(e).concat([o]),n},clear:function(){t={}}};return n}(),{mergeOptions:c,optionsAtMedia:u,optionsMediaQueries:d}=a,{on:p,off:h,emit:f}=l,m=j;let v,y,g,x,b=!1,k=c(VOt,qOt.globalOptions),_=c(k),w=[];function M(t){const r=BOt(e,g,x,n,o,t,l);if(t.loop&&!r.slideLooper.canLoop()){return M(Object.assign({},t,{loop:!1}))}return r}function C(t,r){b||(k=c(k,t),_=u(k),w=r||w,function(){const{container:t,slides:r}=_;g=(lOt(t)?e.querySelector(t):t)||e.children[0];const n=lOt(r)?g.querySelectorAll(r):r;x=[].slice.call(n||g.children)}(),v=M(_),d([k,...w.map(({options:e})=>e)]).forEach(e=>s.add(e,"change",j)),_.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(P),v.eventHandler.init(P),v.resizeHandler.init(P),v.slidesHandler.init(P),v.options.loop&&v.slideLooper.loop(),g.offsetParent&&x.length&&v.dragHandler.init(P),y=i.init(P,w)))}function j(e,t){const r=S();D(),C(c({startIndex:r},e),t),l.emit("reInit")}function D(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),i.destroy(),s.clear()}function O(e,t,r){!_.active||b||(v.scrollBody.useBaseFriction().useDuration(!0===t?0:_.duration),v.scrollTo.index(e,r||0))}function S(){return v.index.get()}const P={canScrollNext:function(){return v.index.add(1).get()!==S()},canScrollPrev:function(){return v.index.add(-1).get()!==S()},containerNode:function(){return g},internalEngine:function(){return v},destroy:function(){b||(b=!0,s.clear(),D(),l.emit("destroy"),l.clear())},off:h,on:p,emit:f,plugins:function(){return y},previousScrollSnap:function(){return v.indexPrevious.get()},reInit:m,rootNode:function(){return e},scrollNext:function(e){O(v.index.add(1).get(),e,-1)},scrollPrev:function(e){O(v.index.add(-1).get(),e,1)},scrollProgress:function(){return v.scrollProgress.get(v.offsetLocation.get())},scrollSnapList:function(){return v.scrollSnapList},scrollTo:O,selectedScrollSnap:S,slideNodes:function(){return x},slidesInView:function(){return v.slidesInView.get()},slidesNotInView:function(){return v.slidesInView.get(!1)}};return C(t,r),setTimeout(()=>l.emit("init"),0),P}function $Ot(t={},r=[]){const n=e.useRef(t),o=e.useRef(r),[a,i]=e.useState(),[s,l]=e.useState(),c=e.useCallback(()=>{a&&a.reInit(n.current,o.current)},[a]);return e.useEffect(()=>{aOt(n.current,t)||(n.current=t,c())},[t,c]),e.useEffect(()=>{(function(e,t){if(e.length!==t.length)return!1;const r=iOt(e),n=iOt(t);return r.every((e,t)=>aOt(e,n[t]))})(o.current,r)||(o.current=r,c())},[r,c]),e.useEffect(()=>{if(typeof window<"u"&&window.document&&window.document.createElement&&s){qOt.globalOptions=$Ot.globalOptions;const e=qOt(s,n.current,o.current);return i(e),()=>e.destroy()}i(void 0)},[s,i]),[l,a]}qOt.globalOptions=void 0,$Ot.globalOptions=void 0;const HOt=s.createContext(null);function WOt(){const e=s.useContext(HOt);if(!e)throw new Error("useCarousel must be used within a <Carousel />");return e}const UOt=s.forwardRef(({orientation:e="horizontal",opts:r,setApi:n,plugins:o,className:a,children:i,...l},c)=>{const[u,d]=$Ot({...r,axis:"horizontal"===e?"x":"y"},o),[p,h]=s.useState(!1),[f,m]=s.useState(!1),v=s.useCallback(e=>{e&&(h(e.canScrollPrev()),m(e.canScrollNext()))},[]),y=s.useCallback(()=>{null==d||d.scrollPrev()},[d]),g=s.useCallback(()=>{null==d||d.scrollNext()},[d]),x=s.useCallback(e=>{"ArrowLeft"===e.key?(e.preventDefault(),y()):"ArrowRight"===e.key&&(e.preventDefault(),g())},[y,g]);return s.useEffect(()=>{!d||!n||n(d)},[d,n]),s.useEffect(()=>{if(d)return v(d),d.on("reInit",v),d.on("select",v),()=>{null==d||d.off("select",v)}},[d,v]),t.jsx(HOt.Provider,{value:{carouselRef:u,api:d,opts:r,orientation:e||("y"===(null==r?void 0:r.axis)?"vertical":"horizontal"),scrollPrev:y,scrollNext:g,canScrollPrev:p,canScrollNext:f},children:t.jsx("div",{ref:c,onKeyDownCapture:x,className:zdt("relative",a),role:"region","aria-roledescription":"carousel",...l,children:i})})});UOt.displayName="Carousel";const YOt=s.forwardRef(({className:e,...r},n)=>{const{carouselRef:o,orientation:a}=WOt();return t.jsx("div",{ref:o,className:"overflow-hidden",children:t.jsx("div",{ref:n,className:zdt("flex","horizontal"===a?"-ml-4":"-mt-4 flex-col",e),...r})})});YOt.displayName="CarouselContent";const ZOt=s.forwardRef(({className:e,...r},n)=>{const{orientation:o}=WOt();return t.jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:zdt("min-w-0 shrink-0 grow-0 basis-full","horizontal"===o?"pl-4":"pt-4",e),...r})});ZOt.displayName="CarouselItem";const KOt=s.forwardRef(({className:e,variant:r="outline",size:n="icon",...o},a)=>{const{orientation:i,scrollPrev:s,canScrollPrev:l}=WOt();return t.jsxs($ht,{ref:a,variant:r,size:n,className:zdt("absolute h-8 w-8 rounded-full","horizontal"===i?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...o,children:[t.jsx(Rst,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Previous slide"})]})});KOt.displayName="CarouselPrevious";const GOt=s.forwardRef(({className:e,variant:r="outline",size:n="icon",...o},a)=>{const{orientation:i,scrollNext:s,canScrollNext:l}=WOt();return t.jsxs($ht,{ref:a,variant:r,size:n,className:zdt("absolute h-8 w-8 rounded-full","horizontal"===i?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",e),disabled:!l,onClick:s,...o,children:[t.jsx(Fst,{className:"h-4 w-4"}),t.jsx("span",{className:"sr-only",children:"Next slide"})]})});GOt.displayName="CarouselNext";const XOt=({form:e,translations:r})=>{const n=[{label:r.timePresetAllDay,start:"00:00",end:"23:59"},{label:r.timePresetEarlyMorning,start:"06:00",end:"09:00"},{label:r.timePresetMorning,start:"09:00",end:"12:00"},{label:r.timePresetLunch,start:"12:00",end:"13:00"},{label:r.timePresetEarlyAfternoon,start:"13:00",end:"15:00"},{label:r.timePresetLateAfternoon,start:"15:00",end:"17:00"},{label:r.timePresetEvening,start:"17:00",end:"20:00"},{label:r.timePresetNight,start:"20:00",end:"23:00"}];return t.jsx("div",{className:"pt-2 pb-1",children:t.jsxs(UOt,{className:"w-full max-w-xs mx-auto sm:px-0",children:[t.jsx(YOt,{className:"",children:n.map(r=>t.jsx(ZOt,{className:"basis-1/3",children:t.jsx(rOt.div,{whileHover:{scale:1},whileTap:{scale:.95},children:t.jsx($ht,{type:"button",variant:"outline",size:"sm",onClick:()=>(t=>{e.setValue("startTime",t.start),e.setValue("endTime",t.end)})(r),className:zdt("w-full text-xs h-5 mx-auto flex",e.watch("startTime")===r.start&&e.watch("endTime")===r.end?"bg-primary text-primary-foreground":""),children:t.jsx("span",{className:"text-[10px] sm:text-xs",children:r.label})})})},r.label))}),t.jsx(KOt,{className:"flex",type:"button"}),t.jsx(GOt,{className:"flex",type:"button"})]})})};var QOt="Switch",[JOt,eSt]=flt(QOt),[tSt,rSt]=JOt(QOt),nSt=s.forwardRef((e,r)=>{const{__scopeSwitch:n,name:o,checked:a,defaultChecked:i,required:l,disabled:c,value:u="on",onCheckedChange:d,form:p,...h}=e,[f,m]=s.useState(null),v=hlt(r,e=>m(e)),y=s.useRef(!1),g=!f||(p||!!f.closest("form")),[x,b]=klt({prop:a,defaultProp:i??!1,onChange:d,caller:QOt});return t.jsxs(tSt,{scope:n,checked:x,disabled:c,children:[t.jsx(Olt.button,{type:"button",role:"switch","aria-checked":x,"aria-required":l,"data-state":sSt(x),"data-disabled":c?"":void 0,disabled:c,value:u,...h,ref:v,onClick:ult(e.onClick,e=>{b(e=>!e),g&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())})}),g&&t.jsx(iSt,{control:f,bubbles:!y.current,name:o,value:u,checked:x,required:l,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})});nSt.displayName=QOt;var oSt="SwitchThumb",aSt=s.forwardRef((e,r)=>{const{__scopeSwitch:n,...o}=e,a=rSt(oSt,n);return t.jsx(Olt.span,{"data-state":sSt(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:r})});aSt.displayName=oSt;var iSt=s.forwardRef(({__scopeSwitch:e,control:r,checked:n,bubbles:o=!0,...a},i)=>{const l=s.useRef(null),c=hlt(l,i),u=kvt(n),d=bvt(r);return s.useEffect(()=>{const e=l.current;if(!e)return;const t=window.HTMLInputElement.prototype,r=Object.getOwnPropertyDescriptor(t,"checked").set;if(u!==n&&r){const t=new Event("click",{bubbles:o});r.call(e,n),e.dispatchEvent(t)}},[u,n,o]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:c,style:{...a.style,...d,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});function sSt(e){return e?"checked":"unchecked"}iSt.displayName="SwitchBubbleInput";var lSt=nSt,cSt=aSt;const uSt=s.forwardRef(({className:e,...r},n)=>t.jsx(lSt,{className:zdt("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...r,ref:n,children:t.jsx(cSt,{className:zdt("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));function dSt(e,[t,r]){return Math.min(r,Math.max(t,e))}uSt.displayName=lSt.displayName;var pSt=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),hSt=s.forwardRef((e,r)=>t.jsx(Olt.span,{...e,ref:r,style:{...pSt,...e.style}}));hSt.displayName="VisuallyHidden";var fSt=hSt,mSt=[" ","Enter","ArrowUp","ArrowDown"],vSt=[" ","Enter"],ySt="Select",[gSt,xSt,bSt]=Jmt(ySt),[kSt,_St]=flt(ySt,[bSt,oxt]),wSt=oxt(),[MSt,CSt]=kSt(ySt),[jSt,DSt]=kSt(ySt),OSt=e=>{const{__scopeSelect:r,children:n,open:o,defaultOpen:a,onOpenChange:i,value:l,defaultValue:c,onValueChange:u,dir:d,name:p,autoComplete:h,disabled:f,required:m,form:v}=e,y=wSt(r),[g,x]=s.useState(null),[b,k]=s.useState(null),[_,w]=s.useState(!1),M=tvt(d),[C,j]=klt({prop:o,defaultProp:a??!1,onChange:i,caller:ySt}),[D,O]=klt({prop:l,defaultProp:c,onChange:u,caller:ySt}),S=s.useRef(null),P=!g||(v||!!g.closest("form")),[T,E]=s.useState(new Set),N=Array.from(T).map(e=>e.props.value).join(";");return t.jsx(bxt,{...y,children:t.jsxs(MSt,{required:m,scope:r,trigger:g,onTriggerChange:x,valueNode:b,onValueNodeChange:k,valueNodeHasChildren:_,onValueNodeHasChildrenChange:w,contentId:xlt(),value:D,onValueChange:O,open:C,onOpenChange:j,dir:M,triggerPointerDownPosRef:S,disabled:f,children:[t.jsx(gSt.Provider,{scope:r,children:t.jsx(jSt,{scope:e.__scopeSelect,onNativeOptionAdd:s.useCallback(e=>{E(t=>new Set(t).add(e))},[]),onNativeOptionRemove:s.useCallback(e=>{E(t=>{const r=new Set(t);return r.delete(e),r})},[]),children:n})}),P?t.jsxs(vPt,{"aria-hidden":!0,required:m,tabIndex:-1,name:p,autoComplete:h,value:D,onChange:e=>O(e.target.value),disabled:f,form:v,children:[void 0===D?t.jsx("option",{value:""}):null,Array.from(T)]},N):null]})})};OSt.displayName=ySt;var SSt="SelectTrigger",PSt=s.forwardRef((e,r)=>{const{__scopeSelect:n,disabled:o=!1,...a}=e,i=wSt(n),l=CSt(SSt,n),c=l.disabled||o,u=hlt(r,l.onTriggerChange),d=xSt(n),p=s.useRef("touch"),[h,f,m]=gPt(e=>{const t=d().filter(e=>!e.disabled),r=t.find(e=>e.value===l.value),n=xPt(t,e,r);void 0!==n&&l.onValueChange(n.value)}),v=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(kxt,{asChild:!0,...i,children:t.jsx(Olt.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":yPt(l.value)?"":void 0,...a,ref:u,onClick:ult(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==p.current&&v(e)}),onPointerDown:ult(a.onPointerDown,e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(v(e),e.preventDefault())}),onKeyDown:ult(a.onKeyDown,e=>{const t=""!==h.current;!(e.ctrlKey||e.altKey||e.metaKey)&&1===e.key.length&&f(e.key),(!t||" "!==e.key)&&mSt.includes(e.key)&&(v(),e.preventDefault())})})})});PSt.displayName=SSt;var TSt="SelectValue",ESt=s.forwardRef((e,r)=>{const{__scopeSelect:n,className:o,style:a,children:i,placeholder:s="",...l}=e,c=CSt(TSt,n),{onValueNodeHasChildrenChange:u}=c,d=void 0!==i,p=hlt(r,c.onValueNodeChange);return vlt(()=>{u(d)},[u,d]),t.jsx(Olt.span,{...l,ref:p,style:{pointerEvents:"none"},children:yPt(c.value)?t.jsx(t.Fragment,{children:s}):i})});ESt.displayName=TSt;var NSt=s.forwardRef((e,r)=>{const{__scopeSelect:n,children:o,...a}=e;return t.jsx(Olt.span,{"aria-hidden":!0,...a,ref:r,children:o||"▼"})});NSt.displayName="SelectIcon";var zSt=e=>t.jsx(Glt,{asChild:!0,...e});zSt.displayName="SelectPortal";var ASt="SelectContent",RSt=s.forwardRef((e,r)=>{const n=CSt(ASt,e.__scopeSelect),[o,a]=s.useState();if(vlt(()=>{a(new DocumentFragment)},[]),!n.open){const r=o;return r?d.createPortal(t.jsx(LSt,{scope:e.__scopeSelect,children:t.jsx(gSt.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),r):null}return t.jsx(ISt,{...e,ref:r})});RSt.displayName=ASt;var FSt=10,[LSt,BSt]=kSt(ASt),VSt=_lt("SelectContent.RemoveScroll"),ISt=s.forwardRef((e,r)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:v,hideWhenDetached:y,avoidCollisions:g,...x}=e,b=CSt(ASt,n),[k,_]=s.useState(null),[w,M]=s.useState(null),C=hlt(r,e=>_(e)),[j,D]=s.useState(null),[O,S]=s.useState(null),P=xSt(n),[T,E]=s.useState(!1),N=s.useRef(!1);s.useEffect(()=>{if(k)return Xct(k)},[k]),ect();const z=s.useCallback(e=>{const[t,...r]=P().map(e=>e.ref.current),[n]=r.slice(-1),o=document.activeElement;for(const r of e)if(r===o||(null==r||r.scrollIntoView({block:"nearest"}),r===t&&w&&(w.scrollTop=0),r===n&&w&&(w.scrollTop=w.scrollHeight),null==r||r.focus(),document.activeElement!==o))return},[P,w]),A=s.useCallback(()=>z([j,k]),[z,j,k]);s.useEffect(()=>{T&&A()},[T,A]);const{onOpenChange:R,triggerPointerDownPosRef:F}=b;s.useEffect(()=>{if(k){let e={x:0,y:0};const t=t=>{var r,n;e={x:Math.abs(Math.round(t.pageX)-((null==(r=F.current)?void 0:r.x)??0)),y:Math.abs(Math.round(t.pageY)-((null==(n=F.current)?void 0:n.y)??0))}},r=r=>{e.x<=10&&e.y<=10?r.preventDefault():k.contains(r.target)||R(!1),document.removeEventListener("pointermove",t),F.current=null};return null!==F.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",r,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",r,{capture:!0})}}},[k,R,F]),s.useEffect(()=>{const e=()=>R(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[R]);const[L,B]=gPt(e=>{const t=P().filter(e=>!e.disabled),r=t.find(e=>e.ref.current===document.activeElement),n=xPt(t,e,r);n&&setTimeout(()=>n.ref.current.focus())}),V=s.useCallback((e,t,r)=>{const n=!N.current&&!r;(void 0!==b.value&&b.value===t||n)&&(D(e),n&&(N.current=!0))},[b.value]),I=s.useCallback(()=>null==k?void 0:k.focus(),[k]),q=s.useCallback((e,t,r)=>{const n=!N.current&&!r;(void 0!==b.value&&b.value===t||n)&&S(e)},[b.value]),$="popper"===o?$St:qSt,H=$===$St?{side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:h,collisionBoundary:f,collisionPadding:m,sticky:v,hideWhenDetached:y,avoidCollisions:g}:{};return t.jsx(LSt,{scope:n,content:k,viewport:w,onViewportChange:M,itemRefCallback:V,selectedItem:j,onItemLeave:I,itemTextRefCallback:q,focusSelectedItem:A,selectedItemText:O,position:o,isPositioned:T,searchRef:L,children:t.jsx(Hct,{as:VSt,allowPinchZoom:!0,children:t.jsx($lt,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ult(a,e=>{var t;null==(t=b.trigger)||t.focus({preventScroll:!0}),e.preventDefault()}),children:t.jsx(Rlt,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:t.jsx($,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...x,...H,onPlaced:()=>E(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...x.style},onKeyDown:ult(x.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),!t&&1===e.key.length&&B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=P().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const r=e.target,n=t.indexOf(r);t=t.slice(n+1)}setTimeout(()=>z(t)),e.preventDefault()}})})})})})})});ISt.displayName="SelectContentImpl";var qSt=s.forwardRef((e,r)=>{const{__scopeSelect:n,onPlaced:o,...a}=e,i=CSt(ASt,n),l=BSt(ASt,n),[c,u]=s.useState(null),[d,p]=s.useState(null),h=hlt(r,e=>p(e)),f=xSt(n),m=s.useRef(!1),v=s.useRef(!0),{viewport:y,selectedItem:g,selectedItemText:x,focusSelectedItem:b}=l,k=s.useCallback(()=>{if(i.trigger&&i.valueNode&&c&&d&&y&&g&&x){const e=i.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),r=i.valueNode.getBoundingClientRect(),n=x.getBoundingClientRect();if("rtl"!==i.dir){const o=n.left-t.left,a=r.left-o,i=e.left-a,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-FSt,d=dSt(a,[FSt,Math.max(FSt,u-l)]);c.style.minWidth=s+"px",c.style.left=d+"px"}else{const o=t.right-n.right,a=window.innerWidth-r.right-o,i=window.innerWidth-e.right-a,s=e.width+i,l=Math.max(s,t.width),u=window.innerWidth-FSt,d=dSt(a,[FSt,Math.max(FSt,u-l)]);c.style.minWidth=s+"px",c.style.right=d+"px"}const a=f(),s=window.innerHeight-2*FSt,l=y.scrollHeight,u=window.getComputedStyle(d),p=parseInt(u.borderTopWidth,10),h=parseInt(u.paddingTop,10),v=parseInt(u.borderBottomWidth,10),b=p+h+l+parseInt(u.paddingBottom,10)+v,k=Math.min(5*g.offsetHeight,b),_=window.getComputedStyle(y),w=parseInt(_.paddingTop,10),M=parseInt(_.paddingBottom,10),C=e.top+e.height/2-FSt,j=s-C,D=g.offsetHeight/2,O=p+h+(g.offsetTop+D),S=b-O;if(O<=C){const e=a.length>0&&g===a[a.length-1].ref.current;c.style.bottom="0px";const t=d.clientHeight-y.offsetTop-y.offsetHeight,r=O+Math.max(j,D+(e?M:0)+t+v);c.style.height=r+"px"}else{const e=a.length>0&&g===a[0].ref.current;c.style.top="0px";const t=Math.max(C,p+y.offsetTop+(e?w:0)+D)+S;c.style.height=t+"px",y.scrollTop=O-C+y.offsetTop}c.style.margin=`${FSt}px 0`,c.style.minHeight=k+"px",c.style.maxHeight=s+"px",null==o||o(),requestAnimationFrame(()=>m.current=!0)}},[f,i.trigger,i.valueNode,c,d,y,g,x,i.dir,o]);vlt(()=>k(),[k]);const[_,w]=s.useState();vlt(()=>{d&&w(window.getComputedStyle(d).zIndex)},[d]);const M=s.useCallback(e=>{e&&!0===v.current&&(k(),null==b||b(),v.current=!1)},[k,b]);return t.jsx(HSt,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:M,children:t.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:_},children:t.jsx(Olt.div,{...a,ref:h,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});qSt.displayName="SelectItemAlignedPosition";var $St=s.forwardRef((e,r)=>{const{__scopeSelect:n,align:o="start",collisionPadding:a=FSt,...i}=e,s=wSt(n);return t.jsx(_xt,{...s,...i,ref:r,align:o,collisionPadding:a,style:{boxSizing:"border-box",...i.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});$St.displayName="SelectPopperPosition";var[HSt,WSt]=kSt(ASt,{}),USt="SelectViewport",YSt=s.forwardRef((e,r)=>{const{__scopeSelect:n,nonce:o,...a}=e,i=BSt(USt,n),l=WSt(USt,n),c=hlt(r,i.onViewportChange),u=s.useRef(0);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),t.jsx(gSt.Slot,{scope:n,children:t.jsx(Olt.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:ult(a.onScroll,e=>{const t=e.currentTarget,{contentWrapper:r,shouldExpandOnScrollRef:n}=l;if(null!=n&&n.current&&r){const e=Math.abs(u.current-t.scrollTop);if(e>0){const n=window.innerHeight-2*FSt,o=parseFloat(r.style.minHeight),a=parseFloat(r.style.height),i=Math.max(o,a);if(i<n){const o=i+e,a=Math.min(n,o),s=o-a;r.style.height=a+"px","0px"===r.style.bottom&&(t.scrollTop=s>0?s:0,r.style.justifyContent="flex-end")}}}u.current=t.scrollTop})})})]})});YSt.displayName=USt;var ZSt="SelectGroup",[KSt,GSt]=kSt(ZSt),XSt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=xlt();return t.jsx(KSt,{scope:n,id:a,children:t.jsx(Olt.div,{role:"group","aria-labelledby":a,...o,ref:r})})});XSt.displayName=ZSt;var QSt="SelectLabel",JSt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=GSt(QSt,n);return t.jsx(Olt.div,{id:a.id,...o,ref:r})});JSt.displayName=QSt;var ePt="SelectItem",[tPt,rPt]=kSt(ePt),nPt=s.forwardRef((e,r)=>{const{__scopeSelect:n,value:o,disabled:a=!1,textValue:i,...l}=e,c=CSt(ePt,n),u=BSt(ePt,n),d=c.value===o,[p,h]=s.useState(i??""),[f,m]=s.useState(!1),v=hlt(r,e=>{var t;return null==(t=u.itemRefCallback)?void 0:t.call(u,e,o,a)}),y=xlt(),g=s.useRef("touch"),x=()=>{a||(c.onValueChange(o),c.onOpenChange(!1))};if(""===o)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return t.jsx(tPt,{scope:n,value:o,disabled:a,textId:y,isSelected:d,onItemTextChange:s.useCallback(e=>{h(t=>t||((null==e?void 0:e.textContent)??"").trim())},[]),children:t.jsx(gSt.ItemSlot,{scope:n,value:o,disabled:a,textValue:p,children:t.jsx(Olt.div,{role:"option","aria-labelledby":y,"data-highlighted":f?"":void 0,"aria-selected":d&&f,"data-state":d?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:v,onFocus:ult(l.onFocus,()=>m(!0)),onBlur:ult(l.onBlur,()=>m(!1)),onClick:ult(l.onClick,()=>{"mouse"!==g.current&&x()}),onPointerUp:ult(l.onPointerUp,()=>{"mouse"===g.current&&x()}),onPointerDown:ult(l.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:ult(l.onPointerMove,e=>{var t;g.current=e.pointerType,a?null==(t=u.onItemLeave)||t.call(u):"mouse"===g.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ult(l.onPointerLeave,e=>{var t;e.currentTarget===document.activeElement&&(null==(t=u.onItemLeave)||t.call(u))}),onKeyDown:ult(l.onKeyDown,e=>{var t;""!==(null==(t=u.searchRef)?void 0:t.current)&&" "===e.key||(vSt.includes(e.key)&&x()," "===e.key&&e.preventDefault())})})})})});nPt.displayName=ePt;var oPt="SelectItemText",aPt=s.forwardRef((e,r)=>{const{__scopeSelect:n,className:o,style:a,...i}=e,l=CSt(oPt,n),c=BSt(oPt,n),u=rPt(oPt,n),p=DSt(oPt,n),[h,f]=s.useState(null),m=hlt(r,e=>f(e),u.onItemTextChange,e=>{var t;return null==(t=c.itemTextRefCallback)?void 0:t.call(c,e,u.value,u.disabled)}),v=null==h?void 0:h.textContent,y=s.useMemo(()=>t.jsx("option",{value:u.value,disabled:u.disabled,children:v},u.value),[u.disabled,u.value,v]),{onNativeOptionAdd:g,onNativeOptionRemove:x}=p;return vlt(()=>(g(y),()=>x(y)),[g,x,y]),t.jsxs(t.Fragment,{children:[t.jsx(Olt.span,{id:u.textId,...i,ref:m}),u.isSelected&&l.valueNode&&!l.valueNodeHasChildren?d.createPortal(i.children,l.valueNode):null]})});aPt.displayName=oPt;var iPt="SelectItemIndicator",sPt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e;return rPt(iPt,n).isSelected?t.jsx(Olt.span,{"aria-hidden":!0,...o,ref:r}):null});sPt.displayName=iPt;var lPt="SelectScrollUpButton",cPt=s.forwardRef((e,r)=>{const n=BSt(lPt,e.__scopeSelect),o=WSt(lPt,e.__scopeSelect),[a,i]=s.useState(!1),l=hlt(r,o.onScrollButtonChange);return vlt(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;i(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),a?t.jsx(pPt,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});cPt.displayName=lPt;var uPt="SelectScrollDownButton",dPt=s.forwardRef((e,r)=>{const n=BSt(uPt,e.__scopeSelect),o=WSt(uPt,e.__scopeSelect),[a,i]=s.useState(!1),l=hlt(r,o.onScrollButtonChange);return vlt(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,r=Math.ceil(t.scrollTop)<e;i(r)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),a?t.jsx(pPt,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});dPt.displayName=uPt;var pPt=s.forwardRef((e,r)=>{const{__scopeSelect:n,onAutoScroll:o,...a}=e,i=BSt("SelectScrollButton",n),l=s.useRef(null),c=xSt(n),u=s.useCallback(()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)},[]);return s.useEffect(()=>()=>u(),[u]),vlt(()=>{var e;const t=c().find(e=>e.ref.current===document.activeElement);null==(e=null==t?void 0:t.ref.current)||e.scrollIntoView({block:"nearest"})},[c]),t.jsx(Olt.div,{"aria-hidden":!0,...a,ref:r,style:{flexShrink:0,...a.style},onPointerDown:ult(a.onPointerDown,()=>{null===l.current&&(l.current=window.setInterval(o,50))}),onPointerMove:ult(a.onPointerMove,()=>{var e;null==(e=i.onItemLeave)||e.call(i),null===l.current&&(l.current=window.setInterval(o,50))}),onPointerLeave:ult(a.onPointerLeave,()=>{u()})})}),hPt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e;return t.jsx(Olt.div,{"aria-hidden":!0,...o,ref:r})});hPt.displayName="SelectSeparator";var fPt="SelectArrow",mPt=s.forwardRef((e,r)=>{const{__scopeSelect:n,...o}=e,a=wSt(n),i=CSt(fPt,n),s=BSt(fPt,n);return i.open&&"popper"===s.position?t.jsx(wxt,{...a,...o,ref:r}):null});mPt.displayName=fPt;var vPt=s.forwardRef(({__scopeSelect:e,value:r,...n},o)=>{const a=s.useRef(null),i=hlt(o,a),l=kvt(r);return s.useEffect(()=>{const e=a.current;if(!e)return;const t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==r&&n){const t=new Event("change",{bubbles:!0});n.call(e,r),e.dispatchEvent(t)}},[l,r]),t.jsx(Olt.select,{...n,style:{...pSt,...n.style},ref:i,defaultValue:r})});function yPt(e){return""===e||void 0===e}function gPt(e){const t=Plt(e),r=s.useRef(""),n=s.useRef(0),o=s.useCallback(e=>{const o=r.current+e;t(o),function e(t){r.current=t,window.clearTimeout(n.current),""!==t&&(n.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),a=s.useCallback(()=>{r.current="",window.clearTimeout(n.current)},[]);return s.useEffect(()=>()=>window.clearTimeout(n.current),[]),[r,o,a]}function xPt(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(o,0));1===n.length&&(a=a.filter(e=>e!==r));const i=a.find(e=>e.textValue.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}vPt.displayName="SelectBubbleInput";var bPt=PSt,kPt=NSt,_Pt=zSt,wPt=RSt,MPt=YSt,CPt=JSt,jPt=nPt,DPt=aPt,OPt=sPt,SPt=cPt,PPt=dPt,TPt=hPt;const EPt=OSt,NPt=ESt,zPt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(bPt,{ref:o,className:zdt("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[r,t.jsx(kPt,{asChild:!0,children:t.jsx(Wst,{className:"h-4 w-4 opacity-50"})})]}));zPt.displayName=bPt.displayName;const APt=s.forwardRef(({className:e,...r},n)=>t.jsx(SPt,{ref:n,className:zdt("flex cursor-default items-center justify-center py-1",e),...r,children:t.jsx(Zst,{className:"h-4 w-4"})}));APt.displayName=SPt.displayName;const RPt=s.forwardRef(({className:e,...r},n)=>t.jsx(PPt,{ref:n,className:zdt("flex cursor-default items-center justify-center py-1",e),...r,children:t.jsx(Wst,{className:"h-4 w-4"})}));RPt.displayName=PPt.displayName;const FPt=s.forwardRef(({className:e,children:r,position:n="popper",...o},a)=>t.jsx(_Pt,{children:t.jsxs(wPt,{ref:a,className:zdt("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o,children:[t.jsx(APt,{}),t.jsx(MPt,{className:zdt("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:r}),t.jsx(RPt,{})]})}));FPt.displayName=wPt.displayName;const LPt=s.forwardRef(({className:e,...r},n)=>t.jsx(CPt,{ref:n,className:zdt("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...r}));LPt.displayName=CPt.displayName;const BPt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(jPt,{ref:o,className:zdt("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(OPt,{children:t.jsx(Hst,{className:"h-4 w-4"})})}),t.jsx(DPt,{children:r})]}));BPt.displayName=jPt.displayName;const VPt=s.forwardRef(({className:e,...r},n)=>t.jsx(TPt,{ref:n,className:zdt("-mx-1 my-1 h-px bg-muted",e),...r}));VPt.displayName=TPt.displayName;const IPt=(e,t,r,n)=>{if(!n||!mst(e,{start:t,end:r}))return!1;switch(n){case"daily":return!0;case"weekly":return cst(e)===cst(t);case"monthly":return e.getDate()===t.getDate();default:return!1}},qPt=({field:r,form:n,translations:o})=>{const[a,i]=e.useState(0),[s,l]=e.useState(""),[c,u]=e.useState({}),d=n.getValues("startDate"),p=n.getValues("endDate"),h=n.getValues("isRepeatingInterval")||"daily",f=bit({start:d,end:p}).filter(e=>{const t=h;return"daily"===t||("weekly"===t?e.getDay()===d.getDay():"monthly"===t&&e.getDate()===d.getDate())}),m=r.value||[],v=m.filter(e=>f.some(t=>hit(e,t)));m.length!==v.length&&setTimeout(()=>{r.onChange(v)},0);const y=e=>e.length>=f.length;if("daily"===h)return t.jsx(fmt,{mode:"multiple",selected:r.value||[],onSelect:e=>{e&&y(e)?tpt.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range"):r.onChange(e||[])},fromDate:d,toDate:p,defaultMonth:d,className:"rounded-md border"});const g=f.reduce((e,t)=>{const r=sst(t,"yyyy-MM");return e[r]||(e[r]=[]),e[r].push(t),e},{}),x=Object.entries(g).sort(([e],[t])=>e.localeCompare(t));if(0===Object.keys(c).length&&x.length>0){const e={};x.forEach(([t],r)=>{e[t]=0===r}),u(e)}const b=""===s.trim()?x:x.filter(e=>{const t=e[1][0];return`${o.monthNames[t.getMonth()]} ${sst(t,"yyyy")}`.toLowerCase().includes(s.toLowerCase())}),k=Math.ceil(b.length/2),_=b.slice(2*a,2*(a+1));return t.jsxs("div",{className:"rounded-md p-1 w-[300px] overflow-y-auto",children:[t.jsx("div",{className:"text-center font-medium mb-2 text-sm",children:"weekly"===h?o.weeklyIntervalLabel.replace("{dayName}",o.fullDayNames[d.getDay()]).replace("{startDate}",`${sst(d,"dd")} ${o.monthNames[d.getMonth()].slice(0,3)}`).replace("{endDate}",`${sst(p,"dd")} ${o.monthNames[p.getMonth()].slice(0,3)} ${sst(p,"yyyy")}`):o.monthlyIntervalLabel.replace("{dayOfMonth}",sst(d,"do")).replace("{startDate}",o.monthNames[d.getMonth()].slice(0,3)).replace("{endDate}",`${o.monthNames[p.getMonth()].slice(0,3)} ${sst(p,"yyyy")}`)}),t.jsxs("div",{className:"flex gap-2 mb-2",children:[t.jsx("div",{className:"flex-grow",children:t.jsx(cyt,{type:"text",placeholder:o.searchMonthPlaceholder,value:s,onChange:e=>{l(e.target.value),i(0)},className:"h-7 text-xs"})}),b.length>0&&t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx($ht,{type:"button",variant:"outline",size:"sm",className:"h-7 w-7 p-0",onClick:()=>{i(e=>Math.max(e-1,0))},disabled:0===a,children:"←"}),t.jsxs("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:[a+1,"/",Math.max(1,k)]}),t.jsx($ht,{type:"button",variant:"outline",size:"sm",className:"h-7 w-7 p-0",onClick:()=>{i(e=>Math.min(e+1,k-1))},disabled:a>=k-1,children:"→"})]})]}),0===f.length?t.jsx("div",{className:"text-center text-muted-foreground py-1 text-xs",children:o.noMatchingDates}):0===b.length?t.jsx("div",{className:"text-center text-muted-foreground py-1 text-xs",children:o.noSearchResults.replace("{query}",s)}):t.jsx("div",{children:_.map(([e,n])=>{const a=n[0],i=`${o.monthNames[a.getMonth()]} ${sst(a,"yyyy")}`,s=c[e],l=n.filter(e=>v.some(t=>hit(t,e))).length;return t.jsxs("div",{className:"mb-2 border rounded-md overflow-hidden",children:[t.jsxs("div",{className:"py-1 px-2 bg-muted flex justify-between items-center cursor-pointer text-xs",onClick:()=>(e=>{u(t=>({...t,[e]:!t[e]}))})(e),children:[t.jsxs("div",{className:"flex items-center",children:[t.jsx("span",{className:"mr-1 flex items-center justify-center w-4",children:s?t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m6 9 6 6 6-6"})}):t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:t.jsx("path",{d:"m9 18 6-6-6-6"})})}),t.jsx("span",{className:"font-medium",children:i}),t.jsx("span",{className:"ml-1 text-muted-foreground",children:o.ofExcluded.replace("{count}",l.toString()).replace("{total}",n.length.toString())})]}),t.jsxs("div",{className:"flex gap-1",children:[t.jsx($ht,{type:"button",variant:"outline",size:"sm",className:"h-5 text-[10px] px-1",onClick:e=>{e.stopPropagation(),(e=>{const t=v,n=e.filter(e=>!t.some(t=>hit(t,e))),a=[...t,...n];y(a)?tpt.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range"):r.onChange(a)})(n)},children:o.selectAll}),t.jsx($ht,{type:"button",variant:"outline",size:"sm",className:"h-5 text-[10px] px-1",onClick:e=>{e.stopPropagation(),(e=>{const t=v.filter(t=>!e.some(e=>hit(e,t)));r.onChange(t)})(n)},disabled:0===l,children:o.clearAll})]})]}),s&&t.jsx("div",{className:"p-1 flex flex-wrap gap-1 bg-background",children:n.map(e=>{const n=v.some(t=>hit(t,e));return t.jsx($ht,{type:"button",variant:n?"default":"outline",className:"h-6 px-1 text-[10px]",onClick:()=>{const t=v;if(n)r.onChange(t.filter(t=>!hit(t,e)));else{const n=[...t,e];if(y(n))return void tpt.error(o.errorCannotExcludeAllDates||"Cannot exclude all dates in the range");r.onChange(n)}},children:sst(e,o.dateButtonFormat)},e.toISOString())})})]},e)})})]})},$Pt=({form:r,translations:n,showRepeatToggle:o})=>{const[a,i]=e.useState(!1);e.useState(()=>{const e=r.getValues("isRepeatingExcludedDates");e&&e.length>0&&i(!0)});return o?t.jsx(rOt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},children:t.jsxs(oyt,{className:"flex flex-col rounded-lg border p-4 space-y-4",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ayt,{className:"text-base flex items-center cursor-pointer",children:[t.jsx(qst,{className:"mr-2 h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"leading-tight",children:n.repeatingEventQuestion})]}),t.jsx(fbt,{mode:"wait",children:r.watch("isRepeating")&&t.jsx(rOt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2,ease:"easeInOut"},children:t.jsx(syt,{className:"text-xs leading-normal max-w-[90%]",children:((e,t,r,o,a,i)=>{const s=e=>sst(e,"MMM d"),l=n.fullDayNames[e.getDay()],c="enUS"===n.language?sst(e,"do"):e.getDate().toString(),u=s(e),d=fst(e,t)?s(t):(e=>sst(e,"MMM d, yyyy"))(t),p=`${r} - ${o}`;let h="";switch(a||"daily"){case"daily":h=n.repeatDailyDescription.replace("{timeRange}",p).replace("{startDate}",u).replace("{endDate}",d);break;case"weekly":h=n.repeatWeeklyDescription.replace("{dayName}",l).replace("{timeRange}",p).replace("{startDate}",u).replace("{endDate}",d);break;case"monthly":h=n.repeatMonthlyDescription.replace("{dayOfMonth}",c).replace("{timeRange}",p).replace("{startDate}",u).replace("{endDate}",d)}if(i&&i.length>0){const e=i.length;h+=` (${n.withExcludedDates.replace("{count}",e.toString()).replace("{s}",e>1?"s":"")})`}return h})(r.watch("startDate"),r.watch("endDate"),r.watch("startTime"),r.watch("endTime"),r.watch("isRepeatingInterval"),r.watch("isRepeatingExcludedDates"))})})})]}),t.jsx(tyt,{control:r.control,name:"isRepeating",render:({field:e})=>t.jsx(iyt,{children:t.jsx(uSt,{checked:e.value,onCheckedChange:t=>{e.onChange(t),t||(i(!1),r.setValue("isRepeatingExcludedDates",[]))},className:"flex-shrink-0"})})})]}),t.jsx(fbt,{children:r.watch("isRepeating")&&t.jsx(rOt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.15},children:t.jsxs("div",{className:"space-y-4",children:[t.jsx(tyt,{control:r.control,name:"isRepeatingInterval",render:({field:e})=>t.jsxs(EPt,{onValueChange:t=>{t!==e.value&&(r.setValue("isRepeatingExcludedDates",[]),i(!1)),e.onChange(t)},value:e.value||"daily",children:[t.jsx(iyt,{children:t.jsx(zPt,{className:"w-full",children:t.jsx(NPt,{})})}),t.jsxs(FPt,{children:[t.jsx(BPt,{value:"daily",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(Bst,{className:"mr-2 h-4 w-4"}),n.repeatDaily]})}),t.jsx(BPt,{value:"weekly",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(qst,{className:"mr-2 h-4 w-4"}),n.repeatWeekly]})}),t.jsx(BPt,{value:"monthly",children:t.jsxs("div",{className:"flex items-center",children:[t.jsx(Vst,{className:"mr-2 h-4 w-4"}),n.repeatMonthly]})})]})]})}),t.jsxs("div",{className:"flex items-center justify-between mt-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsxs(ayt,{className:"flex items-center text-sm cursor-pointer",children:[t.jsx(Kst,{className:"mr-2 h-3 w-3"}),n.excludedDates]}),t.jsx(syt,{className:"text-xs",children:n.excludedDatesDescription})]}),t.jsx(uSt,{checked:a,onCheckedChange:e=>{i(e),e||r.setValue("isRepeatingExcludedDates",[])},className:"flex-shrink-0"})]}),t.jsx(fbt,{children:a&&t.jsx(rOt.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.05,ease:"easeInOut"},className:"mt-4",children:t.jsx(tyt,{control:r.control,name:"isRepeatingExcludedDates",render:({field:e})=>t.jsx(oyt,{children:t.jsxs("div",{className:"space-y-4",children:[t.jsxs(Xxt,{children:[t.jsx(Qxt,{asChild:!0,children:t.jsxs($ht,{variant:"outline",className:"w-full justify-start text-left font-normal text-sm h-9",type:"button",children:[t.jsx(Vst,{className:"mr-2 h-4 w-4"}),n.selectDatesToExclude]})}),t.jsx(Jxt,{className:"w-auto p-0 max-w-[320px]",align:"start",children:t.jsx(qPt,{field:e,form:r,translations:n})})]}),t.jsx(fbt,{children:"daily"===r.watch("isRepeatingInterval")&&t.jsxs(rOt.div,{initial:{opacity:0,height:0,overflow:"hidden"},animate:{opacity:1,height:"auto",overflow:"visible"},exit:{opacity:0,height:0,overflow:"hidden"},transition:{duration:.015,ease:"easeInOut"},className:"space-y-2",children:[t.jsxs("div",{className:"flex items-center justify-between mb-2",children:[t.jsx(syt,{className:"text-xs mb-0",children:n.skipDays}),t.jsx($ht,{type:"button",variant:"destructive",size:"sm",className:"text-xs h-5 mr-3",disabled:!((r.watch("isRepeatingExcludedDates")||[]).length>0),onClick:()=>{r.setValue("isRepeatingExcludedDates",[])},children:n.clearAll})]}),t.jsx("div",{children:t.jsx("div",{className:"grid grid-cols-7 gap-1 mb-2",children:n.dayNames.map((e,o)=>{const a=o,i=r.watch("isRepeatingExcludedDates")||[],s=bit({start:r.getValues("startDate"),end:r.getValues("endDate")}).filter(e=>e.getDay()===a),l=s.length>0,c=l&&s.every(e=>i.some(t=>hit(t,e)));return t.jsx($ht,{type:"button",variant:c?"default":"outline",size:"sm",className:zdt("w-8 h-8 p-0 text-center flex items-center justify-center",0===a||6===a?"font-medium":"",l?"":"opacity-50 cursor-not-allowed"),disabled:!l,onClick:()=>{if(!l)return;const e=r.getValues("startDate"),t=r.getValues("endDate"),o=bit({start:e,end:t}),i=o.filter(e=>e.getDay()===a);let s=[...r.getValues("isRepeatingExcludedDates")||[]];if(c)s=s.filter(e=>!i.some(t=>hit(t,e)));else{i.forEach(e=>{s.some(t=>hit(t,e))||s.push(e)});const r="daily",a=o.filter(n=>IPt(n,e,t,r));if(s.length>=a.length)return void tpt.error(n.errorCannotExcludeAllDates)}r.setValue("isRepeatingExcludedDates",s)},children:e.charAt(0)},o)})})})]})}),e.value&&e.value.length>0&&t.jsx("div",{className:"flex flex-wrap gap-1 mt-2",children:e.value.map((r,n)=>t.jsxs(rOt.div,{className:"bg-secondary text-secondary-foreground rounded-md px-2 py-1 text-xs flex items-center",initial:{opacity:0,scale:.6,y:15,rotateX:-10},animate:{opacity:1,scale:1,y:0,rotateX:0},whileHover:{scale:1.05},transition:{type:"spring",stiffness:500,damping:30,delay:0},children:[sst(r,"MMM d, yyyy"),t.jsxs($ht,{type:"button",variant:"ghost",size:"sm",className:"h-4 w-4 p-0 ml-1",onClick:()=>{const t=[...e.value||[]];t.splice(n,1),e.onChange(t)},children:[t.jsx("span",{className:"sr-only",children:"Remove"}),"×"]})]},r.toISOString()))}),t.jsx(lyt,{})]})})})})})]})})})]})}):null},HPt=({open:e,editType:r,onEditTypeChange:n,onConfirm:o,onClose:a,translations:i})=>t.jsx(qmt,{open:e,children:t.jsxs(Umt,{className:"max-w-[425px]",children:[t.jsxs(Ymt,{children:[t.jsxs(Kmt,{className:"flex items-center",children:[t.jsx(Ist,{className:"mr-2 h-5 w-5 text-primary"}),i.editRecurringEventTitle]}),t.jsx(Gmt,{className:"text-left",children:i.editRecurringEventDescription}),t.jsx("div",{className:"h-2"}),t.jsx("div",{className:"mt-4 space-y-4",children:t.jsx(Yvt,{defaultValue:"all",value:r,onValueChange:e=>n(e),children:t.jsx("div",{className:"space-y-4",children:[{value:"single",label:i.editThisOccurrence,description:i.editThisOccurrenceDescription},{value:"future",label:i.editThisAndFuture,description:i.editThisAndFutureDescription},{value:"all",label:i.editAllOccurrences,description:i.editAllOccurrencesDescription}].map(e=>t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(Zvt,{value:e.value,id:`edit-${e.value}`}),t.jsxs(Qvt,{htmlFor:`edit-${e.value}`,className:"flex flex-col flex-1 items-start cursor-pointer",children:[t.jsx("span",{className:"leading-none",children:e.label}),t.jsx("span",{className:"text-sm text-muted-foreground mt-1",children:e.description})]})]},e.value))})})}),t.jsx("div",{className:"h-2"})]}),t.jsxs(Zmt,{children:[t.jsx(Qmt,{onClick:a,children:i.cancel}),t.jsxs(Xmt,{onClick:o,className:"w-full sm:w-auto",children:[t.jsx(Ist,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),i.save]})]})]})});var WPt,UPt;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const r of e)t[r]=r;return t},e.getValidEnumValues=t=>{const r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),n={};for(const e of r)n[e]=t[e];return e.objectValues(n)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(const r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(WPt||(WPt={})),(UPt||(UPt={})).mergeShapes=(e,t)=>({...e,...t});const YPt=WPt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),ZPt=e=>{switch(typeof e){case"undefined":return YPt.undefined;case"string":return YPt.string;case"number":return Number.isNaN(e)?YPt.nan:YPt.number;case"boolean":return YPt.boolean;case"function":return YPt.function;case"bigint":return YPt.bigint;case"symbol":return YPt.symbol;case"object":return Array.isArray(e)?YPt.array:null===e?YPt.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?YPt.promise:typeof Map<"u"&&e instanceof Map?YPt.map:typeof Set<"u"&&e instanceof Set?YPt.set:typeof Date<"u"&&e instanceof Date?YPt.date:YPt.object;default:return YPt.unknown}},KPt=WPt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class GPt extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},r={_errors:[]},n=e=>{for(const o of e.issues)if("invalid_union"===o.code)o.unionErrors.map(n);else if("invalid_return_type"===o.code)n(o.returnTypeError);else if("invalid_arguments"===o.code)n(o.argumentsError);else if(0===o.path.length)r._errors.push(t(o));else{let e=r,n=0;for(;n<o.path.length;){const r=o.path[n];n===o.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(o))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(this),r}static assert(e){if(!(e instanceof GPt))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,WPt.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},r=[];for(const n of this.issues)if(n.path.length>0){const r=n.path[0];t[r]=t[r]||[],t[r].push(e(n))}else r.push(e(n));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}GPt.create=e=>new GPt(e);const XPt=(e,t)=>{let r;switch(e.code){case KPt.invalid_type:r=e.received===YPt.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case KPt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,WPt.jsonStringifyReplacer)}`;break;case KPt.unrecognized_keys:r=`Unrecognized key(s) in object: ${WPt.joinValues(e.keys,", ")}`;break;case KPt.invalid_union:r="Invalid input";break;case KPt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${WPt.joinValues(e.options)}`;break;case KPt.invalid_enum_value:r=`Invalid enum value. Expected ${WPt.joinValues(e.options)}, received '${e.received}'`;break;case KPt.invalid_arguments:r="Invalid function arguments";break;case KPt.invalid_return_type:r="Invalid function return type";break;case KPt.invalid_date:r="Invalid date";break;case KPt.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:WPt.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case KPt.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case KPt.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case KPt.custom:r="Invalid input";break;case KPt.invalid_intersection_types:r="Intersection results could not be merged";break;case KPt.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case KPt.not_finite:r="Number must be finite";break;default:r=t.defaultError,WPt.assertNever(e)}return{message:r}};let QPt=XPt;function JPt(e,t){const r=QPt,n=(e=>{const{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...o.path||[]],i={...o,path:a};if(void 0!==o.message)return{...o,path:a,message:o.message};let s="";const l=n.filter(e=>!!e).slice().reverse();for(const e of l)s=e(i,{data:t,defaultError:s}).message;return{...o,path:a,message:s}})({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===XPt?void 0:XPt].filter(e=>!!e)});e.common.issues.push(n)}class eTt{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const r=[];for(const n of t){if("aborted"===n.status)return tTt;"dirty"===n.status&&e.dirty(),r.push(n.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){const r=[];for(const e of t){const t=await e.key,n=await e.value;r.push({key:t,value:n})}return eTt.mergeObjectSync(e,r)}static mergeObjectSync(e,t){const r={};for(const n of t){const{key:t,value:o}=n;if("aborted"===t.status||"aborted"===o.status)return tTt;"dirty"===t.status&&e.dirty(),"dirty"===o.status&&e.dirty(),"__proto__"!==t.value&&(typeof o.value<"u"||n.alwaysSet)&&(r[t.value]=o.value)}return{status:e.value,value:r}}}const tTt=Object.freeze({status:"aborted"}),rTt=e=>({status:"dirty",value:e}),nTt=e=>({status:"valid",value:e}),oTt=e=>"aborted"===e.status,aTt=e=>"dirty"===e.status,iTt=e=>"valid"===e.status,sTt=e=>typeof Promise<"u"&&e instanceof Promise;var lTt;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:null==e?void 0:e.message}(lTt||(lTt={}));class cTt{constructor(e,t,r,n){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=n}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const uTt=(e,t)=>{if(iTt(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new GPt(e.common.issues);return this._error=t,this._error}}};function dTt(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:o}:{errorMap:(t,o)=>{const{message:a}=e;return"invalid_enum_value"===t.code?{message:a??o.defaultError}:typeof o.data>"u"?{message:a??n??o.defaultError}:"invalid_type"!==t.code?{message:o.defaultError}:{message:a??r??o.defaultError}},description:o}}class pTt{get description(){return this._def.description}_getType(e){return ZPt(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:ZPt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new eTt,ctx:{common:e.parent.common,data:e.data,parsedType:ZPt(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(sTt(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){const r={common:{issues:[],async:(null==t?void 0:t.async)??!1,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ZPt(e)},n=this._parseSync({data:e,path:r.path,parent:r});return uTt(r,n)}"~validate"(e){var t,r;const n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ZPt(e)};if(!this["~standard"].async)try{const t=this._parseSync({data:e,path:[],parent:n});return iTt(t)?{value:t.value}:{issues:n.common.issues}}catch(e){null!=(r=null==(t=null==e?void 0:e.message)?void 0:t.toLowerCase())&&r.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(e=>iTt(e)?{value:e.value}:{issues:n.common.issues})}async parseAsync(e,t){const r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){const r={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:ZPt(e)},n=this._parse({data:e,path:r.path,parent:r}),o=await(sTt(n)?n:Promise.resolve(n));return uTt(r,o)}refine(e,t){const r=e=>"string"==typeof t||typeof t>"u"?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,n)=>{const o=e(t),a=()=>n.addIssue({code:KPt.custom,...r(t)});return typeof Promise<"u"&&o instanceof Promise?o.then(e=>!!e||(a(),!1)):!!o||(a(),!1)})}refinement(e,t){return this._refinement((r,n)=>!!e(r)||(n.addIssue("function"==typeof t?t(r,n):t),!1))}_refinement(e){return new uEt({schema:this,typeName:xEt.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return dEt.create(this,this._def)}nullable(){return pEt.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return KTt.create(this)}promise(){return cEt.create(this,this._def)}or(e){return QTt.create([this,e],this._def)}and(e){return eEt.create(this,e,this._def)}transform(e){return new uEt({...dTt(this._def),schema:this,typeName:xEt.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new hEt({...dTt(this._def),innerType:this,defaultValue:t,typeName:xEt.ZodDefault})}brand(){return new vEt({typeName:xEt.ZodBranded,type:this,...dTt(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new fEt({...dTt(this._def),innerType:this,catchValue:t,typeName:xEt.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return yEt.create(this,e)}readonly(){return gEt.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const hTt=/^c[^\s-]{8,}$/i,fTt=/^[0-9a-z]+$/,mTt=/^[0-9A-HJKMNP-TV-Z]{26}$/i,vTt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,yTt=/^[a-z0-9_-]{21}$/i,gTt=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,xTt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,bTt=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let kTt;const _Tt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,wTt=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,MTt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,CTt=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,jTt=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,DTt=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,OTt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",STt=new RegExp(`^${OTt}$`);function PTt(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function TTt(e){return new RegExp(`^${PTt(e)}$`)}function ETt(e){let t=`${OTt}T${PTt(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function NTt(e,t){return!(("v4"!==t&&t||!_Tt.test(e))&&("v6"!==t&&t||!MTt.test(e)))}function zTt(e,t){if(!gTt.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!("object"!=typeof o||null===o||"typ"in o&&"JWT"!==(null==o?void 0:o.typ)||!o.alg||t&&o.alg!==t)}catch{return!1}}function ATt(e,t){return!(("v4"!==t&&t||!wTt.test(e))&&("v6"!==t&&t||!CTt.test(e)))}class RTt extends pTt{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==YPt.string){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.string,received:t.parsedType}),tTt}const t=new eTt;let r;for(const n of this._def.checks)if("min"===n.kind)e.data.length<n.value&&(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("max"===n.kind)e.data.length>n.value&&(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!1,message:n.message}),t.dirty());else if("length"===n.kind){const o=e.data.length>n.value,a=e.data.length<n.value;(o||a)&&(r=this._getOrReturnCtx(e,r),o?JPt(r,{code:KPt.too_big,maximum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}):a&&JPt(r,{code:KPt.too_small,minimum:n.value,type:"string",inclusive:!0,exact:!0,message:n.message}),t.dirty())}else if("email"===n.kind)bTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"email",code:KPt.invalid_string,message:n.message}),t.dirty());else if("emoji"===n.kind)kTt||(kTt=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),kTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"emoji",code:KPt.invalid_string,message:n.message}),t.dirty());else if("uuid"===n.kind)vTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"uuid",code:KPt.invalid_string,message:n.message}),t.dirty());else if("nanoid"===n.kind)yTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"nanoid",code:KPt.invalid_string,message:n.message}),t.dirty());else if("cuid"===n.kind)hTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"cuid",code:KPt.invalid_string,message:n.message}),t.dirty());else if("cuid2"===n.kind)fTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"cuid2",code:KPt.invalid_string,message:n.message}),t.dirty());else if("ulid"===n.kind)mTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"ulid",code:KPt.invalid_string,message:n.message}),t.dirty());else if("url"===n.kind)try{new URL(e.data)}catch{r=this._getOrReturnCtx(e,r),JPt(r,{validation:"url",code:KPt.invalid_string,message:n.message}),t.dirty()}else"regex"===n.kind?(n.regex.lastIndex=0,n.regex.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"regex",code:KPt.invalid_string,message:n.message}),t.dirty())):"trim"===n.kind?e.data=e.data.trim():"includes"===n.kind?e.data.includes(n.value,n.position)||(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.invalid_string,validation:{includes:n.value,position:n.position},message:n.message}),t.dirty()):"toLowerCase"===n.kind?e.data=e.data.toLowerCase():"toUpperCase"===n.kind?e.data=e.data.toUpperCase():"startsWith"===n.kind?e.data.startsWith(n.value)||(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.invalid_string,validation:{startsWith:n.value},message:n.message}),t.dirty()):"endsWith"===n.kind?e.data.endsWith(n.value)||(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.invalid_string,validation:{endsWith:n.value},message:n.message}),t.dirty()):"datetime"===n.kind?ETt(n).test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.invalid_string,validation:"datetime",message:n.message}),t.dirty()):"date"===n.kind?STt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.invalid_string,validation:"date",message:n.message}),t.dirty()):"time"===n.kind?TTt(n).test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.invalid_string,validation:"time",message:n.message}),t.dirty()):"duration"===n.kind?xTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"duration",code:KPt.invalid_string,message:n.message}),t.dirty()):"ip"===n.kind?NTt(e.data,n.version)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"ip",code:KPt.invalid_string,message:n.message}),t.dirty()):"jwt"===n.kind?zTt(e.data,n.alg)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"jwt",code:KPt.invalid_string,message:n.message}),t.dirty()):"cidr"===n.kind?ATt(e.data,n.version)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"cidr",code:KPt.invalid_string,message:n.message}),t.dirty()):"base64"===n.kind?jTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"base64",code:KPt.invalid_string,message:n.message}),t.dirty()):"base64url"===n.kind?DTt.test(e.data)||(r=this._getOrReturnCtx(e,r),JPt(r,{validation:"base64url",code:KPt.invalid_string,message:n.message}),t.dirty()):WPt.assertNever(n);return{status:t.value,value:e.data}}_regex(e,t,r){return this.refinement(t=>e.test(t),{validation:t,code:KPt.invalid_string,...lTt.errToObj(r)})}_addCheck(e){return new RTt({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...lTt.errToObj(e)})}url(e){return this._addCheck({kind:"url",...lTt.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...lTt.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...lTt.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...lTt.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...lTt.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...lTt.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...lTt.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...lTt.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...lTt.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...lTt.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...lTt.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...lTt.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,offset:(null==e?void 0:e.offset)??!1,local:(null==e?void 0:e.local)??!1,...lTt.errToObj(null==e?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(null==e?void 0:e.precision)>"u"?null:null==e?void 0:e.precision,...lTt.errToObj(null==e?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...lTt.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...lTt.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,...lTt.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...lTt.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...lTt.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...lTt.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...lTt.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...lTt.errToObj(t)})}nonempty(e){return this.min(1,lTt.errToObj(e))}trim(){return new RTt({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new RTt({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new RTt({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function FTt(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}RTt.create=e=>new RTt({checks:[],typeName:xEt.ZodString,coerce:(null==e?void 0:e.coerce)??!1,...dTt(e)});class LTt extends pTt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==YPt.number){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.number,received:t.parsedType}),tTt}let t;const r=new eTt;for(const n of this._def.checks)"int"===n.kind?WPt.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.invalid_type,expected:"integer",received:"float",message:n.message}),r.dirty()):"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.too_small,minimum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.too_big,maximum:n.value,type:"number",inclusive:n.inclusive,exact:!1,message:n.message}),r.dirty()):"multipleOf"===n.kind?0!==FTt(e.data,n.value)&&(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):"finite"===n.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.not_finite,message:n.message}),r.dirty()):WPt.assertNever(n);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,lTt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,lTt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,lTt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,lTt.toString(t))}setLimit(e,t,r,n){return new LTt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:lTt.toString(n)}]})}_addCheck(e){return new LTt({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:lTt.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:lTt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:lTt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:lTt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:lTt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:lTt.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:lTt.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:lTt.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:lTt.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(e=>"int"===e.kind||"multipleOf"===e.kind&&WPt.isInteger(e.value))}get isFinite(){let e=null,t=null;for(const r of this._def.checks){if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.value<e)&&(e=r.value)}return Number.isFinite(t)&&Number.isFinite(e)}}LTt.create=e=>new LTt({checks:[],typeName:xEt.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...dTt(e)});class BTt extends pTt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==YPt.bigint)return this._getInvalidInput(e);let t;const r=new eTt;for(const n of this._def.checks)"min"===n.kind?(n.inclusive?e.data<n.value:e.data<=n.value)&&(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.too_small,type:"bigint",minimum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"max"===n.kind?(n.inclusive?e.data>n.value:e.data>=n.value)&&(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.too_big,type:"bigint",maximum:n.value,inclusive:n.inclusive,message:n.message}),r.dirty()):"multipleOf"===n.kind?e.data%n.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),JPt(t,{code:KPt.not_multiple_of,multipleOf:n.value,message:n.message}),r.dirty()):WPt.assertNever(n);return{status:r.value,value:e.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.bigint,received:t.parsedType}),tTt}gte(e,t){return this.setLimit("min",e,!0,lTt.toString(t))}gt(e,t){return this.setLimit("min",e,!1,lTt.toString(t))}lte(e,t){return this.setLimit("max",e,!0,lTt.toString(t))}lt(e,t){return this.setLimit("max",e,!1,lTt.toString(t))}setLimit(e,t,r,n){return new BTt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:lTt.toString(n)}]})}_addCheck(e){return new BTt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:lTt.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:lTt.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:lTt.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:lTt.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:lTt.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}BTt.create=e=>new BTt({checks:[],typeName:xEt.ZodBigInt,coerce:(null==e?void 0:e.coerce)??!1,...dTt(e)});class VTt extends pTt{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==YPt.boolean){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.boolean,received:t.parsedType}),tTt}return nTt(e.data)}}VTt.create=e=>new VTt({typeName:xEt.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...dTt(e)});class ITt extends pTt{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==YPt.date){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.date,received:t.parsedType}),tTt}if(Number.isNaN(e.data.getTime())){return JPt(this._getOrReturnCtx(e),{code:KPt.invalid_date}),tTt}const t=new eTt;let r;for(const n of this._def.checks)"min"===n.kind?e.data.getTime()<n.value&&(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.too_small,message:n.message,inclusive:!0,exact:!1,minimum:n.value,type:"date"}),t.dirty()):"max"===n.kind?e.data.getTime()>n.value&&(r=this._getOrReturnCtx(e,r),JPt(r,{code:KPt.too_big,message:n.message,inclusive:!0,exact:!1,maximum:n.value,type:"date"}),t.dirty()):WPt.assertNever(n);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new ITt({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:lTt.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:lTt.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ITt.create=e=>new ITt({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:xEt.ZodDate,...dTt(e)});class qTt extends pTt{_parse(e){if(this._getType(e)!==YPt.symbol){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.symbol,received:t.parsedType}),tTt}return nTt(e.data)}}qTt.create=e=>new qTt({typeName:xEt.ZodSymbol,...dTt(e)});class $Tt extends pTt{_parse(e){if(this._getType(e)!==YPt.undefined){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.undefined,received:t.parsedType}),tTt}return nTt(e.data)}}$Tt.create=e=>new $Tt({typeName:xEt.ZodUndefined,...dTt(e)});class HTt extends pTt{_parse(e){if(this._getType(e)!==YPt.null){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.null,received:t.parsedType}),tTt}return nTt(e.data)}}HTt.create=e=>new HTt({typeName:xEt.ZodNull,...dTt(e)});class WTt extends pTt{constructor(){super(...arguments),this._any=!0}_parse(e){return nTt(e.data)}}WTt.create=e=>new WTt({typeName:xEt.ZodAny,...dTt(e)});class UTt extends pTt{constructor(){super(...arguments),this._unknown=!0}_parse(e){return nTt(e.data)}}UTt.create=e=>new UTt({typeName:xEt.ZodUnknown,...dTt(e)});class YTt extends pTt{_parse(e){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.never,received:t.parsedType}),tTt}}YTt.create=e=>new YTt({typeName:xEt.ZodNever,...dTt(e)});class ZTt extends pTt{_parse(e){if(this._getType(e)!==YPt.undefined){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.void,received:t.parsedType}),tTt}return nTt(e.data)}}ZTt.create=e=>new ZTt({typeName:xEt.ZodVoid,...dTt(e)});class KTt extends pTt{_parse(e){const{ctx:t,status:r}=this._processInputParams(e),n=this._def;if(t.parsedType!==YPt.array)return JPt(t,{code:KPt.invalid_type,expected:YPt.array,received:t.parsedType}),tTt;if(null!==n.exactLength){const e=t.data.length>n.exactLength.value,o=t.data.length<n.exactLength.value;(e||o)&&(JPt(t,{code:e?KPt.too_big:KPt.too_small,minimum:o?n.exactLength.value:void 0,maximum:e?n.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:n.exactLength.message}),r.dirty())}if(null!==n.minLength&&t.data.length<n.minLength.value&&(JPt(t,{code:KPt.too_small,minimum:n.minLength.value,type:"array",inclusive:!0,exact:!1,message:n.minLength.message}),r.dirty()),null!==n.maxLength&&t.data.length>n.maxLength.value&&(JPt(t,{code:KPt.too_big,maximum:n.maxLength.value,type:"array",inclusive:!0,exact:!1,message:n.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>n.type._parseAsync(new cTt(t,e,t.path,r)))).then(e=>eTt.mergeArray(r,e));const o=[...t.data].map((e,r)=>n.type._parseSync(new cTt(t,e,t.path,r)));return eTt.mergeArray(r,o)}get element(){return this._def.type}min(e,t){return new KTt({...this._def,minLength:{value:e,message:lTt.toString(t)}})}max(e,t){return new KTt({...this._def,maxLength:{value:e,message:lTt.toString(t)}})}length(e,t){return new KTt({...this._def,exactLength:{value:e,message:lTt.toString(t)}})}nonempty(e){return this.min(1,e)}}function GTt(e){if(e instanceof XTt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=dEt.create(GTt(n))}return new XTt({...e._def,shape:()=>t})}return e instanceof KTt?new KTt({...e._def,type:GTt(e.element)}):e instanceof dEt?dEt.create(GTt(e.unwrap())):e instanceof pEt?pEt.create(GTt(e.unwrap())):e instanceof tEt?tEt.create(e.items.map(e=>GTt(e))):e}KTt.create=(e,t)=>new KTt({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xEt.ZodArray,...dTt(t)});class XTt extends pTt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=WPt.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==YPt.object){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.object,received:t.parsedType}),tTt}const{status:t,ctx:r}=this._processInputParams(e),{shape:n,keys:o}=this._getCached(),a=[];if(!(this._def.catchall instanceof YTt&&"strip"===this._def.unknownKeys))for(const e in r.data)o.includes(e)||a.push(e);const i=[];for(const e of o){const t=n[e],o=r.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new cTt(r,o,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof YTt){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of a)i.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)a.length>0&&(JPt(r,{code:KPt.unrecognized_keys,keys:a}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of a){const n=r.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new cTt(r,n,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of i){const r=await t.key,n=await t.value;e.push({key:r,value:n,alwaysSet:t.alwaysSet})}return e}).then(e=>eTt.mergeObjectSync(t,e)):eTt.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return lTt.errToObj,new XTt({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{var n,o;const a=(null==(o=(n=this._def).errorMap)?void 0:o.call(n,t,r).message)??r.defaultError;return"unrecognized_keys"===t.code?{message:lTt.errToObj(e).message??a}:{message:a}}}:{}})}strip(){return new XTt({...this._def,unknownKeys:"strip"})}passthrough(){return new XTt({...this._def,unknownKeys:"passthrough"})}extend(e){return new XTt({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new XTt({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:xEt.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new XTt({...this._def,catchall:e})}pick(e){const t={};for(const r of WPt.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new XTt({...this._def,shape:()=>t})}omit(e){const t={};for(const r of WPt.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new XTt({...this._def,shape:()=>t})}deepPartial(){return GTt(this)}partial(e){const t={};for(const r of WPt.objectKeys(this.shape)){const n=this.shape[r];e&&!e[r]?t[r]=n:t[r]=n.optional()}return new XTt({...this._def,shape:()=>t})}required(e){const t={};for(const r of WPt.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof dEt;)e=e._def.innerType;t[r]=e}return new XTt({...this._def,shape:()=>t})}keyof(){return iEt(WPt.objectKeys(this.shape))}}XTt.create=(e,t)=>new XTt({shape:()=>e,unknownKeys:"strip",catchall:YTt.create(),typeName:xEt.ZodObject,...dTt(t)}),XTt.strictCreate=(e,t)=>new XTt({shape:()=>e,unknownKeys:"strict",catchall:YTt.create(),typeName:xEt.ZodObject,...dTt(t)}),XTt.lazycreate=(e,t)=>new XTt({shape:e,unknownKeys:"strip",catchall:YTt.create(),typeName:xEt.ZodObject,...dTt(t)});class QTt extends pTt{_parse(e){const{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{const r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;const r=e.map(e=>new GPt(e.ctx.common.issues));return JPt(t,{code:KPt.invalid_union,unionErrors:r}),tTt});{let e;const n=[];for(const o of r){const r={...t,common:{...t.common,issues:[]},parent:null},a=o._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"===a.status&&!e&&(e={result:a,ctx:r}),r.common.issues.length&&n.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const o=n.map(e=>new GPt(e));return JPt(t,{code:KPt.invalid_union,unionErrors:o}),tTt}}get options(){return this._def.options}}function JTt(e,t){const r=ZPt(e),n=ZPt(t);if(e===t)return{valid:!0,data:e};if(r===YPt.object&&n===YPt.object){const r=WPt.objectKeys(t),n=WPt.objectKeys(e).filter(e=>-1!==r.indexOf(e)),o={...e,...t};for(const r of n){const n=JTt(e[r],t[r]);if(!n.valid)return{valid:!1};o[r]=n.data}return{valid:!0,data:o}}if(r===YPt.array&&n===YPt.array){if(e.length!==t.length)return{valid:!1};const r=[];for(let n=0;n<e.length;n++){const o=JTt(e[n],t[n]);if(!o.valid)return{valid:!1};r.push(o.data)}return{valid:!0,data:r}}return r===YPt.date&&n===YPt.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}QTt.create=(e,t)=>new QTt({options:e,typeName:xEt.ZodUnion,...dTt(t)});class eEt extends pTt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=(e,n)=>{if(oTt(e)||oTt(n))return tTt;const o=JTt(e.value,n.value);return o.valid?((aTt(e)||aTt(n))&&t.dirty(),{status:t.value,value:o.data}):(JPt(r,{code:KPt.invalid_intersection_types}),tTt)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([e,t])=>n(e,t)):n(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}eEt.create=(e,t,r)=>new eEt({left:e,right:t,typeName:xEt.ZodIntersection,...dTt(r)});class tEt extends pTt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==YPt.array)return JPt(r,{code:KPt.invalid_type,expected:YPt.array,received:r.parsedType}),tTt;if(r.data.length<this._def.items.length)return JPt(r,{code:KPt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),tTt;!this._def.rest&&r.data.length>this._def.items.length&&(JPt(r,{code:KPt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const n=[...r.data].map((e,t)=>{const n=this._def.items[t]||this._def.rest;return n?n._parse(new cTt(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(n).then(e=>eTt.mergeArray(t,e)):eTt.mergeArray(t,n)}get items(){return this._def.items}rest(e){return new tEt({...this._def,rest:e})}}tEt.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tEt({items:e,typeName:xEt.ZodTuple,rest:null,...dTt(t)})};class rEt extends pTt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==YPt.map)return JPt(r,{code:KPt.invalid_type,expected:YPt.map,received:r.parsedType}),tTt;const n=this._def.keyType,o=this._def.valueType,a=[...r.data.entries()].map(([e,t],a)=>({key:n._parse(new cTt(r,e,r.path,[a,"key"])),value:o._parse(new cTt(r,t,r.path,[a,"value"]))}));if(r.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const r of a){const n=await r.key,o=await r.value;if("aborted"===n.status||"aborted"===o.status)return tTt;("dirty"===n.status||"dirty"===o.status)&&t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}})}{const e=new Map;for(const r of a){const n=r.key,o=r.value;if("aborted"===n.status||"aborted"===o.status)return tTt;("dirty"===n.status||"dirty"===o.status)&&t.dirty(),e.set(n.value,o.value)}return{status:t.value,value:e}}}}rEt.create=(e,t,r)=>new rEt({valueType:t,keyType:e,typeName:xEt.ZodMap,...dTt(r)});class nEt extends pTt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==YPt.set)return JPt(r,{code:KPt.invalid_type,expected:YPt.set,received:r.parsedType}),tTt;const n=this._def;null!==n.minSize&&r.data.size<n.minSize.value&&(JPt(r,{code:KPt.too_small,minimum:n.minSize.value,type:"set",inclusive:!0,exact:!1,message:n.minSize.message}),t.dirty()),null!==n.maxSize&&r.data.size>n.maxSize.value&&(JPt(r,{code:KPt.too_big,maximum:n.maxSize.value,type:"set",inclusive:!0,exact:!1,message:n.maxSize.message}),t.dirty());const o=this._def.valueType;function a(e){const r=new Set;for(const n of e){if("aborted"===n.status)return tTt;"dirty"===n.status&&t.dirty(),r.add(n.value)}return{status:t.value,value:r}}const i=[...r.data.values()].map((e,t)=>o._parse(new cTt(r,e,r.path,t)));return r.common.async?Promise.all(i).then(e=>a(e)):a(i)}min(e,t){return new nEt({...this._def,minSize:{value:e,message:lTt.toString(t)}})}max(e,t){return new nEt({...this._def,maxSize:{value:e,message:lTt.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}nEt.create=(e,t)=>new nEt({valueType:e,minSize:null,maxSize:null,typeName:xEt.ZodSet,...dTt(t)});class oEt extends pTt{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}oEt.create=(e,t)=>new oEt({getter:e,typeName:xEt.ZodLazy,...dTt(t)});class aEt extends pTt{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return JPt(t,{received:t.data,code:KPt.invalid_literal,expected:this._def.value}),tTt}return{status:"valid",value:e.data}}get value(){return this._def.value}}function iEt(e,t){return new sEt({values:e,typeName:xEt.ZodEnum,...dTt(t)})}aEt.create=(e,t)=>new aEt({value:e,typeName:xEt.ZodLiteral,...dTt(t)});class sEt extends pTt{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),r=this._def.values;return JPt(t,{expected:WPt.joinValues(r),received:t.parsedType,code:KPt.invalid_type}),tTt}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const t=this._getOrReturnCtx(e),r=this._def.values;return JPt(t,{received:t.data,code:KPt.invalid_enum_value,options:r}),tTt}return nTt(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return sEt.create(e,{...this._def,...t})}exclude(e,t=this._def){return sEt.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}sEt.create=iEt;class lEt extends pTt{_parse(e){const t=WPt.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==YPt.string&&r.parsedType!==YPt.number){const e=WPt.objectValues(t);return JPt(r,{expected:WPt.joinValues(e),received:r.parsedType,code:KPt.invalid_type}),tTt}if(this._cache||(this._cache=new Set(WPt.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const e=WPt.objectValues(t);return JPt(r,{received:r.data,code:KPt.invalid_enum_value,options:e}),tTt}return nTt(e.data)}get enum(){return this._def.values}}lEt.create=(e,t)=>new lEt({values:e,typeName:xEt.ZodNativeEnum,...dTt(t)});class cEt extends pTt{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==YPt.promise&&!1===t.common.async)return JPt(t,{code:KPt.invalid_type,expected:YPt.promise,received:t.parsedType}),tTt;const r=t.parsedType===YPt.promise?t.data:Promise.resolve(t.data);return nTt(r.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}cEt.create=(e,t)=>new cEt({type:e,typeName:xEt.ZodPromise,...dTt(t)});class uEt extends pTt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xEt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:r}=this._processInputParams(e),n=this._def.effect||null,o={addIssue:e=>{JPt(r,e),e.fatal?t.abort():t.dirty()},get path(){return r.path}};if(o.addIssue=o.addIssue.bind(o),"preprocess"===n.type){const e=n.transform(r.data,o);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return tTt;const n=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===n.status?tTt:"dirty"===n.status||"dirty"===t.value?rTt(n.value):n});{if("aborted"===t.value)return tTt;const n=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===n.status?tTt:"dirty"===n.status||"dirty"===t.value?rTt(n.value):n}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,o);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===r.common.async){const n=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===n.status?tTt:("dirty"===n.status&&t.dirty(),e(n.value),{status:t.value,value:n.value})}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?tTt:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))))}if("transform"===n.type){if(!1===r.common.async){const e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!iTt(e))return tTt;const a=n.transform(e.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>iTt(e)?Promise.resolve(n.transform(e.value,o)).then(e=>({status:t.value,value:e})):tTt)}WPt.assertNever(n)}}uEt.create=(e,t,r)=>new uEt({schema:e,typeName:xEt.ZodEffects,effect:t,...dTt(r)}),uEt.createWithPreprocess=(e,t,r)=>new uEt({schema:t,effect:{type:"preprocess",transform:e},typeName:xEt.ZodEffects,...dTt(r)});class dEt extends pTt{_parse(e){return this._getType(e)===YPt.undefined?nTt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}dEt.create=(e,t)=>new dEt({innerType:e,typeName:xEt.ZodOptional,...dTt(t)});class pEt extends pTt{_parse(e){return this._getType(e)===YPt.null?nTt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}pEt.create=(e,t)=>new pEt({innerType:e,typeName:xEt.ZodNullable,...dTt(t)});class hEt extends pTt{_parse(e){const{ctx:t}=this._processInputParams(e);let r=t.data;return t.parsedType===YPt.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}hEt.create=(e,t)=>new hEt({innerType:e,typeName:xEt.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...dTt(t)});class fEt extends pTt{_parse(e){const{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},n=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return sTt(n)?n.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new GPt(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===n.status?n.value:this._def.catchValue({get error(){return new GPt(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}fEt.create=(e,t)=>new fEt({innerType:e,typeName:xEt.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...dTt(t)});class mEt extends pTt{_parse(e){if(this._getType(e)!==YPt.nan){const t=this._getOrReturnCtx(e);return JPt(t,{code:KPt.invalid_type,expected:YPt.nan,received:t.parsedType}),tTt}return{status:"valid",value:e.data}}}mEt.create=e=>new mEt({typeName:xEt.ZodNaN,...dTt(e)});class vEt extends pTt{_parse(e){const{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class yEt extends pTt{_parse(e){const{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?tTt:"dirty"===e.status?(t.dirty(),rTt(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{const e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?tTt:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new yEt({in:e,out:t,typeName:xEt.ZodPipeline})}}class gEt extends pTt{_parse(e){const t=this._def.innerType._parse(e),r=e=>(iTt(e)&&(e.value=Object.freeze(e.value)),e);return sTt(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}var xEt;gEt.create=(e,t)=>new gEt({innerType:e,typeName:xEt.ZodReadonly,...dTt(t)}),function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(xEt||(xEt={}));const bEt=RTt.create,kEt=VTt.create,_Et=ITt.create;YTt.create;const wEt=KTt.create,MEt=XTt.create;QTt.create,eEt.create,tEt.create;const CEt=sEt.create;cEt.create,dEt.create,pEt.create;const jEt=CEt(["daily","weekly","monthly"]),DEt=e=>MEt({id:bEt().optional(),title:bEt().min(1,e.validations.eventNameRequired),description:bEt().optional(),startDate:_Et(),endDate:_Et(),startTime:bEt().regex(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/,e.validations.invalidTimeFormat),endTime:bEt().regex(/^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/,e.validations.invalidTimeFormat),color:bEt().min(1,e.validations.colorRequired),isRepeating:kEt(),isRepeatingInterval:jEt.default("daily").optional(),isRepeatingExcludedDates:wEt(_Et()).optional()}).refine(e=>{const t=new Date(`${e.startDate.toDateString()} ${e.startTime}`),r=new Date(`${e.endDate.toDateString()} ${e.endTime}`);if(e.isRepeating){const t=new Date(`2000-01-01 ${e.startTime}`);return new Date(`2000-01-01 ${e.endTime}`)>=t}return r>t},{message:e.validations.endTimeBeforeStart,path:["endTime"]}),OEt=({event:r,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:i,open:s,dateFromViewClick:c,translations:u})=>{const[d,p]=e.useState(!1),[h,f]=e.useState(!1),[m,v]=e.useState(!1),[y,g]=e.useState(!1),[x,b]=e.useState(!1),[k,_]=e.useState("single"),[w,M]=e.useState("all"),[C,j]=e.useState(!1),D=function(e={}){const t=l.default.useRef(void 0),r=l.default.useRef(void 0),[n,o]=l.default.useState({isDirty:!1,isValidating:!1,isLoading:tht(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:tht(e.defaultValues)?void 0:e.defaultValues});if(!t.current)if(e.formControl)t.current={...e.formControl,formState:n},e.defaultValues&&!tht(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:r,...o}=Eht(e);t.current={...o,formState:n}}const a=t.current.control;return a._options=e,$pt(()=>{const e=a._subscribe({formState:a._proxyFormState,callback:()=>o({...a._formState}),reRenderRoot:!0});return o(e=>({...e,isReady:!0})),a._formState.isReady=!0,e},[a]),l.default.useEffect(()=>a._disableForm(e.disabled),[a,e.disabled]),l.default.useEffect(()=>{e.mode&&(a._options.mode=e.mode),e.reValidateMode&&(a._options.reValidateMode=e.reValidateMode)},[a,e.mode,e.reValidateMode]),l.default.useEffect(()=>{e.errors&&(a._setErrors(e.errors),a._focusError())},[a,e.errors]),l.default.useEffect(()=>{e.shouldUnregister&&a._subjects.state.next({values:a._getWatch()})},[a,e.shouldUnregister]),l.default.useEffect(()=>{if(a._proxyFormState.isDirty){const e=a._getDirty();e!==n.isDirty&&a._subjects.state.next({isDirty:e})}},[a,n.isDirty]),l.default.useEffect(()=>{e.values&&!Qpt(e.values,r.current)?(a._reset(e.values,{keepFieldsRef:!0,...a._options.resetOptions}),r.current=e.values,o(e=>({...e}))):a._resetDefaultValues()},[a,e.values]),l.default.useEffect(()=>{a._state.mount||(a._setValid(),a._state.mount=!0),a._state.watch&&(a._state.watch=!1,a._subjects.state.next({...a._formState})),a._removeUnmounted()}),t.current.formState=qpt(n,a),t.current}({resolver:Lht(DEt(u)),defaultValues:{id:(null==r?void 0:r.id)||"",title:(null==r?void 0:r.title)||"",description:(null==r?void 0:r.description)||"",startDate:(null==r?void 0:r.startDate)||new Date,endDate:(null==r?void 0:r.endDate)||new Date,startTime:(null==r?void 0:r.startTime)||"09:00",endTime:(null==r?void 0:r.endTime)||"10:00",color:(null==r?void 0:r.color)||"blue",isRepeating:(null==r?void 0:r.isRepeating)||!1,isRepeatingInterval:(null==r?void 0:r.isRepeatingInterval)||"daily",isRepeatingExcludedDates:(null==r?void 0:r.isRepeatingExcludedDates)||[]}});if(e.useEffect(()=>{const e=D.getValues("startDate"),t=D.getValues("endDate"),r=e.toDateString()===t.toDateString();f(!r)},[D,s]),e.useEffect(()=>{D.reset({title:(null==r?void 0:r.title)||"",description:(null==r?void 0:r.description)||"",startDate:(null==r?void 0:r.startDate)||new Date,endDate:(null==r?void 0:r.endDate)||new Date,startTime:(null==r?void 0:r.startTime)||"09:00",endTime:(null==r?void 0:r.endTime)||"10:00",color:(null==r?void 0:r.color)||"blue",isRepeating:(null==r?void 0:r.isRepeating)||!1,isRepeatingInterval:(null==r?void 0:r.isRepeatingInterval)||"daily",isRepeatingExcludedDates:(null==r?void 0:r.isRepeatingExcludedDates)||[]})},[D,s,r]),e.useEffect(()=>{const e=D.watch((e,{name:t})=>{if("startDate"===t||"endDate"===t){const t=e.startDate,r=e.endDate;t>r&&D.setValue("endDate",t);const n=t.toDateString()===r.toDateString();f(!n),n&&D.setValue("isRepeating",!1)}});return()=>e.unsubscribe()},[D]),!u)return console.error("Translations are required for PopupContent"),null;const O=async e=>{var t;p(!0);try{if(null==r||!r.id){const t={startDate:e.startDate,endDate:e.endDate,title:e.title,startTime:e.startTime,endTime:e.endTime,description:e.description,color:e.color,isRepeating:e.isRepeating,isRepeatingInterval:e.isRepeatingInterval||"daily",isRepeatingExcludedDates:e.isRepeatingExcludedDates||[]};return void await Promise.resolve(n(t))}if(!0!==r.isRepeating){console.log("Updating non-repeating event");const t={...r,startDate:e.startDate,endDate:e.endDate,title:e.title,startTime:e.startTime,endTime:e.endTime,description:e.description,color:e.color,isRepeating:e.isRepeating,isRepeatingInterval:e.isRepeatingInterval||"daily",isRepeatingExcludedDates:e.isRepeatingExcludedDates||[]};return void(o&&await Promise.resolve(o(t)))}const a=c||r.startDate||new Date;switch(w){case"single":{const t=new Date(a.getFullYear(),a.getMonth(),a.getDate()),i=(r.isRepeatingExcludedDates||[]).map(e=>{if(e instanceof Date)return new Date(e.getFullYear(),e.getMonth(),e.getDate());try{const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate())}catch{return null}}).filter(e=>null!==e),s=t.toDateString();if(!i.some(e=>e.toDateString()===s)){const e={...r,isRepeatingExcludedDates:[...i,t]};o&&await Promise.resolve(o(e))}const l={title:e.title,description:e.description,startDate:t,endDate:t,startTime:e.startTime,endTime:e.endTime,color:e.color,isRepeating:!1,isRepeatingInterval:"daily",isRepeatingExcludedDates:[]};await Promise.resolve(n(l));break}case"future":if(a.toDateString()===(null==(t=r.startDate)?void 0:t.toDateString())){const t={...r,...e};o&&await Promise.resolve(o(t))}else{const t=new Date(a);t.setDate(t.getDate()-1);const i={...r,endDate:t};o&&await Promise.resolve(o(i));const s={title:e.title,description:e.description,startDate:a,endDate:e.endDate,startTime:e.startTime,endTime:e.endTime,color:e.color,isRepeating:!0,isRepeatingInterval:e.isRepeatingInterval||"daily",isRepeatingExcludedDates:e.isRepeatingExcludedDates||[]};await Promise.resolve(n(s))}break;case"all":{const t={...r,...e};o&&await Promise.resolve(o(t));break}}}catch(e){console.error("Error saving event:",e),tpt.error("Error saving event")}finally{p(!1),null==i||i()}};return t.jsxs(Bdt,{className:"sm:max-w-[425px] w-full max-h-[90vh] overflow-y-auto",children:[t.jsxs(Vdt,{children:[t.jsxs(qdt,{className:"text-lg sm:text-xl flex items-center",children:[t.jsx(Ist,{className:"mr-2 h-5 w-5"}),null!=r&&r.id?u.editEvent:u.addEvent]}),t.jsx($dt,{className:"text-sm sm:text-base",children:null!=r&&r.id?u.editEventDescription:u.createEventDescription})]}),t.jsxs(Jvt,{...D,children:[t.jsx(HPt,{open:C,onClose:()=>j(!1),editType:w,onEditTypeChange:e=>M(e),onConfirm:()=>{j(!1),D.handleSubmit(O)()},translations:u}),t.jsxs("form",{onSubmit:e=>{var t,n,o,a;if(e.preventDefault(),null!=r&&r.id&&!0===r.isRepeating){const e=D.getValues(),i=(null==(t=e.startDate)?void 0:t.getTime())!==(null==(n=r.startDate)?void 0:n.getTime()),s=(null==(o=e.endDate)?void 0:o.getTime())!==(null==(a=r.endDate)?void 0:a.getTime()),l=e.isRepeating!==r.isRepeating,c=e.isRepeatingInterval!==(r.isRepeatingInterval||"daily"),u=e.isRepeatingExcludedDates||[],d=r.isRepeatingExcludedDates||[],p=JSON.stringify(u),h=JSON.stringify(d);if(!(i||s||l||c||p!==h||C||e.title===r.title&&e.description===r.description&&e.color===r.color&&e.startTime===r.startTime&&e.endTime===r.endTime))return void j(!0)}D.handleSubmit(O)(e)},className:"space-y-4",children:[t.jsx(tyt,{control:D.control,name:"title",render:({field:e})=>t.jsxs(oyt,{children:[t.jsx(ayt,{children:u.eventTitle}),t.jsx(iyt,{children:t.jsx(cyt,{placeholder:u.eventTitle,...e,autoFocus:!r})}),t.jsx(lyt,{})]})}),t.jsx(tyt,{control:D.control,name:"description",render:({field:e})=>t.jsxs(oyt,{children:[t.jsx(ayt,{children:u.eventDescription}),t.jsx(iyt,{children:t.jsx(ebt,{placeholder:u.eventDescription,...e})}),t.jsx(lyt,{})]})}),t.jsx(XOt,{form:D,translations:u}),t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(tyt,{control:D.control,name:"startDate",render:({field:e})=>t.jsxs(oyt,{className:"flex-1",children:[t.jsx(ayt,{children:u.eventDate}),t.jsxs(Xxt,{open:m,onOpenChange:v,children:[t.jsx(Qxt,{asChild:!0,children:t.jsx(iyt,{children:t.jsxs($ht,{variant:"outline",className:"w-full justify-start text-left font-normal",children:[t.jsx(Vst,{className:"mr-2 h-4 w-4"}),e.value?sst(e.value,"PPP"):t.jsx("span",{children:u.pickADate})]})})}),t.jsx(Jxt,{className:"w-auto p-0",children:t.jsx(fmt,{mode:"single",selected:e.value,onSelect:t=>{e.onChange(t),v(!1)},defaultMonth:e.value||new Date})})]}),t.jsx(lyt,{})]})}),t.jsx(tyt,{control:D.control,name:"startTime",render:({field:e})=>t.jsxs(oyt,{className:"flex-1",children:[t.jsx(ayt,{children:u.eventStartTime}),t.jsx(iyt,{children:t.jsx(nOt,{value:e.value,onChange:e.onChange})}),t.jsx(lyt,{})]})})]}),t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(tyt,{control:D.control,name:"endDate",render:({field:e})=>t.jsxs(oyt,{className:"flex-1",children:[t.jsx(ayt,{children:u.eventEndDate}),t.jsxs(Xxt,{open:y,onOpenChange:g,children:[t.jsx(Qxt,{asChild:!0,children:t.jsx(iyt,{children:t.jsxs($ht,{variant:"outline",className:"w-full justify-start text-left font-normal",children:[t.jsx(Vst,{className:"mr-2 h-4 w-4"}),e.value?sst(e.value,"PPP"):t.jsx("span",{children:u.pickADate})]})})}),t.jsx(Jxt,{className:"w-auto p-0",children:t.jsx(fmt,{mode:"single",selected:e.value,onSelect:t=>{if(!t)return;const r=D.getValues("startDate"),n=new Date(r.getFullYear(),r.getMonth(),r.getDate()),o=new Date(t.getFullYear(),t.getMonth(),t.getDate());o>n?(e.onChange(t),g(!1)):o<n?tpt.error(u.errorEndDateBeforeStart):(e.onChange(t),g(!1))},fromDate:D.getValues("startDate"),defaultMonth:e.value||new Date})})]}),t.jsx(lyt,{})]})}),t.jsx(tyt,{control:D.control,name:"endTime",render:({field:e})=>t.jsxs(oyt,{className:"flex-1",children:[t.jsx(ayt,{children:u.eventEndTime}),t.jsx(iyt,{children:t.jsx(nOt,{value:e.value,onChange:e.onChange})}),t.jsx(lyt,{})]})})]}),t.jsx(fbt,{children:t.jsx($Pt,{form:D,translations:u,showRepeatToggle:h})}),t.jsx(tyt,{control:D.control,name:"color",render:({field:e})=>t.jsxs(oyt,{children:[t.jsx(ayt,{children:u.eventColor}),t.jsxs(EPt,{onValueChange:e.onChange,defaultValue:e.value,children:[t.jsx(iyt,{children:t.jsx(zPt,{children:t.jsx(NPt,{placeholder:u.selectAColor})})}),t.jsx(FPt,{children:Bat.map(e=>t.jsx(BPt,{value:e.value,children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:`w-4 h-4 rounded-full mr-2 ${e.class}`}),e.label]})},e.value))})]}),t.jsx(lyt,{})]})}),t.jsxs(Idt,{className:"flex flex-col space-y-3 sm:space-y-0 sm:flex-row sm:justify-between items-center w-full",children:[(null==r?void 0:r.id)&&t.jsx("div",{className:"w-full sm:w-auto",children:t.jsxs(qmt,{children:[t.jsx($mt,{asChild:!0,children:t.jsx($ht,{disabled:x,type:"button",variant:"destructive",size:"sm",className:"w-full gap-1 h-10 sm:w-auto bg-red-600 dark:bg-red-800 hover:bg-red-500 dark:hover:bg-red-900 text-xs sm:text-sm",children:x?t.jsxs(t.Fragment,{children:[t.jsx(alt,{className:"h-4 w-4 animate-spin"}),u.deleting]}):t.jsxs(t.Fragment,{children:[t.jsx(llt,{className:"h-4 w-4"}),u.delete]})})}),t.jsxs(Umt,{className:"max-w-[425px]",children:[t.jsxs(Ymt,{children:[t.jsxs(Kmt,{className:"flex items-center",children:[t.jsx(Kst,{className:"mr-2 h-5 w-5 text-red-500"}),null!=r&&r.isRepeating?u.repeatEventDeleteTitle:u.confirmDelete]}),t.jsx(Gmt,{className:"text-left",children:null!=r&&r.isRepeating?u.repeatEventDeleteDescription:u.confirmDeleteDescription}),t.jsx("div",{className:"h-2"}),(null==r?void 0:r.isRepeating)&&t.jsx("div",{className:"mt-4 space-y-4",children:t.jsx(Yvt,{defaultValue:"single",onValueChange:e=>_(e),children:t.jsx("div",{className:"space-y-4",children:[{value:"single",label:u.deleteThisOccurrence,description:u.deleteThisOccurrenceDescription},{value:"future",label:u.deleteThisAndFuture,description:u.deleteThisAndFutureDescription},{value:"all",label:u.deleteAllOccurrences,description:u.deleteAllOccurrencesDescription}].map(e=>t.jsxs("div",{className:"flex space-x-4",children:[t.jsx(Zvt,{value:e.value,id:e.value}),t.jsxs(Qvt,{htmlFor:e.value,className:"flex flex-col flex-1 items-start cursor-pointer",children:[t.jsx("span",{className:"leading-none",children:e.label}),t.jsx("span",{className:"text-sm text-muted-foreground mt-1",children:e.description})]})]},e.value))})})}),t.jsx("div",{className:"h-2"})]}),t.jsxs(Zmt,{children:[t.jsx(Qmt,{children:u.cancel}),t.jsxs(Xmt,{onClick:async()=>{var e;if(null==r||!r.id)throw Error("Missing Event Id");b(!0);try{const t=c||r.startDate||new Date;if(!r.isRepeating||"all"===k)return void(a&&await Promise.resolve(a(r.id)));if("single"===k){const e=new Date(t.getFullYear(),t.getMonth(),t.getDate()),n=(r.isRepeatingExcludedDates||[]).map(e=>{if(e instanceof Date)return new Date(e.getFullYear(),e.getMonth(),e.getDate());try{const t=new Date(e);return new Date(t.getFullYear(),t.getMonth(),t.getDate())}catch{return null}}).filter(e=>null!==e),a=e.toDateString(),i=n.some(e=>e.toDateString()===a)?n:[...n,e],s={...r,id:r.id,isRepeatingExcludedDates:i};o&&await Promise.resolve(o(s))}else if("future"===k)if(t.toDateString()===(null==(e=r.startDate)?void 0:e.toDateString()))a&&await Promise.resolve(a(r.id));else{const e=new Date(t);e.setDate(e.getDate()-1);const n={...r,id:r.id,endDate:e};o&&await Promise.resolve(o(n))}}finally{b(!1),null==i||i()}},className:"w-full sm:w-auto bg-red-600 dark:bg-red-800 hover:bg-red-500 dark:hover:bg-red-900 sm:text-sm dark:text-white",children:[t.jsx(llt,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),u.delete]})]})]})]})}),t.jsxs("div",{className:"flex flex-col sm:flex-row space-y-2 sm:space-y-0 sm:space-x-2 w-full",children:[t.jsx($ht,{type:"button",variant:"outline",onClick:i,className:"w-full sm:w-1/2 text-xs sm:text-sm",children:u.cancel}),t.jsx($ht,{type:"submit",className:"w-full sm:w-1/2 text-xs sm:text-sm",disabled:d,children:d?t.jsxs(t.Fragment,{children:[t.jsx(alt,{className:"h-4 w-4 animate-spin"}),u.saving]}):u.save})]})]})]})]})]})},SEt=({translations:e,children:r,isDisabled:n=!1})=>r?t.jsx(Rdt,{asChild:!0,disabled:n,children:r}):t.jsx(Rdt,{asChild:!0,children:t.jsxs($ht,{variant:"default",size:"sm",className:"w-full gap-0 sm:w-auto text-xs sm:text-sm",disabled:n,children:[t.jsx(Ist,{className:"h-3 w-3 sm:h-4 sm:w-4 mr-1 sm:mr-2"}),e.addEvent]})}),PEt=({event:r,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:i,onOpenChange:s,dateFromViewClick:l,children:c,isDisabled:u=!1,translations:d})=>{const[p,h]=e.useState(!1),f=e=>{u||(h(e),null==s||s(e),e||null==i||i())};return t.jsxs(Adt,{open:p,onOpenChange:f,children:[t.jsx(SEt,{translations:d,isDisabled:u,children:c}),t.jsx(OEt,{event:r,onAddEvent:n,onUpdateEvent:o,onDeleteEvent:a,onClosePopup:()=>f(!1),dateFromViewClick:l,open:p,translations:d})]})};var TEt=["Enter"," "],EEt=["ArrowUp","PageDown","End"],NEt=["ArrowDown","PageUp","Home",...EEt],zEt={ltr:[...TEt,"ArrowRight"],rtl:[...TEt,"ArrowLeft"]},AEt={ltr:["ArrowLeft"],rtl:["ArrowRight"]},REt="Menu",[FEt,LEt,BEt]=Jmt(REt),[VEt,IEt]=flt(REt,[BEt,oxt,cvt]),qEt=oxt(),$Et=cvt(),[HEt,WEt]=VEt(REt),[UEt,YEt]=VEt(REt),ZEt=e=>{const{__scopeMenu:r,open:n=!1,children:o,dir:a,onOpenChange:i,modal:l=!0}=e,c=qEt(r),[u,d]=s.useState(null),p=s.useRef(!1),h=Plt(i),f=tvt(a);return s.useEffect(()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}},[]),t.jsx(bxt,{...c,children:t.jsx(HEt,{scope:r,open:n,onOpenChange:h,content:u,onContentChange:d,children:t.jsx(UEt,{scope:r,onClose:s.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:p,dir:f,modal:l,children:o})})})};ZEt.displayName=REt;var KEt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e,a=qEt(n);return t.jsx(kxt,{...a,...o,ref:r})});KEt.displayName="MenuAnchor";var GEt="MenuPortal",[XEt,QEt]=VEt(GEt,{forceMount:void 0}),JEt=e=>{const{__scopeMenu:r,forceMount:n,children:o,container:a}=e,i=WEt(GEt,r);return t.jsx(XEt,{scope:r,forceMount:n,children:t.jsx(Xlt,{present:n||i.open,children:t.jsx(Glt,{asChild:!0,container:a,children:o})})})};JEt.displayName=GEt;var eNt="MenuContent",[tNt,rNt]=VEt(eNt),nNt=s.forwardRef((e,r)=>{const n=QEt(eNt,e.__scopeMenu),{forceMount:o=n.forceMount,...a}=e,i=WEt(eNt,e.__scopeMenu),s=YEt(eNt,e.__scopeMenu);return t.jsx(FEt.Provider,{scope:e.__scopeMenu,children:t.jsx(Xlt,{present:o||i.open,children:t.jsx(FEt.Slot,{scope:e.__scopeMenu,children:s.modal?t.jsx(oNt,{...a,ref:r}):t.jsx(aNt,{...a,ref:r})})})})}),oNt=s.forwardRef((e,r)=>{const n=WEt(eNt,e.__scopeMenu),o=s.useRef(null),a=hlt(r,o);return s.useEffect(()=>{const e=o.current;if(e)return Xct(e)},[]),t.jsx(sNt,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:ult(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),aNt=s.forwardRef((e,r)=>{const n=WEt(eNt,e.__scopeMenu);return t.jsx(sNt,{...e,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),iNt=_lt("MenuContent.ScrollLock"),sNt=s.forwardRef((e,r)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:a,onOpenAutoFocus:i,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:m,disableOutsideScroll:v,...y}=e,g=WEt(eNt,n),x=YEt(eNt,n),b=qEt(n),k=$Et(n),_=LEt(n),[w,M]=s.useState(null),C=s.useRef(null),j=hlt(r,C,g.onContentChange),D=s.useRef(0),O=s.useRef(""),S=s.useRef(0),P=s.useRef(null),T=s.useRef("right"),E=s.useRef(0),N=v?Hct:s.Fragment,z=v?{as:iNt,allowPinchZoom:!0}:void 0,A=e=>{var t,r;const n=O.current+e,o=_().filter(e=>!e.disabled),a=document.activeElement,i=null==(t=o.find(e=>e.ref.current===a))?void 0:t.textValue,s=function(e,t,r){const n=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,o=r?e.indexOf(r):-1;let a=function(e,t){return e.map((r,n)=>e[(t+n)%e.length])}(e,Math.max(o,0));1===n.length&&(a=a.filter(e=>e!==r));const i=a.find(e=>e.toLowerCase().startsWith(n.toLowerCase()));return i!==r?i:void 0}(o.map(e=>e.textValue),n,i),l=null==(r=o.find(e=>e.textValue===s))?void 0:r.ref.current;(function e(t){O.current=t,window.clearTimeout(D.current),""!==t&&(D.current=window.setTimeout(()=>e(""),1e3))})(n),l&&setTimeout(()=>l.focus())};s.useEffect(()=>()=>window.clearTimeout(D.current),[]),ect();const R=s.useCallback(e=>{var t,r;return T.current===(null==(t=P.current)?void 0:t.side)&&function(e,t){if(!t)return!1;const r={x:e.clientX,y:e.clientY};return function(e,t){const{x:r,y:n}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,u=s.x,d=s.y;c>n!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(o=!o)}return o}(r,t)}(e,null==(r=P.current)?void 0:r.area)},[]);return t.jsx(tNt,{scope:n,searchRef:O,onItemEnter:s.useCallback(e=>{R(e)&&e.preventDefault()},[R]),onItemLeave:s.useCallback(e=>{var t;R(e)||(null==(t=C.current)||t.focus(),M(null))},[R]),onTriggerLeave:s.useCallback(e=>{R(e)&&e.preventDefault()},[R]),pointerGraceTimerRef:S,onPointerGraceIntentChange:s.useCallback(e=>{P.current=e},[]),children:t.jsx(N,{...z,children:t.jsx($lt,{asChild:!0,trapped:a,onMountAutoFocus:ult(i,e=>{var t;e.preventDefault(),null==(t=C.current)||t.focus({preventScroll:!0})}),onUnmountAutoFocus:l,children:t.jsx(Rlt,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:h,onInteractOutside:f,onDismiss:m,children:t.jsx(gvt,{asChild:!0,...k,dir:x.dir,orientation:"vertical",loop:o,currentTabStopId:w,onCurrentTabStopIdChange:M,onEntryFocus:ult(u,e=>{x.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:t.jsx(_xt,{role:"menu","aria-orientation":"vertical","data-state":NNt(g.open),"data-radix-menu-content":"",dir:x.dir,...b,...y,ref:j,style:{outline:"none",...y.style},onKeyDown:ult(y.onKeyDown,e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&A(e.key));const o=C.current;if(e.target!==o||!NEt.includes(e.key))return;e.preventDefault();const a=_().filter(e=>!e.disabled).map(e=>e.ref.current);EEt.includes(e.key)&&a.reverse(),function(e){const t=document.activeElement;for(const r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(a)}),onBlur:ult(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(D.current),O.current="")}),onPointerMove:ult(e.onPointerMove,RNt(e=>{const t=e.target,r=E.current!==e.clientX;if(e.currentTarget.contains(t)&&r){const t=e.clientX>E.current?"right":"left";T.current=t,E.current=e.clientX}}))})})})})})})});nNt.displayName=eNt;var lNt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(Olt.div,{role:"group",...o,ref:r})});lNt.displayName="MenuGroup";var cNt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(Olt.div,{...o,ref:r})});cNt.displayName="MenuLabel";var uNt="MenuItem",dNt="menu.itemSelect",pNt=s.forwardRef((e,r)=>{const{disabled:n=!1,onSelect:o,...a}=e,i=s.useRef(null),l=YEt(uNt,e.__scopeMenu),c=rNt(uNt,e.__scopeMenu),u=hlt(r,i),d=s.useRef(!1);return t.jsx(hNt,{...a,ref:u,disabled:n,onClick:ult(e.onClick,()=>{const e=i.current;if(!n&&e){const t=new CustomEvent(dNt,{bubbles:!0,cancelable:!0});e.addEventListener(dNt,e=>null==o?void 0:o(e),{once:!0}),Slt(e,t),t.defaultPrevented?d.current=!1:l.onClose()}}),onPointerDown:t=>{var r;null==(r=e.onPointerDown)||r.call(e,t),d.current=!0},onPointerUp:ult(e.onPointerUp,e=>{var t;d.current||null==(t=e.currentTarget)||t.click()}),onKeyDown:ult(e.onKeyDown,e=>{const t=""!==c.searchRef.current;n||t&&" "===e.key||TEt.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});pNt.displayName=uNt;var hNt=s.forwardRef((e,r)=>{const{__scopeMenu:n,disabled:o=!1,textValue:a,...i}=e,l=rNt(uNt,n),c=$Et(n),u=s.useRef(null),d=hlt(r,u),[p,h]=s.useState(!1),[f,m]=s.useState("");return s.useEffect(()=>{const e=u.current;e&&m((e.textContent??"").trim())},[i.children]),t.jsx(FEt.ItemSlot,{scope:n,disabled:o,textValue:a??f,children:t.jsx(xvt,{asChild:!0,...c,focusable:!o,children:t.jsx(Olt.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...i,ref:d,onPointerMove:ult(e.onPointerMove,RNt(e=>{o?l.onItemLeave(e):(l.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:ult(e.onPointerLeave,RNt(e=>l.onItemLeave(e))),onFocus:ult(e.onFocus,()=>h(!0)),onBlur:ult(e.onBlur,()=>h(!1))})})})}),fNt=s.forwardRef((e,r)=>{const{checked:n=!1,onCheckedChange:o,...a}=e;return t.jsx(_Nt,{scope:e.__scopeMenu,checked:n,children:t.jsx(pNt,{role:"menuitemcheckbox","aria-checked":zNt(n)?"mixed":n,...a,ref:r,"data-state":ANt(n),onSelect:ult(a.onSelect,()=>null==o?void 0:o(!!zNt(n)||!n),{checkForDefaultPrevented:!1})})})});fNt.displayName="MenuCheckboxItem";var mNt="MenuRadioGroup",[vNt,yNt]=VEt(mNt,{value:void 0,onValueChange:()=>{}}),gNt=s.forwardRef((e,r)=>{const{value:n,onValueChange:o,...a}=e,i=Plt(o);return t.jsx(vNt,{scope:e.__scopeMenu,value:n,onValueChange:i,children:t.jsx(lNt,{...a,ref:r})})});gNt.displayName=mNt;var xNt="MenuRadioItem",bNt=s.forwardRef((e,r)=>{const{value:n,...o}=e,a=yNt(xNt,e.__scopeMenu),i=n===a.value;return t.jsx(_Nt,{scope:e.__scopeMenu,checked:i,children:t.jsx(pNt,{role:"menuitemradio","aria-checked":i,...o,ref:r,"data-state":ANt(i),onSelect:ult(o.onSelect,()=>{var e;return null==(e=a.onValueChange)?void 0:e.call(a,n)},{checkForDefaultPrevented:!1})})})});bNt.displayName=xNt;var kNt="MenuItemIndicator",[_Nt,wNt]=VEt(kNt,{checked:!1}),MNt=s.forwardRef((e,r)=>{const{__scopeMenu:n,forceMount:o,...a}=e,i=wNt(kNt,n);return t.jsx(Xlt,{present:o||zNt(i.checked)||!0===i.checked,children:t.jsx(Olt.span,{...a,ref:r,"data-state":ANt(i.checked)})})});MNt.displayName=kNt;var CNt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e;return t.jsx(Olt.div,{role:"separator","aria-orientation":"horizontal",...o,ref:r})});CNt.displayName="MenuSeparator";var jNt=s.forwardRef((e,r)=>{const{__scopeMenu:n,...o}=e,a=qEt(n);return t.jsx(wxt,{...a,...o,ref:r})});jNt.displayName="MenuArrow";var[DNt,ONt]=VEt("MenuSub"),SNt="MenuSubTrigger",PNt=s.forwardRef((e,r)=>{const n=WEt(SNt,e.__scopeMenu),o=YEt(SNt,e.__scopeMenu),a=ONt(SNt,e.__scopeMenu),i=rNt(SNt,e.__scopeMenu),l=s.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=i,d={__scopeMenu:e.__scopeMenu},p=s.useCallback(()=>{l.current&&window.clearTimeout(l.current),l.current=null},[]);return s.useEffect(()=>p,[p]),s.useEffect(()=>{const e=c.current;return()=>{window.clearTimeout(e),u(null)}},[c,u]),t.jsx(KEt,{asChild:!0,...d,children:t.jsx(hNt,{id:a.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":a.contentId,"data-state":NNt(n.open),...e,ref:plt(r,a.onTriggerChange),onClick:t=>{var r;null==(r=e.onClick)||r.call(e,t),!e.disabled&&!t.defaultPrevented&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:ult(e.onPointerMove,RNt(t=>{i.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!l.current&&(i.onPointerGraceIntentChange(null),l.current=window.setTimeout(()=>{n.onOpenChange(!0),p()},100))})),onPointerLeave:ult(e.onPointerLeave,RNt(e=>{var t,r;p();const o=null==(t=n.content)?void 0:t.getBoundingClientRect();if(o){const t=null==(r=n.content)?void 0:r.dataset.side,a="right"===t,s=a?-5:5,l=o[a?"left":"right"],u=o[a?"right":"left"];i.onPointerGraceIntentChange({area:[{x:e.clientX+s,y:e.clientY},{x:l,y:o.top},{x:u,y:o.top},{x:u,y:o.bottom},{x:l,y:o.bottom}],side:t}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(e),e.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:ult(e.onKeyDown,t=>{var r;const a=""!==i.searchRef.current;e.disabled||a&&" "===t.key||zEt[o.dir].includes(t.key)&&(n.onOpenChange(!0),null==(r=n.content)||r.focus(),t.preventDefault())})})})});PNt.displayName=SNt;var TNt="MenuSubContent",ENt=s.forwardRef((e,r)=>{const n=QEt(eNt,e.__scopeMenu),{forceMount:o=n.forceMount,...a}=e,i=WEt(eNt,e.__scopeMenu),l=YEt(eNt,e.__scopeMenu),c=ONt(TNt,e.__scopeMenu),u=s.useRef(null),d=hlt(r,u);return t.jsx(FEt.Provider,{scope:e.__scopeMenu,children:t.jsx(Xlt,{present:o||i.open,children:t.jsx(FEt.Slot,{scope:e.__scopeMenu,children:t.jsx(sNt,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;l.isUsingKeyboardRef.current&&(null==(t=u.current)||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:ult(e.onFocusOutside,e=>{e.target!==c.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:ult(e.onEscapeKeyDown,e=>{l.onClose(),e.preventDefault()}),onKeyDown:ult(e.onKeyDown,e=>{var t;const r=e.currentTarget.contains(e.target),n=AEt[l.dir].includes(e.key);r&&n&&(i.onOpenChange(!1),null==(t=c.trigger)||t.focus(),e.preventDefault())})})})})})});function NNt(e){return e?"open":"closed"}function zNt(e){return"indeterminate"===e}function ANt(e){return zNt(e)?"indeterminate":e?"checked":"unchecked"}function RNt(e){return t=>"mouse"===t.pointerType?e(t):void 0}ENt.displayName=TNt;var FNt=ZEt,LNt=KEt,BNt=JEt,VNt=nNt,INt=lNt,qNt=cNt,$Nt=pNt,HNt=fNt,WNt=gNt,UNt=bNt,YNt=MNt,ZNt=CNt,KNt=jNt,GNt=PNt,XNt=ENt,QNt="DropdownMenu",[JNt,ezt]=flt(QNt,[IEt]),tzt=IEt(),[rzt,nzt]=JNt(QNt),ozt=e=>{const{__scopeDropdownMenu:r,children:n,dir:o,open:a,defaultOpen:i,onOpenChange:l,modal:c=!0}=e,u=tzt(r),d=s.useRef(null),[p,h]=klt({prop:a,defaultProp:i??!1,onChange:l,caller:QNt});return t.jsx(rzt,{scope:r,triggerId:xlt(),triggerRef:d,contentId:xlt(),open:p,onOpenChange:h,onOpenToggle:s.useCallback(()=>h(e=>!e),[h]),modal:c,children:t.jsx(FNt,{...u,open:p,onOpenChange:h,dir:o,modal:c,children:n})})};ozt.displayName=QNt;var azt="DropdownMenuTrigger",izt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...a}=e,i=nzt(azt,n),s=tzt(n);return t.jsx(LNt,{asChild:!0,...s,children:t.jsx(Olt.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...a,ref:plt(r,i.triggerRef),onPointerDown:ult(e.onPointerDown,e=>{!o&&0===e.button&&!1===e.ctrlKey&&(i.onOpenToggle(),i.open||e.preventDefault())}),onKeyDown:ult(e.onKeyDown,e=>{o||(["Enter"," "].includes(e.key)&&i.onOpenToggle(),"ArrowDown"===e.key&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});izt.displayName=azt;var szt=e=>{const{__scopeDropdownMenu:r,...n}=e,o=tzt(r);return t.jsx(BNt,{...o,...n})};szt.displayName="DropdownMenuPortal";var lzt="DropdownMenuContent",czt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=nzt(lzt,n),i=tzt(n),l=s.useRef(!1);return t.jsx(VNt,{id:a.contentId,"aria-labelledby":a.triggerId,...i,...o,ref:r,onCloseAutoFocus:ult(e.onCloseAutoFocus,e=>{var t;l.current||null==(t=a.triggerRef.current)||t.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:ult(e.onInteractOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!a.modal||n)&&(l.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});czt.displayName=lzt;var uzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(INt,{...a,...o,ref:r})});uzt.displayName="DropdownMenuGroup";var dzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(qNt,{...a,...o,ref:r})});dzt.displayName="DropdownMenuLabel";var pzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx($Nt,{...a,...o,ref:r})});pzt.displayName="DropdownMenuItem";var hzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(HNt,{...a,...o,ref:r})});hzt.displayName="DropdownMenuCheckboxItem";var fzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(WNt,{...a,...o,ref:r})});fzt.displayName="DropdownMenuRadioGroup";var mzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(UNt,{...a,...o,ref:r})});mzt.displayName="DropdownMenuRadioItem";var vzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(YNt,{...a,...o,ref:r})});vzt.displayName="DropdownMenuItemIndicator";var yzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(ZNt,{...a,...o,ref:r})});yzt.displayName="DropdownMenuSeparator";var gzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(KNt,{...a,...o,ref:r})});gzt.displayName="DropdownMenuArrow";var xzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(GNt,{...a,...o,ref:r})});xzt.displayName="DropdownMenuSubTrigger";var bzt=s.forwardRef((e,r)=>{const{__scopeDropdownMenu:n,...o}=e,a=tzt(n);return t.jsx(XNt,{...a,...o,ref:r,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});bzt.displayName="DropdownMenuSubContent";var kzt=szt,_zt=czt,wzt=dzt,Mzt=pzt,Czt=hzt,jzt=mzt,Dzt=vzt,Ozt=yzt,Szt=xzt,Pzt=bzt;const Tzt=ozt,Ezt=izt,Nzt=s.forwardRef(({className:e,inset:r,children:n,...o},a)=>t.jsxs(Szt,{ref:a,className:zdt("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",e),...o,children:[n,t.jsx(Yst,{className:"ml-auto"})]}));Nzt.displayName=Szt.displayName;const zzt=s.forwardRef(({className:e,...r},n)=>t.jsx(Pzt,{ref:n,className:zdt("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...r}));zzt.displayName=Pzt.displayName;const Azt=s.forwardRef(({className:e,sideOffset:r=4,...n},o)=>t.jsx(kzt,{children:t.jsx(_zt,{ref:o,sideOffset:r,className:zdt("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Azt.displayName=_zt.displayName;const Rzt=s.forwardRef(({className:e,inset:r,...n},o)=>t.jsx(Mzt,{ref:o,className:zdt("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",r&&"pl-8",e),...n}));Rzt.displayName=Mzt.displayName;const Fzt=s.forwardRef(({className:e,children:r,checked:n,...o},a)=>t.jsxs(Czt,{ref:a,className:zdt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Dzt,{children:t.jsx(Hst,{className:"h-4 w-4"})})}),r]}));Fzt.displayName=Czt.displayName;const Lzt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs(jzt,{ref:o,className:zdt("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(Dzt,{children:t.jsx(Xst,{className:"h-2 w-2 fill-current"})})}),r]}));Lzt.displayName=jzt.displayName;const Bzt=s.forwardRef(({className:e,inset:r,...n},o)=>t.jsx(wzt,{ref:o,className:zdt("px-2 py-1.5 text-sm font-semibold",r&&"pl-8",e),...n}));Bzt.displayName=wzt.displayName;const Vzt=s.forwardRef(({className:e,...r},n)=>t.jsx(Ozt,{ref:n,className:zdt("-mx-1 my-1 h-px bg-muted",e),...r}));Vzt.displayName=Ozt.displayName;const Izt=({isFilterOpen:e,setIsFilterOpen:r,selectedColors:n,toggleColorSelection:o,currentConfig:a})=>t.jsxs(Tzt,{open:e,onOpenChange:r,children:[t.jsx(Ezt,{asChild:!0,children:t.jsx($ht,{variant:"outline",size:"sm",className:"w-20 overflow-hidden",children:t.jsx(fbt,{mode:"wait",children:t.jsxs(rOt.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:[t.jsx(elt,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"text-xs font-medium",children:e?a.localization.filtering:a.localization.filter})]},e?"open":"closed")})})}),t.jsxs(Azt,{children:[t.jsx(Bzt,{children:a.localization.filterByColor}),t.jsx(Vzt,{}),Bat.map(e=>t.jsx(Fzt,{checked:n.includes(e.value),onCheckedChange:()=>o(e.value),onSelect:e=>{e.preventDefault()},children:t.jsxs("div",{className:"flex items-center",children:[t.jsx("div",{className:`w-4 h-4 rounded-full mr-2 ${e.class}`}),e.label]})},e.value)),t.jsx(Vzt,{}),t.jsx($ht,{variant:"ghost",size:"sm",onClick:()=>r(!1),className:"w-full justify-center h-8 text-sm",children:a.localization.close})]})]});function qzt(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}var $zt=["color"],Hzt=e.forwardRef(function(t,r){var n=t.color,o=void 0===n?"currentColor":n,a=qzt(t,$zt);return e.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),e.createElement("path",{d:"M4.5 1C4.77614 1 5 1.22386 5 1.5V2H10V1.5C10 1.22386 10.2239 1 10.5 1C10.7761 1 11 1.22386 11 1.5V2H12.5C13.3284 2 14 2.67157 14 3.5V12.5C14 13.3284 13.3284 14 12.5 14H2.5C1.67157 14 1 13.3284 1 12.5V3.5C1 2.67157 1.67157 2 2.5 2H4V1.5C4 1.22386 4.22386 1 4.5 1ZM10 3V3.5C10 3.77614 10.2239 4 10.5 4C10.7761 4 11 3.77614 11 3.5V3H12.5C12.7761 3 13 3.22386 13 3.5V5H2V3.5C2 3.22386 2.22386 3 2.5 3H4V3.5C4 3.77614 4.22386 4 4.5 4C4.77614 4 5 3.77614 5 3.5V3H10ZM2 6V12.5C2 12.7761 2.22386 13 2.5 13H12.5C12.7761 13 13 12.7761 13 12.5V6H2ZM7 7.5C7 7.22386 7.22386 7 7.5 7C7.77614 7 8 7.22386 8 7.5C8 7.77614 7.77614 8 7.5 8C7.22386 8 7 7.77614 7 7.5ZM9.5 7C9.22386 7 9 7.22386 9 7.5C9 7.77614 9.22386 8 9.5 8C9.77614 8 10 7.77614 10 7.5C10 7.22386 9.77614 7 9.5 7ZM11 7.5C11 7.22386 11.2239 7 11.5 7C11.7761 7 12 7.22386 12 7.5C12 7.77614 11.7761 8 11.5 8C11.2239 8 11 7.77614 11 7.5ZM11.5 9C11.2239 9 11 9.22386 11 9.5C11 9.77614 11.2239 10 11.5 10C11.7761 10 12 9.77614 12 9.5C12 9.22386 11.7761 9 11.5 9ZM9 9.5C9 9.22386 9.22386 9 9.5 9C9.77614 9 10 9.22386 10 9.5C10 9.77614 9.77614 10 9.5 10C9.22386 10 9 9.77614 9 9.5ZM7.5 9C7.22386 9 7 9.22386 7 9.5C7 9.77614 7.22386 10 7.5 10C7.77614 10 8 9.77614 8 9.5C8 9.22386 7.77614 9 7.5 9ZM5 9.5C5 9.22386 5.22386 9 5.5 9C5.77614 9 6 9.22386 6 9.5C6 9.77614 5.77614 10 5.5 10C5.22386 10 5 9.77614 5 9.5ZM3.5 9C3.22386 9 3 9.22386 3 9.5C3 9.77614 3.22386 10 3.5 10C3.77614 10 4 9.77614 4 9.5C4 9.22386 3.77614 9 3.5 9ZM3 11.5C3 11.2239 3.22386 11 3.5 11C3.77614 11 4 11.2239 4 11.5C4 11.7761 3.77614 12 3.5 12C3.22386 12 3 11.7761 3 11.5ZM5.5 11C5.22386 11 5 11.2239 5 11.5C5 11.7761 5.22386 12 5.5 12C5.77614 12 6 11.7761 6 11.5C6 11.2239 5.77614 11 5.5 11ZM7 11.5C7 11.2239 7.22386 11 7.5 11C7.77614 11 8 11.2239 8 11.5C8 11.7761 7.77614 12 7.5 12C7.22386 12 7 11.7761 7 11.5ZM9.5 11C9.22386 11 9 11.2239 9 11.5C9 11.7761 9.22386 12 9.5 12C9.77614 12 10 11.7761 10 11.5C10 11.2239 9.77614 11 9.5 11Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),Wzt=["color"],Uzt=e.forwardRef(function(t,r){var n=t.color,o=void 0===n?"currentColor":n,a=qzt(t,Wzt);return e.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),e.createElement("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),Yzt=["color"],Zzt=e.forwardRef(function(t,r){var n=t.color,o=void 0===n?"currentColor":n,a=qzt(t,Yzt);return e.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},a,{ref:r}),e.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:o,fillRule:"evenodd",clipRule:"evenodd"}))}),Kzt=.999,Gzt=/[\\\/_+.#"@\[\(\{&]/,Xzt=/[\\\/_+.#"@\[\(\{&]/g,Qzt=/[\s-]/,Jzt=/[\s-]/g;function eAt(e,t,r,n,o,a,i){if(a===t.length)return o===e.length?1:.99;var s=`${o},${a}`;if(void 0!==i[s])return i[s];for(var l,c,u,d,p=n.charAt(a),h=r.indexOf(p,o),f=0;h>=0;)(l=eAt(e,t,r,n,h+1,a+1,i))>f&&(h===o?l*=1:Gzt.test(e.charAt(h-1))?(l*=.8,(u=e.slice(o,h-1).match(Xzt))&&o>0&&(l*=Math.pow(Kzt,u.length))):Qzt.test(e.charAt(h-1))?(l*=.9,(d=e.slice(o,h-1).match(Jzt))&&o>0&&(l*=Math.pow(Kzt,d.length))):(l*=.17,o>0&&(l*=Math.pow(Kzt,h-o))),e.charAt(h)!==t.charAt(a)&&(l*=.9999)),(l<.1&&r.charAt(h-1)===n.charAt(a+1)||n.charAt(a+1)===n.charAt(a)&&r.charAt(h-1)!==n.charAt(a))&&(.1*(c=eAt(e,t,r,n,h+1,a+2,i))>l&&(l=.1*c)),l>f&&(f=l),h=r.indexOf(p,h+1);return i[s]=f,f}function tAt(e){return e.toLowerCase().replace(Jzt," ")}function rAt(e,t,r){return eAt(e=r&&r.length>0?""+(e+" "+r.join(" ")):e,t,tAt(e),tAt(t),0,0,{})}function nAt(){return nAt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nAt.apply(null,arguments)}function oAt(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(null==e||e(n),!1===r||!n.defaultPrevented)return null==t?void 0:t(n)}}function aAt(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}function iAt(...t){return e.useCallback(aAt(...t),t)}function sAt(...t){const r=t[0];if(1===t.length)return r;const n=()=>{const n=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const o=n.reduce((e,{useScope:r,scopeName:n})=>({...e,...r(t)[`__scope${n}`]}),{});return e.useMemo(()=>({[`__scope${r.scopeName}`]:o}),[o])}};return n.scopeName=r.scopeName,n}const lAt=null!=globalThis&&globalThis.document?e.useLayoutEffect:()=>{},cAt=s.useId||(()=>{});let uAt=0;function dAt(e){const[t,r]=s.useState(cAt());return lAt(()=>{r(e=>e??String(uAt++))},[e]),e||(t?`radix-${t}`:"")}function pAt(t){const r=e.useRef(t);return e.useEffect(()=>{r.current=t}),e.useMemo(()=>(...e)=>{var t;return null===(t=r.current)||void 0===t?void 0:t.call(r,...e)},[])}function hAt({prop:t,defaultProp:r,onChange:n=()=>{}}){const[o,a]=function({defaultProp:t,onChange:r}){const n=e.useState(t),[o]=n,a=e.useRef(o),i=pAt(r);return e.useEffect(()=>{a.current!==o&&(i(o),a.current=o)},[o,a,i]),n}({defaultProp:r,onChange:n}),i=void 0!==t,s=i?t:o,l=pAt(n),c=e.useCallback(e=>{if(i){const r="function"==typeof e?e(t):e;r!==t&&l(r)}else a(e)},[i,t,a,l]);return[s,c]}const fAt=e.forwardRef((t,r)=>{const{children:n,...o}=t,a=e.Children.toArray(n),i=a.find(yAt);if(i){const t=i.props.children,n=a.map(r=>r===i?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:r);return e.createElement(mAt,nAt({},o,{ref:r}),e.isValidElement(t)?e.cloneElement(t,void 0,n):null)}return e.createElement(mAt,nAt({},o,{ref:r}),n)});fAt.displayName="Slot";const mAt=e.forwardRef((t,r)=>{const{children:n,...o}=t;return e.isValidElement(n)?e.cloneElement(n,{...gAt(o,n.props),ref:r?aAt(r,n.ref):n.ref}):e.Children.count(n)>1?e.Children.only(null):null});mAt.displayName="SlotClone";const vAt=({children:t})=>e.createElement(e.Fragment,null,t);function yAt(t){return e.isValidElement(t)&&t.type===vAt}function gAt(e,t){const r={...t};for(const n in t){const o=e[n],a=t[n];/^on[A-Z]/.test(n)?o&&a?r[n]=(...e)=>{a(...e),o(...e)}:o&&(r[n]=o):"style"===n?r[n]={...o,...a}:"className"===n&&(r[n]=[o,a].filter(Boolean).join(" "))}return{...e,...r}}const xAt=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((t,r)=>{const n=e.forwardRef((t,n)=>{const{asChild:o,...a}=t,i=o?fAt:r;return e.useEffect(()=>{window[Symbol.for("radix-ui")]=!0},[]),e.createElement(i,nAt({},a,{ref:n}))});return n.displayName=`Primitive.${r}`,{...t,[r]:n}},{});const bAt="dismissableLayer.update",kAt="dismissableLayer.pointerDownOutside",_At="dismissableLayer.focusOutside";let wAt;const MAt=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),CAt=e.forwardRef((t,r)=>{var n;const{disableOutsidePointerEvents:o=!1,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:s,onInteractOutside:l,onDismiss:c,...u}=t,d=e.useContext(MAt),[p,h]=e.useState(null),f=null!==(n=null==p?void 0:p.ownerDocument)&&void 0!==n?n:null==globalThis?void 0:globalThis.document,[,m]=e.useState({}),v=iAt(r,e=>h(e)),y=Array.from(d.layers),[g]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),x=y.indexOf(g),b=p?y.indexOf(p):-1,k=d.layersWithOutsidePointerEventsDisabled.size>0,_=b>=x,w=function(t,r=(null==globalThis?void 0:globalThis.document)){const n=pAt(t),o=e.useRef(!1),a=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let t=function(){DAt(kAt,n,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",a.current),a.current=t,r.addEventListener("click",a.current,{once:!0})):t()}else r.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",a.current)}},[r,n]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,r=[...d.branches].some(e=>e.contains(t));!_||r||(null==i||i(e),null==l||l(e),e.defaultPrevented||null==c||c())},f),M=function(t,r=(null==globalThis?void 0:globalThis.document)){const n=pAt(t),o=e.useRef(!1);return e.useEffect(()=>{const e=e=>{e.target&&!o.current&&DAt(_At,n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...d.branches].some(e=>e.contains(t))||(null==s||s(e),null==l||l(e),e.defaultPrevented||null==c||c())},f);return function(t,r=(null==globalThis?void 0:globalThis.document)){const n=pAt(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&n(e)};return r.addEventListener("keydown",e),()=>r.removeEventListener("keydown",e)},[n,r])}(e=>{b===d.layers.size-1&&(null==a||a(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))},f),e.useEffect(()=>{if(p)return o&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(wAt=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),jAt(),()=>{o&&1===d.layersWithOutsidePointerEventsDisabled.size&&(f.body.style.pointerEvents=wAt)}},[p,f,o,d]),e.useEffect(()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),jAt())},[p,d]),e.useEffect(()=>{const e=()=>m({});return document.addEventListener(bAt,e),()=>document.removeEventListener(bAt,e)},[]),e.createElement(xAt.div,nAt({},u,{ref:v,style:{pointerEvents:k?_?"auto":"none":void 0,...t.style},onFocusCapture:oAt(t.onFocusCapture,M.onFocusCapture),onBlurCapture:oAt(t.onBlurCapture,M.onBlurCapture),onPointerDownCapture:oAt(t.onPointerDownCapture,w.onPointerDownCapture)}))});function jAt(){const e=new CustomEvent(bAt);document.dispatchEvent(e)}function DAt(e,t,n,{discrete:o}){const a=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),o?function(e,t){e&&r.flushSync(()=>e.dispatchEvent(t))}(a,i):a.dispatchEvent(i)}const OAt="focusScope.autoFocusOnMount",SAt="focusScope.autoFocusOnUnmount",PAt={bubbles:!1,cancelable:!0},TAt=e.forwardRef((t,r)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=t,[l,c]=e.useState(null),u=pAt(a),d=pAt(i),p=e.useRef(null),h=iAt(r,e=>c(e)),f=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(o){let e=function(e){if(f.paused||!l)return;const t=e.target;l.contains(t)?p.current=t:AAt(p.current,{select:!0})},t=function(e){if(f.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||AAt(p.current,{select:!0}))},r=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&AAt(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const n=new MutationObserver(r);return l&&n.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),n.disconnect()}}},[o,l,f.paused]),e.useEffect(()=>{if(l){RAt.add(f);const e=document.activeElement;if(!l.contains(e)){const t=new CustomEvent(OAt,PAt);l.addEventListener(OAt,u),l.dispatchEvent(t),t.defaultPrevented||(function(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(AAt(n,{select:t}),document.activeElement!==r)return}(function(e){return e.filter(e=>"A"!==e.tagName)}(EAt(l)),{select:!0}),document.activeElement===e&&AAt(l))}return()=>{l.removeEventListener(OAt,u),setTimeout(()=>{const t=new CustomEvent(SAt,PAt);l.addEventListener(SAt,d),l.dispatchEvent(t),t.defaultPrevented||AAt(e??document.body,{select:!0}),l.removeEventListener(SAt,d),RAt.remove(f)},0)}}},[l,u,d,f]);const m=e.useCallback(e=>{if(!n&&!o||f.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,r=document.activeElement;if(t&&r){const t=e.currentTarget,[o,a]=function(e){const t=EAt(e),r=NAt(t,e),n=NAt(t.reverse(),e);return[r,n]}(t);o&&a?e.shiftKey||r!==a?e.shiftKey&&r===o&&(e.preventDefault(),n&&AAt(a,{select:!0})):(e.preventDefault(),n&&AAt(o,{select:!0})):r===t&&e.preventDefault()}},[n,o,f.paused]);return e.createElement(xAt.div,nAt({tabIndex:-1},s,{ref:h,onKeyDown:m}))});function EAt(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function NAt(e,t){for(const r of e)if(!zAt(r,{upTo:t}))return r}function zAt(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function AAt(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}const RAt=function(){let e=[];return{add(t){const r=e[0];t!==r&&(null==r||r.pause()),e=FAt(e,t),e.unshift(t)},remove(t){var r;e=FAt(e,t),null===(r=e[0])||void 0===r||r.resume()}}}();function FAt(e,t){const r=[...e],n=r.indexOf(t);return-1!==n&&r.splice(n,1),r}const LAt=e.forwardRef((t,r)=>{var n;const{container:o=(null==globalThis||null===(n=globalThis.document)||void 0===n?void 0:n.body),...a}=t;return o?u.default.createPortal(e.createElement(xAt.div,nAt({},a,{ref:r})),o):null});const BAt=t=>{const{present:n,children:o}=t,a=function(t){const[n,o]=e.useState(),a=e.useRef({}),i=e.useRef(t),s=e.useRef("none"),l=t?"mounted":"unmounted",[c,u]=function(t,r){return e.useReducer((e,t)=>r[e][t]??e,t)}(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=VAt(a.current);s.current="mounted"===c?e:"none"},[c]),lAt(()=>{const e=a.current,r=i.current;if(r!==t){const n=s.current,o=VAt(e);t?u("MOUNT"):"none"===o||"none"===(null==e?void 0:e.display)?u("UNMOUNT"):u(r&&n!==o?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,u]),lAt(()=>{if(n){const e=e=>{const t=VAt(a.current).includes(e.animationName);e.target===n&&t&&r.flushSync(()=>u("ANIMATION_END"))},t=e=>{e.target===n&&(s.current=VAt(a.current))};return n.addEventListener("animationstart",t),n.addEventListener("animationcancel",e),n.addEventListener("animationend",e),()=>{n.removeEventListener("animationstart",t),n.removeEventListener("animationcancel",e),n.removeEventListener("animationend",e)}}u("ANIMATION_END")},[n,u]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:e.useCallback(e=>{e&&(a.current=getComputedStyle(e)),o(e)},[])}}(n),i="function"==typeof o?o({present:a.isPresent}):e.Children.only(o),s=iAt(a.ref,i.ref);return"function"==typeof o||a.isPresent?e.cloneElement(i,{ref:s}):null};function VAt(e){return(null==e?void 0:e.animationName)||"none"}BAt.displayName="Presence";let IAt=0;function qAt(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}var $At=pct(),HAt=function(){},WAt=s.forwardRef(function(e,t){var r=s.useRef(null),n=s.useState({onScrollCapture:HAt,onWheelCapture:HAt,onTouchMoveCapture:HAt}),o=n[0],a=n[1],i=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,p=e.shards,h=e.sideCar,f=e.noIsolation,m=e.inert,v=e.allowPinchZoom,y=e.as,g=void 0===y?"div":y,x=nct(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as"]),b=h,k=uct([r,t]),_=rct(rct({},x),o);return s.createElement(s.Fragment,null,d&&s.createElement(b,{sideCar:$At,removeScrollBar:u,shards:p,noIsolation:f,inert:m,setCallbacks:a,allowPinchZoom:!!v,lockRef:r}),i?s.cloneElement(s.Children.only(l),rct(rct({},_),{ref:k})):s.createElement(g,rct({},_,{className:c,ref:k}),l))});WAt.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},WAt.classNames={fullWidth:ict,zeroRight:act};var UAt=!1;if(typeof window<"u")try{var YAt=Object.defineProperty({},"passive",{get:function(){return UAt=!0,!0}});window.addEventListener("test",YAt,YAt),window.removeEventListener("test",YAt,YAt)}catch{UAt=!1}var ZAt=!!UAt&&{passive:!1},KAt=function(e,t){var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===r[t])},GAt=function(e,t){var r=t;do{if(typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host),XAt(e,r)){var n=QAt(e,r);if(n[1]>n[2])return!0}r=r.parentNode}while(r&&r!==document.body);return!1},XAt=function(e,t){return"v"===e?function(e){return KAt(e,"overflowY")}(t):function(e){return KAt(e,"overflowX")}(t)},QAt=function(e,t){return"v"===e?function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]}(t):function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t)},JAt=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},eRt=function(e){return[e.deltaX,e.deltaY]},tRt=function(e){return e&&"current"in e?e.current:e},rRt=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},nRt=0,oRt=[];const aRt=fct($At,function(e){var t=s.useRef([]),r=s.useRef([0,0]),n=s.useRef(),o=s.useState(nRt++)[0],a=s.useState(function(){return bct()})[0],i=s.useRef(e);s.useEffect(function(){i.current=e},[e]),s.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=oct([e.lockRef.current],(e.shards||[]).map(tRt),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),t.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=s.useCallback(function(e,t){if("touches"in e&&2===e.touches.length)return!i.current.allowPinchZoom;var o,a=JAt(e),s=r.current,l="deltaX"in e?e.deltaX:s[0]-a[0],c="deltaY"in e?e.deltaY:s[1]-a[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var p=GAt(d,u);if(!p)return!0;if(p?o=d:(o="v"===d?"h":"v",p=GAt(d,u)),!p)return!1;if(!n.current&&"changedTouches"in e&&(l||c)&&(n.current=o),!o)return!0;var h=n.current||o;return function(e,t,r,n){var o=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=o*n,i=r.target,s=t.contains(i),l=!1,c=a>0,u=0,d=0;do{var p=QAt(e,i),h=p[0],f=p[1]-p[2]-o*h;(h||f)&&XAt(e,i)&&(u+=f,d+=h),i=i.parentNode}while(!s&&i!==document.body||s&&(t.contains(i)||t===i));return(c&&0===u||!c&&0===d)&&(l=!0),l}(h,t,e,"h"===h?l:c)},[]),c=s.useCallback(function(e){var r=e;if(oRt.length&&oRt[oRt.length-1]===a){var n="deltaY"in r?eRt(r):JAt(r),o=t.current.filter(function(e){return e.name===r.type&&e.target===r.target&&function(e,t){return e[0]===t[0]&&e[1]===t[1]}(e.delta,n)})[0];if(o&&o.should)return void(r.cancelable&&r.preventDefault());if(!o){var s=(i.current.shards||[]).map(tRt).filter(Boolean).filter(function(e){return e.contains(r.target)});(s.length>0?l(r,s[0]):!i.current.noIsolation)&&r.cancelable&&r.preventDefault()}}},[]),u=s.useCallback(function(e,r,n,o){var a={name:e,delta:r,target:n,should:o};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),d=s.useCallback(function(e){r.current=JAt(e),n.current=void 0},[]),p=s.useCallback(function(t){u(t.type,eRt(t),t.target,l(t,e.lockRef.current))},[]),h=s.useCallback(function(t){u(t.type,JAt(t),t.target,l(t,e.lockRef.current))},[]);s.useEffect(function(){return oRt.push(a),e.setCallbacks({onScrollCapture:p,onWheelCapture:p,onTouchMoveCapture:h}),document.addEventListener("wheel",c,ZAt),document.addEventListener("touchmove",c,ZAt),document.addEventListener("touchstart",d,ZAt),function(){oRt=oRt.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,ZAt),document.removeEventListener("touchmove",c,ZAt),document.removeEventListener("touchstart",d,ZAt)}},[]);var f=e.removeScrollBar,m=e.inert;return s.createElement(s.Fragment,null,m?s.createElement(a,{styles:rRt(o)}):null,f?s.createElement(Oct,{gapMode:"margin"}):null)});var iRt=s.forwardRef(function(e,t){return s.createElement(WAt,rct({},e,{ref:t,sideCar:aRt}))});iRt.classNames=WAt.classNames;const sRt="Dialog",[lRt,cRt]=function(t,r=[]){let n=[];const o=()=>{const r=n.map(t=>e.createContext(t));return function(n){const o=(null==n?void 0:n[t])||r;return e.useMemo(()=>({[`__scope${t}`]:{...n,[t]:o}}),[n,o])}};return o.scopeName=t,[function(r,o){const a=e.createContext(o),i=n.length;function s(r){const{scope:n,children:o,...s}=r,l=(null==n?void 0:n[t][i])||a,c=e.useMemo(()=>s,Object.values(s));return e.createElement(l.Provider,{value:c},o)}return n=[...n,o],s.displayName=r+"Provider",[s,function(n,s){const l=(null==s?void 0:s[t][i])||a,c=e.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${n}\` must be used within \`${r}\``)}]},sAt(o,...r)]}(sRt),[uRt,dRt]=lRt(sRt),pRt="DialogPortal",[hRt,fRt]=lRt(pRt,{forceMount:void 0}),mRt="DialogOverlay",vRt=e.forwardRef((t,r)=>{const n=fRt(mRt,t.__scopeDialog),{forceMount:o=n.forceMount,...a}=t,i=dRt(mRt,t.__scopeDialog);return i.modal?e.createElement(BAt,{present:o||i.open},e.createElement(yRt,nAt({},a,{ref:r}))):null}),yRt=e.forwardRef((t,r)=>{const{__scopeDialog:n,...o}=t,a=dRt(mRt,n);return e.createElement(iRt,{as:fAt,allowPinchZoom:!0,shards:[a.contentRef]},e.createElement(xAt.div,nAt({"data-state":wRt(a.open)},o,{ref:r,style:{pointerEvents:"auto",...o.style}})))}),gRt="DialogContent",xRt=e.forwardRef((t,r)=>{const n=fRt(gRt,t.__scopeDialog),{forceMount:o=n.forceMount,...a}=t,i=dRt(gRt,t.__scopeDialog);return e.createElement(BAt,{present:o||i.open},i.modal?e.createElement(bRt,nAt({},a,{ref:r})):e.createElement(kRt,nAt({},a,{ref:r})))}),bRt=e.forwardRef((t,r)=>{const n=dRt(gRt,t.__scopeDialog),o=e.useRef(null),a=iAt(r,n.contentRef,o);return e.useEffect(()=>{const e=o.current;if(e)return Xct(e)},[]),e.createElement(_Rt,nAt({},t,{ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:oAt(t.onCloseAutoFocus,e=>{var t;e.preventDefault(),null===(t=n.triggerRef.current)||void 0===t||t.focus()}),onPointerDownOutside:oAt(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:oAt(t.onFocusOutside,e=>e.preventDefault())}))}),kRt=e.forwardRef((t,r)=>{const n=dRt(gRt,t.__scopeDialog),o=e.useRef(!1),a=e.useRef(!1);return e.createElement(_Rt,nAt({},t,{ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{var r,i;(null===(r=t.onCloseAutoFocus)||void 0===r||r.call(t,e),e.defaultPrevented)||(o.current||null===(i=n.triggerRef.current)||void 0===i||i.focus(),e.preventDefault());o.current=!1,a.current=!1},onInteractOutside:e=>{var r,i;null===(r=t.onInteractOutside)||void 0===r||r.call(t,e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const s=e.target;(null===(i=n.triggerRef.current)||void 0===i?void 0:i.contains(s))&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}}))}),_Rt=e.forwardRef((t,r)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=t,l=dRt(gRt,n),c=iAt(r,e.useRef(null));return e.useEffect(()=>{var e,t;const r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=r[0])&&void 0!==e?e:qAt()),document.body.insertAdjacentElement("beforeend",null!==(t=r[1])&&void 0!==t?t:qAt()),IAt++,()=>{1===IAt&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),IAt--}},[]),e.createElement(e.Fragment,null,e.createElement(TAt,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i},e.createElement(CAt,nAt({role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":wRt(l.open)},s,{ref:c,onDismiss:()=>l.onOpenChange(!1)}))),!1)});function wRt(e){return e?"open":"closed"}const MRt=t=>{const{__scopeDialog:r,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=t,l=e.useRef(null),c=e.useRef(null),[u=!1,d]=hAt({prop:o,defaultProp:a,onChange:i});return e.createElement(uRt,{scope:r,triggerRef:l,contentRef:c,contentId:dAt(),titleId:dAt(),descriptionId:dAt(),open:u,onOpenChange:d,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),modal:s},n)},CRt=t=>{const{__scopeDialog:r,forceMount:n,children:o,container:a}=t,i=dRt(pRt,r);return e.createElement(hRt,{scope:r,forceMount:n},e.Children.map(o,t=>e.createElement(BAt,{present:n||i.open},e.createElement(LAt,{asChild:!0,container:a},t))))},jRt=vRt,DRt=xRt;var ORt='[cmdk-group=""]',SRt='[cmdk-group-items=""]',PRt='[cmdk-item=""]',TRt=`${PRt}:not([aria-disabled="true"])`,ERt="cmdk-item-select",NRt="data-value",zRt=(e,t,r)=>rAt(e,t,r),ARt=s.createContext(void 0),RRt=()=>s.useContext(ARt),FRt=s.createContext(void 0),LRt=()=>s.useContext(FRt),BRt=s.createContext(void 0),VRt=s.forwardRef((e,t)=>{let r=eFt(()=>{var t,r;return{search:"",value:null!=(r=null!=(t=e.value)?t:e.defaultValue)?r:"",filtered:{count:0,items:new Map,groups:new Set}}}),n=eFt(()=>new Set),o=eFt(()=>new Map),a=eFt(()=>new Map),i=eFt(()=>new Set),l=QRt(e),{label:c,children:u,value:d,onValueChange:p,filter:h,shouldFilter:f,loop:m,disablePointerSelection:v=!1,vimBindings:y=!0,...g}=e,x=s.useId(),b=s.useId(),k=s.useId(),_=s.useRef(null),w=oFt();JRt(()=>{if(void 0!==d){let e=d.trim();r.current.value=e,M.emit()}},[d]),JRt(()=>{w(6,P)},[]);let M=s.useMemo(()=>({subscribe:e=>(i.current.add(e),()=>i.current.delete(e)),snapshot:()=>r.current,setState:(e,t,n)=>{var o,a,i;if(!Object.is(r.current[e],t)){if(r.current[e]=t,"search"===e)S(),D(),w(1,O);else if("value"===e&&(n||w(5,P),void 0!==(null==(o=l.current)?void 0:o.value))){let e=t??"";return void(null==(i=(a=l.current).onValueChange)||i.call(a,e))}M.emit()}},emit:()=>{i.current.forEach(e=>e())}}),[]),C=s.useMemo(()=>({value:(e,t,n)=>{var o;t!==(null==(o=a.current.get(e))?void 0:o.value)&&(a.current.set(e,{value:t,keywords:n}),r.current.filtered.items.set(e,j(t,n)),w(2,()=>{D(),M.emit()}))},item:(e,t)=>(n.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),w(3,()=>{S(),D(),r.current.value||O(),M.emit()}),()=>{a.current.delete(e),n.current.delete(e),r.current.filtered.items.delete(e);let t=T();w(4,()=>{S(),(null==t?void 0:t.getAttribute("id"))===e&&O(),M.emit()})}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{a.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],disablePointerSelection:v,listId:x,inputId:k,labelId:b,listInnerRef:_}),[]);function j(e,t){var n,o;let a=null!=(o=null==(n=l.current)?void 0:n.filter)?o:zRt;return e?a(e,r.current.search,t):0}function D(){if(!r.current.search||!1===l.current.shouldFilter)return;let e=r.current.filtered.items,t=[];r.current.filtered.groups.forEach(r=>{let n=o.current.get(r),a=0;n.forEach(t=>{let r=e.get(t);a=Math.max(r,a)}),t.push([r,a])});let n=_.current;E().sort((t,r)=>{var n,o;let a=t.getAttribute("id"),i=r.getAttribute("id");return(null!=(n=e.get(i))?n:0)-(null!=(o=e.get(a))?o:0)}).forEach(e=>{let t=e.closest(SRt);t?t.appendChild(e.parentElement===t?e:e.closest(`${SRt} > *`)):n.appendChild(e.parentElement===n?e:e.closest(`${SRt} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=_.current.querySelector(`${ORt}[${NRt}="${encodeURIComponent(e[0])}"]`);null==t||t.parentElement.appendChild(t)})}function O(){let e=E().find(e=>"true"!==e.getAttribute("aria-disabled")),t=null==e?void 0:e.getAttribute(NRt);M.setState("value",t||void 0)}function S(){var e,t,i,s;if(!r.current.search||!1===l.current.shouldFilter)return void(r.current.filtered.count=n.current.size);r.current.filtered.groups=new Set;let c=0;for(let o of n.current){let n=j(null!=(t=null==(e=a.current.get(o))?void 0:e.value)?t:"",null!=(s=null==(i=a.current.get(o))?void 0:i.keywords)?s:[]);r.current.filtered.items.set(o,n),n>0&&c++}for(let[e,t]of o.current)for(let n of t)if(r.current.filtered.items.get(n)>0){r.current.filtered.groups.add(e);break}r.current.filtered.count=c}function P(){var e,t,r;let n=T();n&&((null==(e=n.parentElement)?void 0:e.firstChild)===n&&(null==(r=null==(t=n.closest(ORt))?void 0:t.querySelector('[cmdk-group-heading=""]'))||r.scrollIntoView({block:"nearest"})),n.scrollIntoView({block:"nearest"}))}function T(){var e;return null==(e=_.current)?void 0:e.querySelector(`${PRt}[aria-selected="true"]`)}function E(){var e;return Array.from(null==(e=_.current)?void 0:e.querySelectorAll(TRt))}function N(e){let t=E()[e];t&&M.setState("value",t.getAttribute(NRt))}function z(e){var t;let r=T(),n=E(),o=n.findIndex(e=>e===r),a=n[o+e];null!=(t=l.current)&&t.loop&&(a=o+e<0?n[n.length-1]:o+e===n.length?n[0]:n[o+e]),a&&M.setState("value",a.getAttribute(NRt))}function A(e){let t,r=T(),n=null==r?void 0:r.closest(ORt);for(;n&&!t;)n=e>0?GRt(n,ORt):XRt(n,ORt),t=null==n?void 0:n.querySelector(TRt);t?M.setState("value",t.getAttribute(NRt)):z(e)}let R=()=>N(E().length-1),F=e=>{e.preventDefault(),e.metaKey?R():e.altKey?A(1):z(1)},L=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?A(-1):z(-1)};return s.createElement(xAt.div,{ref:t,tabIndex:-1,...g,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=g.onKeyDown)||t.call(g,e),!e.defaultPrevented)switch(e.key){case"n":case"j":y&&e.ctrlKey&&F(e);break;case"ArrowDown":F(e);break;case"p":case"k":y&&e.ctrlKey&&L(e);break;case"ArrowUp":L(e);break;case"Home":e.preventDefault(),N(0);break;case"End":e.preventDefault(),R();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=T();if(t){let e=new Event(ERt);t.dispatchEvent(e)}}}}},s.createElement("label",{"cmdk-label":"",htmlFor:C.inputId,id:C.labelId,style:iFt},c),aFt(e,e=>s.createElement(FRt.Provider,{value:M},s.createElement(ARt.Provider,{value:C},e))))}),IRt=s.forwardRef((e,t)=>{var r,n;let o=s.useId(),a=s.useRef(null),i=s.useContext(BRt),l=RRt(),c=QRt(e),u=null!=(n=null==(r=c.current)?void 0:r.forceMount)?n:null==i?void 0:i.forceMount;JRt(()=>{if(!u)return l.item(o,null==i?void 0:i.id)},[u]);let d=nFt(o,a,[e.value,e.children,a],e.keywords),p=LRt(),h=rFt(e=>e.value&&e.value===d.current),f=rFt(e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0));function m(){var e,t;v(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function v(){p.setState("value",d.current,!0)}if(s.useEffect(()=>{let t=a.current;if(t&&!e.disabled)return t.addEventListener(ERt,m),()=>t.removeEventListener(ERt,m)},[f,e.onSelect,e.disabled]),!f)return null;let{disabled:y,value:g,onSelect:x,forceMount:b,keywords:k,..._}=e;return s.createElement(xAt.div,{ref:tFt([a,t]),..._,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!h,"data-disabled":!!y,"data-selected":!!h,onPointerMove:y||l.disablePointerSelection?void 0:v,onClick:y?void 0:m},e.children)}),qRt=s.forwardRef((e,t)=>{let{heading:r,children:n,forceMount:o,...a}=e,i=s.useId(),l=s.useRef(null),c=s.useRef(null),u=s.useId(),d=RRt(),p=rFt(e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(i)));JRt(()=>d.group(i),[]),nFt(i,l,[e.value,e.heading,c]);let h=s.useMemo(()=>({id:i,forceMount:o}),[o]);return s.createElement(xAt.div,{ref:tFt([l,t]),...a,"cmdk-group":"",role:"presentation",hidden:!p||void 0},r&&s.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},r),aFt(e,e=>s.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?u:void 0},s.createElement(BRt.Provider,{value:h},e))))}),$Rt=s.forwardRef((e,t)=>{let{alwaysRender:r,...n}=e,o=s.useRef(null),a=rFt(e=>!e.search);return r||a?s.createElement(xAt.div,{ref:tFt([o,t]),...n,"cmdk-separator":"",role:"separator"}):null}),HRt=s.forwardRef((e,t)=>{let{onValueChange:r,...n}=e,o=null!=e.value,a=LRt(),i=rFt(e=>e.search),l=rFt(e=>e.value),c=RRt(),u=s.useMemo(()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${PRt}[${NRt}="${encodeURIComponent(l)}"]`);return null==t?void 0:t.getAttribute("id")},[]);return s.useEffect(()=>{null!=e.value&&a.setState("search",e.value)},[e.value]),s.createElement(xAt.input,{ref:t,...n,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":u,id:c.inputId,type:"text",value:o?e.value:i,onChange:e=>{o||a.setState("search",e.target.value),null==r||r(e.target.value)}})}),WRt=s.forwardRef((e,t)=>{let{children:r,label:n="Suggestions",...o}=e,a=s.useRef(null),i=s.useRef(null),l=RRt();return s.useEffect(()=>{if(i.current&&a.current){let e,t=i.current,r=a.current,n=new ResizeObserver(()=>{e=requestAnimationFrame(()=>{let e=t.offsetHeight;r.style.setProperty("--cmdk-list-height",e.toFixed(1)+"px")})});return n.observe(t),()=>{cancelAnimationFrame(e),n.unobserve(t)}}},[]),s.createElement(xAt.div,{ref:tFt([a,t]),...o,"cmdk-list":"",role:"listbox","aria-label":n,id:l.listId},aFt(e,e=>s.createElement("div",{ref:tFt([i,l.listInnerRef]),"cmdk-list-sizer":""},e)))}),URt=s.forwardRef((e,t)=>{let{open:r,onOpenChange:n,overlayClassName:o,contentClassName:a,container:i,...l}=e;return s.createElement(MRt,{open:r,onOpenChange:n},s.createElement(CRt,{container:i},s.createElement(jRt,{"cmdk-overlay":"",className:o}),s.createElement(DRt,{"aria-label":e.label,"cmdk-dialog":"",className:a},s.createElement(VRt,{ref:t,...l}))))}),YRt=s.forwardRef((e,t)=>rFt(e=>0===e.filtered.count)?s.createElement(xAt.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),ZRt=s.forwardRef((e,t)=>{let{progress:r,children:n,label:o="Loading...",...a}=e;return s.createElement(xAt.div,{ref:t,...a,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},aFt(e,e=>s.createElement("div",{"aria-hidden":!0},e)))}),KRt=Object.assign(VRt,{List:WRt,Item:IRt,Input:HRt,Group:qRt,Separator:$Rt,Dialog:URt,Empty:YRt,Loading:ZRt});function GRt(e,t){let r=e.nextElementSibling;for(;r;){if(r.matches(t))return r;r=r.nextElementSibling}}function XRt(e,t){let r=e.previousElementSibling;for(;r;){if(r.matches(t))return r;r=r.previousElementSibling}}function QRt(e){let t=s.useRef(e);return JRt(()=>{t.current=e}),t}var JRt=typeof window>"u"?s.useEffect:s.useLayoutEffect;function eFt(e){let t=s.useRef();return void 0===t.current&&(t.current=e()),t}function tFt(e){return t=>{e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}}function rFt(e){let t=LRt(),r=()=>e(t.snapshot());return s.useSyncExternalStore(t.subscribe,r,r)}function nFt(e,t,r,n=[]){let o=s.useRef(),a=RRt();return JRt(()=>{var i;let s=(()=>{var e;for(let t of r){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=n.map(e=>e.trim());a.value(e,s,l),null==(i=t.current)||i.setAttribute(NRt,s),o.current=s}),o}var oFt=()=>{let[e,t]=s.useState(),r=eFt(()=>new Map);return JRt(()=>{r.current.forEach(e=>e()),r.current=new Map},[e]),(e,n)=>{r.current.set(e,n),t({})}};function aFt({asChild:e,children:t},r){return e&&s.isValidElement(t)?s.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},r(t.props.children)):r(t)}var iFt={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const sFt=s.forwardRef(({className:e,...r},n)=>t.jsx(KRt,{ref:n,className:zdt("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...r}));sFt.displayName=KRt.displayName;const lFt=s.forwardRef(({className:e,...r},n)=>t.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[t.jsx(slt,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),t.jsx(KRt.Input,{ref:n,className:zdt("flex h-11 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]}));lFt.displayName=KRt.Input.displayName;const cFt=s.forwardRef(({className:e,...r},n)=>t.jsx(KRt.List,{ref:n,className:zdt("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...r}));cFt.displayName=KRt.List.displayName;const uFt=s.forwardRef((e,r)=>t.jsx(KRt.Empty,{ref:r,className:"py-6 text-center text-sm",...e}));uFt.displayName=KRt.Empty.displayName;const dFt=s.forwardRef(({className:e,...r},n)=>t.jsx(KRt.Group,{ref:n,className:zdt("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...r}));dFt.displayName=KRt.Group.displayName;const pFt=s.forwardRef(({className:e,...r},n)=>t.jsx(KRt.Separator,{ref:n,className:zdt("-mx-1 h-px bg-border",e),...r}));pFt.displayName=KRt.Separator.displayName;const hFt=s.forwardRef(({className:e,...r},n)=>t.jsx(KRt.Item,{ref:n,className:zdt("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected='true']:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...r}));hFt.displayName=KRt.Item.displayName;const fFt=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},mFt=({day:e,weekday:r,translations:n})=>{const o=(e=>["Sun","Mon","Tue","Wed","Thu","Fri","Sat"].indexOf(e))(r),a=n.dayNames[o];return t.jsxs("div",{className:"flex items-center w-full",children:[t.jsx("span",{className:"text-xs sm:text-sm text-muted-foreground italic whitespace-nowrap mr-1 sm:mr-2 pl-4",children:a}),t.jsxs("span",{className:"text-xs sm:text-sm font-medium truncate flex-grow text-center",children:[e,fFt(parseInt(e))]})]})};function vFt({className:e,selectedDate:r,onDateChange:n,isAnimating:o,direction:a,translations:i}){const[l,c]=s.useState(!1),u=s.useMemo(()=>(e=>bit({start:kit(e),end:xit(e)}).map(e=>({dayNumber:sst(e,"d"),weekday:sst(e,"EEE"),value:sst(e,"yyyy-MM-dd"),date:e})))(r),[r]),d=u.find(e=>sst(e.date,"yyyy-MM-dd")===sst(r,"yyyy-MM-dd"));return t.jsxs(Xxt,{open:l,onOpenChange:c,children:[t.jsx(Qxt,{asChild:!0,children:t.jsxs($ht,{variant:"outline",role:"combobox","aria-expanded":l,"aria-label":i.selectDate,className:zdt("w-[120px] sm:w-[159px] justify-between border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",e),children:[t.jsx(fbt,{mode:"wait",children:t.jsx(rOt.div,{initial:!!o&&{y:"down"===a?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===a?-10:10,opacity:0},transition:{duration:.2},className:"w-full",children:d?t.jsx(mFt,{day:d.dayNumber,weekday:d.weekday,translations:i}):t.jsx("span",{className:"text-xs sm:text-sm",children:i.selectDate})},null==d?void 0:d.value)}),t.jsx(Uzt,{className:"ml-1 sm:ml-2 h-4 w-4 sm:h-4 sm:w-4 shrink-0 opacity-50"})]})}),t.jsx(Jxt,{className:"w-[120px] sm:w-[161px] p-0",children:t.jsxs(sFt,{children:[t.jsx(lFt,{placeholder:`${i.search} ${i.day.toLowerCase()}...`,className:"text-xs sm:text-sm"}),t.jsxs(cFt,{className:"max-h-[300px] overflow-y-auto",children:[t.jsx(uFt,{children:i.noEvents}),t.jsx(dFt,{children:u.map(e=>t.jsxs(hFt,{onSelect:()=>{n(e.date),c(!1)},className:"text-xs sm:text-sm",children:[t.jsx(mFt,{day:e.dayNumber,weekday:e.weekday,translations:i}),t.jsx(Zzt,{className:zdt("ml-auto h-4 w-4 sm:h-4 sm:w-4",(null==d?void 0:d.value)===e.value?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}function yFt({className:e,selectedMonth:r,onMonthChange:n,onDateChange:o,isAnimating:a,direction:i,translations:l,currentDate:c}){const[u,d]=s.useState(!1),p=l.monthNames.map(e=>({label:e,value:e.toLowerCase().slice(0,3)}));return t.jsxs(Xxt,{open:u,onOpenChange:d,children:[t.jsx(Qxt,{asChild:!0,children:t.jsxs($ht,{variant:"outline",role:"combobox","aria-expanded":u,"aria-label":l.selectDate,className:zdt("w-[110px] sm:w-[151px] justify-center border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",e),children:[t.jsx(Hzt,{className:"hidden sm:inline-block mr-2 h-4 w-4"}),t.jsx(fbt,{mode:"wait",children:t.jsx(rOt.p,{className:"text-xs sm:text-sm flex-grow text-center",initial:!!a&&{y:"down"===i?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===i?-10:10,opacity:0},transition:{duration:.2},children:r.label},r.value)}),t.jsx(Uzt,{className:"hidden sm:inline-block ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),t.jsx(Jxt,{className:"w-[110px] sm:w-[151px] p-0",children:t.jsxs(sFt,{children:[t.jsx(lFt,{placeholder:l.search,className:"text-xs sm:text-sm"}),t.jsxs(cFt,{children:[t.jsx(uFt,{className:"text-xs sm:text-sm",children:l.noEvents}),t.jsx(dFt,{children:p.map(e=>t.jsxs(hFt,{onSelect:()=>(e=>{const t=c.getDate(),r=c.getFullYear(),a=p.findIndex(t=>t.value===e.value),i=new Date(r,a,t);i.getDate()!==t&&i.setMonth(a+1,0),n(e),o&&o(i),d(!1)})(e),className:"text-xs sm:text-sm",children:[e.label,t.jsx(Zzt,{className:zdt("ml-auto h-4 w-4 sm:h-4 sm:w-4",r.value===e.value?"opacity-100":"opacity-0")})]},e.value))})]})]})})]})}function gFt({className:r,currentYear:n,onYearChange:o,onDateChange:a,currentDate:i,isAnimating:s,direction:l}){const[c,u]=e.useState(!1),[d,p]=e.useState(n),[h,f]=e.useState(n.toString());e.useEffect(()=>{p(n),f(n.toString())},[n]);const m=e=>{if(e>=1900&&e<=3100){const t=i.getDate(),r=i.getMonth(),n=new Date(e,r,t);n.getMonth()!==r&&n.setDate(0),p(e),f(e.toString()),o(e),a&&a(n)}},v=e=>{m(d+e)};return t.jsxs(Xxt,{open:c,onOpenChange:u,children:[t.jsx(Qxt,{asChild:!0,children:t.jsx($ht,{variant:"outline",role:"combobox","aria-expanded":c,"aria-label":"Select a year",className:zdt("w-[70px] sm:w-[71px] justify-center border border-input bg-background hover:bg-accent hover:text-accent-foreground text-xs sm:text-sm p-2 sm:p-2",r),children:t.jsx(fbt,{mode:"wait",children:t.jsx(rOt.p,{className:"text-xs sm:text-sm",initial:!!s&&{y:"down"===l?10:-10,opacity:0},animate:{y:0,opacity:1},exit:{y:"down"===l?-10:10,opacity:0},transition:{duration:.2},children:d},d)})})}),t.jsx(Jxt,{className:"w-[90px] sm:w-[130px] p-2",children:t.jsxs("div",{className:"flex flex-col items-center",children:[t.jsx($ht,{variant:"ghost",size:"sm",className:"w-full h-8",onClick:()=>v(1),children:t.jsx(Zst,{className:"h-4 w-4 sm:h-4 sm:w-4"})}),t.jsx(cyt,{type:"text",value:h,onChange:e=>{const t=e.target.value;f(t);const r=parseInt(t,10);!isNaN(r)&&r>=1900&&r<=2100&&m(r)},onBlur:()=>{h!==d.toString()&&f(d.toString())},className:"w-full text-center text-xs sm:text-sm h-8"}),t.jsx($ht,{variant:"ghost",size:"sm",className:"w-full h-8",onClick:()=>v(-1),children:t.jsx(Wst,{className:"h-4 w-4 sm:h-4 sm:w-4"})})]})})]})}const xFt=({currentDate:e,currentView:r,handlePrevious:n,handleNext:o,lastUpdated:a,animationDirection:i,months:s,handleDayChange:l,handleMonthChange:c,handleYearChange:u,currentConfig:d})=>t.jsxs("div",{className:"flex items-center space-x-1 sm:space-x-2",children:[t.jsx($ht,{variant:"ghost",onClick:n,size:"icon",className:"h-8 w-8 sm:h-10 sm:w-10",children:t.jsx(Ust,{className:"h-4 w-4"})}),t.jsxs(fbt,{mode:"sync",children:["day"===r&&t.jsx(rOt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(vFt,{translations:d.localization,className:"font-semibold text-sm sm:text-lg",selectedDate:e,onDateChange:l,isAnimating:"day"===a,direction:i})},"day-switcher"),"year"!==r&&t.jsx(rOt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(yFt,{className:"font-semibold text-sm sm:text-lg",selectedMonth:s[e.getMonth()],onMonthChange:c,onDateChange:l,isAnimating:"month"===a,direction:i,translations:d.localization,currentDate:e})},"month-switcher"),t.jsx(rOt.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:t.jsx(gFt,{className:"font-semibold text-sm sm:text-lg",currentYear:e.getFullYear(),onYearChange:u,onDateChange:l,currentDate:e,isAnimating:"year"===a,direction:i})},"year-switcher")]}),t.jsx($ht,{variant:"ghost",onClick:o,size:"icon",className:"h-8 w-8 sm:h-10 sm:w-10",children:t.jsx(Yst,{className:"h-4 w-4"})})]});var[bFt,kFt]=flt("Tooltip",[oxt]),_Ft=oxt(),wFt="TooltipProvider",MFt=700,CFt="tooltip.open",[jFt,DFt]=bFt(wFt),OFt=e=>{const{__scopeTooltip:r,delayDuration:n=MFt,skipDelayDuration:o=300,disableHoverableContent:a=!1,children:i}=e,l=s.useRef(!0),c=s.useRef(!1),u=s.useRef(0);return s.useEffect(()=>{const e=u.current;return()=>window.clearTimeout(e)},[]),t.jsx(jFt,{scope:r,isOpenDelayedRef:l,delayDuration:n,onOpen:s.useCallback(()=>{window.clearTimeout(u.current),l.current=!1},[]),onClose:s.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>l.current=!0,o)},[o]),isPointerInTransitRef:c,onPointerInTransitChange:s.useCallback(e=>{c.current=e},[]),disableHoverableContent:a,children:i})};OFt.displayName=wFt;var SFt="Tooltip",[PFt,TFt]=bFt(SFt),EFt=e=>{const{__scopeTooltip:r,children:n,open:o,defaultOpen:a,onOpenChange:i,disableHoverableContent:l,delayDuration:c}=e,u=DFt(SFt,e.__scopeTooltip),d=_Ft(r),[p,h]=s.useState(null),f=xlt(),m=s.useRef(0),v=l??u.disableHoverableContent,y=c??u.delayDuration,g=s.useRef(!1),[x,b]=klt({prop:o,defaultProp:a??!1,onChange:e=>{e?(u.onOpen(),document.dispatchEvent(new CustomEvent(CFt))):u.onClose(),null==i||i(e)},caller:SFt}),k=s.useMemo(()=>x?g.current?"delayed-open":"instant-open":"closed",[x]),_=s.useCallback(()=>{window.clearTimeout(m.current),m.current=0,g.current=!1,b(!0)},[b]),w=s.useCallback(()=>{window.clearTimeout(m.current),m.current=0,b(!1)},[b]),M=s.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{g.current=!0,b(!0),m.current=0},y)},[y,b]);return s.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),t.jsx(bxt,{...d,children:t.jsx(PFt,{scope:r,contentId:f,open:x,stateAttribute:k,trigger:p,onTriggerChange:h,onTriggerEnter:s.useCallback(()=>{u.isOpenDelayedRef.current?M():_()},[u.isOpenDelayedRef,M,_]),onTriggerLeave:s.useCallback(()=>{v?w():(window.clearTimeout(m.current),m.current=0)},[w,v]),onOpen:_,onClose:w,disableHoverableContent:v,children:n})})};EFt.displayName=SFt;var NFt="TooltipTrigger",zFt=s.forwardRef((e,r)=>{const{__scopeTooltip:n,...o}=e,a=TFt(NFt,n),i=DFt(NFt,n),l=_Ft(n),c=hlt(r,s.useRef(null),a.onTriggerChange),u=s.useRef(!1),d=s.useRef(!1),p=s.useCallback(()=>u.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",p),[p]),t.jsx(kxt,{asChild:!0,...l,children:t.jsx(Olt.button,{"aria-describedby":a.open?a.contentId:void 0,"data-state":a.stateAttribute,...o,ref:c,onPointerMove:ult(e.onPointerMove,e=>{"touch"!==e.pointerType&&!d.current&&!i.isPointerInTransitRef.current&&(a.onTriggerEnter(),d.current=!0)}),onPointerLeave:ult(e.onPointerLeave,()=>{a.onTriggerLeave(),d.current=!1}),onPointerDown:ult(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener("pointerup",p,{once:!0})}),onFocus:ult(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:ult(e.onBlur,a.onClose),onClick:ult(e.onClick,a.onClose)})})});zFt.displayName=NFt;var[AFt,RFt]=bFt("TooltipPortal",{forceMount:void 0}),FFt="TooltipContent",LFt=s.forwardRef((e,r)=>{const n=RFt(FFt,e.__scopeTooltip),{forceMount:o=n.forceMount,side:a="top",...i}=e,s=TFt(FFt,e.__scopeTooltip);return t.jsx(Xlt,{present:o||s.open,children:s.disableHoverableContent?t.jsx($Ft,{side:a,...i,ref:r}):t.jsx(BFt,{side:a,...i,ref:r})})}),BFt=s.forwardRef((e,r)=>{const n=TFt(FFt,e.__scopeTooltip),o=DFt(FFt,e.__scopeTooltip),a=s.useRef(null),i=hlt(r,a),[l,c]=s.useState(null),{trigger:u,onClose:d}=n,p=a.current,{onPointerInTransitChange:h}=o,f=s.useCallback(()=>{c(null),h(!1)},[h]),m=s.useCallback((e,t)=>{const r=e.currentTarget,n={x:e.clientX,y:e.clientY},o=function(e,t){const r=Math.abs(t.top-e.y),n=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(r,n,o,a)){case a:return"left";case o:return"right";case r:return"top";case n:return"bottom";default:throw new Error("unreachable")}}(n,r.getBoundingClientRect()),a=function(e,t,r=5){const n=[];switch(t){case"top":n.push({x:e.x-r,y:e.y+r},{x:e.x+r,y:e.y+r});break;case"bottom":n.push({x:e.x-r,y:e.y-r},{x:e.x+r,y:e.y-r});break;case"left":n.push({x:e.x+r,y:e.y-r},{x:e.x+r,y:e.y+r});break;case"right":n.push({x:e.x-r,y:e.y-r},{x:e.x-r,y:e.y+r})}return n}(n,o),i=function(e){const{top:t,right:r,bottom:n,left:o}=e;return[{x:o,y:t},{x:r,y:t},{x:r,y:n},{x:o,y:n}]}(t.getBoundingClientRect()),s=function(e){const t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:e.y>t.y?1:0),function(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r<e.length;r++){const n=e[r];for(;t.length>=2;){const e=t[t.length-1],r=t[t.length-2];if(!((e.x-r.x)*(n.y-r.y)>=(e.y-r.y)*(n.x-r.x)))break;t.pop()}t.push(n)}t.pop();const r=[];for(let t=e.length-1;t>=0;t--){const n=e[t];for(;r.length>=2;){const e=r[r.length-1],t=r[r.length-2];if(!((e.x-t.x)*(n.y-t.y)>=(e.y-t.y)*(n.x-t.x)))break;r.pop()}r.push(n)}return r.pop(),1===t.length&&1===r.length&&t[0].x===r[0].x&&t[0].y===r[0].y?t:t.concat(r)}(t)}([...a,...i]);c(s),h(!0)},[h]);return s.useEffect(()=>()=>f(),[f]),s.useEffect(()=>{if(u&&p){const e=e=>m(e,p),t=e=>m(e,u);return u.addEventListener("pointerleave",e),p.addEventListener("pointerleave",t),()=>{u.removeEventListener("pointerleave",e),p.removeEventListener("pointerleave",t)}}},[u,p,m,f]),s.useEffect(()=>{if(l){const e=e=>{const t=e.target,r={x:e.clientX,y:e.clientY},n=(null==u?void 0:u.contains(t))||(null==p?void 0:p.contains(t)),o=!function(e,t){const{x:r,y:n}=e;let o=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){const i=t[e],s=t[a],l=i.x,c=i.y,u=s.x,d=s.y;c>n!=d>n&&r<(u-l)*(n-c)/(d-c)+l&&(o=!o)}return o}(r,l);n?f():o&&(f(),d())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[u,p,l,d,f]),t.jsx($Ft,{...e,ref:i})}),[VFt,IFt]=bFt(SFt,{isInside:!1}),qFt=jlt("TooltipContent"),$Ft=s.forwardRef((e,r)=>{const{__scopeTooltip:n,children:o,"aria-label":a,onEscapeKeyDown:i,onPointerDownOutside:l,...c}=e,u=TFt(FFt,n),d=_Ft(n),{onClose:p}=u;return s.useEffect(()=>(document.addEventListener(CFt,p),()=>document.removeEventListener(CFt,p)),[p]),s.useEffect(()=>{if(u.trigger){const e=e=>{const t=e.target;null!=t&&t.contains(u.trigger)&&p()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[u.trigger,p]),t.jsx(Rlt,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:p,children:t.jsxs(_xt,{"data-state":u.stateAttribute,...d,...c,ref:r,style:{...c.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[t.jsx(qFt,{children:o}),t.jsx(VFt,{scope:n,isInside:!0,children:t.jsx(fSt,{id:u.contentId,role:"tooltip",children:a||o})})]})})});LFt.displayName=FFt;var HFt="TooltipArrow",WFt=s.forwardRef((e,r)=>{const{__scopeTooltip:n,...o}=e,a=_Ft(n);return IFt(HFt,n).isInside?null:t.jsx(wxt,{...a,...o,ref:r})});WFt.displayName=HFt;var UFt=LFt;const YFt=OFt,ZFt=EFt,KFt=zFt,GFt=s.forwardRef(({className:e,sideOffset:r=4,...n},o)=>t.jsx(UFt,{ref:o,sideOffset:r,className:zdt("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n}));GFt.displayName=UFt.displayName;const XFt=({isListView:e,setIsListView:r,currentConfig:n})=>t.jsx(YFt,{children:t.jsxs(ZFt,{children:[t.jsx(KFt,{asChild:!0,children:t.jsx($ht,{variant:"outline",size:"sm",onClick:()=>r(!e),className:"flex items-center space-x-1 w-10 h-10 justify-center overflow-hidden",children:t.jsx(fbt,{mode:"wait",children:t.jsx(rOt.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:e?t.jsx($st,{className:"h-4 w-4"}):t.jsx(nlt,{className:"h-4 w-4"})},e?"list":"calendar")})})}),t.jsx(GFt,{children:t.jsx("p",{children:e?n.localization.displayCalendar:n.localization.displayList})})]})}),QFt=({is24HourFormat:e,isTimeFormatChanging:r,toggleTimeFormat:n})=>t.jsx($ht,{variant:"outline",size:"sm",onClick:n,disabled:r,className:"flex items-center space-x-1 w-20 justify-center overflow-hidden",children:t.jsx(fbt,{mode:"wait",children:t.jsxs(rOt.div,{className:"flex items-center space-x-1",initial:{y:10,opacity:0},animate:{y:0,opacity:1},exit:{y:-10,opacity:0},transition:{duration:.15},children:[t.jsx(Qst,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{className:"text-xs font-medium",children:e?"24h":"12h"})]},e?"24h":"12h")})}),JFt=({handleTodayClick:e,isTodayDisabled:r,getTodayButtonText:n})=>t.jsx($ht,{variant:"outline",size:"sm",onClick:e,disabled:r,className:"flex items-center space-x-1 w-28 h-10 justify-center overflow-hidden",children:t.jsx(fbt,{mode:"wait",children:t.jsxs(rOt.div,{className:"flex items-center space-x-1",initial:{opacity:0},animate:{opacity:[0,1.05,1]},transition:{duration:.2,times:[0,.8,1]},children:[t.jsx($st,{className:"h-4 w-4 flex-shrink-0"}),t.jsx("span",{children:n()})]},n())})}),eLt=({currentView:e,setCurrentView:r,viewOptions:n,currentConfig:o})=>t.jsx("div",{className:"inline-flex items-center rounded-md border border-input bg-transparent p-1 w-full sm:w-[240px]",children:t.jsx(YFt,{children:n.map(n=>{const a=n.icon,i=e===n.value;return t.jsxs(ZFt,{children:[t.jsx(KFt,{asChild:!0,children:t.jsx(rOt.div,{className:"relative flex-grow",initial:!1,animate:{flex:i?2:1},transition:{duration:.2},children:t.jsx($ht,{variant:i?"secondary":"ghost",size:"sm",className:zdt("relative h-8 w-full overflow-hidden transition-colors",i?"bg-secondary text-secondary-foreground":"hover:bg-secondary/50 hover:text-secondary-foreground",!i&&"cursor-pointer"),onClick:()=>r(n.value),children:t.jsxs("div",{className:"flex items-center justify-center space-x-1 w-full",children:[t.jsx(a,{className:zdt("h-4 w-4 flex-shrink-0",i?"text-primary":"text-muted-foreground")}),t.jsx(fbt,{children:i&&t.jsx(rOt.span,{className:"text-xs font-medium whitespace-nowrap overflow-hidden",initial:{opacity:0,width:0},animate:{opacity:1,width:"auto"},exit:{opacity:0,width:0},transition:{duration:.2},children:n.label})})]})})})}),t.jsx(GFt,{children:t.jsx("p",{children:`${o.localization.viewBy} ${n.label}`})})]},n.value)})})}),tLt=({currentDate:r,currentView:n,handlePrevious:o,handleNext:a,handleTodayClick:i,toggleTimeFormat:s,setCurrentView:l,isTimeFormatChanging:c,use24HourFormat:u,lastUpdated:d,animationDirection:p,months:h,handleDayChange:f,handleMonthChange:m,handleYearChange:v,currentConfig:y,onEventAdd:g,onEventDelete:x,isListView:b,setIsListView:k,selectedColors:_,setSelectedColors:w})=>{const[M,C]=e.useState(!1);(({handleNext:t,handlePrevious:r})=>{const[n,o]=e.useState(0),[a,i]=e.useState(!1);e.useEffect(()=>{const e=e=>{if("ArrowLeft"===e.key||"ArrowRight"===e.key){e.preventDefault();const s=Date.now();!a&&s-n>200&&(i(!0),o(s),"ArrowLeft"===e.key?r():t())}},s=e=>{("ArrowLeft"===e.key||"ArrowRight"===e.key)&&i(!1)};return window.addEventListener("keydown",e),window.addEventListener("keyup",s),()=>{window.removeEventListener("keydown",e),window.removeEventListener("keyup",s)}},[t,r,a,n])})({handleNext:a,handlePrevious:o});const j=[{value:"day",label:y.localization.day,icon:olt},{value:"week",label:y.localization.week,icon:Jst},{value:"month",label:y.localization.month,icon:tlt},{value:"year",label:y.localization.year,icon:rlt}];return t.jsxs("div",{className:"flex flex-col xl:flex-row justify-between items-center mb-4 space-y-2 sm:px-0",children:[t.jsx(xFt,{currentDate:r,currentView:n,handlePrevious:o,handleNext:a,lastUpdated:d,animationDirection:p,months:h,handleDayChange:f,handleMonthChange:m,handleYearChange:v,currentConfig:y}),t.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-2 w-full sm:w-auto",children:[t.jsx(QFt,{is24HourFormat:u,isTimeFormatChanging:c,toggleTimeFormat:s}),t.jsx(Izt,{isFilterOpen:M,setIsFilterOpen:C,selectedColors:_,toggleColorSelection:e=>{w(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},currentConfig:y}),t.jsx(JFt,{handleTodayClick:i,isTodayDisabled:(()=>{const e=new Date;switch(n){case"day":return hit(r,e);case"week":return hit(nit(r,{weekStartsOn:u?1:0}),nit(e,{weekStartsOn:u?1:0}));case"month":return hst(r,e);case"year":return r.getFullYear()===e.getFullYear();default:return!1}})(),getTodayButtonText:()=>{switch(n){case"day":default:return y.localization.today;case"week":return y.localization.thisWeek;case"month":return y.localization.thisMonth;case"year":return y.localization.thisYear}}}),t.jsx(XFt,{isListView:b,setIsListView:k,currentConfig:y}),t.jsx(eLt,{currentView:n,setCurrentView:l,viewOptions:j,currentConfig:y}),t.jsx(PEt,{translations:y.localization,event:(()=>{switch(n){case"day":default:return{startDate:r,endDate:r};case"week":return{startDate:nit(r,{weekStartsOn:u?1:0}),endDate:Mit(r,{weekStartsOn:u?1:0})}}})(),onAddEvent:g,onDeleteEvent:x})]})]})},rLt=({currentView:t,currentDate:r,onDateRangeChange:n,is24HourFormat:o})=>{const a=e.useRef(r),i=e.useRef(t),s=e.useCallback(()=>{let e,n;switch(t){case"day":default:e=iit(r),n=git(r);break;case"week":e=nit(r,{weekStartsOn:o?1:0}),n=Mit(r,{weekStartsOn:o?1:0});break;case"month":e=kit(r),n=xit(r);break;case"year":e=wit(r),n=_it(r)}return{startDate:e,endDate:n}},[t,r,o]),l=e.useCallback(()=>{if(t!==i.current)return!0;const e=a.current;switch(t){case"day":return!hit(r,e);case"week":return!function(e,t,r){return+nit(e,r)==+nit(t,r)}(r,e,{weekStartsOn:o?1:0});case"month":return!hst(r,e);case"year":return!fst(r,e);default:return!0}},[t,r,o]);e.useEffect(()=>{(async()=>{if(n&&l()){const{startDate:e,endDate:o}=s();await n(e,o),a.current=r,i.current=t}})()},[t,r,n,s,l])},nLt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:zdt("rounded-lg border bg-card text-card-foreground shadow-sm",e),...r}));nLt.displayName="Card";const oLt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:zdt("flex flex-col space-y-1.5 p-6",e),...r}));oLt.displayName="CardHeader";const aLt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:zdt("text-2xl font-semibold leading-none tracking-tight",e),...r}));aLt.displayName="CardTitle";const iLt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:zdt("text-sm text-muted-foreground",e),...r}));iLt.displayName="CardDescription";const sLt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:zdt("p-6 pt-0",e),...r}));sLt.displayName="CardContent";const lLt=s.forwardRef(({className:e,...r},n)=>t.jsx("div",{ref:n,className:zdt("flex items-center p-6 pt-0",e),...r}));lLt.displayName="CardFooter";var cLt="ScrollArea",[uLt,dLt]=flt(cLt),[pLt,hLt]=uLt(cLt),fLt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,type:o="hover",dir:a,scrollHideDelay:i=600,...l}=e,[c,u]=s.useState(null),[d,p]=s.useState(null),[h,f]=s.useState(null),[m,v]=s.useState(null),[y,g]=s.useState(null),[x,b]=s.useState(0),[k,_]=s.useState(0),[w,M]=s.useState(!1),[C,j]=s.useState(!1),D=hlt(r,e=>u(e)),O=tvt(a);return t.jsx(pLt,{scope:n,type:o,dir:O,scrollHideDelay:i,scrollArea:c,viewport:d,onViewportChange:p,content:h,onContentChange:f,scrollbarX:m,onScrollbarXChange:v,scrollbarXEnabled:w,onScrollbarXEnabledChange:M,scrollbarY:y,onScrollbarYChange:g,scrollbarYEnabled:C,onScrollbarYEnabledChange:j,onCornerWidthChange:b,onCornerHeightChange:_,children:t.jsx(Olt.div,{dir:O,...l,ref:D,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":k+"px",...e.style}})})});fLt.displayName=cLt;var mLt="ScrollAreaViewport",vLt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,children:o,nonce:a,...i}=e,l=hLt(mLt,n),c=hlt(r,s.useRef(null),l.onViewportChange);return t.jsxs(t.Fragment,{children:[t.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),t.jsx(Olt.div,{"data-radix-scroll-area-viewport":"",...i,ref:c,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:t.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:o})})]})});vLt.displayName=mLt;var yLt="ScrollAreaScrollbar",gLt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=hLt(yLt,e.__scopeScrollArea),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:l}=a,c="horizontal"===e.orientation;return s.useEffect(()=>(c?i(!0):l(!0),()=>{c?i(!1):l(!1)}),[c,i,l]),"hover"===a.type?t.jsx(xLt,{...o,ref:r,forceMount:n}):"scroll"===a.type?t.jsx(bLt,{...o,ref:r,forceMount:n}):"auto"===a.type?t.jsx(kLt,{...o,ref:r,forceMount:n}):"always"===a.type?t.jsx(_Lt,{...o,ref:r}):null});gLt.displayName=yLt;var xLt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=hLt(yLt,e.__scopeScrollArea),[i,l]=s.useState(!1);return s.useEffect(()=>{const e=a.scrollArea;let t=0;if(e){const r=()=>{window.clearTimeout(t),l(!0)},n=()=>{t=window.setTimeout(()=>l(!1),a.scrollHideDelay)};return e.addEventListener("pointerenter",r),e.addEventListener("pointerleave",n),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",r),e.removeEventListener("pointerleave",n)}}},[a.scrollArea,a.scrollHideDelay]),t.jsx(Xlt,{present:n||i,children:t.jsx(kLt,{"data-state":i?"visible":"hidden",...o,ref:r})})}),bLt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=hLt(yLt,e.__scopeScrollArea),i="horizontal"===e.orientation,l=ILt(()=>u("SCROLL_END"),100),[c,u]=function(e,t){return s.useReducer((e,r)=>t[e][r]??e,e)}("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if("idle"===c){const e=window.setTimeout(()=>u("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(e)}},[c,a.scrollHideDelay,u]),s.useEffect(()=>{const e=a.viewport,t=i?"scrollLeft":"scrollTop";if(e){let r=e[t];const n=()=>{const n=e[t];r!==n&&(u("SCROLL"),l()),r=n};return e.addEventListener("scroll",n),()=>e.removeEventListener("scroll",n)}},[a.viewport,i,u,l]),t.jsx(Xlt,{present:n||"hidden"!==c,children:t.jsx(_Lt,{"data-state":"hidden"===c?"hidden":"visible",...o,ref:r,onPointerEnter:ult(e.onPointerEnter,()=>u("POINTER_ENTER")),onPointerLeave:ult(e.onPointerLeave,()=>u("POINTER_LEAVE"))})})}),kLt=s.forwardRef((e,r)=>{const n=hLt(yLt,e.__scopeScrollArea),{forceMount:o,...a}=e,[i,l]=s.useState(!1),c="horizontal"===e.orientation,u=ILt(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;l(c?e:t)}},10);return qLt(n.viewport,u),qLt(n.content,u),t.jsx(Xlt,{present:o||i,children:t.jsx(_Lt,{"data-state":i?"visible":"hidden",...a,ref:r})})}),_Lt=s.forwardRef((e,r)=>{const{orientation:n="vertical",...o}=e,a=hLt(yLt,e.__scopeScrollArea),i=s.useRef(null),l=s.useRef(0),[c,u]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=ALt(c.viewport,c.content),p={...o,sizes:c,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:e=>i.current=e,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:e=>l.current=e};function h(e,t){return function(e,t,r,n="ltr"){const o=RLt(r),a=o/2,i=t||a,s=o-i,l=r.scrollbar.paddingStart+i,c=r.scrollbar.size-r.scrollbar.paddingEnd-s,u=r.content-r.viewport,d="ltr"===n?[0,u]:[-1*u,0];return LLt([l,c],d)(e)}(e,l.current,c,t)}return"horizontal"===n?t.jsx(wLt,{...p,ref:r,onThumbPositionChange:()=>{if(a.viewport&&i.current){const e=FLt(a.viewport.scrollLeft,c,a.dir);i.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollLeft=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollLeft=h(e,a.dir))}}):"vertical"===n?t.jsx(MLt,{...p,ref:r,onThumbPositionChange:()=>{if(a.viewport&&i.current){const e=FLt(a.viewport.scrollTop,c);i.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{a.viewport&&(a.viewport.scrollTop=e)},onDragScroll:e=>{a.viewport&&(a.viewport.scrollTop=h(e))}}):null}),wLt=s.forwardRef((e,r)=>{const{sizes:n,onSizesChange:o,...a}=e,i=hLt(yLt,e.__scopeScrollArea),[l,c]=s.useState(),u=s.useRef(null),d=hlt(r,u,i.onScrollbarXChange);return s.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),t.jsx(DLt,{"data-orientation":"horizontal",...a,ref:d,sizes:n,style:{bottom:0,left:"rtl"===i.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===i.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":RLt(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,r)=>{if(i.viewport){const n=i.viewport.scrollLeft+t.deltaX;e.onWheelScroll(n),BLt(n,r)&&t.preventDefault()}},onResize:()=>{u.current&&i.viewport&&l&&o({content:i.viewport.scrollWidth,viewport:i.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:zLt(l.paddingLeft),paddingEnd:zLt(l.paddingRight)}})}})}),MLt=s.forwardRef((e,r)=>{const{sizes:n,onSizesChange:o,...a}=e,i=hLt(yLt,e.__scopeScrollArea),[l,c]=s.useState(),u=s.useRef(null),d=hlt(r,u,i.onScrollbarYChange);return s.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),t.jsx(DLt,{"data-orientation":"vertical",...a,ref:d,sizes:n,style:{top:0,right:"ltr"===i.dir?0:void 0,left:"rtl"===i.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":RLt(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,r)=>{if(i.viewport){const n=i.viewport.scrollTop+t.deltaY;e.onWheelScroll(n),BLt(n,r)&&t.preventDefault()}},onResize:()=>{u.current&&i.viewport&&l&&o({content:i.viewport.scrollHeight,viewport:i.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:zLt(l.paddingTop),paddingEnd:zLt(l.paddingBottom)}})}})}),[CLt,jLt]=uLt(yLt),DLt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,sizes:o,hasThumb:a,onThumbChange:i,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:u,onDragScroll:d,onWheelScroll:p,onResize:h,...f}=e,m=hLt(yLt,n),[v,y]=s.useState(null),g=hlt(r,e=>y(e)),x=s.useRef(null),b=s.useRef(""),k=m.viewport,_=o.content-o.viewport,w=Plt(p),M=Plt(u),C=ILt(h,10);function j(e){if(x.current){const t=e.clientX-x.current.left,r=e.clientY-x.current.top;d({x:t,y:r})}}return s.useEffect(()=>{const e=e=>{const t=e.target;(null==v?void 0:v.contains(t))&&w(e,_)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[k,v,_,w]),s.useEffect(M,[o,M]),qLt(v,C),qLt(m.content,C),t.jsx(CLt,{scope:n,scrollbar:v,hasThumb:a,onThumbChange:Plt(i),onThumbPointerUp:Plt(l),onThumbPositionChange:M,onThumbPointerDown:Plt(c),children:t.jsx(Olt.div,{...f,ref:g,style:{position:"absolute",...f.style},onPointerDown:ult(e.onPointerDown,e=>{0===e.button&&(e.target.setPointerCapture(e.pointerId),x.current=v.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",m.viewport&&(m.viewport.style.scrollBehavior="auto"),j(e))}),onPointerMove:ult(e.onPointerMove,j),onPointerUp:ult(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=b.current,m.viewport&&(m.viewport.style.scrollBehavior=""),x.current=null})})})}),OLt="ScrollAreaThumb",SLt=s.forwardRef((e,r)=>{const{forceMount:n,...o}=e,a=jLt(OLt,e.__scopeScrollArea);return t.jsx(Xlt,{present:n||a.hasThumb,children:t.jsx(PLt,{ref:r,...o})})}),PLt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,style:o,...a}=e,i=hLt(OLt,n),l=jLt(OLt,n),{onThumbPositionChange:c}=l,u=hlt(r,e=>l.onThumbChange(e)),d=s.useRef(void 0),p=ILt(()=>{d.current&&(d.current(),d.current=void 0)},100);return s.useEffect(()=>{const e=i.viewport;if(e){const t=()=>{if(p(),!d.current){const t=VLt(e,c);d.current=t,c()}};return c(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[i.viewport,p,c]),t.jsx(Olt.div,{"data-state":l.hasThumb?"visible":"hidden",...a,ref:u,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...o},onPointerDownCapture:ult(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;l.onThumbPointerDown({x:r,y:n})}),onPointerUp:ult(e.onPointerUp,l.onThumbPointerUp)})});SLt.displayName=OLt;var TLt="ScrollAreaCorner",ELt=s.forwardRef((e,r)=>{const n=hLt(TLt,e.__scopeScrollArea),o=!(!n.scrollbarX||!n.scrollbarY);return"scroll"!==n.type&&o?t.jsx(NLt,{...e,ref:r}):null});ELt.displayName=TLt;var NLt=s.forwardRef((e,r)=>{const{__scopeScrollArea:n,...o}=e,a=hLt(TLt,n),[i,l]=s.useState(0),[c,u]=s.useState(0),d=!(!i||!c);return qLt(a.scrollbarX,()=>{var e;const t=(null==(e=a.scrollbarX)?void 0:e.offsetHeight)||0;a.onCornerHeightChange(t),u(t)}),qLt(a.scrollbarY,()=>{var e;const t=(null==(e=a.scrollbarY)?void 0:e.offsetWidth)||0;a.onCornerWidthChange(t),l(t)}),d?t.jsx(Olt.div,{...o,ref:r,style:{width:i,height:c,position:"absolute",right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:0,...e.style}}):null});function zLt(e){return e?parseInt(e,10):0}function ALt(e,t){const r=e/t;return isNaN(r)?0:r}function RLt(e){const t=ALt(e.viewport,e.content),r=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,n=(e.scrollbar.size-r)*t;return Math.max(n,18)}function FLt(e,t,r="ltr"){const n=RLt(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,i=t.content-t.viewport,s=a-n,l=dSt(e,"ltr"===r?[0,i]:[-1*i,0]);return LLt([0,i],[0,s])(l)}function LLt(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}function BLt(e,t){return e>0&&e<t}var VLt=(e,t=()=>{})=>{let r={left:e.scrollLeft,top:e.scrollTop},n=0;return function o(){const a={left:e.scrollLeft,top:e.scrollTop},i=r.left!==a.left,s=r.top!==a.top;(i||s)&&t(),r=a,n=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(n)};function ILt(e,t){const r=Plt(e),n=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(n.current),[]),s.useCallback(()=>{window.clearTimeout(n.current),n.current=window.setTimeout(r,t)},[r,t])}function qLt(e,t){const r=Plt(t);vlt(()=>{let t=0;if(e){const n=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(r)});return n.observe(e),()=>{window.cancelAnimationFrame(t),n.unobserve(e)}}},[e,r])}var $Lt=fLt,HLt=vLt,WLt=ELt;const ULt=s.forwardRef(({className:e,children:r,...n},o)=>t.jsxs($Lt,{ref:o,className:zdt("relative overflow-hidden",e),...n,children:[t.jsx(HLt,{className:"h-full w-full rounded-[inherit]",children:r}),t.jsx(YLt,{}),t.jsx(WLt,{})]}));ULt.displayName=$Lt.displayName;const YLt=s.forwardRef(({className:e,orientation:r="vertical",...n},o)=>t.jsx(gLt,{ref:o,orientation:r,className:zdt("flex touch-none select-none transition-colors","vertical"===r&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===r&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:t.jsx(SLt,{className:"relative flex-1 rounded-full bg-border"})}));YLt.displayName=gLt.displayName;const ZLt=(e,t)=>{const[r,n]=e.split(":").map(Number),o=Dst(Ost(new Date,n),r);return t?sst(o,"HH:mm"):sst(o,"h:mm").toLowerCase()+sst(o,"a").toLowerCase()},KLt=(e,t,r)=>r?sst(Dst(e,t),"HH:mm"):sst(Dst(e,t),"h a").toLowerCase(),GLt=e=>{const t=Bat.find(t=>t.value===e);return t?t.class:Bat[0].class},XLt=({className:e,style:r})=>t.jsx(rOt.div,{className:zdt("bg-gray-50 dark:bg-transparent rounded-md overflow-hidden relative",e),style:r,initial:{opacity:.4},animate:{opacity:[.4,.5,.4]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},children:t.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-gray-200 dark:via-muted-foreground to-transparent skeleton-shimmer"})}),QLt=({filteredEvents:e,currentDate:r,hoverLineRef:n,hoverTimeRef:o,setClickedTime:a,currentConfig:i,isAddEventPopupOpen:s,onEventAdd:l,onEventUpdate:c,onEventDelete:u,is24HourFormat:d,clickedTime:p,currentTimeLineRef:h,currentTimeTop:f,isLoading:m,setIsAddEventPopupOpen:v,onDateRangeChange:y})=>{var g,x;const b=e.filter(e=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,r)))&&IPt(r,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?mst(r,{start:iit(e.startDate),end:git(e.endDate)}):hit(e.startDate,r)),k=Array.from({length:24},(e,t)=>t),_=(e,t)=>{if(e.isRepeating){const r=`${ZLt(e.startTime,d)} - ${ZLt(e.endTime,d)}`,n=sst(e.startDate,"MMM d"),o=sst(e.endDate||e.startDate,"MMM d"),a=sst(t,"EEEE"),s=sst(t,"do");switch(e.isRepeatingInterval||"daily"){case"daily":default:return i.localization.repeatDailyDescription.replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o);case"weekly":return i.localization.repeatWeeklyDescription.replace("{dayName}",a).replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o);case"monthly":return i.localization.repeatMonthlyDescription.replace("{dayOfMonth}",s).replace("{timeRange}",r).replace("{startDate}",n).replace("{endDate}",o)}}else if(e.endDate&&!hit(e.startDate,e.endDate)){const r=Math.floor(vit(git(e.endDate),iit(e.startDate)))+1,n=Math.floor(vit(iit(t),iit(e.startDate)))+1;return i.localization.dayXofY.replace("{x}",n.toString()).replace("{y}",r.toString())}return null},w=b.reduce((e,t)=>{const n="00:00"===t.startTime&&"23:59"===t.endTime,o=t.endDate&&!hit(t.startDate,t.endDate);return t.isRepeating?n?e.repeatingFullDayEvents.push(t):e.regularEvents.push(t):o?hit(t.startDate,r)?e.multiDayEvents.push({...t,isStart:!0}):hit(t.endDate,r)?e.multiDayEvents.push({...t,isEnd:!0}):e.multiDayEvents.push({...t,isMiddle:!0}):n?e.fullDayEvents.push(t):e.regularEvents.push(t),e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}),M=[...w.repeatingFullDayEvents,...w.multiDayEvents,...w.fullDayEvents],C=w.regularEvents,{sortedEvents:j,eventPositions:D,maxColumn:O}=(e=>{const t=e.sort((e,t)=>{const n=yst(`${sst(r,"yyyy-MM-dd")}T${e.startTime}`),o=yst(`${sst(r,"yyyy-MM-dd")}T${t.startTime}`);return n.getTime()-o.getTime()}),n={};let o=0;const a=(e,t)=>{const n=yst(`${sst(r,"yyyy-MM-dd")}T${e.startTime}`),o=yst(`${sst(r,"yyyy-MM-dd")}T${e.endTime}`),a=yst(`${sst(r,"yyyy-MM-dd")}T${t.startTime}`);return n<yst(`${sst(r,"yyyy-MM-dd")}T${t.endTime}`)&&a<o};return t.forEach((e,r)=>{let i=0,s=!1;for(let o=0;o<r;o++)a(e,t[o])&&(i=Math.max(i,n[t[o].id].column+1),s=!0);n[e.id]={column:i,span:1},s&&(o=Math.max(o,i))}),0===o?(t.forEach(e=>{n[e.id]={column:0,span:1}}),{sortedEvents:t,eventPositions:n,maxColumn:1}):(t.forEach(e=>{if(n[e.id].column<o){let r=1;for(;r+n[e.id].column<=o&&!t.some(t=>n[t.id].column===n[e.id].column+r&&a(e,t));)r++;n[e.id].span=r}}),{sortedEvents:t,eventPositions:n,maxColumn:o+1})})(C),S=({event:e,currentDate:r})=>t.jsx(PEt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:r,translations:i.localization,children:t.jsxs("div",{className:zdt(GLt(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}})(),"min-h-[44px]"),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsxs("div",{className:"text-xs font-medium",children:[ZLt(e.startTime,d)," - ",ZLt(e.endTime,d)]})]}),t.jsx("div",{className:"text-xs italic",children:_(e,r||new Date)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),P=({event:e,currentDate:r})=>t.jsx(PEt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:r,translations:i.localization,children:t.jsxs("div",{className:zdt(GLt(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[44px]",e.isStart&&["border-l-4","border-l-black/70 dark:border-l-white/50"],e.isEnd&&["border-r-4","border-r-black/70 dark:border-r-white/50"],e.isMiddle&&"border-x-0"),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsx("div",{className:"text-xs font-medium",children:e.isStart?`${i.localization.starts}: ${ZLt(e.startTime,d)}`:e.isEnd?`${i.localization.ends}: ${ZLt(e.endTime,d)}`:i.localization.allDay})]}),t.jsx("div",{className:"text-xs italic",children:_(e,r||new Date)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),T=({event:e})=>t.jsx(PEt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:r,translations:i.localization,children:t.jsxs("div",{className:zdt(GLt(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[44px]","border-l-4 border-r-4","border-black/70 dark:border-white/50"),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||"Untitled Event"}),t.jsx("div",{className:"text-xs font-medium",children:i.localization.allDay})]}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id),E=({event:e,currentDate:r,index:n})=>e.isRepeating?t.jsx(S,{event:e,currentDate:r,index:n}):e.endDate&&!hit(e.startDate,e.endDate)?t.jsx(P,{event:e,currentDate:r,index:n}):t.jsx(T,{event:e,index:n});return t.jsxs(nLt,{className:"pb-4 pl-4 pr-4",children:[t.jsxs("div",{className:"sticky top-0 bg-background z-20 pt-4 pb-1",children:[t.jsx("h2",{className:"text-xl font-bold mb-4",children:`${i.localization.monthNames[r.getMonth()]} ${r.getDate()}, ${r.getFullYear()}`}),M.length>0&&t.jsxs("div",{className:"mb-4",children:[t.jsxs("h3",{className:"text-sm font-semibold mb-2",children:[i.localization.fullDayEvents," (",M.length,")"]}),M.map((e,n)=>t.jsx(rOt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.05*n},className:"space-y-2 mb-1",children:t.jsx(E,{event:e,currentDate:r,index:n},e.id)},e.id))]})]}),t.jsx(ULt,{className:"px-4 h-[570px]",children:t.jsxs("div",{className:"relative mt-2 mb-2",children:[t.jsx("div",{className:"absolute left-0 w-16 z-10 bg-background",children:t.jsx(PEt,{translations:i.localization,onAddEvent:l,event:{startDate:r,endDate:r,startTime:p||sst(new Date,"HH:mm"),endTime:p?eit(yst(`2000-01-01T${p}`),1).toTimeString().slice(0,5):sst(eit(new Date,1),"HH:mm")},children:t.jsx("div",{onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top;let a,i,s;if(e.ctrlKey){const e=15*Math.round(r/64*60/15);a=Math.floor(e/60),i=e%60,s=e/60*64}else a=Math.floor(r/64),i=Math.floor(r%64/64*60),s=r;const l=`${a.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`;n.current&&(n.current.style.top=`${s}px`,n.current.style.display="block"),o.current&&(o.current.textContent=l)},onMouseLeave:()=>{n.current&&(n.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=Math.floor(r/64),o=Math.floor(r%64/64*60),i=`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`;a(i)},children:k.map(e=>t.jsx("div",{className:"cursor-pointer h-16 pr-2 text-right text-sm text-muted-foreground",children:KLt(r,e,d)},`hour-${e}`))})})}),t.jsxs("div",{className:"ml-16 relative",onDoubleClick:e=>{if(s||!i.dayView.enableDoubleClickToAddEvent)return;const t=e.currentTarget.getBoundingClientRect(),n=e.clientY-t.top,o=Math.floor(n/(16/15)),a=Math.floor(o/60),c=o%60,u=`${a.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`,d=`${(a+1).toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;l({title:"",startDate:r,endDate:r,startTime:u,endTime:d,color:"blue",isRepeating:!1})},children:[k.map(e=>t.jsx("div",{className:"h-16 border-t border-border"},e)),!(null!=(g=i.dayView)&&g.hideHoverLine)&&t.jsx("div",{ref:n,className:"absolute left-0 right-0 h-px bg-primary z-40 pointer-events-none",style:{display:"none"},children:t.jsx("span",{ref:o,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})}),hit(r,new Date)&&!(null!=(x=i.dayView)&&x.hideTimeline)&&t.jsx("div",{ref:h,className:"absolute left-0 right-0 h-px bg-red-500 z-30 pointer-events-none",style:{top:`${f}px`},children:t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:sst(new Date,"HH:mm")})}),m&&y&&Array.from({length:10}).map((e,r)=>t.jsx(XLt,{className:"absolute top-0 left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r)),j.map((e,n)=>{const o=yst(`${sst(r,"yyyy-MM-dd")}T${e.startTime}`),a=yst(`${sst(r,"yyyy-MM-dd")}T${e.endTime}`),s=60*o.getHours()+o.getMinutes(),p=60*a.getHours()+a.getMinutes()-s,{column:h,span:f}=D[e.id],m=f/O*100,y=h/O*100,g=_(e,r);return t.jsx(PEt,{event:e,onAddEvent:l,onUpdateEvent:c,onDeleteEvent:u,onOpenChange:v,dateFromViewClick:r,translations:i.localization,children:t.jsxs(rOt.div,{className:zdt(GLt(e.color),"absolute px-2 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{if(!e.isRepeating)return"";switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}})()),style:{top:s*(16/15)+"px",height:`${Math.max(p*(16/15),24)}px`,left:`${y}%`,width:`${m}%`,zIndex:n+1},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*n},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||i.localization.untitledEvent}),t.jsxs("div",{className:"text-xs",children:[ZLt(e.startTime,d)," - ",ZLt(e.endTime,d)]}),e.description&&t.jsx("div",{className:"text-xs font-semibold truncate",children:e.description}),g&&t.jsx("div",{className:"text-xs italic",children:g})]})},`${e.id}-${e.startTime}`)})]})]})})]})},JLt=({events:r,date:n,addEvent:o,updateEvent:a,getEventColor:i,onDelete:s,children:l,onOpenChange:c,preSelectedColor:u,is24HourFormat:d,translations:p})=>{const[h,f]=e.useState(null),[m,v]=e.useState(!1),y=e=>{h&&(a(e),f(null))},g=e=>{const t=e.endDate&&!hit(e.startDate,e.endDate),r=hit(e.startDate,n),o=e.endDate&&hit(e.endDate,n),a=t&&!r&&!o,s=e.isRepeating?zdt("border-2 dark:border border-dashed border-opacity-50",r&&"border-l-solid border-l-2 border-l-black/90 dark:border-l-white/50",o&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",a&&"border-x-0"):zdt(r&&"border-l-4 border-l-black/70 dark:border-l-white/50",o&&"border-r-4 border-r-black/70 dark:border-r-white/50",a&&"border-x-0");return zdt(i(e.color),"p-2 rounded cursor-pointer hover:opacity-80 transition-opacity w-full text-left","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",s)},x=e=>{const t=hit(e.startDate,n),r=e.endDate&&hit(e.endDate,n);return!t||e.endDate&&!hit(e.startDate,e.endDate)?t?`Starts ${ZLt(e.startTime,d)}`:r?e.isRepeating?`Ends today (${ZLt(e.startTime,d)} - ${ZLt(e.endTime,d)})`:`Ends ${ZLt(e.endTime,d)}`:e.isRepeating?`${ZLt(e.startTime,d)} - ${ZLt(e.endTime,d)}`:"All day":`${ZLt(e.startTime,d)} - ${ZLt(e.endTime,d)}`};return t.jsxs(Adt,{open:m,onOpenChange:v,children:[t.jsx(Rdt,{asChild:!0,children:l}),t.jsxs(Bdt,{className:"sm:max-w-[425px]",children:[t.jsx(Vdt,{children:t.jsx(qdt,{children:sst(n,"MMMM d, yyyy")})}),t.jsx(ULt,{className:"h-[300px] mt-4",children:t.jsx("div",{className:"space-y-2 pr-4 flex flex-col items-center pl-6",children:r.sort((e,t)=>new Date(`${sst(n,"yyyy-MM-dd")}T${e.startTime}`).getTime()-new Date(`${sst(n,"yyyy-MM-dd")}T${t.startTime}`).getTime()).map(e=>t.jsx(PEt,{event:e,onAddEvent:o,onUpdateEvent:y,onDeleteEvent:s,onOpenChange:c,dateFromViewClick:n,translations:p,children:t.jsxs("div",{className:g(e),onClick:()=>(e=>{f(e),v(!0)})(e),children:[e.title&&t.jsx("div",{className:"font-semibold truncate",children:e.title}),t.jsx("div",{className:"text-xs",children:x(e)}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description})]})},e.id))})}),t.jsxs("div",{className:"mt-4 flex justify-between items-center",children:[t.jsx(PEt,{translations:p,event:{startDate:n,endDate:n,color:u},onAddEvent:o,dateFromViewClick:n,children:t.jsxs($ht,{variant:"outline",className:"flex-grow mr-2",children:[t.jsx(Gst,{className:"mr-2 h-4 w-4"}),p.addEvent]})}),t.jsx($ht,{variant:"outline",onClick:()=>{f(null),v(!1)},children:"Close"})]})]})]})},eBt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,onEventAdd:a,onEventUpdate:i,onEventDelete:s,isLoading:l,hoverLineRef:c,hoverTimeRef:u,clickedTime:d,setClickedTime:p,currentTimeLineRef:h,currentTimeTop:f,isAddEventPopupOpen:m,setIsAddEventPopupOpen:v,onDateRangeChange:y})=>{var g,x;const b=Array.from(new Set(e.map(e=>e.color))).sort((e,t)=>{const r=Bat.findIndex(t=>t.value===e),n=Bat.findIndex(e=>e.value===t);return r-n}),k=e.filter(e=>{const t=iit(e.startDate),n=iit(r);return e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,n)))&&IPt(n,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?mst(n,{start:t,end:git(e.endDate)}):hit(t,n)}),_=Array.from({length:24},(e,t)=>({hour:t,label:KLt(r,t,o)})),w=e=>{if(!e.isRepeating)return zdt(e.isStart&&"border-l-4 border-l-black/70 dark:border-l-white/50",e.isEnd&&"border-r-4 border-r-black/70 dark:border-r-white/50",e.isMiddle&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}},M=e=>{if(!e.isRepeating)return zdt(e.isStart&&"border-l-4 border-l-black/70 dark:border-l-white/50",e.isEnd&&"border-r-4 border-r-black/70 dark:border-r-white/50",e.isMiddle&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":default:return"border border-dashed border-opacity-50";case"weekly":case"monthly":return"border border-dotted border-opacity-50"}};return t.jsx(nLt,{className:"",children:t.jsxs(ULt,{className:"h-[600px]",children:[t.jsxs("div",{className:"flex pl-2 pr-2",children:[t.jsxs("div",{className:"sticky left-0 z-30 w-16 bg-background border-r border-border h-full",children:[t.jsx("div",{className:"sticky top-0 z-[200] bg-background h-12 border-b border-border"}),t.jsx("div",{className:"sticky top-12 z-[200] bg-background h-[3.1rem] flex items-center justify-end pr-4 text-sm text-muted-foreground border-b border-border",children:n.localization.allDay}),t.jsx(PEt,{onAddEvent:a,onDeleteEvent:s,event:{startDate:r,endDate:r,startTime:d||sst(new Date,"HH:mm"),endTime:sst(eit(d?yst(`2000-01-01T${d}`):new Date,1),"HH:mm"),color:null!=b&&b.length?b[0]:void 0},translations:n.localization,children:t.jsx("div",{onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=r+96;let o,a,i;if(e.ctrlKey){const e=15*Math.round(r/64*60/15);o=Math.floor(e/60),a=e%60,i=e/60*64+96}else o=Math.floor(r/64),a=Math.floor(r%64/64*60),i=n;o=Math.max(0,Math.min(23,o)),a=Math.max(0,Math.min(59,a));const s=`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`;c.current&&(c.current.style.top=`${i}px`,c.current.style.display="block"),u.current&&(u.current.textContent=s)},onMouseLeave:()=>{c.current&&(c.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top,n=Math.floor(r/64),o=Math.floor(r%64/64*60),a=`${n.toString().padStart(2,"0")}:${o.toString().padStart(2,"0")}`;p(a)},children:_.map(({hour:e,label:r})=>t.jsx("div",{className:"h-16 flex items-center justify-end pr-4 text-sm text-muted-foreground cursor-pointer",children:t.jsx("span",{className:"mt-[-46px]",children:r})},e))})})]}),t.jsx("div",{className:"flex-1 relative",children:t.jsxs("div",{className:"grid pb-4",style:{gridTemplateColumns:`repeat(${b.length}, 1fr)`},children:[!(null!=(g=n.dayView)&&g.hideHoverLine)&&t.jsx("div",{className:"absolute inset-0 pointer-events-none",style:{zIndex:150},children:t.jsx("div",{ref:c,className:"absolute left-0 right-0 h-px bg-primary",style:{display:"none"},children:t.jsx("span",{ref:u,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})})}),hit(r,new Date)&&!(null!=(x=n.dayView)&&x.hideTimeline)&&t.jsx("div",{ref:h,className:"absolute left-0 right-0 h-px bg-red-500 pointer-events-none",style:{top:`${f}px`,zIndex:30},children:t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:sst(new Date,"HH:mm")})}),b.map(e=>{const c=Bat.find(t=>t.value===e),u=k.filter(t=>t.color===e),{allDayEvents:d,regularEvents:p}=(e=>e.reduce((e,t)=>{const n="00:00"===t.startTime&&"23:59"===t.endTime,o=t.endDate&&!hit(t.startDate,t.endDate);return n?o?hit(t.startDate,r)?e.allDayEvents.push({...t,isStart:!0}):hit(t.endDate,r)?e.allDayEvents.push({...t,isEnd:!0}):e.allDayEvents.push({...t,isMiddle:!0}):e.allDayEvents.push(t):e.regularEvents.push(t),e},{allDayEvents:[],regularEvents:[]}))(u),{events:h,totalColumns:f}=(e=>{const t=e.map(e=>{const t="00:00"===e.startTime&&"23:59"===e.endTime,n=t?0:60*parseInt(e.startTime.split(":")[0])+parseInt(e.startTime.split(":")[1]),o=t?1440:60*parseInt(e.endTime.split(":")[0])+parseInt(e.endTime.split(":")[1]),a=e.endDate&&!hit(e.startDate,e.endDate),i=a&&hit(e.startDate,r),s=a&&hit(e.endDate,r);return{...e,isAllDay:t,startMinutes:n,endMinutes:o,column:0,width:1,isStart:i,isEnd:s,isMiddle:a&&!i&&!s}}).sort((e,t)=>e.isAllDay&&!t.isAllDay?-1:!e.isAllDay&&t.isAllDay?1:e.startMinutes-t.startMinutes),n=[];return t.forEach(e=>{let r=0;for(;;){if(!t.some(t=>t.column===r&&e!==t&&!(e.startMinutes>=t.endMinutes||e.endMinutes<=t.startMinutes))){e.column=r,n[r]=(n[r]||0)+1;break}r++}}),t.forEach(e=>{let r=1,o=e.column+1;for(;o<n.length&&!t.some(t=>t.column===o&&!(e.startMinutes>=t.endMinutes||e.endMinutes<=t.startMinutes));)r++,o++;e.width=r}),{events:t,totalColumns:Math.max(...n.map((e,t)=>t+1),1)}})(p),g=(e,t)=>{const r="00:00"===e.startTime&&"23:59"===e.endTime;if(e.isRepeating&&!r){const r=iit(e.startDate),o=iit(e.endDate||e.startDate);let a,i;switch(e.isRepeatingInterval||"daily"){case"weekly":a=Math.floor(vit(o,r)/7)+1,i=Math.floor(vit(t,r)/7)+1;break;case"monthly":a=12*(o.getFullYear()-r.getFullYear())+o.getMonth()-r.getMonth()+1,i=12*(t.getFullYear()-r.getFullYear())+t.getMonth()-r.getMonth()+1;break;default:a=vit(o,r)+1,i=vit(t,r)+1}return n.localization.repeatXofY.replace("{x}",i.toString()).replace("{y}",a.toString())}};return t.jsxs("div",{className:"relative border-r border-border flex-1",children:[t.jsx("div",{className:"sticky top-0 z-50 bg-background h-12 flex items-center justify-center border-b border-border",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:zdt("w-3 h-3 rounded-full flex-shrink-0 hidden sm:block text-center",null==c?void 0:c.class)}),t.jsx("div",{className:"max-w-[150px] sm:max-w-[200px]",children:t.jsxs("span",{className:"relative font-medium text-sm sm:text-base group",children:[t.jsxs("span",{className:"block truncate",children:[null==c?void 0:c.label,u.length>0&&` (${u.length})`]}),t.jsx("span",{className:zdt("absolute bottom-0 left-0 w-full h-[2px] sm:hidden",null==c?void 0:c.class)})]})})]})}),t.jsx("div",{className:"sticky top-12 z-50 bg-background min-h-[50px] border-b border-border",children:d.length<=1?d.map(e=>t.jsx("div",{className:"px-1 py-0.5",children:t.jsx(PEt,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:s,dateFromViewClick:r,translations:n.localization,children:t.jsx(rOt.div,{className:zdt(GLt(e.color),"rounded px-2 py-1 mb-0.5 last:mb-0 cursor-pointer","hover:bg-opacity-40 dark:hover:bg-opacity-40 transition-colors",w(e)),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:t.jsxs("div",{className:"max-w-28 md:max-w-48",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||n.localization.untitledEvent}),t.jsx("div",{className:"text-xs font-medium truncate",children:e.isStart?`${n.localization.starts}: ${ZLt(e.startTime,o)}`:e.isEnd?`${n.localization.ends}: ${ZLt(e.endTime,o)}`:null})]}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description}),g(e,r)&&t.jsx("div",{className:"text-xs italic",children:g(e,r)})]})})},e.id)})):t.jsx("div",{className:"px-1 py-0.5",children:t.jsx(JLt,{events:d,date:r,addEvent:a,updateEvent:i,is24HourFormat:o,getEventColor:GLt,onDelete:s,translations:n.localization,preSelectedColor:e,children:t.jsxs(rOt.div,{className:zdt(GLt(d[0].color),"rounded px-2 py-1 cursor-pointer group","hover:bg-opacity-40 dark:hover:bg-opacity-40 transition-colors","border border-dashed border-opacity-50"),initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:[t.jsx("div",{className:"flex items-center justify-between",children:t.jsxs("span",{className:"text-xs font-medium",children:[d.length," ",n.localization.allDay]})}),t.jsxs("div",{className:"text-xs mt-0.5 truncate max-w-24 sm:max-w-44",children:[d.slice(0,3).map(e=>e.title||n.localization.untitledEvent).join(", "),d.length>3&&`, +${d.length-3} more`]})]})})})}),t.jsxs("div",{className:"relative",onDoubleClick:t=>((e,t)=>{if(m||!n.dayView.enableDoubleClickToAddEvent)return;const o=e.currentTarget.getBoundingClientRect(),i=e.clientY-o.top,s=Math.floor(i/(16/15)),l=Math.floor(s/60),c=s%60,u=`${l.toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`,d=`${(l+1).toString().padStart(2,"0")}:${c.toString().padStart(2,"0")}`;a({title:"",startDate:r,endDate:r,startTime:u,endTime:d,color:t,isRepeating:!1})})(t,e),children:[_.map(({hour:e})=>t.jsx("div",{className:"h-16 border-b border-border"},e)),l&&y&&Array.from({length:10}).map((e,r)=>t.jsx(XLt,{className:"absolute left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r)),t.jsx("div",{className:"absolute inset-0",children:h.map((e,l)=>{const c=e.column*(100/f),u=e.width*(100/f);return t.jsx(PEt,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:s,onOpenChange:v,dateFromViewClick:r,translations:n.localization,children:t.jsxs(rOt.div,{className:zdt(GLt(e.color),"absolute px-2 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",M(e)),style:{top:e.startMinutes*(16/15)+"px",height:`${Math.max((e.endMinutes-e.startMinutes)*(16/15),24)}px`,left:`${c}%`,width:`${u}%`},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*l},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:e.title||n.localization.untitledEvent}),t.jsx("div",{className:"text-xs",children:e.isStart?`${n.localization.starts}: ${ZLt(e.startTime,o)}`:e.isEnd?`${n.localization.ends}: ${ZLt(e.endTime,o)}`:`${ZLt(e.startTime,o)} - ${ZLt(e.endTime,o)}`}),e.description&&t.jsx("div",{className:"text-xs truncate mt-0.5",children:e.description}),(e.isRepeating||e.isStart||e.isEnd||e.isMiddle)&&t.jsx("div",{className:"text-xs italic",children:g(e,r)})]})},e.id)})})]})]},e)})]})})]}),t.jsx(YLt,{orientation:"horizontal"})]})})},tBt=({filteredEvents:e,currentDate:r,currentConfig:n,isLoading:o,is24HourFormat:a,clickedTime:i,currentTimeTop:s,hoverLineRef:l,hoverTimeRef:c,currentTimeLineRef:u,setClickedTime:d,onEventAdd:p,onEventUpdate:h,onEventDelete:f,onDateRangeChange:m,isAddEventPopupOpen:v,setIsAddEventPopupOpen:y})=>{var g;const x={filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:a,onEventAdd:p,onEventUpdate:h,onEventDelete:f,hoverLineRef:l,hoverTimeRef:c,clickedTime:i,setClickedTime:d,currentTimeLineRef:u,currentTimeTop:s,isLoading:o,isAddEventPopupOpen:v,setIsAddEventPopupOpen:y,onDateRangeChange:m};return t.jsx(t.Fragment,{children:"resource"===(null==(g=n.dayView)?void 0:g.viewType)?t.jsx(eBt,{...x}):t.jsx(QLt,{...x})})},rBt=({filteredEvents:e,currentDate:r,is24HourFormat:n,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,isAddEventPopupOpen:l,currentConfig:c,setCurrentDate:u,setCurrentView:d,onEventUpdate:p,onEventDelete:h,onEventAdd:f,setIsAddEventPopupOpen:m,isLoading:v,currentTimeLineRef:y,currentTimeTop:g,onDateRangeChange:x})=>{var b,k;const _=nit(r,{weekStartsOn:n?1:0}),w=Mit(r,{weekStartsOn:n?1:0}),M=bit({start:_,end:w}),C=Array.from({length:24},(e,t)=>t),j=Fit(_,{weekStartsOn:n?1:0}),D=(e,t)=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,t)))&&IPt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const r=iit(e.startDate),n=git(e.endDate||e.startDate);return mst(t,{start:r,end:n})},O=e.filter(e=>e.isRepeating?M.some(t=>IPt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily")):mst(e.startDate,{start:_,end:w})||e.endDate&&mst(e.endDate,{start:_,end:w})),S=O.reduce((e,t)=>{const r="00:00"===t.startTime&&"23:59"===t.endTime,n=t.endDate&&!hit(t.startDate,t.endDate);return t.isRepeating?r?e.repeatingFullDayEvents.push(t):e.regularEvents.push(t):n?e.multiDayEvents.push(t):r?e.fullDayEvents.push(t):e.regularEvents.push(t),e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}),P=[...S.repeatingFullDayEvents,...S.multiDayEvents,...S.fullDayEvents],T=({event:e,day:r})=>{var n,o,a;const i=e.endDate&&!hit(e.startDate,e.endDate),s=hit(e.startDate,r),l=e.endDate&&hit(e.endDate,r),u=i&&!s&&!l;return t.jsx(PEt,{event:e,onAddEvent:f,onUpdateEvent:p,onDeleteEvent:h,dateFromViewClick:r,translations:c.localization,children:t.jsxs("div",{className:zdt(GLt(e.color),"px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40","min-h-[24px] text-xs",(()=>{if(!e.isRepeating)return zdt(s&&"border-l-4 border-l-black/70 dark:border-l-white/50",l&&"border-r-4 border-r-black/70 dark:border-r-white/50",u&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return zdt("border border-dashed border-opacity-50",s&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50",l&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",u&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})()),children:[t.jsx("div",{className:"font-semibold truncate",children:e.title||"Untitled Event"}),e.description&&t.jsx("div",{className:"truncate",children:e.description}),e.isRepeating&&t.jsx("div",{className:"text-[10px] opacity-75",children:"daily"===e.isRepeatingInterval?null==(n=c.localization)?void 0:n.repeatDaily:"weekly"===e.isRepeatingInterval?null==(o=c.localization)?void 0:o.repeatWeekly:null==(a=c.localization)?void 0:a.repeatMonthly})]})},e.id)};return t.jsxs(nLt,{className:"p-4",children:[P.length>0&&t.jsxs("div",{className:"mb-4 relative z-20",children:[t.jsx("div",{className:"grid grid-cols-8 gap-0",children:M.map(e=>t.jsx("div",{className:"text-center text-xs font-semibold"},e.toString()))}),t.jsxs("div",{className:"grid grid-cols-8 gap-0 relative",children:[t.jsx("div",{className:"absolute left-0 top-0 bottom-2 w-[12.5%] flex items-center justify-center z-10",children:t.jsxs("div",{className:"text-xs truncate font-semibold whitespace-nowrap",children:[c.localization.fullDayEvents," (",P.length,")"]})}),P.map((e,r)=>t.jsxs(rOt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.05*r},className:"col-span-8 grid grid-cols-8 gap-0 mb-1",children:[t.jsx("div",{className:"w-[12.5%]"}),M.map(r=>t.jsx("div",{className:"min-h-[24px] px-1",children:mst(r,{start:e.startDate,end:e.endDate||e.startDate})&&t.jsx(T,{event:e,day:r})},`${e.id}-${r.toString()}`))]},e.id))]})]}),t.jsx(ULt,{className:"h-[600px]",children:t.jsxs("div",{className:"relative mb-2",children:[t.jsxs("div",{className:"grid grid-cols-8 gap-0",children:[t.jsx(PEt,{event:{startDate:_,endDate:w,startTime:s||sst(new Date,"HH:mm"),endTime:sst(eit(s?yst(`2000-01-01T${s}`):new Date,1),"HH:mm"),isRepeating:!0},onAddEvent:f,dateFromViewClick:_,translations:c.localization,children:t.jsxs("div",{className:"sticky top-0 left-0 z-30 bg-background",onMouseMove:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top-48,n=Math.max(0,r);let i,s,l;if(e.ctrlKey){const e=15*Math.round(n/64*60/15);i=Math.floor(e/60),s=e%60,l=e/60*64}else i=Math.floor(n/64),s=Math.floor(n%64/64*60),l=n;const c=`${i.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`;o.current&&(o.current.style.top=`${l+48}px`,o.current.style.display="block"),a.current&&(a.current.textContent=c)},onMouseLeave:()=>{o.current&&(o.current.style.display="none")},onClick:e=>{const t=e.currentTarget.getBoundingClientRect(),r=e.clientY-t.top-48,n=Math.max(0,r),o=Math.floor(n/64),a=Math.floor(n%64/64*60),s=`${o.toString().padStart(2,"0")}:${a.toString().padStart(2,"0")}`;i(s)},children:[t.jsx("div",{className:"sticky top-0 left-0 bg-background h-12 border-b border-r border-border flex items-center justify-center",children:t.jsxs("span",{className:"text-xs font-semibold text-muted-foreground bg-background",children:["Week ",j]})}),C.map(e=>t.jsx("div",{className:"cursor-pointer h-16 pr-2 text-center text-sm text-muted-foreground border-r border-border",children:KLt(r,e,n)},e))]})}),t.jsx("div",{className:"col-span-7 relative z-20",children:t.jsxs("div",{className:"grid grid-cols-7 gap-0",children:[M.map((e,r)=>{const o=S.regularEvents.filter(t=>D(t,e)),{sortedEvents:a,eventPositions:i,maxColumn:s}=((e,t)=>{const r=e.filter(e=>D(e,t)).sort((e,r)=>{const n=yst(`${sst(t,"yyyy-MM-dd")}T${e.startTime}`),o=yst(`${sst(t,"yyyy-MM-dd")}T${r.startTime}`);return n.getTime()-o.getTime()}),n={};let o=0;const a=(e,r)=>{const n=yst(`${sst(t,"yyyy-MM-dd")}T${e.startTime}`),o=yst(`${sst(t,"yyyy-MM-dd")}T${e.endTime}`),a=yst(`${sst(t,"yyyy-MM-dd")}T${r.startTime}`);return n<yst(`${sst(t,"yyyy-MM-dd")}T${r.endTime}`)&&a<o};return r.forEach((e,t)=>{let i=0,s=!1;for(let o=0;o<t;o++)a(e,r[o])&&(i=Math.max(i,n[r[o].id].column+1),s=!0);n[e.id]={column:i,span:1},s&&(o=Math.max(o,i))}),0===o?(r.forEach(e=>{n[e.id]={column:0,span:1}}),{sortedEvents:r,eventPositions:n,maxColumn:1}):(r.forEach(e=>{if(n[e.id].column<o){let t=1;for(;t+n[e.id].column<=o&&!r.some(r=>n[r.id].column===n[e.id].column+t&&a(e,r));)t++;n[e.id].span=t}}),{sortedEvents:r,eventPositions:n,maxColumn:o+1})})(o,e);return t.jsxs("div",{className:"relative",onDoubleClick:()=>(e=>{l||c.weekView.enableDoubleClickToShiftViewToDaily&&(u(e),d("day"))})(e),children:[t.jsx("div",{className:"sticky top-0 z-30 bg-background h-12 flex items-center justify-center border-b border-border",children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-xs font-semibold",children:c.localization.dayNames[e.getDay()].slice(0,3)}),t.jsx("div",{className:"text-sm "+(hit(e,new Date)?"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center mx-auto":""),children:sst(e,"d")})]})}),t.jsxs("div",{className:"relative h-[calc(100%-3rem)]",children:[C.map((e,r)=>t.jsx("div",{className:zdt("h-16",0!==r&&"border-t border-border",r===C.length-1&&"border-b border-border")},e)),a.map((r,o)=>{const{top:a,height:l}=((e,t)=>{const r=yst(`${sst(e.startDate,"yyyy-MM-dd")}T${e.startTime}`),n=yst(`${sst(e.endDate||e.startDate,"yyyy-MM-dd")}T${e.endTime}`),o=iit(t),a=git(t);let i,s;e.isRepeating?(i=Ost(Dst(t,r.getHours()),r.getMinutes()),s=Ost(Dst(t,n.getHours()),n.getMinutes())):(i=dit([r,o]),s=pit([n,a]));const l=i.getHours()+i.getMinutes()/60;return{top:64*l,height:64*(s.getHours()+s.getMinutes()/60-l)}})(r,e),{column:u,span:d}=i[r.id],v=d/s*100,y=u/s*100,g=((e,t)=>{var r,n,o,a,i,s;if(!e.isRepeating){if(e.endDate&&!hit(e.startDate,e.endDate)){const r=Math.floor(vit(git(e.endDate),iit(e.startDate)))+1;return`Day ${Math.floor(vit(iit(t),iit(e.startDate)))+1} of ${r}`}return null}switch(e.isRepeatingInterval||"daily"){case"daily":{const a=Math.floor(vit(yst(`${sst(e.endDate||e.startDate,"yyyy-MM-dd")}T${e.endTime}`),yst(`${sst(e.startDate,"yyyy-MM-dd")}T${e.startTime}`)))+1,i=bit({start:iit(e.startDate),end:iit(e.endDate||e.startDate)}),s=(null==(r=e.isRepeatingExcludedDates)?void 0:r.filter(e=>i.some(t=>hit(t,e))).length)||0,l=a-s,u=bit({start:iit(e.startDate),end:iit(t)}),d=(null==(n=e.isRepeatingExcludedDates)?void 0:n.filter(e=>u.some(t=>hit(t,e))).length)||0,p=Math.floor(vit(iit(t),iit(e.startDate)))+1-d;return`${null==(o=c.localization)?void 0:o.repeatDaily} ${p} of ${l}`}case"weekly":{const e=cst(t),r=null==(a=c.localization)?void 0:a.dayNames[e];return`${null==(i=c.localization)?void 0:i.repeatWeekly} ${r}`}case"monthly":return`${null==(s=c.localization)?void 0:s.repeatMonthly} ${sst(t,"do")}`;default:return null}})(r,e),x=hit(r.startDate,e),b=r.endDate&&hit(r.endDate,e);return t.jsx(PEt,{event:r,onAddEvent:f,onUpdateEvent:p,onDeleteEvent:h,onOpenChange:m,dateFromViewClick:e,translations:c.localization,children:t.jsxs(rOt.div,{className:zdt(GLt(r.color),"absolute px-1 py-1 rounded overflow-hidden cursor-pointer","transition-colors duration-200","hover:bg-opacity-40 dark:hover:bg-opacity-40",r.isRepeating&&"border border-dashed border-opacity-50",x&&"border-l-1 border-l-black/70 dark:border-l-white/30",b&&"border-r-1 border-r-black/70 dark:border-r-white/30"),style:{top:`${a}px`,height:`${Math.max(l,24)}px`,left:`${y}%`,width:`${v}%`,zIndex:o+1},initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.1*o},children:[t.jsx("div",{className:"text-xs font-semibold truncate",children:r.title||"Untitled Event"}),t.jsxs("div",{className:"text-xs",children:[ZLt(r.startTime,n)," - ",ZLt(r.endTime,n)]}),g&&t.jsx("div",{className:"text-xs italic",children:g})]})},`${r.id}-${e.toISOString()}`)}),v&&x&&Array.from({length:10}).map((e,r)=>t.jsx(XLt,{className:"absolute top-0 left-0 right-0 h-[3px] dark:h-[1px] animate-pulse bg-primary/20",style:{top:64*r+"px"}},r))]}),r<M.length-1&&t.jsx("div",{className:"absolute top-12 right-0 w-px h-[calc(100%-3rem)] bg-border"})]},e.toString())}),t.jsx("div",{className:"absolute top-0 right-0 w-px h-full bg-border"})]})})]}),!(null!=(b=c.weekView)&&b.hideHoverLine)&&t.jsx("div",{ref:o,className:"absolute left-[12.5%] right-0 h-px bg-primary z-50 pointer-events-none",style:{display:"none"},children:t.jsx("span",{ref:a,className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-primary text-primary-foreground text-xs px-1 rounded"})}),M.some(e=>hit(e,new Date))&&!(null!=(k=c.weekView)&&k.hideTimeline)&&t.jsxs("div",{ref:y,className:"absolute left-[12.5%] right-0 h-px bg-red-500 z-40 pointer-events-none",style:{top:`${g+48}px`},children:[t.jsx("span",{className:"absolute left-0 transform -translate-x-full -translate-y-1/2 bg-red-500 text-white text-xs px-1 rounded",children:sst(new Date,"HH:mm")}),M.map((e,r)=>hit(e,new Date)&&t.jsx("div",{className:"absolute h-4 w-[1px] bg-red-500 transform -translate-y-1/2 opacity-75",style:{left:100/7*r+"%",boxShadow:"0 0 4px rgba(239, 68, 68, 0.5)"}},e.toString()))]})]})})]})},nBt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,onEventAdd:a,onEventUpdate:i,onEventDelete:s,isLoading:l,setCurrentDate:c,setCurrentView:u,isAddEventPopupOpen:d,setIsAddEventPopupOpen:p,onDateRangeChange:h})=>{var f;const m=nit(r,{weekStartsOn:o?1:0}),v=bit({start:m,end:Mit(r,{weekStartsOn:o?1:0})}),y=Fit(m,{weekStartsOn:o?1:0}),g=Array.from(new Set(e.map(e=>e.color))).sort((e,t)=>Bat.findIndex(t=>t.value===e)-Bat.findIndex(e=>e.value===t)),x=(e,t)=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,t)))&&IPt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):e.endDate?mst(t,{start:iit(e.startDate),end:git(e.endDate)}):hit(e.startDate,t),b=e=>{d||n.weekView.enableDoubleClickToShiftViewToDaily&&(c(e),u("day"))},k=(null==(f=n.weekView)?void 0:f.resourceDisplayMode)||"row",_=(e,r,l)=>{const c=((e,t)=>{if(e.isRepeating){if("weekly"===e.isRepeatingInterval||"monthly"===e.isRepeatingInterval)return"single";const r=hit(e.startDate,t),n=e.endDate&&hit(e.endDate,t);return r&&n?"single":r?"start":n?"end":"middle"}const r=hit(e.startDate,t),n=e.endDate&&hit(e.endDate,t);return e.endDate?r&&n?"single":r?"start":n?"end":"middle":"single"})(e,r),u=((e,t)=>{if(!e.isRepeating)return zdt("start"===t&&"border-l-4 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-4 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return zdt("border border-dashed border-opacity-50","start"===t&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})(e,c),d=e.isRepeating||"single"===c||"start"===c&&!e.isRepeating||"end"===c&&!e.isRepeating;return t.jsx(PEt,{event:e,onAddEvent:a,onUpdateEvent:i,onDeleteEvent:s,onOpenChange:p,dateFromViewClick:r,translations:n.localization,children:t.jsxs(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{delay:.1*l},className:zdt(GLt(e.color),"mb-1 last:mb-0 px-2 py-1 rounded cursor-pointer","transition-colors duration-200","hover:bg-opacity-50 dark:hover:bg-opacity-60","flex items-center justify-between gap-1",u),children:[t.jsx("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap flex-1 text-xs",children:e.title||n.localization.untitledEvent}),d&&t.jsx("span",{className:"text-[10px] opacity-75 whitespace-nowrap",children:e.isRepeating||"end"!==c?ZLt(e.startTime,o):`ends ${ZLt(e.endTime,o)}`})]})},e.id)},w=(e,r,l)=>e.length<=3?t.jsx(PEt,{event:{startDate:r,endDate:r,color:l},onAddEvent:e=>a({...e}),onOpenChange:p,translations:n.localization,children:t.jsxs(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"group",children:[t.jsx($ht,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2 md:hidden",children:"+"}),t.jsxs($ht,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2 hidden md:block opacity-0 group-hover:opacity-100 transition-opacity duration-200",children:["+ ",n.localization.addEvent]})]})}):t.jsx(JLt,{events:e,addEvent:a,updateEvent:i,onDelete:s,date:r,is24HourFormat:o,getEventColor:GLt,preSelectedColor:l,translations:n.localization,children:t.jsx(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},children:t.jsxs($ht,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2",children:["+",e.length-3," ",n.localization.more]})})});return t.jsx(nLt,{className:"h-full flex flex-col overflow-hidden",children:t.jsxs(ULt,{className:"flex-1 h-[calc(100vh-200px)]",children:[t.jsx("div",{className:"min-w-[768px] relative",children:t.jsx("div",{className:"relative",children:"row"===k?t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sticky top-0 z-30 bg-background grid grid-cols-8 gap-0",style:{gridTemplateColumns:`90px repeat(${v.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"text-xs font-semibold text-center text-muted-foreground",children:[t.jsx("span",{className:"truncate",children:"Week"})," ",y]})}),v.map(e=>t.jsx("div",{className:"border-b border-r border-border p-2 last:border-r-0 h-[50px] flex items-center justify-center",onDoubleClick:()=>b(e),children:t.jsxs("div",{className:"text-center",children:[t.jsx("div",{className:"text-xs font-semibold",children:n.localization.dayNames[e.getDay()].slice(0,3)}),t.jsx("div",{className:zdt("text-sm",hit(e,new Date)&&"bg-primary text-primary-foreground rounded-full w-6 h-6 flex items-center justify-center mx-auto"),children:sst(e,"d")})]})},e.toString()))]}),g.map(r=>{const n=Bat.find(e=>e.value===r);return t.jsxs("div",{className:"grid gap-0",style:{gridTemplateColumns:`90px repeat(${v.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 flex items-center justify-center h-[125px]",children:t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx("div",{className:zdt("w-4 h-4 md:w-5 md:h-5 rounded-full flex-shrink-0",null==n?void 0:n.class)}),t.jsx("span",{className:"text-xs md:text-sm font-medium truncate max-w-[60px]",children:null==n?void 0:n.label})]})}),v.map(n=>{const o=e.filter(e=>e.color===r&&x(e,n));return t.jsxs("div",{className:"border-b border-r border-border p-2 h-[125px] last:border-r-0 relative group overflow-hidden",onDoubleClick:()=>b(n),children:[t.jsxs("div",{className:"relative z-10 h-full flex flex-col",children:[t.jsx("div",{className:"flex-1 overflow-auto",children:o.slice(0,(o.length,3)).map((e,t)=>_(e,n,t))}),t.jsx("div",{className:"mt-auto",children:w(o,n,r)})]}),l&&h&&t.jsx(XLt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"})]},`${r}-${n.toString()}`)})]},r)})]}):t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"sticky top-0 z-30 bg-background grid gap-0",style:{gridTemplateColumns:`90px repeat(${g.length}, minmax(120px, 1fr))`},children:[t.jsx("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"text-xs font-semibold text-center text-muted-foreground",children:[t.jsx("span",{className:"truncate",children:"Week"})," ",y]})}),g.map(e=>{const r=Bat.find(t=>t.value===e);return t.jsx("div",{className:"border-b border-r border-border p-2 last:border-r-0 h-[50px] flex items-center justify-center",children:t.jsxs("div",{className:"flex flex-col items-center justify-center",children:[t.jsx("div",{className:zdt("w-4 h-4 rounded-full",null==r?void 0:r.class)}),t.jsx("div",{className:"text-xs font-medium mt-1 truncate max-w-[90px] text-center",children:null==r?void 0:r.label})]})},e)})]}),v.map(r=>t.jsxs("div",{className:"grid gap-0",style:{gridTemplateColumns:`90px repeat(${g.length}, minmax(120px, 1fr))`},children:[t.jsxs("div",{className:"sticky left-0 z-30 bg-background border-b border-r border-border p-2 flex flex-col items-center justify-center h-[125px]",onDoubleClick:()=>b(r),children:[t.jsx("div",{className:"font-semibold text-sm",children:n.localization.dayNames[r.getDay()].slice(0,3)}),t.jsx("div",{className:zdt("text-base w-7 h-7 flex items-center justify-center",hit(r,new Date)&&"bg-primary text-primary-foreground rounded-full"),children:sst(r,"d")})]}),g.map(n=>{const o=e.filter(e=>e.color===n&&x(e,r));return t.jsxs("div",{className:"border-b border-r border-border p-2 h-[125px] last:border-r-0 relative group overflow-hidden",onDoubleClick:()=>b(r),children:[t.jsxs("div",{className:"relative z-10 h-full flex flex-col",children:[t.jsx("div",{className:"flex-1 overflow-auto",children:o.slice(0,(o.length,3)).map((e,t)=>_(e,r,t))}),t.jsx("div",{className:"mt-auto",children:w(o,r,n)})]}),l&&h&&t.jsx(XLt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"})]},`${r.toString()}-${n}`)})]},r.toString()))]})})}),t.jsx(YLt,{orientation:"horizontal"})]})})},oBt=({filteredEvents:e,currentDate:r,is24HourFormat:n,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,isAddEventPopupOpen:l,currentConfig:c,setCurrentDate:u,setCurrentView:d,onEventUpdate:p,onEventDelete:h,onEventAdd:f,setIsAddEventPopupOpen:m,isLoading:v,currentTimeLineRef:y,currentTimeTop:g,onDateRangeChange:x})=>{var b;const k={filteredEvents:e,currentDate:r,currentConfig:c,is24HourFormat:n,onEventAdd:f,onEventUpdate:p,onEventDelete:h,isLoading:v,isAddEventPopupOpen:l,setIsAddEventPopupOpen:m,setCurrentDate:u,setCurrentView:d,onDateRangeChange:x};return t.jsx(t.Fragment,{children:"resource"===(null==(b=c.weekView)?void 0:b.viewType)?t.jsx(nBt,{...k}):t.jsx(rBt,{...k,hoverLineRef:o,hoverTimeRef:a,setClickedTime:i,clickedTime:s,currentTimeLineRef:y,currentTimeTop:g})})},aBt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,setIsAddEventPopupOpen:a,isAddEventPopupOpen:i,setCurrentDate:s,setCurrentView:l,onEventUpdate:c,onEventDelete:u,onEventAdd:d,isLoading:p,onDateRangeChange:h})=>{var f;const m=kit(r),v=xit(r),y=null==(f=n.monthView)?void 0:f.showOnlyCurrentMonth,g=cst(m),x=new Date,b=n.localization.dayNames;let k,_;if(y)k=bit({start:m,end:v}),_=[...b.slice(g),...b.slice(0,g)];else{const e=o?1:0;k=bit({start:nit(m,{weekStartsOn:e}),end:Mit(v,{weekStartsOn:e})}),_=o?[...b.slice(1),b[0]]:b}return t.jsx(nLt,{className:"p-2 sm:p-4",children:t.jsx(ULt,{children:t.jsxs("div",{className:"grid grid-cols-7 gap-1 sm:gap-2",children:[_.map(e=>t.jsx("div",{className:"text-center font-medium text-xs sm:text-sm",children:e},e)),k.map(f=>{const m=hst(f,r);if(y&&!m)return t.jsx("div",{},f.toString());const v=e.filter(e=>e.isRepeating?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,f)))&&IPt(f,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):hit(e.startDate,f)||e.endDate&&mst(f,{start:e.startDate,end:e.endDate})),g=((e,t)=>e.reduce((e,r)=>{const n="00:00"===r.startTime&&"23:59"===r.endTime,o=r.endDate&&!hit(r.startDate,r.endDate);if(r.isRepeating){if(r.isRepeatingExcludedDates&&r.isRepeatingExcludedDates.some(e=>hit(e,t)))return e;if(IPt(t,r.startDate,r.endDate||r.startDate,r.isRepeatingInterval||"daily")){let o;o="weekly"===r.isRepeatingInterval||"monthly"===r.isRepeatingInterval||hit(r.startDate,t)?"start":r.endDate&&hit(r.endDate,t)?"end":"middle",n?e.repeatingFullDayEvents.push({...r,position:o}):e.regularEvents.push({...r,position:o})}}else if(o){let n;hit(r.startDate,t)?n="start":hit(r.endDate,t)?n="end":mst(t,{start:r.startDate,end:r.endDate})&&(n="middle"),n&&e.multiDayEvents.push({...r,position:n})}else n?e.fullDayEvents.push(r):e.regularEvents.push(r);return e},{repeatingFullDayEvents:[],multiDayEvents:[],fullDayEvents:[],regularEvents:[]}))(v,f),b=[...g.repeatingFullDayEvents,...g.multiDayEvents,...g.fullDayEvents],k=g.regularEvents,_=hit(f,x);let w=[],M=0;return b.length>0?(w.push(b[0]),M=b.length-1+k.length):k.length>0&&(w.push(k[0]),M=k.length-1),M>0?w=w.slice(0,1):k.length>1&&w.length<2&&w.push(k[1]),t.jsxs("div",{className:zdt("p-1 sm:p-2 h-[80px] sm:h-[130px] border rounded relative group flex flex-col",!m&&!y&&"bg-muted/50"),onDoubleClick:()=>(e=>{i||n.monthView.enableDoubleClickToShiftViewToWeekly&&(s(e),l("week"))})(f),children:[t.jsx("div",{className:zdt("font-semibold mb-1 w-5 h-5 sm:w-6 sm:h-6 flex items-center justify-center text-xs sm:text-sm",_&&"bg-primary text-primary-foreground rounded-full"),children:sst(f,"d")}),t.jsxs("div",{className:"flex-grow overflow-hidden",children:[p&&h&&t.jsx(XLt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),w.map((e,r)=>((e,r,i)=>{const s="position"in e,l=s&&"start"===e.position,p=s&&"end"===e.position,h=s&&"middle"===e.position;return t.jsx(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.05*r},children:t.jsx(PEt,{event:e,onAddEvent:d,onUpdateEvent:c,onDeleteEvent:u,dateFromViewClick:i,onOpenChange:a,translations:n.localization,children:t.jsxs("div",{className:zdt(GLt(e.color),"p-1 text-[8px] h-10 sm:text-xs rounded mb-1 cursor-pointer","transition-colors duration-200","hover:bg-opacity-40","dark:hover:bg-opacity-40",(()=>{if(!e.isRepeating)return zdt(l&&"border-l-4 border-l-black/70 dark:border-l-white/50",p&&"border-r-4 border-r-black/70 dark:border-r-white/50",h&&"border-x-0");switch(e.isRepeatingInterval){case"daily":return zdt("border border-dashed border-opacity-50",l&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50",p&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50",h&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})()),children:[t.jsx("div",{className:"font-semibold truncate",children:e.title||"Untitled Event"}),!s&&t.jsxs("div",{className:"hidden sm:block truncate",children:[ZLt(e.startTime,o)," - ",ZLt(e.endTime,o)]}),s&&!e.isRepeating&&t.jsx("div",{className:"hidden sm:block truncate",children:e.description&&t.jsx("div",{className:"truncate",children:e.description})}),e.isRepeating&&t.jsxs("div",{className:"hidden sm:block truncate",children:[ZLt(e.startTime,o)," - ",ZLt(e.endTime,o)]})]})})},`${e.id}-${r}`)})(e,r,f)),0===v.length&&t.jsx(PEt,{translations:n.localization,onOpenChange:a,onAddEvent:d,event:{startDate:f,endDate:f},onDeleteEvent:u,children:t.jsx($ht,{variant:"ghost",size:"sm",className:"w-full h-1/2 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground transition-opacity truncate px-0.5 sm:px-2 sm:opacity-0 sm:group-hover:opacity-100",children:t.jsx("span",{className:"hidden sm:inline ml-1",children:n.localization.addEvent})})})]}),M>0&&t.jsx(JLt,{translations:n.localization,events:v,date:f,addEvent:d,updateEvent:c,onDelete:u,is24HourFormat:o,getEventColor:GLt,onOpenChange:a,children:t.jsx(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2},children:t.jsxs($ht,{variant:"ghost",size:"sm",className:"w-full gap-1 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground mt-auto sm:mt-1 truncate px-0.5 sm:px-2 h-5 sm:h-8",children:[t.jsxs("span",{children:["+",M]}),t.jsxs("span",{className:"hidden sm:inline",children:[" ",n.localization.more]})]})})}),1===v.length&&t.jsx(PEt,{translations:n.localization,onOpenChange:a,onAddEvent:d,event:{startDate:f},onDeleteEvent:u,children:t.jsxs($ht,{variant:"ghost",size:"sm",className:"w-full gap-1 text-[8px] sm:text-xs text-muted-foreground hover:text-foreground mt-auto sm:mt-1 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity truncate px-0.5 sm:px-2 ",children:[t.jsx("span",{className:"font-bold",children:"+"}),t.jsx("span",{className:"hidden sm:inline",children:n.localization.addEvent})]})})]},f.toString())})]})})})},iBt=({filteredEvents:e,onEventUpdate:r,onEventDelete:n,onEventAdd:o,isLoading:a,currentDate:i,currentConfig:s,is24HourFormat:l,isAddEventPopupOpen:c,setCurrentDate:u,setCurrentView:d,setIsAddEventPopupOpen:p,onDateRangeChange:h})=>{var f;const m=kit(i),v=xit(i),y=null==(f=s.monthView)?void 0:f.showOnlyCurrentMonth,g=cst(m),x=new Date,b=s.localization.dayNames;let k,_;if(y)k=bit({start:m,end:v}),_=[...b.slice(g),...b.slice(0,g)];else{const e=l?1:0,t=nit(m,{weekStartsOn:e}),r=Mit(v,{weekStartsOn:e});k=bit({start:t,end:r}),_=l?[...b.slice(1),b[0]]:b}const w=Math.ceil(k.length/7);return t.jsx(nLt,{className:"p-2 sm:p-4",children:t.jsx(ULt,{children:t.jsxs("div",{className:"w-full",children:[t.jsx("div",{className:"grid grid-cols-7 border-b",children:_.map(e=>t.jsx("div",{className:"text-center font-medium text-xs sm:text-sm p-2",children:e},e))}),Array.from({length:w}).map((f,m)=>{const v=k.slice(7*m,7*(m+1));return t.jsx("div",{className:"grid grid-cols-7",children:v.map((f,m)=>{const v=hit(f,x),g=hst(f,i),b=(t=>e.filter(e=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,t)))&&IPt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const r=iit(e.startDate),n=git(e.endDate||e.startDate);return mst(t,{start:r,end:n})}).sort((e,t)=>new Date(e.startDate).getTime()+(e.startTime?36e5*parseFloat(e.startTime.replace(":",".")):0)-(new Date(t.startDate).getTime()+(t.startTime?36e5*parseFloat(t.startTime.replace(":",".")):0))))(f);return y&&!g?t.jsx("div",{},f.toString()):t.jsxs("div",{className:zdt("group min-h-[145px] border-b border-r p-1 relative","transition-colors duration-200",!g&&"bg-muted/50",0===m&&"border-l"),onDoubleClick:()=>(e=>{c||s.monthView.enableDoubleClickToShiftViewToWeekly&&(u(e),d("week"))})(f),children:[a&&h&&t.jsx(XLt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("div",{className:zdt("font-semibold w-6 h-6 flex items-center justify-center text-xs sm:text-sm rounded-full",v&&"bg-primary text-primary-foreground"),children:sst(f,"d")}),t.jsx(PEt,{translations:s.localization,onOpenChange:p,onAddEvent:o,event:{startDate:f,endDate:f},dateFromViewClick:f,onDeleteEvent:n,children:t.jsx($ht,{variant:"ghost",size:"sm",className:"h-6 text-xs text-muted-foreground px-2 sm:opacity-0 sm:group-hover:opacity-100 transition-opacity",children:t.jsx("span",{className:"ml-1 hidden sm:inline",children:s.localization.addEvent})})})]}),t.jsxs("div",{className:"space-y-1 mt-1 overflow-y-auto",children:[b.slice(0,b.length>4?3:4).map((e,a)=>{const i=((e,t)=>{if(e.isRepeating){if("weekly"===e.isRepeatingInterval||"monthly"===e.isRepeatingInterval)return"single";const r=hit(e.startDate,t),n=e.endDate&&hit(e.endDate,t);return r&&n?"single":r?"start":n?"end":"middle"}const r=hit(e.startDate,t),n=e.endDate&&hit(e.endDate,t);return e.endDate?r&&n?"single":r?"start":n?"end":"middle":"single"})(e,f),c=((e,t)=>{if(!e.isRepeating)return zdt("start"===t&&"border-l-4 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-4 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");switch(e.isRepeatingInterval||"daily"){case"daily":return zdt("border border-dashed border-opacity-50","start"===t&&"border-l-solid border-l-2 border-l-black/70 dark:border-l-white/50","end"===t&&"border-r-solid border-r-2 border-r-black/70 dark:border-r-white/50","middle"===t&&"border-x-0");case"weekly":case"monthly":return"border border-dotted border-opacity-50";default:return""}})(e,i),u=e.isRepeating||"single"===i||"start"===i&&!e.isRepeating||"end"===i&&!e.isRepeating;return t.jsx(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.05*a},children:t.jsx(PEt,{translations:s.localization,onAddEvent:o,onUpdateEvent:r,event:e,dateFromViewClick:f,onDeleteEvent:n,onOpenChange:p,children:t.jsxs("div",{className:zdt(GLt(e.color),"text-xs p-1 min-h-[24px] rounded cursor-pointer","hover:opacity-80 transition-opacity","flex items-center justify-between gap-1",c),children:[t.jsx("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap flex-1",children:e.title}),u&&t.jsx("span",{className:"text-[10px] opacity-75 whitespace-nowrap",children:e.isRepeating||"end"!==i?ZLt(e.startTime,l):`ends ${ZLt(e.endTime,l)}`})]})})},`${e.id}-${a}`)}),b.length>4&&t.jsx(JLt,{translations:s.localization,events:b,date:f,addEvent:o,updateEvent:r,onDelete:n,is24HourFormat:l,getEventColor:GLt,onOpenChange:p,children:t.jsx(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2},children:t.jsxs($ht,{variant:"ghost",size:"sm",className:"w-full h-6 text-xs text-muted-foreground hover:text-foreground truncate px-2",children:["+",b.length-3," ",s.localization.more]})})})]})]},f.toString())})},m)})]})})})},sBt=({filteredEvents:e,currentDate:r,currentConfig:n,is24HourFormat:o,setIsAddEventPopupOpen:a,isAddEventPopupOpen:i,setCurrentDate:s,setCurrentView:l,onEventUpdate:c,onEventDelete:u,onEventAdd:d,isLoading:p,onDateRangeChange:h})=>{var f;return t.jsx(t.Fragment,{children:"detailed"===(null==(f=n.monthView)?void 0:f.viewType)?t.jsx(iBt,{filteredEvents:e,currentDate:r,is24HourFormat:o,isAddEventPopupOpen:i,currentConfig:n,setCurrentDate:s,setCurrentView:l,onEventAdd:d,onEventUpdate:c,onEventDelete:u,setIsAddEventPopupOpen:a,isLoading:p,onDateRangeChange:h}):t.jsx(aBt,{filteredEvents:e,currentDate:r,is24HourFormat:o,isAddEventPopupOpen:i,currentConfig:n,setCurrentDate:s,setCurrentView:l,onEventAdd:d,onEventUpdate:c,onEventDelete:u,setIsAddEventPopupOpen:a,isLoading:p,onDateRangeChange:h})})},lBt=({currentConfig:e,currentDate:r,filteredEvents:n,isAddEventPopupOpen:o,setCurrentDate:a,setCurrentView:i,is24HourFormat:s,isLoading:l,onEventAdd:c,onEventUpdate:u,onEventDelete:d,setIsAddEventPopupOpen:p,onDateRangeChange:h})=>{const f=function(e){const t=Yat(e.start),r=Yat(e.end);let n=+t>+r;const o=n?+t:+r,a=n?r:t;a.setHours(0,0,0,0),a.setDate(1);const i=[];for(;+a<=o;)i.push(Yat(a)),a.setMonth(a.getMonth()+1);return n?i.reverse():i}({start:wit(r),end:_it(r)}),m=s?1:0,v=s?e.localization.dayNames.slice(1).concat(e.localization.dayNames[0]):e.localization.dayNames;return t.jsx(nLt,{className:"p-4",children:t.jsx(ULt,{children:t.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4",children:[l&&h&&t.jsx(XLt,{className:"absolute top-0 left-0 right-0 h-[2px] dark:h-[1px] animate-pulse bg-primary/20"}),f.map(r=>{const l=kit(r),h=bit({start:l,end:xit(r)}),f=(cst(l)-m+7)%7;return t.jsxs("div",{className:"border rounded p-2",onDoubleClick:()=>(t=>{o||e.yearView.enableDoubleClickToShiftViewToMonthly&&(a(t),i("month"))})(r),children:[t.jsx("h3",{className:"text-lg font-semibold mb-2 text-center",children:e.localization.monthNames[r.getMonth()]}),t.jsxs("div",{className:"grid grid-cols-7 gap-1",children:[v.map((e,n)=>t.jsxs("div",{className:"text-center text-xs text-muted-foreground",children:[t.jsx("span",{className:"hidden sm:inline",children:e}),t.jsx("span",{className:"sm:hidden",children:e.charAt(0)})]},`${r.toString()}-${e}-${n}`)),Array.from({length:f}).map((e,r)=>t.jsx("div",{className:"h-6 w-6"},`empty-start-${r}`)),h.map(r=>{const o=(e=>n.filter(t=>{if(t.isRepeating)return(!t.isRepeatingExcludedDates||!t.isRepeatingExcludedDates.some(t=>hit(t,e)))&&IPt(e,t.startDate,t.endDate||t.startDate,t.isRepeatingInterval||"daily");const r=iit(t.startDate),n=git(t.endDate||t.startDate);return mst(e,{start:r,end:n})}).map(e=>GLt(e.color)))(r),a=hit(r,new Date),i=n.filter(e=>{if(e.isRepeating)return(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,r)))&&IPt(r,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily");const t=iit(e.startDate),n=git(e.endDate||e.startDate);return mst(r,{start:t,end:n})});return t.jsx(JLt,{events:i,addEvent:c,updateEvent:u,onDelete:d,onOpenChange:p,date:r,is24HourFormat:s,getEventColor:GLt,translations:e.localization,children:t.jsx("div",{className:zdt("h-6 w-6 flex items-center justify-center text-xs cursor-pointer","text-foreground"),children:t.jsxs("div",{className:zdt("h-5 w-5 flex items-center justify-center rounded-full relative","transition-all duration-200 ease-in-out",a&&"bg-accent text-accent-foreground",o.length>0?"hover:scale-150 hover:z-10":"hover:bg-gray-200 dark:hover:bg-gray-700"),children:[o.length>0?t.jsx("div",{className:"absolute inset-0 rounded-full overflow-hidden",children:o.map((e,n)=>t.jsx("div",{className:`absolute inset-0 ${e}`,style:{backgroundColor:e.split(" ")[1],clipPath:`polygon(${n*(100/o.length)}% 0%, ${(n+1)*(100/o.length)}% 0%, ${(n+1)*(100/o.length)}% 100%, ${n*(100/o.length)}% 100%)`}},`${r.toString()}-${n}`))}):t.jsx("div",{className:"absolute inset-0 rounded-full transition-opacity opacity-0 hover:opacity-100 bg-gray-200 dark:bg-gray-700"}),t.jsx("time",{dateTime:sst(r,"yyyy-MM-dd"),className:"relative z-10",children:sst(r,"d")})]})})},r.toString())})]})]},r.toString())})]})})})},cBt=({filteredEvents:e,currentView:r,currentDate:n,listSearchTerm:o,setListSearchTerm:a,currentConfig:i,onEventUpdate:s,onEventDelete:l,onEventAdd:c,is24HourFormat:u,isLoading:d})=>{let p,h;switch(r){case"day":default:p=iit(n),h=git(n);break;case"week":p=nit(n),h=Mit(n);break;case"month":p=kit(n),h=xit(n);break;case"year":p=wit(n),h=_it(n)}const f=e.filter(e=>{if(e.isRepeating){const t=()=>bit({start:p,end:h}).some(t=>(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,t)))&&IPt(t,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"));return"day"===r?(!e.isRepeatingExcludedDates||!e.isRepeatingExcludedDates.some(e=>hit(e,n)))&&IPt(n,e.startDate,e.endDate||e.startDate,e.isRepeatingInterval||"daily"):t()}if("day"===r){const t=iit(e.startDate),r=git(e.endDate||e.startDate);return mst(n,{start:t,end:r})}return mst(e.startDate,{start:p,end:h})||e.endDate&&mst(e.endDate,{start:p,end:h})}).filter(e=>e.title.toLowerCase().includes(o.toLowerCase())||e.description&&e.description.toLowerCase().includes(o.toLowerCase())).sort((e,t)=>function(e,t){const r=Yat(e),n=Yat(t),o=r.getTime()-n.getTime();return o<0?-1:o>0?1:o}(e.startDate,t.startDate));return t.jsxs(nLt,{className:"p-4",children:[t.jsx(rOt.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.3},className:"mb-4",children:t.jsxs("div",{className:"relative",children:[t.jsx(fbt,{initial:!1,mode:"wait",children:o?t.jsx(rOt.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute left-2.5 top-[0.6rem] transform -translate-y-1/2 flex items-center justify-center",children:t.jsx($ht,{variant:"ghost",size:"icon",className:"h-5 w-5 p-0",onClick:()=>a(""),children:t.jsx(clt,{className:"h-4 w-4 text-muted-foreground"})})},"clearButton"):t.jsx(rOt.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.2},className:"absolute left-2.5 top-[0.75rem] transform -translate-y-1/2 flex items-center justify-center",children:t.jsx(slt,{className:"h-4 w-4 text-muted-foreground"})},"searchIcon")}),t.jsx(cyt,{type:"text",placeholder:i.localization.searchEvents,value:o,onChange:e=>a(e.target.value),className:"pl-10 pr-4 py-2 w-full"})]})}),t.jsxs(ULt,{className:"h-[600px]",children:[t.jsx(fbt,{initial:!0,children:f.map(e=>{const{dateInfo:r,isMultiDay:o,isOutOfRange:a,isRepeating:d}=(e=>{const t=iit(e.startDate),r=git(e.endDate||e.startDate),n=!hit(t,r),o=t<p||r>h,a=e.isRepeating;let s="";if(a&&(e.isRepeatingInterval,1)){const t=`${ZLt(e.startTime,u)} - ${ZLt(e.endTime,u)}`,r=sst(e.startDate,"MMM d"),n=sst(e.endDate||e.startDate,"MMM d, yyyy"),o=sst(e.startDate,"EEEE"),a=sst(e.startDate,"do");switch(e.isRepeatingInterval||"daily"){case"daily":s=i.localization.repeatDailyDescription.replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n);break;case"weekly":s=i.localization.repeatWeeklyDescription.replace("{dayName}",o).replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n);break;case"monthly":s=i.localization.repeatMonthlyDescription.replace("{dayOfMonth}",a).replace("{timeRange}",t).replace("{startDate}",r).replace("{endDate}",n)}}else s=`${sst(t,"MMM d")}`,n&&(s+=` - ${sst(r,"MMM d")}`);return{dateInfo:s,isMultiDay:n,isOutOfRange:o,isRepeating:a}})(e);return t.jsx(rOt.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,height:0},transition:{duration:.3},children:t.jsx(PEt,{event:e,onAddEvent:c,onUpdateEvent:s,onDeleteEvent:l,dateFromViewClick:n,translations:i.localization,children:t.jsxs("div",{className:zdt("p-2 rounded-lg cursor-pointer mb-2",GLt(e.color),"hover:opacity-80 transition-opacity",e.isRepeating&&"border border-dashed border-opacity-50"),children:[t.jsxs("div",{className:"flex justify-between items-center text-sm",children:[t.jsx("span",{className:"font-semibold",children:r}),t.jsxs("div",{className:"flex items-center space-x-2",children:[d&&t.jsx(YFt,{children:t.jsxs(ZFt,{children:[t.jsx(KFt,{children:t.jsx(ilt,{className:"h-4 w-4"})}),t.jsx(GFt,{children:t.jsx("p",{children:i.localization.repeatingEvent})})]})}),o&&!d&&t.jsx(YFt,{children:t.jsxs(ZFt,{children:[t.jsx(KFt,{children:t.jsx($st,{className:"h-4 w-4"})}),t.jsx(GFt,{children:t.jsx("p",{children:i.localization.multiDayEvent})})]})}),a&&t.jsx(YFt,{children:t.jsxs(ZFt,{children:[t.jsx(KFt,{children:t.jsx(Lst,{className:"h-4 w-4"})}),t.jsx(GFt,{children:t.jsx("p",{children:i.localization.extendsOutOfRange})})]})}),t.jsxs("span",{children:[ZLt(e.startTime,u)," - ",ZLt(e.endTime,u)]})]})]}),t.jsx("h3",{className:"text-lg font-bold mt-2",children:e.title||"Untitled Event"}),e.description&&t.jsx("p",{className:"mt-1 text-sm",children:e.description})]})})},e.id)})}),!d&&0===f.length&&t.jsx(rOt.div,{initial:{opacity:0},animate:{opacity:1},className:"text-center text-muted-foreground py-8",children:o?i.localization.noEvents:`${i.localization.noEvents} ${i.localization[r]}`})]})]})},uBt=({currentView:r,isListView:n,animationDirection:o,currentDate:a,filteredEvents:i,listSearchTerm:s,setListSearchTerm:l,currentConfig:c,onEventUpdate:u,onEventDelete:d,isLoading:p,onEventAdd:h,is24HourFormat:f,setCurrentDate:m,setCurrentView:v,onDateRangeChange:y})=>{const[g,x]=e.useState(!1),[b,k]=e.useState(null),_=e.useRef(null),w=e.useRef(null),M=e.useRef(null),C=(()=>{const[t,r]=e.useState(0);return e.useEffect(()=>{const e=()=>{const e=new Date,t=(60*e.getHours()+e.getMinutes())*(16/15);r(t)};e();const t=setInterval(e,6e4);return()=>clearInterval(t)},[]),t})();rLt({currentView:r,currentDate:a,onDateRangeChange:y,is24HourFormat:f});const j={filteredEvents:i,currentDate:a,currentConfig:c,onEventUpdate:u,onEventDelete:d,onEventAdd:h,is24HourFormat:f,isLoading:p},D={isAddEventPopupOpen:g,setIsAddEventPopupOpen:x,onDateRangeChange:y},O={hoverLineRef:_,hoverTimeRef:w},S={clickedTime:b,setClickedTime:k},P={currentTimeLineRef:M,currentTimeTop:C},T={setCurrentDate:m,setCurrentView:v};return t.jsx(fbt,{mode:"wait",children:t.jsx(rOt.div,{initial:{opacity:0,y:"up"===o?-20:"down"===o?20:0},animate:{opacity:1,x:0,y:0},exit:{opacity:0,y:"up"===o?20:"down"===o?-20:0},transition:{duration:.1},className:"h-full",children:n?t.jsx(cBt,{...j,currentView:r,listSearchTerm:s,setListSearchTerm:l}):t.jsxs(t.Fragment,{children:["day"===r&&t.jsx(tBt,{...j,...D,...O,...S,...P}),"week"===r&&t.jsx(oBt,{...j,...D,...O,...S,...P,...T}),"month"===r&&t.jsx(sBt,{...j,...D,...T}),"year"===r&&t.jsx(lBt,{...j,...D,...T})]})},`${r}-${a.toISOString()}`)})},dBt={language:"enUS",today:"Today",thisWeek:"This Week",thisMonth:"This Month",thisYear:"This Year",dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],fullDayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],viewBy:"View by",day:"Day",week:"Week",month:"Month",year:"Year",list:"List",addEvent:"Add Event",editEvent:"Edit Event",deleteEvent:"Delete Event",eventTitle:"Event Title",eventDescription:"Description",eventColor:"Event Resource",eventDate:"Date",eventStartTime:"Start Time",eventEndTime:"End Time",eventEndDate:"End Date",eventIsRepeating:"Repeating Event",eventAdded:"Event added",eventUpdated:"Event updated",eventDeleted:"Event deleted",eventRestored:"Event restored",eventUpdateUndone:"Event update undone",failedToAddEvent:"Failed to add event",failedToUpdateEvent:"Failed to update event",failedToDeleteEvent:"Failed to delete event",failedToFetchEvents:"Failed to fetch events",errorCannotExcludeAllDates:"Cannot exclude all dates in the range",save:"Save",saving:"Saving",cancel:"Cancel",delete:"Delete",deleting:"Deleting",undo:"Undo",tryAgain:"Try again",close:"Close",search:"Search",searchEvents:"Search events...",noEvents:"No events",allDay:"All Day",fullDayEvents:"Full-Day Events",loadingEvents:"Loading events...",filterByColor:"Filter by Resource",filter:"Filter",filtering:"Filtering",more:"more",use24HourFormat:"Use 24-hour format",repeatingEvent:"Repeating event",multiDayEvent:"Multi-day event",extendsOutOfRange:"Extends beyond current view",displayCalendar:"Display Calendar",displayList:"Display List",dayXofY:"Day {x} of {y}",repeatXofY:"#{x} of {y}",starts:"Starts",ends:"Ends",untitledEvent:"Untitled Event",repeatDaily:"Daily",repeatWeekly:"Weekly",repeatMonthly:"Monthly",repeatingEventQuestion:"Repeating Event?",repeatDailyDescription:"Repeats daily at {timeRange} from {startDate} to {endDate}",repeatWeeklyDescription:"Repeats every {dayName} at {timeRange} from {startDate} to {endDate}",repeatMonthlyDescription:"Repeats on the {dayOfMonth} of each month at {timeRange} from {startDate} to {endDate}",withExcludedDates:"with {count} excluded date{s}",excludedDates:"Excluded Dates?",excludedDatesDescription:"Select dates to exclude from the recurring pattern",skipDays:"Skip Days:",clearAll:"Clear All",selectDatesToExclude:"Select dates to exclude",selectAll:"Select All",noMatchingDates:"No dates match this repeat pattern",noSearchResults:'No matches found for "{query}"',searchMonthPlaceholder:"Search month...",ofExcluded:"{count} of {total} excluded",pageCount:"{current}/{total}",weeklyIntervalLabel:"{dayName}s ({startDate} - {endDate})",monthlyIntervalLabel:"{dayOfMonth} of each month ({startDate} - {endDate})",dateButtonFormat:"MMM d",editEventDescription:"Edit your event details.",createEventDescription:"Create a new event in your calendar.",timePresetAllDay:"All Day",timePresetEarlyMorning:"Early Morning",timePresetMorning:"Morning",timePresetLunch:"Lunch",timePresetEarlyAfternoon:"Early Afternoon",timePresetLateAfternoon:"Late Afternoon",timePresetEvening:"Evening",timePresetNight:"Night",selectDate:"Pick a date",selectColor:"Select a color",confirmDelete:"Are you sure?",confirmDeleteDescription:"Do you want to delete this event?",repeatEventDeleteTitle:"Delete Repeating Event",repeatEventDeleteDescription:"This is a repeating event. What would you like to delete?",deleteThisOccurrence:"Delete only this occurrence",deleteThisAndFuture:"Delete this and all future occurrences",deleteAllOccurrences:"Delete all occurrences",deleteThisOccurrenceDescription:"Only this specific date will be removed",deleteThisAndFutureDescription:"This and all future dates will be removed",deleteAllOccurrencesDescription:"The entire repeating event will be removed",editRecurringEventTitle:"Edit Recurring Event",editRecurringEventDescription:"This is a recurring event. Would you like to edit all occurrences, just this one, or this and future occurrences?",editThisOccurrence:"Edit this occurrence only",editThisOccurrenceDescription:"Make changes only to this specific event occurrence",editThisAndFuture:"Edit this and future occurrences",editThisAndFutureDescription:"Make changes to this and all future occurrences",editAllOccurrences:"Edit all occurrences",editAllOccurrencesDescription:"Make changes to all occurrences of this event",from:"from",to:"to",pickADate:"Pick a date",errorEndDateBeforeStart:"End date cannot be before start date",selectAColor:"Select a color",validations:{eventNameRequired:"Event name is required",invalidTimeFormat:"Invalid time format",colorRequired:"Color is required",endTimeBeforeStart:"End time can't be before start time"}},pBt={defaultView:"month",use24HourFormatByDefault:!0,dayView:{enableDoubleClickToAddEvent:!1,viewType:"regular"},weekView:{enableDoubleClickToShiftViewToDaily:!1,viewType:"regular"},monthView:{enableDoubleClickToShiftViewToWeekly:!1,viewType:"basic"},yearView:{enableDoubleClickToShiftViewToMonthly:!1},localization:{...dBt}},hBt=({config:r,events:n,isLoading:o=!1,onEventAdd:a,onEventUpdate:i,onEventDelete:s,onDateRangeChange:l})=>{const c={...pBt,...r},u=Pst({config:{defaultView:c.defaultView||"month",use24HourFormatByDefault:c.use24HourFormatByDefault||!1},translations:c.localization}),[d,p]=e.useState(!1),[h,f]=e.useState(""),[m,v]=e.useState(Bat.map(e=>e.value)),y=n.filter(e=>m.includes(e.color)),g=(()=>{const[t,r]=e.useState(!1);return e.useEffect(()=>{r("ontouchstart"in window||navigator.maxTouchPoints>0)},[]),t})(),x=Uat({onSwipedLeft:()=>u.handleNext(),onSwipedRight:()=>u.handlePrevious(),preventScrollOnSwipe:!1,trackMouse:!1,delta:{left:100,right:100},swipeDuration:150,touchEventOptions:{passive:!0},trackTouch:!0}),b={...u,currentConfig:c,onEventAdd:a,onEventDelete:s,isListView:d};return t.jsxs("div",{...g?x:{},children:[t.jsx(tLt,{...b,setIsListView:p,selectedColors:m,setSelectedColors:v}),t.jsx(uBt,{...b,is24HourFormat:u.use24HourFormat,filteredEvents:y,listSearchTerm:h,setListSearchTerm:f,onEventUpdate:i,isLoading:o,onDateRangeChange:l})]})};function fBt({config:t={},initialEvents:r=[],onEventAdd:n,onEventUpdate:o,onEventDelete:a,onDateRangeChange:i}){var s,l;const[c,u]=e.useState(r),[d,p]=e.useState(!1),h=e.useRef(null),f=e.useRef(null),m=(null==(s=t.calendarConfig)?void 0:s.localization)||dBt,v=async(e,r)=>{var o;let a;try{a=n?await n(e):{...e,id:Date.now().toString()+Math.random().toString(36).substring(2,7)},u(e=>[...e,a]),f.current=a,r?tpt.success(m.eventRestored):tpt.success(m.eventAdded,{action:{label:m.undo,onClick:()=>g(a.id,!0)}})}catch(n){console.error("Error adding event:",n),tpt.error(m.failedToAddEvent,!1!==(null==(o=t.events)?void 0:o.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>v(e,r)}}:void 0)}},y=async(e,r)=>{var n;try{o&&await o(e),u(t=>t.map(t=>t.id===e.id?e:t)),r?tpt.success(m.eventRestored):tpt.success(m.eventUpdated,{action:{label:m.undo,onClick:()=>y(c.find(t=>t.id===e.id),!0)}})}catch(o){console.error("Error updating event:",o),tpt.error(m.failedToUpdateEvent,!1!==(null==(n=t.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>y(e,r)}}:void 0)}},g=async(e,r)=>{var n;if(!e)return;const o=r?f.current:c.find(t=>t.id===e);if(o)try{a&&await a(e),u(t=>t.filter(t=>t.id!==e)),r?tpt.success(m.eventDeleted):tpt.success(m.eventDeleted,{action:{label:m.undo,onClick:()=>v(o,!0)}})}catch(o){console.error("Error deleting event:",o),tpt.error(m.failedToDeleteEvent,!1!==(null==(n=t.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>g(e,r)}}:void 0)}else console.error(`Event with id ${e} not found`)},x=function(t,r,n){const o=e.useRef(),a=e.useRef(null),i=e.useCallback(()=>{var e;o.current&&(clearTimeout(o.current),o.current=void 0,null==(e=null==n?void 0:n.onCancel)||e.call(n),a.current&&(a.current(),a.current=null))},[n]);return e.useEffect(()=>()=>i(),[i]),e.useCallback((...e)=>{var s;return r?(i(),null==(s=null==n?void 0:n.onDebounce)||s.call(n),new Promise(n=>{a.current=n,o.current=setTimeout(async()=>{await t(...e),a.current=null,n()},r)})):t(...e)},[t,r,n,i])}(async(e,r)=>{var n;if(!i)return;h.current&&h.current.abort();const o=new AbortController;h.current=o;try{p(!0);const t=await i(e,r,o.signal);h.current===o&&u(e=>[...e,...t])}catch(o){if(o instanceof DOMException&&"AbortError"===o.name)return;console.error("Error fetching events:",o),tpt.error(m.failedToFetchEvents,!1!==(null==(n=t.events)?void 0:n.allowUserRetryAfterFailure)?{action:{label:m.tryAgain,onClick:()=>x(e,r)}}:void 0)}finally{h.current===o&&(p(!1),h.current=null)}},null==(l=t.events)?void 0:l.debounceTimeOnViewOrDateChange,{onDebounce:()=>{}});return{events:c,isLoading:d,addEvent:v,updateEvent:y,deleteEvent:g,onViewOrDateChange:x}}new Date((new Date).getFullYear(),(new Date).getMonth(),7),new Date((new Date).getFullYear(),(new Date).getMonth(),7),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),9),new Date((new Date).getFullYear(),(new Date).getMonth(),12),new Date((new Date).getFullYear(),(new Date).getMonth(),12),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),15),new Date((new Date).getFullYear(),(new Date).getMonth(),17),new Date((new Date).getFullYear(),(new Date).getMonth(),17),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+1),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+3),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),19),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),22),new Date((new Date).getFullYear(),(new Date).getMonth(),25),new Date((new Date).getFullYear(),(new Date).getMonth(),25),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),28),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),3),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),10),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),20),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),24),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()-1),new Date((new Date).getFullYear(),(new Date).getMonth(),(new Date).getDate()+3);var mBt=function(e){var t=e.configurationItemInfo,r=h(e,["configurationItemInfo"]),n=fBt({initialEvents:r.events||[],onEventAdd:function(e){return f(void 0,void 0,void 0,function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,null===(t=r.onEventCreate)||void 0===t?void 0:t.call(r,e)];case 1:return n.sent(),[2,p(p({},e),{id:Date.now().toString()})]}})})},onEventUpdate:function(e){return f(void 0,void 0,void 0,function(){var t;return m(this,function(n){switch(n.label){case 0:return[4,null===(t=r.onEventUpdate)||void 0===t?void 0:t.call(r,e)];case 1:return n.sent(),[2,e]}})})},onEventDelete:r.onEventDelete,onDateRangeChange:r.onDateRangeChange}),o=n.events,a=n.isLoading,i=n.addEvent,s=n.updateEvent,l=n.deleteEvent,c=n.onViewOrDateChange;return Me(jp,p({sx:p({width:"100%",height:"100%"},r.css)},t,{className:"fec-wrapper"},{children:Me(hBt,{events:o,isLoading:a,config:r.config,onEventAdd:i,onEventUpdate:s,onEventDelete:l,onDateRangeChange:c})}))},vBt={exports:{}};const yBt={AED:"د.إ",AFN:"؋",ALL:"L",AMD:"֏",ANG:"ƒ",AOA:"Kz",ARS:"$",AUD:"$",AWG:"ƒ",AZN:"₼",BAM:"KM",BBD:"$",BDT:"৳",BGN:"лв",BHD:".د.ب",BIF:"FBu",BMD:"$",BND:"$",BOB:"$b",BOV:"BOV",BRL:"R$",BSD:"$",BTC:"₿",BTN:"Nu.",BWP:"P",BYN:"Br",BYR:"Br",BZD:"BZ$",CAD:"$",CDF:"FC",CHE:"CHE",CHF:"CHF",CHW:"CHW",CLF:"CLF",CLP:"$",CNH:"¥",CNY:"¥",COP:"$",COU:"COU",CRC:"₡",CUC:"$",CUP:"₱",CVE:"$",CZK:"Kč",DJF:"Fdj",DKK:"kr",DOP:"RD$",DZD:"دج",EEK:"kr",EGP:"£",ERN:"Nfk",ETB:"Br",ETH:"Ξ",EUR:"€",FJD:"$",FKP:"£",GBP:"£",GEL:"₾",GGP:"£",GHC:"₵",GHS:"GH₵",GIP:"£",GMD:"D",GNF:"FG",GTQ:"Q",GYD:"$",HKD:"$",HNL:"L",HRK:"kn",HTG:"G",HUF:"Ft",IDR:"Rp",ILS:"₪",IMP:"£",INR:"₹",IQD:"ع.د",IRR:"﷼",ISK:"kr",JEP:"£",JMD:"J$",JOD:"JD",JPY:"¥",KES:"KSh",KGS:"лв",KHR:"៛",KMF:"CF",KPW:"₩",KRW:"₩",KWD:"KD",KYD:"$",KZT:"₸",LAK:"₭",LBP:"£",LKR:"₨",LRD:"$",LSL:"M",LTC:"Ł",LTL:"Lt",LVL:"Ls",LYD:"LD",MAD:"MAD",MDL:"lei",MGA:"Ar",MKD:"ден",MMK:"K",MNT:"₮",MOP:"MOP$",MRO:"UM",MRU:"UM",MUR:"₨",MVR:"Rf",MWK:"MK",MXN:"$",MXV:"MXV",MYR:"RM",MZN:"MT",NAD:"$",NGN:"₦",NIO:"C$",NOK:"kr",NPR:"₨",NZD:"$",OMR:"﷼",PAB:"B/.",PEN:"S/.",PGK:"K",PHP:"₱",PKR:"₨",PLN:"zł",PYG:"Gs",QAR:"﷼",RMB:"¥",RON:"lei",RSD:"Дин.",RUB:"₽",RWF:"R₣",SAR:"﷼",SBD:"$",SCR:"₨",SDG:"ج.س.",SEK:"kr",SGD:"S$",SHP:"£",SLL:"Le",SOS:"S",SRD:"$",SSP:"£",STD:"Db",STN:"Db",SVC:"$",SYP:"£",SZL:"E",THB:"฿",TJS:"SM",TMT:"T",TND:"د.ت",TOP:"T$",TRL:"₤",TRY:"₺",TTD:"TT$",TVD:"$",TWD:"NT$",TZS:"TSh",UAH:"₴",UGX:"USh",USD:"$",UYI:"UYI",UYU:"$U",UYW:"UYW",UZS:"лв",VEF:"Bs",VES:"Bs.S",VND:"₫",VUV:"VT",WST:"WS$",XAF:"FCFA",XBT:"Ƀ",XCD:"$",XOF:"CFA",XPF:"₣",XSU:"Sucre",XUA:"XUA",YER:"﷼",ZAR:"R",ZMW:"ZK",ZWD:"Z$",ZWL:"$"};vBt.exports=function(e){if("string"!=typeof e)return;const t=e.toUpperCase();return Object.prototype.hasOwnProperty.call(yBt,t)?yBt[t]:void 0},vBt.exports.currencySymbolMap=yBt;var gBt=function(t){var r,n,o=t.required,a=void 0!==o&&o,i=t.requiredErrorText,s=void 0===i?"This field is required":i,l=t.validationErrorText,c=void 0===l?"Invalid numeric value":l,u=t.isDisplayOnly,d=void 0!==u&&u,h=t.backgroundColor,f=t.textAlign,m=void 0===f?"left":f,v=t.textColor,y=void 0===v?"inherit":v,g=t.fontSize,x=void 0===g?"16px":g,b=t.fontFamily,k=void 0===b?"inherit":b,_=t.fontWeight,w=void 0===_?"normal":_,M=t.borderColor,C=t.marginLeft,j=void 0===C?"0":C,D=t.marginTop,O=void 0===D?"0":D,S=t.marginRight,P=void 0===S?"0":S,T=t.marginBottom,E=void 0===T?"0":T,N=t.paddingLeft,z=void 0===N?"0":N,A=t.paddingTop,R=void 0===A?"0":A,F=t.paddingRight,L=void 0===F?"0":F,B=t.paddingBottom,V=void 0===B?"0":B,I=t.width,q=t.height,$=t.minHeight,H=t.maxHeight,W=t.minWidth,U=t.maxWidth,Y=t.text,Z=t.placeholderText,K=t.configurationItemInfo,G=t.name,X=t.numericPrecision,Q=void 0===X?"1":X,J=t.currency,ee=t.placement,te=void 0===ee?"left":ee,re=t.sourceDataModelField,ne=WS(),oe=null==ne?void 0:ne.control,ae=KBt().localStateObject,ie=JBt().stateConfig,se=ae||ie,le=e.useState(""),ce=le[0],ue=le[1],de=!!oe&&!!G,pe=re?null===(r=null==se?void 0:se[re])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==pe&&(de?ne.setValue(G,pe):ue(String(null!=pe?pe:"")))},[pe,de,ne,G]);var he=Number.isFinite(+Q)&&+Q>0?+Q:1,fe=J?null!==(n=vBt.exports(J.toUpperCase()))&&void 0!==n?n:J.toUpperCase():"",me={required:!!a&&s,pattern:{value:/^-?\d+(?:\.\d+)?$/,message:c}},ve=p(p(p(p(p(p(p({backgroundColor:h,color:y,fontSize:x,fontFamily:k,fontWeight:w},I&&{width:I}),q&&{height:q}),W&&{minWidth:W}),U&&{maxWidth:U}),$&&{minHeight:$}),H&&{maxHeight:H}),{"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:M},"&:hover fieldset":{borderColor:M},"&.Mui-focused fieldset":{borderColor:M},"&.Mui-disabled fieldset":{borderColor:M}},"& .MuiOutlinedInput-input":{textAlign:m,paddingLeft:z,paddingTop:R,paddingRight:L,paddingBottom:V}}),ye={color:y,"&.Mui-focused":{color:y}},ge={marginLeft:j,marginTop:O,marginRight:P,marginBottom:E,display:"inline-flex",flexDirection:"column"},xe=fe?Me("span",p({style:{color:y,fontWeight:w}},{children:fe})):null;if(d){var be=de?ne.watch(G):pe,ke=null!=be?be:"-";return Ce(jp,p({sx:p(p(p(p(p(p(p({},ge),I&&{width:I}),q&&{height:q}),W&&{minWidth:W}),U&&{maxWidth:U}),$&&{minHeight:$}),H&&{maxHeight:H})},K,{children:[Y&&Me(nm,p({sx:{fontSize:x,fontFamily:k,fontWeight:w,color:y,marginLeft:0}},{children:Y})),Me(qc,p({sx:{fontSize:x,fontFamily:k,fontWeight:w,color:y,backgroundColor:h,paddingLeft:z,paddingTop:R,paddingRight:L,paddingBottom:V,border:"1px solid ".concat(M||"#ccc"),borderRadius:"4px",minWidth:"100px"}},{children:"left"===te?"".concat(fe).concat(ke):"".concat(ke).concat(fe)}))]}))}var _e=function(e,t){return Me(Qb,p({type:"number",label:Y,required:a,placeholder:Z,variant:"outlined",sx:ge,inputProps:{step:he},slotProps:{input:{sx:ve,style:{textAlign:m}},inputLabel:{sx:ye}},InputProps:{startAdornment:"left"===te&&xe?Me(Mm,p({position:"start"},{children:xe})):void 0,endAdornment:"right"===te&&xe?Me(Mm,p({position:"end"},{children:xe})):void 0},error:!!t,helperText:t||null},e,K))};return de?Me(QS,{name:G,rules:me,control:oe,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return _e(r,null===(t=n.error)||void 0===t?void 0:t.message)}}):_e({value:ce,onChange:function(e){return ue(e.target.value)}})},xBt=e.forwardRef(function(e,t){var r=e.inputRef,n=h(e,["inputRef"]);return Me($k,p({},n,{ref:function(e){"function"==typeof r&&r(e?e.inputElement:null)},mask:k_,guide:!0,placeholderChar:" "}))}),bBt=function(e){var t=e.masked,r=e.errorMsg,n=e.inputSx,o=e.labelSx,a=h(e,["masked","errorMsg","inputSx","labelSx"]);return Me(Qb,p({},a,{variant:"outlined",error:!!r,helperText:r||null,type:"text",slotProps:{input:p({sx:n},t?{inputComponent:xBt}:{}),inputLabel:{sx:o}}}))},kBt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"Email is required":s,c=t.validationErrorText,u=void 0===c?"Invalid email address":c,d=t.text,h=t.placeholderText,f=t.masked,m=void 0!==f&&f,v=t.multiLine,y=void 0!==v&&v,g=t.backgroundColor,x=t.borderColor,b=t.color,k=void 0===b?"inherit":b,_=t.fontSize,w=void 0===_?"16px":_,M=t.fontFamily,C=void 0===M?"inherit":M,j=t.fontWeight,D=void 0===j?"normal":j,O=t.textAlign,S=void 0===O?"left":O,P=t.marginLeft,T=void 0===P?"0":P,E=t.marginTop,N=void 0===E?"0":E,z=t.marginRight,A=void 0===z?"0":z,R=t.marginBottom,F=void 0===R?"0":R,L=t.paddingLeft,B=void 0===L?"0":L,V=t.paddingTop,I=void 0===V?"0":V,q=t.paddingRight,$=void 0===q?"0":q,H=t.paddingBottom,W=void 0===H?"0":H,U=t.width,Y=t.height,Z=t.minHeight,K=t.maxHeight,G=t.minWidth,X=t.maxWidth,Q=t.name,J=t.sourceDataModelField,ee=t.configurationItemInfo,te=WS(),re=null==te?void 0:te.control,ne=!(!re||!Q),oe=KBt().localStateObject,ae=JBt().stateConfig,ie=oe||ae,se=J?null===(r=null==ie?void 0:ie[J])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==se&&ne&&te.setValue(Q,se)},[se]);var le=e.useState("");le[0],le[1];var ce={required:!!i&&l,pattern:{value:/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@(([^<>()[\]\\.,;:\s@"]+\.)+[^<>()[\]\\.,;:\s@"]{2,})$/,message:u}};if(o){var ue=(ne?te.watch(Q)||"":se)||h||"-";return Ce("div",p({style:p(p(p({display:"inline-flex",flexDirection:"column",marginLeft:T,marginTop:N,marginRight:A,marginBottom:F},U&&{width:U}),Y&&{height:Y}),{minHeight:Z,maxHeight:K,minWidth:G,maxWidth:X})},ee,{children:[d&&Me(nm,p({sx:{fontSize:w,fontFamily:C,fontWeight:D,color:k,marginLeft:0,marginBottom:"4px"}},{children:d})),Me(qc,p({sx:{fontSize:w,fontFamily:C,fontWeight:D,color:k,paddingLeft:B,paddingTop:I,paddingRight:$,paddingBottom:W,backgroundColor:g,border:"1px solid ".concat(x||"#ccc"),borderRadius:"4px",minWidth:"120px",textAlign:S}},{children:ue}))]}))}var de=p(p(p(p(p(p(p({backgroundColor:g,color:k,fontSize:w,fontFamily:C,fontWeight:D},U&&{width:U}),Y&&{height:Y}),G&&{minWidth:G}),X&&{maxWidth:X}),Z&&{minHeight:Z}),K&&{maxHeight:K}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:x||"inherit"},"& .MuiOutlinedInput-input":{textAlign:S,paddingLeft:B,paddingTop:I,paddingRight:$,paddingBottom:W}}),pe={color:k,"&.Mui-focused":{color:k}},he=y?3:1;if(ne)return Me("div",p({style:{marginLeft:T,marginTop:N,marginRight:A,marginBottom:F}},{children:Me(QS,{name:Q,rules:ce,control:re,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return Me(bBt,p({masked:m,required:i,errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,inputSx:de,labelSx:pe,label:d,placeholder:h,multiline:y,minRows:he,value:r.value||"",onChange:r.onChange},ee||{}))}})}));var fe=e.useState(""),me=fe[0],ve=fe[1];return Me("div",p({style:{marginLeft:T,marginTop:N,marginRight:A,marginBottom:F}},{children:Me(bBt,p({masked:m,required:i,errorMsg:void 0,inputSx:de,labelSx:pe,label:d,placeholder:h,multiline:y,minRows:he,value:me,onChange:function(e){return ve(e.target.value)}},ee||{}))}))},_Bt=function(e){return{justifyContent:e.textAlign||"flex-start",backgroundColor:e.backgroundColor,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,paddingLeft:e.paddingLeft}},wBt=function(t){var r,n=t.popover,o=void 0===n||n,a=t.items,i=t.marginTop,s=void 0===i?"0":i,l=t.marginRight,c=void 0===l?"0":l,u=t.marginBottom,d=void 0===u?"0":u,h=t.marginLeft,f=void 0===h?"0":h,m=t.paddingTop,v=void 0===m?"0":m,y=t.paddingRight,g=void 0===y?"0":y,x=t.paddingBottom,b=void 0===x?"0":x,k=t.paddingLeft,_=void 0===k?"0":k,w=t.cornerRadius,M=void 0===w?"4px":w,C=t.backgroundColor,j=void 0===C?"#fff":C,D=t.width,O=void 0===D?"100%":D,S=t.height,P=void 0===S?"auto":S,T=t.borderColor,E=void 0===T?"#ccc":T,N=t.borderWeight,z=void 0===N?"1px":N,A=t.buttonText,R=void 0===A?"Open Menu":A,F=t.buttonVariant,L=void 0===F?"contained":F,B=t.buttonTextColor,V=t.buttonFontSize,I=t.buttonFontWeight,q=t.buttonFontFamily,$=t.buttonDisabled,H=void 0!==$&&$,W=t.buttonGap,U=void 0===W?0:W,Y=t.buttonStartIcon,Z=t.buttonEndIcon,K=t.buttonCornerRadius,G=void 0===K?"0":K,X=t.buttonMarginTop,Q=void 0===X?"0":X,J=t.buttonMarginRight,ee=void 0===J?"0":J,te=t.buttonMarginBottom,re=void 0===te?"0":te,ne=t.buttonMarginLeft,oe=void 0===ne?"0":ne,ae=t.buttonPaddingTop,ie=void 0===ae?"0":ae,se=t.buttonPaddingRight,le=void 0===se?"0":se,ce=t.buttonPaddingBottom,ue=void 0===ce?"0":ce,de=t.buttonPaddingLeft,pe=void 0===de?"0":de,he=t.buttonIconOnly,fe=t.buttonElevation,ve=t.buttonFillColor,ye=t.buttonFillColorDisabled,ge=t.buttonFillColorHover,xe=t.buttonFillColorPressed,be=t.buttonBorderColor,ke=t.buttonBorderColorDisabled,_e=t.buttonBorderColorHover,we=t.buttonBorderColorPressed,je=t.buttonTextColorDisabled,De=t.buttonTextColorHover,Oe=t.buttonTextColorPressed,Se=t.buttonColor,Pe=void 0===Se?"#1976d2":Se,Te=t.anchorOriginVertical,Ee=void 0===Te?"bottom":Te,Ne=t.anchorOriginHorizontal,ze=void 0===Ne?"left":Ne,Ae=t.transformOriginVertical,Re=void 0===Ae?"top":Ae,Fe=t.transformOriginHorizontal,Le=void 0===Fe?"left":Fe,Be=t.elevation,Ve=void 0===Be?3:Be,Ie=t.moleculeId,qe=t.configurationItemInfo,$e=me(),He=KBt(),We=He.isConfigurationMode,Ue=He.selectedConfigurationItemId,Ye=He.onConfigurationItemClicked,Ze=He.onInternalNavigation,Ke=e.useState(null),Ge=Ke[0],Xe=Ke[1],Qe=e.useState(!1),Je=Qe[0],et=Qe[1],tt=Boolean(We&&(Ue===Ie||a.some(function(e){return e.id===Ue}))),rt=function(){return et(!1)},nt=p({marginTop:s,marginRight:c,marginBottom:d,marginLeft:f,paddingTop:v,paddingRight:g,paddingBottom:b,paddingLeft:_},o?{display:"inline-block",zIndex:null===(r=null==$e?void 0:$e.zIndex)||void 0===r?void 0:r.drawer}:{width:O,height:P,backgroundColor:j,display:"block",overflow:"hidden",border:"".concat(z," solid ").concat(E),borderRadius:M});return o?Ce(jp,{children:[Me(L2e,{ref:Xe,text:R,variant:L,moleculeId:Ie,textColor:B,fontSize:V,fontWeight:I,fontFamily:q,disabled:H,gap:U,startIcon:Y,endIcon:Z,onClick:function(){return et(!0)},marginTop:Q,marginRight:ee,marginBottom:re,marginLeft:oe,paddingTop:ie,paddingRight:le,paddingBottom:ue,paddingLeft:pe,borderRadius:G,iconOnly:he,elevation:fe,fillColor:ve||Pe,fillColorDisabled:ye,fillColorHover:ge,fillColorPressed:xe,borderColor:be,borderColorDisabled:ke,borderColorHover:_e,borderColorPressed:we,textColorDisabled:je,textColorHover:De,textColorPressed:Oe,configurationItemInfo:qe}),Me(Pv,p({open:We?tt:Je,variant:"menu",anchorEl:Ge,disablePortal:!0,disableScrollLock:!0,disableRestoreFocus:!0,disableEnforceFocus:!0,onClose:rt,anchorOrigin:{vertical:Ee,horizontal:ze},transformOrigin:{vertical:Re,horizontal:Le},elevation:Ve,slotProps:{paper:{sx:{backgroundColor:j}}},sx:nt},{children:a.map(function(e){var t=Ue===e.id,r={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},n=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!1)}:void 0,o=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!0)}:void 0,a=We?{onClick:n,onDoubleClick:o,"data-organism-id":e.id,css:n4e({theme:$e,selected:t})}:{};return Ce(Av,p({sx:_Bt(e),onClick:function(){var t,r;(null==e?void 0:e.link)&&(cot(e.link)?null==Ze||Ze(null===(t=e.link)||void 0===t?void 0:t.internalLink):lot(null===(r=e.link)||void 0===r?void 0:r.externalLink)),rt()},disabled:e.disabled},a,{children:[e.startIcon&&Me(N2e,{iconName:e.startIcon,color:e.textColor}),Me(qc,p({sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",width:"100%",textAlign:e.textAlign||"left"}},{children:e.text})),e.endIcon&&Me(N2e,{iconName:e.endIcon,color:e.textColor})]}),e.id)})}))]}):Me(zl,p({id:Ie,sx:nt,elevation:Ve},qe,{children:Me(Im,p({disablePadding:!0},{children:a.map(function(e){var t=Ue===e.id,r={entityId:e.id,entity:"molecule_item",entityType:"menu_item"},n=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!1)}:void 0,o=We?function(e){e.stopPropagation(),null==Ye||Ye(r,!0)}:void 0,a=We?{onClick:n,onDoubleClick:o,"data-organism-id":e.id,css:n4e({theme:$e,selected:t})}:{};return Ce(Ym,p({disabled:e.disabled,sx:_Bt(e),onClick:function(){var t,r;(null==e?void 0:e.link)&&(cot(e.link)?null==Ze||Ze(null===(t=e.link)||void 0===t?void 0:t.internalLink):lot(null===(r=e.link)||void 0===r?void 0:r.externalLink))}},a,{children:[e.startIcon&&Me(N2e,{iconName:e.startIcon,color:e.textColor}),Me(sv,{primary:Me(qc,p({sx:{ml:e.startIcon?1:0,mr:e.endIcon?1:0,color:e.textColor||"inherit",fontSize:e.fontSize||"inherit",fontWeight:e.fontWeight||"normal",fontFamily:e.fontFamily||"inherit",whiteSpace:e.wrap?"normal":"nowrap",textAlign:e.textAlign||"left"}},{children:e.text}))}),e.endIcon&&Me(N2e,{iconName:e.endIcon,color:e.textColor})]}),e.id)})}))}))};var MBt=function(e){var t=e.errorMsg,r=e.stepValue,n=e.minValue,o=e.allowNegative,a=e.inputSx,i=e.labelSx,s=h(e,["errorMsg","stepValue","minValue","allowNegative","inputSx","labelSx"]);return Me(Qb,p({},s,{variant:"outlined",type:"number",error:!!t,helperText:t||null,inputProps:{step:r,min:o?void 0:n},slotProps:{input:{sx:a},inputLabel:{sx:i}}}))},CBt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"This field is required":s,c=t.validationErrorText,u=void 0===c?"Invalid numeric value":c,d=t.text,h=t.placeholderText,f=t.backgroundColor,m=t.borderColor,v=t.textColor,y=void 0===v?"#000":v,g=t.fontSize,x=t.fontFamily,b=t.fontWeight,k=t.allowNegative,_=void 0!==k&&k,w=t.numericPrecision,M=void 0===w?"1":w,C=t.name,j=t.sourceDataModelField,D=t.marginLeft,O=void 0===D?"0":D,S=t.marginTop,P=void 0===S?"0":S,T=t.marginRight,E=void 0===T?"0":T,N=t.marginBottom,z=void 0===N?"0":N,A=t.paddingLeft,R=void 0===A?"0":A,F=t.paddingTop,L=void 0===F?"0":F,B=t.paddingRight,V=void 0===B?"0":B,I=t.paddingBottom,q=void 0===I?"0":I,$=t.width,H=t.height,W=t.configurationItemInfo;t._textAlign;var U=t.minHeight,Y=t.maxHeight,Z=t.minWidth,K=t.maxWidth,G=WS(),X=null==G?void 0:G.control,Q=!(!X||!C),J=KBt().localStateObject,ee=JBt().stateConfig,te=J||ee,re=j?null===(r=null==te?void 0:te[j])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==re&&Q&&G.setValue(C,re)},[re]);var ne=e.useState(""),oe=ne[0],ae=ne[1],ie=parseFloat(M),se=_?void 0:0,le={required:!!i&&l,pattern:{value:_?/^-?\d*(\.\d+)?$/:/^\d*(\.\d+)?$/,message:u}};if(_||(le.min={value:0,message:"Value cannot be less than zero"}),o){var ce="",ue=(ce=Q?G.watch(C)||"":re)?function(e,t,r){if(!e)return"";var n=parseFloat(e);if(Number.isNaN(n))return e;if(!r&&n<0)return"0";if(t){var o=(t.split(".")[1]||"").length;if(o>0)return n.toFixed(o)}return e}(ce,M,_):h||"-";return Ce("div",p({style:p(p(p(p(p(p({display:"inline-flex",flexDirection:"column",marginLeft:O,marginTop:P,marginRight:E,marginBottom:z},$&&{width:$}),H&&{height:H}),Z&&{minWidth:Z}),K&&{maxWidth:K}),U&&{minHeight:U}),Y&&{maxHeight:Y})},W,{children:[d&&Me(nm,p({sx:{fontSize:g,fontFamily:x,fontWeight:b,color:y,marginBottom:"4px"}},{children:d})),Me(qc,p({sx:{fontSize:g,fontFamily:x,fontWeight:b,color:y,paddingLeft:R,paddingTop:L,paddingRight:V,paddingBottom:q,backgroundColor:f,border:"1px solid ".concat(m||"#ccc"),borderRadius:"4px",minWidth:"60px"}},{children:ue}))]}))}var de=p(p(p(p(p(p(p({backgroundColor:f,color:y,fontSize:g,fontFamily:x,fontWeight:b},$&&{width:$}),H&&{height:H}),Z&&{minWidth:Z}),K&&{maxWidth:K}),U&&{minHeight:U}),Y&&{maxHeight:Y}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:m||"inherit"}}),pe={color:y,"&.Mui-focused":{color:y}};return Me(If,p({required:i,sx:{marginLeft:O,marginTop:P,marginRight:E,marginBottom:z,width:"fit-content"}},W,Q?{children:Me(QS,{name:C,rules:le,control:X,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return Me(MBt,{errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,label:d,placeholder:h,stepValue:ie,minValue:se,allowNegative:_,inputSx:de,labelSx:pe,value:r.value||"",onChange:function(e){return r.onChange(e.target.value)}})}})}:{children:Me(MBt,{errorMsg:void 0,label:d,placeholder:h,stepValue:ie,minValue:se,allowNegative:_,inputSx:de,labelSx:pe,value:oe,onChange:function(e){return ae(e.target.value)}})}))},jBt=["+"," ","(",/[0-9]/,/[0-9]/,/[0-9]/,")"," ",/[0-9]/,/[0-9]/,/[0-9]/,"-",/[0-9]/,/[0-9]/,/[0-9]/,/[0-9]/],DBt=e.forwardRef(function(e,t){var r=e.inputRef,n=h(e,["inputRef"]);return Me($k,p({},n,{ref:function(e){"function"==typeof r&&r(e?e.inputElement:null)},mask:jBt,guide:!0,placeholderChar:" "}))});var OBt,SBt,PBt,TBt,EBt,NBt,zBt,ABt,RBt,FBt,LBt,BBt,VBt=function(e){var t=e.masked,r=e.errorMsg,n=e.inputSx,o=e.labelSx,a=h(e,["masked","errorMsg","inputSx","labelSx"]);return Me(Qb,p({},a,{variant:"outlined",error:!!r,helperText:r||null,slotProps:{input:p({sx:n},t?{inputComponent:DBt}:{}),inputLabel:{sx:o}}}))},IBt=function(t){var r,n=t.isDisplayOnly,o=void 0!==n&&n,a=t.required,i=void 0!==a&&a,s=t.requiredErrorText,l=void 0===s?"Phone is required":s,c=t.validationErrorText,u=void 0===c?"Invalid phone number":c,d=t.text,h=t.placeholderText,f=t.masked,m=void 0===f||f;t.multiLine;var v=t.backgroundColor,y=t.borderColor,g=t.textColor,x=void 0===g?"#000":g,b=t.fontSize,k=t.fontFamily,_=t.fontWeight;t.textAlign;var w=t.marginLeft,M=void 0===w?"0":w,C=t.marginTop,j=void 0===C?"0":C,D=t.marginRight,O=void 0===D?"0":D,S=t.marginBottom,P=void 0===S?"0":S,T=t.paddingLeft,E=void 0===T?"0":T,N=t.paddingTop,z=void 0===N?"0":N,A=t.paddingRight,R=void 0===A?"0":A,F=t.paddingBottom,L=void 0===F?"0":F,B=t.width,V=t.height,I=t.minHeight,q=t.maxHeight,$=t.minWidth,H=t.maxWidth,W=t.name,U=t.sourceDataModelField,Y=t.configurationItemInfo,Z=WS(),K=null==Z?void 0:Z.control,G=!(!K||!W),X=KBt().localStateObject,Q=JBt().stateConfig,J=X||Q,ee=U?null===(r=null==J?void 0:J[U])||void 0===r?void 0:r.value:void 0;e.useEffect(function(){void 0!==ee&&G&&Z.setValue(W,ee)},[ee]);var te=e.useState(""),re=te[0],ne=te[1],oe={required:!!i&&l,pattern:{value:/^\d{10}$/,message:u}};if(o){var ae="";ae=G?Z.watch(W)||"":ee;var ie=m?function(e){var t=(null!=e?e:"").replace(/\D+/g,"");if(!t)return"";var r="",n=0;return D_.forEach(function(e){"string"==typeof e?r+=e:n<t.length?(r+=t[n],n+=1):r+="_"}),r}(ae):ae,se=ie||h||"-";return Ce("div",p({style:p(p(p(p(p(p({display:"inline-flex",flexDirection:"column",marginLeft:M,marginTop:j,marginRight:O,marginBottom:P},B&&{width:B}),V&&{height:V}),$&&{minWidth:$}),H&&{maxWidth:H}),I&&{minHeight:I}),q&&{maxHeight:q})},Y,{children:[d&&Me(nm,p({sx:{fontSize:b,fontFamily:k,fontWeight:_,color:x,marginLeft:0,marginBottom:"4px"}},{children:d})),Me(qc,p({sx:{fontSize:b,fontFamily:k,fontWeight:_,color:x,paddingLeft:E,paddingTop:z,paddingRight:R,paddingBottom:L,backgroundColor:v,border:"1px solid ".concat(y||"#ccc"),borderRadius:"4px",minWidth:"120px"}},{children:se}))]}))}var le=p(p(p(p(p(p(p({backgroundColor:v,color:x,fontSize:b,fontFamily:k,fontWeight:_},B&&{width:B}),V&&{height:V}),$&&{minWidth:$}),H&&{maxWidth:H}),I&&{minHeight:I}),q&&{maxHeight:q}),{"& .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"},"& .MuiOutlinedInput-root.Mui-disabled:hover .MuiOutlinedInput-notchedOutline":{borderColor:y||"inherit"}}),ce={color:x,"&.Mui-focused":{color:x}},ue={marginLeft:M,marginTop:j,marginRight:O,marginBottom:P,width:"fit-content"};return Me(If,p({required:i,sx:ue},Y,G?{children:Me(QS,{name:W,rules:oe,control:K,defaultValue:"",render:function(e){var t,r=e.field,n=e.fieldState;return Me(VBt,{masked:m,errorMsg:null===(t=n.error)||void 0===t?void 0:t.message,inputSx:le,labelSx:ce,label:d,placeholder:h,value:r.value||"",onChange:function(e){var t,n,o=(null!==(n=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==n?n:"").toString().replace(/\D+/g,"");r.onChange(o)}})}})}:{children:Me(VBt,{masked:m,errorMsg:void 0,inputSx:le,labelSx:ce,label:d,placeholder:h,value:re,onChange:function(e){var t,r,n=(null!==(r=null===(t=null==e?void 0:e.target)||void 0===t?void 0:t.value)&&void 0!==r?r:"").toString();ne(n.replace(/\D+/g,""))}})}))},qBt=function(t){var r=t.items,n=t.onTabChange,o=t.activeTabKey,a=t.isMobile,i=void 0!==a&&a,s=t.marginTop,l=t.marginRight,c=t.marginBottom,u=t.marginLeft,d=t.paddingTop,h=t.paddingRight,f=t.paddingBottom,m=t.paddingLeft,v=t.buttonPaddingTop,y=t.buttonPaddingRight,g=t.buttonPaddingBottom,x=t.buttonPaddingLeft,b=t.width,k=t.height,_=t.backgroundColor,w=t.borderRadius,M=t.elevation,C=void 0===M?1:M,j=t.gap,D=t.indicatorVisible,O=void 0===D||D,S=t.indicatorColor,P=t.lineWidth,T=void 0===P?"2px":P,E=t.orientation,N=void 0===E?"horizontal":E,z=t.activeTextColor,A=void 0===z?"#1976d2":z,R=t.inactiveTextColor,F=void 0===R?"#000":R,L=t.fontSize,B=t.fontWeight,V=t.fontFamily,I=t.wrapText,q=t.textAlign,$=t.iconName,H=t.iconColor,W=t.iconSize,U=t.iconPlacement,Y=void 0===U?"left":U,Z=t.hoverTextColor,K=t.itemBorder,G=t.itemBorderRadius,X=t.itemBackgroundColor,Q=t.itemSelectedBackgroundColor,J=t.itemHoverBackgroundColor,ee=t.selectedItemElevation,te=void 0===ee?0:ee,re=t.itemDisableRipple,ne=t.configurationItemInfo,oe=me(),ae=KBt(),ie=ae.isConfigurationMode,se=ae.onConfigurationItemClicked,le=ae.selectedConfigurationItemId,ce=e.useState(null),ue=ce[0],de=ce[1],pe=function(){return de(null)},he={marginTop:s,marginRight:l,marginBottom:c,marginLeft:u,paddingTop:d,paddingRight:h,paddingBottom:f,paddingLeft:m,width:b,height:k,backgroundColor:_,borderRadius:w,display:"flex",overflow:"visible !important"},fe=function(e){var t=e?A:F,r=e&&Q||X;return{color:t,fontSize:L,fontWeight:B,fontFamily:V,textAlign:q,whiteSpace:I?"normal":"nowrap",border:K,borderRadius:G,backgroundColor:r,boxShadow:e?oe.shadows[te]:void 0,paddingTop:v,paddingRight:y,paddingBottom:g,paddingLeft:x,"&:hover":{color:Z||t,backgroundColor:J||r}}},ve=function(e){null==n||n({newTabKey:e.tabKey,link:e.link})},ye=function(e){if(!ie)return{};var t=e.id===le,r={entityId:e.id,entity:"molecule_item",entityType:"tabs_item"};return{onClick:function(e){e.stopPropagation(),null==se||se(r,!1)},onDoubleClick:function(e){e.stopPropagation(),null==se||se(r,!0)},"data-organism-id":e.id,css:n4e({theme:oe,selected:t})}};if(i)return Ce(zl,p({elevation:C,style:he},ne,{children:[Me(_c,p({onClick:function(e){return de(e.currentTarget)}},{children:Me(N2e,{size:W,color:H,iconName:$})})),Me(Pv,p({anchorEl:ue,open:Boolean(ue),onClose:pe},{children:r.map(function(e){var t=e.tabKey===o,r=fe(t);return Ce(Av,p({onClick:function(){ve(e),pe()},sx:p(p({},r),{display:"flex",alignItems:"center"})},ye(e),{children:[e.iconName&&Me(N2e,{iconName:e.iconName,sx:{fontSize:L,color:t?A:F,mr:1}}),Me(jp,p({component:"span"},{children:e.label}))]}),e.id)})}))]}));var ge=r.findIndex(function(e){return e.tabKey===o});return Me(zl,p({elevation:C,style:he},ne,{children:Me(Ob,p({value:ge<0?0:ge,onChange:function(e,t){return ie?null:ve(r[t])},orientation:N,sx:{overflow:"visible","& .MuiTabs-flexContainer":{gap:j}},TabIndicatorProps:{style:O?{height:T,borderRadius:w,backgroundColor:S||A}:{display:"none"}}},{children:r.map(function(e){var t=e.tabKey===o,r=p(p({},fe(t)),{"&.Mui-selected":{color:t?A:F}});return Me(ob,p({label:e.label,disableRipple:re,sx:p(p({},r),{textTransform:"none"}),onClick:function(){return ve(e)},iconPosition:"right"===Y?"end":"start",icon:e.iconName?Me(N2e,{iconName:e.iconName,sx:{fontSize:L,color:t?A:F}}):void 0},ye(e)),e.id)})}))}))},$Bt=function(t){var r,n,o,a=t.id,i=t.type,s=t.name,l=t.form,c=t.config;t.formData;var u=t.isMobile,d=t.children,v=t.tabsProps,y=t.properties,g=t.organismLibraryMoleculeId,x=me(),b=u||ok("xs"),k=KBt(),_=k.formId,w=k.isPreview,M=void 0!==w&&w,C=k.validations,j=k.submitHandler,D=k.isConfigurationMode,O=k.onConfigurationItemClicked,S=k.selectedConfigurationItemId,P=k.currentStyleProperties,T=k.currentContentProperties,E=k.onInternalNavigation,N=KBt().localStateObject,z=JBt().stateConfig,A=N||z,R=(null===(r=null==c?void 0:c.props)||void 0===r?void 0:r.dataCaptureName)||(null===(n=null==y?void 0:y.dataCapture)||void 0===n?void 0:n.dataCaptureName)||a,F=null===(o=null==y?void 0:y.dataCapture)||void 0===o?void 0:o.sourceDataModelFieldId,L=S===a,B=ZBt(),V=B.setActivePopUpById,I=B.setDrawerVisible,q=B.onCloseModal,$=B.onCloseDrawer,H=function(e){var t=e.stateListenerId,r=KBt().localStateObject,n=JBt().stateConfig,o=r||n,a=!0,i=!1;if(!t)return{isStateDisabled:i,isStateVisible:a};var s=(null==o?void 0:o[t])||{},l=s||{},c=l.visible,u=void 0===c||c,d=l.disabled,p=void 0!==d&&d;return t in o&&(a=Boolean(u),i=Boolean(p)),{isStateDisabled:i,isStateVisible:a,stateValue:s}}({stateListenerId:a}),W=H.isStateDisabled,U=H.isStateVisible,Y=e.useMemo(function(){return{entityType:i,entity:"molecule",entityName:s,entityId:a,organismLibraryMoleculeId:g}},[i,s,a,g]),Z=e.useCallback(function(e){null==e||e.stopPropagation(),O(Y,!1)},[O,Y]),K=e.useCallback(function(e){null==e||e.stopPropagation(),O(Y,!0)},[O,Y]),G=D?{onClick:Z,onDoubleClick:K,"data-configuration-id":a,css:n4e({theme:x,selected:L})}:{},X=D||W;if(!U)return null;return function(){var e,t,r,n,o,s,u,g,x;switch(i){case"simple_text":var k=Aat(O={text:null==y?void 0:y.text},T,N=["text"],L).text,w=Rat(null==c?void 0:c.props,P,L);return Me(tot,p({},w,{text:(null==k?void 0:k.text)||"",htmlElementId:a,configurationsItemInfo:G}));case"text":var O={text:null==y?void 0:y.text},N=Object.keys(O);k=Aat(O,T,N,L).text,w=Rat(null==c?void 0:c.props,P,L);return Me(eot,p({},k,w,{htmlElementId:a,configurationItemInfo:G}));case"consent":var z=Aat(y,T,[],L);w=Rat(null==c?void 0:c.props,P,L)||{};return Me(s4e,p({},w,{htmlElementId:a,properties:z,configurationItemInfo:G}));case"signup_password_fields":O={text:null==y?void 0:y.text,subText:null==y?void 0:y.subText,placeholderText:null==y?void 0:y.placeholderText,subPlaceholderText:null==y?void 0:y.subPlaceholderText,validationText:null==y?void 0:y.validationText},N=Object.keys(O);var B=Aat(O,T,N,L),H=Rat(null==c?void 0:c.props,P,L),U=H.state,Y=H.gap,Z=h(H,["state","gap"]);return Me(Mot,{gap:Y,inputProps:Z,validations:C||[],htmlElementId:a,validationState:U,overridesProperties:B,configurationItemInfo:G});case"stepper":var K=Rat(null==c?void 0:c.props,P,L),Q=null==d?void 0:d.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a=h(r,["properties","config"]),i={title:null==n?void 0:n.title,subText:null==n?void 0:n.subText},s=Object.keys(i),l=Aat(i,T,s,t),c=l.title,u=l.subText,d=Rat(null==o?void 0:o.props,P,t);return p(p(p({},a),d),{title:(null==c?void 0:c.text)||"",subText:(null==u?void 0:u.text)||""})});return Me(tat,p({},K,{items:Q||[],isMobile:b,moleculeId:a,configurationItemInfo:G}));case"checklist":var J=Rat(null==c?void 0:c.props,P,L)||{},ee=null==d?void 0:d.map(function(e){var t,r,n,o,a,i=S===e.id,s=e||{},l=s.properties,c=s.config,u=h(s,["properties","config"]);switch(e.type){case"checklist_item":var d={label:null==l?void 0:l.label,objectState:null==l?void 0:l.objectState},f=Object.keys(d),m=Aat(d,T,f,i),v=Rat(null==c?void 0:c.props,P,i)||{},y=(null===(t=m.label)||void 0===t?void 0:t.text)||"",g=!!(null===(r=m.objectState)||void 0===r?void 0:r.pmiObjectId);return p(p(p({},u),v),{type:"checklist_item",label:y,textColor:v.textColor||"#000",fontSize:v.fontSize||"14px",fontFamily:v.fontFamily||"inherit",fontWeight:v.fontWeight||"normal",textAlign:v.textAlign||"left",isSystemDriven:g,disabled:g,interacted:(null===(n=null==A?void 0:A[e.id])||void 0===n?void 0:n.interacted)||"unchecked"});case"divider_item":v=Rat(null==c?void 0:c.props,P,i)||{};return p(p(p({},u),v),{type:"divider_item"});case"text_item":d={text:null==l?void 0:l.text},f=Object.keys(d),m=Aat(d,T,f,i),v=Rat(null==c?void 0:c.props,P,i)||{};var x=(null===(o=m.text)||void 0===o?void 0:o.text)||"";return p(p(p({},u),v),{type:"text_item",text:x});case"rich_text_item":d={text:null==l?void 0:l.text},f=Object.keys(d),m=Aat(d,T,f,i),v=Rat(null==c?void 0:c.props,P,i)||{},x=(null===(a=m.text)||void 0===a?void 0:a.text)||xVt;return p(p(p({},u),v),{type:"rich_text_item",text:x});default:return p(p({},u),{type:e.type})}});return Me(a4e,p({},J,{items:ee||[],moleculeId:a,configurationItemInfo:G}));case"accordion":var te=Rat(null==c?void 0:c.props,P,L);ee=null==d?void 0:d.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a=h(r,["properties","config"]),i={text:null==n?void 0:n.text,subText:null==n?void 0:n.subText,bodyText:null==n?void 0:n.bodyText},s=Object.keys(i),l=Aat(i,T,s,t),c=l.text,u=l.subText,d=l.bodyText,f=Rat(null==o?void 0:o.props,P,t);return p(p(p({},a),f),{text:(null==c?void 0:c.text)||"",subText:(null==u?void 0:u.text)||"",bodyText:(null==d?void 0:d.text)||""})});return Me(Fat,p({},te,{items:ee||[],moleculeId:a,configurationItemInfo:G}));case"menu":O={text:null==y?void 0:y.text,disabled:null==y?void 0:y.disabled},N=Object.keys(O);var re=Aat(O,T,N,L),ne=re.text,oe=re.disabled,ae=Rat(null==c?void 0:c.props,P,L);ee=null==d?void 0:d.map(function(e){var t,r=S===e.id,n=e||{},o=n.properties,a=n.config,i=h(n,["properties","config"]),s={disabled:o&&"disabled"in o?o.disabled:void 0,text:o&&"text"in o?o.text:void 0,link:o&&"link"in o?o.link:void 0},l=Object.keys(s),c=Aat(s,T,l,r),u=c.text,d=c.disabled,f=c.link,m=Rat(null==a?void 0:a.props,P,r);return p(p(p({},i),m),{disabled:(null==A?void 0:A[e.id])?null===(t=null==A?void 0:A[e.id])||void 0===t?void 0:t.disabled:(null==d?void 0:d.value)||(null==m?void 0:m.disabled)||!1,text:(null==u?void 0:u.text)||"Menu Item",link:f})});return Me(wBt,p({},ae,{items:ee||[],moleculeId:a,buttonText:(null==ne?void 0:ne.text)||"Open Menu",configurationItemInfo:G,buttonDisabled:(null==A?void 0:A[a])?null===(e=null==A?void 0:A[a])||void 0===e?void 0:e.disabled:(null==oe?void 0:oe.value)||(null==ae?void 0:ae.disabled)||!1}));case"tabs":w=Rat(null==c?void 0:c.props,P,L);var ie=null==d?void 0:d.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a={label:null==n?void 0:n.label,link:null==n?void 0:n.link},i=Object.keys(a),s=Aat(a,T,i,t),l=s.label,c=s.link,u=Rat(null==o?void 0:o.props,P,t);return p(p({},u),{id:e.id,tabKey:cot(c)?sot(rot,null==c?void 0:c.internalLink):void 0,label:(null==l?void 0:l.text)||"",link:c})}),se=null==v?void 0:v.tabs.map(function(e){var t=e.text,r=h(e,["text"]);return p(p({},r),{label:t||""})}),le=Boolean(null==w?void 0:w.isTabsSystemDerived),ce=le?se:ie,ue=(null==v?void 0:v.activeTabKey)||(null===(t=null==ce?void 0:ce[0])||void 0===t?void 0:t.tabKey)||"";return Me(qBt,p({},w,{items:ce||[],isMobile:b,moleculeId:a,activeTabKey:ue,configurationItemInfo:G,onTabChange:D?void 0:function(e){var t,r=e.newTabKey,n=e.link;le?null===(t=null==v?void 0:v.onTabChange)||void 0===t||t.call(v,r):cot(n)?null==E||E((null==n?void 0:n.internalLink)||""):lot(null==n?void 0:n.externalLink)}}));case"divider":w=Rat(null==c?void 0:c.props,P,L);return Me(Xnt,p({moleculeId:a,configurationItemInfo:G},w));case"link":O={text:null==y?void 0:y.text,link:null==y?void 0:y.link},N=Object.keys(O);var de=Aat(O,T,N,L),pe=(k=de.text,de.link);w=Rat(null==c?void 0:c.props,P,L);return Me(bot,p({moleculeId:a},w,{type:null==pe?void 0:pe.type,src:X?void 0:dot(pe,M)||"",text:(null==k?void 0:k.text)||"",disabled:(null==w?void 0:w.disabled)||W,configurationItemInfo:G}));case"video":O={video:null==y?void 0:y.video,coverImage:null==y?void 0:y.coverImage},N=Object.keys(O);var he=Aat(O,T,N,L),fe=he.video,me=he.coverImage;w=Rat(null==c?void 0:c.props,P,L);return Me(iat,p({},w,{moleculeId:a,poster:null===(r=null==me?void 0:me.imageFile)||void 0===r?void 0:r.url,src:null!==(s=null!==(n=null==fe?void 0:fe.videoSource)&&void 0!==n?n:null===(o=null==fe?void 0:fe.videoFile)||void 0===o?void 0:o.url)&&void 0!==s?s:"",configurationItemInfo:G}));case"badge":w=Rat(null==c?void 0:c.props,P,L);return Me(A2e,p({},w,{configurationItemInfo:G}));case"alert":O={text:null==y?void 0:y.text,subText:null==y?void 0:y.subText},N=Object.keys(O);var ve=Aat(O,T,N,L),ye=(k=ve.text,ve.subText);w=Rat(null==c?void 0:c.props,P,L);return Me(z2e,p({text:(null==k?void 0:k.text)||"",subText:(null==ye?void 0:ye.text)||""},w,{configurationItemInfo:G}));case"chip":O={text:null==y?void 0:y.text},N=Object.keys(O),k=Aat(O,T,N,L).text,w=Rat(null==c?void 0:c.props,P,L);return Me(i4e,p({text:(null==k?void 0:k.text)||""},w,{configurationItemInfo:G}));case"email_display_field":case"email_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var ge=Aat(O,T,N,L),xe=(k=ge.text,ge.placeholderText),be=ge.required,ke=ge.requiredErrorText,_e=ge.validationErrorText;w=Rat(null==c?void 0:c.props,P,L);return Me(kBt,p({name:R,text:(null==k?void 0:k.text)||"",placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F,required:null==be?void 0:be.value,isDisplayOnly:"email_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text},w,{configurationItemInfo:G}));case"phone_number_display_field":case"phone_number_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Ce=Aat(O,T,N,L);k=Ce.text,xe=Ce.placeholderText,be=Ce.required,ke=Ce.requiredErrorText,_e=Ce.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(IBt,p({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F,isDisplayOnly:"phone_number_display_field"===i},w,{configurationItemInfo:G}));case"numeric_display_field":case"numeric_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var je=Aat(O,T,N,L);k=je.text,xe=je.placeholderText,be=je.required,ke=je.requiredErrorText,_e=je.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(CBt,p({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"numeric_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F},w,{configurationItemInfo:G}));case"currency_display_field":case"currency_input_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var De=Aat(O,T,N,L);k=De.text,xe=De.placeholderText,be=De.required,ke=De.requiredErrorText,_e=De.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(gBt,p({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"currency_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F},w,{configurationItemInfo:G}));case"basic_text_display_field":case"basic_text_field":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Oe=Aat(O,T,N,L);k=Oe.text,xe=Oe.placeholderText,be=Oe.required,ke=Oe.requiredErrorText,_e=Oe.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(F2e,p({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"basic_text_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:(null==xe?void 0:xe.text)||"",sourceDataModelField:F},w,{configurationItemInfo:G}));case"rating_display_field":case"rating":O={text:null==y?void 0:y.text,dataCapture:null==y?void 0:y.dataCapture,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Se=Aat(O,T,N,L);k=Se.text,be=Se.required,ke=Se.requiredErrorText,_e=Se.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(qot,p({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F,isDisplayOnly:"rating_display_field"===i},w,{configurationItemInfo:G}));case"switch_display_field":case"switch":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Pe=Aat(O,T,N,L);k=Pe.text,be=Pe.required,ke=Pe.requiredErrorText,_e=Pe.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(nat,p({name:R,moleculeId:a,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"switch_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F},w,{configurationItemInfo:G}));case"slider_display_field":case"slider":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,placeholderText:null==y?void 0:y.placeholderText,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Te=Aat(O,T,N,L);k=Te.text,be=Te.required,ke=Te.requiredErrorText,_e=Te.validationErrorText,xe=Te.placeholderText,w=Rat(null==c?void 0:c.props,P,L);return Me(eat,p({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"slider_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,placeholderText:null==xe?void 0:xe.text,sourceDataModelField:F},w,{configurationItemInfo:G}));case"date_display_field":case"date_picker":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,placeholderText:null==y?void 0:y.placeholderText,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Ee=Aat(O,T,N,L);k=Ee.text,be=Ee.required,xe=Ee.placeholderText,ke=Ee.requiredErrorText,_e=Ee.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(W4e,p({dateAdapter:jat},{children:Me(Gnt,p({moleculeId:a,name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,placeholderText:(null==xe?void 0:xe.text)||"",isDisplayOnly:"date_display_field"===i,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F},w,{configurationItemInfo:G}))}));case"time_picker_display":case"time_picker":O={text:null==y?void 0:y.text,placeholderText:null==y?void 0:y.placeholderText,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText,required:null==y?void 0:y.required},N=Object.keys(O);var Ne=Aat(O,T,N,L),ze=(k=Ne.text,xe=Ne.placeholderText,ke=Ne.requiredErrorText,_e=Ne.validationErrorText,be=Ne.required,Rat(null==c?void 0:c.props,P,L));return Me(W4e,p({dateAdapter:jat},{children:Me(aat,p({},ze,{name:R,text:(null==k?void 0:k.text)||"",placeholderText:(null==xe?void 0:xe.text)||"",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,isDisplayOnly:"time_picker_display"===i,sourceDataModelField:F,configurationItemInfo:G}))}));case"select_display_field":case"select":O={text:null==y?void 0:y.text,required:null==y?void 0:y.required,placeholderText:null==y?void 0:y.placeholderText,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Ae=Aat(O,T,N,L);k=Ae.text,be=Ae.required,xe=Ae.placeholderText,ke=Ae.requiredErrorText,_e=Ae.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(Hot,p({name:R,text:(null==k?void 0:k.text)||"",required:null==be?void 0:be.value,isDisplayOnly:"select_display_field"===i,placeholderText:(null==xe?void 0:xe.text)||"",requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F},w,{configurationItemInfo:G}));case"image":O={image:null==y?void 0:y.image,link:null==y?void 0:y.link},N=Object.keys(O);var Re=Aat(O,T,N,L),Fe=Re.image,Le=Re.link,Be=(w=Rat(null==c?void 0:c.props,P,L),(null==Fe?void 0:Fe.imageSource)||(null===(u=null==Fe?void 0:Fe.imageFile)||void 0===u?void 0:u.url)||"");return Me(Qnt,p({},w,{src:Be,onClick:function(){return cot(Le)?null==E?void 0:E((null==Le?void 0:Le.internalLink)||""):lot(null==Le?void 0:Le.externalLink)},moleculeId:a,configurationItemInfo:G}));case"button":O={text:null==y?void 0:y.text,action:null==y?void 0:y.action},N=Object.keys(O);var Ve=Aat(O,T,N,L),Ie=(k=Ve.text,Ve.action),qe=(w=Rat(null==c?void 0:c.props,P,L),(null==Ie?void 0:Ie.action)||{}),$e=qe.link,He=qe.popup,We=qe.download,Ue=qe.submit,Ye={link:function(){return cot($e)?E(null==$e?void 0:$e.internalLink):lot(null==$e?void 0:$e.externalLink)},popup:function(){(null==He?void 0:He.id)&&V(null==He?void 0:He.id)},drawer:function(){I(!0)},download:function(){return We?function(e,t){return void 0===e&&(e=""),void 0===t&&(t="Downloaded file"),f(void 0,void 0,void 0,function(){var r,n,o,a;return m(this,function(i){switch(i.label){case 0:return i.trys.push([0,3,,4]),[4,fetch(e)];case 1:return[4,i.sent().blob()];case 2:return r=i.sent(),n=URL.createObjectURL(r),(o=document.createElement("a")).href=n,o.download=t,o.click(),URL.revokeObjectURL(n),[3,4];case 3:return a=i.sent(),gqt({message:"Failed to download the file: ".concat(a),type:"error"}),[3,4];case 4:return[2]}})})}(We.url,We.name):gqt({message:"File not found to download",type:"warning"})},submit:null==l?void 0:l.handleSubmit(function(e){return f(void 0,void 0,void 0,function(){var t,r,n,o;return m(this,function(a){switch(a.label){case 0:return a.trys.push([0,3,,4]),_?[4,null==j?void 0:j({formId:_,data:e})]:[3,2];case 1:a.sent(),(t=null===(n=null==Ue?void 0:Ue.onSuccess)||void 0===n?void 0:n.link)&&(cot(t)?null==E||E(t.internalLink||""):lot(t.externalLink)),l.reset(),a.label=2;case 2:return[3,4];case 3:return a.sent(),(r=null===(o=null==Ue?void 0:Ue.onError)||void 0===o?void 0:o.link)&&(cot(r)?null==E||E(r.internalLink||""):lot(r.externalLink)),[3,4];case 4:return[2]}})})}),reset:function(){return null==l?void 0:l.reset()},destroy:function(){null==l||l.reset(),null==q||q(),null==$||$()}};return Me(L2e,p({moleculeId:a,text:(null==k?void 0:k.text)||""},w,{disabled:(null==w?void 0:w.disabled)||W,onClick:null==Ye?void 0:Ye[(null===(g=null==Ie?void 0:Ie.action)||void 0===g?void 0:g.type)||"link"],configurationItemInfo:G}));case"avatar":w=Rat(null==c?void 0:c.props,P,L);return Me(Lat,p({},w,{sourceDataModelField:F,configurationItemInfo:G}));case"calendar":w=Rat(null==c?void 0:c.props,P,L);return Me(mBt,p({},w,{configurationItemInfo:G}));case"drawer":O={text:null==y?void 0:y.text,disabled:null==y?void 0:y.disabled},N=Object.keys(O);var Ze=Aat(O,T,N,L),Ke=Ze.text,Ge=Ze.disabled,Xe=Rat(null==c?void 0:c.props,P,L);ee=null==d?void 0:d.map(function(e){var t,r,n,o,a,i,s,l,c,u=S===e.id,d=e||{},f=d.properties,m=d.config,v=h(d,["properties","config"]),y={},g=[];switch(e.type){case"menu_item":var x=f;y={disabled:null==x?void 0:x.disabled,text:null==x?void 0:x.text,link:null==x?void 0:x.link},g=Object.keys(y);break;case"text_item":var b=f;y={text:null==b?void 0:b.text},g=Object.keys(y);break;case"rich_text_item":var k=f;y={text:null==k?void 0:k.text},g=Object.keys(y);break;case"image_item":var _=f;y={image:null==_?void 0:_.image,alt:null==_?void 0:_.alt,link:null==_?void 0:_.link},g=Object.keys(y);break;default:y={},g=[]}var w=Aat(y,T,g,u),M=Rat(null==m?void 0:m.props,P,u),C=p(p({},v),M);switch(e.type){case"menu_item":return p(p({},C),{disabled:(null==A?void 0:A[e.id])?null===(t=null==A?void 0:A[e.id])||void 0===t?void 0:t.disabled:(null===(r=null==w?void 0:w.disabled)||void 0===r?void 0:r.value)||(null==M?void 0:M.disabled)||!1,text:(null===(n=null==w?void 0:w.text)||void 0===n?void 0:n.text)||"Menu Item",link:null==w?void 0:w.link});case"text_item":return p(p({},C),{text:(null===(o=null==w?void 0:w.text)||void 0===o?void 0:o.text)||""});case"rich_text_item":return p(p({},C),{text:(null===(a=null==w?void 0:w.text)||void 0===a?void 0:a.text)||xVt});case"image_item":var j=(null===(i=null==w?void 0:w.image)||void 0===i?void 0:i.imageSource)||(null===(l=null===(s=null==w?void 0:w.image)||void 0===s?void 0:s.imageFile)||void 0===l?void 0:l.url)||"";return p(p({},C),{src:j,alt:(null===(c=null==w?void 0:w.alt)||void 0===c?void 0:c.text)||"Drawer image",link:null==w?void 0:w.link});default:return C}});return Me(xot,p({},Xe,{items:ee||[],moleculeId:a,buttonText:(null==Ke?void 0:Ke.text)||(null==Xe?void 0:Xe.buttonText),buttonDisabled:(null==A?void 0:A[a])?null===(x=null==A?void 0:A[a])||void 0===x?void 0:x.disabled:(null==Ge?void 0:Ge.value)||(null==Xe?void 0:Xe.disabled)||!1,configurationItemInfo:G}));case"speed_dial":var Qe=Rat(null==c?void 0:c.props,P,L);ee=null==d?void 0:d.map(function(e){var t=S===e.id,r=e||{},n=r.properties,o=r.config,a=h(r,["properties","config"]),i={link:null==n?void 0:n.link,text:null==n?void 0:n.text},s=Object.keys(i),l=Aat(i,T,s,t),c=Rat(null==o?void 0:o.props,P,t);return p(p({},a),{config:{props:p(p(p({},null==o?void 0:o.props),c),{tooltipText:(null==c?void 0:c.tooltipText)||""})},properties:{link:(null==l?void 0:l.link)||(null==n?void 0:n.link),text:(null==l?void 0:l.text)||(null==n?void 0:n.text)}})});return Me(yat,p({},Qe,{items:ee||[],moleculeId:a,configurationItemInfo:G}));case"checkbox":case"checkbox_display":O={label:null==y?void 0:y.label,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var Je=Aat(O,T,N,L),et=Je.label;be=Je.required,ke=Je.requiredErrorText,_e=Je.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(hat,p({name:R,moleculeId:a,label:(null==et?void 0:et.text)||"",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F,isDisplayOnly:"checkbox_display"===i},w,{configurationItemInfo:G}));case"binary_radio_buttons":case"binary_radio_buttons_display":O={confirmText:null==y?void 0:y.confirmText,rejectText:null==y?void 0:y.rejectText,required:null==y?void 0:y.required,requiredErrorText:null==y?void 0:y.requiredErrorText,validationErrorText:null==y?void 0:y.validationErrorText},N=Object.keys(O);var tt=Aat(O,T,N,L),rt=tt.confirmText,nt=tt.rejectText;be=tt.required,ke=tt.requiredErrorText,_e=tt.validationErrorText,w=Rat(null==c?void 0:c.props,P,L);return Me(pat,p({name:R,moleculeId:a,confirmText:(null==rt?void 0:rt.text)||"Yes",rejectText:(null==nt?void 0:nt.text)||"No",required:null==be?void 0:be.value,requiredErrorText:null==ke?void 0:ke.text,validationErrorText:null==_e?void 0:_e.text,sourceDataModelField:F,isDisplayOnly:"binary_radio_buttons_display"===i},w,{configurationItemInfo:G}));default:return Me(we,{children:"There is no such type of molecule yet."})}}()},HBt=function(t){var r=t.item,n=t.activeChildrenIds,o=e.useState(),a=o[0],i=o[1],s=e.useMemo(function(){return n.map(function(e){var t=r.items.find(function(t){return t.id===e});return t?function(e){var t,r,n,o=(null===(r=null===(t=e.config)||void 0===t?void 0:t.props)||void 0===r?void 0:r.formStepProps)||{};return p(p({},e),{config:p(p({},e.config),{props:p(p({},null===(n=e.config)||void 0===n?void 0:n.props),{formStepProps:p(p({},o),{order:0})})})})}(t):void 0}).filter(Boolean)},[n,r]);return e.useEffect(function(){i(function(){return p(p({},r),{items:s})})},[r]),a},WBt=function(t){var r=t.config,n=t.tabsProps,o=t.id,a=t.type,i=t.items,s=t.metadata,l=t.formData,c=t.setFormData,u=t.isMobile,d=t.properties,h=t.isConfigurationMode,f=void 0!==h&&h,m=e.useState(),v=m[0],y=m[1];if(!i||!i.length)return null;var g=u||ok("xs");return Me(XBt,p({userInitials:"UN",logOutHandler:function(){return console.log("log out")},goToAccountInfo:function(){return console.log("account info page")}},{children:Me(dS,p({organismMetadata:s,organismId:o,initItems:i,organismBodyId:o,submitHandler:function(e){return new Promise(function(t){setTimeout(function(){t(alert(JSON.stringify(e,null,2)))},600)})},formId:o,isConfigurationMode:f,onConfigurationItemHandler:function(e){y(null==e?void 0:e.entityId)},selectedConfigurationItemId:v},{children:Me(YBt,{item:{id:o,type:a,items:i,config:r,metadata:s,properties:d,instance:"container"},formData:l,tabsProps:n,isMobile:g,setFormData:c})}))}),"".concat(o,".").concat(g?"mobile":"desktop"))},UBt=function(e){var t=e.formData,r=e.setFormData,n=e.isMobile,o=h(e,["formData","setFormData","isMobile"]),a=HBt(o);return a?Me(WBt,p({},a,{isMobile:n,formData:t,setFormData:r})):null},YBt=e.memo(function(t){var r,n=t.item,o=t.tabsProps,a=t.formData,i=t.setFormData,s=t.isMobile,l=t.parentId,c=WS(),u=JBt().stateConfig,d=KBt(),h=d.organismMetadata,f=d.localStateObject||u;if("molecule"===n.instance)return Me(LP,p({additionalInfo:"molecule: ".concat(n.id)},{children:Me($Bt,p({},n,{form:c,isMobile:s,formData:a,parentId:l,tabsProps:o,setFormData:i,metadata:p(p({},n.metadata),{stateListenerId:(null==h?void 0:h.stateListenerId)||n.id})}))}));if(!n.items||!n.items.length)return null;var m="form"===n.type&&(null===(r=n.config.props)||void 0===r?void 0:r.activeChildrenIds)||[];if(m.length)return Me(LP,p({additionalInfo:"form: ".concat(n.id)},{children:Me(UBt,{item:n,activeChildrenIds:m,formData:a,setFormData:i,isMobile:s})}));var v=e.useMemo(function(){var e;return null===(e=n.items)||void 0===e?void 0:e.filter(function(e){var t,r,n,o,a,i=null===(n=null===(r=null===(t=e.config)||void 0===t?void 0:t.props)||void 0===r?void 0:r.visible)||void 0===n||n,s=null===(a=null===(o=null==f?void 0:f[e.id])||void 0===o?void 0:o.visible)||void 0===a||a;return i&&s})},[n.items,f]);return Me(LP,p({additionalInfo:"container: ".concat(n.id)},{children:Me(bat,p({},n,{isMobile:s,config:n.config?p(p({},n.config),{props:n.config.props||{},wide:n.config.wide||{},compact:n.config.compact||{}}):{props:{},wide:{},compact:{}}},{children:null==v?void 0:v.map(function(e){return Me(YBt,{item:e,parentId:e.id,formData:a,setFormData:i,isMobile:s,tabsProps:o},e.id)})}))}))}),ZBt=function(){return e.useContext(lS)},KBt=function(){return e.useContext(cS)},GBt=e.createContext({userInitials:"",logOutHandler:function(){return null},goToAccountInfo:function(){return null},username:""}),XBt=function(t){var r=t.children,n=t.goToAccountInfo,o=t.userInitials,a=t.logOutHandler,i=t.username,s=e.useMemo(function(){return{logOutHandler:a,goToAccountInfo:n,userInitials:o,username:i}},[a,n,o,i]);return Me(GBt.Provider,p({value:s},{children:r}))},QBt=e.createContext({stateConfig:{},stateHandler:function(){return null},authenticated:!1}),JBt=function(){return e.useContext(QBt)},eVt=function(){return e.useContext(GN)},tVt={pickList:{get:function(e){return f(void 0,void 0,void 0,function(){return m(this,function(e){return[2,{data:[]}]})})}},calendar:{createEvent:function(){return f(void 0,void 0,void 0,function(){return m(this,function(e){return[2]})})},updateEvent:function(){return f(void 0,void 0,void 0,function(){return m(this,function(e){return[2]})})},deleteEvent:function(){return f(void 0,void 0,void 0,function(){return m(this,function(e){return[2]})})},getEvents:function(){return f(void 0,void 0,void 0,function(){return m(this,function(e){return[2,[]]})})}}},rVt=e.createContext(tVt),nVt=function(){var t=e.useContext(rVt);if(!t)throw new Error("useApi must be used within ApiProvider");return t},oVt=function(e,t){var r=e.replace(/\D+/g,"");if(!r)return"";var n="",o=0;return t.reduce(function(e,t){return"string"==typeof t?n+=t:o<r.length&&(n+=r[o],o+=1),e},""),n},aVt=function(e,t){try{var r=new Date(e);if(Number.isNaN(r.getTime()))return e;var n=void 0,o=void 0,a=void 0;switch("string"==typeof e&&(e.endsWith("Z")||e.includes("+")||e.includes("T"))?(n=String(r.getUTCMonth()+1).padStart(2,"0"),o=String(r.getUTCDate()).padStart(2,"0"),a=r.getUTCFullYear()):(n=String(r.getMonth()+1).padStart(2,"0"),o=String(r.getDate()).padStart(2,"0"),a=r.getFullYear()),t){case"DD/MM/YYYY":return"".concat(o,"/").concat(n,"/").concat(a);case"MM/YYYY":return"".concat(n,"/").concat(a);case"YYYY/MM/DD":return"".concat(a,"/").concat(n,"/").concat(o);default:return"".concat(n,"/").concat(o,"/").concat(a)}}catch(t){return e}},iVt=function(e){var t,r=e.variable,n=e.stateObject;e.children;var o,a=(null==r?void 0:r.dataModelField)||{},i=a.defaultValue,s=a.dataModelFieldId,l=a.pmiObjectName,c=a.dataFieldName,u=a.dataType,d=a.format,p="[".concat(l," - ").concat(c,"]");if(!n||!s)return Me(we,{children:p});try{o=null===(t=null==n?void 0:n[s])||void 0===t?void 0:t.value}catch(e){o=null}if(!o&&0!==o)return Me(we,{children:i||p});var h=String(o);if("date"===u){var f="MM/DD/YYYY";switch(d){case"day_month_year_date":f="DD/MM/YYYY";break;case"month_day_year_date":default:f="MM/DD/YYYY";break;case"year_month_day_date":f="YYYY/MM/DD";break;case"month_year_date":f="MM/YYYY"}h=aVt(h,f)}else if(d)switch(d){case"phone_number":h=oVt(h,D_);break;case"us_zip_code":case"zip_code":h=oVt(h,__);break;case"day_month_year_date":h=aVt(h,"DD/MM/YYYY");break;case"month_day_year_date":h=aVt(h,"MM/DD/YYYY");break;case"year_month_day_date":h=aVt(h,"YYYY/MM/DD");break;case"month_year_date":h=aVt(h,"MM/YYYY");break;case"numeric":var m=Number(o);h=Number.isNaN(m)?String(o):String(m);break;case"integer":var v=Number(o);h=Number.isNaN(v)?String(o):String(Math.floor(v));break;case"email":case"text":case"string":case"any":default:h=String(o);break;case"password":h="*".repeat(String(o).length)}return Me(we,{children:h})},sVt=function(t){var r,n,o,a,i,s,l,c,u,d=t.attributes,h=t.children,f=t.element,m=e.useContext(lO),v=e.useContext(GO),y=KBt().localStateObject,g=JBt().stateConfig,x=y||g,b={padding:"1px 3px",margin:"0 1px",verticalAlign:"baseline",display:"inline-block",borderRadius:"3px",backgroundColor:"#f0f0f0",border:"1px solid #ddd",fontSize:"0.95em",boxShadow:m&&v?"0 0 0 2px #B4D5FF":"none"};(null===(r=f.children[0])||void 0===r?void 0:r.bold)&&(b.fontWeight="bold"),(null===(n=f.children[0])||void 0===n?void 0:n.italic)&&(b.fontStyle="italic"),(null===(o=f.children[0])||void 0===o?void 0:o.color)&&(b.color=f.children[0].color),(null===(a=f.children[0])||void 0===a?void 0:a.fontSize)&&(b.fontSize=f.children[0].fontSize),(null===(i=f.children[0])||void 0===i?void 0:i.fontFamily)&&(b.fontFamily=f.children[0].fontFamily),(null===(s=f.children[0])||void 0===s?void 0:s.letterSpacing)&&(b.letterSpacing=f.children[0].letterSpacing),(null===(l=f.children[0])||void 0===l?void 0:l.lineHeight)&&(b.lineHeight=f.children[0].lineHeight);var k=Me(iVt,p({variable:f.variablePayload,stateObject:x,leaf:{text:""}},{children:h}));return Ce("span",p({},d,{contentEditable:!1,style:b},{children:[Me("div",p({contentEditable:!1},{children:Ce(e.Fragment,{children:["[",(null===(c=f.children[0])||void 0===c?void 0:c.underline)?Me("u",{children:k}):(null===(u=f.children[0])||void 0===u?void 0:u.strikethrough)?Me("s",{children:k}):k,"]"]})})),h]}))},lVt=function(e){var t=e.element,r=e.attributes,n=e.children;switch(t.type){case"headingOne":return Me("h1",p({},r,{children:n}));case"headingTwo":return Me("h2",p({},r,{children:n}));case"headingThree":return Me("h3",p({},r,{children:n}));case"blockquote":return Me("blockquote",p({},r,{children:n}));case"alignLeft":return Me(cVt,p({style:{textAlign:"left"}},r,{children:n}));case"alignCenter":return Me(cVt,p({style:{textAlign:"center"}},r,{children:n}));case"alignRight":return Me(cVt,p({style:{textAlign:"right"}},r,{children:n}));case"justify":return Me(cVt,p({style:{textAlign:"justify"}},r,{children:n}));case"listItem":return Me("li",p({},r,{children:n}));case"orderedList":return Me(uVt,p({},r,{children:n}));case"unorderedList":return Me(dVt,p({},r,{children:n}));case"variable":return Me(sVt,{attributes:r,children:n,element:t});default:return Me("p",p({},r,{children:n}))}},cVt=rt.div(OBt||(OBt=y(["\n display: block;\n width: 100%;\n"],["\n display: block;\n width: 100%;\n"]))),uVt=rt.ol(SBt||(SBt=y(["\n list-style-type: decimal;\n list-style-position: inside;\n margin: 0;\n padding: 0;\n"],["\n list-style-type: decimal;\n list-style-position: inside;\n margin: 0;\n padding: 0;\n"]))),dVt=rt.ul(PBt||(PBt=y(["\n list-style-type: disc;\n list-style-position: inside;\n margin: 0;\n padding: 0;\n"],["\n list-style-type: disc;\n list-style-position: inside;\n margin: 0;\n padding: 0;\n"]))),pVt=rt.span(EBt||(EBt=y(["\n ","\n"],["\n ","\n"])),function(e){var t=e.$color,r=e.$backgroundColor,n=e.$fontSize,o=e.$fontFamily,a=e.$letterSpacing,i=e.$lineHeight;return Ye(TBt||(TBt=y(["\n ","\n ","\n ","\n ","\n ","\n ","\n "],["\n ","\n ","\n ","\n ","\n ","\n ","\n "])),t&&"\n color: ".concat(t," !important;\n &, & *, & span, & a, & [contenteditable] { /* Added for aggressive color override */\n color: ").concat(t," !important;\n }\n "),r&&"background-color: ".concat(r," !important;"),n&&"font-size: ".concat(n," !important;"),o&&"\n font-family: ".concat(o," !important;\n \n /* More aggressive font-family overrides */\n &, & *, & span, & a, & [contenteditable] {\n font-family: ").concat(o," !important;\n }\n "),a&&"letter-spacing: ".concat(a," !important;"),i&&"line-height: ".concat(i," !important;"))}),hVt=function(e){var t,r,n,o=e.leaf,a=e.children,i=e.attributes,s=sS(),l=s.showAnnotations,c=s.annotationsList,u=s.isMLRReview,d=KBt(),h=d.isPreview;if(d.localStateObject,JBt().stateConfig,o.tag){var f=c.tags.findIndex(function(e){var t,r=e.id;return(null===(t=o.tag)||void 0===t?void 0:t.id)===r})+1;u&&l&&f&&(a=Ce(ox,p({component:"span",display:"inline-flex",direction:"row",alignItems:"center",gap:.5,id:fVt},((t={})["data-".concat(vVt)]=null===(n=o.tag)||void 0===n?void 0:n.id,t),{children:[Me("span",p({style:{backgroundColor:"#FFF0D0B5"}},{children:a})),Me(zk,{index:c.tags.findIndex(function(e){var t,r,n=e.id,a=e.label;return(null===(t=o.tag)||void 0===t?void 0:t.id)===n||(null===(r=o.tag)||void 0===r?void 0:r.label)===a})+1,type:"message"})]})))}if(o.bold&&(a=Me("span",p({style:{fontWeight:"bold"}},{children:a}))),o.strikethrough&&(a=Me("s",{children:a})),o.italic&&(a=Me("span",p({style:{fontStyle:"italic"}},{children:a}))),o.underline&&(a=Me("u",{children:a})),(o.color||o.bgColor||o.fontSize||o.fontFamily||o.letterSpacing||o.lineHeight)&&(a=Me(pVt,p({$color:o.color,$backgroundColor:o.bgColor,$fontSize:o.fontSize,$fontFamily:o.fontFamily,$letterSpacing:o.letterSpacing,$lineHeight:o.lineHeight},{children:a}))),o.communicationLink){var m=o.communicationLink,v=m.type,y=m.url,g="internalLink"===v,x=g?uot(y,h):y,b=c.links.findIndex(function(e){return y===e.url&&o.text===e.text})+1;a=Me(we,{children:u&&l&&b?Ce(ox,p({component:"span",display:"inline-flex",alignItems:"center",gap:.2,marginBottom:.2,id:mVt},(r={},r["data-".concat(yVt)]=y,r["data-".concat(gVt)]=o.text,r),{children:[Me(pVt,p({$fontSize:o.fontSize,$fontFamily:o.fontFamily,$letterSpacing:o.letterSpacing,$lineHeight:o.lineHeight,$color:o.color||Te.colors.blue},{children:Me("a",p({},i,{href:x,target:g?"_self":"_blank"},{children:a}))})),Me(zk,{index:b,type:"link"})]})):Me(pVt,p({$fontSize:o.fontSize,$fontFamily:o.fontFamily,$letterSpacing:o.letterSpacing,$lineHeight:o.lineHeight,$color:o.color||Te.colors.blue},{children:Me("a",p({},i,{href:x,target:g?"_self":"_blank"},{children:a}))}))})}return Me("span",p({},i,{children:a}))},fVt="matrix-message",mVt="communication-link",vVt="matrix-message-id",yVt="communication-link-url",gVt="communication-link-text",xVt=[{type:"paragraph",children:[{text:""}]}],bVt=function(t){var r=t.value;t.numberOfLines;var n=e.useMemo(function(){return function(e){var t=e.isInline,r=e.isVoid,n=e.markableVoid;return e.isInline=function(e){return"variable"===e.type||t(e)},e.isVoid=function(e){return"variable"===e.type||r(e)},e.markableVoid=function(e){return"variable"===e.type||n(e)},e}(oS((()=>{var e={children:[],operations:[],selection:null,marks:null,isInline:()=>!1,isVoid:()=>!1,markableVoid:()=>!1,onChange:()=>{},apply:t=>{for(var r of LM.pathRefs(e))ZM.transform(r,t);for(var n of LM.pointRefs(e))QM.transform(n,t);for(var o of LM.rangeRefs(e))rC.transform(o,t);var a,i,s=Zw.get(e)||[],l=Kw.get(e)||new Set,c=e=>{if(e){var t=e.join(",");i.has(t)||(i.add(t),a.push(e))}};if(YM.operationCanTransformPath(t))for(var u of(a=[],i=new Set,s))c(YM.transform(u,t));else a=s,i=l;var d=e.getDirtyPaths(t);for(var p of d)c(p);Zw.set(e,a),Kw.set(e,i),OC.transform(e,t),e.operations.push(t),LM.normalize(e),"set_selection"===t.type&&(e.marks=null),Gw.get(e)||(Gw.set(e,!0),Promise.resolve().then(()=>{Gw.set(e,!1),e.onChange(),e.operations=[]}))},addMark:(t,r)=>{var{selection:n,markableVoid:o}=e;if(n){var a=(t,r)=>{if(!uC.isText(t))return!1;var[n,o]=LM.parent(e,r);return!e.isVoid(n)||e.markableVoid(n)},i=tC.isExpanded(n),s=!1;if(!i){var[l,c]=LM.node(e,n);if(l&&a(l,c)){var[u]=LM.parent(e,c);s=u&&e.markableVoid(u)}}if(i||s)OC.setNodes(e,{[t]:r},{match:a,split:!0,voids:!0});else{var d=rM(rM({},LM.marks(e)||{}),{},{[t]:r});e.marks=d,Gw.get(e)||e.onChange()}}},deleteBackward:t=>{var{selection:r}=e;r&&tC.isCollapsed(r)&&OC.delete(e,{unit:t,reverse:!0})},deleteForward:t=>{var{selection:r}=e;r&&tC.isCollapsed(r)&&OC.delete(e,{unit:t})},deleteFragment:t=>{var{selection:r}=e;r&&tC.isExpanded(r)&&OC.delete(e,{reverse:"backward"===t})},getFragment:()=>{var{selection:t}=e;return t?$M.fragment(e,t):[]},insertBreak:()=>{OC.splitNodes(e,{always:!0})},insertSoftBreak:()=>{OC.splitNodes(e,{always:!0})},insertFragment:t=>{OC.insertFragment(e,t)},insertNode:t=>{OC.insertNodes(e,t)},insertText:t=>{var{selection:r,marks:n}=e;if(r){if(n){var o=rM({text:t},n);OC.insertNodes(e,o)}else OC.insertText(e,t);e.marks=null}},normalizeNode:t=>{var[r,n]=t;if(!uC.isText(r))if(EM.isElement(r)&&0===r.children.length)OC.insertNodes(e,{text:""},{at:n.concat(0),voids:!0});else for(var o=!LM.isEditor(r)&&EM.isElement(r)&&(e.isInline(r)||0===r.children.length||uC.isText(r.children[0])||e.isInline(r.children[0])),a=0,i=0;i<r.children.length;i++,a++){var s=$M.get(e,n);if(!uC.isText(s)){var l=r.children[i],c=s.children[a-1],u=i===r.children.length-1;(uC.isText(l)||EM.isElement(l)&&e.isInline(l))!==o?(OC.removeNodes(e,{at:n.concat(a),voids:!0}),a--):EM.isElement(l)?e.isInline(l)&&(null!=c&&uC.isText(c)?u&&(OC.insertNodes(e,{text:""},{at:n.concat(a+1),voids:!0}),a++):(OC.insertNodes(e,{text:""},{at:n.concat(a),voids:!0}),a++)):null!=c&&uC.isText(c)&&(uC.equals(l,c,{loose:!0})?(OC.mergeNodes(e,{at:n.concat(a),voids:!0}),a--):""===c.text?(OC.removeNodes(e,{at:n.concat(a-1),voids:!0}),a--):""===l.text&&(OC.removeNodes(e,{at:n.concat(a),voids:!0}),a--))}}},removeMark:t=>{var{selection:r}=e;if(r){var n=(t,r)=>{if(!uC.isText(t))return!1;var[n,o]=LM.parent(e,r);return!e.isVoid(n)||e.markableVoid(n)},o=tC.isExpanded(r),a=!1;if(!o){var[i,s]=LM.node(e,r);if(i&&n(i,s)){var[l]=LM.parent(e,s);a=l&&e.markableVoid(l)}}if(o||a)OC.unsetNodes(e,t,{match:n,split:!0,voids:!0});else{var c=rM({},LM.marks(e)||{});delete c[t],e.marks=c,Gw.get(e)||e.onChange()}}},getDirtyPaths:e=>{switch(e.type){case"insert_text":case"remove_text":case"set_node":var{path:t}=e;return YM.levels(t);case"insert_node":var{node:r,path:n}=e,o=YM.levels(n),a=uC.isText(r)?[]:Array.from($M.nodes(r),e=>{var[,t]=e;return n.concat(t)});return[...o,...a];case"merge_node":var{path:i}=e;return[...YM.ancestors(i),YM.previous(i)];case"move_node":var{path:s,newPath:l}=e;if(YM.equals(s,l))return[];var c=[],u=[];for(var d of YM.ancestors(s)){var p=YM.transform(d,e);c.push(p)}for(var h of YM.ancestors(l)){var f=YM.transform(h,e);u.push(f)}var m=u[u.length-1],v=l[l.length-1],y=m.concat(v);return[...c,...u,y];case"remove_node":var{path:g}=e;return[...YM.ancestors(g)];case"split_node":var{path:x}=e;return[...YM.levels(x),YM.next(x)];default:return[]}}};return e})()))},[]),o=xVt;if(null==r||"string"!=typeof r)o=xVt;else{var a=r.replace(/\\/g,"");try{o=JSON.parse(r)}catch(e){console.error(e,"Value was parsed incorrectly. Trying to parse it...");try{o=JSON.parse(a)}catch(e){console.error(e,"Most probably that it's not possible to parse this value")}}}return Me(JO,p({editor:n,value:o},{children:Me(IO,{readOnly:!0,renderLeaf:function(e){return Me(hVt,p({},e))},placeholder:o===xVt?"No content available":"",renderElement:function(e){return Me(lVt,p({},e))}})}),JSON.stringify(o))},kVt=rt.div(NBt||(NBt=y(["\n ",";\n\n ",";\n"],["\n ",";\n\n ",";\n"])),function(e){var t=e.theme.colors,r=e.hasError,n=e.disabled,o=e.isOpen,a=e.isEditMode;return"\n .select-wrapper {\n text-align: left;\n border: ".concat(a?"1px solid ".concat(t.gray3):"none",";\n position: relative;\n border-radius: ").concat(sizes.S,"px;\n &:hover,\n &:active,\n &:focus {\n border-color: ").concat(t.gray2,";\n }\n\n .select-input {\n padding: ").concat(a?"10px ".concat(sizes.S,"px 10px ").concat(sizes.M,"px"):"0",";\n display: flex;\n user-select: none;\n align-items: center;\n flex-direction: row;\n justify-content: space-between;\n cursor: ").concat(a?"pointer":"default",";\n\n .icon-container {\n max-height: 33px;\n transform: rotate(0deg);\n transition: transform 0.2s ease-in-out;\n ").concat(o&&"transform: rotate(180deg);","\n }\n }\n\n ").concat(n&&"\n border-color: ".concat(t.gray4," !important;\n cursor: not-allowed;\n .select-input {\n background-color: ").concat(t.gray4,";\n pointer-events: none;\n .selected-text-value {\n color: ").concat(t.gray3,";\n }\n .icon-container {\n svg path {\n stroke: ").concat(t.gray3,";\n }\n }\n }\n "),"\n \n ").concat(r&&"\n border-color: ".concat(t.red," !important;\n .select-input {\n .selected-text-value {\n color: ").concat(t.red,";\n }\n .icon-container {\n svg path {\n stroke: ").concat(t.red,";\n }\n }\n }\n "),"\n ")},function(e){return e.$styles}),_Vt=rt.div(zBt||(zBt=y(["\n ",";\n"],["\n ",";\n"])),function(e){var t=e.theme,r=t.colors,n=t.sizes;return"\n position: absolute;\n width: 100%;\n border-radius: ".concat(n.S,"px;\n padding: ").concat(n.L,"px ").concat(n.M,"px;\n box-shadow: 0 0 ").concat(n.XL,"px 0 #0000001a;\n overflow: auto;\n max-height: 150px;\n z-index: 10;\n transform: translateY(").concat(n.S,"px);\n background-color: ").concat(r.white,";\n ")}),wVt=rt.div(ABt||(ABt=y(["\n width: 100%;\n cursor: pointer;\n ",";\n"],["\n width: 100%;\n cursor: pointer;\n ",";\n"])),function(e){var t=e.theme,r=t.sizes,n=t.colors,o=t.fonts,a=e.$selected;return"\n border-radius: ".concat(r.S,"px;\n &:hover {\n background-color: ").concat(n.gray5,";\n }\n padding: ").concat(r.S,"px ").concat(r.M,"px;\n ").concat(o.M,";\n color: ").concat(n.gray2,";\n ").concat(a&&"\n background-color: ".concat(n.gray4," !important;\n color: ").concat(n.black,";\n "),";\n ")}),MVt=function(e,t){void 0===t&&(t=!1);var r=e||{},n=r.horizontalPadding,o=void 0===n?0:n,a=r.verticalPadding,i=void 0===a?0:a,s=r.selectedTextColor,l=r.selectedTextFontSize,c=r.placeholderTextColor,u=r.placeholderTextFontSize,d=r.styles,p=r.wrapperStyles;return Ye(FBt||(FBt=y(["\n ",";\n "],["\n ",";\n "])),function(e){var r=e.theme.colors;return Ye(RBt||(RBt=y(["\n .select-wrapper {\n .select-input {\n ",";\n .selected-text-value {\n ",";\n }\n ",";\n }\n ",";\n }\n "],["\n .select-wrapper {\n .select-input {\n ",";\n .selected-text-value {\n ",";\n }\n ",";\n }\n ",";\n }\n "])),i||o?"padding: ".concat(i,"px ").concat(o,"px;"):"",t?"\n ".concat(s?"color: ".concat(r[s]||s,";"):"",";\n ").concat(l?"font-size: ".concat(l,"px;"):"",";\n "):"\n ".concat(c?"color: ".concat(r[c]||c,";"):"",";\n ").concat(u?"font-size: ".concat(u,"px;"):"",";\n "),d,p)})},CVt=Ze(LBt||(LBt=y(["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"],["\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n"]))),jVt=rt.div(BBt||(BBt=y(["\n border: 0.2em solid rgba(0, 0, 0, 0.1);\n border-top: 0.2em solid ",";\n border-radius: 50%;\n width: ","px;\n height: ","px;\n animation: "," 0.6s linear infinite;\n"],["\n border: 0.2em solid rgba(0, 0, 0, 0.1);\n border-top: 0.2em solid ",";\n border-radius: 50%;\n width: ","px;\n height: ","px;\n animation: "," 0.6s linear infinite;\n"])),function(e){var t=e.theme,r=e.color,n=void 0===r?"secondary":r;return t.colors[n]},function(e){var t=e.theme,r=e.size;return r?t.sizes[r]:12},function(e){var t=e.theme,r=e.size;return r?t.sizes[r]:12},CVt);function DVt(e,t){if(null==e)return{};var r,n,o=$s(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],-1===t.indexOf(r)&&{}.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function OVt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function SVt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?OVt(Object(r),!0).forEach(function(t){ort(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):OVt(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function PVt(e,t){this.v=e,this.k=t}function TVt(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}TVt=function(e,t,r,n){if(t)o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r;else{var a=function(t,r){TVt(e,t,function(e){return this._invoke(t,r,e)})};a("next",0),a("throw",1),a("return",2)}},TVt(e,t,r,n)}function EVt(){
9574
9574
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
9575
9575
  var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function a(r,n,o,a){var l=n&&n.prototype instanceof s?n:s,c=Object.create(l.prototype);return TVt(c,"_invoke",function(r,n,o){var a,s,l,c=0,u=o||[],d=!1,p={p:0,n:0,v:e,a:h,f:h.bind(e,4),d:function(t,r){return a=t,s=0,l=e,p.n=r,i}};function h(r,n){for(s=r,l=n,t=0;!d&&c&&!o&&t<u.length;t++){var o,a=u[t],h=p.p,f=a[2];r>3?(o=f===n)&&(l=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=h&&((o=r<2&&h<a[1])?(s=0,p.v=n,p.n=a[1]):h<f&&(o=r<3||a[0]>n||n>f)&&(a[4]=r,a[5]=n,p.n=f,s=0))}if(o||r>1)return i;throw d=!0,n}return function(o,u,f){if(c>1)throw TypeError("Generator is already running");for(d&&1===u&&h(u,f),s=u,l=f;(t=s<2?e:l)||!d;){a||(s?s<3?(s>1&&(p.n=-1),h(s,l)):p.n=l:p.v=l);try{if(c=2,a){if(s||(o="next"),t=a[o]){if(!(t=t.call(a,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(l=TypeError("The iterator does not provide a '"+o+"' method"),s=1);a=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){a=e,s=1,l=t}finally{c=1}}return{value:t,done:d}}}(r,o,a),!0),c}var i={};function s(){}function l(){}function c(){}t=Object.getPrototypeOf;var u=[][n]?t(t([][n]())):(TVt(t={},n,function(){return this}),t),d=c.prototype=s.prototype=Object.create(u);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,c):(e.__proto__=c,TVt(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=c,TVt(d,"constructor",c),TVt(c,"constructor",l),l.displayName="GeneratorFunction",TVt(c,o,"GeneratorFunction"),TVt(d),TVt(d,o,"Generator"),TVt(d,n,function(){return this}),TVt(d,"toString",function(){return"[object Generator]"}),(EVt=function(){return{w:a,m:p}})()}function NVt(e,t){function r(n,o,a,i){try{var s=e[n](o),l=s.value;return l instanceof PVt?t.resolve(l.v).then(function(e){r("next",e,a,i)},function(e){r("throw",e,a,i)}):t.resolve(l).then(function(e){s.value=e,a(s)},function(e){return r("throw",e,a,i)})}catch(e){i(e)}}var n;this.next||(TVt(NVt.prototype),TVt(NVt.prototype,"function"==typeof Symbol&&Symbol.asyncIterator||"@asyncIterator",function(){return this})),TVt(this,"_invoke",function(e,o,a){function i(){return new t(function(t,n){r(e,a,t,n)})}return n=n?n.then(i,i):i()},!0)}function zVt(e,t,r,n,o){return new NVt(EVt().w(e,t,r,n),o||Promise)}function AVt(e,t,r,n,o){var a=zVt(e,t,r,n,o);return a.next().then(function(e){return e.done?e.value:a.next()})}function RVt(e){var t=Object(e),r=[];for(var n in t)r.unshift(n);return function e(){for(;r.length;)if((n=r.pop())in t)return e.value=n,e.done=!1,e;return e.done=!0,e}}function FVt(e){if(null!=e){var t=e["function"==typeof Symbol&&Symbol.iterator||"@@iterator"],r=0;if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length))return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}}}throw new TypeError(jet(e)+" is not iterable")}function LVt(){var e=EVt(),t=e.m(LVt),r=(Object.getPrototypeOf?Object.getPrototypeOf(t):t.__proto__).constructor;function n(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===r||"GeneratorFunction"===(t.displayName||t.name))}var o={throw:1,return:2,break:3,continue:3};function a(e){var t,r;return function(n){t||(t={stop:function(){return r(n.a,2)},catch:function(){return n.v},abrupt:function(e,t){return r(n.a,o[e],t)},delegateYield:function(e,o,a){return t.resultName=o,r(n.d,FVt(e),a)},finish:function(e){return r(n.f,e)}},r=function(e,r,o){n.p=t.prev,n.n=t.next;try{return e(r,o)}finally{t.next=n.n}}),t.resultName&&(t[t.resultName]=n.v,t.resultName=void 0),t.sent=n.v,t.next=n.n;try{return e.call(this,t)}finally{n.p=t.prev,n.n=t.next}}}return(LVt=function(){return{wrap:function(t,r,n,o){return e.w(a(t),r,n,o&&o.reverse())},isGeneratorFunction:n,mark:e.m,awrap:function(e,t){return new PVt(e,t)},AsyncIterator:NVt,async:function(e,t,r,o,i){return(n(t)?zVt:AVt)(a(e),t,r,o,i)},keys:RVt,values:FVt}})()}function BVt(e,t,r,n,o,a,i){try{var s=e[a](i),l=s.value}catch(e){return void r(e)}s.done?t(l):Promise.resolve(l).then(n,o)}function VVt(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){BVt(a,n,o,i,s,"next",e)}function s(e){BVt(a,n,o,i,s,"throw",e)}i(void 0)})}}var IVt,qVt=SVt({},d),$Vt=qVt.version,HVt=qVt.render,WVt=qVt.unmountComponentAtNode;try{Number(($Vt||"").split(".")[0])>=18&&(IVt=qVt.createRoot)}catch(Mj){}function UVt(e){var t=qVt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;t&&"object"===jet(t)&&(t.usingClientEntryPoint=e)}var YVt="__rc_react_root__";function ZVt(e,t){IVt?function(e,t){UVt(!0);var r=t[YVt]||IVt(t);UVt(!1),r.render(e),t[YVt]=r}(e,t):function(e,t){HVt(e,t)}(e,t)}function KVt(e){return GVt.apply(this,arguments)}function GVt(){return GVt=VVt(LVt().mark(function e(t){return LVt().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Promise.resolve().then(function(){var e;null===(e=t[YVt])||void 0===e||e.unmount(),delete t[YVt]}));case 1:case"end":return e.stop()}},e)})),GVt.apply(this,arguments)}function XVt(e){WVt(e)}function QVt(){return QVt=VVt(LVt().mark(function e(t){return LVt().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0===IVt){e.next=2;break}return e.abrupt("return",KVt(t));case 2:XVt(t);case 3:case"end":return e.stop()}},e)})),QVt.apply(this,arguments)}function JVt(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],l=!0,c=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){c=!0,o=e}finally{try{if(!l&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw o}}return s}}(e,t)||Ztt(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function eIt(e){return e instanceof HTMLElement?e:u.default.findDOMNode(e)}function tIt(e,t){"function"==typeof e?e(t):"object"===jet(e)&&e&&"current"in e&&(e.current=t)}function rIt(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.filter(function(e){return e});return n.length<=1?n[0]:function(e){t.forEach(function(t){tIt(t,e)})}}function nIt(e){var t,r,n=F.exports.isMemo(e)?e.type.type:e.type;return!("function"==typeof n&&!(null===(t=n.prototype)||void 0===t?void 0:t.render))&&!("function"==typeof e&&!(null===(r=e.prototype)||void 0===r?void 0:r.render))}function oIt(){return!("undefined"==typeof window||!window.document||!window.document.createElement)}function aIt(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit".concat(e)]="webkit".concat(t),r["Moz".concat(e)]="moz".concat(t),r["ms".concat(e)]="MS".concat(t),r["O".concat(e)]="o".concat(t.toLowerCase()),r}var iIt,sIt,lIt,cIt=(iIt=oIt(),sIt="undefined"!=typeof window?window:{},lIt={animationend:aIt("Animation","AnimationEnd"),transitionend:aIt("Transition","TransitionEnd")},iIt&&("AnimationEvent"in sIt||delete lIt.animationend.animation,"TransitionEvent"in sIt||delete lIt.transitionend.transition),lIt),uIt={};if(oIt()){var dIt=document.createElement("div");uIt=dIt.style}var pIt={};function hIt(e){if(pIt[e])return pIt[e];var t=cIt[e];if(t)for(var r=Object.keys(t),n=r.length,o=0;o<n;o+=1){var a=r[o];if(Object.prototype.hasOwnProperty.call(t,a)&&a in uIt)return pIt[e]=t[a],pIt[e]}return""}var fIt=hIt("animationend"),mIt=hIt("transitionend"),vIt=!(!fIt||!mIt),yIt=fIt||"animationend",gIt=mIt||"transitionend";function xIt(e,t){if(!e)return null;if("object"===jet(e)){var r=t.replace(/-\w/g,function(e){return e[1].toUpperCase()});return e[r]}return"".concat(e,"-").concat(t)}var bIt="none",kIt="appear",_It="enter",wIt="leave",MIt="none",CIt="prepare",jIt="start",DIt="active",OIt="end";function SIt(e){var t=s.useRef(!1),r=JVt(s.useState(e),2),n=r[0],o=r[1];return s.useEffect(function(){return t.current=!1,function(){t.current=!0}},[]),[n,function(e,r){r&&t.current||o(e)}]}var PIt=function(e){return+setTimeout(e,16)},TIt=function(e){return clearTimeout(e)};"undefined"!=typeof window&&"requestAnimationFrame"in window&&(PIt=function(e){return window.requestAnimationFrame(e)},TIt=function(e){return window.cancelAnimationFrame(e)});var EIt=0,NIt=new Map;function zIt(e){NIt.delete(e)}function AIt(e){var t=EIt+=1;return function r(n){if(0===n)zIt(t),e();else{var o=PIt(function(){r(n-1)});NIt.set(t,o)}}(arguments.length>1&&void 0!==arguments[1]?arguments[1]:1),t}AIt.cancel=function(e){var t=NIt.get(e);return zIt(t),TIt(t)};var RIt=oIt()?e.useLayoutEffect:e.useEffect,FIt=[CIt,jIt,DIt,OIt],LIt=!1;function BIt(e){return e===DIt||e===OIt}var VIt=function(e,t){var r=JVt(SIt(MIt),2),n=r[0],o=r[1],a=function(){var e=s.useRef(null);function t(){AIt.cancel(e.current)}return s.useEffect(function(){return function(){t()}},[]),[function r(n){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;t();var a=AIt(function(){o<=1?n({isCanceled:function(){return a!==e.current}}):r(n,o-1)});e.current=a},t]}(),i=JVt(a,2),l=i[0],c=i[1];return RIt(function(){if(n!==MIt&&n!==OIt){var e=FIt.indexOf(n),r=FIt[e+1],a=t(n);a===LIt?o(r,!0):l(function(e){function t(){e.isCanceled()||o(r,!0)}!0===a?t():Promise.resolve(a).then(t)})}},[e,n]),s.useEffect(function(){return function(){c()}},[]),[function(){o(CIt,!0)},n]};function IIt(t,r,n,o){var a=o.motionEnter,i=void 0===a||a,l=o.motionAppear,c=void 0===l||l,u=o.motionLeave,d=void 0===u||u,p=o.motionDeadline,h=o.motionLeaveImmediately,f=o.onAppearPrepare,m=o.onEnterPrepare,v=o.onLeavePrepare,y=o.onAppearStart,g=o.onEnterStart,x=o.onLeaveStart,b=o.onAppearActive,k=o.onEnterActive,_=o.onLeaveActive,w=o.onAppearEnd,M=o.onEnterEnd,C=o.onLeaveEnd,j=o.onVisibleChanged,D=JVt(SIt(),2),O=D[0],S=D[1],P=JVt(SIt(bIt),2),T=P[0],E=P[1],N=JVt(SIt(null),2),z=N[0],A=N[1],R=e.useRef(!1),F=e.useRef(null);function L(){return n()}var B=e.useRef(!1);function V(e){var t=L();if(!e||e.deadline||e.target===t){var r,n=B.current;T===kIt&&n?r=null==w?void 0:w(t,e):T===_It&&n?r=null==M?void 0:M(t,e):T===wIt&&n&&(r=null==C?void 0:C(t,e)),T!==bIt&&n&&!1!==r&&(E(bIt,!0),A(null,!0))}}var I=function(t){var r=e.useRef(),n=e.useRef(t);n.current=t;var o=s.useCallback(function(e){n.current(e)},[]);function a(e){e&&(e.removeEventListener(gIt,o),e.removeEventListener(yIt,o))}return s.useEffect(function(){return function(){a(r.current)}},[]),[function(e){r.current&&r.current!==e&&a(r.current),e&&e!==r.current&&(e.addEventListener(gIt,o),e.addEventListener(yIt,o),r.current=e)},a]}(V),q=JVt(I,1)[0],$=s.useMemo(function(){var e,t,r;switch(T){case kIt:return ort(e={},CIt,f),ort(e,jIt,y),ort(e,DIt,b),e;case _It:return ort(t={},CIt,m),ort(t,jIt,g),ort(t,DIt,k),t;case wIt:return ort(r={},CIt,v),ort(r,jIt,x),ort(r,DIt,_),r;default:return{}}},[T]),H=JVt(VIt(T,function(e){if(e===CIt){var t=$[CIt];return t?t(L()):LIt}var r;U in $&&A((null===(r=$[U])||void 0===r?void 0:r.call($,L(),null))||null);return U===DIt&&(q(L()),p>0&&(clearTimeout(F.current),F.current=setTimeout(function(){V({deadline:!0})},p))),true}),2),W=H[0],U=H[1],Y=BIt(U);B.current=Y,RIt(function(){S(r);var e,n=R.current;(R.current=!0,t)&&(!n&&r&&c&&(e=kIt),n&&r&&i&&(e=_It),(n&&!r&&d||!n&&h&&!r&&d)&&(e=wIt),e&&(E(e),W()))},[r]),e.useEffect(function(){(T===kIt&&!c||T===_It&&!i||T===wIt&&!d)&&E(bIt)},[c,i,d]),e.useEffect(function(){return function(){R.current=!1,clearTimeout(F.current)}},[]);var Z=s.useRef(!1);e.useEffect(function(){O&&(Z.current=!0),void 0!==O&&T===bIt&&((Z.current||O)&&(null==j||j(O)),Z.current=!0)},[O,T]);var K=z;return $[CIt]&&U===jIt&&(K=SVt({transition:"none"},K)),[T,U,K,null!=O?O:r]}var qIt=function(){Gtt(t,s.Component);var e=Jtt(t);function t(){return ert(this,t),e.apply(this,arguments)}return nrt(t,[{key:"render",value:function(){return this.props.children}}]),t}();var $It=function(t){var r=t;function n(e){return!(!e.motionName||!r)}"object"===jet(t)&&(r=t.transitionSupport);var o=s.forwardRef(function(t,r){var o=t.visible,a=void 0===o||o,i=t.removeOnLeave,l=void 0===i||i,c=t.forceRender,u=t.children,d=t.motionName,p=t.leavedClassName,h=t.eventProps,f=n(t),m=e.useRef(),v=e.useRef();var y=JVt(IIt(f,a,function(){try{return m.current instanceof HTMLElement?m.current:eIt(v.current)}catch(e){return null}},t),4),g=y[0],x=y[1],b=y[2],k=y[3],_=s.useRef(k);k&&(_.current=!0);var w,M=s.useCallback(function(e){m.current=e,tIt(r,e)},[r]),C=SVt(SVt({},h),{},{visible:a});if(u)if(g!==bIt&&n(t)){var j,D;x===CIt?D="prepare":BIt(x)?D="active":x===jIt&&(D="start"),w=u(SVt(SVt({},C),{},{className:aT(xIt(d,g),(j={},ort(j,xIt(d,"".concat(g,"-").concat(D)),D),ort(j,d,"string"==typeof d),j)),style:b}),M)}else w=k?u(SVt({},C),M):!l&&_.current?u(SVt(SVt({},C),{},{className:p}),M):c?u(SVt(SVt({},C),{},{style:{display:"none"}}),M):null;else w=null;s.isValidElement(w)&&nIt(w)&&(w.ref||(w=s.cloneElement(w,{ref:M})));return s.createElement(qIt,{ref:v},w)});return o.displayName="CSSMotion",o}(vIt),HIt="add",WIt="keep",UIt="remove",YIt="removed";function ZIt(e){var t;return SVt(SVt({},t=e&&"object"===jet(e)&&"key"in e?e:{key:e}),{},{key:String(t.key)})}function KIt(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:[]).map(ZIt)}var GIt=["component","children","onVisibleChanged","onAllRemoved"],XIt=["status"],QIt=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];var JIt=function(){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:$It,t=function(){Gtt(r,s.Component);var t=Jtt(r);function r(){var e;ert(this,r);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return(e=t.call.apply(t,[this].concat(o))).state={keyEntities:[]},e.removeKey=function(t){var r=e.state.keyEntities.map(function(e){return e.key!==t?e:SVt(SVt({},e),{},{status:YIt})});return e.setState({keyEntities:r}),r.filter(function(e){return e.status!==YIt}).length},e}return nrt(r,[{key:"render",value:function(){var t=this,r=this.state.keyEntities,n=this.props,o=n.component,a=n.children,i=n.onVisibleChanged,l=n.onAllRemoved,c=DVt(n,GIt),u=o||s.Fragment,d={};return QIt.forEach(function(e){d[e]=c[e],delete c[e]}),delete c.keys,s.createElement(u,c,r.map(function(r){var n=r.status,o=DVt(r,XIt),c=n===HIt||n===WIt;return s.createElement(e,A({},d,{key:o.key,visible:c,eventProps:o,onVisibleChanged:function(e){(null==i||i(e,{key:o.key}),e)||0===t.removeKey(o.key)&&l&&l()}}),a)}))}}],[{key:"getDerivedStateFromProps",value:function(e,t){var r=e.keys,n=t.keyEntities,o=KIt(r),a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=[],n=0,o=t.length,a=KIt(e),i=KIt(t);a.forEach(function(e){for(var t=!1,a=n;a<o;a+=1){var s=i[a];if(s.key===e.key){n<a&&(r=r.concat(i.slice(n,a).map(function(e){return SVt(SVt({},e),{},{status:HIt})})),n=a),r.push(SVt(SVt({},s),{},{status:WIt})),n+=1,t=!0;break}}t||r.push(SVt(SVt({},e),{},{status:UIt}))}),n<o&&(r=r.concat(i.slice(n).map(function(e){return SVt(SVt({},e),{},{status:HIt})})));var s={};r.forEach(function(e){var t=e.key;s[t]=(s[t]||0)+1});var l=Object.keys(s).filter(function(e){return s[e]>1});return l.forEach(function(e){r=r.filter(function(t){var r=t.key,n=t.status;return r!==e||n!==UIt}),r.forEach(function(t){t.key===e&&(t.status=WIt)})}),r}(n,o);return{keyEntities:a.filter(function(e){var t=n.find(function(t){var r=t.key;return e.key===r});return!t||t.status!==YIt||e.status!==UIt})}}}]),r}();return t.defaultProps={component:"div"},t}(vIt),eqt=function(){Gtt(r,e.Component);var t=Jtt(r);function r(){var e;ert(this,r);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return(e=t.call.apply(t,[this].concat(o))).closeTimer=null,e.close=function(t){t&&t.stopPropagation(),e.clearCloseTimer();var r=e.props,n=r.onClose,o=r.noticeKey;n&&n(o)},e.startCloseTimer=function(){e.props.duration&&(e.closeTimer=window.setTimeout(function(){e.close()},1e3*e.props.duration))},e.clearCloseTimer=function(){e.closeTimer&&(clearTimeout(e.closeTimer),e.closeTimer=null)},e}return nrt(r,[{key:"componentDidMount",value:function(){this.startCloseTimer()}},{key:"componentDidUpdate",value:function(e){(this.props.duration!==e.duration||this.props.updateMark!==e.updateMark||this.props.visible!==e.visible&&this.props.visible)&&this.restartCloseTimer()}},{key:"componentWillUnmount",value:function(){this.clearCloseTimer()}},{key:"restartCloseTimer",value:function(){this.clearCloseTimer(),this.startCloseTimer()}},{key:"render",value:function(){var e=this,t=this.props,r=t.prefixCls,n=t.className,o=t.closable,a=t.closeIcon,i=t.style,l=t.onClick,c=t.children,d=t.holder,p="".concat(r,"-notice"),h=Object.keys(this.props).reduce(function(t,r){return"data-"!==r.substr(0,5)&&"aria-"!==r.substr(0,5)&&"role"!==r||(t[r]=e.props[r]),t},{}),f=s.createElement("div",A({className:aT(p,n,ort({},"".concat(p,"-closable"),o)),style:i,onMouseEnter:this.clearCloseTimer,onMouseLeave:this.startCloseTimer,onClick:l},h),s.createElement("div",{className:"".concat(p,"-content")},c),o?s.createElement("a",{tabIndex:0,onClick:this.close,className:"".concat(p,"-close")},a||s.createElement("span",{className:"".concat(p,"-close-x")})):null);return d?u.default.createPortal(f,d):f}}]),r}();function tqt(e){return function(e){if(Array.isArray(e))return Ytt(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||Ztt(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}eqt.defaultProps={onClose:function(){},duration:1.5};var rqt=["getContainer"],nqt=0,oqt=Date.now();function aqt(){var e=nqt;return nqt+=1,"rcNotification_".concat(oqt,"_").concat(e)}var iqt=function(){Gtt(r,e.Component);var t=Jtt(r);function r(){var e;ert(this,r);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return(e=t.call.apply(t,[this].concat(o))).state={notices:[]},e.hookRefs=new Map,e.add=function(t,r){var n=t.key||aqt(),o=SVt(SVt({},t),{},{key:n}),a=e.props.maxCount;e.setState(function(e){var t=e.notices,i=t.map(function(e){return e.notice.key}).indexOf(n),s=t.concat();return-1!==i?s.splice(i,1,{notice:o,holderCallback:r}):(a&&t.length>=a&&(o.key=s[0].notice.key,o.updateMark=aqt(),o.userPassKey=n,s.shift()),s.push({notice:o,holderCallback:r})),{notices:s}})},e.remove=function(t){e.setState(function(e){return{notices:e.notices.filter(function(e){var r=e.notice,n=r.key;return(r.userPassKey||n)!==t})}})},e.noticePropsMap={},e}return nrt(r,[{key:"getTransitionName",value:function(){var e=this.props,t=e.prefixCls,r=e.animation,n=this.props.transitionName;return!n&&r&&(n="".concat(t,"-").concat(r)),n}},{key:"render",value:function(){var e=this,t=this.state.notices,r=this.props,n=r.prefixCls,o=r.className,a=r.closeIcon,i=r.style,l=[];return t.forEach(function(r,o){var i=r.notice,s=r.holderCallback,c=o===t.length-1?i.updateMark:void 0,u=i.key,d=i.userPassKey,p=SVt(SVt(SVt({prefixCls:n,closeIcon:a},i),i.props),{},{key:u,noticeKey:d||u,updateMark:c,onClose:function(t){var r;e.remove(t),null===(r=i.onClose)||void 0===r||r.call(i)},onClick:i.onClick,children:i.content});l.push(u),e.noticePropsMap[u]={props:p,holderCallback:s}}),s.createElement("div",{className:aT(n,o),style:i},s.createElement(JIt,{keys:l,motionName:this.getTransitionName(),onVisibleChanged:function(t,r){var n=r.key;t||delete e.noticePropsMap[n]}},function(t){var r=t.key,o=t.className,a=t.style,i=t.visible,l=e.noticePropsMap[r],c=l.props,u=l.holderCallback;return u?s.createElement("div",{key:r,className:aT(o,"".concat(n,"-hook-holder")),style:SVt({},a),ref:function(t){void 0!==r&&(t?(e.hookRefs.set(r,t),u(t,c)):e.hookRefs.delete(r))}}):s.createElement(eqt,A({},c,{className:aT(o,null==c?void 0:c.className),style:SVt(SVt({},a),null==c?void 0:c.style),visible:i}))}))}}]),r}();iqt.newInstance=void 0,iqt.defaultProps={prefixCls:"rc-notification",animation:"fade",style:{top:65,left:"50%"}},iqt.newInstance=function(e,t){var r=e||{},n=r.getContainer,o=DVt(r,rqt),a=document.createElement("div");n?n().appendChild(a):document.body.appendChild(a);var i=!1;function l(e){i||(i=!0,t({notice:function(t){e.add(t)},removeNotice:function(t){e.remove(t)},component:e,destroy:function(){!function(e){QVt.apply(this,arguments)}(a),a.parentNode&&a.parentNode.removeChild(a)},useNotification:function(){return t=e,r=s.useRef({}),n=JVt(s.useState([]),2),o=n[0],a=n[1],[function(e){var n=!0;t.add(e,function(e,t){var o=t.key;if(e&&(!r.current[o]||n)){var i=s.createElement(eqt,A({},t,{holder:e}));r.current[o]=i,a(function(e){var r=e.findIndex(function(e){return e.key===t.key});if(-1===r)return[].concat(tqt(e),[i]);var n=tqt(e);return n[r]=i,n})}n=!1})},s.createElement(s.Fragment,null,o)];var t,r,n,o,a}}))}"test"===process.env.NODE_ENV&&e.TEST_RENDER?e.TEST_RENDER(s.createElement(iqt,A({},o,{ref:l}))):ZVt(s.createElement(iqt,A({},o,{ref:l})),a)};var sqt,lqt,cqt,uqt=Te.colors,dqt=Te.fonts,pqt=Te.sizes,hqt=rt.span(sqt||(sqt=y(["\n color: ",";\n ",";\n"],["\n color: ",";\n ",";\n"])),function(e){return e.textColor},dqt.L),fqt=rt.div(lqt||(lqt=y(["\n display: flex;\n height: ","px;\n column-gap: ","px;\n align-items: center;\n padding-right: ","px;\n"],["\n display: flex;\n height: ","px;\n column-gap: ","px;\n align-items: center;\n padding-right: ","px;\n"])),pqt.XL,pqt.M,pqt.XL),mqt=rt.div(cqt||(cqt=y(["\n ",";\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n background-color: ",";\n"],["\n ",";\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 50%;\n background-color: ",";\n"])),je(pqt.XL),function(e){return e.backgroundColor}),vqt=function(e){var t=e.type,r=e.message,n=function(e){switch(e){case"success":return{icon:"Check",backgroundColor:uqt.green,textColor:uqt.greenShade};case"error":return{icon:"Close",backgroundColor:uqt.red,textColor:uqt.redShade};case"warning":return{icon:"Warning",backgroundColor:uqt.yellow,textColor:uqt.yellowShade,iconColor:uqt.yellowShade,iconSize:18};case"infoTierOne":return{icon:"Bell",backgroundColor:uqt.blue,textColor:uqt.blueShade,iconSize:18};case"infoTierTwo":return{icon:"Bell",backgroundColor:uqt.gray2,textColor:Se(uqt.gray2),iconSize:18};default:return{icon:"Bell",backgroundColor:uqt.blue,textColor:uqt.blueShade}}}(t),o=n.icon,a=n.iconColor,i=n.textColor,s=n.backgroundColor,l=n.iconSize;return Ce(fqt,{children:[Me(mqt,p({backgroundColor:s},{children:Me(Ik,{size:l||32,name:o,color:a||uqt.white})})),Me(hqt,p({textColor:i},{children:r}))]})},yqt=null;iqt.newInstance({maxCount:2},function(e){return yqt=e});var gqt=function(e){var t=e.message,r=e.type,n=void 0===r?"success":r,o=e.duration,a=void 0===o?2.5:o;return null==yqt?void 0:yqt.notice({content:Me(vqt,{message:t,type:n}),className:"toast-".concat(n),closable:!0,closeIcon:Me(Ik,{name:"Close"}),duration:a})};function xqt(e,t){if(!e)return!1;if(e.contains)return e.contains(t);for(var r=t;r;){if(r===e)return!0;r=r.parentNode}return!1}function bqt(e,t,r,n){var o=u.default.unstable_batchedUpdates?function(e){u.default.unstable_batchedUpdates(r,e)}:r;return e.addEventListener&&e.addEventListener(t,o,n),{remove:function(){e.removeEventListener&&e.removeEventListener(t,o,n)}}}var kqt=e.forwardRef(function(t,r){var n=t.didUpdate,o=t.getContainer,a=t.children,i=e.useRef(),s=e.useRef();e.useImperativeHandle(r,function(){return{}});var l=e.useRef(!1);return!l.current&&oIt()&&(s.current=o(),i.current=s.current.parentNode,l.current=!0),e.useEffect(function(){null==n||n(t)}),e.useEffect(function(){return null===s.current.parentNode&&null!==i.current&&i.current.appendChild(s.current),function(){var e,t;null===(e=s.current)||void 0===e||null===(t=e.parentNode)||void 0===t||t.removeChild(s.current)}},[]),s.current?u.default.createPortal(a,s.current):null});function _qt(e,t,r){return r?e[0]===t[0]:e[0]===t[0]&&e[1]===t[1]}function wqt(e){var t=e.prefixCls,r=e.motion,n=e.animation,o=e.transitionName;return r||(n?{motionName:"".concat(t,"-").concat(n)}:o?{motionName:o}:null)}function Mqt(e){var t=e.prefixCls,r=e.visible,n=e.zIndex,o=e.mask,a=e.maskMotion,i=e.maskAnimation,l=e.maskTransitionName;if(!o)return null;var c={};return(a||l||i)&&(c=SVt({motionAppear:!0},wqt({motion:a,prefixCls:t,transitionName:l,animation:i}))),s.createElement($It,A({},c,{visible:r,removeOnLeave:!0}),function(e){var r=e.className;return s.createElement("div",{style:{zIndex:n},className:aT("".concat(t,"-mask"),r)})})}var Cqt;function jqt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Dqt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?jqt(Object(r),!0).forEach(function(t){Sqt(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):jqt(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Oqt(e){return Oqt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Oqt(e)}function Sqt(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var Pqt={Webkit:"-webkit-",Moz:"-moz-",ms:"-ms-",O:"-o-"};function Tqt(){if(void 0!==Cqt)return Cqt;Cqt="";var e=document.createElement("p").style;for(var t in Pqt)t+"Transform"in e&&(Cqt=t);return Cqt}function Eqt(){return Tqt()?"".concat(Tqt(),"TransitionProperty"):"transitionProperty"}function Nqt(){return Tqt()?"".concat(Tqt(),"Transform"):"transform"}function zqt(e,t){var r=Eqt();r&&(e.style[r]=t,"transitionProperty"!==r&&(e.style.transitionProperty=t))}function Aqt(e,t){var r=Nqt();r&&(e.style[r]=t,"transform"!==r&&(e.style.transform=t))}var Rqt,Fqt=/matrix\((.*)\)/,Lqt=/matrix3d\((.*)\)/;function Bqt(e){var t=e.style.display;e.style.display="none",e.offsetHeight,e.style.display=t}function Vqt(e,t,r){var n=r;if("object"!==Oqt(t))return void 0!==n?("number"==typeof n&&(n="".concat(n,"px")),void(e.style[t]=n)):Rqt(e,t);for(var o in t)t.hasOwnProperty(o)&&Vqt(e,o,t[o])}function Iqt(e,t){var r=e["page".concat(t?"Y":"X","Offset")],n="scroll".concat(t?"Top":"Left");if("number"!=typeof r){var o=e.document;"number"!=typeof(r=o.documentElement[n])&&(r=o.body[n])}return r}function qqt(e){return Iqt(e)}function $qt(e){return Iqt(e,!0)}function Hqt(e){var t=function(e){var t,r,n,o=e.ownerDocument,a=o.body,i=o&&o.documentElement;return t=e.getBoundingClientRect(),r=Math.floor(t.left),n=Math.floor(t.top),{left:r-=i.clientLeft||a.clientLeft||0,top:n-=i.clientTop||a.clientTop||0}}(e),r=e.ownerDocument,n=r.defaultView||r.parentWindow;return t.left+=qqt(n),t.top+=$qt(n),t}function Wqt(e){return null!=e&&e==e.window}function Uqt(e){return Wqt(e)?e.document:9===e.nodeType?e:e.ownerDocument}var Yqt=new RegExp("^(".concat(/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,")(?!px)[a-z%]+$"),"i"),Zqt=/^(top|right|bottom|left)$/,Kqt="currentStyle",Gqt="runtimeStyle",Xqt="left";function Qqt(e,t){return"left"===e?t.useCssRight?"right":e:t.useCssBottom?"bottom":e}function Jqt(e){return"left"===e?"right":"right"===e?"left":"top"===e?"bottom":"bottom"===e?"top":void 0}function e$t(e,t,r){"static"===Vqt(e,"position")&&(e.style.position="relative");var n=-999,o=-999,a=Qqt("left",r),i=Qqt("top",r),s=Jqt(a),l=Jqt(i);"left"!==a&&(n=999),"top"!==i&&(o=999);var c,u="",d=Hqt(e);("left"in t||"top"in t)&&(u=(c=e).style.transitionProperty||c.style[Eqt()]||"",zqt(e,"none")),"left"in t&&(e.style[s]="",e.style[a]="".concat(n,"px")),"top"in t&&(e.style[l]="",e.style[i]="".concat(o,"px")),Bqt(e);var p=Hqt(e),h={};for(var f in t)if(t.hasOwnProperty(f)){var m=Qqt(f,r),v="left"===f?n:o,y=d[f]-p[f];h[m]=m===f?v+y:v-y}Vqt(e,h),Bqt(e),("left"in t||"top"in t)&&zqt(e,u);var g={};for(var x in t)if(t.hasOwnProperty(x)){var b=Qqt(x,r),k=t[x]-d[x];g[b]=x===b?h[b]+k:h[b]-k}Vqt(e,g)}function t$t(e,t){var r=Hqt(e),n=function(e){var t=window.getComputedStyle(e,null),r=t.getPropertyValue("transform")||t.getPropertyValue(Nqt());if(r&&"none"!==r){var n=r.replace(/[^0-9\-.,]/g,"").split(",");return{x:parseFloat(n[12]||n[4],0),y:parseFloat(n[13]||n[5],0)}}return{x:0,y:0}}(e),o={x:n.x,y:n.y};"left"in t&&(o.x=n.x+t.left-r.left),"top"in t&&(o.y=n.y+t.top-r.top),function(e,t){var r=window.getComputedStyle(e,null),n=r.getPropertyValue("transform")||r.getPropertyValue(Nqt());if(n&&"none"!==n){var o,a=n.match(Fqt);a?((o=(a=a[1]).split(",").map(function(e){return parseFloat(e,10)}))[4]=t.x,o[5]=t.y,Aqt(e,"matrix(".concat(o.join(","),")"))):((o=n.match(Lqt)[1].split(",").map(function(e){return parseFloat(e,10)}))[12]=t.x,o[13]=t.y,Aqt(e,"matrix3d(".concat(o.join(","),")")))}else Aqt(e,"translateX(".concat(t.x,"px) translateY(").concat(t.y,"px) translateZ(0)"))}(e,o)}function r$t(e,t){for(var r=0;r<e.length;r++)t(e[r])}function n$t(e){return"border-box"===Rqt(e,"boxSizing")}"undefined"!=typeof window&&(Rqt=window.getComputedStyle?function(e,t,r){var n=r,o="",a=Uqt(e);return(n=n||a.defaultView.getComputedStyle(e,null))&&(o=n.getPropertyValue(t)||n[t]),o}:function(e,t){var r=e[Kqt]&&e[Kqt][t];if(Yqt.test(r)&&!Zqt.test(t)){var n=e.style,o=n[Xqt],a=e[Gqt][Xqt];e[Gqt][Xqt]=e[Kqt][Xqt],n[Xqt]="fontSize"===t?"1em":r||0,r=n.pixelLeft+"px",n[Xqt]=o,e[Gqt][Xqt]=a}return""===r?"auto":r});var o$t=["margin","border","padding"];function a$t(e,t,r){var n,o,a,i=0;for(o=0;o<t.length;o++)if(n=t[o])for(a=0;a<r.length;a++){var s=void 0;s="border"===n?"".concat(n).concat(r[a],"Width"):n+r[a],i+=parseFloat(Rqt(e,s))||0}return i}var i$t={getParent:function(e){var t=e;do{t=11===t.nodeType&&t.host?t.host:t.parentNode}while(t&&1!==t.nodeType&&9!==t.nodeType);return t}};function s$t(e,t,r){var n=r;if(Wqt(e))return"width"===t?i$t.viewportWidth(e):i$t.viewportHeight(e);if(9===e.nodeType)return"width"===t?i$t.docWidth(e):i$t.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],a="width"===t?Math.floor(e.getBoundingClientRect().width):Math.floor(e.getBoundingClientRect().height),i=n$t(e),s=0;(null==a||a<=0)&&(a=void 0,(null==(s=Rqt(e,t))||Number(s)<0)&&(s=e.style[t]||0),s=parseFloat(s)||0),void 0===n&&(n=i?1:-1);var l=void 0!==a||i,c=a||s;return-1===n?l?c-a$t(e,["border","padding"],o):s:l?1===n?c:c+(2===n?-a$t(e,["border"],o):a$t(e,["margin"],o)):s+a$t(e,o$t.slice(n),o)}r$t(["Width","Height"],function(e){i$t["doc".concat(e)]=function(t){var r=t.document;return Math.max(r.documentElement["scroll".concat(e)],r.body["scroll".concat(e)],i$t["viewport".concat(e)](r))},i$t["viewport".concat(e)]=function(t){var r="client".concat(e),n=t.document,o=n.body,a=n.documentElement[r];return"CSS1Compat"===n.compatMode&&a||o&&o[r]||a}});var l$t={position:"absolute",visibility:"hidden",display:"block"};function c$t(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,o=t[0];return 0!==o.offsetWidth?n=s$t.apply(void 0,t):function(e,t,r){var n,o={},a=e.style;for(n in t)t.hasOwnProperty(n)&&(o[n]=a[n],a[n]=t[n]);for(n in r.call(e),t)t.hasOwnProperty(n)&&(a[n]=o[n])}(o,l$t,function(){n=s$t.apply(void 0,t)}),n}function u$t(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r]);return e}r$t(["width","height"],function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);i$t["outer".concat(t)]=function(t,r){return t&&c$t(t,e,r?0:1)};var r="width"===e?["Left","Right"]:["Top","Bottom"];i$t[e]=function(t,n){var o=n;return void 0!==o?t?(n$t(t)&&(o+=a$t(t,["padding","border"],r)),Vqt(t,e,o)):void 0:t&&c$t(t,e,-1)}});var d$t={getWindow:function(e){if(e&&e.document&&e.setTimeout)return e;var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},getDocument:Uqt,offset:function(e,t,r){if(void 0===t)return Hqt(e);!function(e,t,r){if(r.ignoreShake){var n=Hqt(e),o=n.left.toFixed(0),a=n.top.toFixed(0),i=t.left.toFixed(0),s=t.top.toFixed(0);if(o===i&&a===s)return}r.useCssRight||r.useCssBottom?e$t(e,t,r):r.useCssTransform&&Nqt()in document.body.style?t$t(e,t):e$t(e,t,r)}(e,t,r||{})},isWindow:Wqt,each:r$t,css:Vqt,clone:function(e){var t,r={};for(t in e)e.hasOwnProperty(t)&&(r[t]=e[t]);if(e.overflow)for(t in e)e.hasOwnProperty(t)&&(r.overflow[t]=e.overflow[t]);return r},mix:u$t,getWindowScrollLeft:function(e){return qqt(e)},getWindowScrollTop:function(e){return $qt(e)},merge:function(){for(var e={},t=0;t<arguments.length;t++)d$t.mix(e,t<0||arguments.length<=t?void 0:arguments[t]);return e},viewportWidth:0,viewportHeight:0};u$t(d$t,i$t);var p$t=d$t.getParent;function h$t(e){if(d$t.isWindow(e)||9===e.nodeType)return null;var t,r=d$t.getDocument(e).body,n=d$t.css(e,"position");if(!("fixed"===n||"absolute"===n))return"html"===e.nodeName.toLowerCase()?null:p$t(e);for(t=p$t(e);t&&t!==r&&9!==t.nodeType;t=p$t(t))if("static"!==(n=d$t.css(t,"position")))return t;return null}var f$t=d$t.getParent;function m$t(e,t){for(var r={left:0,right:1/0,top:0,bottom:1/0},n=h$t(e),o=d$t.getDocument(e),a=o.defaultView||o.parentWindow,i=o.body,s=o.documentElement;n;){if(-1!==navigator.userAgent.indexOf("MSIE")&&0===n.clientWidth||n===i||n===s||"visible"===d$t.css(n,"overflow")){if(n===i||n===s)break}else{var l=d$t.offset(n);l.left+=n.clientLeft,l.top+=n.clientTop,r.top=Math.max(r.top,l.top),r.right=Math.min(r.right,l.left+n.clientWidth),r.bottom=Math.min(r.bottom,l.top+n.clientHeight),r.left=Math.max(r.left,l.left)}n=h$t(n)}var c=null;d$t.isWindow(e)||9===e.nodeType||(c=e.style.position,"absolute"===d$t.css(e,"position")&&(e.style.position="fixed"));var u=d$t.getWindowScrollLeft(a),d=d$t.getWindowScrollTop(a),p=d$t.viewportWidth(a),h=d$t.viewportHeight(a),f=s.scrollWidth,m=s.scrollHeight,v=window.getComputedStyle(i);if("hidden"===v.overflowX&&(f=a.innerWidth),"hidden"===v.overflowY&&(m=a.innerHeight),e.style&&(e.style.position=c),t||function(e){if(d$t.isWindow(e)||9===e.nodeType)return!1;var t=d$t.getDocument(e),r=t.body,n=null;for(n=f$t(e);n&&n!==r&&n!==t;n=f$t(n))if("fixed"===d$t.css(n,"position"))return!0;return!1}(e))r.left=Math.max(r.left,u),r.top=Math.max(r.top,d),r.right=Math.min(r.right,u+p),r.bottom=Math.min(r.bottom,d+h);else{var y=Math.max(f,u+p);r.right=Math.min(r.right,y);var g=Math.max(m,d+h);r.bottom=Math.min(r.bottom,g)}return r.top>=0&&r.left>=0&&r.bottom>r.top&&r.right>r.left?r:null}function v$t(e){var t,r,n;if(d$t.isWindow(e)||9===e.nodeType){var o=d$t.getWindow(e);t={left:d$t.getWindowScrollLeft(o),top:d$t.getWindowScrollTop(o)},r=d$t.viewportWidth(o),n=d$t.viewportHeight(o)}else t=d$t.offset(e),r=d$t.outerWidth(e),n=d$t.outerHeight(e);return t.width=r,t.height=n,t}function y$t(e,t){var r=t.charAt(0),n=t.charAt(1),o=e.width,a=e.height,i=e.left,s=e.top;return"c"===r?s+=a/2:"b"===r&&(s+=a),"c"===n?i+=o/2:"r"===n&&(i+=o),{left:i,top:s}}function g$t(e,t,r,n,o){var a=y$t(t,r[1]),i=y$t(e,r[0]),s=[i.left-a.left,i.top-a.top];return{left:Math.round(e.left-s[0]+n[0]-o[0]),top:Math.round(e.top-s[1]+n[1]-o[1])}}function x$t(e,t,r){return e.left<r.left||e.left+t.width>r.right}function b$t(e,t,r){return e.top<r.top||e.top+t.height>r.bottom}function k$t(e,t,r){var n=[];return d$t.each(e,function(e){n.push(e.replace(t,function(e){return r[e]}))}),n}function _$t(e,t){return e[t]=-e[t],e}function w$t(e,t){return(/%$/.test(e)?parseInt(e.substring(0,e.length-1),10)/100*t:parseInt(e,10))||0}function M$t(e,t){e[0]=w$t(e[0],t.width),e[1]=w$t(e[1],t.height)}function C$t(e,t,r,n){var o=r.points,a=r.offset||[0,0],i=r.targetOffset||[0,0],s=r.overflow,l=r.source||e;a=[].concat(a),i=[].concat(i);var c={},u=0,d=m$t(l,!(!(s=s||{})||!s.alwaysByViewport)),p=v$t(l);M$t(a,p),M$t(i,t);var h=g$t(p,t,o,a,i),f=d$t.merge(p,h);if(d&&(s.adjustX||s.adjustY)&&n){if(s.adjustX&&x$t(h,p,d)){var m=k$t(o,/[lr]/gi,{l:"r",r:"l"}),v=_$t(a,0),y=_$t(i,0);(function(e,t,r){return e.left>r.right||e.left+t.width<r.left})(g$t(p,t,m,v,y),p,d)||(u=1,o=m,a=v,i=y)}if(s.adjustY&&b$t(h,p,d)){var g=k$t(o,/[tb]/gi,{t:"b",b:"t"}),x=_$t(a,1),b=_$t(i,1);(function(e,t,r){return e.top>r.bottom||e.top+t.height<r.top})(g$t(p,t,g,x,b),p,d)||(u=1,o=g,a=x,i=b)}u&&(h=g$t(p,t,o,a,i),d$t.mix(f,h));var k=x$t(h,p,d),_=b$t(h,p,d);if(k||_){var w=o;k&&(w=k$t(o,/[lr]/gi,{l:"r",r:"l"})),_&&(w=k$t(o,/[tb]/gi,{t:"b",b:"t"})),o=w,a=r.offset||[0,0],i=r.targetOffset||[0,0]}c.adjustX=s.adjustX&&k,c.adjustY=s.adjustY&&_,(c.adjustX||c.adjustY)&&(f=function(e,t,r,n){var o=d$t.clone(e),a={width:t.width,height:t.height};return n.adjustX&&o.left<r.left&&(o.left=r.left),n.resizeWidth&&o.left>=r.left&&o.left+a.width>r.right&&(a.width-=o.left+a.width-r.right),n.adjustX&&o.left+a.width>r.right&&(o.left=Math.max(r.right-a.width,r.left)),n.adjustY&&o.top<r.top&&(o.top=r.top),n.resizeHeight&&o.top>=r.top&&o.top+a.height>r.bottom&&(a.height-=o.top+a.height-r.bottom),n.adjustY&&o.top+a.height>r.bottom&&(o.top=Math.max(r.bottom-a.height,r.top)),d$t.mix(o,a)}(h,p,d,c))}return f.width!==p.width&&d$t.css(l,"width",d$t.width(l)+f.width-p.width),f.height!==p.height&&d$t.css(l,"height",d$t.height(l)+f.height-p.height),d$t.offset(l,{left:f.left,top:f.top},{useCssRight:r.useCssRight,useCssBottom:r.useCssBottom,useCssTransform:r.useCssTransform,ignoreShake:r.ignoreShake}),{points:o,offset:a,targetOffset:i,overflow:c}}function j$t(e,t,r){var n=r.target||t,o=v$t(n),a=!function(e,t){var r=m$t(e,t),n=v$t(e);return!r||n.left+n.width<=r.left||n.top+n.height<=r.top||n.left>=r.right||n.top>=r.bottom}(n,r.overflow&&r.overflow.alwaysByViewport);return C$t(e,o,r,a)}j$t.__getOffsetParent=h$t,j$t.__getVisibleRectForElement=m$t;var D$t=function(){this.__data__=[],this.size=0};var O$t=function(e,t){return e===t||e!=e&&t!=t},S$t=O$t;var P$t=function(e,t){for(var r=e.length;r--;)if(S$t(e[r][0],t))return r;return-1},T$t=P$t,E$t=Array.prototype.splice;var N$t=function(e){var t=this.__data__,r=T$t(t,e);return!(r<0)&&(r==t.length-1?t.pop():E$t.call(t,r,1),--this.size,!0)},z$t=P$t;var A$t=function(e){var t=this.__data__,r=z$t(t,e);return r<0?void 0:t[r][1]},R$t=P$t;var F$t=function(e){return R$t(this.__data__,e)>-1},L$t=P$t;var B$t=function(e,t){var r=this.__data__,n=L$t(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},V$t=D$t,I$t=N$t,q$t=A$t,$$t=F$t,H$t=B$t;function W$t(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}W$t.prototype.clear=V$t,W$t.prototype.delete=I$t,W$t.prototype.get=q$t,W$t.prototype.has=$$t,W$t.prototype.set=H$t;var U$t=W$t,Y$t=U$t;var Z$t=function(){this.__data__=new Y$t,this.size=0};var K$t=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r};var G$t=function(e){return this.__data__.get(e)};var X$t=function(e){return this.__data__.has(e)},Q$t=nj,J$t=zC;var eHt,tHt=function(e){if(!J$t(e))return!1;var t=Q$t(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},rHt=LC["__core-js_shared__"],nHt=(eHt=/[^.]+$/.exec(rHt&&rHt.keys&&rHt.keys.IE_PROTO||""))?"Symbol(src)_1."+eHt:"";var oHt=function(e){return!!nHt&&nHt in e},aHt=Function.prototype.toString;var iHt=function(e){if(null!=e){try{return aHt.call(e)}catch(e){}try{return e+""}catch(e){}}return""},sHt=tHt,lHt=oHt,cHt=zC,uHt=iHt,dHt=/^\[object .+?Constructor\]$/,pHt=Function.prototype,hHt=Object.prototype,fHt=pHt.toString,mHt=hHt.hasOwnProperty,vHt=RegExp("^"+fHt.call(mHt).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var yHt=function(e,t){return null==e?void 0:e[t]},gHt=function(e){return!(!cHt(e)||lHt(e))&&(sHt(e)?vHt:dHt).test(uHt(e))},xHt=yHt;var bHt=function(e,t){var r=xHt(e,t);return gHt(r)?r:void 0},kHt=bHt(LC,"Map"),_Ht=bHt(Object,"create"),wHt=_Ht;var MHt=function(){this.__data__=wHt?wHt(null):{},this.size=0};var CHt=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},jHt=_Ht,DHt=Object.prototype.hasOwnProperty;var OHt=function(e){var t=this.__data__;if(jHt){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return DHt.call(t,e)?t[e]:void 0},SHt=_Ht,PHt=Object.prototype.hasOwnProperty;var THt=function(e){var t=this.__data__;return SHt?void 0!==t[e]:PHt.call(t,e)},EHt=_Ht;var NHt=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=EHt&&void 0===t?"__lodash_hash_undefined__":t,this},zHt=MHt,AHt=CHt,RHt=OHt,FHt=THt,LHt=NHt;function BHt(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}BHt.prototype.clear=zHt,BHt.prototype.delete=AHt,BHt.prototype.get=RHt,BHt.prototype.has=FHt,BHt.prototype.set=LHt;var VHt=BHt,IHt=U$t,qHt=kHt;var $Ht=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},HHt=$Ht;var WHt=function(e,t){var r=e.__data__;return HHt(t)?r["string"==typeof t?"string":"hash"]:r.map},UHt=WHt;var YHt=function(e){var t=UHt(this,e).delete(e);return this.size-=t?1:0,t},ZHt=WHt;var KHt=function(e){return ZHt(this,e).get(e)},GHt=WHt;var XHt=function(e){return GHt(this,e).has(e)},QHt=WHt;var JHt=function(e,t){var r=QHt(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},eWt=function(){this.size=0,this.__data__={hash:new VHt,map:new(qHt||IHt),string:new VHt}},tWt=YHt,rWt=KHt,nWt=XHt,oWt=JHt;function aWt(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}aWt.prototype.clear=eWt,aWt.prototype.delete=tWt,aWt.prototype.get=rWt,aWt.prototype.has=nWt,aWt.prototype.set=oWt;var iWt=aWt,sWt=U$t,lWt=kHt,cWt=iWt;var uWt=function(e,t){var r=this.__data__;if(r instanceof sWt){var n=r.__data__;if(!lWt||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new cWt(n)}return r.set(e,t),this.size=r.size,this},dWt=U$t,pWt=Z$t,hWt=K$t,fWt=G$t,mWt=X$t,vWt=uWt;function yWt(e){var t=this.__data__=new dWt(e);this.size=t.size}yWt.prototype.clear=pWt,yWt.prototype.delete=hWt,yWt.prototype.get=fWt,yWt.prototype.has=mWt,yWt.prototype.set=vWt;var gWt=yWt;var xWt=iWt,bWt=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},kWt=function(e){return this.__data__.has(e)};function _Wt(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new xWt;++t<r;)this.add(e[t])}_Wt.prototype.add=_Wt.prototype.push=bWt,_Wt.prototype.has=kWt;var wWt=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1};var MWt=function(e,t){return e.has(t)},CWt=_Wt,jWt=wWt,DWt=MWt;var OWt=function(e,t,r,n,o,a){var i=1&r,s=e.length,l=t.length;if(s!=l&&!(i&&l>s))return!1;var c=a.get(e),u=a.get(t);if(c&&u)return c==t&&u==e;var d=-1,p=!0,h=2&r?new CWt:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var f=e[d],m=t[d];if(n)var v=i?n(m,f,d,t,e,a):n(f,m,d,e,t,a);if(void 0!==v){if(v)continue;p=!1;break}if(h){if(!jWt(t,function(e,t){if(!DWt(h,t)&&(f===e||o(f,e,r,n,a)))return h.push(t)})){p=!1;break}}else if(f!==m&&!o(f,m,r,n,a)){p=!1;break}}return a.delete(e),a.delete(t),p};var SWt=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r};var PWt=function(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r},TWt=LC.Uint8Array,EWt=O$t,NWt=OWt,zWt=SWt,AWt=PWt,RWt=UC?UC.prototype:void 0,FWt=RWt?RWt.valueOf:void 0;var LWt=function(e,t,r,n,o,a,i){switch(r){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new TWt(e),new TWt(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return EWt(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=zWt;case"[object Set]":var l=1&n;if(s||(s=AWt),e.size!=t.size&&!l)return!1;var c=i.get(e);if(c)return c==t;n|=2,i.set(e,t);var u=NWt(s(e),s(t),n,o,a,i);return i.delete(e),u;case"[object Symbol]":if(FWt)return FWt.call(e)==FWt.call(t)}return!1};var BWt=function(e,t){for(var r=-1,n=t.length,o=e.length;++r<n;)e[o+r]=t[r];return e},VWt=Array.isArray,IWt=BWt,qWt=VWt;var $Wt=function(e,t,r){var n=t(e);return qWt(e)?n:IWt(n,r(e))};var HWt=function(e,t){for(var r=-1,n=null==e?0:e.length,o=0,a=[];++r<n;){var i=e[r];t(i,r,e)&&(a[o++]=i)}return a};var WWt=HWt,UWt=function(){return[]},YWt=Object.prototype.propertyIsEnumerable,ZWt=Object.getOwnPropertySymbols,KWt=ZWt?function(e){return null==e?[]:(e=Object(e),WWt(ZWt(e),function(t){return YWt.call(e,t)}))}:UWt;var GWt=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n},XWt=nj,QWt=oj;var JWt=function(e){return QWt(e)&&"[object Arguments]"==XWt(e)},eUt=oj,tUt=Object.prototype,rUt=tUt.hasOwnProperty,nUt=tUt.propertyIsEnumerable,oUt=JWt(function(){return arguments}())?JWt:function(e){return eUt(e)&&rUt.call(e,"callee")&&!nUt.call(e,"callee")},aUt={exports:{}};var iUt=function(){return!1};!function(e,t){var r=LC,n=iUt,o=t&&!t.nodeType&&t,a=o&&e&&!e.nodeType&&e,i=a&&a.exports===o?r.Buffer:void 0,s=(i?i.isBuffer:void 0)||n;e.exports=s}(aUt,aUt.exports);var sUt=/^(?:0|[1-9]\d*)$/;var lUt=function(e,t){var r=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==r||"symbol"!=r&&sUt.test(e))&&e>-1&&e%1==0&&e<t};var cUt=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991},uUt=nj,dUt=cUt,pUt=oj,hUt={};hUt["[object Float32Array]"]=hUt["[object Float64Array]"]=hUt["[object Int8Array]"]=hUt["[object Int16Array]"]=hUt["[object Int32Array]"]=hUt["[object Uint8Array]"]=hUt["[object Uint8ClampedArray]"]=hUt["[object Uint16Array]"]=hUt["[object Uint32Array]"]=!0,hUt["[object Arguments]"]=hUt["[object Array]"]=hUt["[object ArrayBuffer]"]=hUt["[object Boolean]"]=hUt["[object DataView]"]=hUt["[object Date]"]=hUt["[object Error]"]=hUt["[object Function]"]=hUt["[object Map]"]=hUt["[object Number]"]=hUt["[object Object]"]=hUt["[object RegExp]"]=hUt["[object Set]"]=hUt["[object String]"]=hUt["[object WeakMap]"]=!1;var fUt=function(e){return pUt(e)&&dUt(e.length)&&!!hUt[uUt(e)]};var mUt=function(e){return function(t){return e(t)}},vUt={exports:{}};!function(e,t){var r=AC,n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,a=o&&o.exports===n&&r.process,i=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=i}(vUt,vUt.exports);var yUt=fUt,gUt=mUt,xUt=vUt.exports,bUt=xUt&&xUt.isTypedArray,kUt=bUt?gUt(bUt):yUt,_Ut=GWt,wUt=oUt,MUt=VWt,CUt=aUt.exports,jUt=lUt,DUt=kUt,OUt=Object.prototype.hasOwnProperty;var SUt=function(e,t){var r=MUt(e),n=!r&&wUt(e),o=!r&&!n&&CUt(e),a=!r&&!n&&!o&&DUt(e),i=r||n||o||a,s=i?_Ut(e.length,String):[],l=s.length;for(var c in e)!t&&!OUt.call(e,c)||i&&("length"==c||o&&("offset"==c||"parent"==c)||a&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||jUt(c,l))||s.push(c);return s},PUt=Object.prototype;var TUt=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||PUt)};var EUt=function(e,t){return function(r){return e(t(r))}},NUt=EUt(Object.keys,Object),zUt=TUt,AUt=NUt,RUt=Object.prototype.hasOwnProperty;var FUt=function(e){if(!zUt(e))return AUt(e);var t=[];for(var r in Object(e))RUt.call(e,r)&&"constructor"!=r&&t.push(r);return t},LUt=tHt,BUt=cUt;var VUt=SUt,IUt=FUt,qUt=function(e){return null!=e&&BUt(e.length)&&!LUt(e)};var $Ut=$Wt,HUt=KWt,WUt=function(e){return qUt(e)?VUt(e):IUt(e)};var UUt=function(e){return $Ut(e,WUt,HUt)},YUt=Object.prototype.hasOwnProperty;var ZUt=function(e,t,r,n,o,a){var i=1&r,s=UUt(e),l=s.length;if(l!=UUt(t).length&&!i)return!1;for(var c=l;c--;){var u=s[c];if(!(i?u in t:YUt.call(t,u)))return!1}var d=a.get(e),p=a.get(t);if(d&&p)return d==t&&p==e;var h=!0;a.set(e,t),a.set(t,e);for(var f=i;++c<l;){var m=e[u=s[c]],v=t[u];if(n)var y=i?n(v,m,u,t,e,a):n(m,v,u,e,t,a);if(!(void 0===y?m===v||o(m,v,r,n,a):y)){h=!1;break}f||(f="constructor"==u)}if(h&&!f){var g=e.constructor,x=t.constructor;g==x||!("constructor"in e)||!("constructor"in t)||"function"==typeof g&&g instanceof g&&"function"==typeof x&&x instanceof x||(h=!1)}return a.delete(e),a.delete(t),h},KUt=bHt(LC,"DataView"),GUt=kHt,XUt=bHt(LC,"Promise"),QUt=bHt(LC,"Set"),JUt=bHt(LC,"WeakMap"),eYt=nj,tYt=iHt,rYt="[object Map]",nYt="[object Promise]",oYt="[object Set]",aYt="[object WeakMap]",iYt="[object DataView]",sYt=tYt(KUt),lYt=tYt(GUt),cYt=tYt(XUt),uYt=tYt(QUt),dYt=tYt(JUt),pYt=eYt;(KUt&&pYt(new KUt(new ArrayBuffer(1)))!=iYt||GUt&&pYt(new GUt)!=rYt||XUt&&pYt(XUt.resolve())!=nYt||QUt&&pYt(new QUt)!=oYt||JUt&&pYt(new JUt)!=aYt)&&(pYt=function(e){var t=eYt(e),r="[object Object]"==t?e.constructor:void 0,n=r?tYt(r):"";if(n)switch(n){case sYt:return iYt;case lYt:return rYt;case cYt:return nYt;case uYt:return oYt;case dYt:return aYt}return t});var hYt=gWt,fYt=OWt,mYt=LWt,vYt=ZUt,yYt=pYt,gYt=VWt,xYt=aUt.exports,bYt=kUt,kYt="[object Arguments]",_Yt="[object Array]",wYt="[object Object]",MYt=Object.prototype.hasOwnProperty;var CYt=function(e,t,r,n,o,a){var i=gYt(e),s=gYt(t),l=i?_Yt:yYt(e),c=s?_Yt:yYt(t),u=(l=l==kYt?wYt:l)==wYt,d=(c=c==kYt?wYt:c)==wYt,p=l==c;if(p&&xYt(e)){if(!xYt(t))return!1;i=!0,u=!1}if(p&&!u)return a||(a=new hYt),i||bYt(e)?fYt(e,t,r,n,o,a):mYt(e,t,l,r,n,o,a);if(!(1&r)){var h=u&&MYt.call(e,"__wrapped__"),f=d&&MYt.call(t,"__wrapped__");if(h||f){var m=h?e.value():e,v=f?t.value():t;return a||(a=new hYt),o(m,v,r,n,a)}}return!!p&&(a||(a=new hYt),vYt(e,t,r,n,o,a))},jYt=oj;var DYt=function e(t,r,n,o,a){return t===r||(null==t||null==r||!jYt(t)&&!jYt(r)?t!=t&&r!=r:CYt(t,r,n,o,e,a))},OYt=DYt;var SYt=function(e,t){return OYt(e,t)};function PYt(e,t){var r=null,n=null;var o=new iN(function(e){var o=JVt(e,1)[0].target;if(document.documentElement.contains(o)){var a=o.getBoundingClientRect(),i=a.width,s=a.height,l=Math.floor(i),c=Math.floor(s);r===l&&n===c||Promise.resolve().then(function(){t({width:l,height:c})}),r=l,n=c}});return e&&o.observe(e),function(){o.disconnect()}}function TYt(e){return"function"!=typeof e?null:e()}function EYt(e){return"object"===jet(e)&&e?e:null}var NYt=function(e,t){var r=e.children,n=e.disabled,o=e.target,a=e.align,i=e.onAlign,s=e.monitorWindowResize,c=e.monitorBufferTime,u=void 0===c?0:c,d=l.default.useRef({}),p=l.default.useRef(),h=l.default.Children.only(r),f=l.default.useRef({});f.current.disabled=n,f.current.target=o,f.current.align=a,f.current.onAlign=i;var m=function(e,t){var r=l.default.useRef(!1),n=l.default.useRef(null);function o(){window.clearTimeout(n.current)}return[function a(i){if(o(),r.current&&!0!==i)n.current=window.setTimeout(function(){r.current=!1,a()},t);else{if(!1===e())return;r.current=!0,n.current=window.setTimeout(function(){r.current=!1},t)}},function(){r.current=!1,o()}]}(function(){var e=f.current,t=e.disabled,r=e.target,n=e.align,o=e.onAlign;if(!t&&r){var a,i=p.current,s=TYt(r),l=EYt(r);d.current.element=s,d.current.point=l,d.current.align=n;var c=document.activeElement;return s&&function(e){if(!e)return!1;if(e instanceof HTMLElement&&e.offsetParent)return!0;if(e instanceof SVGGraphicsElement&&e.getBBox){var t=e.getBBox(),r=t.width,n=t.height;if(r||n)return!0}if(e instanceof HTMLElement&&e.getBoundingClientRect){var o=e.getBoundingClientRect(),a=o.width,i=o.height;if(a||i)return!0}return!1}(s)?a=j$t(i,s,n):l&&(a=function(e,t,r){var n,o,a=d$t.getDocument(e),i=a.defaultView||a.parentWindow,s=d$t.getWindowScrollLeft(i),l=d$t.getWindowScrollTop(i),c=d$t.viewportWidth(i),u=d$t.viewportHeight(i),d={left:n="pageX"in t?t.pageX:s+t.clientX,top:o="pageY"in t?t.pageY:l+t.clientY,width:0,height:0},p=n>=0&&n<=s+c&&o>=0&&o<=l+u,h=[r.points[0],"cc"];return C$t(e,d,Dqt(Dqt({},r),{},{points:h}),p)}(i,l,n)),function(e,t){e!==document.activeElement&&xqt(t,e)&&"function"==typeof e.focus&&e.focus()}(c,i),o&&a&&o(i,a),!0}return!1},u),v=JVt(m,2),y=v[0],g=v[1],x=l.default.useRef({cancel:function(){}}),b=l.default.useRef({cancel:function(){}});l.default.useEffect(function(){var e,t,r=TYt(o),n=EYt(o);p.current!==b.current.element&&(b.current.cancel(),b.current.element=p.current,b.current.cancel=PYt(p.current,y)),d.current.element===r&&((e=d.current.point)===(t=n)||e&&t&&("pageX"in t&&"pageY"in t?e.pageX===t.pageX&&e.pageY===t.pageY:"clientX"in t&&"clientY"in t&&e.clientX===t.clientX&&e.clientY===t.clientY))&&SYt(d.current.align,a)||(y(),x.current.element!==r&&(x.current.cancel(),x.current.element=r,x.current.cancel=PYt(r,y)))}),l.default.useEffect(function(){n?g():y()},[n]);var k=l.default.useRef(null);return l.default.useEffect(function(){s?k.current||(k.current=bqt(window,"resize",y)):k.current&&(k.current.remove(),k.current=null)},[s]),l.default.useEffect(function(){return function(){x.current.cancel(),b.current.cancel(),k.current&&k.current.remove(),g()}},[]),l.default.useImperativeHandle(t,function(){return{forceAlign:function(){return y(!0)}}}),l.default.isValidElement(h)&&(h=l.default.cloneElement(h,{ref:rIt(h.ref,p)})),h},zYt=l.default.forwardRef(NYt);zYt.displayName="Align";var AYt="test"!==process.env.NODE_ENV&&oIt()?s.useLayoutEffect:s.useEffect,RYt=["measure","alignPre","align",null,"motion"],FYt=s.forwardRef(function(t,r){var n=t.visible,o=t.prefixCls,a=t.className,i=t.style,l=t.children,c=t.zIndex,u=t.stretch,d=t.destroyPopupOnHide,p=t.forceRender,h=t.align,f=t.point,m=t.getRootDomNode,v=t.getClassNameFromAlign,y=t.onAlign,g=t.onMouseEnter,x=t.onMouseLeave,b=t.onMouseDown,k=t.onTouchStart,_=t.onClick,w=e.useRef(),M=e.useRef(),C=JVt(e.useState(),2),j=C[0],D=C[1],O=function(e){var t=JVt(s.useState({width:0,height:0}),2),r=t[0],n=t[1],o=s.useMemo(function(){var t={};if(e){var n=r.width,o=r.height;-1!==e.indexOf("height")&&o?t.height=o:-1!==e.indexOf("minHeight")&&o&&(t.minHeight=o),-1!==e.indexOf("width")&&n?t.width=n:-1!==e.indexOf("minWidth")&&n&&(t.minWidth=n)}return t},[e,r]);return[o,function(e){n({width:e.offsetWidth,height:e.offsetHeight})}]}(u),S=JVt(O,2),P=S[0],T=S[1];var E=function(t,r){var n=JVt(SIt(null),2),o=n[0],a=n[1],i=e.useRef();function s(e){a(e,!0)}function l(){AIt.cancel(i.current)}return e.useEffect(function(){s("measure")},[t]),e.useEffect(function(){"measure"===o&&r(),o&&(i.current=AIt(VVt(LVt().mark(function e(){var t,r;return LVt().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:t=RYt.indexOf(o),(r=RYt[t+1])&&-1!==t&&s(r);case 3:case"end":return e.stop()}},e)}))))},[o]),e.useEffect(function(){return function(){l()}},[]),[o,function(e){l(),i.current=AIt(function(){s(function(e){switch(o){case"align":return"motion";case"motion":return"stable"}return e}),null==e||e()})}]}(n,function(){u&&T(m())}),N=JVt(E,2),z=N[0],R=N[1],F=JVt(e.useState(0),2),L=F[0],B=F[1],V=e.useRef();function I(){var e;null===(e=w.current)||void 0===e||e.forceAlign()}function q(e,t){var r=v(t);j!==r&&D(r),B(function(e){return e+1}),"align"===z&&(null==y||y(e,t))}AYt(function(){"alignPre"===z&&B(0)},[z]),AYt(function(){"align"===z&&(L<2?I():R(function(){var e;null===(e=V.current)||void 0===e||e.call(V)}))},[L]);var $=SVt({},wqt(t));function H(){return new Promise(function(e){V.current=e})}["onAppearEnd","onEnterEnd","onLeaveEnd"].forEach(function(e){var t=$[e];$[e]=function(e,r){return R(),null==t?void 0:t(e,r)}}),s.useEffect(function(){$.motionName||"motion"!==z||R()},[$.motionName,z]),s.useImperativeHandle(r,function(){return{forceAlign:I,getElement:function(){return M.current}}});var W=SVt(SVt({},P),{},{zIndex:c,opacity:"motion"!==z&&"stable"!==z&&n?0:void 0,pointerEvents:n||"stable"===z?void 0:"none"},i),U=!0;!(null==h?void 0:h.points)||"align"!==z&&"stable"!==z||(U=!1);var Y=l;return s.Children.count(l)>1&&(Y=s.createElement("div",{className:"".concat(o,"-content")},l)),s.createElement($It,A({visible:n,ref:M,leavedClassName:"".concat(o,"-hidden")},$,{onAppearPrepare:H,onEnterPrepare:H,removeOnLeave:d,forceRender:p}),function(e,t){var r=e.className,n=e.style,i=aT(o,a,j,r);return s.createElement(zYt,{target:f||m,key:"popup",ref:w,monitorWindowResize:!0,disabled:U,align:h,onAlign:q},s.createElement("div",{ref:t,className:i,onMouseEnter:g,onMouseLeave:x,onMouseDownCapture:b,onTouchStartCapture:k,onClick:_,style:SVt(SVt({},n),W)},Y))})});FYt.displayName="PopupInner";var LYt=s.forwardRef(function(e,t){var r=e.prefixCls,n=e.visible,o=e.zIndex,a=e.children,i=e.mobile,l=(i=void 0===i?{}:i).popupClassName,c=i.popupStyle,u=i.popupMotion,d=void 0===u?{}:u,p=i.popupRender,h=e.onClick,f=s.useRef();s.useImperativeHandle(t,function(){return{forceAlign:function(){},getElement:function(){return f.current}}});var m=SVt({zIndex:o},c),v=a;return s.Children.count(a)>1&&(v=s.createElement("div",{className:"".concat(r,"-content")},a)),p&&(v=p(v)),s.createElement($It,A({visible:n,ref:f,removeOnLeave:!0},d),function(e,t){var n=e.className,o=e.style,a=aT(r,l,n);return s.createElement("div",{ref:t,className:a,onClick:h,style:SVt(SVt({},o),m)},v)})});LYt.displayName="MobilePopupInner";var BYt=["visible","mobile"],VYt=s.forwardRef(function(t,r){var n=t.visible,o=t.mobile,a=DVt(t,BYt),i=JVt(e.useState(n),2),l=i[0],c=i[1],u=JVt(e.useState(!1),2),d=u[0],p=u[1],h=SVt(SVt({},a),{},{visible:l});e.useEffect(function(){c(n),n&&o&&p(function(){if("undefined"==typeof navigator||"undefined"==typeof window)return!1;var e=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(e)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(null==e?void 0:e.substr(0,4))}())},[n,o]);var f=d?s.createElement(LYt,A({},h,{mobile:o,ref:r})):s.createElement(FYt,A({},h,{ref:r}));return s.createElement("div",null,s.createElement(Mqt,h),f)});VYt.displayName="Popup";var IYt=s.createContext(null);function qYt(){}function $Yt(){return""}function HYt(e){return e?e.ownerDocument:window.document}var WYt=["onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur","onContextMenu"];var UYt=function(e){var t=function(){Gtt(r,s.Component);var t=Jtt(r);function r(e){var n,o;return ert(this,r),(n=t.call(this,e)).popupRef=s.createRef(),n.triggerRef=s.createRef(),n.portalContainer=void 0,n.attachId=void 0,n.clickOutsideHandler=void 0,n.touchOutsideHandler=void 0,n.contextMenuOutsideHandler1=void 0,n.contextMenuOutsideHandler2=void 0,n.mouseDownTimeout=void 0,n.focusTime=void 0,n.preClickTime=void 0,n.preTouchTime=void 0,n.delayTimer=void 0,n.hasPopupMouseDown=void 0,n.onMouseEnter=function(e){var t=n.props.mouseEnterDelay;n.fireEvents("onMouseEnter",e),n.delaySetPopupVisible(!0,t,t?null:e)},n.onMouseMove=function(e){n.fireEvents("onMouseMove",e),n.setPoint(e)},n.onMouseLeave=function(e){n.fireEvents("onMouseLeave",e),n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)},n.onPopupMouseEnter=function(){n.clearDelayTimer()},n.onPopupMouseLeave=function(e){var t;e.relatedTarget&&!e.relatedTarget.setTimeout&&xqt(null===(t=n.popupRef.current)||void 0===t?void 0:t.getElement(),e.relatedTarget)||n.delaySetPopupVisible(!1,n.props.mouseLeaveDelay)},n.onFocus=function(e){n.fireEvents("onFocus",e),n.clearDelayTimer(),n.isFocusToShow()&&(n.focusTime=Date.now(),n.delaySetPopupVisible(!0,n.props.focusDelay))},n.onMouseDown=function(e){n.fireEvents("onMouseDown",e),n.preClickTime=Date.now()},n.onTouchStart=function(e){n.fireEvents("onTouchStart",e),n.preTouchTime=Date.now()},n.onBlur=function(e){n.fireEvents("onBlur",e),n.clearDelayTimer(),n.isBlurToHide()&&n.delaySetPopupVisible(!1,n.props.blurDelay)},n.onContextMenu=function(e){e.preventDefault(),n.fireEvents("onContextMenu",e),n.setPopupVisible(!0,e)},n.onContextMenuClose=function(){n.isContextMenuToShow()&&n.close()},n.onClick=function(e){if(n.fireEvents("onClick",e),n.focusTime){var t;if(n.preClickTime&&n.preTouchTime?t=Math.min(n.preClickTime,n.preTouchTime):n.preClickTime?t=n.preClickTime:n.preTouchTime&&(t=n.preTouchTime),Math.abs(t-n.focusTime)<20)return;n.focusTime=0}n.preClickTime=0,n.preTouchTime=0,n.isClickToShow()&&(n.isClickToHide()||n.isBlurToHide())&&e&&e.preventDefault&&e.preventDefault();var r=!n.state.popupVisible;(n.isClickToHide()&&!r||r&&n.isClickToShow())&&n.setPopupVisible(!n.state.popupVisible,e)},n.onPopupMouseDown=function(){var e;(n.hasPopupMouseDown=!0,clearTimeout(n.mouseDownTimeout),n.mouseDownTimeout=window.setTimeout(function(){n.hasPopupMouseDown=!1},0),n.context)&&(e=n.context).onPopupMouseDown.apply(e,arguments)},n.onDocumentClick=function(e){if(!n.props.mask||n.props.maskClosable){var t=e.target,r=n.getRootDomNode(),o=n.getPopupDomNode();xqt(r,t)&&!n.isContextMenuOnly()||xqt(o,t)||n.hasPopupMouseDown||n.close()}},n.getRootDomNode=function(){var e=n.props.getTriggerDOMNode;if(e)return e(n.triggerRef.current);try{var t=eIt(n.triggerRef.current);if(t)return t}catch(e){}return u.default.findDOMNode(ll(n))},n.getPopupClassNameFromAlign=function(e){var t=[],r=n.props,o=r.popupPlacement,a=r.builtinPlacements,i=r.prefixCls,s=r.alignPoint,l=r.getPopupClassNameFromAlign;return o&&a&&t.push(function(e,t,r,n){for(var o=r.points,a=Object.keys(e),i=0;i<a.length;i+=1){var s=a[i];if(_qt(e[s].points,o,n))return"".concat(t,"-placement-").concat(s)}return""}(a,i,e,s)),l&&t.push(l(e)),t.join(" ")},n.getComponent=function(){var e=n.props,t=e.prefixCls,r=e.destroyPopupOnHide,o=e.popupClassName,a=e.onPopupAlign,i=e.popupMotion,l=e.popupAnimation,c=e.popupTransitionName,u=e.popupStyle,d=e.mask,p=e.maskAnimation,h=e.maskTransitionName,f=e.maskMotion,m=e.zIndex,v=e.popup,y=e.stretch,g=e.alignPoint,x=e.mobile,b=e.forceRender,k=e.onPopupClick,_=n.state,w=_.popupVisible,M=_.point,C=n.getPopupAlign(),j={};return n.isMouseEnterToShow()&&(j.onMouseEnter=n.onPopupMouseEnter),n.isMouseLeaveToHide()&&(j.onMouseLeave=n.onPopupMouseLeave),j.onMouseDown=n.onPopupMouseDown,j.onTouchStart=n.onPopupMouseDown,s.createElement(VYt,A({prefixCls:t,destroyPopupOnHide:r,visible:w,point:g&&M,className:o,align:C,onAlign:a,animation:l,getClassNameFromAlign:n.getPopupClassNameFromAlign},j,{stretch:y,getRootDomNode:n.getRootDomNode,style:u,mask:d,zIndex:m,transitionName:c,maskAnimation:p,maskTransitionName:h,maskMotion:f,ref:n.popupRef,motion:i,mobile:x,forceRender:b,onClick:k}),"function"==typeof v?v():v)},n.attachParent=function(e){AIt.cancel(n.attachId);var t,r=n.props,o=r.getPopupContainer,a=r.getDocument,i=n.getRootDomNode();o?(i||0===o.length)&&(t=o(i)):t=a(n.getRootDomNode()).body,t?t.appendChild(e):n.attachId=AIt(function(){n.attachParent(e)})},n.getContainer=function(){if(!n.portalContainer){var e=(0,n.props.getDocument)(n.getRootDomNode()).createElement("div");e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",n.portalContainer=e}return n.attachParent(n.portalContainer),n.portalContainer},n.setPoint=function(e){n.props.alignPoint&&e&&n.setState({point:{pageX:e.pageX,pageY:e.pageY}})},n.handlePortalUpdate=function(){n.state.prevPopupVisible!==n.state.popupVisible&&n.props.afterPopupVisibleChange(n.state.popupVisible)},n.triggerContextValue={onPopupMouseDown:n.onPopupMouseDown},o="popupVisible"in e?!!e.popupVisible:!!e.defaultPopupVisible,n.state={prevPopupVisible:o,popupVisible:o},WYt.forEach(function(e){n["fire".concat(e)]=function(t){n.fireEvents(e,t)}}),n}return nrt(r,[{key:"componentDidMount",value:function(){this.componentDidUpdate()}},{key:"componentDidUpdate",value:function(){var e,t=this.props;if(this.state.popupVisible)return this.clickOutsideHandler||!this.isClickToHide()&&!this.isContextMenuToShow()||(e=t.getDocument(this.getRootDomNode()),this.clickOutsideHandler=bqt(e,"mousedown",this.onDocumentClick)),this.touchOutsideHandler||(e=e||t.getDocument(this.getRootDomNode()),this.touchOutsideHandler=bqt(e,"touchstart",this.onDocumentClick)),!this.contextMenuOutsideHandler1&&this.isContextMenuToShow()&&(e=e||t.getDocument(this.getRootDomNode()),this.contextMenuOutsideHandler1=bqt(e,"scroll",this.onContextMenuClose)),void(!this.contextMenuOutsideHandler2&&this.isContextMenuToShow()&&(this.contextMenuOutsideHandler2=bqt(window,"blur",this.onContextMenuClose)));this.clearOutsideHandler()}},{key:"componentWillUnmount",value:function(){this.clearDelayTimer(),this.clearOutsideHandler(),clearTimeout(this.mouseDownTimeout),AIt.cancel(this.attachId)}},{key:"getPopupDomNode",value:function(){var e;return(null===(e=this.popupRef.current)||void 0===e?void 0:e.getElement())||null}},{key:"getPopupAlign",value:function(){var e=this.props,t=e.popupPlacement,r=e.popupAlign,n=e.builtinPlacements;return t&&n?function(e,t,r){return SVt(SVt({},e[t]||{}),r)}(n,t,r):r}},{key:"setPopupVisible",value:function(e,t){var r=this.props.alignPoint,n=this.state.popupVisible;this.clearDelayTimer(),n!==e&&("popupVisible"in this.props||this.setState({popupVisible:e,prevPopupVisible:n}),this.props.onPopupVisibleChange(e)),r&&t&&e&&this.setPoint(t)}},{key:"delaySetPopupVisible",value:function(e,t,r){var n=this,o=1e3*t;if(this.clearDelayTimer(),o){var a=r?{pageX:r.pageX,pageY:r.pageY}:null;this.delayTimer=window.setTimeout(function(){n.setPopupVisible(e,a),n.clearDelayTimer()},o)}else this.setPopupVisible(e,r)}},{key:"clearDelayTimer",value:function(){this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null)}},{key:"clearOutsideHandler",value:function(){this.clickOutsideHandler&&(this.clickOutsideHandler.remove(),this.clickOutsideHandler=null),this.contextMenuOutsideHandler1&&(this.contextMenuOutsideHandler1.remove(),this.contextMenuOutsideHandler1=null),this.contextMenuOutsideHandler2&&(this.contextMenuOutsideHandler2.remove(),this.contextMenuOutsideHandler2=null),this.touchOutsideHandler&&(this.touchOutsideHandler.remove(),this.touchOutsideHandler=null)}},{key:"createTwoChains",value:function(e){var t=this.props.children.props,r=this.props;return t[e]&&r[e]?this["fire".concat(e)]:t[e]||r[e]}},{key:"isClickToShow",value:function(){var e=this.props,t=e.action,r=e.showAction;return-1!==t.indexOf("click")||-1!==r.indexOf("click")}},{key:"isContextMenuOnly",value:function(){var e=this.props.action;return"contextMenu"===e||1===e.length&&"contextMenu"===e[0]}},{key:"isContextMenuToShow",value:function(){var e=this.props,t=e.action,r=e.showAction;return-1!==t.indexOf("contextMenu")||-1!==r.indexOf("contextMenu")}},{key:"isClickToHide",value:function(){var e=this.props,t=e.action,r=e.hideAction;return-1!==t.indexOf("click")||-1!==r.indexOf("click")}},{key:"isMouseEnterToShow",value:function(){var e=this.props,t=e.action,r=e.showAction;return-1!==t.indexOf("hover")||-1!==r.indexOf("mouseEnter")}},{key:"isMouseLeaveToHide",value:function(){var e=this.props,t=e.action,r=e.hideAction;return-1!==t.indexOf("hover")||-1!==r.indexOf("mouseLeave")}},{key:"isFocusToShow",value:function(){var e=this.props,t=e.action,r=e.showAction;return-1!==t.indexOf("focus")||-1!==r.indexOf("focus")}},{key:"isBlurToHide",value:function(){var e=this.props,t=e.action,r=e.hideAction;return-1!==t.indexOf("focus")||-1!==r.indexOf("blur")}},{key:"forcePopupAlign",value:function(){var e;this.state.popupVisible&&(null===(e=this.popupRef.current)||void 0===e||e.forceAlign())}},{key:"fireEvents",value:function(e,t){var r=this.props.children.props[e];r&&r(t);var n=this.props[e];n&&n(t)}},{key:"close",value:function(){this.setPopupVisible(!1)}},{key:"render",value:function(){var t=this.state.popupVisible,r=this.props,n=r.children,o=r.forceRender,a=r.alignPoint,i=r.className,l=r.autoDestroy,c=s.Children.only(n),u={key:"trigger"};this.isContextMenuToShow()?u.onContextMenu=this.onContextMenu:u.onContextMenu=this.createTwoChains("onContextMenu"),this.isClickToHide()||this.isClickToShow()?(u.onClick=this.onClick,u.onMouseDown=this.onMouseDown,u.onTouchStart=this.onTouchStart):(u.onClick=this.createTwoChains("onClick"),u.onMouseDown=this.createTwoChains("onMouseDown"),u.onTouchStart=this.createTwoChains("onTouchStart")),this.isMouseEnterToShow()?(u.onMouseEnter=this.onMouseEnter,a&&(u.onMouseMove=this.onMouseMove)):u.onMouseEnter=this.createTwoChains("onMouseEnter"),this.isMouseLeaveToHide()?u.onMouseLeave=this.onMouseLeave:u.onMouseLeave=this.createTwoChains("onMouseLeave"),this.isFocusToShow()||this.isBlurToHide()?(u.onFocus=this.onFocus,u.onBlur=this.onBlur):(u.onFocus=this.createTwoChains("onFocus"),u.onBlur=this.createTwoChains("onBlur"));var d=aT(c&&c.props&&c.props.className,i);d&&(u.className=d);var p=SVt({},u);nIt(c)&&(p.ref=rIt(this.triggerRef,c.ref));var h,f=s.cloneElement(c,p);return(t||this.popupRef.current||o)&&(h=s.createElement(e,{key:"portal",getContainer:this.getContainer,didUpdate:this.handlePortalUpdate},this.getComponent())),!t&&l&&(h=null),s.createElement(IYt.Provider,{value:this.triggerContextValue},f,h)}}],[{key:"getDerivedStateFromProps",value:function(e,t){var r=e.popupVisible,n={};return void 0!==r&&t.popupVisible!==r&&(n.popupVisible=r,n.prevPopupVisible=t.popupVisible),n}}]),r}();return t.contextType=IYt,t.defaultProps={prefixCls:"rc-trigger-popup",getPopupClassNameFromAlign:$Yt,getDocument:HYt,onPopupVisibleChange:qYt,afterPopupVisibleChange:qYt,onPopupAlign:qYt,popupClassName:"",mouseEnterDelay:0,mouseLeaveDelay:.1,focusDelay:0,blurDelay:.15,popupStyle:{},destroyPopupOnHide:!1,popupAlign:{},defaultPopupVisible:!1,mask:!1,maskClosable:!0,action:[],showAction:[],hideAction:[],autoDestroy:!1},t}(kqt),YYt={adjustX:1,adjustY:1},ZYt=[0,0],KYt={left:{points:["cr","cl"],overflow:YYt,offset:[-4,0],targetOffset:ZYt},right:{points:["cl","cr"],overflow:YYt,offset:[4,0],targetOffset:ZYt},top:{points:["bc","tc"],overflow:YYt,offset:[0,-4],targetOffset:ZYt},bottom:{points:["tc","bc"],overflow:YYt,offset:[0,4],targetOffset:ZYt},topLeft:{points:["bl","tl"],overflow:YYt,offset:[0,-4],targetOffset:ZYt},leftTop:{points:["tr","tl"],overflow:YYt,offset:[-4,0],targetOffset:ZYt},topRight:{points:["br","tr"],overflow:YYt,offset:[0,-4],targetOffset:ZYt},rightTop:{points:["tl","tr"],overflow:YYt,offset:[4,0],targetOffset:ZYt},bottomRight:{points:["tr","br"],overflow:YYt,offset:[0,4],targetOffset:ZYt},rightBottom:{points:["bl","br"],overflow:YYt,offset:[4,0],targetOffset:ZYt},bottomLeft:{points:["tl","bl"],overflow:YYt,offset:[0,4],targetOffset:ZYt},leftBottom:{points:["br","bl"],overflow:YYt,offset:[-4,0],targetOffset:ZYt}};function GYt(e){var t=e.showArrow,r=e.arrowContent,n=e.children,o=e.prefixCls,a=e.id,i=e.overlayInnerStyle,l=e.className,c=e.style;return s.createElement("div",{className:aT("".concat(o,"-content"),l),style:c},!1!==t&&s.createElement("div",{className:"".concat(o,"-arrow"),key:"arrow"},r),s.createElement("div",{className:"".concat(o,"-inner"),id:a,role:"tooltip",style:i},"function"==typeof n?n():n))}var XYt,QYt,JYt,eZt,tZt=function(t,r){var n=t.overlayClassName,o=t.trigger,a=void 0===o?["hover"]:o,i=t.mouseEnterDelay,l=void 0===i?0:i,c=t.mouseLeaveDelay,u=void 0===c?.1:c,d=t.overlayStyle,p=t.prefixCls,h=void 0===p?"rc-tooltip":p,f=t.children,m=t.onVisibleChange,v=t.afterVisibleChange,y=t.transitionName,g=t.animation,x=t.motion,b=t.placement,k=void 0===b?"right":b,_=t.align,w=void 0===_?{}:_,M=t.destroyTooltipOnHide,C=void 0!==M&&M,j=t.defaultVisible,D=t.getTooltipContainer,O=t.overlayInnerStyle,S=t.arrowContent,P=t.overlay,T=t.id,E=t.showArrow,N=DVt(t,["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow"]),z=e.useRef(null);e.useImperativeHandle(r,function(){return z.current});var R=SVt({},N);"visible"in t&&(R.popupVisible=t.visible);var F=!1,L=!1;if("boolean"==typeof C)F=C;else if(C&&"object"===jet(C)){var B=C.keepParent;F=!0===B,L=!1===B}return s.createElement(UYt,A({popupClassName:n,prefixCls:h,popup:function(){return s.createElement(GYt,{showArrow:E,arrowContent:S,key:"content",prefixCls:h,id:T,overlayInnerStyle:O},P)},action:a,builtinPlacements:KYt,popupPlacement:k,ref:z,popupAlign:w,getPopupContainer:D,onPopupVisibleChange:m,afterPopupVisibleChange:v,popupTransitionName:y,popupAnimation:g,popupMotion:x,defaultPopupVisible:j,destroyPopupOnHide:F,autoDestroy:L,mouseLeaveDelay:u,popupStyle:d,mouseEnterDelay:l},R),f)},rZt=e.forwardRef(tZt),nZt=rt.div(QYt||(QYt=y(["\n ",";\n"],["\n ",";\n"])),function(e){var t=e.theme,r=t.colors,n=t.sizes,o=t.fonts,a=e.$styles;return Ye(XYt||(XYt=y(["\n .rc-tooltip {\n &-arrow {\n display: none;\n }\n &-inner {\n min-height: unset;\n padding: ","px;\n background-color: ",";\n color: ",";\n border-radius: ","px;\n ",";\n ",";\n }\n }\n "],["\n .rc-tooltip {\n &-arrow {\n display: none;\n }\n &-inner {\n min-height: unset;\n padding: ","px;\n background-color: ",";\n color: ",";\n border-radius: ","px;\n ",";\n ",";\n }\n }\n "])),n.S,r.indigo,r.white,n.S,o.S,a)}),oZt={DEFAULT:"Minus",ERROR:"Close",SUCCESS:"Check"},aZt=function(e){var t=e.text,r=e.status,n=function(e){var t=me().colors;switch(e){case"SUCCESS":return{color:t.greenShade,backgroundColor:t.greenTint,borderColor:"transparent"};case"ERROR":return{color:t.redShade,backgroundColor:t.redTint,borderColor:"transparent"};default:return{color:t.gray2,backgroundColor:"transparent",borderColor:t.gray3}}}(r),o=n.backgroundColor,a=n.color,i=n.borderColor,s=me().sizes;return Ce(iZt,p({style:{backgroundColor:o,borderColor:i}},{children:[Me(Ik,{size:s.M,name:oZt[r],color:a}),Me(l4e,{width:"S"}),Me(c4e,p({variant:"M",color:a},{children:t}))]}))},iZt=rt.div(eZt||(eZt=y(["\n ","\n"],["\n ","\n"])),function(e){var t=e.theme.sizes;return Ye(JYt||(JYt=y(["\n display: flex;\n width: fit-content;\n align-items: center;\n border-radius: ","px;\n border: 1.5px solid transparent;\n padding: ","px ","px ","px ","px;\n "],["\n display: flex;\n width: fit-content;\n align-items: center;\n border-radius: ","px;\n border: 1.5px solid transparent;\n padding: ","px ","px ","px ","px;\n "])),t.M,t.XS,t.M,t.XS,t.S)}),sZt=function(e){var t,r=e.children,n=h(e,["children"]);return p(p({},n),{items:null!==(t=null==r?void 0:r.map(function(e){return"molecule"===e.instance&&"consent"===e.type?e:"container"===e.instance?sZt(e):e}))&&void 0!==t?t:[]})};exports.AccountButtonContext=GBt,exports.AccountButtonProvider=XBt,exports.AlertMolecule=z2e,exports.ApiContext=rVt,exports.ApiProvider=function(e){var t=e.api,r=e.children;return Me(rVt.Provider,p({value:t},{children:r}))},exports.BackgroundImage=W_,exports.BadgeMolecule=A2e,exports.BaseMolecule=$Bt,exports.BaseTextButton=Sk,exports.BasicTextField=F2e,exports.BinaryRadioButtons=pat,exports.Button=L2e,exports.ButtonActionsContext=lS,exports.ButtonActionsProvider=function(t){var r,n,o,a=t.children,i=t.popupProps,s=KBt().localStateObject,l=JBt().stateConfig,c=s||l,u=e.useState({}),d=u[0],h=u[1],f=e.useState(!1),m=f[0],v=f[1],y=e.useState(!1),g=y[0],x=y[1],b=e.useState(null),k=b[0],_=b[1],w=pS().onStateChange,M=function(e){var t=null==i?void 0:i.find(function(t){return t.id===e});_(t||null),v(!0),w({id:e,type:"opened"})};e.useEffect(function(){null==i||i.forEach(function(e){var t;(null===(t=c[e.id])||void 0===t?void 0:t.visible)&&M(e.id)})},[c]);var C=function(e){_(null),v(!1),w({id:e,type:"closed"})},j=function(){x(!1)};Me(YBt,{item:d});var D=e.useMemo(function(){return{actionContent:d,setActionContent:h,isModalVisible:m,isDrawerVisible:g,setDrawerVisible:x,setActivePopUpById:M,onCloseDrawer:j,onCloseModal:C}},[d,h,m,g,x,M,j,C]),O=k||{},S=O.config,P=O.content;return Ce(lS.Provider,p({value:D},{children:[k&&m&&Ce(cat,p({size:null==S?void 0:S.size,open:m,onClose:function(){return C(k.id)},popupId:k.id,modalStyles:null==S?void 0:S.styles,withCloseIcon:null==S?void 0:S.withCloseIcon},{children:[null===(r=null==P?void 0:P.embedded)||void 0===r?void 0:r.map(function(e){var t;return Me(dS,p({initItems:null===(t=null==e?void 0:e.body)||void 0===t?void 0:t.items},{children:Me(YBt,{item:null==e?void 0:e.body},e.id)}))}),(null==P?void 0:P.isi)&&Me(YBt,{item:null===(o=null===(n=null==k?void 0:k.content)||void 0===n?void 0:n.isi)||void 0===o?void 0:o.body})]})),a]}))},exports.COMMUNICATION_LINK_DATA_TEXT=gVt,exports.COMMUNICATION_LINK_DATA_URL=yVt,exports.COMMUNICATION_LINK_ELEMENT_ID=mVt,exports.Checkbox=hat,exports.Checklist=a4e,exports.ChipMolecule=i4e,exports.Circle=zk,exports.CirclesWrapper=Rk,exports.CircularIndicator=function(e){var t=e.activeColor,r=e.inactiveColor,n=h(e,["activeColor","inactiveColor"]),o=(me()||Te).colors;return Me(Fk,p({},n,{activeColor:o[t]||t,inactiveColor:o[r]||r}))},exports.CircularIndicatorStyledComponent=Fk,exports.ConsentMolecule=s4e,exports.Container=bat,exports.ContainerWrapper=r4e,exports.ContentWrapper=function(t){var r=t.children,n=t.className,o=t.marginTop,a=void 0===o?"0px":o,i=t.marginLeft,s=void 0===i?"0px":i,l=t.marginRight,c=void 0===l?"0px":l,u=mat(),d=u.drawer,h=u.setDrawerContainerRef,f=e.useRef(null);e.useEffect(function(){return h&&h(f.current),function(){h&&h(null)}},[h]);var m=function(e){var t=parseFloat(e);return isNaN(t)?0:t},v=m(s),y="absolute"!==d.positionType&&"left"===d.position&&d.isOpen?"".concat(v+d.width,"px"):s,g=m(c),x="absolute"!==d.positionType&&"right"===d.position&&d.isOpen?"".concat(g+d.width,"px"):c;return Me(vat,p({ref:f,className:n,style:{marginTop:a,marginLeft:y,marginRight:x}},{children:r}))},exports.CustomValidation=d4e,exports.DatePickerMolecule=Gnt,exports.Divider=Xnt,exports.Drawer=xot,exports.ErrorText=function(e){var t=e.text;return Ce(we,{children:[Me(l4e,{height:"XS"}),Me(c4e,p({variant:"XS",color:"red"},{children:t}))]})},exports.FormOrganismItem=UBt,exports.FormStepContext=GN,exports.FormStepContextProvider=XN,exports.HorizontalButtons=function(e){var t=e.onClick,r=e.disabled,n=e.buttonOptions,o=e.selectedButtonId,a=e.error,i=(null==n?void 0:n.slice(0,2))||[];return Me(Lk,p({error:a,disabled:r},{children:i.map(function(e){var r=e.value,n=e.id;return Me(Bk,p({isActive:n===o,onClick:function(){return t(n)}},{children:r}),n)})}))},exports.HorizontalPadding=F_,exports.Icon=Ik,exports.IconButton=function(e){var t=e.name,r=e.color,n=e.onClick,o=e.disabled,a=e.activeOpacity,i=e.withoutOpacityEffect,s=h(e,["name","color","onClick","disabled","activeOpacity","withoutOpacityEffect"]),l=(me()||Te).colors;return Me(Tk,p({onClick:n,disabled:o,activeOpacity:a,withoutOpacityEffect:i},{children:Me(Ok[t],p({},s,{color:l[r]||r}))}))},exports.IconRenderer=N2e,exports.IconWrapper=dat,exports.Image=Qnt,exports.Input=function(t){var r=t.value,n=t.leftIcon,o=t.rightIcon,a=t.onChange,i=t.onBlur,s=t.disabled,l=t.isError,c=t.placeholder,u=t.isEditMode,d=void 0===u||u,f=t.type,m=void 0===f?"text":f,v=t.internalConfig,g=t.config,x=h(t,["value","leftIcon","rightIcon","onChange","onBlur","disabled","isError","placeholder","isEditMode","type","internalConfig","config"]),b=e.useState(!1),k=b[0],_=b[1],w=e.useRef(null),M=function(e){switch(e){case"text":return{type:"text",inputMode:"text"};case"phone_number":return{type:"tel",inputMode:"tel"};case"password":return{type:"password",inputMode:"text"};default:return{}}}(m),C=function(e,t){var r=(t||{}).maskPlaceholder;switch(e){case"month_year_date":return{keepCharPositions:!0,mask:j_,placeholder:r||"09/1970",pipe:Hk.exports.createAutoCorrectedDatePipe("mm/yyyy",P_)};case"day_month_year_date":return{keepCharPositions:!0,mask:C_,placeholder:r||"25/09/1970",pipe:Hk.exports.createAutoCorrectedDatePipe("dd/mm/yyyy",P_)};case"month_day_year_date":return{keepCharPositions:!0,mask:M_,placeholder:r||"09/25/1970",pipe:Hk.exports.createAutoCorrectedDatePipe("mm/dd/yyyy",P_)};case"year_month_day_date":return{keepCharPositions:!0,mask:w_,placeholder:r||"1970/09/25",pipe:Hk.exports.createAutoCorrectedDatePipe("yyyy/mm/dd",P_)};case"phone_number":return{keepCharPositions:!0,mask:D_,placeholder:r||"(555) 495-3947"};case"email":return{mask:k_,placeholder:r||"example@mail.com"};case"us_zip_code":return{keepCharPositions:!0,mask:__,placeholder:r||"12345"};case"integer":return{mask:O_,placeholder:r||"123"};case"numerical":return{mask:S_,placeholder:r||"123.45"};default:return{mask:!1}}}(m,g),j=me().colors,D=j[function(e){var t=e.isEditMode,r=e.isFocused,n=e.isError,o=e.disabled;return t?o?"gray3":n?"red":r?"gray1":"gray3":"gray1"}({isFocused:k,isError:l,disabled:s,isEditMode:d})],O=v||{},S=O.horizontalPadding,P=void 0===S?0:S,T=O.verticalPadding,E=void 0===T?0:T,N=O.placeholderTextColor,z=O.placeholderTextFontSize,A=O.textColor,R=O.textFontSize,F=O.styles,L=O.wrapperStyles,B=Ye(Uk||(Uk=y(["\n ",";\n ",";\n ",";\n &::placeholder {\n ",";\n ",";\n }\n ",";\n "],["\n ",";\n ",";\n ",";\n &::placeholder {\n ",";\n ",";\n }\n ",";\n "])),A?"color: ".concat(j[A]||A,";"):"",R?"font-size: ".concat(R,"px;"):"",P||E?"padding: ".concat(E,"px ").concat(P,"px;"):"",z?"font-size: ".concat(z,"px;"):"",N?"color: ".concat(j[N]||N,";"):"",F);return Ce(E_,p({withoutOpacityEffect:!0,disabled:!d||s,isEditMode:d,isFocused:k,isError:l,$styles:L,onClick:function(){var e;return null===(e=w.current)||void 0===e?void 0:e.inputElement.focus()}},{children:[!!n&&Me(A_,p({withoutOpacityEffect:!n.onClick,onClick:function(e){return T_(e,n.onClick)}},{children:Me(Ik,{name:n.name,color:D})})),Me(N_,p({id:"formatted-text-mask-input",value:r,$styles:B,onChange:function(e){return null==a?void 0:a(e.target.value)},onFocus:function(){return _(!0)},onBlur:function(){_(!1),null==i||i()},ref:w,isError:l,disabled:!d||s,placeholder:c,isEditMode:d,autoComplete:"off"},x,M,C)),!!o&&Me(R_,p({withoutOpacityEffect:!o.onClick,onClick:function(e){return T_(e,o.onClick)}},{children:Me(Ik,{name:o.name,color:D})}))]}))},exports.LayoutContext=fat,exports.LayoutProvider=function(t){var r=t.children,n=t.layoutPosition,o=void 0===n?"normal":n,a=t.drawerMaxWidthPercent,i=void 0===a?80:a,s=t.headerHeight,l=void 0===s?"0px":s,c=t.isMLR,u=void 0!==c&&c,d=t.isMobile,h=void 0!==d&&d,f=e.useState({width:0,position:"right",isOpen:!1,positionType:o}),m=f[0],v=f[1],y=e.useRef(null),g=e.useState(null),x=g[0],b=g[1],k=ok("xs"),_=h||k;e.useEffect(function(){v(function(e){return p(p({},e),{positionType:o})})},[o]),e.useEffect(function(){if(y.current){var e=function(){var e;if(m.isOpen){var t=(null===(e=y.current)||void 0===e?void 0:e.clientWidth)||0,r=Math.floor(t*(i/100));m.width>r&&v(function(e){return p(p({},e),{width:r})})}};e();var t=new ResizeObserver(function(){e()});return t.observe(y.current),function(){t&&t.disconnect()}}},[m.isOpen,m.width,i]);var w=e.useMemo(function(){return function(e){v(function(t){var r=void 0!==e.width?e.width:t.width;if(y.current&&(e.isOpen||t.isOpen)){var n=y.current.clientWidth,o=Math.floor(n*(i/100));r=Math.min(r,o)}var a=void 0!==e.positionType?e.positionType:t.positionType;return p(p(p({},t),e),{width:r,positionType:a})})}},[i]),M=e.useMemo(function(){return{drawer:m,updateDrawer:w,drawerContainerRef:x,setDrawerContainerRef:b,headerHeight:l,isMobile:_,isMLR:u}},[m,w,x,l,_,u]);return Me(fat.Provider,p({value:M},{children:Me("div",p({ref:y,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"}},{children:r}))}))},exports.Link=bot,exports.MATRIX_MESSAGE_DATA_ID=vVt,exports.MATRIX_MESSAGE_ELEMENT_ID=fVt,exports.MlrRichTextViewerContext=iS,exports.MlrRichTextViewerProvider=function(e){var t=e.children,r=e.isMLRReview,n=e.showAnnotations,o=e.annotationsList;return Me(iS.Provider,p({value:{isMLRReview:r,annotationsList:o,showAnnotations:n}},{children:t}))},exports.ModalWrapper=uat,exports.Organism=function(e){var t=e.organism;return Me(YBt,{item:sZt(t.body)})},exports.OrganismContext=cS,exports.OrganismContextProvider=dS,exports.OrganismItem=YBt,exports.PasswordSetup=Mot,exports.PdfDocument=function(t){var r=t.source,n=t.isMobile,a=void 0!==n&&n,i=t.customDocumentStyles,s=e.useState(0),l=s[0],c=s[1],u=e.useState(1),d=u[0],h=u[1],f=e.useState(null),m=f[0],v=f[1],y=i||{},g=y.pageWidth,x=void 0===g?a?342:856:g,b=y.pageHeight,k=m!==d;return Me(Rot,p({pageWidth:x,pageHeight:void 0===b?a?442:1108:b},{children:Ce(Fot,p({customDocumentStyles:i},{children:[Ce(o.Document,p({file:r,renderMode:"canvas",className:"document",onLoadSuccess:function(e){var t=e.numPages;c(t)},loading:Me(kh,{size:60})},{children:[k&&m?Me(o.Page,{pageNumber:m,renderTextLayer:!1,className:"custom-pdf"},m):null,Me(o.Page,{pageNumber:d,renderTextLayer:!1,className:"".concat(k?"loadingPage":"custom-pdf"),onRenderSuccess:function(){return v(d)}},d)]})),Ce(Lot,{children:[Me(Bot,p({disable:d<=1,onClick:function(){return h(function(e){return e+(e<=1?0:-1)})},customDocumentStyles:i},{children:Me(Ik,{name:"CaretLeft",size:33})})),Me(Vot,{type:"number",size:"small",customDocumentStyles:i,onChange:function(e){var t=e.target.value,r=e.nativeEvent;return function(e,t){if(!Number.isNaN(e)){var r=Math.round(e);r>l?!Number.isNaN(t)&&t>0&&t<=l&&h(t):r<1||h(r)}}(+t,+((null==r?void 0:r.data)||""))},value:d}),Me(Bot,p({disabled:!0},{children:Me(Iot,{})})),Me(c4e,p({variant:"S",color:(null==i?void 0:i.pageNumberColor)||"white"},{children:l})),Me(Bot,p({disable:d>=l,onClick:function(){return h(function(e){return e+(e>=l?0:1)})},customDocumentStyles:i},{children:Me(Ik,{name:"CaretRight"})}))]})]}))}))},exports.RadioButtons=function(e){var t=e.ref,r=e.name,n=e.value,o=e.options,a=e.onBlur,i=e.onChange,s=e.isRow,l=void 0!==s&&s,c=e.isError,u=void 0!==c&&c,d=e.disabled,h=void 0!==d&&d,f=e.isEditMode,m=void 0===f||f,v=e.isRichText,y=void 0!==v&&v,g=e.internalConfig,x=B_({internalConfig:g}).groupWrapperStyles;return Me($_,p({ref:t,row:l,$isRow:l,name:r,value:n,onBlur:a,onChange:function(e){m&&(null==i||i(e.target.value))},$styles:x},{children:null==o?void 0:o.map(function(e){return Me(q_,{option:e,isError:u,disabled:h,isRichText:y,isEditMode:m,internalConfig:g},e.id)})}))},exports.RadioGroupWrapper=$_,exports.RatingMolecule=qot,exports.RegularImage=H_,exports.RichTextViewer=bVt,exports.Select=function(t){var r=t.ref,n=t.onBlur,o=t.onChange,a=t.value,i=t.placeholder,s=t.options,l=void 0===s?[]:s,c=t.disabled,u=void 0!==c&&c,d=t.optionsPresentation,h=void 0!==d&&d,f=t.isError,m=t.isEditMode,v=void 0===m||m,y=t.selectInternalConfig,g=t.isRichText,x=void 0!==g&&g,b=e.useState(h),k=b[0],_=b[1],w=e.useState(a),M=w[0],C=w[1],j=null==l?void 0:l.find(function(e){return e.id===M});e.useEffect(function(){var e=function(){return!h&&_(!1)};return window.addEventListener("click",e),function(){return window.removeEventListener("click",e)}}),e.useEffect(function(){return _(h)},[h]),e.useEffect(function(){return C(a)},[a]);var D=function(e){return e===M};return Me(kVt,p({ref:r,tabIndex:0,onBlur:n,disabled:u,isEditMode:v,hasValue:!!j,isOpen:k,hasError:!!f,$styles:MVt(y,!!j)},{children:Ce("div",p({className:"select-wrapper"},{children:[Ce("div",p({className:"select-input",onClick:function(e){h||(e.stopPropagation(),_(function(e){return!e}))}},{children:[j?x?Me(bVt,{numberOfLines:1,value:j.label}):Me(c4e,p({numberOfLines:1,variant:"M",color:"gray1"},{children:j.label})):Me(c4e,p({numberOfLines:1,variant:"M",color:"gray3"},{children:i})),v&&Me("div",p({className:"icon-container"},{children:Me(Ik,{name:"CaretDown"})}))]})),k&&v&&Me(_Vt,{children:l.map(function(e){var t,r=e.id,n=e.label;return Me(wVt,p({$selected:D(r),onClick:function(){return function(e){C(e),null==o||o(e)}(r)}},{children:x?(t=JSON.parse(n),t.map(function(e){return $M.string(e)}).join("\n")):n}),r)})})]}))}))},exports.SelectMolecule=Hot,exports.SliderMolecule=eat,exports.Spacer=l4e,exports.SpeedDial=yat,exports.Spinner=jVt,exports.StateContext=QBt,exports.StateContextProvider=function(t){var r=t.initStateConfig,n=t.children,o=t.stateHandler,a=t.authenticated,i=e.useMemo(function(){return{stateConfig:r,stateHandler:o,authenticated:a}},[r,o,a]);return Me(QBt.Provider,p({value:i},{children:n}))},exports.Stepper=tat,exports.StyleWrapper=nZt,exports.SwitchMolecule=nat,exports.TextButton=Pk,exports.TextMolecule=eot,exports.TextWrapper=c4e,exports.TimePickerMolecule=aat,exports.Tooltip=function(t){var r=t.trigger,n=void 0===r?"hover":r,o=t.placement,a=void 0===o?"top":o,i=t.styles,s=h(t,["trigger","placement","styles"]),l=e.useRef(null);return Me(nZt,p({ref:l,$styles:i},{children:Me(rZt,p({},s,{getTooltipContainer:function(){return l.current},trigger:n,placement:a}))}))},exports.TouchableOpacity=Tk,exports.ValidationTag=aZt,exports.VerticalPadding=L_,exports.Video=iat,exports.ZealThemeProvider=function(e){return Me(wt,p({injectFirst:!0},{children:Me(ye,p({theme:p(p({},nk),e.theme)},{children:Ce(Vi,p({theme:p(p({},nk),e.theme)},{children:[Me(Oh,{}),Me(Ue,{styles:rk}),e.children]}))}))}))},exports.ZealUIModal=cat,exports.defaultTheme=Te,exports.fontWeight=[100,200,300,400,500,600,700,800,900],exports.fonts=["3XL","2XL","XL","L","M","S","XS"],exports.passwordValidationMapper=kot,exports.richTextDefaultValue=xVt,exports.seoTags=["h1","h2","h3","h4","h5","h6"],exports.sizings=["5XL","4XL","3XL","2XL","XL","L","M","S","XS",0],exports.toast=gqt,exports.toastStyles=tk,exports.useAccountButtonContext=function(){return e.useContext(GBt)},exports.useApi=nVt,exports.useButtonActionsContext=ZBt,exports.useFormStepContext=eVt,exports.useLayoutContext=mat,exports.useMediaQuery=ok,exports.useMlrRichTextViewerContext=sS,exports.useOrganismContext=KBt,exports.useStateContext=JBt;
9576
9576
  //# sourceMappingURL=index.js.map