@3sc/common-component 0.0.283 → 0.0.284
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/index.es.js +2 -2
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -299,7 +299,7 @@ const theme2 = createTheme({ palette: {
|
|
|
299
299
|
${p}px !important;
|
|
300
300
|
top: ${u}px !important;
|
|
301
301
|
}
|
|
302
|
-
`),()=>{document.head.removeChild(h)}},[t]),g.jsx(K5,{isPresent:t,childRef:o,sizeRef:i,children:S.cloneElement(e,{ref:o})})}const Z5=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:a,anchorX:l})=>{const c=Cd(J5),u=R.useId(),d=R.useCallback(p=>{c.set(p,!0);for(const h of c.values())if(!h)return;r&&r()},[c,r]),f=R.useMemo(()=>({id:u,initial:t,isPresent:n,custom:o,onExitComplete:d,register:p=>(c.set(p,!1),()=>c.delete(p))}),i?[Math.random(),d]:[n,d]);return R.useMemo(()=>{c.forEach((p,h)=>c.set(h,!1))},[n]),S.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),a==="popLayout"&&(e=g.jsx(X5,{isPresent:n,anchorX:l,children:e})),g.jsx(Ll.Provider,{value:f,children:e})};function J5(){return new Map}function ey(e=!0){const t=R.useContext(Ll);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=R.useId();R.useEffect(()=>{if(e)return o(i)},[e]);const a=R.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const Vl=e=>e.key||"";function ty(e){const t=[];return R.Children.forEach(e,n=>{R.isValidElement(n)&&t.push(n)}),t}const Q5=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:a=!1,anchorX:l="left"})=>{const[c,u]=ey(a),d=R.useMemo(()=>ty(e),[e]),f=a&&!c?[]:d.map(Vl),p=R.useRef(!0),h=R.useRef(d),y=Cd(()=>new Map),[m,b]=R.useState(d),[x,w]=R.useState(d);Qg(()=>{p.current=!1,h.current=d;for(let v=0;v<x.length;v++){const k=Vl(x[v]);f.includes(k)?y.delete(k):y.get(k)!==!0&&y.set(k,!1)}},[x,f.length,f.join("-")]);const C=[];if(d!==m){let v=[...d];for(let k=0;k<x.length;k++){const E=x[k],M=Vl(E);f.includes(M)||(v.splice(k,0,E),C.push(E))}return i==="wait"&&C.length&&(v=C),w(ty(v)),b(d),null}process.env.NODE_ENV!=="production"&&i==="wait"&&x.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:O}=R.useContext(wd);return g.jsx(g.Fragment,{children:x.map(v=>{const k=Vl(v),E=a&&!c?!1:d===x||f.includes(k),M=()=>{if(y.has(k))y.set(k,!0);else return;let D=!0;y.forEach(A=>{A||(D=!1)}),D&&(O==null||O(),w(h.current),a&&(u==null||u()),r&&r())};return g.jsx(Z5,{isPresent:E,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,onExitComplete:E?void 0:M,anchorX:l,children:v},k)})})};function Od(e,t){e.indexOf(t)===-1&&e.push(t)}function kd(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let us=()=>{},Vr=()=>{};process.env.NODE_ENV!=="production"&&(us=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Vr=(e,t)=>{if(!e)throw new Error(t)});const Ed={useManualTiming:!1};function Pd(e){let t;return()=>(t===void 0&&(t=e()),t)}const Bn=e=>e,Ei=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Md{constructor(){this.subscriptions=[]}add(t){return Od(this.subscriptions,t),()=>kd(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i<o;i++){const a=this.subscriptions[i];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const qn=e=>e*1e3,ir=e=>e/1e3;function ny(e,t){return t?e*(1e3/t):0}const ry=new Set;function Wl(e,t,n){e||ry.has(t)||(console.warn(t),ry.add(t))}const eI=Pd(()=>window.ScrollTimeline!==void 0);class tI{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(o=>{if(eI()&&o.attachTimeline)return o.attachTimeline(t);if(typeof n=="function")return n(o)});return()=>{r.forEach((o,i)=>{o&&o(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class nI extends tI{then(t,n){return this.finished.finally(t).then(()=>{})}}const oy={value:null},Rd=e=>Array.isArray(e)&&typeof e[0]=="number",rI={};function oI(e,t){const n=Pd(e);return()=>rI[t]??n()}const Pi=oI(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),sy=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=e(i/(o-1))+", ";return`linear(${r.substring(0,r.length-2)})`},Mi=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Dd={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Mi([0,.65,.55,1]),circOut:Mi([.55,0,1,.45]),backIn:Mi([.31,.01,.66,-.59]),backOut:Mi([.33,1.53,.69,.99])};function iy(e,t){if(e)return typeof e=="function"&&Pi()?sy(e,t):Rd(e)?Mi(e):Array.isArray(e)?e.map(n=>iy(n,t)||Dd.easeOut):Dd[e]}function sI(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:a="loop",ease:l="easeInOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const f=iy(l,o);return Array.isArray(f)&&(d.easing=f),e.animate(d,{delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal",pseudoElement:u})}function Id(e){return typeof e=="function"&&"applyToOptions"in e}function Ad(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const zl=2e4;function jd(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<zl;)t+=n,r=e.next(t);return t>=zl?1/0:t}function iI(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(jd(r),zl);return{type:"keyframes",ease:i=>r.next(o*i).value/t,duration:ir(o)}}function ay(e){return!!(typeof e=="function"&&Pi()||!e||typeof e=="string"&&(e in Dd||Pi())||Rd(e)||Array.isArray(e)&&e.every(ay))}function ly(e,t){e.timeline=t,e.onfinish=null}const Ul=["read","resolveKeyframes","update","preRender","render","postRender"];function aI(e,t){let n=new Set,r=new Set,o=!1,i=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function u(f){a.has(f)&&(d.schedule(f),e()),c++,f(l)}const d={schedule:(f,p=!1,h=!1)=>{const m=h&&o?n:r;return p&&a.add(f),m.has(f)||m.add(f),f},cancel:f=>{r.delete(f),a.delete(f)},process:f=>{if(l=f,o){i=!0;return}o=!0,[n,r]=[r,n],n.forEach(u),t&&oy.value&&oy.value.frameloop[t].push(c),c=0,n.clear(),o=!1,i&&(i=!1,d.process(f))}};return d}const lI=40;function cy(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Ul.reduce((x,w)=>(x[w]=aI(i,t?w:void 0),x),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:p}=a,h=()=>{const x=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(x-o.timestamp,lI),1),o.timestamp=x,o.isProcessing=!0,l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),p.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))},y=()=>{n=!0,r=!0,o.isProcessing||e(h)};return{schedule:Ul.reduce((x,w)=>{const C=a[w];return x[w]=(O,v=!1,k=!1)=>(n||y(),C.schedule(O,v,k)),x},{}),cancel:x=>{for(let w=0;w<Ul.length;w++)a[Ul[w]].cancel(x)},state:o,steps:a}}const{schedule:Nd}=cy(queueMicrotask,!1),{schedule:wt,cancel:Wr,state:qt,steps:$d}=cy(typeof requestAnimationFrame<"u"?requestAnimationFrame:Bn,!0);let Hl;function cI(){Hl=void 0}const ar={now:()=>(Hl===void 0&&ar.set(qt.isProcessing||Ed.useManualTiming?qt.timestamp:performance.now()),Hl),set:e=>{Hl=e,queueMicrotask(cI)}},Yn={x:!1,y:!1};function uy(){return Yn.x||Yn.y}function uI(e){return e==="x"||e==="y"?Yn[e]?null:(Yn[e]=!0,()=>{Yn[e]=!1}):Yn.x||Yn.y?null:(Yn.x=Yn.y=!0,()=>{Yn.x=Yn.y=!1})}function dI(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function dy(e,t){const n=dI(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function fy(e){return!(e.pointerType==="touch"||uy())}function fI(e,t,n={}){const[r,o,i]=dy(e,n),a=l=>{if(!fy(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=f=>{fy(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,o)};return r.forEach(l=>{l.addEventListener("pointerenter",a,o)}),i}const py=(e,t)=>t?e===t?!0:py(e,t.parentElement):!1,_d=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,pI=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function hI(e){return pI.has(e.tagName)||e.tabIndex!==-1}const Ri=new WeakSet;function hy(e){return t=>{t.key==="Enter"&&e(t)}}function Fd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const mI=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=hy(()=>{if(Ri.has(n))return;Fd(n,"down");const o=hy(()=>{Fd(n,"up")}),i=()=>Fd(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function my(e){return _d(e)&&!uy()}function gI(e,t,n={}){const[r,o,i]=dy(e,n),a=l=>{const c=l.currentTarget;if(!my(l)||Ri.has(c))return;Ri.add(c);const u=t(c,l),d=(h,y)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",p),!(!my(h)||!Ri.has(c))&&(Ri.delete(c),typeof u=="function"&&u(h,{success:y}))},f=h=>{d(h,c===window||c===document||n.useGlobalTarget||py(c,h.target))},p=h=>{d(h,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",p,o)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,o),l instanceof HTMLElement&&(l.addEventListener("focus",u=>mI(u,o)),!hI(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}const gy=30,yI=e=>!isNaN(parseFloat(e));class bI{constructor(t,n={}){this.version="12.7.3",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{const i=ar.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ar.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=yI(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Wl(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Md);const r=this.events[t].add(n);return t==="change"?()=>{r(),wt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ar.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>gy)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,gy);return ny(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Di(e,t){return new bI(e,t)}const yy=R.createContext({strict:!1}),by={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"]},ds={};for(const e in by)ds[e]={isEnabled:t=>by[e].some(n=>!!t[n])};function vI(e){for(const t in e)ds[t]={...ds[t],...e[t]}}const xI=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 ql(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||xI.has(e)}let vy=e=>!ql(e);function wI(e){e&&(vy=t=>t.startsWith("on")?!ql(t):e(t))}try{wI(require("@emotion/is-prop-valid").default)}catch{}function CI(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(vy(o)||n===!0&&ql(o)||!t&&!ql(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function SI(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Wl(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}const Yl=R.createContext({});function Gl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ii(e){return typeof e=="string"||Array.isArray(e)}const Bd=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ld=["initial",...Bd];function Kl(e){return Gl(e.animate)||Ld.some(t=>Ii(e[t]))}function xy(e){return!!(Kl(e)||e.variants)}function TI(e,t){if(Kl(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ii(n)?n:void 0,animate:Ii(r)?r:void 0}}return e.inherit!==!1?t:{}}function OI(e){const{initial:t,animate:n}=TI(e,R.useContext(Yl));return R.useMemo(()=>({initial:t,animate:n}),[wy(t),wy(n)])}function wy(e){return Array.isArray(e)?e.join(" "):e}const kI=Symbol.for("motionComponentSymbol");function fs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function EI(e,t,n){return R.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):fs(n)&&(n.current=r))},[t])}const Vd=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Cy="data-"+Vd("framerAppearId"),Sy=R.createContext({});function PI(e,t,n,r,o){var m,b;const{visualElement:i}=R.useContext(Yl),a=R.useContext(yy),l=R.useContext(Ll),c=R.useContext(Td).reducedMotion,u=R.useRef(null);r=r||a.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,f=R.useContext(Sy);d&&!d.projection&&o&&(d.type==="html"||d.type==="svg")&&MI(u.current,n,o,f);const p=R.useRef(!1);R.useInsertionEffect(()=>{d&&p.current&&d.update(n,l)});const h=n[Cy],y=R.useRef(!!h&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,h))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,h)));return Qg(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),Nd.render(d.render),y.current&&d.animationState&&d.animationState.animateChanges())}),R.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)==null||x.call(window,h)}),y.current=!1))}),d}function MI(e,t,n,r){const{layoutId:o,layout:i,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ty(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!a||l&&fs(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function Ty(e){if(e)return e.options.allowProjection!==!1?e.projection:Ty(e.parent)}function RI({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&vI(e);function i(l,c){let u;const d={...R.useContext(Td),...l,layoutId:DI(l)},{isStatic:f}=d,p=OI(l),h=r(l,f);if(!f&&Sd){II(d,e);const y=AI(d);u=y.MeasureLayout,p.visualElement=PI(o,h,d,t,y.ProjectionNode)}return g.jsxs(Yl.Provider,{value:p,children:[u&&p.visualElement?g.jsx(u,{visualElement:p.visualElement,...d}):null,n(o,l,EI(h,p.visualElement,c),h,f,p.visualElement)]})}i.displayName=`motion.${typeof o=="string"?o:`create(${o.displayName??o.name??""})`}`;const a=R.forwardRef(i);return a[kI]=o,a}function DI({layoutId:e}){const t=R.useContext(wd).id;return t&&e!==void 0?t+"-"+e:e}function II(e,t){const n=R.useContext(yy).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?us(!1,r):Vr(!1,r)}}function AI(e){const{drag:t,layout:n}=ds;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Oy=e=>t=>typeof t=="string"&&t.startsWith(e),Wd=Oy("--"),jI=Oy("var(--"),zd=e=>jI(e)?NI.test(e.split("/*")[0].trim()):!1,NI=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ai={};function $I(e){for(const t in e)Ai[t]=e[t],Wd(t)&&(Ai[t].isCSSVariable=!0)}const ps=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],lo=new Set(ps);function ky(e,{layout:t,layoutId:n}){return lo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ai[e]||e==="opacity")}const Xt=e=>!!(e&&e.getVelocity),Ey=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Or=(e,t,n)=>n>t?t:n<e?e:n,hs={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ji={...hs,transform:e=>Or(0,1,e)},Xl={...hs,default:1},Ni=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),zr=Ni("deg"),lr=Ni("%"),_e=Ni("px"),_I=Ni("vh"),FI=Ni("vw"),Py={...lr,parse:e=>lr.parse(e)/100,transform:e=>lr.transform(e*100)},BI={borderWidth:_e,borderTopWidth:_e,borderRightWidth:_e,borderBottomWidth:_e,borderLeftWidth:_e,borderRadius:_e,radius:_e,borderTopLeftRadius:_e,borderTopRightRadius:_e,borderBottomRightRadius:_e,borderBottomLeftRadius:_e,width:_e,maxWidth:_e,height:_e,maxHeight:_e,top:_e,right:_e,bottom:_e,left:_e,padding:_e,paddingTop:_e,paddingRight:_e,paddingBottom:_e,paddingLeft:_e,margin:_e,marginTop:_e,marginRight:_e,marginBottom:_e,marginLeft:_e,backgroundPositionX:_e,backgroundPositionY:_e},LI={rotate:zr,rotateX:zr,rotateY:zr,rotateZ:zr,scale:Xl,scaleX:Xl,scaleY:Xl,scaleZ:Xl,skew:zr,skewX:zr,skewY:zr,distance:_e,translateX:_e,translateY:_e,translateZ:_e,x:_e,y:_e,z:_e,perspective:_e,transformPerspective:_e,opacity:ji,originX:Py,originY:Py,originZ:_e},My={...hs,transform:Math.round},Ud={...BI,...LI,zIndex:My,size:_e,fillOpacity:ji,strokeOpacity:ji,numOctaves:My},VI={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},WI=ps.length;function zI(e,t,n){let r="",o=!0;for(let i=0;i<WI;i++){const a=ps[i],l=e[a];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(a.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=Ey(l,Ud[a]);if(!c){o=!1;const d=VI[a]||a;r+=`${d}(${u}) `}n&&(t[a]=u)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function Hd(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let a=!1,l=!1;for(const c in t){const u=t[c];if(lo.has(c)){a=!0;continue}else if(Wd(c)){o[c]=u;continue}else{const d=Ey(u,Ud[c]);c.startsWith("origin")?(l=!0,i[c]=d):r[c]=d}}if(t.transform||(a||n?r.transform=zI(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=i;r.transformOrigin=`${c} ${u} ${d}`}}const qd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ry(e,t,n){for(const r in t)!Xt(t[r])&&!ky(r,n)&&(e[r]=t[r])}function UI({transformTemplate:e},t){return R.useMemo(()=>{const n=qd();return Hd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function HI(e,t){const n=e.style||{},r={};return Ry(r,n,e),Object.assign(r,UI(e,t)),r}function qI(e,t){const n={},r=HI(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const YI=["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 Yd(e){return typeof e!="string"||e.includes("-")?!1:!!(YI.indexOf(e)>-1||/[A-Z]/u.test(e))}const GI={offset:"stroke-dashoffset",array:"stroke-dasharray"},KI={offset:"strokeDashoffset",array:"strokeDasharray"};function XI(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?GI:KI;e[i.offset]=_e.transform(-r);const a=_e.transform(t),l=_e.transform(n);e[i.array]=`${a} ${l}`}function Dy(e,t,n){return typeof e=="string"?e:_e.transform(t+n*e)}function ZI(e,t,n){const r=Dy(t,e.x,e.width),o=Dy(n,e.y,e.height);return`${r} ${o}`}function Gd(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:a,pathSpacing:l=1,pathOffset:c=0,...u},d,f){if(Hd(e,u,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:h,dimensions:y}=e;p.transform&&(y&&(h.transform=p.transform),delete p.transform),y&&(o!==void 0||i!==void 0||h.transform)&&(h.transformOrigin=ZI(y,o!==void 0?o:.5,i!==void 0?i:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),a!==void 0&&XI(p,a,l,c,!1)}const Iy=()=>({...qd(),attrs:{}}),Kd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function JI(e,t,n,r){const o=R.useMemo(()=>{const i=Iy();return Gd(i,t,Kd(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Ry(i,e.style,e),o.style={...i,...o.style}}return o}function QI(e=!1){return(n,r,o,{latestValues:i},a)=>{const c=(Yd(n)?JI:qI)(r,i,a,n),u=CI(r,typeof n=="string",e),d=n!==R.Fragment?{...u,...c,ref:o}:{},{children:f}=r,p=R.useMemo(()=>Xt(f)?f.get():f,[f]);return R.createElement(n,{...d,children:p})}}function Ay(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Xd(e,t,n,r){if(typeof t=="function"){const[o,i]=Ay(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=Ay(r);t=t(n!==void 0?n:e.custom,o,i)}return t}const Zd=e=>Array.isArray(e),eA=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),tA=e=>Zd(e)?e[e.length-1]||0:e;function Zl(e){const t=Xt(e)?e.get():e;return eA(t)?t.toValue():t}function nA({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,i){const a={latestValues:rA(r,o,i,e),renderState:t()};return n&&(a.onMount=l=>n({props:r,current:l,...a}),a.onUpdate=l=>n(l)),a}const jy=e=>(t,n)=>{const r=R.useContext(Yl),o=R.useContext(Ll),i=()=>nA(e,t,r,o);return n?i():Cd(i)};function rA(e,t,n,r){const o={},i=r(e,{});for(const p in i)o[p]=Zl(i[p]);let{initial:a,animate:l}=e;const c=Kl(e),u=xy(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!Gl(f)){const p=Array.isArray(f)?f:[f];for(let h=0;h<p.length;h++){const y=Xd(e,p[h]);if(y){const{transitionEnd:m,transition:b,...x}=y;for(const w in x){let C=x[w];if(Array.isArray(C)){const O=d?C.length-1:0;C=C[O]}C!==null&&(o[w]=C)}for(const w in m)o[w]=m[w]}}}return o}function Jd(e,t,n){var i;const{style:r}=e,o={};for(const a in r)(Xt(r[a])||t.style&&Xt(t.style[a])||ky(a,e)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(o[a]=r[a]);return o}const oA={useVisualState:jy({scrapeMotionValuesFromProps:Jd,createRenderState:qd})};function Ny(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function $y(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const _y=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 Fy(e,t,n,r){$y(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(_y.has(o)?o:Vd(o),t.attrs[o])}function By(e,t,n){const r=Jd(e,t,n);for(const o in e)if(Xt(e[o])||Xt(t[o])){const i=ps.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const Ly=["x","y","width","height","cx","cy","r"],sA={useVisualState:jy({scrapeMotionValuesFromProps:By,createRenderState:Iy,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in o)if(lo.has(l)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let l=0;l<Ly.length;l++){const c=Ly[l];e[c]!==t[c]&&(a=!0)}a&&wt.read(()=>{Ny(n,r),wt.render(()=>{Gd(r,o,Kd(n.tagName),e.transformTemplate),Fy(n,r)})})}})};function iA(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){const a={...Yd(r)?sA:oA,preloadedFeatures:e,useRender:QI(o),createVisualElement:t,Component:r};return RI(a)}}function $i(e,t,n){const r=e.getProps();return Xd(r,t,n!==void 0?n:r.custom,e)}const Vy=new Set(["width","height","top","left","right","bottom",...ps]);function aA(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Di(n))}function lA(e,t){const n=$i(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const a in i){const l=tA(i[a]);aA(e,a,l)}}function cA(e){return!!(Xt(e)&&e.add)}function Qd(e,t){const n=e.getValue("willChange");if(cA(n))return n.add(t);if(!n&&Ed.WillChange){const r=new Ed.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Wy(e){return e.props[Cy]}const zy=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,uA=1e-7,dA=12;function fA(e,t,n,r,o){let i,a,l=0;do a=t+(n-t)/2,i=zy(a,r,o)-e,i>0?n=a:t=a;while(Math.abs(i)>uA&&++l<dA);return a}function _i(e,t,n,r){if(e===t&&n===r)return Bn;const o=i=>fA(i,0,1,e,n);return i=>i===0||i===1?i:zy(o(i),t,r)}const Uy=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Hy=e=>t=>1-e(1-t),qy=_i(.33,1.53,.69,.99),ef=Hy(qy),Yy=Uy(ef),Gy=e=>(e*=2)<1?.5*ef(e):.5*(2-Math.pow(2,-10*(e-1))),tf=e=>1-Math.sin(Math.acos(e)),Ky=Hy(tf),Xy=Uy(tf),Zy=e=>/^0[^.\s]+$/u.test(e);function pA(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Zy(e):!0}const Fi=e=>Math.round(e*1e5)/1e5,nf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function hA(e){return e==null}const mA=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rf=(e,t)=>n=>!!(typeof n=="string"&&mA.test(n)&&n.startsWith(e)||t&&!hA(n)&&Object.prototype.hasOwnProperty.call(n,t)),Jy=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,i,a,l]=r.match(nf);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},gA=e=>Or(0,255,e),of={...hs,transform:e=>Math.round(gA(e))},co={test:rf("rgb","red"),parse:Jy("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+of.transform(e)+", "+of.transform(t)+", "+of.transform(n)+", "+Fi(ji.transform(r))+")"};function yA(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const sf={test:rf("#"),parse:yA,transform:co.transform},ms={test:rf("hsl","hue"),parse:Jy("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+lr.transform(Fi(t))+", "+lr.transform(Fi(n))+", "+Fi(ji.transform(r))+")"},Zt={test:e=>co.test(e)||sf.test(e)||ms.test(e),parse:e=>co.test(e)?co.parse(e):ms.test(e)?ms.parse(e):sf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?co.transform(e):ms.transform(e)},bA=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function vA(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(nf))==null?void 0:t.length)||0)+(((n=e.match(bA))==null?void 0:n.length)||0)>0}const Qy="number",eb="color",xA="var",wA="var(",tb="${}",CA=/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 Bi(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const l=t.replace(CA,c=>(Zt.test(c)?(r.color.push(i),o.push(eb),n.push(Zt.parse(c))):c.startsWith(wA)?(r.var.push(i),o.push(xA),n.push(c)):(r.number.push(i),o.push(Qy),n.push(parseFloat(c))),++i,tb)).split(tb);return{values:n,split:l,indexes:r,types:o}}function nb(e){return Bi(e).values}function rb(e){const{split:t,types:n}=Bi(e),r=t.length;return o=>{let i="";for(let a=0;a<r;a++)if(i+=t[a],o[a]!==void 0){const l=n[a];l===Qy?i+=Fi(o[a]):l===eb?i+=Zt.transform(o[a]):i+=o[a]}return i}}const SA=e=>typeof e=="number"?0:e;function TA(e){const t=nb(e);return rb(e)(t.map(SA))}const Ur={test:vA,parse:nb,createTransformer:rb,getAnimatableNone:TA},OA=new Set(["brightness","contrast","saturate","opacity"]);function kA(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(nf)||[];if(!r)return e;const o=n.replace(r,"");let i=OA.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const EA=/\b([a-z-]*)\(.*?\)/gu,af={...Ur,getAnimatableNone:e=>{const t=e.match(EA);return t?t.map(kA).join(" "):e}},PA={...Ud,color:Zt,backgroundColor:Zt,outlineColor:Zt,fill:Zt,stroke:Zt,borderColor:Zt,borderTopColor:Zt,borderRightColor:Zt,borderBottomColor:Zt,borderLeftColor:Zt,filter:af,WebkitFilter:af},ob=e=>PA[e];function sb(e,t){let n=ob(e);return n!==af&&(n=Ur),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const MA=new Set(["auto","none","0"]);function RA(e,t,n){let r=0,o;for(;r<e.length&&!o;){const i=e[r];typeof i=="string"&&!MA.has(i)&&Bi(i).values.length&&(o=e[r]),r++}if(o&&n)for(const i of t)e[i]=sb(n,o)}const uo=e=>e*180/Math.PI,lf=e=>{const t=uo(Math.atan2(e[1],e[0]));return cf(t)},DA={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:lf,rotateZ:lf,skewX:e=>uo(Math.atan(e[1])),skewY:e=>uo(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},cf=e=>(e=e%360,e<0&&(e+=360),e),ib=lf,ab=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),lb=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),IA={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ab,scaleY:lb,scale:e=>(ab(e)+lb(e))/2,rotateX:e=>cf(uo(Math.atan2(e[6],e[5]))),rotateY:e=>cf(uo(Math.atan2(-e[2],e[0]))),rotateZ:ib,rotate:ib,skewX:e=>uo(Math.atan(e[4])),skewY:e=>uo(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function cb(e){return e.includes("scale")?1:0}function uf(e,t){if(!e||e==="none")return cb(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=IA,o=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=DA,o=l}if(!o)return cb(t);const i=r[t],a=o[1].split(",").map(jA);return typeof i=="function"?i(a):a[i]}const AA=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return uf(n,t)};function jA(e){return parseFloat(e.trim())}const ub=e=>e===hs||e===_e,NA=new Set(["x","y","z"]),$A=ps.filter(e=>!NA.has(e));function _A(e){const t=[];return $A.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const gs={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>uf(t,"x"),y:(e,{transform:t})=>uf(t,"y")};gs.translateX=gs.x,gs.translateY=gs.y;const fo=new Set;let df=!1,ff=!1;function db(){if(ff){const e=Array.from(fo).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=_A(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([i,a])=>{var l;(l=r.getValue(i))==null||l.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ff=!1,df=!1,fo.forEach(e=>e.complete()),fo.clear()}function fb(){fo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ff=!0)})}function FA(){fb(),db()}class pf{constructor(t,n,r,o,i,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=i,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(fo.add(this),df||(df=!0,wt.read(fb),wt.resolveKeyframes(db))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const a=o==null?void 0:o.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),o&&a===void 0&&o.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),fo.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,fo.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const pb=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),BA=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function LA(e){const t=BA.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const VA=4;function hb(e,t,n=1){Vr(n<=VA,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=LA(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return pb(a)?parseFloat(a):a}return zd(o)?hb(o,t,n+1):o}const mb=e=>t=>t.test(e),gb=[hs,_e,lr,zr,FI,_I,{test:e=>e==="auto",parse:e=>e}],yb=e=>gb.find(mb(e));class bb extends pf{constructor(t,n,r,o,i){super(t,n,r,o,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),zd(u))){const d=hb(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Vy.has(r)||t.length!==2)return;const[o,i]=t,a=yb(o),l=yb(i);if(a!==l)if(ub(a)&&ub(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)pA(t[o])&&r.push(o);r.length&&RA(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=gs[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,a=r[i];r[i]=gs[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const vb=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ur.test(e)||e==="0")&&!e.startsWith("url("));function WA(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function zA(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],a=vb(o,t),l=vb(i,t);return us(a===l,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!a||!l?!1:WA(e)||(n==="spring"||Id(n))&&r}const UA=e=>e!==null;function Jl(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(UA),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return!i||r===void 0?o[i]:r}const HA=40;class xb{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ar.now(),this.options={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:i,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>HA?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&FA(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=ar.now(),this.hasAttemptedResolve=!0;const{name:r,type:o,velocity:i,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!zA(t,r,o,i))if(a)this.options.duration=0;else{c&&c(Jl(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Et=(e,t,n)=>e+(t-e)*n;function hf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function qA({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,a=0;if(!t)o=i=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;o=hf(c,l,e+1/3),i=hf(c,l,e),a=hf(c,l,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function Ql(e,t){return n=>n>0?t:e}const mf=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},YA=[sf,co,ms],GA=e=>YA.find(t=>t.test(e));function wb(e){const t=GA(e);if(us(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===ms&&(n=qA(n)),n}const Cb=(e,t)=>{const n=wb(e),r=wb(t);if(!n||!r)return Ql(e,t);const o={...n};return i=>(o.red=mf(n.red,r.red,i),o.green=mf(n.green,r.green,i),o.blue=mf(n.blue,r.blue,i),o.alpha=Et(n.alpha,r.alpha,i),co.transform(o))},KA=(e,t)=>n=>t(e(n)),Li=(...e)=>e.reduce(KA),gf=new Set(["none","hidden"]);function XA(e,t){return gf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ZA(e,t){return n=>Et(e,t,n)}function yf(e){return typeof e=="number"?ZA:typeof e=="string"?zd(e)?Ql:Zt.test(e)?Cb:ej:Array.isArray(e)?Sb:typeof e=="object"?Zt.test(e)?Cb:JA:Ql}function Sb(e,t){const n=[...e],r=n.length,o=e.map((i,a)=>yf(i)(i,t[a]));return i=>{for(let a=0;a<r;a++)n[a]=o[a](i);return n}}function JA(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=yf(e[o])(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}}function QA(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const i=t.types[o],a=e.indexes[i][r[i]],l=e.values[a]??0;n[o]=l,r[i]++}return n}const ej=(e,t)=>{const n=Ur.createTransformer(t),r=Bi(e),o=Bi(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?gf.has(e)&&!o.values.length||gf.has(t)&&!r.values.length?XA(e,t):Li(Sb(QA(r,o),o.values),n):(us(!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.`),Ql(e,t))};function Tb(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Et(e,t,n):yf(e)(e,t)}const tj=5;function Ob(e,t,n){const r=Math.max(t-tj,0);return ny(n-e(r),t-r)}const Pt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},kb=.001;function nj({duration:e=Pt.duration,bounce:t=Pt.bounce,velocity:n=Pt.velocity,mass:r=Pt.mass}){let o,i;us(e<=qn(Pt.maxDuration),"Spring duration must be 10 seconds or less");let a=1-t;a=Or(Pt.minDamping,Pt.maxDamping,a),e=Or(Pt.minDuration,Pt.maxDuration,ir(e)),a<1?(o=u=>{const d=u*a,f=d*e,p=d-n,h=bf(u,a),y=Math.exp(-f);return kb-p/h*y},i=u=>{const f=u*a*e,p=f*n+n,h=Math.pow(a,2)*Math.pow(u,2)*e,y=Math.exp(-f),m=bf(Math.pow(u,2),a);return(-o(u)+kb>0?-1:1)*((p-h)*y)/m}):(o=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-.001+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=oj(o,i,l);if(e=qn(e),isNaN(c))return{stiffness:Pt.stiffness,damping:Pt.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const rj=12;function oj(e,t,n){let r=n;for(let o=1;o<rj;o++)r=r-e(r)/t(r);return r}function bf(e,t){return e*Math.sqrt(1-t*t)}const sj=["duration","bounce"],ij=["stiffness","damping","mass"];function Eb(e,t){return t.some(n=>e[n]!==void 0)}function aj(e){let t={velocity:Pt.velocity,stiffness:Pt.stiffness,damping:Pt.damping,mass:Pt.mass,isResolvedFromDuration:!1,...e};if(!Eb(e,ij)&&Eb(e,sj))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,i=2*Or(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Pt.mass,stiffness:o,damping:i}}else{const n=nj(e);t={...t,...n,mass:Pt.mass},t.isResolvedFromDuration=!0}return t}function ec(e=Pt.visualDuration,t=Pt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:u,mass:d,duration:f,velocity:p,isResolvedFromDuration:h}=aj({...n,velocity:-ir(n.velocity||0)}),y=p||0,m=u/(2*Math.sqrt(c*d)),b=a-i,x=ir(Math.sqrt(c/d)),w=Math.abs(b)<5;r||(r=w?Pt.restSpeed.granular:Pt.restSpeed.default),o||(o=w?Pt.restDelta.granular:Pt.restDelta.default);let C;if(m<1){const v=bf(x,m);C=k=>{const E=Math.exp(-m*x*k);return a-E*((y+m*x*b)/v*Math.sin(v*k)+b*Math.cos(v*k))}}else if(m===1)C=v=>a-Math.exp(-x*v)*(b+(y+x*b)*v);else{const v=x*Math.sqrt(m*m-1);C=k=>{const E=Math.exp(-m*x*k),M=Math.min(v*k,300);return a-E*((y+m*x*b)*Math.sinh(M)+v*b*Math.cosh(M))/v}}const O={calculatedDuration:h&&f||null,next:v=>{const k=C(v);if(h)l.done=v>=f;else{let E=0;m<1&&(E=v===0?qn(y):Ob(C,v,k));const M=Math.abs(E)<=r,D=Math.abs(a-k)<=o;l.done=M&&D}return l.value=l.done?a:k,l},toString:()=>{const v=Math.min(jd(O),zl),k=sy(E=>O.next(v*E).value,v,30);return v+"ms "+k},toTransition:()=>{}};return O}ec.applyToOptions=e=>{const t=iI(e,100,ec);return e.ease=Pi()?t.ease:"easeOut",e.duration=qn(t.duration),e.type="keyframes",e};function Pb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],p={done:!1,value:f},h=M=>l!==void 0&&M<l||c!==void 0&&M>c,y=M=>l===void 0?c:c===void 0||Math.abs(l-M)<Math.abs(c-M)?l:c;let m=n*t;const b=f+m,x=a===void 0?b:a(b);x!==b&&(m=x-f);const w=M=>-m*Math.exp(-M/r),C=M=>x+w(M),O=M=>{const D=w(M),A=C(M);p.done=Math.abs(D)<=u,p.value=p.done?x:A};let v,k;const E=M=>{h(p.value)&&(v=M,k=ec({keyframes:[p.value,y(p.value)],velocity:Ob(C,M,p.value),damping:o,stiffness:i,restDelta:u,restSpeed:d}))};return E(0),{calculatedDuration:null,next:M=>{let D=!1;return!k&&v===void 0&&(D=!0,O(M),E(M)),v!==void 0&&M>=v?k.next(M-v):(!D&&O(M),p)}}}const lj=_i(.42,0,1,1),cj=_i(0,0,.58,1),Mb=_i(.42,0,.58,1),uj=e=>Array.isArray(e)&&typeof e[0]!="number",Rb={linear:Bn,easeIn:lj,easeInOut:Mb,easeOut:cj,circIn:tf,circInOut:Xy,circOut:Ky,backIn:ef,backInOut:Yy,backOut:qy,anticipate:Gy},Db=e=>{if(Rd(e)){Vr(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return _i(t,n,r,o)}else if(typeof e=="string")return Vr(Rb[e]!==void 0,`Invalid easing type '${e}'`),Rb[e];return e};function dj(e,t,n){const r=[],o=n||Tb,i=e.length-1;for(let a=0;a<i;a++){let l=o(e[a],e[a+1]);if(t){const c=Array.isArray(t)?t[a]||Bn:t;l=Li(c,l)}r.push(l)}return r}function fj(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Vr(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=dj(t,r,o),c=l.length,u=d=>{if(a&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const p=Ei(e[f],e[f+1],d);return l[f](p)};return n?d=>u(Or(e[0],e[i-1],d)):u}function pj(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Ei(0,t,r);e.push(Et(n,1,o))}}function hj(e){const t=[0];return pj(t,e.length-1),t}function mj(e,t){return e.map(n=>n*t)}function gj(e,t){return e.map(()=>t||Mb).splice(0,e.length-1)}function Vi({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=uj(r)?r.map(Db):Db(r),i={done:!1,value:t[0]},a=mj(n&&n.length===t.length?n:hj(t),e),l=fj(a,t,{ease:Array.isArray(o)?o:gj(t,o)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const yj=e=>{const t=({timestamp:n})=>e(n);return{start:()=>wt.update(t,!0),stop:()=>Wr(t),now:()=>qt.isProcessing?qt.timestamp:ar.now()}},bj={decay:Pb,inertia:Pb,tween:Vi,keyframes:Vi,spring:ec},vj=e=>e/100;class vf extends xb{constructor(t){super(t),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,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:r,element:o,keyframes:i}=this.options,a=(o==null?void 0:o.KeyframeResolver)||pf,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(i,l,n,r,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i,velocity:a=0}=this.options,l=Id(n)?n:bj[n]||Vi;let c,u;process.env.NODE_ENV!=="production"&&l!==Vi&&Vr(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l!==Vi&&typeof t[0]!="number"&&(c=Li(vj,Tb(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});i==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=jd(d));const{calculatedDuration:f}=d,p=f+o,h=p*(r+1)-o;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:p,totalDuration:h}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:M}=this.options;return{done:!0,value:M[M.length-1]}}const{finalKeyframe:o,generator:i,mirroredGenerator:a,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:p,repeat:h,repeatType:y,repeatDelay:m,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const x=this.currentTime-p*(this.speed>=0?1:-1),w=this.speed>=0?x<0:x>d;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let C=this.currentTime,O=i;if(h){const M=Math.min(this.currentTime,d)/f;let D=Math.floor(M),A=M%1;!A&&M>=1&&(A=1),A===1&&D--,D=Math.min(D,h+1),!!(D%2)&&(y==="reverse"?(A=1-A,m&&(A-=m/f)):y==="mirror"&&(O=a)),C=Or(0,1,A)*f}const v=w?{done:!1,value:c[0]}:O.next(C);l&&(v.value=l(v.value));let{done:k}=v;!w&&u!==null&&(k=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return E&&o!==void 0&&(v.value=Jl(c,this.options,o)),b&&b(v.value),E&&this.finish(),v}get duration(){const{resolved:t}=this;return t?ir(t.calculatedDuration):0}get time(){return ir(this.currentTime)}set time(t){t=qn(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ir(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=yj,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&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(t){return this.startTime=0,this.tick(t,!0)}get finished(){return this.currentFinishedPromise}}const xj=new Set(["opacity","clipPath","filter","transform"]),wj=Pd(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),tc=10,Cj=2e4;function Sj(e){return Id(e.type)||e.type==="spring"||!ay(e.ease)}function Tj(e,t){const n=new vf({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<Cj;)r=n.sample(i),o.push(r.value),i+=tc;return{times:void 0,keyframes:o,duration:i-tc,ease:"linear"}}const Ib={anticipate:Gy,backInOut:Yy,circInOut:Xy};function Oj(e){return e in Ib}class Ab extends xb{constructor(t){super(t);const{name:n,motionValue:r,element:o,keyframes:i}=this.options;this.resolver=new bb(i,(a,l)=>this.onKeyframesResolved(a,l),n,r,o),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:o,ease:i,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&Pi()&&Oj(i)&&(i=Ib[i]),Sj(this.options)){const{onComplete:f,onUpdate:p,motionValue:h,element:y,...m}=this.options,b=Tj(t,m);t=b.keyframes,t.length===1&&(t[1]=t[0]),r=b.duration,o=b.times,i=b.ease,a="keyframes"}const d=sI(l.owner.current,c,t,{...this.options,duration:r,times:o,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(ly(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(Jl(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:o,type:a,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ir(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ir(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=qn(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Bn;const{animation:r}=n;ly(r,t)}return Bn}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:o,type:i,ease:a,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:p,...h}=this.options,y=new vf({...h,keyframes:r,duration:o,type:i,ease:a,times:l,isGenerator:!0}),m=qn(this.time);u.setWithVelocity(y.sample(m-tc).value,y.sample(m).value,tc)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:o,repeatType:i,damping:a,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return wj()&&r&&xj.has(r)&&(r!=="transform"||!u)&&!c&&!o&&i!=="mirror"&&a!==0&&l!=="inertia"}}const kj={type:"spring",stiffness:500,damping:25,restSpeed:10},Ej=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Pj={type:"keyframes",duration:.8},Mj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Rj=(e,{keyframes:t})=>t.length>2?Pj:lo.has(e)?e.startsWith("scale")?Ej(t[1]):kj:Mj;function Dj({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const xf=(e,t,n,r={},o,i)=>a=>{const l=Ad(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-qn(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:p=>{t.set(p),l.onUpdate&&l.onUpdate(p)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:o};Dj(l)||(d={...d,...Rj(e,d)}),d.duration&&(d.duration=qn(d.duration)),d.repeatDelay&&(d.repeatDelay=qn(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),d.allowFlatten=!l.type&&!l.ease,f&&!i&&t.get()!==void 0){const p=Jl(d.keyframes,l);if(p!==void 0)return wt.update(()=>{d.onUpdate(p),d.onComplete()}),new nI([])}return!i&&Ab.supports(d)?new Ab(d):new vf(d)};function Ij({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function jb(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(i=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const d in l){const f=e.getValue(d,e.latestValues[d]??null),p=l[d];if(p===void 0||u&&Ij(u,d))continue;const h={delay:n,...Ad(i||{},d)};let y=!1;if(window.MotionHandoffAnimation){const b=Wy(e);if(b){const x=window.MotionHandoffAnimation(b,d,wt);x!==null&&(h.startTime=x,y=!0)}}Qd(e,d),f.start(xf(d,f,p,e.shouldReduceMotion&&Vy.has(d)?{type:!1}:h,e,y));const m=f.animation;m&&c.push(m)}return a&&Promise.all(c).then(()=>{wt.update(()=>{a&&lA(e,a)})}),c}function wf(e,t,n={}){var c;const r=$i(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(jb(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:p}=o;return Aj(e,t,d+u,f,p,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,d]=l==="beforeChildren"?[i,a]:[a,i];return u().then(()=>d())}else return Promise.all([i(),a(n.delay)])}function Aj(e,t,n=0,r=0,o=1,i){const a=[],l=(e.variantChildren.size-1)*r,c=o===1?(u=0)=>u*r:(u=0)=>l-u*r;return Array.from(e.variantChildren).sort(jj).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(wf(u,t,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function jj(e,t){return e.sortNodePosition(t)}function Nj(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>wf(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=wf(e,t,n);else{const o=typeof t=="function"?$i(e,t,n.custom):t;r=Promise.all(jb(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Nb(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const $j=Ld.length;function $b(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?$b(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<$j;n++){const r=Ld[n],o=e.props[r];(Ii(o)||o===!1)&&(t[r]=o)}return t}const _j=[...Bd].reverse(),Fj=Bd.length;function Bj(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Nj(e,n,r)))}function Lj(e){let t=Bj(e),n=_b(),r=!0;const o=c=>(u,d)=>{var p;const f=$i(e,d,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(f){const{transition:h,transitionEnd:y,...m}=f;u={...u,...m,...y}}return u};function i(c){t=c(e)}function a(c){const{props:u}=e,d=$b(e.parent)||{},f=[],p=new Set;let h={},y=1/0;for(let b=0;b<Fj;b++){const x=_j[b],w=n[x],C=u[x]!==void 0?u[x]:d[x],O=Ii(C),v=x===c?w.isActive:null;v===!1&&(y=b);let k=C===d[x]&&C!==u[x]&&O;if(k&&r&&e.manuallyAnimateOnMount&&(k=!1),w.protectedKeys={...h},!w.isActive&&v===null||!C&&!w.prevProp||Gl(C)||typeof C=="boolean")continue;const E=Vj(w.prevProp,C);let M=E||x===c&&w.isActive&&!k&&O||b>y&&O,D=!1;const A=Array.isArray(C)?C:[C];let $=A.reduce(o(x),{});v===!1&&($={});const{prevResolvedValues:I={}}=w,W={...I,...$},j=N=>{M=!0,p.has(N)&&(D=!0,p.delete(N)),w.needsAnimating[N]=!0;const L=e.getValue(N);L&&(L.liveStyle=!1)};for(const N in W){const L=$[N],H=I[N];if(h.hasOwnProperty(N))continue;let V=!1;Zd(L)&&Zd(H)?V=!Nb(L,H):V=L!==H,V?L!=null?j(N):p.add(N):L!==void 0&&p.has(N)?j(N):w.protectedKeys[N]=!0}w.prevProp=C,w.prevResolvedValues=$,w.isActive&&(h={...h,...$}),r&&e.blockInitialAnimation&&(M=!1),M&&(!(k&&E)||D)&&f.push(...A.map(N=>({animation:N,options:{type:x}})))}if(p.size){const b={};if(typeof u.initial!="boolean"){const x=$i(e,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(b.transition=x.transition)}p.forEach(x=>{const w=e.getBaseTarget(x),C=e.getValue(x);C&&(C.liveStyle=!0),b[x]=w??null}),f.push({animation:b})}let m=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(f):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(p=>{var h;return(h=p.animationState)==null?void 0:h.setActive(c,u)}),n[c].isActive=u;const d=a(c);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:a,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=_b(),r=!0}}}function Vj(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Nb(t,e):!1}function po(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _b(){return{animate:po(!0),whileInView:po(),whileHover:po(),whileTap:po(),whileDrag:po(),whileFocus:po(),exit:po()}}class Hr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Wj extends Hr{constructor(t){super(t),t.animationState||(t.animationState=Lj(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Gl(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let zj=0;class Uj extends Hr{constructor(){super(...arguments),this.id=zj++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Hj={animation:{Feature:Wj},exit:{Feature:Uj}};function Wi(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function zi(e){return{point:{x:e.pageX,y:e.pageY}}}const qj=e=>t=>_d(t)&&e(t,zi(t));function Ui(e,t,n,r){return Wi(e,t,qj(n),r)}function Fb({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Yj({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Gj(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Bb=1e-4,Kj=1-Bb,Xj=1+Bb,Lb=.01,Zj=0-Lb,Jj=0+Lb;function on(e){return e.max-e.min}function Qj(e,t,n){return Math.abs(e-t)<=n}function Vb(e,t,n,r=.5){e.origin=r,e.originPoint=Et(t.min,t.max,e.origin),e.scale=on(n)/on(t),e.translate=Et(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Kj&&e.scale<=Xj||isNaN(e.scale))&&(e.scale=1),(e.translate>=Zj&&e.translate<=Jj||isNaN(e.translate))&&(e.translate=0)}function Hi(e,t,n,r){Vb(e.x,t.x,n.x,r?r.originX:void 0),Vb(e.y,t.y,n.y,r?r.originY:void 0)}function Wb(e,t,n){e.min=n.min+t.min,e.max=e.min+on(t)}function eN(e,t,n){Wb(e.x,t.x,n.x),Wb(e.y,t.y,n.y)}function zb(e,t,n){e.min=t.min-n.min,e.max=e.min+on(t)}function qi(e,t,n){zb(e.x,t.x,n.x),zb(e.y,t.y,n.y)}const Ub=()=>({translate:0,scale:1,origin:0,originPoint:0}),ys=()=>({x:Ub(),y:Ub()}),Hb=()=>({min:0,max:0}),_t=()=>({x:Hb(),y:Hb()});function Ln(e){return[e("x"),e("y")]}function Cf(e){return e===void 0||e===1}function Sf({scale:e,scaleX:t,scaleY:n}){return!Cf(e)||!Cf(t)||!Cf(n)}function ho(e){return Sf(e)||qb(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function qb(e){return Yb(e.x)||Yb(e.y)}function Yb(e){return e&&e!=="0%"}function nc(e,t,n){const r=e-n,o=t*r;return n+o}function Gb(e,t,n,r,o){return o!==void 0&&(e=nc(e,o,r)),nc(e,n,r)+t}function Tf(e,t=0,n=1,r,o){e.min=Gb(e.min,t,n,r,o),e.max=Gb(e.max,t,n,r,o)}function Kb(e,{x:t,y:n}){Tf(e.x,t.translate,t.scale,t.originPoint),Tf(e.y,n.translate,n.scale,n.originPoint)}const Xb=.999999999999,Zb=1.0000000000001;function tN(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,a;for(let l=0;l<o;l++){i=n[l],a=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&vs(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,Kb(e,a)),r&&ho(i.latestValues)&&vs(e,i.latestValues))}t.x<Zb&&t.x>Xb&&(t.x=1),t.y<Zb&&t.y>Xb&&(t.y=1)}function bs(e,t){e.min=e.min+t,e.max=e.max+t}function Jb(e,t,n,r,o=.5){const i=Et(e.min,e.max,o);Tf(e,t,n,i,r)}function vs(e,t){Jb(e.x,t.x,t.scaleX,t.scale,t.originX),Jb(e.y,t.y,t.scaleY,t.scale,t.originY)}function Qb(e,t){return Fb(Gj(e.getBoundingClientRect(),t))}function nN(e,t,n){const r=Qb(e,n),{scroll:o}=t;return o&&(bs(r.x,o.offset.x),bs(r.y,o.offset.y)),r}const ev=({current:e})=>e?e.ownerDocument.defaultView:null,tv=(e,t)=>Math.abs(e-t);function rN(e,t){const n=tv(e.x,t.x),r=tv(e.y,t.y);return Math.sqrt(n**2+r**2)}class nv{constructor(t,n,{transformPagePoint:r,contextWindow:o,dragSnapToOrigin:i=!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 f=kf(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,h=rN(f.offset,{x:0,y:0})>=3;if(!p&&!h)return;const{point:y}=f,{timestamp:m}=qt;this.history.push({...y,timestamp:m});const{onStart:b,onMove:x}=this.handlers;p||(b&&b(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Of(p,this.transformPagePoint),wt.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:h,onSessionEnd:y,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=kf(f.type==="pointercancel"?this.lastMoveEventInfo:Of(p,this.transformPagePoint),this.history);this.startEvent&&h&&h(f,b),y&&y(f,b)},!_d(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=o||window;const a=zi(t),l=Of(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=qt;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,kf(l,this.history)),this.removeListeners=Li(Ui(this.contextWindow,"pointermove",this.handlePointerMove),Ui(this.contextWindow,"pointerup",this.handlePointerUp),Ui(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Wr(this.updatePoint)}}function Of(e,t){return t?{point:t(e.point)}:e}function rv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function kf({point:e},t){return{point:e,delta:rv(e,ov(t)),offset:rv(e,oN(t)),velocity:sN(t,.1)}}function oN(e){return e[0]}function ov(e){return e[e.length-1]}function sN(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=ov(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>qn(t)));)n--;if(!r)return{x:0,y:0};const i=ir(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function iN(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Et(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Et(n,e,r.max):Math.min(e,n)),e}function sv(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function aN(e,{top:t,left:n,bottom:r,right:o}){return{x:sv(e.x,n,o),y:sv(e.y,t,r)}}function iv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function lN(e,t){return{x:iv(e.x,t.x),y:iv(e.y,t.y)}}function cN(e,t){let n=.5;const r=on(e),o=on(t);return o>r?n=Ei(t.min,t.max-r,e.min):r>o&&(n=Ei(e.min,e.max-o,t.min)),Or(0,1,n)}function uN(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Ef=.35;function dN(e=Ef){return e===!1?e=0:e===!0&&(e=Ef),{x:av(e,"left","right"),y:av(e,"top","bottom")}}function av(e,t,n){return{min:lv(e,t),max:lv(e,n)}}function lv(e,t){return typeof e=="number"?e:e[t]||0}const fN=new WeakMap;class pN{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=_t(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(zi(d).point)},i=(d,f)=>{const{drag:p,dragPropagation:h,onDragStart:y}=this.getProps();if(p&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=uI(p),!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),Ln(b=>{let x=this.getAxisMotionValue(b).get()||0;if(lr.test(x)){const{projection:w}=this.visualElement;if(w&&w.layout){const C=w.layout.layoutBox[b];C&&(x=on(C)*(parseFloat(x)/100))}}this.originPoint[b]=x}),y&&wt.postRender(()=>y(d,f)),Qd(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:p,dragDirectionLock:h,onDirectionLock:y,onDrag:m}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:b}=f;if(h&&this.currentDirection===null){this.currentDirection=hN(b),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),m&&m(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Ln(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)==null?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new nv(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:ev(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&wt.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!rc(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=iN(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,o=this.constraints;t&&fs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=aN(r.layoutBox,t):this.constraints=!1,this.elastic=dN(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ln(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=uN(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!fs(t))return!1;const r=t.current;Vr(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=nN(r,o.root,this.visualElement.getTransformPagePoint());let a=lN(o.layout.layoutBox,i);if(n){const l=n(Yj(a));this.hasMutatedConstraints=!!l,l&&(a=Fb(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Ln(d=>{if(!rc(d,n,this.currentDirection))return;let f=c&&c[d]||{};a&&(f={min:0,max:0});const p=o?200:1e6,h=o?40:1e7,y={type:"inertia",velocity:r?t[d]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,y)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Qd(this.visualElement,t),r.start(xf(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ln(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ln(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ln(n=>{const{drag:r}=this.getProps();if(!rc(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:a,max:l}=o.layout.layoutBox[n];i.set(t[n]-Et(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!fs(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Ln(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();o[a]=cN({min:c,max:c},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ln(a=>{if(!rc(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(Et(c,u,o[a]))})}addListeners(){if(!this.visualElement.current)return;fN.set(this.visualElement,this);const t=this.visualElement.current,n=Ui(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();fs(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),wt.read(r);const a=Wi(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ln(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{a(),n(),i(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:a=Ef,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function rc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function hN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class mN extends Hr{constructor(t){super(t),this.removeGroupControls=Bn,this.removeListeners=Bn,this.controls=new pN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Bn}unmount(){this.removeGroupControls(),this.removeListeners()}}const cv=e=>(t,n)=>{e&&wt.postRender(()=>e(t,n))};class gN extends Hr{constructor(){super(...arguments),this.removePointerDownListener=Bn}onPointerDown(t){this.session=new nv(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ev(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:cv(t),onStart:cv(n),onMove:r,onEnd:(i,a)=>{delete this.session,o&&wt.postRender(()=>o(i,a))}}}mount(){this.removePointerDownListener=Ui(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const oc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function uv(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Yi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_e.test(e))e=parseFloat(e);else return e;const n=uv(e,t.target.x),r=uv(e,t.target.y);return`${n}% ${r}%`}},yN={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ur.parse(e);if(o.length>5)return r;const i=Ur.createTransformer(e),a=typeof o[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;o[0+a]/=l,o[1+a]/=c;const u=Et(l,c,.5);return typeof o[2+a]=="number"&&(o[2+a]/=u),typeof o[3+a]=="number"&&(o[3+a]/=u),i(o)}};class bN extends R.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;$I(vN),i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),oc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,a=r.projection;return a&&(a.isPresent=i,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||wt.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Nd.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function dv(e){const[t,n]=ey(),r=R.useContext(wd);return g.jsx(bN,{...e,layoutGroup:r,switchLayoutGroup:R.useContext(Sy),isPresent:t,safeToRemove:n})}const vN={borderRadius:{...Yi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Yi,borderTopRightRadius:Yi,borderBottomLeftRadius:Yi,borderBottomRightRadius:Yi,boxShadow:yN};function xN(e,t,n){const r=Xt(e)?e:Di(e);return r.start(xf("",r,t,n)),r.animation}function wN(e){return e instanceof SVGElement&&e.tagName!=="svg"}const CN=(e,t)=>e.depth-t.depth;class SN{constructor(){this.children=[],this.isDirty=!1}add(t){Od(this.children,t),this.isDirty=!0}remove(t){kd(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(CN),this.isDirty=!1,this.children.forEach(t)}}function TN(e,t){const n=ar.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Wr(r),e(i-t))};return wt.read(r,!0),()=>Wr(r)}const fv=["TopLeft","TopRight","BottomLeft","BottomRight"],ON=fv.length,pv=e=>typeof e=="string"?parseFloat(e):e,hv=e=>typeof e=="number"||_e.test(e);function kN(e,t,n,r,o,i){o?(e.opacity=Et(0,n.opacity??1,EN(r)),e.opacityExit=Et(t.opacity??1,0,PN(r))):i&&(e.opacity=Et(t.opacity??1,n.opacity??1,r));for(let a=0;a<ON;a++){const l=`border${fv[a]}Radius`;let c=mv(t,l),u=mv(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||hv(c)===hv(u)?(e[l]=Math.max(Et(pv(c),pv(u),r),0),(lr.test(u)||lr.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=Et(t.rotate||0,n.rotate||0,r))}function mv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const EN=gv(0,.5,Ky),PN=gv(.5,.95,Bn);function gv(e,t,n){return r=>r<e?0:r>t?1:n(Ei(e,t,r))}function yv(e,t){e.min=t.min,e.max=t.max}function Vn(e,t){yv(e.x,t.x),yv(e.y,t.y)}function bv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function vv(e,t,n,r,o){return e-=t,e=nc(e,1/n,r),o!==void 0&&(e=nc(e,1/o,r)),e}function MN(e,t=0,n=1,r=.5,o,i=e,a=e){if(lr.test(t)&&(t=parseFloat(t),t=Et(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=Et(i.min,i.max,r);e===i&&(l-=t),e.min=vv(e.min,t,n,l,o),e.max=vv(e.max,t,n,l,o)}function xv(e,t,[n,r,o],i,a){MN(e,t[n],t[r],t[o],t.scale,i,a)}const RN=["x","scaleX","originX"],DN=["y","scaleY","originY"];function wv(e,t,n,r){xv(e.x,t,RN,n?n.x:void 0,r?r.x:void 0),xv(e.y,t,DN,n?n.y:void 0,r?r.y:void 0)}function Cv(e){return e.translate===0&&e.scale===1}function Sv(e){return Cv(e.x)&&Cv(e.y)}function Tv(e,t){return e.min===t.min&&e.max===t.max}function IN(e,t){return Tv(e.x,t.x)&&Tv(e.y,t.y)}function Ov(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function kv(e,t){return Ov(e.x,t.x)&&Ov(e.y,t.y)}function Ev(e){return on(e.x)/on(e.y)}function Pv(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class AN{constructor(){this.members=[]}add(t){Od(this.members,t),t.scheduleRender()}remove(t){if(kd(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function jN(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((o||i||a)&&(r=`translate3d(${o}px, ${i}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:p,skewX:h,skewY:y}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),p&&(r+=`rotateY(${p}deg) `),h&&(r+=`skewX(${h}deg) `),y&&(r+=`skewY(${y}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Pf=["","X","Y","Z"],NN={visibility:"hidden"},Mv=1e3;let $N=0;function Mf(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Rv(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Wy(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",wt,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Rv(r)}function Dv({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(a={},l=t==null?void 0:t()){this.id=$N++,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,this.nodes.forEach(BN),this.nodes.forEach(UN),this.nodes.forEach(HN),this.nodes.forEach(LN)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new SN)}addEventListener(a,l){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new Md),this.eventHandlers.get(a).add(l)}notifyListeners(a,...l){const c=this.eventHandlers.get(a);c&&c.notify(...l)}hasListeners(a){return this.eventHandlers.has(a)}mount(a,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=wN(a),this.instance=a;const{layoutId:c,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(u||c)&&(this.isLayoutDirty=!0),e){let f;const p=()=>this.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=TN(p,250),oc.hasAnimatedSinceResize&&(oc.hasAnimatedSinceResize=!1,this.nodes.forEach(Av))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeLayoutChanged:h,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||d.getDefaultTransition()||XN,{onLayoutAnimationStart:b,onLayoutAnimationComplete:x}=d.getProps(),w=!this.targetLayout||!kv(this.targetLayout,y),C=!p&&h;if(this.options.layoutRoot||this.resumeFrom||C||p&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,C);const O={...Ad(m,"layout"),onPlay:b,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else p||Av(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Wr(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(qN),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Rv(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Iv);return}this.isUpdating||this.nodes.forEach(WN),this.isUpdating=!1,this.nodes.forEach(zN),this.nodes.forEach(_N),this.nodes.forEach(FN),this.clearAllSnapshots();const l=ar.now();qt.delta=Or(0,1e3/60,l-qt.timestamp),qt.timestamp=l,qt.isProcessing=!0,$d.update.process(qt),$d.preRender.process(qt),$d.render.process(qt),qt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Nd.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(VN),this.sharedNodes.forEach(YN)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,wt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){wt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!on(this.snapshot.measuredBox.x)&&!on(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutCorrected=_t(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(l=!1),l){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!Sv(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;a&&(l||ho(this.latestValues)||d)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return a&&(c=this.removeTransform(c)),ZN(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:a}=this.options;if(!a)return _t();const l=a.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(JN))){const{scroll:d}=this.root;d&&(bs(l.x,d.offset.x),bs(l.y,d.offset.y))}return l}removeElementScroll(a){var c;const l=_t();if(Vn(l,a),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:p}=d;d!==this.root&&f&&p.layoutScroll&&(f.wasRoot&&Vn(l,a),bs(l.x,f.offset.x),bs(l.y,f.offset.y))}return l}applyTransform(a,l=!1){const c=_t();Vn(c,a);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&vs(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),ho(d.latestValues)&&vs(c,d.latestValues)}return ho(this.latestValues)&&vs(c,this.latestValues),c}removeTransform(a){const l=_t();Vn(l,a);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!ho(u.latestValues))continue;Sf(u.latestValues)&&u.updateSnapshot();const d=_t(),f=u.measurePageBox();Vn(d,f),wv(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return ho(this.latestValues)&&wv(l,this.latestValues),l}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}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!==qt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var p;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=qt.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_t(),this.relativeTargetOrigin=_t(),qi(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),Vn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=_t(),this.targetWithTransforms=_t()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),eN(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Vn(this.target,this.layout.layoutBox),Kb(this.target,this.targetDelta)):Vn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_t(),this.relativeTargetOrigin=_t(),qi(this.relativeTargetOrigin,this.target,h.target),Vn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Sf(this.parent.latestValues)||qb(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 y;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===qt.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;Vn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;tN(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=_t());const{target:h}=a;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(bv(this.prevProjectionDelta.x,this.projectionDelta.x),bv(this.prevProjectionDelta.y,this.projectionDelta.y)),Hi(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!Pv(this.projectionDelta.x,this.prevProjectionDelta.x)||!Pv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ys(),this.projectionDelta=ys(),this.projectionDeltaWithTransform=ys()}setAnimationOrigin(a,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=ys();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const p=_t(),h=c?c.source:void 0,y=this.layout?this.layout.source:void 0,m=h!==y,b=this.getStack(),x=!b||b.members.length<=1,w=!!(m&&!x&&this.options.crossfade===!0&&!this.path.some(KN));this.animationProgress=0;let C;this.mixTargetDelta=O=>{const v=O/1e3;jv(f.x,a.x,v),jv(f.y,a.y,v),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qi(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),GN(this.relativeTarget,this.relativeTargetOrigin,p,v),C&&IN(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=_t()),Vn(C,this.relativeTarget)),m&&(this.animationValues=d,kN(d,u,this.latestValues,v,w,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=v},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Wr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=wt.update(()=>{oc.hasAnimatedSinceResize=!0,this.currentAnimation=xN(0,Mv,{...a,onUpdate:l=>{this.mixTargetDelta(l),a.onUpdate&&a.onUpdate(l)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Mv),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&Bv(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||_t();const f=on(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const p=on(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+p}Vn(l,c),vs(l,d),Hi(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new AN),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var l;const{layoutId:a}=this.options;return a?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:a}=this.options;return a?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Mf("z",a,u,this.animationValues);for(let d=0;d<Pf.length;d++)Mf(`rotate${Pf[d]}`,a,u,this.animationValues),Mf(`skew${Pf[d]}`,a,u,this.animationValues);a.render();for(const d in u)a.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);a.scheduleRender()}getProjectionStyles(a){if(!this.instance||this.isSVG)return;if(!this.isVisible)return NN;const l={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,l.opacity="",l.pointerEvents=Zl(a==null?void 0:a.pointerEvents)||"",l.transform=c?c(this.latestValues,""):"none",l;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const h={};return this.options.layoutId&&(h.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,h.pointerEvents=Zl(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ho(this.latestValues)&&(h.transform=c?c({},""):"none",this.hasProjected=!1),h}const d=u.animationValues||u.latestValues;this.applyTransformsToTarget(),l.transform=jN(this.projectionDeltaWithTransform,this.treeScale,d),c&&(l.transform=c(d,l.transform));const{x:f,y:p}=this.projectionDelta;l.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,u.animationValues?l.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:l.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const h in Ai){if(d[h]===void 0)continue;const{correct:y,applyTo:m,isCSSVariable:b}=Ai[h],x=l.transform==="none"?d[h]:y(d[h],u);if(m){const w=m.length;for(let C=0;C<w;C++)l[m[C]]=x}else b?this.options.visualElement.renderState.vars[h]=x:l[h]=x}return this.options.layoutId&&(l.pointerEvents=u===this?Zl(a==null?void 0:a.pointerEvents)||"":"none"),l}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var l;return(l=a.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(Iv),this.root.sharedNodes.clear()}}}function _N(e){e.updateLayout()}function FN(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i==="size"?Ln(f=>{const p=a?t.measuredBox[f]:t.layoutBox[f],h=on(p);p.min=r[f].min,p.max=p.min+h}):Bv(i,t.layoutBox,r)&&Ln(f=>{const p=a?t.measuredBox[f]:t.layoutBox[f],h=on(r[f]);p.max=p.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+h)});const l=ys();Hi(l,r,t.layoutBox);const c=ys();a?Hi(c,e.applyTransform(o,!0),t.measuredBox):Hi(c,r,t.layoutBox);const u=!Sv(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:p,layout:h}=f;if(p&&h){const y=_t();qi(y,t.layoutBox,p.layoutBox);const m=_t();qi(m,r,h.layoutBox),kv(y,m)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=y,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function BN(e){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 LN(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function VN(e){e.clearSnapshot()}function Iv(e){e.clearMeasurements()}function WN(e){e.isLayoutDirty=!1}function zN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Av(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function UN(e){e.resolveTargetDelta()}function HN(e){e.calcProjection()}function qN(e){e.resetSkewAndRotation()}function YN(e){e.removeLeadSnapshot()}function jv(e,t,n){e.translate=Et(t.translate,0,n),e.scale=Et(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Nv(e,t,n,r){e.min=Et(t.min,n.min,r),e.max=Et(t.max,n.max,r)}function GN(e,t,n,r){Nv(e.x,t.x,n.x,r),Nv(e.y,t.y,n.y,r)}function KN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const XN={duration:.45,ease:[.4,0,.1,1]},$v=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),_v=$v("applewebkit/")&&!$v("chrome/")?Math.round:Bn;function Fv(e){e.min=_v(e.min),e.max=_v(e.max)}function ZN(e){Fv(e.x),Fv(e.y)}function Bv(e,t,n){return e==="position"||e==="preserve-aspect"&&!Qj(Ev(t),Ev(n),.2)}function JN(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const QN=Dv({attachResizeListener:(e,t)=>Wi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Rf={current:void 0},Lv=Dv({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Rf.current){const e=new QN({});e.mount(window),e.setOptions({layoutScroll:!0}),Rf.current=e}return Rf.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),e6={pan:{Feature:gN},drag:{Feature:mN,ProjectionNode:Lv,MeasureLayout:dv}};function Vv(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&wt.postRender(()=>i(t,zi(t)))}class t6 extends Hr{mount(){const{current:t}=this.node;t&&(this.unmount=fI(t,(n,r)=>(Vv(this.node,r,"Start"),o=>Vv(this.node,o,"End"))))}unmount(){}}class n6 extends Hr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Li(Wi(this.node.current,"focus",()=>this.onFocus()),Wi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Wv(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&wt.postRender(()=>i(t,zi(t)))}class r6 extends Hr{mount(){const{current:t}=this.node;t&&(this.unmount=gI(t,(n,r)=>(Wv(this.node,r,"Start"),(o,{success:i})=>Wv(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Df=new WeakMap,If=new WeakMap,o6=e=>{const t=Df.get(e.target);t&&t(e)},s6=e=>{e.forEach(o6)};function i6({root:e,...t}){const n=e||document;If.has(n)||If.set(n,{});const r=If.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(s6,{root:e,...t})),r[o]}function a6(e,t,n){const r=i6(t);return Df.set(e,n),r.observe(e),()=>{Df.delete(e),r.unobserve(e)}}const l6={some:0,all:1};class c6 extends Hr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:l6[o]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),p=u?d:f;p&&p(c)};return a6(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(u6(t,n))&&this.startObserver()}unmount(){}}function u6({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const d6={inView:{Feature:c6},tap:{Feature:r6},focus:{Feature:n6},hover:{Feature:t6}},f6={layout:{ProjectionNode:Lv,MeasureLayout:dv}},Af={current:null},zv={current:!1};function p6(){if(zv.current=!0,!!Sd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Af.current=e.matches;e.addListener(t),t()}else Af.current=!1}const h6=[...gb,Zt,Ur],m6=e=>h6.find(mb(e)),g6=new WeakMap;function y6(e,t,n){for(const r in t){const o=t[r],i=n[r];if(Xt(o))e.addValue(r,o),process.env.NODE_ENV==="development"&&Wl(o.version==="12.7.3",`Attempting to mix Motion versions ${o.version} with 12.7.3 may not work as expected.`);else if(Xt(i))e.addValue(r,Di(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(o):a.hasAnimated||a.set(o)}else{const a=e.getStaticValue(r);e.addValue(r,Di(a!==void 0?a:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Uv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class b6{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=pf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=ar.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,wt.render(this.render,!1,!0))};const{latestValues:c,renderState:u,onUpdate:d}=a;this.onUpdate=d,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=Kl(n),this.isVariantNode=xy(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in p){const y=p[h];c[h]!==void 0&&Xt(y)&&y.set(c[h],!1)}}mount(t){this.current=t,g6.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),zv.current||p6(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Af.current,process.env.NODE_ENV!=="production"&&Wl(this.shouldReduceMotion!==!0,"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(){this.projection&&this.projection.unmount(),Wr(this.notifyUpdate),Wr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=lo.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&wt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ds){const n=ds[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):_t()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Uv.length;r++){const o=Uv[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,a=t[i];a&&(this.propEventSubscriptions[o]=this.on(o,a))}this.prevMotionValues=y6(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Di(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(pb(r)||Zy(r))?r=parseFloat(r):!m6(r)&&Ur.test(n)&&(r=sb(t,n)),this.setBaseTarget(t,Xt(r)?r.get():r)),Xt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=Xd(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Xt(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Md),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Hv extends b6{constructor(){super(...arguments),this.KeyframeResolver=bb}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Xt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function v6(e){return window.getComputedStyle(e)}class x6 extends Hv{constructor(){super(...arguments),this.type="html",this.renderInstance=$y}readValueFromInstance(t,n){if(lo.has(n))return AA(t,n);{const r=v6(t),o=(Wd(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Qb(t,n)}build(t,n,r){Hd(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Jd(t,n,r)}}class w6 extends Hv{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_t,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Ny(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(lo.has(n)){const r=ob(n);return r&&r.default||0}return n=_y.has(n)?n:Vd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return By(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&wt.postRender(this.updateDimensions)}build(t,n,r){Gd(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,o){Fy(t,n,r,o)}mount(t){this.isSVGTag=Kd(t.tagName),super.mount(t)}}const C6=(e,t)=>Yd(e)?new w6(t):new x6(t,{allowProjection:e!==R.Fragment}),S6=iA({...Hj,...d6,...e6,...f6},C6),Gi=SI(S6),hn=({name:e,size:t=24,url:n,color:r="currentColor",style:o={},...i})=>{const{isPrimary:a}=i,l=n||Ke[e],u=It().palette.mode==="dark",d=a?"invert(100%) brightness(200%)":u?"invert(100%) sepia(0%) saturate(0%) hue-rotate(93deg) brightness(103%) contrast(103%)":"invert(48%) sepia(0%) saturate(0%) hue-rotate(181deg) brightness(95%) contrast(90%)";return l?g.jsx("img",{src:l,alt:`${e}-icon`,style:{filter:d,...o},...i}):null},T6=({showOptions:e,setShowOptions:t,buttonRef:n,options:r,onClick:o})=>{const i=R.useRef(null);return R.useEffect(()=>{let a;return e&&(a=setTimeout(()=>{const l=c=>{i!=null&&i.current&&!(i!=null&&i.current.contains(c.target))&&!(n!=null&&n.contains(c.target))&&t(!1)};document.addEventListener("mousedown",l),document._customLabelClickOutside=l},0)),()=>{clearTimeout(a),document._customLabelClickOutside&&(document.removeEventListener("mousedown",document._customLabelClickOutside),delete document._customLabelClickOutside)}},[e]),g.jsx(rs,{open:e,anchorEl:n,placement:"bottom",transition:!0,modifiers:[{name:"offset",options:{offset:[0,0]}},{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:a})=>{a.styles.popper.width=`${a.rects.reference.width}px`}}],style:{zIndex:1300},ref:i,children:({TransitionProps:a})=>g.jsx(Nr,{...a,timeout:100,children:g.jsx(ye,{sx:{background:l=>l.palette.primary.appBackground,border:l=>`1px solid ${l.palette.primary.notifyBorderColor}`,borderRadius:"0.7rem",width:"100%",padding:"0.3rem",maxHeight:"20rem",overflowY:"auto"},children:g.jsx(ye,{children:r==null?void 0:r.map((l,c)=>g.jsx(Fr,{sx:{opacity:1,pointerEvents:"auto",padding:"0rem",borderTop:c!==0?u=>`0.1rem solid ${u.palette.primary.notifyBorderColor}`:"none"},onClick:u=>{u.stopPropagation(),o(l)},children:g.jsx(ft,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{p:"0.5rem"},children:g.jsx(ft,{direction:"row",alignItems:"center",gap:"1rem",children:g.jsx(nt,{component:"h3",sx:{color:u=>u.palette.primary.notifyActiveText,fontWeight:"300",fontSize:"1.1rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l.label})})})},c))})})})})},qv=({styles:e,label:t,disabled:n,onClick:r,...o})=>{var y,m;const i=It();let a=(t==null?void 0:t.length)*((t==null?void 0:t.length)>=10?6.5:7.5)+38||0;a=o!=null&&o.options?a+15:a;const[l,c]=R.useState(!1),u=R.useRef(null),[d,f]=R.useState(!1),[p,h]=R.useState(e==null?void 0:e.isAnimate);return g.jsxs(Gi.button,{ref:u,onMouseEnter:()=>p&&c(!0),onMouseLeave:()=>p&&c(!1),initial:{width:(e==null?void 0:e.width)||(!p&&t?`${a/10}rem`:"3.2rem"),borderRadius:"0.7rem"},animate:{width:p?`${l?a/10:3.2}rem`:t?`${a/10}rem`:"3.2rem"},whileHover:{backgroundColor:(y=e==null?void 0:e.hover)==null?void 0:y.backgroundColor,color:(m=e==null?void 0:e.hover)==null?void 0:m.color},transition:{duration:.2,ease:"easeInOut"},style:{height:"3.2rem",outline:"none",overflow:"hidden",backgroundColor:(e==null?void 0:e.variant)!=="outlined"?(e==null?void 0:e.colorType)==="secondary"?i.palette.brandColor.blue:(e==null?void 0:e.colorType)==="danger"?i.palette.brandColor.red:(e==null?void 0:e.colorType)==="empty"?i.palette.primary.notifyButtonBackground:i.palette.brandColor.orange:i.palette.primary.notifyBackground,border:(e==null?void 0:e.variant)==="outlined"||(e==null?void 0:e.colorType)==="empty"?`0.1rem solid ${i.palette.primary.notifyBorderColor}`:"none",display:"flex",cursor:"pointer",alignItems:"center",gap:l||!p?"0.5rem":0,color:(e==null?void 0:e.variant)==="outlined"||(e==null?void 0:e.colorType)==="empty"?i.palette.primary.notifyTextColor:"white",justifyContent:l?"flex-start":"center",padding:l||!p?"1.2rem":"0.8rem",whiteSpace:"nowrap",opacity:n?.6:1,cursor:n?"auto":"pointer",...e},disabled:n,layout:!0,onClick:()=>{!(o!=null&&o.options)&&r(),o!=null&&o.options&&(f(b=>!b),h(d))},...o,children:[(e==null?void 0:e.icon)&&(!(e!=null&&e.iconPosition)||(e==null?void 0:e.iconPosition)==="start")&&g.jsx(hn,{url:e==null?void 0:e.icon,isPrimary:e==null?void 0:e.iconPrimary}),t&&g.jsxs(Gi.div,{layout:!0,initial:{opacity:0,width:0},animate:{opacity:l||!p?1:0,width:l||!p?"auto":0},transition:{duration:.2,ease:"easeInOut",delay:l?.1:0},style:{overflow:"hidden",whiteSpace:"nowrap",display:"flex",justifyContent:"center",gap:"0.8rem"},children:[g.jsx(nt,{sx:{fontSize:"1.1rem"},children:t}),(o==null?void 0:o.options)&&(d?g.jsx(hn,{url:Ke.ArrowUpLight}):g.jsx(hn,{url:Ke.ArrowDownLight}))]}),(e==null?void 0:e.iconPosition)==="end"&&g.jsx(hn,{url:e==null?void 0:e.icon,isPrimary:e==null?void 0:e.iconPrimary}),g.jsx(T6,{showOptions:d,buttonRef:u==null?void 0:u.current,setShowOptions:f,options:o==null?void 0:o.options,onClick:r})]})};qv.propTypes={styles:s.object.isRequired,label:s.string};function mo({...e}){return g.jsx(Fn,{children:g.jsx(qv,{...e})})}function sc({...e}){return g.jsx(Fn,{children:g.jsx(U0,{id:e==null?void 0:e.id,icon:g.jsx(ye,{component:"img",src:Ke.Uncheck}),checkedIcon:g.jsx(ye,{component:"img",src:Ke.Check}),...e})})}const Yv=new Set;function O6(e,t="warning"){if(process.env.NODE_ENV==="production")return;const n=Array.isArray(e)?e.join(`
|
|
302
|
+
`),()=>{document.head.removeChild(h)}},[t]),g.jsx(K5,{isPresent:t,childRef:o,sizeRef:i,children:S.cloneElement(e,{ref:o})})}const Z5=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:o,presenceAffectsLayout:i,mode:a,anchorX:l})=>{const c=Cd(J5),u=R.useId(),d=R.useCallback(p=>{c.set(p,!0);for(const h of c.values())if(!h)return;r&&r()},[c,r]),f=R.useMemo(()=>({id:u,initial:t,isPresent:n,custom:o,onExitComplete:d,register:p=>(c.set(p,!1),()=>c.delete(p))}),i?[Math.random(),d]:[n,d]);return R.useMemo(()=>{c.forEach((p,h)=>c.set(h,!1))},[n]),S.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),a==="popLayout"&&(e=g.jsx(X5,{isPresent:n,anchorX:l,children:e})),g.jsx(Ll.Provider,{value:f,children:e})};function J5(){return new Map}function ey(e=!0){const t=R.useContext(Ll);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:o}=t,i=R.useId();R.useEffect(()=>{if(e)return o(i)},[e]);const a=R.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,a]:[!0]}const Vl=e=>e.key||"";function ty(e){const t=[];return R.Children.forEach(e,n=>{R.isValidElement(n)&&t.push(n)}),t}const Q5=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:i="sync",propagate:a=!1,anchorX:l="left"})=>{const[c,u]=ey(a),d=R.useMemo(()=>ty(e),[e]),f=a&&!c?[]:d.map(Vl),p=R.useRef(!0),h=R.useRef(d),y=Cd(()=>new Map),[m,b]=R.useState(d),[x,w]=R.useState(d);Qg(()=>{p.current=!1,h.current=d;for(let v=0;v<x.length;v++){const k=Vl(x[v]);f.includes(k)?y.delete(k):y.get(k)!==!0&&y.set(k,!1)}},[x,f.length,f.join("-")]);const C=[];if(d!==m){let v=[...d];for(let k=0;k<x.length;k++){const E=x[k],M=Vl(E);f.includes(M)||(v.splice(k,0,E),C.push(E))}return i==="wait"&&C.length&&(v=C),w(ty(v)),b(d),null}process.env.NODE_ENV!=="production"&&i==="wait"&&x.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:O}=R.useContext(wd);return g.jsx(g.Fragment,{children:x.map(v=>{const k=Vl(v),E=a&&!c?!1:d===x||f.includes(k),M=()=>{if(y.has(k))y.set(k,!0);else return;let D=!0;y.forEach(A=>{A||(D=!1)}),D&&(O==null||O(),w(h.current),a&&(u==null||u()),r&&r())};return g.jsx(Z5,{isPresent:E,initial:!p.current||n?void 0:!1,custom:t,presenceAffectsLayout:o,mode:i,onExitComplete:E?void 0:M,anchorX:l,children:v},k)})})};function Od(e,t){e.indexOf(t)===-1&&e.push(t)}function kd(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}let us=()=>{},Vr=()=>{};process.env.NODE_ENV!=="production"&&(us=(e,t)=>{!e&&typeof console<"u"&&console.warn(t)},Vr=(e,t)=>{if(!e)throw new Error(t)});const Ed={useManualTiming:!1};function Pd(e){let t;return()=>(t===void 0&&(t=e()),t)}const Bn=e=>e,Ei=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r};class Md{constructor(){this.subscriptions=[]}add(t){return Od(this.subscriptions,t),()=>kd(this.subscriptions,t)}notify(t,n,r){const o=this.subscriptions.length;if(o)if(o===1)this.subscriptions[0](t,n,r);else for(let i=0;i<o;i++){const a=this.subscriptions[i];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const qn=e=>e*1e3,ir=e=>e/1e3;function ny(e,t){return t?e*(1e3/t):0}const ry=new Set;function Wl(e,t,n){e||ry.has(t)||(console.warn(t),ry.add(t))}const eI=Pd(()=>window.ScrollTimeline!==void 0);class tI{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>t.finished))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(o=>{if(eI()&&o.attachTimeline)return o.attachTimeline(t);if(typeof n=="function")return n(o)});return()=>{r.forEach((o,i)=>{o&&o(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class nI extends tI{then(t,n){return this.finished.finally(t).then(()=>{})}}const oy={value:null},Rd=e=>Array.isArray(e)&&typeof e[0]=="number",rI={};function oI(e,t){const n=Pd(e);return()=>rI[t]??n()}const Pi=oI(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),sy=(e,t,n=10)=>{let r="";const o=Math.max(Math.round(t/n),2);for(let i=0;i<o;i++)r+=e(i/(o-1))+", ";return`linear(${r.substring(0,r.length-2)})`},Mi=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Dd={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Mi([0,.65,.55,1]),circOut:Mi([.55,0,1,.45]),backIn:Mi([.31,.01,.66,-.59]),backOut:Mi([.33,1.53,.69,.99])};function iy(e,t){if(e)return typeof e=="function"&&Pi()?sy(e,t):Rd(e)?Mi(e):Array.isArray(e)?e.map(n=>iy(n,t)||Dd.easeOut):Dd[e]}function sI(e,t,n,{delay:r=0,duration:o=300,repeat:i=0,repeatType:a="loop",ease:l="easeInOut",times:c}={},u=void 0){const d={[t]:n};c&&(d.offset=c);const f=iy(l,o);return Array.isArray(f)&&(d.easing=f),e.animate(d,{delay:r,duration:o,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal",pseudoElement:u})}function Id(e){return typeof e=="function"&&"applyToOptions"in e}function Ad(e,t){return(e==null?void 0:e[t])??(e==null?void 0:e.default)??e}const zl=2e4;function jd(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<zl;)t+=n,r=e.next(t);return t>=zl?1/0:t}function iI(e,t=100,n){const r=n({...e,keyframes:[0,t]}),o=Math.min(jd(r),zl);return{type:"keyframes",ease:i=>r.next(o*i).value/t,duration:ir(o)}}function ay(e){return!!(typeof e=="function"&&Pi()||!e||typeof e=="string"&&(e in Dd||Pi())||Rd(e)||Array.isArray(e)&&e.every(ay))}function ly(e,t){e.timeline=t,e.onfinish=null}const Ul=["read","resolveKeyframes","update","preRender","render","postRender"];function aI(e,t){let n=new Set,r=new Set,o=!1,i=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function u(f){a.has(f)&&(d.schedule(f),e()),c++,f(l)}const d={schedule:(f,p=!1,h=!1)=>{const m=h&&o?n:r;return p&&a.add(f),m.has(f)||m.add(f),f},cancel:f=>{r.delete(f),a.delete(f)},process:f=>{if(l=f,o){i=!0;return}o=!0,[n,r]=[r,n],n.forEach(u),t&&oy.value&&oy.value.frameloop[t].push(c),c=0,n.clear(),o=!1,i&&(i=!1,d.process(f))}};return d}const lI=40;function cy(e,t){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Ul.reduce((x,w)=>(x[w]=aI(i,t?w:void 0),x),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:f,postRender:p}=a,h=()=>{const x=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(x-o.timestamp,lI),1),o.timestamp=x,o.isProcessing=!0,l.process(o),c.process(o),u.process(o),d.process(o),f.process(o),p.process(o),o.isProcessing=!1,n&&t&&(r=!1,e(h))},y=()=>{n=!0,r=!0,o.isProcessing||e(h)};return{schedule:Ul.reduce((x,w)=>{const C=a[w];return x[w]=(O,v=!1,k=!1)=>(n||y(),C.schedule(O,v,k)),x},{}),cancel:x=>{for(let w=0;w<Ul.length;w++)a[Ul[w]].cancel(x)},state:o,steps:a}}const{schedule:Nd}=cy(queueMicrotask,!1),{schedule:wt,cancel:Wr,state:qt,steps:$d}=cy(typeof requestAnimationFrame<"u"?requestAnimationFrame:Bn,!0);let Hl;function cI(){Hl=void 0}const ar={now:()=>(Hl===void 0&&ar.set(qt.isProcessing||Ed.useManualTiming?qt.timestamp:performance.now()),Hl),set:e=>{Hl=e,queueMicrotask(cI)}},Yn={x:!1,y:!1};function uy(){return Yn.x||Yn.y}function uI(e){return e==="x"||e==="y"?Yn[e]?null:(Yn[e]=!0,()=>{Yn[e]=!1}):Yn.x||Yn.y?null:(Yn.x=Yn.y=!0,()=>{Yn.x=Yn.y=!1})}function dI(e,t,n){if(e instanceof EventTarget)return[e];if(typeof e=="string"){let r=document;const o=(n==null?void 0:n[e])??r.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function dy(e,t){const n=dI(e),r=new AbortController,o={passive:!0,...t,signal:r.signal};return[n,o,()=>r.abort()]}function fy(e){return!(e.pointerType==="touch"||uy())}function fI(e,t,n={}){const[r,o,i]=dy(e,n),a=l=>{if(!fy(l))return;const{target:c}=l,u=t(c,l);if(typeof u!="function"||!c)return;const d=f=>{fy(f)&&(u(f),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,o)};return r.forEach(l=>{l.addEventListener("pointerenter",a,o)}),i}const py=(e,t)=>t?e===t?!0:py(e,t.parentElement):!1,_d=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,pI=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function hI(e){return pI.has(e.tagName)||e.tabIndex!==-1}const Ri=new WeakSet;function hy(e){return t=>{t.key==="Enter"&&e(t)}}function Fd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const mI=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=hy(()=>{if(Ri.has(n))return;Fd(n,"down");const o=hy(()=>{Fd(n,"up")}),i=()=>Fd(n,"cancel");n.addEventListener("keyup",o,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function my(e){return _d(e)&&!uy()}function gI(e,t,n={}){const[r,o,i]=dy(e,n),a=l=>{const c=l.currentTarget;if(!my(l)||Ri.has(c))return;Ri.add(c);const u=t(c,l),d=(h,y)=>{window.removeEventListener("pointerup",f),window.removeEventListener("pointercancel",p),!(!my(h)||!Ri.has(c))&&(Ri.delete(c),typeof u=="function"&&u(h,{success:y}))},f=h=>{d(h,c===window||c===document||n.useGlobalTarget||py(c,h.target))},p=h=>{d(h,!1)};window.addEventListener("pointerup",f,o),window.addEventListener("pointercancel",p,o)};return r.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,o),l instanceof HTMLElement&&(l.addEventListener("focus",u=>mI(u,o)),!hI(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}const gy=30,yI=e=>!isNaN(parseFloat(e));class bI{constructor(t,n={}){this.version="12.7.3",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,o=!0)=>{const i=ar.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),o&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ar.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=yI(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&Wl(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Md);const r=this.events[t].add(n);return t==="change"?()=>{r(),wt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ar.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>gy)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,gy);return ny(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Di(e,t){return new bI(e,t)}const yy=R.createContext({strict:!1}),by={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"]},ds={};for(const e in by)ds[e]={isEnabled:t=>by[e].some(n=>!!t[n])};function vI(e){for(const t in e)ds[t]={...ds[t],...e[t]}}const xI=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 ql(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||xI.has(e)}let vy=e=>!ql(e);function wI(e){e&&(vy=t=>t.startsWith("on")?!ql(t):e(t))}try{wI(require("@emotion/is-prop-valid").default)}catch{}function CI(e,t,n){const r={};for(const o in e)o==="values"&&typeof e.values=="object"||(vy(o)||n===!0&&ql(o)||!t&&!ql(o)||e.draggable&&o.startsWith("onDrag"))&&(r[o]=e[o]);return r}function SI(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>(process.env.NODE_ENV!=="production"&&Wl(!1,"motion() is deprecated. Use motion.create() instead."),e(...r));return new Proxy(n,{get:(r,o)=>o==="create"?e:(t.has(o)||t.set(o,e(o)),t.get(o))})}const Yl=R.createContext({});function Gl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ii(e){return typeof e=="string"||Array.isArray(e)}const Bd=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Ld=["initial",...Bd];function Kl(e){return Gl(e.animate)||Ld.some(t=>Ii(e[t]))}function xy(e){return!!(Kl(e)||e.variants)}function TI(e,t){if(Kl(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ii(n)?n:void 0,animate:Ii(r)?r:void 0}}return e.inherit!==!1?t:{}}function OI(e){const{initial:t,animate:n}=TI(e,R.useContext(Yl));return R.useMemo(()=>({initial:t,animate:n}),[wy(t),wy(n)])}function wy(e){return Array.isArray(e)?e.join(" "):e}const kI=Symbol.for("motionComponentSymbol");function fs(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function EI(e,t,n){return R.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):fs(n)&&(n.current=r))},[t])}const Vd=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),Cy="data-"+Vd("framerAppearId"),Sy=R.createContext({});function PI(e,t,n,r,o){var m,b;const{visualElement:i}=R.useContext(Yl),a=R.useContext(yy),l=R.useContext(Ll),c=R.useContext(Td).reducedMotion,u=R.useRef(null);r=r||a.renderer,!u.current&&r&&(u.current=r(e,{visualState:t,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,f=R.useContext(Sy);d&&!d.projection&&o&&(d.type==="html"||d.type==="svg")&&MI(u.current,n,o,f);const p=R.useRef(!1);R.useInsertionEffect(()=>{d&&p.current&&d.update(n,l)});const h=n[Cy],y=R.useRef(!!h&&!((m=window.MotionHandoffIsComplete)!=null&&m.call(window,h))&&((b=window.MotionHasOptimisedAnimation)==null?void 0:b.call(window,h)));return Qg(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),Nd.render(d.render),y.current&&d.animationState&&d.animationState.animateChanges())}),R.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{var x;(x=window.MotionHandoffMarkAsComplete)==null||x.call(window,h)}),y.current=!1))}),d}function MI(e,t,n,r){const{layoutId:o,layout:i,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Ty(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!a||l&&fs(l),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:u})}function Ty(e){if(e)return e.options.allowProjection!==!1?e.projection:Ty(e.parent)}function RI({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:o}){e&&vI(e);function i(l,c){let u;const d={...R.useContext(Td),...l,layoutId:DI(l)},{isStatic:f}=d,p=OI(l),h=r(l,f);if(!f&&Sd){II(d,e);const y=AI(d);u=y.MeasureLayout,p.visualElement=PI(o,h,d,t,y.ProjectionNode)}return g.jsxs(Yl.Provider,{value:p,children:[u&&p.visualElement?g.jsx(u,{visualElement:p.visualElement,...d}):null,n(o,l,EI(h,p.visualElement,c),h,f,p.visualElement)]})}i.displayName=`motion.${typeof o=="string"?o:`create(${o.displayName??o.name??""})`}`;const a=R.forwardRef(i);return a[kI]=o,a}function DI({layoutId:e}){const t=R.useContext(wd).id;return t&&e!==void 0?t+"-"+e:e}function II(e,t){const n=R.useContext(yy).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const r="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?us(!1,r):Vr(!1,r)}}function AI(e){const{drag:t,layout:n}=ds;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t!=null&&t.isEnabled(e)||n!=null&&n.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const Oy=e=>t=>typeof t=="string"&&t.startsWith(e),Wd=Oy("--"),jI=Oy("var(--"),zd=e=>jI(e)?NI.test(e.split("/*")[0].trim()):!1,NI=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Ai={};function $I(e){for(const t in e)Ai[t]=e[t],Wd(t)&&(Ai[t].isCSSVariable=!0)}const ps=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],lo=new Set(ps);function ky(e,{layout:t,layoutId:n}){return lo.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Ai[e]||e==="opacity")}const Xt=e=>!!(e&&e.getVelocity),Ey=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Or=(e,t,n)=>n>t?t:n<e?e:n,hs={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},ji={...hs,transform:e=>Or(0,1,e)},Xl={...hs,default:1},Ni=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),zr=Ni("deg"),lr=Ni("%"),_e=Ni("px"),_I=Ni("vh"),FI=Ni("vw"),Py={...lr,parse:e=>lr.parse(e)/100,transform:e=>lr.transform(e*100)},BI={borderWidth:_e,borderTopWidth:_e,borderRightWidth:_e,borderBottomWidth:_e,borderLeftWidth:_e,borderRadius:_e,radius:_e,borderTopLeftRadius:_e,borderTopRightRadius:_e,borderBottomRightRadius:_e,borderBottomLeftRadius:_e,width:_e,maxWidth:_e,height:_e,maxHeight:_e,top:_e,right:_e,bottom:_e,left:_e,padding:_e,paddingTop:_e,paddingRight:_e,paddingBottom:_e,paddingLeft:_e,margin:_e,marginTop:_e,marginRight:_e,marginBottom:_e,marginLeft:_e,backgroundPositionX:_e,backgroundPositionY:_e},LI={rotate:zr,rotateX:zr,rotateY:zr,rotateZ:zr,scale:Xl,scaleX:Xl,scaleY:Xl,scaleZ:Xl,skew:zr,skewX:zr,skewY:zr,distance:_e,translateX:_e,translateY:_e,translateZ:_e,x:_e,y:_e,z:_e,perspective:_e,transformPerspective:_e,opacity:ji,originX:Py,originY:Py,originZ:_e},My={...hs,transform:Math.round},Ud={...BI,...LI,zIndex:My,size:_e,fillOpacity:ji,strokeOpacity:ji,numOctaves:My},VI={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},WI=ps.length;function zI(e,t,n){let r="",o=!0;for(let i=0;i<WI;i++){const a=ps[i],l=e[a];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(a.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=Ey(l,Ud[a]);if(!c){o=!1;const d=VI[a]||a;r+=`${d}(${u}) `}n&&(t[a]=u)}}return r=r.trim(),n?r=n(t,o?"":r):o&&(r="none"),r}function Hd(e,t,n){const{style:r,vars:o,transformOrigin:i}=e;let a=!1,l=!1;for(const c in t){const u=t[c];if(lo.has(c)){a=!0;continue}else if(Wd(c)){o[c]=u;continue}else{const d=Ey(u,Ud[c]);c.startsWith("origin")?(l=!0,i[c]=d):r[c]=d}}if(t.transform||(a||n?r.transform=zI(t,e.transform,n):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=i;r.transformOrigin=`${c} ${u} ${d}`}}const qd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Ry(e,t,n){for(const r in t)!Xt(t[r])&&!ky(r,n)&&(e[r]=t[r])}function UI({transformTemplate:e},t){return R.useMemo(()=>{const n=qd();return Hd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function HI(e,t){const n=e.style||{},r={};return Ry(r,n,e),Object.assign(r,UI(e,t)),r}function qI(e,t){const n={},r=HI(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const YI=["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 Yd(e){return typeof e!="string"||e.includes("-")?!1:!!(YI.indexOf(e)>-1||/[A-Z]/u.test(e))}const GI={offset:"stroke-dashoffset",array:"stroke-dasharray"},KI={offset:"strokeDashoffset",array:"strokeDasharray"};function XI(e,t,n=1,r=0,o=!0){e.pathLength=1;const i=o?GI:KI;e[i.offset]=_e.transform(-r);const a=_e.transform(t),l=_e.transform(n);e[i.array]=`${a} ${l}`}function Dy(e,t,n){return typeof e=="string"?e:_e.transform(t+n*e)}function ZI(e,t,n){const r=Dy(t,e.x,e.width),o=Dy(n,e.y,e.height);return`${r} ${o}`}function Gd(e,{attrX:t,attrY:n,attrScale:r,originX:o,originY:i,pathLength:a,pathSpacing:l=1,pathOffset:c=0,...u},d,f){if(Hd(e,u,f),d){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:p,style:h,dimensions:y}=e;p.transform&&(y&&(h.transform=p.transform),delete p.transform),y&&(o!==void 0||i!==void 0||h.transform)&&(h.transformOrigin=ZI(y,o!==void 0?o:.5,i!==void 0?i:.5)),t!==void 0&&(p.x=t),n!==void 0&&(p.y=n),r!==void 0&&(p.scale=r),a!==void 0&&XI(p,a,l,c,!1)}const Iy=()=>({...qd(),attrs:{}}),Kd=e=>typeof e=="string"&&e.toLowerCase()==="svg";function JI(e,t,n,r){const o=R.useMemo(()=>{const i=Iy();return Gd(i,t,Kd(r),e.transformTemplate),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Ry(i,e.style,e),o.style={...i,...o.style}}return o}function QI(e=!1){return(n,r,o,{latestValues:i},a)=>{const c=(Yd(n)?JI:qI)(r,i,a,n),u=CI(r,typeof n=="string",e),d=n!==R.Fragment?{...u,...c,ref:o}:{},{children:f}=r,p=R.useMemo(()=>Xt(f)?f.get():f,[f]);return R.createElement(n,{...d,children:p})}}function Ay(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function Xd(e,t,n,r){if(typeof t=="function"){const[o,i]=Ay(r);t=t(n!==void 0?n:e.custom,o,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[o,i]=Ay(r);t=t(n!==void 0?n:e.custom,o,i)}return t}const Zd=e=>Array.isArray(e),eA=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),tA=e=>Zd(e)?e[e.length-1]||0:e;function Zl(e){const t=Xt(e)?e.get():e;return eA(t)?t.toValue():t}function nA({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,o,i){const a={latestValues:rA(r,o,i,e),renderState:t()};return n&&(a.onMount=l=>n({props:r,current:l,...a}),a.onUpdate=l=>n(l)),a}const jy=e=>(t,n)=>{const r=R.useContext(Yl),o=R.useContext(Ll),i=()=>nA(e,t,r,o);return n?i():Cd(i)};function rA(e,t,n,r){const o={},i=r(e,{});for(const p in i)o[p]=Zl(i[p]);let{initial:a,animate:l}=e;const c=Kl(e),u=xy(e);t&&u&&!c&&e.inherit!==!1&&(a===void 0&&(a=t.initial),l===void 0&&(l=t.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const f=d?l:a;if(f&&typeof f!="boolean"&&!Gl(f)){const p=Array.isArray(f)?f:[f];for(let h=0;h<p.length;h++){const y=Xd(e,p[h]);if(y){const{transitionEnd:m,transition:b,...x}=y;for(const w in x){let C=x[w];if(Array.isArray(C)){const O=d?C.length-1:0;C=C[O]}C!==null&&(o[w]=C)}for(const w in m)o[w]=m[w]}}}return o}function Jd(e,t,n){var i;const{style:r}=e,o={};for(const a in r)(Xt(r[a])||t.style&&Xt(t.style[a])||ky(a,e)||((i=n==null?void 0:n.getValue(a))==null?void 0:i.liveStyle)!==void 0)&&(o[a]=r[a]);return o}const oA={useVisualState:jy({scrapeMotionValuesFromProps:Jd,createRenderState:qd})};function Ny(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function $y(e,{style:t,vars:n},r,o){Object.assign(e.style,t,o&&o.getProjectionStyles(r));for(const i in n)e.style.setProperty(i,n[i])}const _y=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 Fy(e,t,n,r){$y(e,t,void 0,r);for(const o in t.attrs)e.setAttribute(_y.has(o)?o:Vd(o),t.attrs[o])}function By(e,t,n){const r=Jd(e,t,n);for(const o in e)if(Xt(e[o])||Xt(t[o])){const i=ps.indexOf(o)!==-1?"attr"+o.charAt(0).toUpperCase()+o.substring(1):o;r[i]=e[o]}return r}const Ly=["x","y","width","height","cx","cy","r"],sA={useVisualState:jy({scrapeMotionValuesFromProps:By,createRenderState:Iy,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:o})=>{if(!n)return;let i=!!e.drag;if(!i){for(const l in o)if(lo.has(l)){i=!0;break}}if(!i)return;let a=!t;if(t)for(let l=0;l<Ly.length;l++){const c=Ly[l];e[c]!==t[c]&&(a=!0)}a&&wt.read(()=>{Ny(n,r),wt.render(()=>{Gd(r,o,Kd(n.tagName),e.transformTemplate),Fy(n,r)})})}})};function iA(e,t){return function(r,{forwardMotionProps:o}={forwardMotionProps:!1}){const a={...Yd(r)?sA:oA,preloadedFeatures:e,useRender:QI(o),createVisualElement:t,Component:r};return RI(a)}}function $i(e,t,n){const r=e.getProps();return Xd(r,t,n!==void 0?n:r.custom,e)}const Vy=new Set(["width","height","top","left","right","bottom",...ps]);function aA(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Di(n))}function lA(e,t){const n=$i(e,t);let{transitionEnd:r={},transition:o={},...i}=n||{};i={...i,...r};for(const a in i){const l=tA(i[a]);aA(e,a,l)}}function cA(e){return!!(Xt(e)&&e.add)}function Qd(e,t){const n=e.getValue("willChange");if(cA(n))return n.add(t);if(!n&&Ed.WillChange){const r=new Ed.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function Wy(e){return e.props[Cy]}const zy=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,uA=1e-7,dA=12;function fA(e,t,n,r,o){let i,a,l=0;do a=t+(n-t)/2,i=zy(a,r,o)-e,i>0?n=a:t=a;while(Math.abs(i)>uA&&++l<dA);return a}function _i(e,t,n,r){if(e===t&&n===r)return Bn;const o=i=>fA(i,0,1,e,n);return i=>i===0||i===1?i:zy(o(i),t,r)}const Uy=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,Hy=e=>t=>1-e(1-t),qy=_i(.33,1.53,.69,.99),ef=Hy(qy),Yy=Uy(ef),Gy=e=>(e*=2)<1?.5*ef(e):.5*(2-Math.pow(2,-10*(e-1))),tf=e=>1-Math.sin(Math.acos(e)),Ky=Hy(tf),Xy=Uy(tf),Zy=e=>/^0[^.\s]+$/u.test(e);function pA(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Zy(e):!0}const Fi=e=>Math.round(e*1e5)/1e5,nf=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function hA(e){return e==null}const mA=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rf=(e,t)=>n=>!!(typeof n=="string"&&mA.test(n)&&n.startsWith(e)||t&&!hA(n)&&Object.prototype.hasOwnProperty.call(n,t)),Jy=(e,t,n)=>r=>{if(typeof r!="string")return r;const[o,i,a,l]=r.match(nf);return{[e]:parseFloat(o),[t]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},gA=e=>Or(0,255,e),of={...hs,transform:e=>Math.round(gA(e))},co={test:rf("rgb","red"),parse:Jy("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+of.transform(e)+", "+of.transform(t)+", "+of.transform(n)+", "+Fi(ji.transform(r))+")"};function yA(e){let t="",n="",r="",o="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),o=e.substring(4,5),t+=t,n+=n,r+=r,o+=o),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}}const sf={test:rf("#"),parse:yA,transform:co.transform},ms={test:rf("hsl","hue"),parse:Jy("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+lr.transform(Fi(t))+", "+lr.transform(Fi(n))+", "+Fi(ji.transform(r))+")"},Zt={test:e=>co.test(e)||sf.test(e)||ms.test(e),parse:e=>co.test(e)?co.parse(e):ms.test(e)?ms.parse(e):sf.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?co.transform(e):ms.transform(e)},bA=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function vA(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(nf))==null?void 0:t.length)||0)+(((n=e.match(bA))==null?void 0:n.length)||0)>0}const Qy="number",eb="color",xA="var",wA="var(",tb="${}",CA=/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 Bi(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},o=[];let i=0;const l=t.replace(CA,c=>(Zt.test(c)?(r.color.push(i),o.push(eb),n.push(Zt.parse(c))):c.startsWith(wA)?(r.var.push(i),o.push(xA),n.push(c)):(r.number.push(i),o.push(Qy),n.push(parseFloat(c))),++i,tb)).split(tb);return{values:n,split:l,indexes:r,types:o}}function nb(e){return Bi(e).values}function rb(e){const{split:t,types:n}=Bi(e),r=t.length;return o=>{let i="";for(let a=0;a<r;a++)if(i+=t[a],o[a]!==void 0){const l=n[a];l===Qy?i+=Fi(o[a]):l===eb?i+=Zt.transform(o[a]):i+=o[a]}return i}}const SA=e=>typeof e=="number"?0:e;function TA(e){const t=nb(e);return rb(e)(t.map(SA))}const Ur={test:vA,parse:nb,createTransformer:rb,getAnimatableNone:TA},OA=new Set(["brightness","contrast","saturate","opacity"]);function kA(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(nf)||[];if(!r)return e;const o=n.replace(r,"");let i=OA.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+o+")"}const EA=/\b([a-z-]*)\(.*?\)/gu,af={...Ur,getAnimatableNone:e=>{const t=e.match(EA);return t?t.map(kA).join(" "):e}},PA={...Ud,color:Zt,backgroundColor:Zt,outlineColor:Zt,fill:Zt,stroke:Zt,borderColor:Zt,borderTopColor:Zt,borderRightColor:Zt,borderBottomColor:Zt,borderLeftColor:Zt,filter:af,WebkitFilter:af},ob=e=>PA[e];function sb(e,t){let n=ob(e);return n!==af&&(n=Ur),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const MA=new Set(["auto","none","0"]);function RA(e,t,n){let r=0,o;for(;r<e.length&&!o;){const i=e[r];typeof i=="string"&&!MA.has(i)&&Bi(i).values.length&&(o=e[r]),r++}if(o&&n)for(const i of t)e[i]=sb(n,o)}const uo=e=>e*180/Math.PI,lf=e=>{const t=uo(Math.atan2(e[1],e[0]));return cf(t)},DA={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:lf,rotateZ:lf,skewX:e=>uo(Math.atan(e[1])),skewY:e=>uo(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},cf=e=>(e=e%360,e<0&&(e+=360),e),ib=lf,ab=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),lb=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),IA={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:ab,scaleY:lb,scale:e=>(ab(e)+lb(e))/2,rotateX:e=>cf(uo(Math.atan2(e[6],e[5]))),rotateY:e=>cf(uo(Math.atan2(-e[2],e[0]))),rotateZ:ib,rotate:ib,skewX:e=>uo(Math.atan(e[4])),skewY:e=>uo(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function cb(e){return e.includes("scale")?1:0}function uf(e,t){if(!e||e==="none")return cb(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,o;if(n)r=IA,o=n;else{const l=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=DA,o=l}if(!o)return cb(t);const i=r[t],a=o[1].split(",").map(jA);return typeof i=="function"?i(a):a[i]}const AA=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return uf(n,t)};function jA(e){return parseFloat(e.trim())}const ub=e=>e===hs||e===_e,NA=new Set(["x","y","z"]),$A=ps.filter(e=>!NA.has(e));function _A(e){const t=[];return $A.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const gs={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>uf(t,"x"),y:(e,{transform:t})=>uf(t,"y")};gs.translateX=gs.x,gs.translateY=gs.y;const fo=new Set;let df=!1,ff=!1;function db(){if(ff){const e=Array.from(fo).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const o=_A(r);o.length&&(n.set(r,o),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const o=n.get(r);o&&o.forEach(([i,a])=>{var l;(l=r.getValue(i))==null||l.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}ff=!1,df=!1,fo.forEach(e=>e.complete()),fo.clear()}function fb(){fo.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ff=!0)})}function FA(){fb(),db()}class pf{constructor(t,n,r,o,i,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=o,this.element=i,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(fo.add(this),df||(df=!0,wt.read(fb),wt.resolveKeyframes(db))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:o}=this;for(let i=0;i<t.length;i++)if(t[i]===null)if(i===0){const a=o==null?void 0:o.get(),l=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const c=r.readValue(n,l);c!=null&&(t[0]=c)}t[0]===void 0&&(t[0]=l),o&&a===void 0&&o.set(t[0])}else t[i]=t[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),fo.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,fo.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const pb=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),BA=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function LA(e){const t=BA.exec(e);if(!t)return[,];const[,n,r,o]=t;return[`--${n??r}`,o]}const VA=4;function hb(e,t,n=1){Vr(n<=VA,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,o]=LA(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const a=i.trim();return pb(a)?parseFloat(a):a}return zd(o)?hb(o,t,n+1):o}const mb=e=>t=>t.test(e),gb=[hs,_e,lr,zr,FI,_I,{test:e=>e==="auto",parse:e=>e}],yb=e=>gb.find(mb(e));class bb extends pf{constructor(t,n,r,o,i){super(t,n,r,o,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<t.length;c++){let u=t[c];if(typeof u=="string"&&(u=u.trim(),zd(u))){const d=hb(u,n.current);d!==void 0&&(t[c]=d),c===t.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Vy.has(r)||t.length!==2)return;const[o,i]=t,a=yb(o),l=yb(i);if(a!==l)if(ub(a)&&ub(l))for(let c=0;c<t.length;c++){const u=t[c];typeof u=="string"&&(t[c]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let o=0;o<t.length;o++)pA(t[o])&&r.push(o);r.length&&RA(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=gs[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const o=n[n.length-1];o!==void 0&&t.getValue(r,o).jump(o,!1)}measureEndState(){var l;const{element:t,name:n,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(n);o&&o.jump(this.measuredOrigin,!1);const i=r.length-1,a=r[i];r[i]=gs[n](t.measureViewportBox(),window.getComputedStyle(t.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}}const vb=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(Ur.test(e)||e==="0")&&!e.startsWith("url("));function WA(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function zA(e,t,n,r){const o=e[0];if(o===null)return!1;if(t==="display"||t==="visibility")return!0;const i=e[e.length-1],a=vb(o,t),l=vb(i,t);return us(a===l,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!a||!l?!1:WA(e)||(n==="spring"||Id(n))&&r}const UA=e=>e!==null;function Jl(e,{repeat:t,repeatType:n="loop"},r){const o=e.filter(UA),i=t&&n!=="loop"&&t%2===1?0:o.length-1;return!i||r===void 0?o[i]:r}const HA=40;class xb{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ar.now(),this.options={autoplay:t,delay:n,type:r,repeat:o,repeatDelay:i,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>HA?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&FA(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=ar.now(),this.hasAttemptedResolve=!0;const{name:r,type:o,velocity:i,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!zA(t,r,o,i))if(a)this.options.duration=0;else{c&&c(Jl(t,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(t,n);d!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const Et=(e,t,n)=>e+(t-e)*n;function hf(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function qA({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let o=0,i=0,a=0;if(!t)o=i=a=n;else{const l=n<.5?n*(1+t):n+t-n*t,c=2*n-l;o=hf(c,l,e+1/3),i=hf(c,l,e),a=hf(c,l,e-1/3)}return{red:Math.round(o*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:r}}function Ql(e,t){return n=>n>0?t:e}const mf=(e,t,n)=>{const r=e*e,o=n*(t*t-r)+r;return o<0?0:Math.sqrt(o)},YA=[sf,co,ms],GA=e=>YA.find(t=>t.test(e));function wb(e){const t=GA(e);if(us(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let n=t.parse(e);return t===ms&&(n=qA(n)),n}const Cb=(e,t)=>{const n=wb(e),r=wb(t);if(!n||!r)return Ql(e,t);const o={...n};return i=>(o.red=mf(n.red,r.red,i),o.green=mf(n.green,r.green,i),o.blue=mf(n.blue,r.blue,i),o.alpha=Et(n.alpha,r.alpha,i),co.transform(o))},KA=(e,t)=>n=>t(e(n)),Li=(...e)=>e.reduce(KA),gf=new Set(["none","hidden"]);function XA(e,t){return gf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function ZA(e,t){return n=>Et(e,t,n)}function yf(e){return typeof e=="number"?ZA:typeof e=="string"?zd(e)?Ql:Zt.test(e)?Cb:ej:Array.isArray(e)?Sb:typeof e=="object"?Zt.test(e)?Cb:JA:Ql}function Sb(e,t){const n=[...e],r=n.length,o=e.map((i,a)=>yf(i)(i,t[a]));return i=>{for(let a=0;a<r;a++)n[a]=o[a](i);return n}}function JA(e,t){const n={...e,...t},r={};for(const o in n)e[o]!==void 0&&t[o]!==void 0&&(r[o]=yf(e[o])(e[o],t[o]));return o=>{for(const i in r)n[i]=r[i](o);return n}}function QA(e,t){const n=[],r={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const i=t.types[o],a=e.indexes[i][r[i]],l=e.values[a]??0;n[o]=l,r[i]++}return n}const ej=(e,t)=>{const n=Ur.createTransformer(t),r=Bi(e),o=Bi(t);return r.indexes.var.length===o.indexes.var.length&&r.indexes.color.length===o.indexes.color.length&&r.indexes.number.length>=o.indexes.number.length?gf.has(e)&&!o.values.length||gf.has(t)&&!r.values.length?XA(e,t):Li(Sb(QA(r,o),o.values),n):(us(!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.`),Ql(e,t))};function Tb(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Et(e,t,n):yf(e)(e,t)}const tj=5;function Ob(e,t,n){const r=Math.max(t-tj,0);return ny(n-e(r),t-r)}const Pt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},kb=.001;function nj({duration:e=Pt.duration,bounce:t=Pt.bounce,velocity:n=Pt.velocity,mass:r=Pt.mass}){let o,i;us(e<=qn(Pt.maxDuration),"Spring duration must be 10 seconds or less");let a=1-t;a=Or(Pt.minDamping,Pt.maxDamping,a),e=Or(Pt.minDuration,Pt.maxDuration,ir(e)),a<1?(o=u=>{const d=u*a,f=d*e,p=d-n,h=bf(u,a),y=Math.exp(-f);return kb-p/h*y},i=u=>{const f=u*a*e,p=f*n+n,h=Math.pow(a,2)*Math.pow(u,2)*e,y=Math.exp(-f),m=bf(Math.pow(u,2),a);return(-o(u)+kb>0?-1:1)*((p-h)*y)/m}):(o=u=>{const d=Math.exp(-u*e),f=(u-n)*e+1;return-.001+d*f},i=u=>{const d=Math.exp(-u*e),f=(n-u)*(e*e);return d*f});const l=5/e,c=oj(o,i,l);if(e=qn(e),isNaN(c))return{stiffness:Pt.stiffness,damping:Pt.damping,duration:e};{const u=Math.pow(c,2)*r;return{stiffness:u,damping:a*2*Math.sqrt(r*u),duration:e}}}const rj=12;function oj(e,t,n){let r=n;for(let o=1;o<rj;o++)r=r-e(r)/t(r);return r}function bf(e,t){return e*Math.sqrt(1-t*t)}const sj=["duration","bounce"],ij=["stiffness","damping","mass"];function Eb(e,t){return t.some(n=>e[n]!==void 0)}function aj(e){let t={velocity:Pt.velocity,stiffness:Pt.stiffness,damping:Pt.damping,mass:Pt.mass,isResolvedFromDuration:!1,...e};if(!Eb(e,ij)&&Eb(e,sj))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),o=r*r,i=2*Or(.05,1,1-(e.bounce||0))*Math.sqrt(o);t={...t,mass:Pt.mass,stiffness:o,damping:i}}else{const n=nj(e);t={...t,...n,mass:Pt.mass},t.isResolvedFromDuration=!0}return t}function ec(e=Pt.visualDuration,t=Pt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:o}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:u,mass:d,duration:f,velocity:p,isResolvedFromDuration:h}=aj({...n,velocity:-ir(n.velocity||0)}),y=p||0,m=u/(2*Math.sqrt(c*d)),b=a-i,x=ir(Math.sqrt(c/d)),w=Math.abs(b)<5;r||(r=w?Pt.restSpeed.granular:Pt.restSpeed.default),o||(o=w?Pt.restDelta.granular:Pt.restDelta.default);let C;if(m<1){const v=bf(x,m);C=k=>{const E=Math.exp(-m*x*k);return a-E*((y+m*x*b)/v*Math.sin(v*k)+b*Math.cos(v*k))}}else if(m===1)C=v=>a-Math.exp(-x*v)*(b+(y+x*b)*v);else{const v=x*Math.sqrt(m*m-1);C=k=>{const E=Math.exp(-m*x*k),M=Math.min(v*k,300);return a-E*((y+m*x*b)*Math.sinh(M)+v*b*Math.cosh(M))/v}}const O={calculatedDuration:h&&f||null,next:v=>{const k=C(v);if(h)l.done=v>=f;else{let E=0;m<1&&(E=v===0?qn(y):Ob(C,v,k));const M=Math.abs(E)<=r,D=Math.abs(a-k)<=o;l.done=M&&D}return l.value=l.done?a:k,l},toString:()=>{const v=Math.min(jd(O),zl),k=sy(E=>O.next(v*E).value,v,30);return v+"ms "+k},toTransition:()=>{}};return O}ec.applyToOptions=e=>{const t=iI(e,100,ec);return e.ease=Pi()?t.ease:"easeOut",e.duration=qn(t.duration),e.type="keyframes",e};function Pb({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const f=e[0],p={done:!1,value:f},h=M=>l!==void 0&&M<l||c!==void 0&&M>c,y=M=>l===void 0?c:c===void 0||Math.abs(l-M)<Math.abs(c-M)?l:c;let m=n*t;const b=f+m,x=a===void 0?b:a(b);x!==b&&(m=x-f);const w=M=>-m*Math.exp(-M/r),C=M=>x+w(M),O=M=>{const D=w(M),A=C(M);p.done=Math.abs(D)<=u,p.value=p.done?x:A};let v,k;const E=M=>{h(p.value)&&(v=M,k=ec({keyframes:[p.value,y(p.value)],velocity:Ob(C,M,p.value),damping:o,stiffness:i,restDelta:u,restSpeed:d}))};return E(0),{calculatedDuration:null,next:M=>{let D=!1;return!k&&v===void 0&&(D=!0,O(M),E(M)),v!==void 0&&M>=v?k.next(M-v):(!D&&O(M),p)}}}const lj=_i(.42,0,1,1),cj=_i(0,0,.58,1),Mb=_i(.42,0,.58,1),uj=e=>Array.isArray(e)&&typeof e[0]!="number",Rb={linear:Bn,easeIn:lj,easeInOut:Mb,easeOut:cj,circIn:tf,circInOut:Xy,circOut:Ky,backIn:ef,backInOut:Yy,backOut:qy,anticipate:Gy},Db=e=>{if(Rd(e)){Vr(e.length===4,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,o]=e;return _i(t,n,r,o)}else if(typeof e=="string")return Vr(Rb[e]!==void 0,`Invalid easing type '${e}'`),Rb[e];return e};function dj(e,t,n){const r=[],o=n||Tb,i=e.length-1;for(let a=0;a<i;a++){let l=o(e[a],e[a+1]);if(t){const c=Array.isArray(t)?t[a]||Bn:t;l=Li(c,l)}r.push(l)}return r}function fj(e,t,{clamp:n=!0,ease:r,mixer:o}={}){const i=e.length;if(Vr(i===t.length,"Both input and output ranges must be the same length"),i===1)return()=>t[0];if(i===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const l=dj(t,r,o),c=l.length,u=d=>{if(a&&d<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(d<e[f+1]);f++);const p=Ei(e[f],e[f+1],d);return l[f](p)};return n?d=>u(Or(e[0],e[i-1],d)):u}function pj(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const o=Ei(0,t,r);e.push(Et(n,1,o))}}function hj(e){const t=[0];return pj(t,e.length-1),t}function mj(e,t){return e.map(n=>n*t)}function gj(e,t){return e.map(()=>t||Mb).splice(0,e.length-1)}function Vi({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const o=uj(r)?r.map(Db):Db(r),i={done:!1,value:t[0]},a=mj(n&&n.length===t.length?n:hj(t),e),l=fj(a,t,{ease:Array.isArray(o)?o:gj(t,o)});return{calculatedDuration:e,next:c=>(i.value=l(c),i.done=c>=e,i)}}const yj=e=>{const t=({timestamp:n})=>e(n);return{start:()=>wt.update(t,!0),stop:()=>Wr(t),now:()=>qt.isProcessing?qt.timestamp:ar.now()}},bj={decay:Pb,inertia:Pb,tween:Vi,keyframes:Vi,spring:ec},vj=e=>e/100;class vf extends xb{constructor(t){super(t),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,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:r,element:o,keyframes:i}=this.options,a=(o==null?void 0:o.KeyframeResolver)||pf,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(i,l,n,r,o),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:i,velocity:a=0}=this.options,l=Id(n)?n:bj[n]||Vi;let c,u;process.env.NODE_ENV!=="production"&&l!==Vi&&Vr(t.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),l!==Vi&&typeof t[0]!="number"&&(c=Li(vj,Tb(t[0],t[1])),t=[0,100]);const d=l({...this.options,keyframes:t});i==="mirror"&&(u=l({...this.options,keyframes:[...t].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=jd(d));const{calculatedDuration:f}=d,p=f+o,h=p*(r+1)-o;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:f,resolvedDuration:p,totalDuration:h}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:M}=this.options;return{done:!0,value:M[M.length-1]}}const{finalKeyframe:o,generator:i,mirroredGenerator:a,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:f}=r;if(this.startTime===null)return i.next(0);const{delay:p,repeat:h,repeatType:y,repeatDelay:m,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-d/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const x=this.currentTime-p*(this.speed>=0?1:-1),w=this.speed>=0?x<0:x>d;this.currentTime=Math.max(x,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let C=this.currentTime,O=i;if(h){const M=Math.min(this.currentTime,d)/f;let D=Math.floor(M),A=M%1;!A&&M>=1&&(A=1),A===1&&D--,D=Math.min(D,h+1),!!(D%2)&&(y==="reverse"?(A=1-A,m&&(A-=m/f)):y==="mirror"&&(O=a)),C=Or(0,1,A)*f}const v=w?{done:!1,value:c[0]}:O.next(C);l&&(v.value=l(v.value));let{done:k}=v;!w&&u!==null&&(k=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const E=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&k);return E&&o!==void 0&&(v.value=Jl(c,this.options,o)),b&&b(v.value),E&&this.finish(),v}get duration(){const{resolved:t}=this;return t?ir(t.calculatedDuration):0}get time(){return ir(this.currentTime)}set time(t){t=qn(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=ir(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=yj,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(i=>this.tick(i))),n&&n();const o=this.driver.now();this.holdTime!==null?this.startTime=o-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=o):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&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(t){return this.startTime=0,this.tick(t,!0)}get finished(){return this.currentFinishedPromise}}const xj=new Set(["opacity","clipPath","filter","transform"]),wj=Pd(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),tc=10,Cj=2e4;function Sj(e){return Id(e.type)||e.type==="spring"||!ay(e.ease)}function Tj(e,t){const n=new vf({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const o=[];let i=0;for(;!r.done&&i<Cj;)r=n.sample(i),o.push(r.value),i+=tc;return{times:void 0,keyframes:o,duration:i-tc,ease:"linear"}}const Ib={anticipate:Gy,backInOut:Yy,circInOut:Xy};function Oj(e){return e in Ib}class Ab extends xb{constructor(t){super(t);const{name:n,motionValue:r,element:o,keyframes:i}=this.options;this.resolver=new bb(i,(a,l)=>this.onKeyframesResolved(a,l),n,r,o),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:o,ease:i,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&Pi()&&Oj(i)&&(i=Ib[i]),Sj(this.options)){const{onComplete:f,onUpdate:p,motionValue:h,element:y,...m}=this.options,b=Tj(t,m);t=b.keyframes,t.length===1&&(t[1]=t[0]),r=b.duration,o=b.times,i=b.ease,a="keyframes"}const d=sI(l.owner.current,c,t,{...this.options,duration:r,times:o,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(ly(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:f}=this.options;l.set(Jl(t,this.options,n)),f&&f(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:r,times:o,type:a,ease:i,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return ir(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return ir(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=qn(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Bn;const{animation:r}=n;ly(r,t)}return Bn}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:o,type:i,ease:a,times:l}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:f,element:p,...h}=this.options,y=new vf({...h,keyframes:r,duration:o,type:i,ease:a,times:l,isGenerator:!0}),m=qn(this.time);u.setWithVelocity(y.sample(m-tc).value,y.sample(m).value,tc)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:o,repeatType:i,damping:a,type:l}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return wj()&&r&&xj.has(r)&&(r!=="transform"||!u)&&!c&&!o&&i!=="mirror"&&a!==0&&l!=="inertia"}}const kj={type:"spring",stiffness:500,damping:25,restSpeed:10},Ej=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Pj={type:"keyframes",duration:.8},Mj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Rj=(e,{keyframes:t})=>t.length>2?Pj:lo.has(e)?e.startsWith("scale")?Ej(t[1]):kj:Mj;function Dj({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const xf=(e,t,n,r={},o,i)=>a=>{const l=Ad(r,e)||{},c=l.delay||r.delay||0;let{elapsed:u=0}=r;u=u-qn(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-u,onUpdate:p=>{t.set(p),l.onUpdate&&l.onUpdate(p)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:e,motionValue:t,element:i?void 0:o};Dj(l)||(d={...d,...Rj(e,d)}),d.duration&&(d.duration=qn(d.duration)),d.repeatDelay&&(d.repeatDelay=qn(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let f=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(f=!0)),d.allowFlatten=!l.type&&!l.ease,f&&!i&&t.get()!==void 0){const p=Jl(d.keyframes,l);if(p!==void 0)return wt.update(()=>{d.onUpdate(p),d.onComplete()}),new nI([])}return!i&&Ab.supports(d)?new Ab(d):new vf(d)};function Ij({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function jb(e,t,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(i=r);const c=[],u=o&&e.animationState&&e.animationState.getState()[o];for(const d in l){const f=e.getValue(d,e.latestValues[d]??null),p=l[d];if(p===void 0||u&&Ij(u,d))continue;const h={delay:n,...Ad(i||{},d)};let y=!1;if(window.MotionHandoffAnimation){const b=Wy(e);if(b){const x=window.MotionHandoffAnimation(b,d,wt);x!==null&&(h.startTime=x,y=!0)}}Qd(e,d),f.start(xf(d,f,p,e.shouldReduceMotion&&Vy.has(d)?{type:!1}:h,e,y));const m=f.animation;m&&c.push(m)}return a&&Promise.all(c).then(()=>{wt.update(()=>{a&&lA(e,a)})}),c}function wf(e,t,n={}){var c;const r=$i(e,t,n.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(jb(e,r,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:f,staggerDirection:p}=o;return Aj(e,t,d+u,f,p,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[u,d]=l==="beforeChildren"?[i,a]:[a,i];return u().then(()=>d())}else return Promise.all([i(),a(n.delay)])}function Aj(e,t,n=0,r=0,o=1,i){const a=[],l=(e.variantChildren.size-1)*r,c=o===1?(u=0)=>u*r:(u=0)=>l-u*r;return Array.from(e.variantChildren).sort(jj).forEach((u,d)=>{u.notify("AnimationStart",t),a.push(wf(u,t,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",t)))}),Promise.all(a)}function jj(e,t){return e.sortNodePosition(t)}function Nj(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const o=t.map(i=>wf(e,i,n));r=Promise.all(o)}else if(typeof t=="string")r=wf(e,t,n);else{const o=typeof t=="function"?$i(e,t,n.custom):t;r=Promise.all(jb(e,o,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}function Nb(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}const $j=Ld.length;function $b(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?$b(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<$j;n++){const r=Ld[n],o=e.props[r];(Ii(o)||o===!1)&&(t[r]=o)}return t}const _j=[...Bd].reverse(),Fj=Bd.length;function Bj(e){return t=>Promise.all(t.map(({animation:n,options:r})=>Nj(e,n,r)))}function Lj(e){let t=Bj(e),n=_b(),r=!0;const o=c=>(u,d)=>{var p;const f=$i(e,d,c==="exit"?(p=e.presenceContext)==null?void 0:p.custom:void 0);if(f){const{transition:h,transitionEnd:y,...m}=f;u={...u,...m,...y}}return u};function i(c){t=c(e)}function a(c){const{props:u}=e,d=$b(e.parent)||{},f=[],p=new Set;let h={},y=1/0;for(let b=0;b<Fj;b++){const x=_j[b],w=n[x],C=u[x]!==void 0?u[x]:d[x],O=Ii(C),v=x===c?w.isActive:null;v===!1&&(y=b);let k=C===d[x]&&C!==u[x]&&O;if(k&&r&&e.manuallyAnimateOnMount&&(k=!1),w.protectedKeys={...h},!w.isActive&&v===null||!C&&!w.prevProp||Gl(C)||typeof C=="boolean")continue;const E=Vj(w.prevProp,C);let M=E||x===c&&w.isActive&&!k&&O||b>y&&O,D=!1;const A=Array.isArray(C)?C:[C];let $=A.reduce(o(x),{});v===!1&&($={});const{prevResolvedValues:I={}}=w,W={...I,...$},j=N=>{M=!0,p.has(N)&&(D=!0,p.delete(N)),w.needsAnimating[N]=!0;const L=e.getValue(N);L&&(L.liveStyle=!1)};for(const N in W){const L=$[N],H=I[N];if(h.hasOwnProperty(N))continue;let V=!1;Zd(L)&&Zd(H)?V=!Nb(L,H):V=L!==H,V?L!=null?j(N):p.add(N):L!==void 0&&p.has(N)?j(N):w.protectedKeys[N]=!0}w.prevProp=C,w.prevResolvedValues=$,w.isActive&&(h={...h,...$}),r&&e.blockInitialAnimation&&(M=!1),M&&(!(k&&E)||D)&&f.push(...A.map(N=>({animation:N,options:{type:x}})))}if(p.size){const b={};if(typeof u.initial!="boolean"){const x=$i(e,Array.isArray(u.initial)?u.initial[0]:u.initial);x&&x.transition&&(b.transition=x.transition)}p.forEach(x=>{const w=e.getBaseTarget(x),C=e.getValue(x);C&&(C.liveStyle=!0),b[x]=w??null}),f.push({animation:b})}let m=!!f.length;return r&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(m=!1),r=!1,m?t(f):Promise.resolve()}function l(c,u){var f;if(n[c].isActive===u)return Promise.resolve();(f=e.variantChildren)==null||f.forEach(p=>{var h;return(h=p.animationState)==null?void 0:h.setActive(c,u)}),n[c].isActive=u;const d=a(c);for(const p in n)n[p].protectedKeys={};return d}return{animateChanges:a,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=_b(),r=!0}}}function Vj(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!Nb(t,e):!1}function po(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function _b(){return{animate:po(!0),whileInView:po(),whileHover:po(),whileTap:po(),whileDrag:po(),whileFocus:po(),exit:po()}}class Hr{constructor(t){this.isMounted=!1,this.node=t}update(){}}class Wj extends Hr{constructor(t){super(t),t.animationState||(t.animationState=Lj(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Gl(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let zj=0;class Uj extends Hr{constructor(){super(...arguments),this.id=zj++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t);n&&!t&&o.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const Hj={animation:{Feature:Wj},exit:{Feature:Uj}};function Wi(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function zi(e){return{point:{x:e.pageX,y:e.pageY}}}const qj=e=>t=>_d(t)&&e(t,zi(t));function Ui(e,t,n,r){return Wi(e,t,qj(n),r)}function Fb({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Yj({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Gj(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}const Bb=1e-4,Kj=1-Bb,Xj=1+Bb,Lb=.01,Zj=0-Lb,Jj=0+Lb;function on(e){return e.max-e.min}function Qj(e,t,n){return Math.abs(e-t)<=n}function Vb(e,t,n,r=.5){e.origin=r,e.originPoint=Et(t.min,t.max,e.origin),e.scale=on(n)/on(t),e.translate=Et(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Kj&&e.scale<=Xj||isNaN(e.scale))&&(e.scale=1),(e.translate>=Zj&&e.translate<=Jj||isNaN(e.translate))&&(e.translate=0)}function Hi(e,t,n,r){Vb(e.x,t.x,n.x,r?r.originX:void 0),Vb(e.y,t.y,n.y,r?r.originY:void 0)}function Wb(e,t,n){e.min=n.min+t.min,e.max=e.min+on(t)}function eN(e,t,n){Wb(e.x,t.x,n.x),Wb(e.y,t.y,n.y)}function zb(e,t,n){e.min=t.min-n.min,e.max=e.min+on(t)}function qi(e,t,n){zb(e.x,t.x,n.x),zb(e.y,t.y,n.y)}const Ub=()=>({translate:0,scale:1,origin:0,originPoint:0}),ys=()=>({x:Ub(),y:Ub()}),Hb=()=>({min:0,max:0}),_t=()=>({x:Hb(),y:Hb()});function Ln(e){return[e("x"),e("y")]}function Cf(e){return e===void 0||e===1}function Sf({scale:e,scaleX:t,scaleY:n}){return!Cf(e)||!Cf(t)||!Cf(n)}function ho(e){return Sf(e)||qb(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function qb(e){return Yb(e.x)||Yb(e.y)}function Yb(e){return e&&e!=="0%"}function nc(e,t,n){const r=e-n,o=t*r;return n+o}function Gb(e,t,n,r,o){return o!==void 0&&(e=nc(e,o,r)),nc(e,n,r)+t}function Tf(e,t=0,n=1,r,o){e.min=Gb(e.min,t,n,r,o),e.max=Gb(e.max,t,n,r,o)}function Kb(e,{x:t,y:n}){Tf(e.x,t.translate,t.scale,t.originPoint),Tf(e.y,n.translate,n.scale,n.originPoint)}const Xb=.999999999999,Zb=1.0000000000001;function tN(e,t,n,r=!1){const o=n.length;if(!o)return;t.x=t.y=1;let i,a;for(let l=0;l<o;l++){i=n[l],a=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&vs(e,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,Kb(e,a)),r&&ho(i.latestValues)&&vs(e,i.latestValues))}t.x<Zb&&t.x>Xb&&(t.x=1),t.y<Zb&&t.y>Xb&&(t.y=1)}function bs(e,t){e.min=e.min+t,e.max=e.max+t}function Jb(e,t,n,r,o=.5){const i=Et(e.min,e.max,o);Tf(e,t,n,i,r)}function vs(e,t){Jb(e.x,t.x,t.scaleX,t.scale,t.originX),Jb(e.y,t.y,t.scaleY,t.scale,t.originY)}function Qb(e,t){return Fb(Gj(e.getBoundingClientRect(),t))}function nN(e,t,n){const r=Qb(e,n),{scroll:o}=t;return o&&(bs(r.x,o.offset.x),bs(r.y,o.offset.y)),r}const ev=({current:e})=>e?e.ownerDocument.defaultView:null,tv=(e,t)=>Math.abs(e-t);function rN(e,t){const n=tv(e.x,t.x),r=tv(e.y,t.y);return Math.sqrt(n**2+r**2)}class nv{constructor(t,n,{transformPagePoint:r,contextWindow:o,dragSnapToOrigin:i=!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 f=kf(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,h=rN(f.offset,{x:0,y:0})>=3;if(!p&&!h)return;const{point:y}=f,{timestamp:m}=qt;this.history.push({...y,timestamp:m});const{onStart:b,onMove:x}=this.handlers;p||(b&&b(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=Of(p,this.transformPagePoint),wt.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:h,onSessionEnd:y,resumeAnimation:m}=this.handlers;if(this.dragSnapToOrigin&&m&&m(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const b=kf(f.type==="pointercancel"?this.lastMoveEventInfo:Of(p,this.transformPagePoint),this.history);this.startEvent&&h&&h(f,b),y&&y(f,b)},!_d(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.contextWindow=o||window;const a=zi(t),l=Of(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=qt;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(t,kf(l,this.history)),this.removeListeners=Li(Ui(this.contextWindow,"pointermove",this.handlePointerMove),Ui(this.contextWindow,"pointerup",this.handlePointerUp),Ui(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Wr(this.updatePoint)}}function Of(e,t){return t?{point:t(e.point)}:e}function rv(e,t){return{x:e.x-t.x,y:e.y-t.y}}function kf({point:e},t){return{point:e,delta:rv(e,ov(t)),offset:rv(e,oN(t)),velocity:sN(t,.1)}}function oN(e){return e[0]}function ov(e){return e[e.length-1]}function sN(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const o=ov(e);for(;n>=0&&(r=e[n],!(o.timestamp-r.timestamp>qn(t)));)n--;if(!r)return{x:0,y:0};const i=ir(o.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const a={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function iN(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Et(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Et(n,e,r.max):Math.min(e,n)),e}function sv(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function aN(e,{top:t,left:n,bottom:r,right:o}){return{x:sv(e.x,n,o),y:sv(e.y,t,r)}}function iv(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function lN(e,t){return{x:iv(e.x,t.x),y:iv(e.y,t.y)}}function cN(e,t){let n=.5;const r=on(e),o=on(t);return o>r?n=Ei(t.min,t.max-r,e.min):r>o&&(n=Ei(e.min,e.max-o,t.min)),Or(0,1,n)}function uN(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Ef=.35;function dN(e=Ef){return e===!1?e=0:e===!0&&(e=Ef),{x:av(e,"left","right"),y:av(e,"top","bottom")}}function av(e,t,n){return{min:lv(e,t),max:lv(e,n)}}function lv(e,t){return typeof e=="number"?e:e[t]||0}const fN=new WeakMap;class pN{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=_t(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=d=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(zi(d).point)},i=(d,f)=>{const{drag:p,dragPropagation:h,onDragStart:y}=this.getProps();if(p&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=uI(p),!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),Ln(b=>{let x=this.getAxisMotionValue(b).get()||0;if(lr.test(x)){const{projection:w}=this.visualElement;if(w&&w.layout){const C=w.layout.layoutBox[b];C&&(x=on(C)*(parseFloat(x)/100))}}this.originPoint[b]=x}),y&&wt.postRender(()=>y(d,f)),Qd(this.visualElement,"transform");const{animationState:m}=this.visualElement;m&&m.setActive("whileDrag",!0)},a=(d,f)=>{const{dragPropagation:p,dragDirectionLock:h,onDirectionLock:y,onDrag:m}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:b}=f;if(h&&this.currentDirection===null){this.currentDirection=hN(b),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",f.point,b),this.updateAxis("y",f.point,b),this.visualElement.render(),m&&m(d,f)},l=(d,f)=>this.stop(d,f),c=()=>Ln(d=>{var f;return this.getAnimationState(d)==="paused"&&((f=this.getAxisMotionValue(d).animation)==null?void 0:f.play())}),{dragSnapToOrigin:u}=this.getProps();this.panSession=new nv(t,{onSessionStart:o,onStart:i,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:ev(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:o}=n;this.startAnimation(o);const{onDragEnd:i}=this.getProps();i&&wt.postRender(()=>i(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:o}=this.getProps();if(!r||!rc(t,o,this.currentDirection))return;const i=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=iN(a,this.constraints[t],this.elastic[t])),i.set(a)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,o=this.constraints;t&&fs(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=aN(r.layoutBox,t):this.constraints=!1,this.elastic=dN(n),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ln(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=uN(r.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!fs(t))return!1;const r=t.current;Vr(r!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:o}=this.visualElement;if(!o||!o.layout)return!1;const i=nN(r,o.root,this.visualElement.getTransformPagePoint());let a=lN(o.layout.layoutBox,i);if(n){const l=n(Yj(a));this.hasMutatedConstraints=!!l,l&&(a=Fb(l))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:o,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Ln(d=>{if(!rc(d,n,this.currentDirection))return;let f=c&&c[d]||{};a&&(f={min:0,max:0});const p=o?200:1e6,h=o?40:1e7,y={type:"inertia",velocity:r?t[d]:0,bounceStiffness:p,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10,...i,...f};return this.startAxisValueAnimation(d,y)});return Promise.all(u).then(l)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Qd(this.visualElement,t),r.start(xf(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ln(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Ln(t=>{var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)==null?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),o=r[n];return o||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Ln(n=>{const{drag:r}=this.getProps();if(!rc(n,r,this.currentDirection))return;const{projection:o}=this.visualElement,i=this.getAxisMotionValue(n);if(o&&o.layout){const{min:a,max:l}=o.layout.layoutBox[n];i.set(t[n]-Et(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!fs(n)||!r||!this.constraints)return;this.stopAnimation();const o={x:0,y:0};Ln(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();o[a]=cN({min:c,max:c},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Ln(a=>{if(!rc(a,t,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(Et(c,u,o[a]))})}addListeners(){if(!this.visualElement.current)return;fN.set(this.visualElement,this);const t=this.visualElement.current,n=Ui(t,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),r=()=>{const{dragConstraints:c}=this.getProps();fs(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:o}=this.visualElement,i=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),wt.read(r);const a=Wi(window,"resize",()=>this.scalePositionWithinConstraints()),l=o.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ln(d=>{const f=this.getAxisMotionValue(d);f&&(this.originPoint[d]+=c[d].translate,f.set(f.get()+c[d].translate))}),this.visualElement.render())});return()=>{a(),n(),i(),l&&l()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:o=!1,dragConstraints:i=!1,dragElastic:a=Ef,dragMomentum:l=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:o,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function rc(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function hN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class mN extends Hr{constructor(t){super(t),this.removeGroupControls=Bn,this.removeListeners=Bn,this.controls=new pN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Bn}unmount(){this.removeGroupControls(),this.removeListeners()}}const cv=e=>(t,n)=>{e&&wt.postRender(()=>e(t,n))};class gN extends Hr{constructor(){super(...arguments),this.removePointerDownListener=Bn}onPointerDown(t){this.session=new nv(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ev(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:o}=this.node.getProps();return{onSessionStart:cv(t),onStart:cv(n),onMove:r,onEnd:(i,a)=>{delete this.session,o&&wt.postRender(()=>o(i,a))}}}mount(){this.removePointerDownListener=Ui(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const oc={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function uv(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Yi={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(_e.test(e))e=parseFloat(e);else return e;const n=uv(e,t.target.x),r=uv(e,t.target.y);return`${n}% ${r}%`}},yN={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,o=Ur.parse(e);if(o.length>5)return r;const i=Ur.createTransformer(e),a=typeof o[0]!="number"?1:0,l=n.x.scale*t.x,c=n.y.scale*t.y;o[0+a]/=l,o[1+a]/=c;const u=Et(l,c,.5);return typeof o[2+a]=="number"&&(o[2+a]/=u),typeof o[3+a]=="number"&&(o[3+a]/=u),i(o)}};class bN extends R.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:o}=this.props,{projection:i}=t;$I(vN),i&&(n.group&&n.group.add(i),r&&r.register&&o&&r.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),oc.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:o,isPresent:i}=this.props,a=r.projection;return a&&(a.isPresent=i,o||t.layoutDependency!==n||n===void 0||t.isPresent!==i?a.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?a.promote():a.relegate()||wt.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Nd.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:o}=t;o&&(o.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(o),r&&r.deregister&&r.deregister(o))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function dv(e){const[t,n]=ey(),r=R.useContext(wd);return g.jsx(bN,{...e,layoutGroup:r,switchLayoutGroup:R.useContext(Sy),isPresent:t,safeToRemove:n})}const vN={borderRadius:{...Yi,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Yi,borderTopRightRadius:Yi,borderBottomLeftRadius:Yi,borderBottomRightRadius:Yi,boxShadow:yN};function xN(e,t,n){const r=Xt(e)?e:Di(e);return r.start(xf("",r,t,n)),r.animation}function wN(e){return e instanceof SVGElement&&e.tagName!=="svg"}const CN=(e,t)=>e.depth-t.depth;class SN{constructor(){this.children=[],this.isDirty=!1}add(t){Od(this.children,t),this.isDirty=!0}remove(t){kd(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(CN),this.isDirty=!1,this.children.forEach(t)}}function TN(e,t){const n=ar.now(),r=({timestamp:o})=>{const i=o-n;i>=t&&(Wr(r),e(i-t))};return wt.read(r,!0),()=>Wr(r)}const fv=["TopLeft","TopRight","BottomLeft","BottomRight"],ON=fv.length,pv=e=>typeof e=="string"?parseFloat(e):e,hv=e=>typeof e=="number"||_e.test(e);function kN(e,t,n,r,o,i){o?(e.opacity=Et(0,n.opacity??1,EN(r)),e.opacityExit=Et(t.opacity??1,0,PN(r))):i&&(e.opacity=Et(t.opacity??1,n.opacity??1,r));for(let a=0;a<ON;a++){const l=`border${fv[a]}Radius`;let c=mv(t,l),u=mv(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||hv(c)===hv(u)?(e[l]=Math.max(Et(pv(c),pv(u),r),0),(lr.test(u)||lr.test(c))&&(e[l]+="%")):e[l]=u}(t.rotate||n.rotate)&&(e.rotate=Et(t.rotate||0,n.rotate||0,r))}function mv(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const EN=gv(0,.5,Ky),PN=gv(.5,.95,Bn);function gv(e,t,n){return r=>r<e?0:r>t?1:n(Ei(e,t,r))}function yv(e,t){e.min=t.min,e.max=t.max}function Vn(e,t){yv(e.x,t.x),yv(e.y,t.y)}function bv(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function vv(e,t,n,r,o){return e-=t,e=nc(e,1/n,r),o!==void 0&&(e=nc(e,1/o,r)),e}function MN(e,t=0,n=1,r=.5,o,i=e,a=e){if(lr.test(t)&&(t=parseFloat(t),t=Et(a.min,a.max,t/100)-a.min),typeof t!="number")return;let l=Et(i.min,i.max,r);e===i&&(l-=t),e.min=vv(e.min,t,n,l,o),e.max=vv(e.max,t,n,l,o)}function xv(e,t,[n,r,o],i,a){MN(e,t[n],t[r],t[o],t.scale,i,a)}const RN=["x","scaleX","originX"],DN=["y","scaleY","originY"];function wv(e,t,n,r){xv(e.x,t,RN,n?n.x:void 0,r?r.x:void 0),xv(e.y,t,DN,n?n.y:void 0,r?r.y:void 0)}function Cv(e){return e.translate===0&&e.scale===1}function Sv(e){return Cv(e.x)&&Cv(e.y)}function Tv(e,t){return e.min===t.min&&e.max===t.max}function IN(e,t){return Tv(e.x,t.x)&&Tv(e.y,t.y)}function Ov(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function kv(e,t){return Ov(e.x,t.x)&&Ov(e.y,t.y)}function Ev(e){return on(e.x)/on(e.y)}function Pv(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class AN{constructor(){this.members=[]}add(t){Od(this.members,t),t.scheduleRender()}remove(t){if(kd(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(o=>t===o);if(n===0)return!1;let r;for(let o=n;o>=0;o--){const i=this.members[o];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:o}=t.options;o===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function jN(e,t,n){let r="";const o=e.x.translate/t.x,i=e.y.translate/t.y,a=(n==null?void 0:n.z)||0;if((o||i||a)&&(r=`translate3d(${o}px, ${i}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:f,rotateY:p,skewX:h,skewY:y}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),f&&(r+=`rotateX(${f}deg) `),p&&(r+=`rotateY(${p}deg) `),h&&(r+=`skewX(${h}deg) `),y&&(r+=`skewY(${y}deg) `)}const l=e.x.scale*t.x,c=e.y.scale*t.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const Pf=["","X","Y","Z"],NN={visibility:"hidden"},Mv=1e3;let $N=0;function Mf(e,t,n,r){const{latestValues:o}=t;o[e]&&(n[e]=o[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Rv(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Wy(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:o,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",wt,!(o||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Rv(r)}function Dv({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(a={},l=t==null?void 0:t()){this.id=$N++,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,this.nodes.forEach(BN),this.nodes.forEach(UN),this.nodes.forEach(HN),this.nodes.forEach(LN)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new SN)}addEventListener(a,l){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new Md),this.eventHandlers.get(a).add(l)}notifyListeners(a,...l){const c=this.eventHandlers.get(a);c&&c.notify(...l)}hasListeners(a){return this.eventHandlers.has(a)}mount(a,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=wN(a),this.instance=a;const{layoutId:c,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(u||c)&&(this.isLayoutDirty=!0),e){let f;const p=()=>this.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,f&&f(),f=TN(p,250),oc.hasAnimatedSinceResize&&(oc.hasAnimatedSinceResize=!1,this.nodes.forEach(Av))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:f,hasLayoutChanged:p,hasRelativeLayoutChanged:h,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const m=this.options.transition||d.getDefaultTransition()||XN,{onLayoutAnimationStart:b,onLayoutAnimationComplete:x}=d.getProps(),w=!this.targetLayout||!kv(this.targetLayout,y),C=!p&&h;if(this.options.layoutRoot||this.resumeFrom||C||p&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(f,C);const O={...Ad(m,"layout"),onPlay:b,onComplete:x};(d.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else p||Av(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Wr(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(qN),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Rv(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const f=this.path[d];f.shouldResetTransform=!0,f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Iv);return}this.isUpdating||this.nodes.forEach(WN),this.isUpdating=!1,this.nodes.forEach(zN),this.nodes.forEach(_N),this.nodes.forEach(FN),this.clearAllSnapshots();const l=ar.now();qt.delta=Or(0,1e3/60,l-qt.timestamp),qt.timestamp=l,qt.isProcessing=!0,$d.update.process(qt),$d.preRender.process(qt),$d.render.process(qt),qt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Nd.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(VN),this.sharedNodes.forEach(YN)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,wt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){wt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!on(this.snapshot.measuredBox.x)&&!on(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutCorrected=_t(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(l=!1),l){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!o)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!Sv(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;a&&(l||ho(this.latestValues)||d)&&(o(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return a&&(c=this.removeTransform(c)),ZN(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;const{visualElement:a}=this.options;if(!a)return _t();const l=a.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(JN))){const{scroll:d}=this.root;d&&(bs(l.x,d.offset.x),bs(l.y,d.offset.y))}return l}removeElementScroll(a){var c;const l=_t();if(Vn(l,a),(c=this.scroll)!=null&&c.wasRoot)return l;for(let u=0;u<this.path.length;u++){const d=this.path[u],{scroll:f,options:p}=d;d!==this.root&&f&&p.layoutScroll&&(f.wasRoot&&Vn(l,a),bs(l.x,f.offset.x),bs(l.y,f.offset.y))}return l}applyTransform(a,l=!1){const c=_t();Vn(c,a);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&vs(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),ho(d.latestValues)&&vs(c,d.latestValues)}return ho(this.latestValues)&&vs(c,this.latestValues),c}removeTransform(a){const l=_t();Vn(l,a);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!ho(u.latestValues))continue;Sf(u.latestValues)&&u.updateSnapshot();const d=_t(),f=u.measurePageBox();Vn(d,f),wv(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return ho(this.latestValues)&&wv(l,this.latestValues),l}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}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!==qt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var p;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:f}=this.options;if(!(!this.layout||!(d||f))){if(this.resolvedRelativeTargetAt=qt.timestamp,!this.targetDelta&&!this.relativeTarget){const h=this.getClosestProjectingParent();h&&h.layout&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_t(),this.relativeTargetOrigin=_t(),qi(this.relativeTargetOrigin,this.layout.layoutBox,h.layout.layoutBox),Vn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=_t(),this.targetWithTransforms=_t()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),eN(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Vn(this.target,this.layout.layoutBox),Kb(this.target,this.targetDelta)):Vn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const h=this.getClosestProjectingParent();h&&!!h.resumingFrom==!!this.resumingFrom&&!h.options.layoutScroll&&h.target&&this.animationProgress!==1?(this.relativeParent=h,this.forceRelativeParentToResolveTarget(),this.relativeTarget=_t(),this.relativeTargetOrigin=_t(),qi(this.relativeTargetOrigin,this.target,h.target),Vn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||Sf(this.parent.latestValues)||qb(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 y;const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===qt.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;Vn(this.layoutCorrected,this.layout.layoutBox);const f=this.treeScale.x,p=this.treeScale.y;tN(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=_t());const{target:h}=a;if(!h){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(bv(this.prevProjectionDelta.x,this.projectionDelta.x),bv(this.prevProjectionDelta.y,this.projectionDelta.y)),Hi(this.projectionDelta,this.layoutCorrected,h,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==p||!Pv(this.projectionDelta.x,this.prevProjectionDelta.x)||!Pv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",h))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),a){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ys(),this.projectionDelta=ys(),this.projectionDeltaWithTransform=ys()}setAnimationOrigin(a,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},f=ys();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const p=_t(),h=c?c.source:void 0,y=this.layout?this.layout.source:void 0,m=h!==y,b=this.getStack(),x=!b||b.members.length<=1,w=!!(m&&!x&&this.options.crossfade===!0&&!this.path.some(KN));this.animationProgress=0;let C;this.mixTargetDelta=O=>{const v=O/1e3;jv(f.x,a.x,v),jv(f.y,a.y,v),this.setTargetDelta(f),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qi(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),GN(this.relativeTarget,this.relativeTargetOrigin,p,v),C&&IN(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=_t()),Vn(C,this.relativeTarget)),m&&(this.animationValues=d,kN(d,u,this.latestValues,v,w,x)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=v},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Wr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=wt.update(()=>{oc.hasAnimatedSinceResize=!0,this.currentAnimation=xN(0,Mv,{...a,onUpdate:l=>{this.mixTargetDelta(l),a.onUpdate&&a.onUpdate(l)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.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 a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Mv),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&Bv(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||_t();const f=on(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+f;const p=on(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+p}Vn(l,c),vs(l,d),Hi(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new AN),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var l;const{layoutId:a}=this.options;return a?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:a}=this.options;return a?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Mf("z",a,u,this.animationValues);for(let d=0;d<Pf.length;d++)Mf(`rotate${Pf[d]}`,a,u,this.animationValues),Mf(`skew${Pf[d]}`,a,u,this.animationValues);a.render();for(const d in u)a.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);a.scheduleRender()}getProjectionStyles(a){if(!this.instance||this.isSVG)return;if(!this.isVisible)return NN;const l={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,l.opacity="",l.pointerEvents=Zl(a==null?void 0:a.pointerEvents)||"",l.transform=c?c(this.latestValues,""):"none",l;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const h={};return this.options.layoutId&&(h.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,h.pointerEvents=Zl(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!ho(this.latestValues)&&(h.transform=c?c({},""):"none",this.hasProjected=!1),h}const d=u.animationValues||u.latestValues;this.applyTransformsToTarget(),l.transform=jN(this.projectionDeltaWithTransform,this.treeScale,d),c&&(l.transform=c(d,l.transform));const{x:f,y:p}=this.projectionDelta;l.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,u.animationValues?l.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:l.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const h in Ai){if(d[h]===void 0)continue;const{correct:y,applyTo:m,isCSSVariable:b}=Ai[h],x=l.transform==="none"?d[h]:y(d[h],u);if(m){const w=m.length;for(let C=0;C<w;C++)l[m[C]]=x}else b?this.options.visualElement.renderState.vars[h]=x:l[h]=x}return this.options.layoutId&&(l.pointerEvents=u===this?Zl(a==null?void 0:a.pointerEvents)||"":"none"),l}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var l;return(l=a.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(Iv),this.root.sharedNodes.clear()}}}function _N(e){e.updateLayout()}function FN(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:o}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;i==="size"?Ln(f=>{const p=a?t.measuredBox[f]:t.layoutBox[f],h=on(p);p.min=r[f].min,p.max=p.min+h}):Bv(i,t.layoutBox,r)&&Ln(f=>{const p=a?t.measuredBox[f]:t.layoutBox[f],h=on(r[f]);p.max=p.min+h,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+h)});const l=ys();Hi(l,r,t.layoutBox);const c=ys();a?Hi(c,e.applyTransform(o,!0),t.measuredBox):Hi(c,r,t.layoutBox);const u=!Sv(l);let d=!1;if(!e.resumeFrom){const f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){const{snapshot:p,layout:h}=f;if(p&&h){const y=_t();qi(y,t.layoutBox,p.layoutBox);const m=_t();qi(m,r,h.layoutBox),kv(y,m)||(d=!0),f.options.layoutRoot&&(e.relativeTarget=m,e.relativeTargetOrigin=y,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:c,layoutDelta:l,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function BN(e){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 LN(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function VN(e){e.clearSnapshot()}function Iv(e){e.clearMeasurements()}function WN(e){e.isLayoutDirty=!1}function zN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Av(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function UN(e){e.resolveTargetDelta()}function HN(e){e.calcProjection()}function qN(e){e.resetSkewAndRotation()}function YN(e){e.removeLeadSnapshot()}function jv(e,t,n){e.translate=Et(t.translate,0,n),e.scale=Et(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function Nv(e,t,n,r){e.min=Et(t.min,n.min,r),e.max=Et(t.max,n.max,r)}function GN(e,t,n,r){Nv(e.x,t.x,n.x,r),Nv(e.y,t.y,n.y,r)}function KN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const XN={duration:.45,ease:[.4,0,.1,1]},$v=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),_v=$v("applewebkit/")&&!$v("chrome/")?Math.round:Bn;function Fv(e){e.min=_v(e.min),e.max=_v(e.max)}function ZN(e){Fv(e.x),Fv(e.y)}function Bv(e,t,n){return e==="position"||e==="preserve-aspect"&&!Qj(Ev(t),Ev(n),.2)}function JN(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const QN=Dv({attachResizeListener:(e,t)=>Wi(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Rf={current:void 0},Lv=Dv({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Rf.current){const e=new QN({});e.mount(window),e.setOptions({layoutScroll:!0}),Rf.current=e}return Rf.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),e6={pan:{Feature:gN},drag:{Feature:mN,ProjectionNode:Lv,MeasureLayout:dv}};function Vv(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const o="onHover"+n,i=r[o];i&&wt.postRender(()=>i(t,zi(t)))}class t6 extends Hr{mount(){const{current:t}=this.node;t&&(this.unmount=fI(t,(n,r)=>(Vv(this.node,r,"Start"),o=>Vv(this.node,o,"End"))))}unmount(){}}class n6 extends Hr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Li(Wi(this.node.current,"focus",()=>this.onFocus()),Wi(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Wv(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const o="onTap"+(n==="End"?"":n),i=r[o];i&&wt.postRender(()=>i(t,zi(t)))}class r6 extends Hr{mount(){const{current:t}=this.node;t&&(this.unmount=gI(t,(n,r)=>(Wv(this.node,r,"Start"),(o,{success:i})=>Wv(this.node,o,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const Df=new WeakMap,If=new WeakMap,o6=e=>{const t=Df.get(e.target);t&&t(e)},s6=e=>{e.forEach(o6)};function i6({root:e,...t}){const n=e||document;If.has(n)||If.set(n,{});const r=If.get(n),o=JSON.stringify(t);return r[o]||(r[o]=new IntersectionObserver(s6,{root:e,...t})),r[o]}function a6(e,t,n){const r=i6(t);return Df.set(e,n),r.observe(e),()=>{Df.delete(e),r.unobserve(e)}}const l6={some:0,all:1};class c6 extends Hr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:o="some",once:i}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof o=="number"?o:l6[o]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:f}=this.node.getProps(),p=u?d:f;p&&p(c)};return a6(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(u6(t,n))&&this.startObserver()}unmount(){}}function u6({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const d6={inView:{Feature:c6},tap:{Feature:r6},focus:{Feature:n6},hover:{Feature:t6}},f6={layout:{ProjectionNode:Lv,MeasureLayout:dv}},Af={current:null},zv={current:!1};function p6(){if(zv.current=!0,!!Sd)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Af.current=e.matches;e.addListener(t),t()}else Af.current=!1}const h6=[...gb,Zt,Ur],m6=e=>h6.find(mb(e)),g6=new WeakMap;function y6(e,t,n){for(const r in t){const o=t[r],i=n[r];if(Xt(o))e.addValue(r,o),process.env.NODE_ENV==="development"&&Wl(o.version==="12.7.3",`Attempting to mix Motion versions ${o.version} with 12.7.3 may not work as expected.`);else if(Xt(i))e.addValue(r,Di(o,{owner:e}));else if(i!==o)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(o):a.hasAnimated||a.set(o)}else{const a=e.getStaticValue(r);e.addValue(r,Di(a!==void 0?a:o,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Uv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class b6{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:o,blockInitialAnimation:i,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=pf,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const h=ar.now();this.renderScheduledAt<h&&(this.renderScheduledAt=h,wt.render(this.render,!1,!0))};const{latestValues:c,renderState:u,onUpdate:d}=a;this.onUpdate=d,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=o,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=Kl(n),this.isVariantNode=xy(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:f,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const h in p){const y=p[h];c[h]!==void 0&&Xt(y)&&y.set(c[h],!1)}}mount(t){this.current=t,g6.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),zv.current||p6(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Af.current,process.env.NODE_ENV!=="production"&&Wl(this.shouldReduceMotion!==!0,"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(){this.projection&&this.projection.unmount(),Wr(this.notifyUpdate),Wr(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=lo.has(t);r&&this.onBindTransform&&this.onBindTransform();const o=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&wt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{o(),i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in ds){const n=ds[t];if(!n)continue;const{isEnabled:r,Feature:o}=n;if(!this.features[t]&&o&&r(this.props)&&(this.features[t]=new o(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):_t()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<Uv.length;r++){const o=Uv[r];this.propEventSubscriptions[o]&&(this.propEventSubscriptions[o](),delete this.propEventSubscriptions[o]);const i="on"+o,a=t[i];a&&(this.propEventSubscriptions[o]=this.on(o,a))}this.prevMotionValues=y6(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=Di(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(pb(r)||Zy(r))?r=parseFloat(r):!m6(r)&&Ur.test(n)&&(r=sb(t,n)),this.setBaseTarget(t,Xt(r)?r.get():r)),Xt(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const a=Xd(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);a&&(r=a[t])}if(n&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Xt(o)?o:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Md),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Hv extends b6{constructor(){super(...arguments),this.KeyframeResolver=bb}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Xt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function v6(e){return window.getComputedStyle(e)}class x6 extends Hv{constructor(){super(...arguments),this.type="html",this.renderInstance=$y}readValueFromInstance(t,n){if(lo.has(n))return AA(t,n);{const r=v6(t),o=(Wd(n)?r.getPropertyValue(n):r[n])||0;return typeof o=="string"?o.trim():o}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Qb(t,n)}build(t,n,r){Hd(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return Jd(t,n,r)}}class w6 extends Hv{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=_t,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Ny(this.current,this.renderState)}}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(lo.has(n)){const r=ob(n);return r&&r.default||0}return n=_y.has(n)?n:Vd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return By(t,n,r)}onBindTransform(){this.current&&!this.renderState.dimensions&&wt.postRender(this.updateDimensions)}build(t,n,r){Gd(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,o){Fy(t,n,r,o)}mount(t){this.isSVGTag=Kd(t.tagName),super.mount(t)}}const C6=(e,t)=>Yd(e)?new w6(t):new x6(t,{allowProjection:e!==R.Fragment}),S6=iA({...Hj,...d6,...e6,...f6},C6),Gi=SI(S6),hn=({name:e,size:t=24,url:n,color:r="currentColor",style:o={},...i})=>{const{isPrimary:a}=i,l=n||Ke[e],u=It().palette.mode==="dark",d=a?"invert(0%) brightness(200%)":u?"invert(100%) sepia(0%) saturate(0%) hue-rotate(93deg) brightness(103%) contrast(103%)":"invert(48%) sepia(0%) saturate(0%) hue-rotate(181deg) brightness(95%) contrast(90%)";return l?g.jsx("img",{src:l,alt:`${e}-icon`,style:{filter:d,...o},...i}):null},T6=({showOptions:e,setShowOptions:t,buttonRef:n,options:r,onClick:o})=>{const i=R.useRef(null);return R.useEffect(()=>{let a;return e&&(a=setTimeout(()=>{const l=c=>{i!=null&&i.current&&!(i!=null&&i.current.contains(c.target))&&!(n!=null&&n.contains(c.target))&&t(!1)};document.addEventListener("mousedown",l),document._customLabelClickOutside=l},0)),()=>{clearTimeout(a),document._customLabelClickOutside&&(document.removeEventListener("mousedown",document._customLabelClickOutside),delete document._customLabelClickOutside)}},[e]),g.jsx(rs,{open:e,anchorEl:n,placement:"bottom",transition:!0,modifiers:[{name:"offset",options:{offset:[0,0]}},{name:"sameWidth",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:({state:a})=>{a.styles.popper.width=`${a.rects.reference.width}px`}}],style:{zIndex:1300},ref:i,children:({TransitionProps:a})=>g.jsx(Nr,{...a,timeout:100,children:g.jsx(ye,{sx:{background:l=>l.palette.primary.appBackground,border:l=>`1px solid ${l.palette.primary.notifyBorderColor}`,borderRadius:"0.7rem",width:"100%",padding:"0.3rem",maxHeight:"20rem",overflowY:"auto"},children:g.jsx(ye,{children:r==null?void 0:r.map((l,c)=>g.jsx(Fr,{sx:{opacity:1,pointerEvents:"auto",padding:"0rem",borderTop:c!==0?u=>`0.1rem solid ${u.palette.primary.notifyBorderColor}`:"none"},onClick:u=>{u.stopPropagation(),o(l)},children:g.jsx(ft,{direction:"row",alignItems:"center",justifyContent:"space-between",sx:{p:"0.5rem"},children:g.jsx(ft,{direction:"row",alignItems:"center",gap:"1rem",children:g.jsx(nt,{component:"h3",sx:{color:u=>u.palette.primary.notifyActiveText,fontWeight:"300",fontSize:"1.1rem",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:l.label})})})},c))})})})})},qv=({styles:e,label:t,disabled:n,onClick:r,...o})=>{var y,m;const i=It();let a=(t==null?void 0:t.length)*((t==null?void 0:t.length)>=10?6.5:7.5)+38||0;a=o!=null&&o.options?a+15:a;const[l,c]=R.useState(!1),u=R.useRef(null),[d,f]=R.useState(!1),[p,h]=R.useState(e==null?void 0:e.isAnimate);return g.jsxs(Gi.button,{ref:u,onMouseEnter:()=>p&&c(!0),onMouseLeave:()=>p&&c(!1),initial:{width:(e==null?void 0:e.width)||(!p&&t?`${a/10}rem`:"3.2rem"),borderRadius:"0.7rem"},animate:{width:p?`${l?a/10:3.2}rem`:t?`${a/10}rem`:"3.2rem"},whileHover:{backgroundColor:(y=e==null?void 0:e.hover)==null?void 0:y.backgroundColor,color:(m=e==null?void 0:e.hover)==null?void 0:m.color},transition:{duration:.2,ease:"easeInOut"},style:{height:"3.2rem",outline:"none",overflow:"hidden",backgroundColor:(e==null?void 0:e.variant)!=="outlined"?(e==null?void 0:e.colorType)==="secondary"?i.palette.brandColor.blue:(e==null?void 0:e.colorType)==="danger"?i.palette.brandColor.red:(e==null?void 0:e.colorType)==="empty"?i.palette.primary.notifyButtonBackground:i.palette.brandColor.orange:i.palette.primary.notifyBackground,border:(e==null?void 0:e.variant)==="outlined"||(e==null?void 0:e.colorType)==="empty"?`0.1rem solid ${i.palette.primary.notifyBorderColor}`:"none",display:"flex",cursor:"pointer",alignItems:"center",gap:l||!p?"0.5rem":0,color:(e==null?void 0:e.variant)==="outlined"||(e==null?void 0:e.colorType)==="empty"?i.palette.primary.notifyTextColor:"white",justifyContent:l?"flex-start":"center",padding:l||!p?"1.2rem":"0.8rem",whiteSpace:"nowrap",opacity:n?.6:1,cursor:n?"auto":"pointer",...e},disabled:n,layout:!0,onClick:()=>{!(o!=null&&o.options)&&r(),o!=null&&o.options&&(f(b=>!b),h(d))},...o,children:[(e==null?void 0:e.icon)&&(!(e!=null&&e.iconPosition)||(e==null?void 0:e.iconPosition)==="start")&&g.jsx(hn,{url:e==null?void 0:e.icon,isPrimary:e==null?void 0:e.iconPrimary}),t&&g.jsxs(Gi.div,{layout:!0,initial:{opacity:0,width:0},animate:{opacity:l||!p?1:0,width:l||!p?"auto":0},transition:{duration:.2,ease:"easeInOut",delay:l?.1:0},style:{overflow:"hidden",whiteSpace:"nowrap",display:"flex",justifyContent:"center",gap:"0.8rem"},children:[g.jsx(nt,{sx:{fontSize:"1.1rem"},children:t}),(o==null?void 0:o.options)&&(d?g.jsx(hn,{url:Ke.ArrowUpLight}):g.jsx(hn,{url:Ke.ArrowDownLight}))]}),(e==null?void 0:e.iconPosition)==="end"&&g.jsx(hn,{url:e==null?void 0:e.icon,isPrimary:e==null?void 0:e.iconPrimary}),g.jsx(T6,{showOptions:d,buttonRef:u==null?void 0:u.current,setShowOptions:f,options:o==null?void 0:o.options,onClick:r})]})};qv.propTypes={styles:s.object.isRequired,label:s.string};function mo({...e}){return g.jsx(Fn,{children:g.jsx(qv,{...e})})}function sc({...e}){return g.jsx(Fn,{children:g.jsx(U0,{id:e==null?void 0:e.id,icon:g.jsx(ye,{component:"img",src:Ke.Uncheck}),checkedIcon:g.jsx(ye,{component:"img",src:Ke.Check}),...e})})}const Yv=new Set;function O6(e,t="warning"){if(process.env.NODE_ENV==="production")return;const n=Array.isArray(e)?e.join(`
|
|
303
303
|
`):e;Yv.has(n)||(Yv.add(n),t==="error"?console.error(n):console.warn(n))}function k6(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}const kr=s.oneOfType([s.func,s.object]);function E6(e){if(typeof e!="string")throw new Error(process.env.NODE_ENV!=="production"?"MUI: `capitalize(string)` expects a string argument.":k6(7));return e.charAt(0).toUpperCase()+e.slice(1)}function jf(e){return e&&e.ownerDocument||document}const cr=typeof window<"u"?S.useLayoutEffect:S.useEffect;let Gv=0;function P6(e){const[t,n]=S.useState(e),r=e||t;return S.useEffect(()=>{t==null&&(Gv+=1,n(`mui-${Gv}`))},[t]),r}const Kv={...S}.useId;function ic(e){if(Kv!==void 0){const t=Kv();return e??t}return P6(e)}function xs({controlled:e,default:t,name:n,state:r="value"}){const{current:o}=S.useRef(e!==void 0),[i,a]=S.useState(t),l=o?e:i;if(process.env.NODE_ENV!=="production"){S.useEffect(()=>{o!==(e!==void 0)&&console.error([`MUI: A component is changing the ${o?"":"un"}controlled ${r} state of ${n} to be ${o?"un":""}controlled.`,"Elements should not switch from uncontrolled to controlled (or vice versa).",`Decide between using a controlled or uncontrolled ${n} element for the lifetime of the component.`,"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.","More info: https://fb.me/react-controlled-components"].join(`
|
|
304
304
|
`))},[r,n,e]);const{current:u}=S.useRef(t);S.useEffect(()=>{!o&&!Object.is(u,t)&&console.error([`MUI: A component is changing the default ${r} state of an uncontrolled ${n} after being initialized. To suppress this warning opt to use a controlled ${n}.`].join(`
|
|
305
305
|
`))},[JSON.stringify(t)])}const c=S.useCallback(u=>{o||a(u)},[]);return[l,c]}function Te(e){const t=S.useRef(e);return cr(()=>{t.current=e}),S.useRef((...n)=>(0,t.current)(...n)).current}function mn(...e){const t=S.useRef(void 0),n=S.useCallback(r=>{const o=e.map(i=>{if(i==null)return null;if(typeof i=="function"){const a=i,l=a(r);return typeof l=="function"?l:()=>{a(null)}}return i.current=r,()=>{i.current=null}});return()=>{o.forEach(i=>i==null?void 0:i())}},e);return S.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const Xv={};function M6(e,t){const n=S.useRef(Xv);return n.current===Xv&&(n.current=e(t)),n}const R6=[];function D6(e){S.useEffect(e,R6)}class Nf{constructor(){Lc(this,"currentId",null);Lc(this,"clear",()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)});Lc(this,"disposeEffect",()=>this.clear)}static create(){return new Nf}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}function ws(){const e=M6(Nf.create).current;return D6(e.disposeEffect),e}const I6={border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"};function At(e,t,n=void 0){const r={};for(const o in e){const i=e[o];let a="",l=!0;for(let c=0;c<i.length;c+=1){const u=i[c];u&&(a+=(l===!0?"":" ")+t(u),l=!1,n&&n[u]&&(a+=" "+n[u]))}r[o]=a}return r}const Zv=e=>e,A6=(()=>{let e=Zv;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Zv}}})(),j6={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Lt(e,t,n="Mui"){const r=j6[t];return r?`${n}-${r}`:`${A6.generate(e)}-${t}`}function Vt(e,t,n="Mui"){const r={};return t.forEach(o=>{r[o]=Lt(e,o,n)}),r}function N6(e){return typeof e=="string"}function $6(e,t,n){return e===void 0||N6(e)?t:{...t,ownerState:{...t.ownerState,...n}}}function _6(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function Jv(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function F6(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:o,className:i}=e;if(!t){const h=de(n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),y={...n==null?void 0:n.style,...o==null?void 0:o.style,...r==null?void 0:r.style},m={...n,...o,...r};return h.length>0&&(m.className=h),Object.keys(y).length>0&&(m.style=y),{props:m,internalRef:void 0}}const a=_6({...o,...r}),l=Jv(r),c=Jv(o),u=t(a),d=de(u==null?void 0:u.className,n==null?void 0:n.className,i,o==null?void 0:o.className,r==null?void 0:r.className),f={...u==null?void 0:u.style,...n==null?void 0:n.style,...o==null?void 0:o.style,...r==null?void 0:r.style},p={...u,...n,...c,...l};return d.length>0&&(p.className=d),Object.keys(f).length>0&&(p.style=f),{props:p,internalRef:u.ref}}function Ki(e,t,n){return typeof e=="function"?e(t,n):e}function dt(e){var f;const{elementType:t,externalSlotProps:n,ownerState:r,skipResolvingSlotProps:o=!1,...i}=e,a=o?{}:Ki(n,r),{props:l,internalRef:c}=F6({...i,externalSlotProps:a}),u=mn(c,a==null?void 0:a.ref,(f=e.additionalProps)==null?void 0:f.ref);return $6(t,{...l,ref:u},r)}const Xi=(e,t)=>e.length!==t.length?!1:t.every(n=>e.includes(n)),B6=({openTo:e,defaultOpenTo:t,views:n,defaultViews:r})=>{const o=n??r;let i;if(e!=null)i=e;else if(o.includes(t))i=t;else if(o.length>0)i=o[0];else throw new Error("MUI X: The `views` prop must contain at least one view.");return{views:o,openTo:i}},ac=(e,t,n)=>{let r=t;return r=e.setHours(r,e.getHours(n)),r=e.setMinutes(r,e.getMinutes(n)),r=e.setSeconds(r,e.getSeconds(n)),r=e.setMilliseconds(r,e.getMilliseconds(n)),r},Zi=({date:e,disableFuture:t,disablePast:n,maxDate:r,minDate:o,isDateDisabled:i,utils:a,timezone:l})=>{const c=ac(a,a.date(void 0,l),e);n&&a.isBefore(o,c)&&(o=c),t&&a.isAfter(r,c)&&(r=c);let u=e,d=e;for(a.isBefore(e,o)&&(u=o,d=null),a.isAfter(e,r)&&(d&&(d=r),u=null);u||d;){if(u&&a.isAfter(u,r)&&(u=null),d&&a.isBefore(d,o)&&(d=null),u){if(!i(u))return u;u=a.addDays(u,1)}if(d){if(!i(d))return d;d=a.addDays(d,-1)}}return null},L6=(e,t)=>e.isValid(t)?t:null,Qv=(e,t,n)=>t==null||!e.isValid(t)?n:t,V6=(e,t,n)=>!e.isValid(t)&&t!=null&&!e.isValid(n)&&n!=null?!0:e.isEqual(t,n),$f=(e,t)=>{const r=[e.startOfYear(t)];for(;r.length<12;){const o=r[r.length-1];r.push(e.addMonths(o,1))}return r},e2=(e,t,n)=>n==="date"?e.startOfDay(e.date(void 0,t)):e.date(void 0,t),W6=["year","month","day"],t2=e=>W6.includes(e),_f=(e,{format:t,views:n},r)=>{if(t!=null)return t;const o=e.formats;return Xi(n,["year"])?o.year:Xi(n,["month"])?o.month:Xi(n,["day"])?o.dayOfMonth:Xi(n,["month","year"])?`${o.month} ${o.year}`:Xi(n,["day","month"])?`${o.month} ${o.dayOfMonth}`:r?/en/.test(e.getCurrentLocaleCode())?o.normalDateWithWeekday:o.normalDate:o.keyboardDate},z6=(e,t)=>{const n=e.startOfWeek(t);return[0,1,2,3,4,5,6].map(r=>e.addDays(n,r))},U6=["hours","minutes","seconds"],H6=e=>U6.includes(e),n2=(e,t)=>t.getHours(e)*3600+t.getMinutes(e)*60+t.getSeconds(e),q6=(e,t)=>(n,r)=>e?t.isAfter(n,r):n2(n,t)>n2(r,t),ur={year:1,month:2,day:3,hours:4,minutes:5,seconds:6,milliseconds:7},Y6=e=>Math.max(...e.map(t=>ur[t.type]??1)),Ji=(e,t,n)=>{if(t===ur.year)return e.startOfYear(n);if(t===ur.month)return e.startOfMonth(n);if(t===ur.day)return e.startOfDay(n);let r=n;return t<ur.minutes&&(r=e.setMinutes(r,0)),t<ur.seconds&&(r=e.setSeconds(r,0)),t<ur.milliseconds&&(r=e.setMilliseconds(r,0)),r},G6=({props:e,utils:t,granularity:n,timezone:r,getTodayDate:o})=>{let i=o?o():Ji(t,n,e2(t,r));e.minDate!=null&&t.isAfterDay(e.minDate,i)&&(i=Ji(t,n,e.minDate)),e.maxDate!=null&&t.isBeforeDay(e.maxDate,i)&&(i=Ji(t,n,e.maxDate));const a=q6(e.disableIgnoringDatePartForTimeValidation??!1,t);return e.minTime!=null&&a(e.minTime,i)&&(i=Ji(t,n,e.disableIgnoringDatePartForTimeValidation?e.minTime:ac(t,i,e.minTime))),e.maxTime!=null&&a(i,e.maxTime)&&(i=Ji(t,n,e.disableIgnoringDatePartForTimeValidation?e.maxTime:ac(t,i,e.maxTime))),i},Ff=(e,t)=>{const n=e.formatTokenMap[t];if(n==null)throw new Error([`MUI X: The token "${t}" is not supported by the Date and Time Pickers.`,"Please try using another token or open an issue on https://github.com/mui/mui-x/issues/new/choose if you think it should be supported."].join(`
|
|
@@ -323,5 +323,5 @@ const theme2 = createTheme({ palette: {
|
|
|
323
323
|
`)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[D1]=this[D1]={accessors:{}}).accessors,o=this.prototype;function i(a){const l=wa(a);r[l]||(_V(o,a),r[l]=!0)}return te.isArray(t)?t.forEach(i):i(t),this}};gn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),te.reduceDescriptors(gn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}}),te.freezeMethods(gn);function Tp(e,t){const n=this||xa,r=t||n,o=gn.from(r.headers);let i=r.data;return te.forEach(e,function(l){i=l.call(n,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function I1(e){return!!(e&&e.__CANCEL__)}function Is(e,t,n){He.call(this,e??"canceled",He.ERR_CANCELED,t,n),this.name="CanceledError"}te.inherits(Is,He,{__CANCEL__:!0});function A1(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new He("Request failed with status code "+n.status,[He.ERR_BAD_REQUEST,He.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function FV(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function BV(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,i=0,a;return t=t!==void 0?t:1e3,function(c){const u=Date.now(),d=r[i];a||(a=u),n[o]=c,r[o]=u;let f=i,p=0;for(;f!==o;)p+=n[f++],f=f%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),u-a<t)return;const h=d&&u-d;return h?Math.round(p*1e3/h):void 0}}function LV(e,t){let n=0,r=1e3/t,o,i;const a=(u,d=Date.now())=>{n=d,o=null,i&&(clearTimeout(i),i=null),e.apply(null,u)};return[(...u)=>{const d=Date.now(),f=d-n;f>=r?a(u,d):(o=u,i||(i=setTimeout(()=>{i=null,a(o)},r-f)))},()=>o&&a(o)]}const Rc=(e,t,n=3)=>{let r=0;const o=BV(50,250);return LV(i=>{const a=i.loaded,l=i.lengthComputable?i.total:void 0,c=a-r,u=o(c),d=a<=l;r=a;const f={loaded:a,total:l,progress:l?a/l:void 0,bytes:c,rate:u||void 0,estimated:u&&l&&d?(l-a)/u:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(f)},n)},j1=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},N1=e=>(...t)=>te.asap(()=>e(...t)),VV=en.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,en.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(en.origin),en.navigator&&/(msie|trident)/i.test(en.navigator.userAgent)):()=>!0,WV=en.hasStandardBrowserEnv?{write(e,t,n,r,o,i){const a=[e+"="+encodeURIComponent(t)];te.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),te.isString(r)&&a.push("path="+r),te.isString(o)&&a.push("domain="+o),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function zV(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function UV(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function $1(e,t,n){let r=!zV(t);return e&&(r||n==!1)?UV(e,t):t}const _1=e=>e instanceof gn?{...e}:e;function So(e,t){t=t||{};const n={};function r(u,d,f,p){return te.isPlainObject(u)&&te.isPlainObject(d)?te.merge.call({caseless:p},u,d):te.isPlainObject(d)?te.merge({},d):te.isArray(d)?d.slice():d}function o(u,d,f,p){if(te.isUndefined(d)){if(!te.isUndefined(u))return r(void 0,u,f,p)}else return r(u,d,f,p)}function i(u,d){if(!te.isUndefined(d))return r(void 0,d)}function a(u,d){if(te.isUndefined(d)){if(!te.isUndefined(u))return r(void 0,u)}else return r(void 0,d)}function l(u,d,f){if(f in t)return r(u,d);if(f in e)return r(void 0,u)}const c={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(u,d,f)=>o(_1(u),_1(d),f,!0)};return te.forEach(Object.keys(Object.assign({},e,t)),function(d){const f=c[d]||o,p=f(e[d],t[d],d);te.isUndefined(p)&&f!==l||(n[d]=p)}),n}const F1=e=>{const t=So({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:l}=t;t.headers=a=gn.from(a),t.url=E1($1(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):"")));let c;if(te.isFormData(n)){if(en.hasStandardBrowserEnv||en.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if((c=a.getContentType())!==!1){const[u,...d]=c?c.split(";").map(f=>f.trim()).filter(Boolean):[];a.setContentType([u||"multipart/form-data",...d].join("; "))}}if(en.hasStandardBrowserEnv&&(r&&te.isFunction(r)&&(r=r(t)),r||r!==!1&&VV(t.url))){const u=o&&i&&WV.read(i);u&&a.set(o,u)}return t},HV=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(n,r){const o=F1(e);let i=o.data;const a=gn.from(o.headers).normalize();let{responseType:l,onUploadProgress:c,onDownloadProgress:u}=o,d,f,p,h,y;function m(){h&&h(),y&&y(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let b=new XMLHttpRequest;b.open(o.method.toUpperCase(),o.url,!0),b.timeout=o.timeout;function x(){if(!b)return;const C=gn.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),v={data:!l||l==="text"||l==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:C,config:e,request:b};A1(function(E){n(E),m()},function(E){r(E),m()},v),b=null}"onloadend"in b?b.onloadend=x:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(x)},b.onabort=function(){b&&(r(new He("Request aborted",He.ECONNABORTED,e,b)),b=null)},b.onerror=function(){r(new He("Network Error",He.ERR_NETWORK,e,b)),b=null},b.ontimeout=function(){let O=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const v=o.transitional||M1;o.timeoutErrorMessage&&(O=o.timeoutErrorMessage),r(new He(O,v.clarifyTimeoutError?He.ETIMEDOUT:He.ECONNABORTED,e,b)),b=null},i===void 0&&a.setContentType(null),"setRequestHeader"in b&&te.forEach(a.toJSON(),function(O,v){b.setRequestHeader(v,O)}),te.isUndefined(o.withCredentials)||(b.withCredentials=!!o.withCredentials),l&&l!=="json"&&(b.responseType=o.responseType),u&&([p,y]=Rc(u,!0),b.addEventListener("progress",p)),c&&b.upload&&([f,h]=Rc(c),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",h)),(o.cancelToken||o.signal)&&(d=C=>{b&&(r(!C||C.type?new Is(null,e,b):C),b.abort(),b=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));const w=FV(o.url);if(w&&en.protocols.indexOf(w)===-1){r(new He("Unsupported protocol "+w+":",He.ERR_BAD_REQUEST,e));return}b.send(i||null)})},qV=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,o;const i=function(u){if(!o){o=!0,l();const d=u instanceof Error?u:this.reason;r.abort(d instanceof He?d:new Is(d instanceof Error?d.message:d))}};let a=t&&setTimeout(()=>{a=null,i(new He(`timeout ${t} of ms exceeded`,He.ETIMEDOUT))},t);const l=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(u=>{u.unsubscribe?u.unsubscribe(i):u.removeEventListener("abort",i)}),e=null)};e.forEach(u=>u.addEventListener("abort",i));const{signal:c}=r;return c.unsubscribe=()=>te.asap(l),c}},YV=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,o;for(;r<n;)o=r+t,yield e.slice(r,o),r=o},GV=async function*(e,t){for await(const n of KV(e))yield*YV(n,t)},KV=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},B1=(e,t,n,r)=>{const o=GV(e,t);let i=0,a,l=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await o.next();if(u){l(),c.close();return}let f=d.byteLength;if(n){let p=i+=f;n(p)}c.enqueue(new Uint8Array(d))}catch(u){throw l(u),u}},cancel(c){return l(c),o.return()}},{highWaterMark:2})},Dc=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",L1=Dc&&typeof ReadableStream=="function",XV=Dc&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),V1=(e,...t)=>{try{return!!e(...t)}catch{return!1}},ZV=L1&&V1(()=>{let e=!1;const t=new Request(en.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),W1=64*1024,Op=L1&&V1(()=>te.isReadableStream(new Response("").body)),Ic={stream:Op&&(e=>e.body)};Dc&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Ic[t]&&(Ic[t]=te.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new He(`Response type '${t}' is not supported`,He.ERR_NOT_SUPPORT,r)})})})(new Response);const JV=async e=>{if(e==null)return 0;if(te.isBlob(e))return e.size;if(te.isSpecCompliantForm(e))return(await new Request(en.origin,{method:"POST",body:e}).arrayBuffer()).byteLength;if(te.isArrayBufferView(e)||te.isArrayBuffer(e))return e.byteLength;if(te.isURLSearchParams(e)&&(e=e+""),te.isString(e))return(await XV(e)).byteLength},QV=async(e,t)=>{const n=te.toFiniteNumber(e.getContentLength());return n??JV(t)},kp={http:xV,xhr:HV,fetch:Dc&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:i,timeout:a,onDownloadProgress:l,onUploadProgress:c,responseType:u,headers:d,withCredentials:f="same-origin",fetchOptions:p}=F1(e);u=u?(u+"").toLowerCase():"text";let h=qV([o,i&&i.toAbortSignal()],a),y;const m=h&&h.unsubscribe&&(()=>{h.unsubscribe()});let b;try{if(c&&ZV&&n!=="get"&&n!=="head"&&(b=await QV(d,r))!==0){let v=new Request(t,{method:"POST",body:r,duplex:"half"}),k;if(te.isFormData(r)&&(k=v.headers.get("content-type"))&&d.setContentType(k),v.body){const[E,M]=j1(b,Rc(N1(c)));r=B1(v.body,W1,E,M)}}te.isString(f)||(f=f?"include":"omit");const x="credentials"in Request.prototype;y=new Request(t,{...p,signal:h,method:n.toUpperCase(),headers:d.normalize().toJSON(),body:r,duplex:"half",credentials:x?f:void 0});let w=await fetch(y);const C=Op&&(u==="stream"||u==="response");if(Op&&(l||C&&m)){const v={};["status","statusText","headers"].forEach(D=>{v[D]=w[D]});const k=te.toFiniteNumber(w.headers.get("content-length")),[E,M]=l&&j1(k,Rc(N1(l),!0))||[];w=new Response(B1(w.body,W1,E,()=>{M&&M(),m&&m()}),v)}u=u||"text";let O=await Ic[te.findKey(Ic,u)||"text"](w,e);return!C&&m&&m(),await new Promise((v,k)=>{A1(v,k,{data:O,headers:gn.from(w.headers),status:w.status,statusText:w.statusText,config:e,request:y})})}catch(x){throw m&&m(),x&&x.name==="TypeError"&&/fetch/i.test(x.message)?Object.assign(new He("Network Error",He.ERR_NETWORK,e,y),{cause:x.cause||x}):He.from(x,x&&x.code,e,y)}})};te.forEach(kp,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const z1=e=>`- ${e}`,e7=e=>te.isFunction(e)||e===null||e===!1,U1={getAdapter:e=>{e=te.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let i=0;i<t;i++){n=e[i];let a;if(r=n,!e7(n)&&(r=kp[(a=String(n)).toLowerCase()],r===void 0))throw new He(`Unknown adapter '${a}'`);if(r)break;o[a||"#"+i]=r}if(!r){const i=Object.entries(o).map(([l,c])=>`adapter ${l} `+(c===!1?"is not supported by the environment":"is not available in the build"));let a=t?i.length>1?`since :
|
|
324
324
|
`+i.map(z1).join(`
|
|
325
325
|
`):" "+z1(i[0]):"as no adapter specified";throw new He("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r},adapters:kp};function Ep(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Is(null,e)}function H1(e){return Ep(e),e.headers=gn.from(e.headers),e.data=Tp.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),U1.getAdapter(e.adapter||xa.adapter)(e).then(function(r){return Ep(e),r.data=Tp.call(e,e.transformResponse,r),r.headers=gn.from(r.headers),r},function(r){return I1(r)||(Ep(e),r&&r.response&&(r.response.data=Tp.call(e,e.transformResponse,r.response),r.response.headers=gn.from(r.response.headers))),Promise.reject(r)})}const q1="1.8.4",Ac={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Ac[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Y1={};Ac.transitional=function(t,n,r){function o(i,a){return"[Axios v"+q1+"] Transitional option '"+i+"'"+a+(r?". "+r:"")}return(i,a,l)=>{if(t===!1)throw new He(o(a," has been removed"+(n?" in "+n:"")),He.ERR_DEPRECATED);return n&&!Y1[a]&&(Y1[a]=!0,console.warn(o(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,a,l):!0}},Ac.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function t7(e,t,n){if(typeof e!="object")throw new He("options must be an object",He.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const i=r[o],a=t[i];if(a){const l=e[i],c=l===void 0||a(l,i,e);if(c!==!0)throw new He("option "+i+" must be "+c,He.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new He("Unknown option "+i,He.ERR_BAD_OPTION)}}const jc={assertOptions:t7,validators:Ac},mr=jc.validators;let To=class{constructor(t){this.defaults=t,this.interceptors={request:new P1,response:new P1}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
326
|
-
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=So(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&jc.assertOptions(r,{silentJSONParsing:mr.transitional(mr.boolean),forcedJSONParsing:mr.transitional(mr.boolean),clarifyTimeoutError:mr.transitional(mr.boolean)},!1),o!=null&&(te.isFunction(o)?n.paramsSerializer={serialize:o}:jc.assertOptions(o,{encode:mr.function,serialize:mr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),jc.assertOptions(n,{baseUrl:mr.spelling("baseURL"),withXsrfToken:mr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&te.merge(i.common,i[n.method]);i&&te.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=gn.concat(a,i);const l=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,f=0,p;if(!c){const y=[H1.bind(this),void 0];for(y.unshift.apply(y,l),y.push.apply(y,u),p=y.length,d=Promise.resolve(n);f<p;)d=d.then(y[f++],y[f++]);return d}p=l.length;let h=n;for(f=0;f<p;){const y=l[f++],m=l[f++];try{h=y(h)}catch(b){m.call(this,b);break}}try{d=H1.call(this,h)}catch(y){return Promise.reject(y)}for(f=0,p=u.length;f<p;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=So(this.defaults,t);const n=$1(t.baseURL,t.url,t.allowAbsoluteUrls);return E1(n,t.params,t.paramsSerializer)}};te.forEach(["delete","get","head","options"],function(t){To.prototype[t]=function(n,r){return this.request(So(r||{},{method:t,url:n,data:(r||{}).data}))}}),te.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,l){return this.request(So(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}To.prototype[t]=n(),To.prototype[t+"Form"]=n(!0)});let n7=class Mw{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(l=>{r.subscribe(l),i=l}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,l){r.reason||(r.reason=new Is(i,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Mw(function(o){t=o}),cancel:t}}};function r7(e){return function(n){return e.apply(null,n)}}function o7(e){return te.isObject(e)&&e.isAxiosError===!0}const Pp={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pp).forEach(([e,t])=>{Pp[t]=e});function G1(e){const t=new To(e),n=p1(To.prototype.request,t);return te.extend(n,To.prototype,t,{allOwnKeys:!0}),te.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return G1(So(e,o))},n}const St=G1(xa);St.Axios=To,St.CanceledError=Is,St.CancelToken=n7,St.isCancel=I1,St.VERSION=q1,St.toFormData=Pc,St.AxiosError=He,St.Cancel=St.CanceledError,St.all=function(t){return Promise.all(t)},St.spread=r7,St.isAxiosError=o7,St.mergeConfig=So,St.AxiosHeaders=gn,St.formToJSON=e=>R1(te.isHTMLForm(e)?new FormData(e):e),St.getAdapter=U1.getAdapter,St.HttpStatusCode=Pp,St.default=St;const{Axios:KW,AxiosError:XW,CanceledError:ZW,isCancel:JW,CancelToken:QW,VERSION:ez,all:tz,Cancel:nz,isAxiosError:rz,spread:oz,toFormData:sz,AxiosHeaders:iz,HttpStatusCode:az,formToJSON:lz,getAdapter:cz,mergeConfig:uz}=St,Mp={BASE_URL:"https://qa.3sc.ai/api",VERSION:"/v1"};/*! js-cookie v3.0.5 | MIT */function Nc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var s7={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Rp(e,t){function n(o,i,a){if(!(typeof document>"u")){a=Nc({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var c in a)a[c]&&(l+="; "+c,a[c]!==!0&&(l+="="+a[c].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+l}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],a={},l=0;l<i.length;l++){var c=i[l].split("="),u=c.slice(1).join("=");try{var d=decodeURIComponent(c[0]);if(a[d]=e.read(u,d),o===d)break}catch{}}return o?a[o]:a}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",Nc({},i,{expires:-1}))},withAttributes:function(o){return Rp(this.converter,Nc({},this.attributes,o))},withConverter:function(o){return Rp(Nc({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var i7=Rp(s7,{path:"/"});const Rr={TOKEN:"token",USER:"user",SNOP:"snop",SELECTED_BU:"selected_business_unit",SETTINGS:"settings"},Dp={BEARER:"Bearer",TENANT_ID:"tenant_id",BU_ID:"bu_id",SNOP_ID:"snop_id"},a7=Object.values({"SKU Name":"sku_name",Node:"node","Channel Name":"channel_name"}),l7=[10,25,50,100],K1={MARK_ALL_READ:"MARK_ALL_READ"},c7=l7.map(e=>({label:e,value:e})),X1={PRIMARY:"PRIMARY",SECONDARY:"SECONDARY"},Ip=wc(Rr.SNOP),Ap=wc(Rr.SELECTED_BU),jp=wc(Rr.USER),u7=wc(Rr.SETTINGS),Ca={BU_IDS:Ap==null?void 0:Ap.business_unit_id,TOKEN:JSON.parse(i7.get(Rr.TOKEN)||null),TENANT_IDS:jp==null?void 0:jp.tenant_id,SNOP_IDS:Ip==null?void 0:Ip.snop_id,GRID_SETTINGS:u7},Sa={headers:{"Content-Type":"application/json",Authorization:`${Dp.BEARER} ${Ca.TOKEN}`}},Z1=St.create({baseURL:Mp.BASE_URL,axiosConfig:Sa});Z1.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),Z1.interceptors.response.use(function(e){return e},function(e){return Promise.reject(e)});const $c={NOTIFICATION:"/notifications",SETTING:"/configuration/setting"},{TENANT_ID:d7,BU_ID:f7}=Dp,{TENANT_IDS:p7,BU_IDS:h7}=Ca,_c=async({baseUrl:e,payload:t})=>{try{const n=`${e}${$c.SETTING}/v1?${d7}=${p7}&${f7}=${h7}`;return await St.post(n,t,Sa)}catch(n){return n}},m7=({columns:e,gridPath:t,baseUrl:n,isDefaultConfig:r,pageSize:o})=>{var m,b;let{definitions:i,defaultUserSettings:a,labels:l}=e;const c=t.split("/").filter(Boolean),u=JSON.parse(localStorage.getItem(Rr.SETTINGS));let d=c.reduce((x,w)=>x==null?void 0:x[w],u)||null;if(!r&&t){a=J1({definitions:i});const x=new Set((m=d==null?void 0:d.column)==null?void 0:m.map(C=>C.id)),w=a.filter(C=>!x.has(C.id));(!d||(w==null?void 0:w.length)>0)&&(async()=>{try{const O={...Ca.GRID_SETTINGS||{platform:{theme:"light"}}},v=(d==null?void 0:d.pageSize)??o;let k=O;for(let E=0;E<c.length;E++){const M=c[E];E===c.length-1?k[M]={columns:a,pageSize:v}:(k[M]={...k[M]||{}},k=k[M])}localStorage.setItem(Rr.SETTINGS,JSON.stringify(O)),await _c({baseUrl:n,payload:O})}catch(C){console.error(C)}})()}a=(d==null?void 0:d.columns)??a??J1({definitions:i});const f=a.reduce((x,w)=>(x[w.id]=w,x),{}),p=l.reduce((x,w)=>(x[w.id]=w,x),{}),h=[];for(const x of i){const w=f[x.id]||{},C=p[x.id]||{};let O={...x,...w,...C};if((b=x.children)!=null&&b.length){const v=w.children||[],k=C.children||[];O.children=x.children.map((E,M)=>({...E,...v[M],...k[M]}))}h.push(O)}return h.sort((x,w)=>x.sequenceId-w.sequenceId)},g7=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),J1=({definitions:e})=>e.map((t,n)=>({id:t.id,key:t.key,sequenceId:t.id,isHidden:!1,style:t.style||{}})),y7=()=>({definitions:[{id:1,key:"sku_name",isSortable:!0,isMandatory:!0},{id:2,key:"node",isSortable:!0,isMandatory:!0},{id:3,key:"channel_name",isSortable:!0,isMandatory:!0}],defaultUserSettings:[{id:1,key:"sku_name",sequenceId:1,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}},{id:2,key:"node",sequenceId:2,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}},{id:3,key:"channel_name",sequenceId:3,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}}],labels:[{id:1,key:"sku_name",label:"SKU",isLocalizable:!1},{id:2,key:"node",label:"Node",isLocalizable:!1},{id:3,key:"channel_name",label:"Channel",isLocalizable:!1}]});class Np extends R.Component{constructor(t){super(t),this.startDrag=this.startDrag.bind(this),this.endDrag=this.endDrag.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.dragging=!1,this.mouseX=0,this.startPos=0,this.startWidthPrev=0,this.lastDraggedWidth=0,this.draggedCol=null,this.resizeRef=R.createRef()}startDrag(){if(!this.props.disabled&&(this.draggedCol=this.props.id,this.props.resizeStart&&this.draggedCol===this.props.id&&this.props.resizeStart(),this.dragging=!0,this.startPos=this.mouseX,this.startWidthPrev=0,this.resizeRef.current)){let t=this.resizeRef.current.previousSibling;t&&(this.startWidthPrev=t.clientWidth)}}endDrag(){this.props.disabled||(this.dragging=!1,this.props.resizeEnd&&this.draggedCol===this.props.id&&this.props.resizeEnd(this.lastDraggedWidth),this.draggedCol=null)}onMouseMove(t){if(this.props.disabled||(this.mouseX=t.touches?t.touches[0].screenX:t.screenX,!this.dragging))return;const n=this.resizeRef.current,r=this.startPos-this.mouseX;let o=this.startWidthPrev-r;(!this.props.minWidth||o>=this.props.minWidth)&&(!this.props.maxWidth||o<=this.props.maxWidth)&&(n.previousSibling.style.width=o+"px",n.previousSibling.style.minWidth=o+"px",n.previousSibling.style.maxWidth=o+"px",n.previousSibling.style.setProperty("--column_resize_before_width",o+"px"),this.lastDraggedWidth=o)}componentDidMount(){const t=this.resizeRef.current;if(t&&(this.props.defaultWidth?(t.previousSibling.style.minWidth=this.props.defaultWidth+"px",t.previousSibling.style.width=this.props.defaultWidth+"px",t.previousSibling.style.maxWidth=this.props.defaultWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.defaultWidth+"px")):this.props.minWidth&&(t.previousSibling.style.minWidth=this.props.minWidth+"px",t.previousSibling.style.width=this.props.minWidth+"px",t.previousSibling.style.maxWidth=this.props.minWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.minWidth+"px"))),this.props.disabled){this.props.defaultWidth&&t&&(t.previousSibling.style.minWidth=this.props.defaultWidth+"px",t.previousSibling.style.width=this.props.defaultWidth+"px",t.previousSibling.style.maxWidth=this.props.defaultWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.defaultWidth+"px")),this.props.maxWidth&&t&&(t.previousSibling.style.maxWidth=this.props.maxWidth+"px");return}this.addEventListenersToDocument()}componentWillUnmount(){this.props.disabled||this.removeEventListenersFromDocument()}componentDidUpdate(t,n){t.disabled&&!this.props.disabled&&this.addEventListenersToDocument(),!t.disabled&&this.props.disabled&&this.removeEventListenersFromDocument()}addEventListenersToDocument(){document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.endDrag),document.addEventListener("touchmove",this.onMouseMove),document.addEventListener("touchend",this.endDrag)}removeEventListenersFromDocument(){document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.endDrag),document.removeEventListener("touchmove",this.onMouseMove),document.removeEventListener("touchend",this.endDrag)}render(){var t={userSelect:"none"};return this.props.disabled||(t.cursor="ew-resize"),this.props.className===""&&(t.width="6px",t.backgroundColor="rgba(0, 0, 0, 0.1)"),R.createElement("th",{ref:this.resizeRef,style:t,disabled:this.props.disabled,rowSpan:this.props.rowSpan?this.props.rowSpan:1,colSpan:this.props.colSpan?this.props.colSpan:1,className:`column_resizer_own_class ${this.props.disabled?"disabled_column_resize":""} ${this.props.className}`,onMouseDown:this.props.disabled?null:this.startDrag,onTouchStart:this.props.disabled?null:this.startDrag})}}Np.defaultProps={disabled:!1,minWidth:0,className:""},Np.propTypes={disabled:"boolean",minWidth:"number",className:"string"};var Q1,ew;function $p(){return $p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$p.apply(null,arguments)}var b7=function(t){return S.createElement("svg",$p({xmlns:"http://www.w3.org/2000/svg",width:17,height:7,fill:"none"},t),Q1||(Q1=S.createElement("path",{fill:"#0582CA",d:"M4.652.5.676 3.493l3.976 2.981V4.051h8.354V2.859H4.652z"})),ew||(ew=S.createElement("path",{fill:"#0582CA",d:"M12.36.5v2.384H4.008v1.193h8.352v2.396l.956-.716 3.022-2.265z"})))};const v7=(e,t,n,r,o)=>{const[i,a]=R.useState({isOpen:!1,column:null}),l=(f,p,h)=>{a({isOpen:f.currentTarget,column:p,isChild:!!h})},c=()=>{a({isOpen:!1,column:null,isChild:!1})},u=async()=>{c();const f=e.map(p=>{var h,y;if(i!=null&&i.isChild&&Array.isArray(p.children)){const m=p.children.map(x=>{var w;return x.id===i.column.id&&x.key===((w=i.column)==null?void 0:w.key)?{...x,isHidden:!0}:x}),b=m.every(x=>x.isHidden);return{...p,isHidden:b?!0:p.isHidden,children:m}}return p.id===((h=i==null?void 0:i.column)==null?void 0:h.id)&&p.key===((y=i.column)==null?void 0:y.key)?{...p,isHidden:!0}:p});d({updatedColumns:f})},d=async({updatedColumns:f})=>{t({type:qe.SET_GRID_DATA,payload:{visibleGridColumns:f}});const p=r.split("/").filter(Boolean),m={...JSON.parse(localStorage.getItem(Rr.SETTINGS))||{platform:{theme:"light"}}},b=p.reduce((C,O)=>C==null?void 0:C[O],Ca.GRID_SETTINGS)||null,x=(b==null?void 0:b.pageSize)??o;let w=m;for(let C=0;C<p.length;C++){const O=p[C];C===p.length-1?w[O]={columns:f,pageSize:x}:(w[O]={...w[O]||{}},w=w[O])}localStorage.setItem(Rr.SETTINGS,JSON.stringify(m)),await _c({baseUrl:n,payload:m})};return{selectedColumn:i,handleMenuClick:l,handleClose:c,handleHideClick:u,columnUpdaterFunction:d}},tw=({pagination:e,gridPath:t,baseUrl:n})=>{const{selectedPage:r,rowPerPage:o,totalRecords:i,onPageChange:a,onPageSizeChange:l}=e,c=It(),u=async(d,f)=>{if(!f)return;const p=f.split("/").filter(Boolean),h="settings",m={...JSON.parse(localStorage.getItem(h))||{}};let b=m;for(let x=0;x<p.length;x++){const w=p[x];x===p.length-1?b[w]={...b[w]||{},pageSize:d}:(b[w]={...b[w]||{}},b=b[w])}localStorage.setItem(h,JSON.stringify(m)),await _c({baseUrl:n,payload:m})};return g.jsxs(ye,{sx:{display:"flex",p:"1rem 2rem"},children:[g.jsxs(ye,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"0.5rem",width:"100%"},children:[g.jsx(nt,{sx:{fontSize:"1.1rem",color:c.palette.primary.notifyTextColor},children:`Showing ${(r-1)*o+1} to ${Math.min(r*o,i)} of ${i} rows`}),g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem 0.8rem!important"},width:"6rem"},children:g.jsx(Sc,{options:c7,value:o,onChange:async d=>{l(d),u(d==null?void 0:d.value,t)}})}),g.jsx(nt,{sx:{fontSize:"1.1rem",color:c.palette.primary.notifyTextColor},children:"records per page"})]}),g.jsx(Tg,{count:Math.ceil(i/o),page:r,onChange:async(d,f)=>{a(f)},siblingCount:0,shape:"rounded",sx:{width:"100%","& .MuiPagination-ul":{width:"100%",display:"flex",justifyContent:"flex-end","& li:first-of-type":{border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,color:c.palette.primary.notifyActiveText,marginRight:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"},"& li:last-child":{border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,color:c.palette.primary.notifyActiveText,marginLeft:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"}},"& .MuiPaginationItem-root":{color:"#595959",fontSize:"1.1rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex","& .MuiSvgIcon-root":{fontSize:"2.2rem"}},"& .Mui-selected":{color:c.palette.primary.notifyActiveText,backgroundColor:`${c.palette.brandColor.paginationBc} !important`}}})]})};tw.propTypes={pagination:s.object.isRequired};function _p({isRenderCellContent:e,column:t,row:n,parent:r}){const o=n[t.key];return g.jsx(g.Fragment,{children:e?g.jsx(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},children:t==null?void 0:t.cellRenderer(n,{column:t,parent:r})}):g.jsx(Ag,{title:(o==null?void 0:o.length)>20?o:"",arrow:!0,children:g.jsx(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},id:t.key,component:"label",children:m8(o)})})})}_p.propTypes={isRenderCellContent:s.bool,column:s.object,row:s.object};const nw=({menuOpen:e,handleClose:t,onHideClick:n})=>{const r=It();return g.jsx(Si,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:g.jsx(ye,{sx:{backgroundColor:r.palette.primary.notifyBackground,border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,minHeight:"2.3rem",display:"flex",justifyContent:"center",alignItems:"center"},children:g.jsx(Hn,{onClick:n,disableRipple:!0,sx:{textTransform:"none",fontSize:"1.1rem",p:"0.4rem 1rem",minHeight:"unset",fontWeight:500,color:r.palette.primary.notifyTextColor,backgroundColor:"transparent","&:hover":{backgroundColor:"transparent"},"&:active":{backgroundColor:"transparent"},"&:focus":{backgroundColor:"transparent"}},children:"Hide Column"})})})};nw.propTypes={menuOpen:s.object,handleClose:s.func,onHideClick:s.func},G(kl)(({theme:e})=>({"& .MuiPaper-root":{borderRadius:8,border:`1px solid ${e.palette.primary.notifyBorderColor}`,boxShadow:e.shadows[4],padding:"1rem 1rem 0rem 1rem",backgroundColor:e.palette.primary.notifyBackground}}));const Oo=G(nt)(({theme:e})=>({color:e.palette.primary.notifyTextColor,fontSize:"1.1rem"})),x7=G(jg)(({theme:e})=>({width:28,height:16,padding:0,display:"flex","&:active":{"& .MuiSwitch-thumb":{width:15},"& .MuiSwitch-switchBase.Mui-checked":{transform:"translateX(9px)"}},"& .MuiSwitch-switchBase":{padding:2,"&.Mui-checked":{transform:"translateX(12px)",color:"#fff","& + .MuiSwitch-track":{opacity:1,backgroundColor:"#1890ff",...e.applyStyles("dark",{backgroundColor:"#177ddc"})}}},"& .MuiSwitch-thumb":{boxShadow:"0 2px 4px 0 rgb(0 35 11 / 20%)",width:12,height:12,borderRadius:6,transition:e.transitions.create(["width"],{duration:200})},"& .MuiSwitch-track":{borderRadius:16/2,opacity:1,backgroundColor:"rgba(0,0,0,.25)",boxSizing:"border-box",...e.applyStyles("dark",{backgroundColor:"rgba(255,255,255,.35)"})}})),w7=G(yi)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),C7=G(nd)(({theme:e})=>({"& .MuiBadge-badge":{right:3.5,top:1.8,border:`0.1rem solid ${e.palette.primary.notifyBackground}`,padding:"0 1.3px",borderRadius:"50%",backgroundColor:"#D44E40",fontSize:"0.725rem",minWidth:"0.7rem",height:"0.7rem"}}));G(Fl)(({theme:e})=>({"& .MuiInputBase-root":{height:"3.52rem"},"& .MuiFormLabel-root":{color:`${e.palette.primary.notifyBorderColor} !important`,fontSize:"1rem",marginTop:"0.4rem"},"& label.Mui-focused":{color:e.palette.primary.notifyTextColor},"& .MuiInput-underline:after":{borderBottomColor:e.palette.primary.notifyBorderColor,borderBottomWidth:"0.1rem"},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&:hover fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&.Mui-focused fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"}}}));const S7=G(Jg)(({theme:e})=>({minHeight:"2rem","& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveText}})),Fp=G(Ng)(({theme:e})=>({color:e.palette.primary.notifyActiveText,textTransform:"none",fontWeight:"normal",padding:0,fontSize:"1rem",minHeight:"2rem",paddingBottom:"1rem","&.Mui-selected":{fontWeight:"bold",color:e.palette.primary.notifyActiveText}})),Fc=G(Qu)(({theme:e})=>({"&.MuiChip-outlined":{borderColor:e.palette.primary.notifyBorderColor,color:e.palette.primary.notifyActiveText},height:"2rem",fontSize:"0.9rem",fontWeight:"300",borderColor:e.palette.primary.notifyBorderColor,color:e.palette.primary.notifyActiveText,borderRadius:"0.6rem",padding:"0.2rem","&:hover":{backgroundColor:`${e.palette.brandColor.orange} !important`,color:`${e.palette.brandColor.white} !important`}})),rw=({sortKey:e,sortField:t,sortDir:n,handleSortClick:r})=>{const o=i=>g.jsx(Ir,{onClick:r,sx:{padding:"0.5rem"},children:g.jsx(hn,{url:i})});return g.jsx(g.Fragment,{children:o(t===e?n==="asc"?Ke.AscSort:Ke.DescSort:Ke.Unsort)})};rw.propTypes={sortKey:s.string.isRequired,sortField:s.string,sortDir:s.string,handleSortClick:s.func};function ow({parent:e,column:t,sort:n,handleMenuClick:r,isManageable:o}){const i=t==null?void 0:t.isMandatory,a=t==null?void 0:t.label,l=t==null?void 0:t.isSortable,c=n==null?void 0:n.sortField,u=n==null?void 0:n.sortDir,d=n==null?void 0:n.onSort;return g.jsxs(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem",textAlign:"center",whiteSpace:"normal"},children:[a,g.jsxs(ye,{sx:{display:"flex",alignItems:"center"},children:[l&&g.jsx(rw,{sortKey:e?`${e==null?void 0:e.key}|${t==null?void 0:t.key}`:t==null?void 0:t.key,sortField:c,sortDir:u,handleSortClick:()=>d({column:t,sortDir:u,sortField:c,parent:e})}),o&&!i&&g.jsx(Ir,{onClick:f=>r(f,t,e),sx:{padding:"0.5rem 0.2rem"},children:g.jsx(hn,{url:Ke.Menu})})]})]})}ow.propTypes={column:s.object.isRequired,sort:s.object.isRequired,handleMenuClick:s.func,isManageable:s.bool};const T7=G($l)(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"table-cell",[`&.${vd.head}`]:{color:e.palette.primary.notifyTextColor,backgroundColor:e.palette.primary.notifyBackground,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 0.5rem",textAlign:"center"},[`&.${vd.body}`]:{color:e.palette.primary.notifyTextColor,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 0.5rem",textAlign:"center"}}));function Ta({children:e,...t}){return g.jsx(T7,{...t,children:e})}Ta.propTypes={children:s.node};const O7=G(Hg)(()=>({"&:last-child td":{borderBottom:0}}));function As({children:e,...t}){return g.jsx(O7,{...t,children:e})}As.propTypes={children:s.node};function sw({rows:e,sort:t,data:n,pagination:r,columns:o,nested:i,baseUrl:a,gridPath:l}){var ue;const c=It(),{visibleGridColumns:u}=R.useContext(ga),d=R.useContext(ya),{selectedColumn:f,handleMenuClick:p,handleClose:h,handleHideClick:y,columnUpdaterFunction:m}=v7(u,d,a,l,r==null?void 0:r.rowPerPage),b=o==null?void 0:o.isManageable,x=o==null?void 0:o.isResizable,w=(n==null?void 0:n.length)>0,C=R.useRef(null),[O,v]=R.useState(null),[k,E]=R.useState(null),[M,D]=R.useState(null);let A=null;const $=R.useRef(0),I=R.useRef(!1),W=R.useRef(null),j=g7(((ue=i==null?void 0:i.column)==null?void 0:ue.definitions)||[]),F=i==null?void 0:i.isNested,P=(i==null?void 0:i.data)||[],N=i==null?void 0:i.hashKey;if(R.useEffect(()=>{const _=C.current,q=_==null?void 0:_.querySelector("thead");if(!q)return;const X=()=>{D(null)};return q==null||q.addEventListener("mousedown",X),()=>{q==null||q.removeEventListener("mousedown",X)}},[]),!w)return g.jsx(Oo,{sx:{textAlign:"center"},children:Gr.NRF});const L=(_,q)=>{var oe,ce;if(I.current){_.preventDefault();return}v(q),D(null),_.dataTransfer.setData("colIndex",q);const X=u[q],Y=X==null?void 0:X.label,B=document.createElement("div");B.textContent=Y,Object.assign(B.style,{display:"flex",alignItems:"center",justifyContent:"center",padding:"1.5rem 2.5rem",minWidth:(oe=X==null?void 0:X.style)==null?void 0:oe.minWidth,maxWidth:(ce=X==null?void 0:X.style)==null?void 0:ce.maxWidth,fontSize:"1.2rem",fontWeight:"500",color:c.palette.primary.notifyTextColor,background:c.palette.primary.notifyBackground,border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,borderRadius:"0rem",pointerEvents:"none",position:"absolute",top:"0",left:"0",zIndex:"-1",textAlign:"center",boxSizing:"border-box",boxShadow:"0 1px 4px rgba(0, 0, 0, 0.2)"}),document.body.appendChild(B);const{offsetWidth:K,offsetHeight:ee}=B;_.dataTransfer.setDragImage(B,K/2,ee/2),requestAnimationFrame(()=>{document.body.removeChild(B)})},H=(_,q)=>{_.preventDefault(),E(q),Q(_)},V=async(_,q)=>{if(_.preventDefault(),clearInterval(A),O===null||O===q)return;const X=[...u],[Y]=X.splice(O,1);X.splice(q,0,Y);const B=u.slice().sort((ee,oe)=>ee.sequenceId-oe.sequenceId).map(ee=>ee.sequenceId),K=X.map((ee,oe)=>({...ee,sequenceId:B[oe]??ee.sequenceId}));m({updatedColumns:K}),v(null),E(null)},z=()=>{v(null),E(null)},Z=(_,q,X,Y)=>{var me,ge,$e,Ae,Me,ze,Xe;if(!_)return null;const B=(_==null?void 0:_.isMandatory)&&(_==null?void 0:_.isSticky),K=parseFloat((ge=(me=_==null?void 0:_.style)==null?void 0:me.minWidth)==null?void 0:ge.toString().replace("rem",""))||7.5;q===0&&($.current=0);const ee=B?q===0?0:`${$.current}rem`:void 0;B&&($.current+=K);const oe=O===q,ce=k==q||(($e=u==null?void 0:u[k])==null?void 0:$e.isMandatory),Ce=Fe=>{_.isMandatory?(Fe.preventDefault(),Fe.dataTransfer.dropEffect="none"):(Fe.preventDefault(),Fe.dataTransfer.dropEffect="move"),H==null||H(Fe,q)},ae=Fe=>{_.isMandatory||V==null||V(Fe,q)},we=Y?`${Y==null?void 0:Y.key}_${_==null?void 0:_.key}_${q}`:q;return g.jsx(Ta,{rowSpan:_!=null&&_.children?1:2,colSpan:x?((Me=(Ae=_==null?void 0:_.children)==null?void 0:Ae.filter(Fe=>!(Fe!=null&&Fe.isHidden)))==null?void 0:Me.length)*2-1:(Xe=(ze=_==null?void 0:_.children)==null?void 0:ze.filter(Fe=>!(Fe!=null&&Fe.isHidden)))==null?void 0:Xe.length,style:_==null?void 0:_.style,onMouseEnter:()=>{M!==we&&D(we)},draggable:X&&!Y&&!(_!=null&&_.isMandatory),onDragStart:X?Fe=>L(Fe,q):void 0,onDragOver:X?Ce:void 0,onDrop:X?ae:void 0,onDragEnd:X?z:void 0,sx:{...oe&&{border:`0.1rem solid ${c.palette.brandColor.lightBlue}!important`},...B&&{borderRadius:"0rem!important",position:"sticky",left:ee,zIndex:3},..._!=null&&_.children?{}:{borderLeft:Fe=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${Fe.palette.primary.notifyBorderColor}`,borderRight:Fe=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${Fe.palette.primary.notifyBorderColor}`},cursor:ce?"not-allowed":X&&!(_!=null&&_.isMandatory)?"grab":"default"},children:g.jsx(ow,{parent:Y,column:_,sort:t,handleMenuClick:p,isManageable:X})},q)},ne=(_,q,X,Y)=>{var oe,ce,Ce;if(!_)return null;const B=(_==null?void 0:_.isMandatory)&&(_==null?void 0:_.isSticky),K=parseFloat((ce=(oe=_==null?void 0:_.style)==null?void 0:oe.minWidth)==null?void 0:ce.toString().replace("rem",""))||7.5;X===0&&($.current=0);const ee=B?X===0?0:`${$.current}rem`:void 0;return B&&($.current+=K),g.jsxs(Ta,{colSpan:1,style:_==null?void 0:_.style,className:`${_==null?void 0:_.label}`,sx:{position:"relative",...B&&{position:"sticky",left:ee,zIndex:2,backgroundColor:ae=>{var we;return e!=null&&e.selectedRow&&((we=e==null?void 0:e.selectedRow)==null?void 0:we.fhi)===(q==null?void 0:q.fhi)||q!=null&&q.isHigh?ae.palette.primary.appBackground:ae.palette.primary.notifyBackground}},...Y?{p:"0rem!important"}:{px:"0rem!important",borderLeft:ae=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${ae.palette.primary.notifyBorderColor}`,borderRight:ae=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${ae.palette.primary.notifyBorderColor}`}},children:[((e==null?void 0:e.selectedRow)&&((Ce=e==null?void 0:e.selectedRow)==null?void 0:Ce.fhi)===(q==null?void 0:q.fhi)||(q==null?void 0:q.isHigh))&&g.jsx(ye,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}}),g.jsx(_p,{isRenderCellContent:!!(_!=null&&_.cellRenderer),column:_,row:q,parent:Y})]},X)},J=(_,q,X,Y)=>{var K;const B=Y?`${Y==null?void 0:Y.key}_${_==null?void 0:_.key}_${q}`:q;return(K=[...u].map((ee,oe)=>({col:ee,index:oe})).reverse().find(({col:ee})=>Array.isArray(ee.children)&&ee.children.length>0))==null||K.index,g.jsx(g.Fragment,{children:_&&!(_!=null&&_.isMandatory)&&X?g.jsx(ye,{resizeStart:()=>{I.current=!0},resizeEnd:()=>{I.current=!1},component:_!=null&&_.children?$l:Np,rowSpan:_!=null&&_.children?1:2,colSpan:1,id:q,sx:{width:"2rem",maxWidth:"2rem",minWidth:"2rem",padding:0,position:"relative",background:c.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,"&::after":{content:'""',position:"absolute",left:"50%",top:0,transform:"translateX(-50%)",width:"0.15rem",height:"calc(100% + 0.1rem)",backgroundColor:M===B&&!(_!=null&&_.children)?c.palette.brandColor.lightBlue:Y||_!=null&&_.children?c.palette.primary.notifyBorderColor:"transparent",transition:"background-color 0.2s ease",zIndex:1}},disabled:!X}):null})},se=(_,q,X,Y,B,K)=>{var oe;const ee=K?`${K==null?void 0:K.key}_${q==null?void 0:q.key}_${X}`:X;return g.jsx(g.Fragment,{children:q&&!(q!=null&&q.isMandatory)&&Y?g.jsxs($l,{className:"column_resizer_body",sx:{padding:0,position:"relative",borderBottom:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,"&::after":{content:'""',position:"absolute",left:"50%",top:0,transform:"translateX(-50%)",width:"0.15rem",height:"calc(100% + 0.1rem)",backgroundColor:M===ee?c.palette.brandColor.lightBlue:K||q!=null&&q.children?c.palette.primary.notifyBorderColor:"transparent",transition:"background-color 0.2s ease",zIndex:1}},children:[B===0&&M===ee&&g.jsx(ye,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1,pointerEvents:"none"},children:g.jsx(b7,{})}),((e==null?void 0:e.selectedRow)&&((oe=e==null?void 0:e.selectedRow)==null?void 0:oe.fhi)===(_==null?void 0:_.fhi)||(_==null?void 0:_.isHigh))&&g.jsx(ye,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}})]},`resize-${X}`):null})},Q=_=>{const q=C.current,{left:X,right:Y}=q.getBoundingClientRect(),B=50,K=_.clientX>Y-B?1:_.clientX<X+B?-1:0;K!==0?(W.current&&clearInterval(W.current),W.current=setInterval(()=>{q.scrollLeft+=K*10},50)):W.current&&(clearInterval(W.current),W.current=null)};return g.jsxs(g.Fragment,{children:[g.jsx(Lg,{sx:{maxHeight:"100%",whiteSpace:"nowrap",overflow:"auto",width:"100%",border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem"},children:g.jsxs(_g,{ref:C,stickyHeader:!0,"aria-label":"sticky table",sx:{backgroundColor:_=>_.palette.primary.notifyBackground},children:[g.jsxs(Wg,{children:[g.jsx(As,{children:u.map((_,q)=>_!=null&&_.isHidden?null:g.jsxs(R.Fragment,{children:[Z(_,q,b),x&&J(_,q,b)]},q))}),g.jsx(As,{children:u.flatMap((_,q)=>_!=null&&_.isHidden||!(_!=null&&_.children)?[]:_.children.map((X,Y)=>X!=null&&X.isHidden?null:g.jsxs(R.Fragment,{children:[Z(X,Y,b,_),x&&J(X,Y,b,_)]},`${q}-${Y}`)))})]}),g.jsx(Bg,{children:n.map((_,q)=>{const X=_[N],Y=P==null?void 0:P[X],B=(Y==null?void 0:Y.length)>0;return g.jsxs(R.Fragment,{children:[g.jsx(As,{sx:{backgroundColor:K=>{var ee;return e&&((ee=e==null?void 0:e.selectedRow)==null?void 0:ee.fhi)===(_==null?void 0:_.fhi)||_!=null&&_.isHigh?K.palette.primary.appBackground:K.palette.primary.notifyBackground}},onClick:()=>e==null?void 0:e.onRowClick(_),children:u.map((K,ee)=>K!=null&&K.isHidden?null:K!=null&&K.children?K.children.map((oe,ce)=>oe!=null&&oe.isHidden?null:g.jsxs(R.Fragment,{children:[ne(oe,_,ce,K),x&&se(_,oe,ce,b,q,K)]},`${ee}-${ce}`)):g.jsxs(R.Fragment,{children:[ne(K,_,ee),x&&se(_,K,ee,b,q)]},ee))}),F&&Y&&g.jsx(g.Fragment,{children:B?Y.map((K,ee)=>g.jsx(As,{children:j.map((oe,ce)=>g.jsx(Ta,{style:oe==null?void 0:oe.style,children:g.jsx(_p,{isRenderCellContent:!!(oe!=null&&oe.cellRenderer),column:oe,row:K})},ce))},`nested-${ee}`)):g.jsx(As,{children:g.jsx(Ta,{colSpan:j.length,children:g.jsx(Oo,{sx:{textAlign:"center"},children:Gr.NRF})})})})]},q)})})]})}),r&&g.jsx(tw,{pagination:r,gridPath:l,baseUrl:a}),g.jsx(nw,{menuOpen:f==null?void 0:f.isOpen,handleClose:h,onHideClick:y})]})}sw.propTypes={sort:s.object,data:s.array,pagination:s.object,columns:s.object,nested:s.object};function iw({tableProps:e,isDefaultConfig:t,gridPath:n,baseUrl:r}){var u;const{columns:o}=e,{visibleGridColumns:i=[]}=R.useContext(ga)??{},a=R.useContext(ya),l=R.useMemo(()=>{var d;return m7({columns:o,gridPath:n,baseUrl:r,isDefaultConfig:t,pageSize:(d=e==null?void 0:e.pagination)==null?void 0:d.rowPerPage})},[o,n,r,t,(u=e==null?void 0:e.pagination)==null?void 0:u.rowPerPage]),c=R.useMemo(()=>{const d=new Map(i.map(f=>[f.key,f]));return l.map(f=>{const p=d.get(f.key);return{...f,...p&&{isHidden:p.isHidden,sequenceId:p.sequenceId}}}).sort((f,p)=>f.sequenceId-p.sequenceId)},[l,i]);return R.useEffect(()=>{a({type:qe.SET_GRID_DATA,payload:{visibleGridColumns:i.length?c:l}})},[l]),g.jsx(sw,{...e,gridPath:n,baseUrl:r})}iw.propTypes={tableProps:s.object.isRequired,mergedColumns:s.array.isRequired};const aw=({type:e})=>{const t=It(),r=(t==null?void 0:t.mode)==="dark"?{bgcolor:"grey.800"}:{};return{grid:g.jsxs(ye,{sx:{borderRadius:2,overflow:"hidden"},children:[g.jsx(Tr,{variant:"text",width:"100%",height:60,sx:r}),Array.from({length:10}).map((i,a)=>g.jsx(ye,{sx:{display:"flex",alignItems:"center",padding:"0.5rem",gap:"3rem"},children:Array.from({length:5}).map((l,c)=>g.jsx(ye,{sx:{flex:1},children:g.jsx(Tr,{variant:"text",height:45,sx:r})},c))},a))]}),toolbar:g.jsx(g.Fragment,{children:g.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{display:"flex",gap:"1rem"},children:[g.jsxs(ft,{direction:"row",gap:"1rem",children:[g.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"15.2rem",height:"5rem",sx:r})]}),g.jsxs(ft,{direction:"row",gap:"1rem",children:[g.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r})]})]})})}[e]},k7=e=>{if(!e)return null;const{options:t,...n}=e,r=t?"select":"button",o={button:i=>{var a;return g.jsx(mo,{...i,styles:{...i.styles,iconPrimary:((a=i==null?void 0:i.styles)==null?void 0:a.variant)=="filled"}})},select:i=>{var a;return g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"},width:(a=i.styles)==null?void 0:a.width},children:g.jsx(l1,{...i,options:t})})}};return o[r]?o[r](n):null},E7=({presentSetting:e,gridSetting:t,gridPath:n})=>{var a;if(!n)return e;const r=n.split("/").filter(Boolean),o=(a=t==null?void 0:t.grid)==null?void 0:a.map(({id:l,isHidden:c,isSortable:u,key:d,sequenceId:f})=>({id:l,isHidden:c,isSortable:u,key:d,sequenceId:f}));let i=e;for(let l=0;l<r.length;l++){const c=r[l];l===r.length-1?i[c]={columns:o,pageSize:(t==null?void 0:t.pageSize)??null}:(i[c]=i[c]||{},i=i[c])}return{settingObject:e,defaultUserSettings:o}},P7=async({baseUrl:e,gridSetting:t,gridPath:n})=>{try{const r=JSON.parse(localStorage.getItem("settings")),{settingObject:o,defaultUserSettings:i}=E7({presentSetting:r,gridSetting:t,gridPath:n});return localStorage.setItem("settings",JSON.stringify(o)),await _c({baseUrl:e,payload:o}),i}catch(r){console.error(r)}},M7=({customTools:e})=>{var r,o;const t=(r=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===X1.PRIMARY))==null?void 0:r.sort((i,a)=>i.sequenceId-a.sequenceId),n=(o=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===X1.SECONDARY))==null?void 0:o.sort((i,a)=>i.sequenceId-a.sequenceId);return{primaryButtons:t,secondaryButtons:n}},lw=({customTools:e,isExpanded:t,setIsExpanded:n})=>{const{primaryButtons:r,secondaryButtons:o}=M7({customTools:e}),[i,a]=R.useState(r),l=(o==null?void 0:o.length)>0,c=d=>{d?a([...r,...o]):setTimeout(()=>{a(r)},100)},u=()=>{const d=!t;n(d),c(d)};return R.useEffect(()=>{c(t)},[e]),g.jsxs(g.Fragment,{children:[t&&g.jsx("div",{style:{position:"fixed",left:0,width:"100vw",height:"4rem",zIndex:998}}),g.jsxs(ye,{sx:{display:"flex",alignItems:"center",gap:"0.8rem",flexWrap:"nowrap",maxWidth:"100%",whiteSpace:"nowrap",zIndex:999},children:[g.jsx(Q5,{mode:"popLayout",children:i.map((d,f)=>g.jsx(Gi.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},layout:!0,children:g.jsx(ye,{sx:{flexShrink:0,minWidth:"fit-content"},children:k7(d)})},`${d.id}_${f}`))}),l&&g.jsx(ye,{sx:{paddingLeft:t?"0.5rem":0},children:g.jsx(mo,{label:t?"":"More Actions",styles:{iconPrimary:!0,icon:t?Ke.CrossWhite:Ke.More,colorType:t?"danger":""},onClick:u})})]})]})};lw.propTypes={customTools:s.array.isRequired};const cw=({defaultTools:e,isManageable:t,customTools:n,baseUrl:r,gridPath:o,managableColumns:i=[],pageSize:a})=>{var b,x,w,C,O,v;const l=R.useContext(ya),{visibleGridColumns:c,triggerApi:u}=R.useContext(ga),[d,f]=R.useState([]),[p,h]=R.useState(!1);R.useEffect(()=>{if(i.length){const k=i.length?c.filter(E=>i.includes(E.id)):c;f(k)}},[i,c]);const y=async k=>{try{await P7({baseUrl:r,gridPath:o,gridSetting:{grid:k,pageSize:a}})}catch(E){console.error(E)}finally{l({type:qe.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),l({type:qe.TRIGGER_API,payload:{triggerApi:!1}})}};R.useEffect(()=>{u&&y(c)},[u]);const m=k=>{const E=k.map(D=>D.id),M=c.map(D=>{if(!d.some(I=>I.id===D.id))return D;const $=E.includes(D.id);if(Array.isArray(D.children)&&D.children.length>0){const I=D.children.map(j=>d.some(P=>P.id===j.id)?{...j,isHidden:$?!1:!E.includes(j.id)}:j),W=I.filter(j=>d.some(F=>F.id===j.id)).every(j=>j.isHidden);return{...D,isHidden:$?!1:W,children:I}}return{...D,isHidden:!E.includes(D.id)}});l({type:qe.SET_GRID_DATA,payload:{visibleGridColumns:M}}),l({type:qe.HAS_SETTING_CHANGE,payload:{hasChange:!0}})};return g.jsxs(ye,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"0.6rem",width:"100%"},children:[g.jsxs(ye,{sx:{display:"flex",flexDirection:"row",gap:"0.6rem"},children:[((b=e==null?void 0:e.search)==null?void 0:b.isRequired)&&g.jsx(s1,{...e==null?void 0:e.search,iconUrl:Ke.Search}),((x=e==null?void 0:e.groupBy)==null?void 0:x.isRequired)&&g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:g.jsx(Sc,{styles:{icon:Ke.Group},...e.groupBy})}),((w=e==null?void 0:e.refresh)==null?void 0:w.isRequired)&&g.jsx(mo,{...e==null?void 0:e.refresh,styles:{variant:"filled",icon:Ke.Refresh,colorType:"empty",width:"3.2rem",height:"3.2rem"}}),t&&g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:g.jsx(Sc,{placeholder:"Manage Columns",options:d,value:d.filter(k=>!k.isHidden),isMulti:!0,isDraggable:!0,showSearch:!0,onChange:m,styles:{icon:Ke.Manage}})})]}),g.jsxs(ye,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:"0.6rem"},children:[n&&g.jsx(lw,{customTools:n,setIsExpanded:h,isExpanded:p}),((C=e==null?void 0:e.save)==null?void 0:C.isRequired)&&g.jsx(ye,{sx:{px:"0.5rem"},children:g.jsx(mo,{label:p?"":"Save",styles:{icon:Ke.Save,colorType:"empty"},...e==null?void 0:e.save})}),((O=e==null?void 0:e.upload)==null?void 0:O.isRequired)&&g.jsx(mo,{...e==null?void 0:e.upload,styles:{variant:p?"outlined":"filled",icon:p?Ke.UploadDark:Ke.Upload,iconPrimary:!0,colorType:"secondary",isAnimate:!0}}),((v=e==null?void 0:e.download)==null?void 0:v.isRequired)&&g.jsx(mo,{...e==null?void 0:e.download,styles:{variant:"outlined",icon:Ke.Download,isAnimate:!0}})]})]})};cw.propTypes={defaultTools:s.object.isRequired,customTools:s.array,isManageable:s.bool,baseUrl:s.string,gridPath:s.gridPath};function Bp({tableProps:e,toolbarProps:t,isDefaultConfig:n,isLoading:r}){var i,a;const o=(i=e.columns)==null?void 0:i.isManageable;return g.jsx(a1,{children:r?g.jsxs(g.Fragment,{children:[g.jsx(aw,{type:"toolbar"}),g.jsx(aw,{type:"grid"})]}):g.jsxs(ye,{sx:{position:"sticky"},children:[t&&g.jsx(cw,{...t,isManageable:o,pageSize:(a=e==null?void 0:e.pagination)==null?void 0:a.rowPerPage}),g.jsx(iw,{tableProps:e,isDefaultConfig:n,gridPath:(t==null?void 0:t.gridPath)||"",baseUrl:(t==null?void 0:t.baseUrl)||""})]})})}Bp.propTypes={tableProps:s.object.isRequired,toolbarProps:s.object,isDefaultConfig:s.bool};const uw=({list:e,handleLinkClick:t})=>{const n=It(),r=({list:o})=>{var i;return(i=o==null?void 0:o.sort((a,l)=>a.order-l.order))==null?void 0:i.map((a,l)=>a!=null&&a.link?g.jsx(Fr,{component:"h3",sx:{fontSize:"1rem",cursor:"pointer",color:l===(o==null?void 0:o.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},href:a==null?void 0:a.link,underline:"hover",onClick:()=>t(a),children:a==null?void 0:a.title},l):g.jsx(nt,{component:"h3",sx:{fontSize:"1rem",color:l===(o==null?void 0:o.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},children:a==null?void 0:a.title},l))};return g.jsx(L0,{separator:g.jsx(hn,{url:Ke.ArrowRight}),children:r({list:e})})};uw.propTypes={list:s.array.isRequired,handleLinkClick:s.func};const dw=({breadcrumbProps:e,switchProps:t,filterComponentProps:n})=>{var o,i,a,l,c,u;const r=It();return g.jsxs(g.Fragment,{children:[g.jsxs(ft,{sx:{background:r.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,height:"3rem",p:"0px 5.5rem 0 1.5rem",zIndex:4,position:"relative"},direction:"row",justifyContent:"space-between",alignItems:"center",children:[g.jsx(uw,{...e}),g.jsxs(ft,{direction:"row",gap:"1rem",alignItems:"center",children:[t&&g.jsx(f1,{...t}),(n==null?void 0:n.filterBtnProps)&&g.jsxs(ft,{direction:"row",children:[g.jsx(yi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"2rem!important",opacity:"1!important",borderColor:r.palette.primary.notifyBorderColor}}),g.jsxs(ft,{direction:"row",alignItems:"center",gap:"0.5rem",onClick:(o=n==null?void 0:n.filterBtnProps)==null?void 0:o.onFilterClick,sx:{cursor:"pointer"},children:[g.jsx(hn,{url:Ke.Filter}),g.jsx(nt,{sx:{fontSize:"1.1rem",color:r.palette.primary.notifyActiveText},children:(i=n==null?void 0:n.filterBtnProps)==null?void 0:i.label})]})]})]})]}),g.jsx(Gi.div,{layout:!0,initial:{height:"0rem"},animate:{height:(a=n==null?void 0:n.filterBtnProps)!=null&&a.filterContainerVisible?"5rem":"0rem",opacity:(l=n==null?void 0:n.filterBtnProps)!=null&&l.filterContainerVisible?1:0},transition:{duration:.5,ease:"easeInOut"},style:{background:r.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,padding:"0px 5.5rem 0 1.5rem",position:"relative",alignItems:"center",display:"flex",overflow:"hidden"},children:g.jsxs(ft,{sx:{background:r.palette.primary.appBackground,height:"3.8rem",p:"0 2rem",width:"100%",borderRadius:"0.7rem",overflow:"visible"},direction:"row",alignItems:"center",children:[g.jsx(nt,{sx:{fontSize:"1.2rem",fontWeight:"500",color:r.palette.primary.notifyActiveText},children:"Filters:"}),g.jsx(ye,{sx:{overflowX:"auto",overflowY:"visible",whiteSpace:"nowrap",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},margin:"0 1rem",padding:"0.5rem 0",flexGrow:1},children:g.jsx(ft,{direction:"row",gap:"1.2rem",sx:{overflow:"visible"},children:(c=n==null?void 0:n.filterItems)==null?void 0:c.map((d,f)=>g.jsx(g.Fragment,{children:g.jsxs(ye,{sx:{position:"relative",overflow:"visible",border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,background:r.palette.primary.notifyBackground,borderRadius:"0.6rem",padding:"0.3rem 1.1rem",display:"inline-block"},children:[g.jsx(ye,{component:"img",src:Ke.FilterClose,sx:{position:"absolute",top:"-0.4rem",right:"-0.6rem",cursor:"pointer"},onClick:()=>n==null?void 0:n.onFilterChipClose(d)}),g.jsx(nt,{sx:{fontSize:"1rem",color:r.palette.primary.notifyTextColor},children:d==null?void 0:d.filterLabel})]},f)}))})}),g.jsx(ye,{component:nt,sx:{fontSize:"1.1rem",fontWeight:"500",textDecoration:"underline",color:r.palette.brandColor.red,cursor:"pointer"},onClick:(u=n==null?void 0:n.filterContainerProps)==null?void 0:u.onClearClick,children:"Clear"})]})})]})};dw.propTypes={breadcrumbProps:s.object.isRequired,switchProps:s.object};function fw({headerProps:e}){return g.jsx(Fn,{children:g.jsx(dw,{...e})})}fw.propTypes={headerProps:s.object.isRequired};const Lp=R.createContext(null),pw=R.createContext(null);function R7({children:e}){const[t,n]=R.useReducer(D7,I7);return g.jsx(Lp.Provider,{value:t,children:g.jsx(pw.Provider,{value:n,children:e})})}function D7(e,t){var n;switch(t.type){case qe.LOADING:return{...e,loading:t.loading};case qe.SUCCESS:return{...e,data:(n=t.data)==null?void 0:n.sort((r,o)=>new Date(o.createdAt)-new Date(r.createdAt))};case qe.MARK_ALL_AS_READ:return{...e,isMarkAllAsRead:t.isMarkAllAsRead};case qe.ERROR:return{...e,error:t.error};default:throw new Error(`${Gr.UNHANDLED}: ${t}`)}}const I7={loading:!1,data:[],error:"",isMarkAllAsRead:{count:0,boo:!1}},{TENANT_ID:Vp,BU_ID:Wp,SNOP_ID:hw}=Dp,{TENANT_IDS:zp,BU_IDS:Up}=Ca,A7=async e=>{try{const t=`${e}${$c.NOTIFICATION}/v1?${Vp}=${zp}&${Wp}=${Up}`;return await St.get(t,Sa)}catch(t){return t}},mw=async(e,t,n)=>{try{const r=n===K1.MARK_ALL_READ?"":`&${hw}=${n}&`,o=`${e}${$c.NOTIFICATION}${Mp.VERSION}?${Vp}=${zp}&${Wp}=${Up}${r}`;return await St.put(o,t,Sa)}catch(r){return r}},j7=async({baseUrl:e,id:t,snopId:n})=>{try{const r=`${e}${$c.NOTIFICATION}${Mp.VERSION}?${Vp}=${zp}&${Wp}=${Up}&${hw}=${n}&id=${t}`;return await St.get(r,Sa)}catch(r){return r}},Bc={OK:200,CREATED:201,NO_CONTENT:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,INTERNAL_SERVER_ERROR:500},gw=({baseUrl:e})=>{const t=R.useContext(pw),[n,r]=R.useState(!1),[o,i]=R.useState(!1),[a,l]=R.useState(!1),[c,u]=R.useState({}),[d,f]=R.useState(null),[p,h]=R.useState(1),[y,m]=R.useState(!1),[b,x]=R.useState(0),{loading:w,data:C,isMarkAllAsRead:O}=R.useContext(Lp),[v,k]=R.useState([]);R.useEffect(()=>{k(C)},[C]);const E=R.useCallback(async()=>{var j,F;try{t({type:qe.LOADING,loading:!0}),t({type:qe.SUCCESS,data:[]});const P=await A7(e);if(P.status===Bc.OK){const N=((F=(j=P.data)==null?void 0:j.responseData)==null?void 0:F.response)||[],L=Cc(N);t({type:qe.SUCCESS,data:Cc(L)}),t({type:qe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:i1(N),boo:i1(N)>0}})}}catch{t({type:qe.ERROR,error:Gr.SWR})}finally{t({type:qe.LOADING,loading:!1})}},[e,t]);R.useEffect(()=>{E();const j=setInterval(E,3e5);return()=>clearInterval(j)},[E]);const M=async(j,F)=>{var P,N,L;if(j){f(j);try{const H=await j7({baseUrl:e,id:j,snopId:F});if(H.status===Bc.OK){const V=((L=(N=(P=H.data)==null?void 0:P.responseData)==null?void 0:N.response)==null?void 0:L[0])||{};u(V||{}),l(!0)}else throw new Error}catch{t({type:qe.ERROR,error:Gr.SWR})}finally{f(null)}}},D=async(j,F)=>{if(j.length){t({type:qe.LOADING,loading:!0});try{if((await mw(e,j,F)).status===Bc.OK){const N=C.map(H=>j.includes(H.id)?{...H,isRead:!0}:H),L=N.filter(H=>!H.isRead).length;t({type:qe.SUCCESS,data:Cc(N)}),t({type:qe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:L,boo:L>0}}),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},200)}}catch{t({type:qe.ERROR,error:Gr.SWR}),t({type:qe.LOADING,loading:!1})}}},A=async()=>{t({type:qe.LOADING,loading:!0});try{const j=d8(C);if((await mw(e,j,K1.MARK_ALL_READ)).status===Bc.OK){const P=C.map(N=>({...N,isRead:!0}));t({type:qe.SUCCESS,data:Cc(P)}),t({type:qe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:0,boo:!1}}),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},200)}}catch{t({type:qe.ERROR,error:Gr.SWR}),t({type:qe.LOADING,loading:!1})}},$=(j,F)=>{t({type:qe.LOADING,loading:!0}),x(F),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},400)},I=j=>{const F=j||C||[];return{0:F,1:F.filter(P=>(P==null?void 0:P.type)==="INFO"),2:F.filter(P=>(P==null?void 0:P.type)==="ERROR")}},W=()=>{t({type:qe.LOADING,loading:!0});const j=!y,F=j?(v||[]).filter(P=>!P.isRead):C||[];m(j),k(F),h(1),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},400)};return{fetchNotification:E,showDetailsProps:{open:a,handleClose:()=>l(!1),setOpen:l,data:c,clickId:d},alertDialogProps:{open:n,handleClose:()=>r(!1),onRefresh:E,handleRead:D,handleMarkAllAsRead:A,setOpen:r,handleShowDetails:M,clickId:d,isMainDialog:!0},activeTab:b,loading:w,tabData:I(v)[b],data:v,mode:y,handleTabChange:$,toggleAlertMode:W,page:p,setPage:h,isMarkAllAsRead:O}};var yw,bw,vw;function Hp(){return Hp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hp.apply(null,arguments)}var N7=function(t){return S.createElement("svg",Hp({xmlns:"http://www.w3.org/2000/svg",width:16,height:17,fill:"none"},t),yw||(yw=S.createElement("path",{stroke:"#909090",strokeLinecap:"round",strokeMiterlimit:10,d:"M8.013 2.19c-2.206 0-4 1.793-4 4v1.927c0 .406-.173 1.026-.38 1.373l-.766 1.273c-.474.787-.147 1.66.72 1.954 2.873.96 5.973.96 8.846 0a1.335 1.335 0 0 0 .72-1.954l-.766-1.273c-.2-.347-.374-.967-.374-1.373V6.19c0-2.2-1.8-4-4-4Z"})),bw||(bw=S.createElement("path",{stroke:"#909090",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"M9.247 2.383a4.503 4.503 0 0 0-2.467 0 1.324 1.324 0 0 1 2.467 0"})),vw||(vw=S.createElement("path",{stroke:"#909090",strokeMiterlimit:10,d:"M10.013 12.957c0 1.1-.9 2-2 2a2.007 2.007 0 0 1-2-2"})))};const $7=({count:e})=>(It(),g.jsxs(g.Fragment,{children:[g.jsx(ye,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center","& svg":{transform:"scale(1)"}},children:g.jsx(N7,{style:{scale:2}})}),g.jsx(C7,{badgeContent:e!=0?"":null,color:"error"})]}));function xw({children:e,handleClose:t,open:n,isMainDialog:r}){return g.jsx(kl,{open:n,onClose:t,...r?{scroll:"paper",PaperProps:{sx:{position:"fixed",top:30,right:30,m:0,width:400,height:450,display:"flex",flexDirection:"column",borderRadius:2,boxShadow:6,backgroundColor:o=>o.palette.primary.notifyBackground}}}:{fullWidth:!0,maxWidth:"md",sx:{"& .MuiPaper-root":{minHeight:250,maxHeight:500,borderRadius:"1.5rem",boxShadow:6,backgroundColor:o=>o.palette.primary.appBackground}}},children:e})}var ww;function qp(){return qp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qp.apply(null,arguments)}var _7=function(t){return S.createElement("svg",qp({xmlns:"http://www.w3.org/2000/svg",width:14,height:9,fill:"none",viewBox:"0 0 13 9"},t),ww||(ww=S.createElement("path",{fill:"#A8A8A8",fillRule:"evenodd",d:"M8.954 1.004a.406.406 0 0 1 0 .575L3.537 6.996a.406.406 0 0 1-.574 0L.796 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0m3.25 0a.406.406 0 0 1 0 .575L6.787 6.996a.406.406 0 1 1-.574-.575l5.416-5.417a.406.406 0 0 1 .575 0",clipRule:"evenodd"})))},Cw,Sw;function Yp(){return Yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yp.apply(null,arguments)}var F7=function(t){return S.createElement("svg",Yp({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),Cw||(Cw=S.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M7.79 6c0 .99-.8 1.79-1.79 1.79S4.21 6.99 4.21 6 5.01 4.21 6 4.21s1.79.8 1.79 1.79"})),Sw||(Sw=S.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M6 10.135c1.765 0 3.41-1.04 4.555-2.84.45-.705.45-1.89 0-2.595C9.41 2.9 7.765 1.86 6 1.86S2.59 2.9 1.445 4.7c-.45.705-.45 1.89 0 2.595 1.145 1.8 2.79 2.84 4.555 2.84"})))},Tw;function Gp(){return Gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gp.apply(null,arguments)}var B7=function(t){return S.createElement("svg",Gp({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),Tw||(Tw=S.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M8.277 1.004a.406.406 0 0 1 0 .575L2.86 6.996a.406.406 0 0 1-.574 0L.119 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0",clipRule:"evenodd"})))};const Ow=({type:e,item:t,handleShowDetails:n,handleRead:r,handleCTAClicked:o,clickId:i})=>{var c,u;const a=It(),l=(u=(c=JSON.parse(localStorage.getItem("settings")))==null?void 0:c.platform)==null?void 0:u.theme;return g.jsxs(ye,{className:"cards",sx:{pt:" 0.8rem"},children:[g.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:g.jsx(nd,{sx:{width:"calc(100% - 2%)","& .MuiBadge-badge":{backgroundColor:"#6041EA",height:"0.5rem",minWidth:"0.5rem"}},variant:"dot",invisible:t==null?void 0:t.isRead,children:g.jsx(Oo,{sx:{color:a.palette.primary.notifyActiveText,whiteSpace:"normal",wordBreak:"break-word"},component:"p",className:["title-card",(t==null?void 0:t.isRead)&&"read"].join(" "),children:t==null?void 0:t.message})})}),g.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:g.jsxs(ft,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[(t==null?void 0:t.isNotificationDetails)&&g.jsx(Fc,{icon:g.jsx(F7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:n,label:i===(t==null?void 0:t.id)?g.jsx(Ol,{color:"primary",size:13}):"Show Details",component:"button",variant:"filled",clickable:!0,size:"small",sx:{backgroundColor:a.palette.brandColor.orange,color:a.palette.brandColor.white}}),!(t!=null&&t.isRead)&&g.jsx(Fc,{icon:g.jsx(B7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:r,label:"Acknowledge",component:"button",variant:"outlined",clickable:!0,size:"small"}),(t==null?void 0:t.primaryCTAURL)&&g.jsx(Fc,{disabled:t==null?void 0:t.isPrimaryCTAClicked,onClick:()=>o({redirect:t==null?void 0:t.isPrimaryCTARedirect,isClicked:t==null?void 0:t.isPrimaryCTAClicked,url:t==null?void 0:t.primaryCTAURL}),label:t==null?void 0:t.primaryCTALabel,component:"button",variant:"outlined",clickable:!0,size:"small"}),(t==null?void 0:t.secondaryCTAURL)&&g.jsx(Fc,{disabled:t==null?void 0:t.isSecondaryCTAClicked,onClick:()=>o({redirect:t==null?void 0:t.isSecondaryCTARedirect,isClicked:t==null?void 0:t.isSecondaryCTAClicked,url:t==null?void 0:t.secondaryCTAURL}),label:t==null?void 0:t.secondaryCTALabel,component:"button",variant:"outlined",clickable:!0,size:"small"})]})}),g.jsxs(ft,{display:"flex",flexDirection:"row",alignItems:"center",gap:.35,children:[g.jsx(Oo,{sx:{fontSize:"0.8rem"},children:t==null?void 0:t.product}),g.jsx(Oo,{color:a.palette.primary.notifyTextColor,children:"•"}),g.jsx(Oo,{sx:{fontSize:"0.8rem"},children:u8(t==null?void 0:t.createdAt)})]})]})};Ow.propTypes={type:s.string,title:s.string,subTitle:s.string,isRead:s.bool,handleShowDetails:s.func,handleRead:s.func};const kw=({data:e,handleRead:t,handleShowDetails:n,clickId:r,mode:o,page:i,setPage:a})=>{const{isMarkAllAsRead:l}=R.useContext(Lp),c=new Date,u=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(c),[d,f]=R.useState([]),[p,h]=R.useState(!1),[y,m]=R.useState(!0),b=R.useRef(null),x=async C=>{h(!0);const O=e.slice((C-1)*10,C*10);await new Promise(v=>setTimeout(v,1e3)),f(v=>{const k=O.filter(E=>!v.some(M=>M.id===E.id));return[...v,...k]}),h(!1),(d==null?void 0:d.length)>=(e==null?void 0:e.length)&&m(!1)};R.useEffect(()=>{var O;let C=[];o?l!=null&&l.count?C=(O=e==null?void 0:e.filter(v=>!v.isRead))==null?void 0:O.slice(0,10):C=[]:C=e.slice(0,10),(C==null?void 0:C.length)<10&&m(!1),f(C)},[e,o,l]),R.useEffect(()=>{y&&i!==1&&x(i)},[i,e]),R.useEffect(()=>{f([...e])},[e]),R.useEffect(()=>{const C=new IntersectionObserver(O=>{O[0].isIntersecting&&!p&&y&&a(v=>v+1)},{threshold:1});return b.current&&C.observe(b.current),()=>{b.current&&C.unobserve(b.current)}},[p,y]);const w=({redirect:C,isClicked:O,url:v})=>{window.open(v,"_blank")};return g.jsxs(ye,{sx:{width:"100%"},children:[Object.entries(h8(d)).map(([C,O])=>g.jsxs(R.Fragment,{children:[C!==u&&g.jsx(w7,{children:C}),O.map((v,k)=>g.jsx(R.Fragment,{children:g.jsx(Ow,{item:v,handleCTAClicked:w,handleShowDetails:()=>n(v.id,v.snopId),handleRead:()=>t([v.id],v.snopId),clickId:r})},`${k}_${v.id}`))]},C)),p&&i>1&&!!(d!=null&&d.length)&&g.jsx(ye,{sx:{display:"flex",justifyContent:"center",alignItems:"center",pl:"0.5rem",py:"0.3rem"},children:g.jsx(Ol,{size:20,sx:{color:C=>C.palette.primary.notifyIconColor}})}),!(d!=null&&d.length)&&g.jsx(nt,{sx:{fontSize:"1.1rem",color:C=>C.palette.primary.notifyTextColor,textAlign:"center",px:"0.8rem"},children:"You don't have any unread notification here. Use the toggle to switch between read and unread notification."}),g.jsx(ye,{ref:b,style:{height:"0.1rem",backgroundColor:"transparent"}})]})};kw.propTypes={data:s.array,handleRead:s.func,handleShowDetails:s.func};const L7=({onRefresh:e,handleShowDetails:t,clickId:n,handleRead:r,handleMarkAllAsRead:o})=>{var y,m,b,x;const{loading:i,activeTab:a,data:l,tabData:c,mode:u,page:d,setPage:f,handleTabChange:p,toggleAlertMode:h}=gw({});return g.jsxs(g.Fragment,{children:[g.jsxs(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,pt:2},children:[g.jsx(nt,{variant:"h2",sx:{fontSize:"1.2rem",color:w=>w.palette.primary.notifyTextColor},children:"Notifications"}),g.jsx(ye,{onClick:e,children:g.jsx(hn,{url:Ke.Refresh,alt:"refresh",sx:{cursor:"pointer"}})})]}),g.jsx(ye,{sx:{borderBottom:1,m:"1.2rem 1.2rem 0 1.2rem",borderColor:w=>w.palette.primary.notifyBorderColor},children:g.jsxs(S7,{value:a,onChange:p,children:[g.jsx(Fp,{label:g.jsxs(ye,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["All (",g.jsx(nt,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((y=l==null?void 0:l.filter(w=>!(w!=null&&w.isRead)))==null?void 0:y.length)||0}),")"]})}),g.jsx(Fp,{label:g.jsxs(ye,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Info (",g.jsx(nt,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((m=l==null?void 0:l.filter(w=>(w==null?void 0:w.type)==="INFO"&&!(w!=null&&w.isRead)))==null?void 0:m.length)||0}),")"]}),sx:{color:w=>w.palette.brandColor.blue}}),g.jsx(Fp,{label:g.jsxs(ye,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Error (",g.jsx(nt,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((b=l==null?void 0:l.filter(w=>(w==null?void 0:w.type)==="ERROR"&&!(w!=null&&w.isRead)))==null?void 0:b.length)||0}),")"]}),sx:{color:w=>w.palette.brandColor.red}})]})}),g.jsx(Pl,{dividers:!0,sx:{p:0,...i&&!c.length&&{alignItems:"center",justifyContent:"center"},flexGrow:1,overflowY:"auto",mx:"1.2rem",borderColor:w=>w.palette.primary.notifyBorderColor},tabIndex:-1,children:i?g.jsx(Ol,{size:30,sx:{color:w=>w.palette.primary.notifyIconColor}}):g.jsx(g.Fragment,{children:g.jsx(kw,{data:c,handleShowDetails:t,handleRead:r,clickId:n,page:d,setPage:f,mode:u})})}),g.jsxs(El,{sx:{justifyContent:"space-between",px:"1.2rem"},children:[g.jsxs(ft,{direction:"row",gap:1,children:[g.jsx(Oo,{sx:{fontSize:"1rem"},children:"Only show unread"}),g.jsx(x7,{disabled:i,checked:u,onChange:h})]}),g.jsx(Hn,{variant:"outlined",className:"view-all",onClick:o,startIcon:g.jsx(_7,{}),disabled:!((x=l==null?void 0:l.filter(w=>!(w!=null&&w.isRead)))!=null&&x.length),style:{backgroundColor:"transparent"},sx:{fontSize:"1rem",fontWeight:"300",p:0,border:"none",textTransform:"none",color:w=>w.palette.primary.notifyTextColor,"&:hover":{color:w=>w.palette.primary.notifyActiveText,background:"transparent",boxShadow:"none",border:"none"},"&.Mui-disabled":{opacity:.5,color:w=>`${w.palette.primary.notifyActiveText}!important`,background:"transparent",boxShadow:"none",border:"none"}},children:"Mark all as read"})]})]})},V7=({data:e,handleClose:t})=>{var b;const[n,r]=R.useState(1),[o,i]=R.useState(10),[a,l]=R.useState(((b=e==null?void 0:e.notificationDetails)==null?void 0:b.length)||0),[c,u]=R.useState("sku_name"),[d,f]=R.useState("asc"),[p,h]=R.useState([]),[y,m]=R.useState("");return R.useEffect(()=>{var x;if(y||c){const w=f8(e==null?void 0:e.notificationDetails,a7,y);if(c){const C=p8(w,c,d?"asc":"desc");h(pp(C,n,o)),l(C.length);return}h(pp(w,n,o)),l(w.length);return}h(pp(e==null?void 0:e.notificationDetails,n,o)),l((x=e==null?void 0:e.notificationDetails)==null?void 0:x.length)},[y,e==null?void 0:e.notificationDetails,n,o,d,c]),g.jsxs(g.Fragment,{children:[g.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{padding:"1.5rem 2rem",borderBottom:"0.1rem solid",borderColor:x=>x.palette.primary.notifyBorderColor},children:[g.jsx(nt,{component:"h2",sx:{fontSize:"1.4rem",color:x=>x.palette.primary.notifyActiveText},children:(e==null?void 0:e.message)||""}),g.jsx(ye,{onClick:t,sx:{cursor:"pointer"},children:g.jsx(hn,{url:Ke.CloseCircle})})]}),g.jsx(Pl,{children:g.jsx(Bp,{tableProps:{data:p,columns:{...y7(),isManageable:!1},sort:{sortField:c,sortDir:d,onSort:x=>{var C;const w=(C=x==null?void 0:x.column)==null?void 0:C.key;f(O=>c===w&&O==="asc"?"desc":"asc"),u(w)}},pagination:{selectedPage:n,rowPerPage:o,totalRecords:a,onPageChange:x=>{r(x)},onPageSizeChange:x=>{i(x==null?void 0:x.value),r(1)}}},toolbarProps:{defaultTools:{search:{isRequired:!0,onChange:x=>{const w=x.target.value;w&&r(1),m(w)},placeholder:"Search..."}}}})}),g.jsx(El,{sx:{padding:"1.5rem 2rem"}})]})},W7=({baseUrl:e})=>{const{alertDialogProps:t,showDetailsProps:n,fetchNotification:r,isMarkAllAsRead:o}=gw({baseUrl:e});return g.jsxs(g.Fragment,{children:[g.jsx(ye,{sx:{display:"flex",justifyContent:"center",cursor:"pointer",marginTop:"0.6rem"},onClick:()=>{var i;r(),(i=t==null?void 0:t.setOpen)==null||i.call(t,!0)},children:g.jsx($7,{count:o.count})}),g.jsx(xw,{...t,children:g.jsx(L7,{...t})}),g.jsx(xw,{...n,children:g.jsx(V7,{...n})})]})},z7=({baseUrl:e})=>g.jsx(Fn,{children:g.jsx(R7,{children:g.jsx(W7,{baseUrl:e})})}),U7=({rightChild:e,leftChild:t,isDrawerMerged:n,isDrawerOpen:r,drawerTitle:o,showExpand:i,onCloseClick:a,onMergeClick:l,onExpandClick:c,isDrawerExpanded:u,styles:d,showMerge:f})=>{const p=It();return g.jsx(ye,{sx:{position:"relative",overflow:"hidden"},children:g.jsxs(ao,{container:!0,sx:{height:"100%"},children:[g.jsx(ao,{item:!0,sx:{width:n?d!=null&&d.drawerWidth?`calc(${"100%"-(d==null?void 0:d.drawerWidth)})`:"75%":"100%",position:"relative",zIndex:3,height:"calc(100vh - 7rem)",p:"0rem 1.5rem",overflow:"auto"},children:t}),r&&!n&&g.jsxs(g.Fragment,{children:[g.jsx(ye,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"#07080B80",backdropFilter:"blur(3px)",zIndex:3,transition:"opacity 0.3s ease-in-out"}}),g.jsx(ye,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"transparent",zIndex:4}})]}),e&&g.jsxs(ao,{item:!0,sx:{width:u?"90%":(d==null?void 0:d.drawerWidth)||"25%",position:n?"relative":"absolute",top:0,right:0,height:"calc(100vh - 7rem)",backgroundColor:p.palette.primary.notifyBackground,transform:r?"translateX(0)":"translateX(100%)",transition:"transform 0.4s ease-in-out , width 0.4s ease-in-out",zIndex:4,borderLeft:`0.1rem solid ${p.palette.primary.notifyBorderColor}`,display:"flex",flexDirection:"column"},children:[g.jsxs(ft,{direction:"row",alignItems:"center",sx:{width:"100%",flexShrink:0,paddingBottom:"0.8rem",px:2,pt:"0.8rem",borderBottom:h=>`0.1rem solid ${h.palette.primary.notifyBorderColor}`},children:[!u&&f&&g.jsxs(g.Fragment,{children:[g.jsx(ye,{component:"img",src:Ke.Merge,sx:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer"},onClick:l}),g.jsx(yi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"auto!important",borderColor:p.palette.primary.notifyBorderColor}})]}),g.jsxs(ft,{direction:"row",justifyContent:"space-between",alignItems:"center",flexGrow:1,children:[g.jsxs(ft,{direction:"row",gap:"0.5rem",alignItems:"center",onClick:a,sx:{cursor:"pointer"},children:[g.jsx(hn,{url:Ke.CrossLight}),g.jsx(nt,{sx:{fontSize:"1.2rem",color:p.palette.primary.notifyTextColor},children:o})]}),g.jsx(ft,{direction:"row",gap:"0.5rem",alignItems:"center",children:i&&g.jsx(ye,{onClick:c,sx:{cursor:"pointer"},children:g.jsx(ye,{component:"img",src:u?Ke.Collapse:Ke.Expand})})})]})]}),g.jsx(ye,{sx:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},overflow:"auto",px:2},children:e})]})]})})},Ew=({layoutChildren:e,layoutProps:t})=>g.jsx(Fn,{children:g.jsx(U7,{...e,...t})});Ew.propTypes={layoutChildren:s.object.isRequired,layoutProps:s.object.isRequired},vt.Button=mo,vt.Checkbox=sc,vt.DatePicker=l8,vt.Grid=Bp,vt.Header=fw,vt.InputField=s1,vt.Loader=N8,vt.Notification=z7,vt.Select=l1,vt.SliderLayout=Ew,vt.Switch=f1,vt.TextField=xc,vt.ToastProvider=R8,vt.toast=k8,Object.defineProperty(vt,Symbol.toStringTag,{value:"Module"})});
|
|
326
|
+
`+i):r.stack=i}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=So(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&jc.assertOptions(r,{silentJSONParsing:mr.transitional(mr.boolean),forcedJSONParsing:mr.transitional(mr.boolean),clarifyTimeoutError:mr.transitional(mr.boolean)},!1),o!=null&&(te.isFunction(o)?n.paramsSerializer={serialize:o}:jc.assertOptions(o,{encode:mr.function,serialize:mr.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),jc.assertOptions(n,{baseUrl:mr.spelling("baseURL"),withXsrfToken:mr.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=i&&te.merge(i.common,i[n.method]);i&&te.forEach(["delete","get","head","post","put","patch","common"],y=>{delete i[y]}),n.headers=gn.concat(a,i);const l=[];let c=!0;this.interceptors.request.forEach(function(m){typeof m.runWhen=="function"&&m.runWhen(n)===!1||(c=c&&m.synchronous,l.unshift(m.fulfilled,m.rejected))});const u=[];this.interceptors.response.forEach(function(m){u.push(m.fulfilled,m.rejected)});let d,f=0,p;if(!c){const y=[H1.bind(this),void 0];for(y.unshift.apply(y,l),y.push.apply(y,u),p=y.length,d=Promise.resolve(n);f<p;)d=d.then(y[f++],y[f++]);return d}p=l.length;let h=n;for(f=0;f<p;){const y=l[f++],m=l[f++];try{h=y(h)}catch(b){m.call(this,b);break}}try{d=H1.call(this,h)}catch(y){return Promise.reject(y)}for(f=0,p=u.length;f<p;)d=d.then(u[f++],u[f++]);return d}getUri(t){t=So(this.defaults,t);const n=$1(t.baseURL,t.url,t.allowAbsoluteUrls);return E1(n,t.params,t.paramsSerializer)}};te.forEach(["delete","get","head","options"],function(t){To.prototype[t]=function(n,r){return this.request(So(r||{},{method:t,url:n,data:(r||{}).data}))}}),te.forEach(["post","put","patch"],function(t){function n(r){return function(i,a,l){return this.request(So(l||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}To.prototype[t]=n(),To.prototype[t+"Form"]=n(!0)});let n7=class Mw{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(i){n=i});const r=this;this.promise.then(o=>{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(l=>{r.subscribe(l),i=l}).then(o);return a.cancel=function(){r.unsubscribe(i)},a},t(function(i,a,l){r.reason||(r.reason=new Is(i,a,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Mw(function(o){t=o}),cancel:t}}};function r7(e){return function(n){return e.apply(null,n)}}function o7(e){return te.isObject(e)&&e.isAxiosError===!0}const Pp={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pp).forEach(([e,t])=>{Pp[t]=e});function G1(e){const t=new To(e),n=p1(To.prototype.request,t);return te.extend(n,To.prototype,t,{allOwnKeys:!0}),te.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return G1(So(e,o))},n}const St=G1(xa);St.Axios=To,St.CanceledError=Is,St.CancelToken=n7,St.isCancel=I1,St.VERSION=q1,St.toFormData=Pc,St.AxiosError=He,St.Cancel=St.CanceledError,St.all=function(t){return Promise.all(t)},St.spread=r7,St.isAxiosError=o7,St.mergeConfig=So,St.AxiosHeaders=gn,St.formToJSON=e=>R1(te.isHTMLForm(e)?new FormData(e):e),St.getAdapter=U1.getAdapter,St.HttpStatusCode=Pp,St.default=St;const{Axios:KW,AxiosError:XW,CanceledError:ZW,isCancel:JW,CancelToken:QW,VERSION:ez,all:tz,Cancel:nz,isAxiosError:rz,spread:oz,toFormData:sz,AxiosHeaders:iz,HttpStatusCode:az,formToJSON:lz,getAdapter:cz,mergeConfig:uz}=St,Mp={BASE_URL:"https://qa.3sc.ai/api",VERSION:"/v1"};/*! js-cookie v3.0.5 | MIT */function Nc(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)e[r]=n[r]}return e}var s7={read:function(e){return e[0]==='"'&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}};function Rp(e,t){function n(o,i,a){if(!(typeof document>"u")){a=Nc({},t,a),typeof a.expires=="number"&&(a.expires=new Date(Date.now()+a.expires*864e5)),a.expires&&(a.expires=a.expires.toUTCString()),o=encodeURIComponent(o).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var l="";for(var c in a)a[c]&&(l+="; "+c,a[c]!==!0&&(l+="="+a[c].split(";")[0]));return document.cookie=o+"="+e.write(i,o)+l}}function r(o){if(!(typeof document>"u"||arguments.length&&!o)){for(var i=document.cookie?document.cookie.split("; "):[],a={},l=0;l<i.length;l++){var c=i[l].split("="),u=c.slice(1).join("=");try{var d=decodeURIComponent(c[0]);if(a[d]=e.read(u,d),o===d)break}catch{}}return o?a[o]:a}}return Object.create({set:n,get:r,remove:function(o,i){n(o,"",Nc({},i,{expires:-1}))},withAttributes:function(o){return Rp(this.converter,Nc({},this.attributes,o))},withConverter:function(o){return Rp(Nc({},this.converter,o),this.attributes)}},{attributes:{value:Object.freeze(t)},converter:{value:Object.freeze(e)}})}var i7=Rp(s7,{path:"/"});const Rr={TOKEN:"token",USER:"user",SNOP:"snop",SELECTED_BU:"selected_business_unit",SETTINGS:"settings"},Dp={BEARER:"Bearer",TENANT_ID:"tenant_id",BU_ID:"bu_id",SNOP_ID:"snop_id"},a7=Object.values({"SKU Name":"sku_name",Node:"node","Channel Name":"channel_name"}),l7=[10,25,50,100],K1={MARK_ALL_READ:"MARK_ALL_READ"},c7=l7.map(e=>({label:e,value:e})),X1={PRIMARY:"PRIMARY",SECONDARY:"SECONDARY"},Ip=wc(Rr.SNOP),Ap=wc(Rr.SELECTED_BU),jp=wc(Rr.USER),u7=wc(Rr.SETTINGS),Ca={BU_IDS:Ap==null?void 0:Ap.business_unit_id,TOKEN:JSON.parse(i7.get(Rr.TOKEN)||null),TENANT_IDS:jp==null?void 0:jp.tenant_id,SNOP_IDS:Ip==null?void 0:Ip.snop_id,GRID_SETTINGS:u7},Sa={headers:{"Content-Type":"application/json",Authorization:`${Dp.BEARER} ${Ca.TOKEN}`}},Z1=St.create({baseURL:Mp.BASE_URL,axiosConfig:Sa});Z1.interceptors.request.use(function(e){return e},function(e){return Promise.reject(e)}),Z1.interceptors.response.use(function(e){return e},function(e){return Promise.reject(e)});const $c={NOTIFICATION:"/notifications",SETTING:"/configuration/setting"},{TENANT_ID:d7,BU_ID:f7}=Dp,{TENANT_IDS:p7,BU_IDS:h7}=Ca,_c=async({baseUrl:e,payload:t})=>{try{const n=`${e}${$c.SETTING}/v1?${d7}=${p7}&${f7}=${h7}`;return await St.post(n,t,Sa)}catch(n){return n}},m7=({columns:e,gridPath:t,baseUrl:n,isDefaultConfig:r,pageSize:o})=>{var m,b;let{definitions:i,defaultUserSettings:a,labels:l}=e;const c=t.split("/").filter(Boolean),u=JSON.parse(localStorage.getItem(Rr.SETTINGS));let d=c.reduce((x,w)=>x==null?void 0:x[w],u)||null;if(!r&&t){a=J1({definitions:i});const x=new Set((m=d==null?void 0:d.column)==null?void 0:m.map(C=>C.id)),w=a.filter(C=>!x.has(C.id));(!d||(w==null?void 0:w.length)>0)&&(async()=>{try{const O={...Ca.GRID_SETTINGS||{platform:{theme:"light"}}},v=(d==null?void 0:d.pageSize)??o;let k=O;for(let E=0;E<c.length;E++){const M=c[E];E===c.length-1?k[M]={columns:a,pageSize:v}:(k[M]={...k[M]||{}},k=k[M])}localStorage.setItem(Rr.SETTINGS,JSON.stringify(O)),await _c({baseUrl:n,payload:O})}catch(C){console.error(C)}})()}a=(d==null?void 0:d.columns)??a??J1({definitions:i});const f=a.reduce((x,w)=>(x[w.id]=w,x),{}),p=l.reduce((x,w)=>(x[w.id]=w,x),{}),h=[];for(const x of i){const w=f[x.id]||{},C=p[x.id]||{};let O={...x,...w,...C};if((b=x.children)!=null&&b.length){const v=w.children||[],k=C.children||[];O.children=x.children.map((E,M)=>({...E,...v[M],...k[M]}))}h.push(O)}return h.sort((x,w)=>x.sequenceId-w.sequenceId)},g7=e=>e.sort((t,n)=>t.sequenceId-n.sequenceId),J1=({definitions:e})=>e.map((t,n)=>({id:t.id,key:t.key,sequenceId:t.id,isHidden:!1,style:t.style||{}})),y7=()=>({definitions:[{id:1,key:"sku_name",isSortable:!0,isMandatory:!0},{id:2,key:"node",isSortable:!0,isMandatory:!0},{id:3,key:"channel_name",isSortable:!0,isMandatory:!0}],defaultUserSettings:[{id:1,key:"sku_name",sequenceId:1,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}},{id:2,key:"node",sequenceId:2,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}},{id:3,key:"channel_name",sequenceId:3,isHidden:!1,style:{width:"20rem",minWidth:"20rem",maxWidth:"20rem"}}],labels:[{id:1,key:"sku_name",label:"SKU",isLocalizable:!1},{id:2,key:"node",label:"Node",isLocalizable:!1},{id:3,key:"channel_name",label:"Channel",isLocalizable:!1}]});class Np extends R.Component{constructor(t){super(t),this.startDrag=this.startDrag.bind(this),this.endDrag=this.endDrag.bind(this),this.onMouseMove=this.onMouseMove.bind(this),this.dragging=!1,this.mouseX=0,this.startPos=0,this.startWidthPrev=0,this.lastDraggedWidth=0,this.draggedCol=null,this.resizeRef=R.createRef()}startDrag(){if(!this.props.disabled&&(this.draggedCol=this.props.id,this.props.resizeStart&&this.draggedCol===this.props.id&&this.props.resizeStart(),this.dragging=!0,this.startPos=this.mouseX,this.startWidthPrev=0,this.resizeRef.current)){let t=this.resizeRef.current.previousSibling;t&&(this.startWidthPrev=t.clientWidth)}}endDrag(){this.props.disabled||(this.dragging=!1,this.props.resizeEnd&&this.draggedCol===this.props.id&&this.props.resizeEnd(this.lastDraggedWidth),this.draggedCol=null)}onMouseMove(t){if(this.props.disabled||(this.mouseX=t.touches?t.touches[0].screenX:t.screenX,!this.dragging))return;const n=this.resizeRef.current,r=this.startPos-this.mouseX;let o=this.startWidthPrev-r;(!this.props.minWidth||o>=this.props.minWidth)&&(!this.props.maxWidth||o<=this.props.maxWidth)&&(n.previousSibling.style.width=o+"px",n.previousSibling.style.minWidth=o+"px",n.previousSibling.style.maxWidth=o+"px",n.previousSibling.style.setProperty("--column_resize_before_width",o+"px"),this.lastDraggedWidth=o)}componentDidMount(){const t=this.resizeRef.current;if(t&&(this.props.defaultWidth?(t.previousSibling.style.minWidth=this.props.defaultWidth+"px",t.previousSibling.style.width=this.props.defaultWidth+"px",t.previousSibling.style.maxWidth=this.props.defaultWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.defaultWidth+"px")):this.props.minWidth&&(t.previousSibling.style.minWidth=this.props.minWidth+"px",t.previousSibling.style.width=this.props.minWidth+"px",t.previousSibling.style.maxWidth=this.props.minWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.minWidth+"px"))),this.props.disabled){this.props.defaultWidth&&t&&(t.previousSibling.style.minWidth=this.props.defaultWidth+"px",t.previousSibling.style.width=this.props.defaultWidth+"px",t.previousSibling.style.maxWidth=this.props.defaultWidth+"px",t.previousSibling.style.setProperty("--column_resize_before_width",this.props.defaultWidth+"px")),this.props.maxWidth&&t&&(t.previousSibling.style.maxWidth=this.props.maxWidth+"px");return}this.addEventListenersToDocument()}componentWillUnmount(){this.props.disabled||this.removeEventListenersFromDocument()}componentDidUpdate(t,n){t.disabled&&!this.props.disabled&&this.addEventListenersToDocument(),!t.disabled&&this.props.disabled&&this.removeEventListenersFromDocument()}addEventListenersToDocument(){document.addEventListener("mousemove",this.onMouseMove),document.addEventListener("mouseup",this.endDrag),document.addEventListener("touchmove",this.onMouseMove),document.addEventListener("touchend",this.endDrag)}removeEventListenersFromDocument(){document.removeEventListener("mousemove",this.onMouseMove),document.removeEventListener("mouseup",this.endDrag),document.removeEventListener("touchmove",this.onMouseMove),document.removeEventListener("touchend",this.endDrag)}render(){var t={userSelect:"none"};return this.props.disabled||(t.cursor="ew-resize"),this.props.className===""&&(t.width="6px",t.backgroundColor="rgba(0, 0, 0, 0.1)"),R.createElement("th",{ref:this.resizeRef,style:t,disabled:this.props.disabled,rowSpan:this.props.rowSpan?this.props.rowSpan:1,colSpan:this.props.colSpan?this.props.colSpan:1,className:`column_resizer_own_class ${this.props.disabled?"disabled_column_resize":""} ${this.props.className}`,onMouseDown:this.props.disabled?null:this.startDrag,onTouchStart:this.props.disabled?null:this.startDrag})}}Np.defaultProps={disabled:!1,minWidth:0,className:""},Np.propTypes={disabled:"boolean",minWidth:"number",className:"string"};var Q1,ew;function $p(){return $p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},$p.apply(null,arguments)}var b7=function(t){return S.createElement("svg",$p({xmlns:"http://www.w3.org/2000/svg",width:17,height:7,fill:"none"},t),Q1||(Q1=S.createElement("path",{fill:"#0582CA",d:"M4.652.5.676 3.493l3.976 2.981V4.051h8.354V2.859H4.652z"})),ew||(ew=S.createElement("path",{fill:"#0582CA",d:"M12.36.5v2.384H4.008v1.193h8.352v2.396l.956-.716 3.022-2.265z"})))};const v7=(e,t,n,r,o)=>{const[i,a]=R.useState({isOpen:!1,column:null}),l=(f,p,h)=>{a({isOpen:f.currentTarget,column:p,isChild:!!h})},c=()=>{a({isOpen:!1,column:null,isChild:!1})},u=async()=>{c();const f=e.map(p=>{var h,y;if(i!=null&&i.isChild&&Array.isArray(p.children)){const m=p.children.map(x=>{var w;return x.id===i.column.id&&x.key===((w=i.column)==null?void 0:w.key)?{...x,isHidden:!0}:x}),b=m.every(x=>x.isHidden);return{...p,isHidden:b?!0:p.isHidden,children:m}}return p.id===((h=i==null?void 0:i.column)==null?void 0:h.id)&&p.key===((y=i.column)==null?void 0:y.key)?{...p,isHidden:!0}:p});d({updatedColumns:f})},d=async({updatedColumns:f})=>{t({type:qe.SET_GRID_DATA,payload:{visibleGridColumns:f}});const p=r.split("/").filter(Boolean),m={...JSON.parse(localStorage.getItem(Rr.SETTINGS))||{platform:{theme:"light"}}},b=p.reduce((C,O)=>C==null?void 0:C[O],Ca.GRID_SETTINGS)||null,x=(b==null?void 0:b.pageSize)??o;let w=m;for(let C=0;C<p.length;C++){const O=p[C];C===p.length-1?w[O]={columns:f,pageSize:x}:(w[O]={...w[O]||{}},w=w[O])}localStorage.setItem(Rr.SETTINGS,JSON.stringify(m)),await _c({baseUrl:n,payload:m})};return{selectedColumn:i,handleMenuClick:l,handleClose:c,handleHideClick:u,columnUpdaterFunction:d}},tw=({pagination:e,gridPath:t,baseUrl:n})=>{const{selectedPage:r,rowPerPage:o,totalRecords:i,onPageChange:a,onPageSizeChange:l}=e,c=It(),u=async(d,f)=>{if(!f)return;const p=f.split("/").filter(Boolean),h="settings",m={...JSON.parse(localStorage.getItem(h))||{}};let b=m;for(let x=0;x<p.length;x++){const w=p[x];x===p.length-1?b[w]={...b[w]||{},pageSize:d}:(b[w]={...b[w]||{}},b=b[w])}localStorage.setItem(h,JSON.stringify(m)),await _c({baseUrl:n,payload:m})};return g.jsxs(ye,{sx:{display:"flex",p:"1rem 2rem"},children:[g.jsxs(ye,{sx:{display:"flex",flexDirection:"row",alignItems:"center",gap:"0.5rem",width:"100%"},children:[g.jsx(nt,{sx:{fontSize:"1.1rem",color:c.palette.primary.notifyTextColor},children:`Showing ${(r-1)*o+1} to ${Math.min(r*o,i)} of ${i} rows`}),g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem 0.8rem!important"},width:"6rem"},children:g.jsx(Sc,{options:c7,value:o,onChange:async d=>{l(d),u(d==null?void 0:d.value,t)}})}),g.jsx(nt,{sx:{fontSize:"1.1rem",color:c.palette.primary.notifyTextColor},children:"records per page"})]}),g.jsx(Tg,{count:Math.ceil(i/o),page:r,onChange:async(d,f)=>{a(f)},siblingCount:0,shape:"rounded",sx:{width:"100%","& .MuiPagination-ul":{width:"100%",display:"flex",justifyContent:"flex-end","& li:first-of-type":{border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,color:c.palette.primary.notifyActiveText,marginRight:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"},"& li:last-child":{border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,color:c.palette.primary.notifyActiveText,marginLeft:"1.5rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex"}},"& .MuiPaginationItem-root":{color:"#595959",fontSize:"1.1rem",borderRadius:"1rem",width:"3rem",height:"3rem",justifyContent:"center",alignItems:"center",display:"flex","& .MuiSvgIcon-root":{fontSize:"2.2rem"}},"& .Mui-selected":{color:c.palette.primary.notifyActiveText,backgroundColor:`${c.palette.brandColor.paginationBc} !important`}}})]})};tw.propTypes={pagination:s.object.isRequired};function _p({isRenderCellContent:e,column:t,row:n,parent:r}){const o=n[t.key];return g.jsx(g.Fragment,{children:e?g.jsx(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},children:t==null?void 0:t.cellRenderer(n,{column:t,parent:r})}):g.jsx(Ag,{title:(o==null?void 0:o.length)>20?o:"",arrow:!0,children:g.jsx(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis",textTransform:"none",fontSize:"1.1rem"},id:t.key,component:"label",children:m8(o)})})})}_p.propTypes={isRenderCellContent:s.bool,column:s.object,row:s.object};const nw=({menuOpen:e,handleClose:t,onHideClick:n})=>{const r=It();return g.jsx(Si,{open:!!e,anchorEl:e,onClose:t,anchorOrigin:{vertical:"bottom",horizontal:"left"},children:g.jsx(ye,{sx:{backgroundColor:r.palette.primary.notifyBackground,border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,minHeight:"2.3rem",display:"flex",justifyContent:"center",alignItems:"center"},children:g.jsx(Hn,{onClick:n,disableRipple:!0,sx:{textTransform:"none",fontSize:"1.1rem",p:"0.4rem 1rem",minHeight:"unset",fontWeight:500,color:r.palette.primary.notifyTextColor,backgroundColor:"transparent","&:hover":{backgroundColor:"transparent"},"&:active":{backgroundColor:"transparent"},"&:focus":{backgroundColor:"transparent"}},children:"Hide Column"})})})};nw.propTypes={menuOpen:s.object,handleClose:s.func,onHideClick:s.func},G(kl)(({theme:e})=>({"& .MuiPaper-root":{borderRadius:8,border:`1px solid ${e.palette.primary.notifyBorderColor}`,boxShadow:e.shadows[4],padding:"1rem 1rem 0rem 1rem",backgroundColor:e.palette.primary.notifyBackground}}));const Oo=G(nt)(({theme:e})=>({color:e.palette.primary.notifyTextColor,fontSize:"1.1rem"})),x7=G(jg)(({theme:e})=>({width:28,height:16,padding:0,display:"flex","&:active":{"& .MuiSwitch-thumb":{width:15},"& .MuiSwitch-switchBase.Mui-checked":{transform:"translateX(9px)"}},"& .MuiSwitch-switchBase":{padding:2,"&.Mui-checked":{transform:"translateX(12px)",color:"#fff","& + .MuiSwitch-track":{opacity:1,backgroundColor:"#1890ff",...e.applyStyles("dark",{backgroundColor:"#177ddc"})}}},"& .MuiSwitch-thumb":{boxShadow:"0 2px 4px 0 rgb(0 35 11 / 20%)",width:12,height:12,borderRadius:6,transition:e.transitions.create(["width"],{duration:200})},"& .MuiSwitch-track":{borderRadius:16/2,opacity:1,backgroundColor:"rgba(0,0,0,.25)",boxSizing:"border-box",...e.applyStyles("dark",{backgroundColor:"rgba(255,255,255,.35)"})}})),w7=G(yi)(({theme:e})=>({color:e.palette.primary.notifyTextColor,padding:"0.6rem 0",fontSize:"0.9rem",fontWeight:500,"&::before, &::after":{borderColor:`${e.palette.primary.notifyBorderColor}!important`}})),C7=G(nd)(({theme:e})=>({"& .MuiBadge-badge":{right:3.5,top:1.8,border:`0.1rem solid ${e.palette.primary.notifyBackground}`,padding:"0 1.3px",borderRadius:"50%",backgroundColor:"#D44E40",fontSize:"0.725rem",minWidth:"0.7rem",height:"0.7rem"}}));G(Fl)(({theme:e})=>({"& .MuiInputBase-root":{height:"3.52rem"},"& .MuiFormLabel-root":{color:`${e.palette.primary.notifyBorderColor} !important`,fontSize:"1rem",marginTop:"0.4rem"},"& label.Mui-focused":{color:e.palette.primary.notifyTextColor},"& .MuiInput-underline:after":{borderBottomColor:e.palette.primary.notifyBorderColor,borderBottomWidth:"0.1rem"},"& .MuiOutlinedInput-root":{"& fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&:hover fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"},"&.Mui-focused fieldset":{borderColor:e.palette.primary.notifyBorderColor,borderWidth:"0.1rem"}}}));const S7=G(Jg)(({theme:e})=>({minHeight:"2rem","& .MuiTabs-indicator":{height:"0.1rem",backgroundColor:e.palette.primary.notifyActiveText}})),Fp=G(Ng)(({theme:e})=>({color:e.palette.primary.notifyActiveText,textTransform:"none",fontWeight:"normal",padding:0,fontSize:"1rem",minHeight:"2rem",paddingBottom:"1rem","&.Mui-selected":{fontWeight:"bold",color:e.palette.primary.notifyActiveText}})),Fc=G(Qu)(({theme:e})=>({"&.MuiChip-outlined":{borderColor:e.palette.primary.notifyBorderColor,color:e.palette.primary.notifyActiveText},height:"2rem",fontSize:"0.9rem",fontWeight:"300",borderColor:e.palette.primary.notifyBorderColor,color:e.palette.primary.notifyActiveText,borderRadius:"0.6rem",padding:"0.2rem","&:hover":{backgroundColor:`${e.palette.brandColor.orange} !important`,color:`${e.palette.brandColor.white} !important`}})),rw=({sortKey:e,sortField:t,sortDir:n,handleSortClick:r})=>{const o=i=>g.jsx(Ir,{onClick:r,sx:{padding:"0.5rem"},children:g.jsx(hn,{url:i})});return g.jsx(g.Fragment,{children:o(t===e?n==="asc"?Ke.AscSort:Ke.DescSort:Ke.Unsort)})};rw.propTypes={sortKey:s.string.isRequired,sortField:s.string,sortDir:s.string,handleSortClick:s.func};function ow({parent:e,column:t,sort:n,handleMenuClick:r,isManageable:o}){const i=t==null?void 0:t.isMandatory,a=t==null?void 0:t.label,l=t==null?void 0:t.isSortable,c=n==null?void 0:n.sortField,u=n==null?void 0:n.sortDir,d=n==null?void 0:n.onSort;return g.jsxs(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem",textAlign:"center",whiteSpace:"normal"},children:[a,g.jsxs(ye,{sx:{display:"flex",alignItems:"center"},children:[l&&g.jsx(rw,{sortKey:e?`${e==null?void 0:e.key}|${t==null?void 0:t.key}`:t==null?void 0:t.key,sortField:c,sortDir:u,handleSortClick:()=>d({column:t,sortDir:u,sortField:c,parent:e})}),o&&!i&&g.jsx(Ir,{onClick:f=>r(f,t,e),sx:{padding:"0.5rem 0.2rem"},children:g.jsx(hn,{url:Ke.Menu})})]})]})}ow.propTypes={column:s.object.isRequired,sort:s.object.isRequired,handleMenuClick:s.func,isManageable:s.bool};const T7=G($l)(({theme:e})=>({overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"table-cell",[`&.${vd.head}`]:{color:e.palette.primary.notifyTextColor,backgroundColor:e.palette.primary.notifyBackground,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 0.5rem",textAlign:"center"},[`&.${vd.body}`]:{color:e.palette.primary.notifyTextColor,borderColor:e.palette.primary.notifyBorderColor,padding:"0.3rem 0.5rem",textAlign:"center"}}));function Ta({children:e,...t}){return g.jsx(T7,{...t,children:e})}Ta.propTypes={children:s.node};const O7=G(Hg)(()=>({"&:last-child td":{borderBottom:0}}));function As({children:e,...t}){return g.jsx(O7,{...t,children:e})}As.propTypes={children:s.node};function sw({rows:e,sort:t,data:n,pagination:r,columns:o,nested:i,baseUrl:a,gridPath:l}){var ue;const c=It(),{visibleGridColumns:u}=R.useContext(ga),d=R.useContext(ya),{selectedColumn:f,handleMenuClick:p,handleClose:h,handleHideClick:y,columnUpdaterFunction:m}=v7(u,d,a,l,r==null?void 0:r.rowPerPage),b=o==null?void 0:o.isManageable,x=o==null?void 0:o.isResizable,w=(n==null?void 0:n.length)>0,C=R.useRef(null),[O,v]=R.useState(null),[k,E]=R.useState(null),[M,D]=R.useState(null);let A=null;const $=R.useRef(0),I=R.useRef(!1),W=R.useRef(null),j=g7(((ue=i==null?void 0:i.column)==null?void 0:ue.definitions)||[]),F=i==null?void 0:i.isNested,P=(i==null?void 0:i.data)||[],N=i==null?void 0:i.hashKey;if(R.useEffect(()=>{const _=C.current,q=_==null?void 0:_.querySelector("thead");if(!q)return;const X=()=>{D(null)};return q==null||q.addEventListener("mousedown",X),()=>{q==null||q.removeEventListener("mousedown",X)}},[]),!w)return g.jsx(Oo,{sx:{textAlign:"center"},children:Gr.NRF});const L=(_,q)=>{var oe,ce;if(I.current){_.preventDefault();return}v(q),D(null),_.dataTransfer.setData("colIndex",q);const X=u[q],Y=X==null?void 0:X.label,B=document.createElement("div");B.textContent=Y,Object.assign(B.style,{display:"flex",alignItems:"center",justifyContent:"center",padding:"1.5rem 2.5rem",minWidth:(oe=X==null?void 0:X.style)==null?void 0:oe.minWidth,maxWidth:(ce=X==null?void 0:X.style)==null?void 0:ce.maxWidth,fontSize:"1.2rem",fontWeight:"500",color:c.palette.primary.notifyTextColor,background:c.palette.primary.notifyBackground,border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,borderRadius:"0rem",pointerEvents:"none",position:"absolute",top:"0",left:"0",zIndex:"-1",textAlign:"center",boxSizing:"border-box",boxShadow:"0 1px 4px rgba(0, 0, 0, 0.2)"}),document.body.appendChild(B);const{offsetWidth:K,offsetHeight:ee}=B;_.dataTransfer.setDragImage(B,K/2,ee/2),requestAnimationFrame(()=>{document.body.removeChild(B)})},H=(_,q)=>{_.preventDefault(),E(q),Q(_)},V=async(_,q)=>{if(_.preventDefault(),clearInterval(A),O===null||O===q)return;const X=[...u],[Y]=X.splice(O,1);X.splice(q,0,Y);const B=u.slice().sort((ee,oe)=>ee.sequenceId-oe.sequenceId).map(ee=>ee.sequenceId),K=X.map((ee,oe)=>({...ee,sequenceId:B[oe]??ee.sequenceId}));m({updatedColumns:K}),v(null),E(null)},z=()=>{v(null),E(null)},Z=(_,q,X,Y)=>{var me,ge,$e,Ae,Me,ze,Xe;if(!_)return null;const B=(_==null?void 0:_.isMandatory)&&(_==null?void 0:_.isSticky),K=parseFloat((ge=(me=_==null?void 0:_.style)==null?void 0:me.minWidth)==null?void 0:ge.toString().replace("rem",""))||7.5;q===0&&($.current=0);const ee=B?q===0?0:`${$.current}rem`:void 0;B&&($.current+=K);const oe=O===q,ce=k==q||(($e=u==null?void 0:u[k])==null?void 0:$e.isMandatory),Ce=Fe=>{_.isMandatory?(Fe.preventDefault(),Fe.dataTransfer.dropEffect="none"):(Fe.preventDefault(),Fe.dataTransfer.dropEffect="move"),H==null||H(Fe,q)},ae=Fe=>{_.isMandatory||V==null||V(Fe,q)},we=Y?`${Y==null?void 0:Y.key}_${_==null?void 0:_.key}_${q}`:q;return g.jsx(Ta,{rowSpan:_!=null&&_.children?1:2,colSpan:x?((Me=(Ae=_==null?void 0:_.children)==null?void 0:Ae.filter(Fe=>!(Fe!=null&&Fe.isHidden)))==null?void 0:Me.length)*2-1:(Xe=(ze=_==null?void 0:_.children)==null?void 0:ze.filter(Fe=>!(Fe!=null&&Fe.isHidden)))==null?void 0:Xe.length,style:_==null?void 0:_.style,onMouseEnter:()=>{M!==we&&D(we)},draggable:X&&!Y&&!(_!=null&&_.isMandatory),onDragStart:X?Fe=>L(Fe,q):void 0,onDragOver:X?Ce:void 0,onDrop:X?ae:void 0,onDragEnd:X?z:void 0,sx:{...oe&&{border:`0.1rem solid ${c.palette.brandColor.lightBlue}!important`},...B&&{borderRadius:"0rem!important",position:"sticky",left:ee,zIndex:3},..._!=null&&_.children?{}:{borderLeft:Fe=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${Fe.palette.primary.notifyBorderColor}`,borderRight:Fe=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${Fe.palette.primary.notifyBorderColor}`},cursor:ce?"not-allowed":X&&!(_!=null&&_.isMandatory)?"grab":"default"},children:g.jsx(ow,{parent:Y,column:_,sort:t,handleMenuClick:p,isManageable:X})},q)},ne=(_,q,X,Y)=>{var oe,ce,Ce;if(!_)return null;const B=(_==null?void 0:_.isMandatory)&&(_==null?void 0:_.isSticky),K=parseFloat((ce=(oe=_==null?void 0:_.style)==null?void 0:oe.minWidth)==null?void 0:ce.toString().replace("rem",""))||7.5;X===0&&($.current=0);const ee=B?X===0?0:`${$.current}rem`:void 0;return B&&($.current+=K),g.jsxs(Ta,{colSpan:1,style:_==null?void 0:_.style,className:`${_==null?void 0:_.label}`,sx:{position:"relative",...B&&{position:"sticky",left:ee,zIndex:2,backgroundColor:ae=>{var we;return e!=null&&e.selectedRow&&((we=e==null?void 0:e.selectedRow)==null?void 0:we.fhi)===(q==null?void 0:q.fhi)||q!=null&&q.isHigh?ae.palette.primary.appBackground:ae.palette.primary.notifyBackground}},...Y?{p:"0rem!important"}:{px:"0rem!important",borderLeft:ae=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${ae.palette.primary.notifyBorderColor}`,borderRight:ae=>(_==null?void 0:_.key)==="volume_value"&&`0.1rem solid ${ae.palette.primary.notifyBorderColor}`}},children:[((e==null?void 0:e.selectedRow)&&((Ce=e==null?void 0:e.selectedRow)==null?void 0:Ce.fhi)===(q==null?void 0:q.fhi)||(q==null?void 0:q.isHigh))&&g.jsx(ye,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}}),g.jsx(_p,{isRenderCellContent:!!(_!=null&&_.cellRenderer),column:_,row:q,parent:Y})]},X)},J=(_,q,X,Y)=>{var K;const B=Y?`${Y==null?void 0:Y.key}_${_==null?void 0:_.key}_${q}`:q;return(K=[...u].map((ee,oe)=>({col:ee,index:oe})).reverse().find(({col:ee})=>Array.isArray(ee.children)&&ee.children.length>0))==null||K.index,g.jsx(g.Fragment,{children:_&&!(_!=null&&_.isMandatory)&&X?g.jsx(ye,{resizeStart:()=>{I.current=!0},resizeEnd:()=>{I.current=!1},component:_!=null&&_.children?$l:Np,rowSpan:_!=null&&_.children?1:2,colSpan:1,id:q,sx:{width:"2rem",maxWidth:"2rem",minWidth:"2rem",padding:0,position:"relative",background:c.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,"&::after":{content:'""',position:"absolute",left:"50%",top:0,transform:"translateX(-50%)",width:"0.15rem",height:"calc(100% + 0.1rem)",backgroundColor:M===B&&!(_!=null&&_.children)?c.palette.brandColor.lightBlue:Y||_!=null&&_.children?c.palette.primary.notifyBorderColor:"transparent",transition:"background-color 0.2s ease",zIndex:1}},disabled:!X}):null})},se=(_,q,X,Y,B,K)=>{var oe;const ee=K?`${K==null?void 0:K.key}_${q==null?void 0:q.key}_${X}`:X;return g.jsx(g.Fragment,{children:q&&!(q!=null&&q.isMandatory)&&Y?g.jsxs($l,{className:"column_resizer_body",sx:{padding:0,position:"relative",borderBottom:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,"&::after":{content:'""',position:"absolute",left:"50%",top:0,transform:"translateX(-50%)",width:"0.15rem",height:"calc(100% + 0.1rem)",backgroundColor:M===ee?c.palette.brandColor.lightBlue:K||q!=null&&q.children?c.palette.primary.notifyBorderColor:"transparent",transition:"background-color 0.2s ease",zIndex:1}},children:[B===0&&M===ee&&g.jsx(ye,{sx:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:1,pointerEvents:"none"},children:g.jsx(b7,{})}),((e==null?void 0:e.selectedRow)&&((oe=e==null?void 0:e.selectedRow)==null?void 0:oe.fhi)===(_==null?void 0:_.fhi)||(_==null?void 0:_.isHigh))&&g.jsx(ye,{sx:{position:"absolute",bottom:0,left:0,width:"100%",height:"0.08rem",background:"linear-gradient(#F9B16E, #F68080)",pointerEvents:"none"}})]},`resize-${X}`):null})},Q=_=>{const q=C.current,{left:X,right:Y}=q.getBoundingClientRect(),B=50,K=_.clientX>Y-B?1:_.clientX<X+B?-1:0;K!==0?(W.current&&clearInterval(W.current),W.current=setInterval(()=>{q.scrollLeft+=K*10},50)):W.current&&(clearInterval(W.current),W.current=null)};return g.jsxs(g.Fragment,{children:[g.jsx(Lg,{sx:{maxHeight:"100%",whiteSpace:"nowrap",overflow:"auto",width:"100%",border:`0.1rem solid ${c.palette.primary.notifyBorderColor}`,borderRadius:"1.4rem"},children:g.jsxs(_g,{ref:C,stickyHeader:!0,"aria-label":"sticky table",sx:{backgroundColor:_=>_.palette.primary.notifyBackground},children:[g.jsxs(Wg,{children:[g.jsx(As,{children:u.map((_,q)=>_!=null&&_.isHidden?null:g.jsxs(R.Fragment,{children:[Z(_,q,b),x&&J(_,q,b)]},q))}),g.jsx(As,{children:u.flatMap((_,q)=>_!=null&&_.isHidden||!(_!=null&&_.children)?[]:_.children.map((X,Y)=>X!=null&&X.isHidden?null:g.jsxs(R.Fragment,{children:[Z(X,Y,b,_),x&&J(X,Y,b,_)]},`${q}-${Y}`)))})]}),g.jsx(Bg,{children:n.map((_,q)=>{const X=_[N],Y=P==null?void 0:P[X],B=(Y==null?void 0:Y.length)>0;return g.jsxs(R.Fragment,{children:[g.jsx(As,{sx:{backgroundColor:K=>{var ee;return e&&((ee=e==null?void 0:e.selectedRow)==null?void 0:ee.fhi)===(_==null?void 0:_.fhi)||_!=null&&_.isHigh?K.palette.primary.appBackground:K.palette.primary.notifyBackground}},onClick:()=>e==null?void 0:e.onRowClick(_),children:u.map((K,ee)=>K!=null&&K.isHidden?null:K!=null&&K.children?K.children.map((oe,ce)=>oe!=null&&oe.isHidden?null:g.jsxs(R.Fragment,{children:[ne(oe,_,ce,K),x&&se(_,oe,ce,b,q,K)]},`${ee}-${ce}`)):g.jsxs(R.Fragment,{children:[ne(K,_,ee),x&&se(_,K,ee,b,q)]},ee))}),F&&Y&&g.jsx(g.Fragment,{children:B?Y.map((K,ee)=>g.jsx(As,{children:j.map((oe,ce)=>g.jsx(Ta,{style:oe==null?void 0:oe.style,children:g.jsx(_p,{isRenderCellContent:!!(oe!=null&&oe.cellRenderer),column:oe,row:K})},ce))},`nested-${ee}`)):g.jsx(As,{children:g.jsx(Ta,{colSpan:j.length,children:g.jsx(Oo,{sx:{textAlign:"center"},children:Gr.NRF})})})})]},q)})})]})}),r&&g.jsx(tw,{pagination:r,gridPath:l,baseUrl:a}),g.jsx(nw,{menuOpen:f==null?void 0:f.isOpen,handleClose:h,onHideClick:y})]})}sw.propTypes={sort:s.object,data:s.array,pagination:s.object,columns:s.object,nested:s.object};function iw({tableProps:e,isDefaultConfig:t,gridPath:n,baseUrl:r}){var u;const{columns:o}=e,{visibleGridColumns:i=[]}=R.useContext(ga)??{},a=R.useContext(ya),l=R.useMemo(()=>{var d;return m7({columns:o,gridPath:n,baseUrl:r,isDefaultConfig:t,pageSize:(d=e==null?void 0:e.pagination)==null?void 0:d.rowPerPage})},[o,n,r,t,(u=e==null?void 0:e.pagination)==null?void 0:u.rowPerPage]),c=R.useMemo(()=>{const d=new Map(i.map(f=>[f.key,f]));return l.map(f=>{const p=d.get(f.key);return{...f,...p&&{isHidden:p.isHidden,sequenceId:p.sequenceId}}}).sort((f,p)=>f.sequenceId-p.sequenceId)},[l,i]);return R.useEffect(()=>{a({type:qe.SET_GRID_DATA,payload:{visibleGridColumns:i.length?c:l}})},[l]),g.jsx(sw,{...e,gridPath:n,baseUrl:r})}iw.propTypes={tableProps:s.object.isRequired,mergedColumns:s.array.isRequired};const aw=({type:e})=>{const t=It(),r=(t==null?void 0:t.mode)==="dark"?{bgcolor:"grey.800"}:{};return{grid:g.jsxs(ye,{sx:{borderRadius:2,overflow:"hidden"},children:[g.jsx(Tr,{variant:"text",width:"100%",height:60,sx:r}),Array.from({length:10}).map((i,a)=>g.jsx(ye,{sx:{display:"flex",alignItems:"center",padding:"0.5rem",gap:"3rem"},children:Array.from({length:5}).map((l,c)=>g.jsx(ye,{sx:{flex:1},children:g.jsx(Tr,{variant:"text",height:45,sx:r})},c))},a))]}),toolbar:g.jsx(g.Fragment,{children:g.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{display:"flex",gap:"1rem"},children:[g.jsxs(ft,{direction:"row",gap:"1rem",children:[g.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"15.2rem",height:"5rem",sx:r})]}),g.jsxs(ft,{direction:"row",gap:"1rem",children:[g.jsx(Tr,{variant:"text",width:"10.2rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r}),g.jsx(Tr,{variant:"text",width:"3.5rem",height:"5rem",sx:r})]})]})})}[e]},k7=e=>{if(!e)return null;const{options:t,...n}=e,r=t?"select":"button",o={button:i=>{var a;return g.jsx(mo,{...i,styles:{...i.styles,iconPrimary:((a=i==null?void 0:i.styles)==null?void 0:a.variant)=="filled"}})},select:i=>{var a;return g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"},width:(a=i.styles)==null?void 0:a.width},children:g.jsx(l1,{...i,options:t})})}};return o[r]?o[r](n):null},E7=({presentSetting:e,gridSetting:t,gridPath:n})=>{var a;if(!n)return e;const r=n.split("/").filter(Boolean),o=(a=t==null?void 0:t.grid)==null?void 0:a.map(({id:l,isHidden:c,isSortable:u,key:d,sequenceId:f})=>({id:l,isHidden:c,isSortable:u,key:d,sequenceId:f}));let i=e;for(let l=0;l<r.length;l++){const c=r[l];l===r.length-1?i[c]={columns:o,pageSize:(t==null?void 0:t.pageSize)??null}:(i[c]=i[c]||{},i=i[c])}return{settingObject:e,defaultUserSettings:o}},P7=async({baseUrl:e,gridSetting:t,gridPath:n})=>{try{const r=JSON.parse(localStorage.getItem("settings")),{settingObject:o,defaultUserSettings:i}=E7({presentSetting:r,gridSetting:t,gridPath:n});return localStorage.setItem("settings",JSON.stringify(o)),await _c({baseUrl:e,payload:o}),i}catch(r){console.error(r)}},M7=({customTools:e})=>{var r,o;const t=(r=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===X1.PRIMARY))==null?void 0:r.sort((i,a)=>i.sequenceId-a.sequenceId),n=(o=e==null?void 0:e.filter(i=>(i==null?void 0:i.type)===X1.SECONDARY))==null?void 0:o.sort((i,a)=>i.sequenceId-a.sequenceId);return{primaryButtons:t,secondaryButtons:n}},lw=({customTools:e,isExpanded:t,setIsExpanded:n})=>{const{primaryButtons:r,secondaryButtons:o}=M7({customTools:e}),[i,a]=R.useState(r),l=(o==null?void 0:o.length)>0,c=d=>{d?a([...r,...o]):setTimeout(()=>{a(r)},100)},u=()=>{const d=!t;n(d),c(d)};return R.useEffect(()=>{c(t)},[e]),g.jsxs(g.Fragment,{children:[t&&g.jsx("div",{style:{position:"fixed",left:0,width:"100vw",height:"4rem",zIndex:998}}),g.jsxs(ye,{sx:{display:"flex",alignItems:"center",gap:"0.8rem",flexWrap:"nowrap",maxWidth:"100%",whiteSpace:"nowrap",zIndex:999},children:[g.jsx(Q5,{mode:"popLayout",children:i.map((d,f)=>g.jsx(Gi.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.15},layout:!0,children:g.jsx(ye,{sx:{flexShrink:0,minWidth:"fit-content"},children:k7(d)})},`${d.id}_${f}`))}),l&&g.jsx(ye,{sx:{paddingLeft:t?"0.5rem":0},children:g.jsx(mo,{label:t?"":"More Actions",styles:{iconPrimary:!0,icon:t?Ke.CrossWhite:Ke.More,colorType:t?"danger":""},onClick:u})})]})]})};lw.propTypes={customTools:s.array.isRequired};const cw=({defaultTools:e,isManageable:t,customTools:n,baseUrl:r,gridPath:o,managableColumns:i=[],pageSize:a})=>{var b,x,w,C,O,v;const l=R.useContext(ya),{visibleGridColumns:c,triggerApi:u}=R.useContext(ga),[d,f]=R.useState([]),[p,h]=R.useState(!1);R.useEffect(()=>{if(i.length){const k=i.length?c.filter(E=>i.includes(E.id)):c;f(k)}},[i,c]);const y=async k=>{try{await P7({baseUrl:r,gridPath:o,gridSetting:{grid:k,pageSize:a}})}catch(E){console.error(E)}finally{l({type:qe.HAS_SETTING_CHANGE,payload:{hasChange:!1}}),l({type:qe.TRIGGER_API,payload:{triggerApi:!1}})}};R.useEffect(()=>{u&&y(c)},[u]);const m=k=>{const E=k.map(D=>D.id),M=c.map(D=>{if(!d.some(I=>I.id===D.id))return D;const $=E.includes(D.id);if(Array.isArray(D.children)&&D.children.length>0){const I=D.children.map(j=>d.some(P=>P.id===j.id)?{...j,isHidden:$?!1:!E.includes(j.id)}:j),W=I.filter(j=>d.some(F=>F.id===j.id)).every(j=>j.isHidden);return{...D,isHidden:$?!1:W,children:I}}return{...D,isHidden:!E.includes(D.id)}});l({type:qe.SET_GRID_DATA,payload:{visibleGridColumns:M}}),l({type:qe.HAS_SETTING_CHANGE,payload:{hasChange:!0}})};return g.jsxs(ye,{sx:{margin:"1rem 0",position:"relative",zIndex:10,display:"flex",flexDirection:"row",justifyContent:"space-between",gap:"0.6rem",width:"100%"},children:[g.jsxs(ye,{sx:{display:"flex",flexDirection:"row",gap:"0.6rem"},children:[((b=e==null?void 0:e.search)==null?void 0:b.isRequired)&&g.jsx(s1,{...e==null?void 0:e.search,iconUrl:Ke.Search}),((x=e==null?void 0:e.groupBy)==null?void 0:x.isRequired)&&g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:g.jsx(Sc,{styles:{icon:Ke.Group},...e.groupBy})}),((w=e==null?void 0:e.refresh)==null?void 0:w.isRequired)&&g.jsx(mo,{...e==null?void 0:e.refresh,styles:{variant:"filled",icon:Ke.Refresh,colorType:"empty",width:"3.2rem",height:"3.2rem"}}),t&&g.jsx(ye,{sx:{"& .MuiInputBase-input":{padding:"0rem!important"}},children:g.jsx(Sc,{placeholder:"Manage Columns",options:d,value:d.filter(k=>!k.isHidden),isMulti:!0,isDraggable:!0,showSearch:!0,onChange:m,styles:{icon:Ke.Manage}})})]}),g.jsxs(ye,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",gap:"0.6rem"},children:[n&&g.jsx(lw,{customTools:n,setIsExpanded:h,isExpanded:p}),((C=e==null?void 0:e.save)==null?void 0:C.isRequired)&&g.jsx(ye,{sx:{px:"0.5rem"},children:g.jsx(mo,{label:p?"":"Save",styles:{icon:Ke.Save,colorType:"empty"},...e==null?void 0:e.save})}),((O=e==null?void 0:e.upload)==null?void 0:O.isRequired)&&g.jsx(mo,{...e==null?void 0:e.upload,styles:{variant:p?"outlined":"filled",icon:p?Ke.UploadDark:Ke.Upload,iconPrimary:!p,colorType:"secondary",isAnimate:!0}}),((v=e==null?void 0:e.download)==null?void 0:v.isRequired)&&g.jsx(mo,{...e==null?void 0:e.download,styles:{variant:"outlined",icon:Ke.Download,isAnimate:!0}})]})]})};cw.propTypes={defaultTools:s.object.isRequired,customTools:s.array,isManageable:s.bool,baseUrl:s.string,gridPath:s.gridPath};function Bp({tableProps:e,toolbarProps:t,isDefaultConfig:n,isLoading:r}){var i,a;const o=(i=e.columns)==null?void 0:i.isManageable;return g.jsx(a1,{children:r?g.jsxs(g.Fragment,{children:[g.jsx(aw,{type:"toolbar"}),g.jsx(aw,{type:"grid"})]}):g.jsxs(ye,{sx:{position:"sticky"},children:[t&&g.jsx(cw,{...t,isManageable:o,pageSize:(a=e==null?void 0:e.pagination)==null?void 0:a.rowPerPage}),g.jsx(iw,{tableProps:e,isDefaultConfig:n,gridPath:(t==null?void 0:t.gridPath)||"",baseUrl:(t==null?void 0:t.baseUrl)||""})]})})}Bp.propTypes={tableProps:s.object.isRequired,toolbarProps:s.object,isDefaultConfig:s.bool};const uw=({list:e,handleLinkClick:t})=>{const n=It(),r=({list:o})=>{var i;return(i=o==null?void 0:o.sort((a,l)=>a.order-l.order))==null?void 0:i.map((a,l)=>a!=null&&a.link?g.jsx(Fr,{component:"h3",sx:{fontSize:"1rem",cursor:"pointer",color:l===(o==null?void 0:o.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},href:a==null?void 0:a.link,underline:"hover",onClick:()=>t(a),children:a==null?void 0:a.title},l):g.jsx(nt,{component:"h3",sx:{fontSize:"1rem",color:l===(o==null?void 0:o.length)-1?n.palette.brandColor.orange:n.palette.primary.notifyTextColor},children:a==null?void 0:a.title},l))};return g.jsx(L0,{separator:g.jsx(hn,{url:Ke.ArrowRight}),children:r({list:e})})};uw.propTypes={list:s.array.isRequired,handleLinkClick:s.func};const dw=({breadcrumbProps:e,switchProps:t,filterComponentProps:n})=>{var o,i,a,l,c,u;const r=It();return g.jsxs(g.Fragment,{children:[g.jsxs(ft,{sx:{background:r.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,height:"3rem",p:"0px 5.5rem 0 1.5rem",zIndex:4,position:"relative"},direction:"row",justifyContent:"space-between",alignItems:"center",children:[g.jsx(uw,{...e}),g.jsxs(ft,{direction:"row",gap:"1rem",alignItems:"center",children:[t&&g.jsx(f1,{...t}),(n==null?void 0:n.filterBtnProps)&&g.jsxs(ft,{direction:"row",children:[g.jsx(yi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"2rem!important",opacity:"1!important",borderColor:r.palette.primary.notifyBorderColor}}),g.jsxs(ft,{direction:"row",alignItems:"center",gap:"0.5rem",onClick:(o=n==null?void 0:n.filterBtnProps)==null?void 0:o.onFilterClick,sx:{cursor:"pointer"},children:[g.jsx(hn,{url:Ke.Filter}),g.jsx(nt,{sx:{fontSize:"1.1rem",color:r.palette.primary.notifyActiveText},children:(i=n==null?void 0:n.filterBtnProps)==null?void 0:i.label})]})]})]})]}),g.jsx(Gi.div,{layout:!0,initial:{height:"0rem"},animate:{height:(a=n==null?void 0:n.filterBtnProps)!=null&&a.filterContainerVisible?"5rem":"0rem",opacity:(l=n==null?void 0:n.filterBtnProps)!=null&&l.filterContainerVisible?1:0},transition:{duration:.5,ease:"easeInOut"},style:{background:r.palette.primary.notifyBackground,borderBottom:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,padding:"0px 5.5rem 0 1.5rem",position:"relative",alignItems:"center",display:"flex",overflow:"hidden"},children:g.jsxs(ft,{sx:{background:r.palette.primary.appBackground,height:"3.8rem",p:"0 2rem",width:"100%",borderRadius:"0.7rem",overflow:"visible"},direction:"row",alignItems:"center",children:[g.jsx(nt,{sx:{fontSize:"1.2rem",fontWeight:"500",color:r.palette.primary.notifyActiveText},children:"Filters:"}),g.jsx(ye,{sx:{overflowX:"auto",overflowY:"visible",whiteSpace:"nowrap",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},margin:"0 1rem",padding:"0.5rem 0",flexGrow:1},children:g.jsx(ft,{direction:"row",gap:"1.2rem",sx:{overflow:"visible"},children:(c=n==null?void 0:n.filterItems)==null?void 0:c.map((d,f)=>g.jsx(g.Fragment,{children:g.jsxs(ye,{sx:{position:"relative",overflow:"visible",border:`0.1rem solid ${r.palette.primary.notifyBorderColor}`,background:r.palette.primary.notifyBackground,borderRadius:"0.6rem",padding:"0.3rem 1.1rem",display:"inline-block"},children:[g.jsx(ye,{component:"img",src:Ke.FilterClose,sx:{position:"absolute",top:"-0.4rem",right:"-0.6rem",cursor:"pointer"},onClick:()=>n==null?void 0:n.onFilterChipClose(d)}),g.jsx(nt,{sx:{fontSize:"1rem",color:r.palette.primary.notifyTextColor},children:d==null?void 0:d.filterLabel})]},f)}))})}),g.jsx(ye,{component:nt,sx:{fontSize:"1.1rem",fontWeight:"500",textDecoration:"underline",color:r.palette.brandColor.red,cursor:"pointer"},onClick:(u=n==null?void 0:n.filterContainerProps)==null?void 0:u.onClearClick,children:"Clear"})]})})]})};dw.propTypes={breadcrumbProps:s.object.isRequired,switchProps:s.object};function fw({headerProps:e}){return g.jsx(Fn,{children:g.jsx(dw,{...e})})}fw.propTypes={headerProps:s.object.isRequired};const Lp=R.createContext(null),pw=R.createContext(null);function R7({children:e}){const[t,n]=R.useReducer(D7,I7);return g.jsx(Lp.Provider,{value:t,children:g.jsx(pw.Provider,{value:n,children:e})})}function D7(e,t){var n;switch(t.type){case qe.LOADING:return{...e,loading:t.loading};case qe.SUCCESS:return{...e,data:(n=t.data)==null?void 0:n.sort((r,o)=>new Date(o.createdAt)-new Date(r.createdAt))};case qe.MARK_ALL_AS_READ:return{...e,isMarkAllAsRead:t.isMarkAllAsRead};case qe.ERROR:return{...e,error:t.error};default:throw new Error(`${Gr.UNHANDLED}: ${t}`)}}const I7={loading:!1,data:[],error:"",isMarkAllAsRead:{count:0,boo:!1}},{TENANT_ID:Vp,BU_ID:Wp,SNOP_ID:hw}=Dp,{TENANT_IDS:zp,BU_IDS:Up}=Ca,A7=async e=>{try{const t=`${e}${$c.NOTIFICATION}/v1?${Vp}=${zp}&${Wp}=${Up}`;return await St.get(t,Sa)}catch(t){return t}},mw=async(e,t,n)=>{try{const r=n===K1.MARK_ALL_READ?"":`&${hw}=${n}&`,o=`${e}${$c.NOTIFICATION}${Mp.VERSION}?${Vp}=${zp}&${Wp}=${Up}${r}`;return await St.put(o,t,Sa)}catch(r){return r}},j7=async({baseUrl:e,id:t,snopId:n})=>{try{const r=`${e}${$c.NOTIFICATION}${Mp.VERSION}?${Vp}=${zp}&${Wp}=${Up}&${hw}=${n}&id=${t}`;return await St.get(r,Sa)}catch(r){return r}},Bc={OK:200,CREATED:201,NO_CONTENT:204,BAD_REQUEST:400,UNAUTHORIZED:401,NOT_FOUND:404,INTERNAL_SERVER_ERROR:500},gw=({baseUrl:e})=>{const t=R.useContext(pw),[n,r]=R.useState(!1),[o,i]=R.useState(!1),[a,l]=R.useState(!1),[c,u]=R.useState({}),[d,f]=R.useState(null),[p,h]=R.useState(1),[y,m]=R.useState(!1),[b,x]=R.useState(0),{loading:w,data:C,isMarkAllAsRead:O}=R.useContext(Lp),[v,k]=R.useState([]);R.useEffect(()=>{k(C)},[C]);const E=R.useCallback(async()=>{var j,F;try{t({type:qe.LOADING,loading:!0}),t({type:qe.SUCCESS,data:[]});const P=await A7(e);if(P.status===Bc.OK){const N=((F=(j=P.data)==null?void 0:j.responseData)==null?void 0:F.response)||[],L=Cc(N);t({type:qe.SUCCESS,data:Cc(L)}),t({type:qe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:i1(N),boo:i1(N)>0}})}}catch{t({type:qe.ERROR,error:Gr.SWR})}finally{t({type:qe.LOADING,loading:!1})}},[e,t]);R.useEffect(()=>{E();const j=setInterval(E,3e5);return()=>clearInterval(j)},[E]);const M=async(j,F)=>{var P,N,L;if(j){f(j);try{const H=await j7({baseUrl:e,id:j,snopId:F});if(H.status===Bc.OK){const V=((L=(N=(P=H.data)==null?void 0:P.responseData)==null?void 0:N.response)==null?void 0:L[0])||{};u(V||{}),l(!0)}else throw new Error}catch{t({type:qe.ERROR,error:Gr.SWR})}finally{f(null)}}},D=async(j,F)=>{if(j.length){t({type:qe.LOADING,loading:!0});try{if((await mw(e,j,F)).status===Bc.OK){const N=C.map(H=>j.includes(H.id)?{...H,isRead:!0}:H),L=N.filter(H=>!H.isRead).length;t({type:qe.SUCCESS,data:Cc(N)}),t({type:qe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:L,boo:L>0}}),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},200)}}catch{t({type:qe.ERROR,error:Gr.SWR}),t({type:qe.LOADING,loading:!1})}}},A=async()=>{t({type:qe.LOADING,loading:!0});try{const j=d8(C);if((await mw(e,j,K1.MARK_ALL_READ)).status===Bc.OK){const P=C.map(N=>({...N,isRead:!0}));t({type:qe.SUCCESS,data:Cc(P)}),t({type:qe.MARK_ALL_AS_READ,isMarkAllAsRead:{count:0,boo:!1}}),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},200)}}catch{t({type:qe.ERROR,error:Gr.SWR}),t({type:qe.LOADING,loading:!1})}},$=(j,F)=>{t({type:qe.LOADING,loading:!0}),x(F),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},400)},I=j=>{const F=j||C||[];return{0:F,1:F.filter(P=>(P==null?void 0:P.type)==="INFO"),2:F.filter(P=>(P==null?void 0:P.type)==="ERROR")}},W=()=>{t({type:qe.LOADING,loading:!0});const j=!y,F=j?(v||[]).filter(P=>!P.isRead):C||[];m(j),k(F),h(1),setTimeout(()=>{t({type:qe.LOADING,loading:!1})},400)};return{fetchNotification:E,showDetailsProps:{open:a,handleClose:()=>l(!1),setOpen:l,data:c,clickId:d},alertDialogProps:{open:n,handleClose:()=>r(!1),onRefresh:E,handleRead:D,handleMarkAllAsRead:A,setOpen:r,handleShowDetails:M,clickId:d,isMainDialog:!0},activeTab:b,loading:w,tabData:I(v)[b],data:v,mode:y,handleTabChange:$,toggleAlertMode:W,page:p,setPage:h,isMarkAllAsRead:O}};var yw,bw,vw;function Hp(){return Hp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Hp.apply(null,arguments)}var N7=function(t){return S.createElement("svg",Hp({xmlns:"http://www.w3.org/2000/svg",width:16,height:17,fill:"none"},t),yw||(yw=S.createElement("path",{stroke:"#909090",strokeLinecap:"round",strokeMiterlimit:10,d:"M8.013 2.19c-2.206 0-4 1.793-4 4v1.927c0 .406-.173 1.026-.38 1.373l-.766 1.273c-.474.787-.147 1.66.72 1.954 2.873.96 5.973.96 8.846 0a1.335 1.335 0 0 0 .72-1.954l-.766-1.273c-.2-.347-.374-.967-.374-1.373V6.19c0-2.2-1.8-4-4-4Z"})),bw||(bw=S.createElement("path",{stroke:"#909090",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:10,d:"M9.247 2.383a4.503 4.503 0 0 0-2.467 0 1.324 1.324 0 0 1 2.467 0"})),vw||(vw=S.createElement("path",{stroke:"#909090",strokeMiterlimit:10,d:"M10.013 12.957c0 1.1-.9 2-2 2a2.007 2.007 0 0 1-2-2"})))};const $7=({count:e})=>(It(),g.jsxs(g.Fragment,{children:[g.jsx(ye,{sx:{gap:"0.5rem",display:"flex",justifyContent:"center",alignItems:"center","& svg":{transform:"scale(1)"}},children:g.jsx(N7,{style:{scale:2}})}),g.jsx(C7,{badgeContent:e!=0?"":null,color:"error"})]}));function xw({children:e,handleClose:t,open:n,isMainDialog:r}){return g.jsx(kl,{open:n,onClose:t,...r?{scroll:"paper",PaperProps:{sx:{position:"fixed",top:30,right:30,m:0,width:400,height:450,display:"flex",flexDirection:"column",borderRadius:2,boxShadow:6,backgroundColor:o=>o.palette.primary.notifyBackground}}}:{fullWidth:!0,maxWidth:"md",sx:{"& .MuiPaper-root":{minHeight:250,maxHeight:500,borderRadius:"1.5rem",boxShadow:6,backgroundColor:o=>o.palette.primary.appBackground}}},children:e})}var ww;function qp(){return qp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},qp.apply(null,arguments)}var _7=function(t){return S.createElement("svg",qp({xmlns:"http://www.w3.org/2000/svg",width:14,height:9,fill:"none",viewBox:"0 0 13 9"},t),ww||(ww=S.createElement("path",{fill:"#A8A8A8",fillRule:"evenodd",d:"M8.954 1.004a.406.406 0 0 1 0 .575L3.537 6.996a.406.406 0 0 1-.574 0L.796 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0m3.25 0a.406.406 0 0 1 0 .575L6.787 6.996a.406.406 0 1 1-.574-.575l5.416-5.417a.406.406 0 0 1 .575 0",clipRule:"evenodd"})))},Cw,Sw;function Yp(){return Yp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yp.apply(null,arguments)}var F7=function(t){return S.createElement("svg",Yp({xmlns:"http://www.w3.org/2000/svg",width:12,height:12,fill:"none"},t),Cw||(Cw=S.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M7.79 6c0 .99-.8 1.79-1.79 1.79S4.21 6.99 4.21 6 5.01 4.21 6 4.21s1.79.8 1.79 1.79"})),Sw||(Sw=S.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",d:"M6 10.135c1.765 0 3.41-1.04 4.555-2.84.45-.705.45-1.89 0-2.595C9.41 2.9 7.765 1.86 6 1.86S2.59 2.9 1.445 4.7c-.45.705-.45 1.89 0 2.595 1.145 1.8 2.79 2.84 4.555 2.84"})))},Tw;function Gp(){return Gp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Gp.apply(null,arguments)}var B7=function(t){return S.createElement("svg",Gp({xmlns:"http://www.w3.org/2000/svg",width:9,height:8,fill:"none"},t),Tw||(Tw=S.createElement("path",{fill:"#fff",fillRule:"evenodd",d:"M8.277 1.004a.406.406 0 0 1 0 .575L2.86 6.996a.406.406 0 0 1-.574 0L.119 4.829a.406.406 0 1 1 .575-.575l1.879 1.88 5.13-5.13a.406.406 0 0 1 .574 0",clipRule:"evenodd"})))};const Ow=({type:e,item:t,handleShowDetails:n,handleRead:r,handleCTAClicked:o,clickId:i})=>{var c,u;const a=It(),l=(u=(c=JSON.parse(localStorage.getItem("settings")))==null?void 0:c.platform)==null?void 0:u.theme;return g.jsxs(ye,{className:"cards",sx:{pt:" 0.8rem"},children:[g.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"start",justifyContent:"space-between",gap:1,children:g.jsx(nd,{sx:{width:"calc(100% - 2%)","& .MuiBadge-badge":{backgroundColor:"#6041EA",height:"0.5rem",minWidth:"0.5rem"}},variant:"dot",invisible:t==null?void 0:t.isRead,children:g.jsx(Oo,{sx:{color:a.palette.primary.notifyActiveText,whiteSpace:"normal",wordBreak:"break-word"},component:"p",className:["title-card",(t==null?void 0:t.isRead)&&"read"].join(" "),children:t==null?void 0:t.message})})}),g.jsx(ft,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",children:g.jsxs(ft,{display:"flex",flexDirection:"row",justifyContent:"start",gap:1,sx:{p:"0.5rem 0"},children:[(t==null?void 0:t.isNotificationDetails)&&g.jsx(Fc,{icon:g.jsx(F7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:n,label:i===(t==null?void 0:t.id)?g.jsx(Ol,{color:"primary",size:13}):"Show Details",component:"button",variant:"filled",clickable:!0,size:"small",sx:{backgroundColor:a.palette.brandColor.orange,color:a.palette.brandColor.white}}),!(t!=null&&t.isRead)&&g.jsx(Fc,{icon:g.jsx(B7,{className:`${l==="light"?"chip-icon-light":"chip-icon-dark"}`}),disabled:i,onClick:r,label:"Acknowledge",component:"button",variant:"outlined",clickable:!0,size:"small"}),(t==null?void 0:t.primaryCTAURL)&&g.jsx(Fc,{disabled:t==null?void 0:t.isPrimaryCTAClicked,onClick:()=>o({redirect:t==null?void 0:t.isPrimaryCTARedirect,isClicked:t==null?void 0:t.isPrimaryCTAClicked,url:t==null?void 0:t.primaryCTAURL}),label:t==null?void 0:t.primaryCTALabel,component:"button",variant:"outlined",clickable:!0,size:"small"}),(t==null?void 0:t.secondaryCTAURL)&&g.jsx(Fc,{disabled:t==null?void 0:t.isSecondaryCTAClicked,onClick:()=>o({redirect:t==null?void 0:t.isSecondaryCTARedirect,isClicked:t==null?void 0:t.isSecondaryCTAClicked,url:t==null?void 0:t.secondaryCTAURL}),label:t==null?void 0:t.secondaryCTALabel,component:"button",variant:"outlined",clickable:!0,size:"small"})]})}),g.jsxs(ft,{display:"flex",flexDirection:"row",alignItems:"center",gap:.35,children:[g.jsx(Oo,{sx:{fontSize:"0.8rem"},children:t==null?void 0:t.product}),g.jsx(Oo,{color:a.palette.primary.notifyTextColor,children:"•"}),g.jsx(Oo,{sx:{fontSize:"0.8rem"},children:u8(t==null?void 0:t.createdAt)})]})]})};Ow.propTypes={type:s.string,title:s.string,subTitle:s.string,isRead:s.bool,handleShowDetails:s.func,handleRead:s.func};const kw=({data:e,handleRead:t,handleShowDetails:n,clickId:r,mode:o,page:i,setPage:a})=>{const{isMarkAllAsRead:l}=R.useContext(Lp),c=new Date,u=new Intl.DateTimeFormat("en-US",{day:"numeric",month:"long",year:"numeric"}).format(c),[d,f]=R.useState([]),[p,h]=R.useState(!1),[y,m]=R.useState(!0),b=R.useRef(null),x=async C=>{h(!0);const O=e.slice((C-1)*10,C*10);await new Promise(v=>setTimeout(v,1e3)),f(v=>{const k=O.filter(E=>!v.some(M=>M.id===E.id));return[...v,...k]}),h(!1),(d==null?void 0:d.length)>=(e==null?void 0:e.length)&&m(!1)};R.useEffect(()=>{var O;let C=[];o?l!=null&&l.count?C=(O=e==null?void 0:e.filter(v=>!v.isRead))==null?void 0:O.slice(0,10):C=[]:C=e.slice(0,10),(C==null?void 0:C.length)<10&&m(!1),f(C)},[e,o,l]),R.useEffect(()=>{y&&i!==1&&x(i)},[i,e]),R.useEffect(()=>{f([...e])},[e]),R.useEffect(()=>{const C=new IntersectionObserver(O=>{O[0].isIntersecting&&!p&&y&&a(v=>v+1)},{threshold:1});return b.current&&C.observe(b.current),()=>{b.current&&C.unobserve(b.current)}},[p,y]);const w=({redirect:C,isClicked:O,url:v})=>{window.open(v,"_blank")};return g.jsxs(ye,{sx:{width:"100%"},children:[Object.entries(h8(d)).map(([C,O])=>g.jsxs(R.Fragment,{children:[C!==u&&g.jsx(w7,{children:C}),O.map((v,k)=>g.jsx(R.Fragment,{children:g.jsx(Ow,{item:v,handleCTAClicked:w,handleShowDetails:()=>n(v.id,v.snopId),handleRead:()=>t([v.id],v.snopId),clickId:r})},`${k}_${v.id}`))]},C)),p&&i>1&&!!(d!=null&&d.length)&&g.jsx(ye,{sx:{display:"flex",justifyContent:"center",alignItems:"center",pl:"0.5rem",py:"0.3rem"},children:g.jsx(Ol,{size:20,sx:{color:C=>C.palette.primary.notifyIconColor}})}),!(d!=null&&d.length)&&g.jsx(nt,{sx:{fontSize:"1.1rem",color:C=>C.palette.primary.notifyTextColor,textAlign:"center",px:"0.8rem"},children:"You don't have any unread notification here. Use the toggle to switch between read and unread notification."}),g.jsx(ye,{ref:b,style:{height:"0.1rem",backgroundColor:"transparent"}})]})};kw.propTypes={data:s.array,handleRead:s.func,handleShowDetails:s.func};const L7=({onRefresh:e,handleShowDetails:t,clickId:n,handleRead:r,handleMarkAllAsRead:o})=>{var y,m,b,x;const{loading:i,activeTab:a,data:l,tabData:c,mode:u,page:d,setPage:f,handleTabChange:p,toggleAlertMode:h}=gw({});return g.jsxs(g.Fragment,{children:[g.jsxs(ye,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",px:2,pt:2},children:[g.jsx(nt,{variant:"h2",sx:{fontSize:"1.2rem",color:w=>w.palette.primary.notifyTextColor},children:"Notifications"}),g.jsx(ye,{onClick:e,children:g.jsx(hn,{url:Ke.Refresh,alt:"refresh",sx:{cursor:"pointer"}})})]}),g.jsx(ye,{sx:{borderBottom:1,m:"1.2rem 1.2rem 0 1.2rem",borderColor:w=>w.palette.primary.notifyBorderColor},children:g.jsxs(S7,{value:a,onChange:p,children:[g.jsx(Fp,{label:g.jsxs(ye,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["All (",g.jsx(nt,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((y=l==null?void 0:l.filter(w=>!(w!=null&&w.isRead)))==null?void 0:y.length)||0}),")"]})}),g.jsx(Fp,{label:g.jsxs(ye,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Info (",g.jsx(nt,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((m=l==null?void 0:l.filter(w=>(w==null?void 0:w.type)==="INFO"&&!(w!=null&&w.isRead)))==null?void 0:m.length)||0}),")"]}),sx:{color:w=>w.palette.brandColor.blue}}),g.jsx(Fp,{label:g.jsxs(ye,{sx:{display:"flex",alignItems:"center",fontSize:"1rem",fontWeight:"500"},children:["Error (",g.jsx(nt,{component:"span",sx:{fontWeight:"500",fontSize:"1rem"},children:((b=l==null?void 0:l.filter(w=>(w==null?void 0:w.type)==="ERROR"&&!(w!=null&&w.isRead)))==null?void 0:b.length)||0}),")"]}),sx:{color:w=>w.palette.brandColor.red}})]})}),g.jsx(Pl,{dividers:!0,sx:{p:0,...i&&!c.length&&{alignItems:"center",justifyContent:"center"},flexGrow:1,overflowY:"auto",mx:"1.2rem",borderColor:w=>w.palette.primary.notifyBorderColor},tabIndex:-1,children:i?g.jsx(Ol,{size:30,sx:{color:w=>w.palette.primary.notifyIconColor}}):g.jsx(g.Fragment,{children:g.jsx(kw,{data:c,handleShowDetails:t,handleRead:r,clickId:n,page:d,setPage:f,mode:u})})}),g.jsxs(El,{sx:{justifyContent:"space-between",px:"1.2rem"},children:[g.jsxs(ft,{direction:"row",gap:1,children:[g.jsx(Oo,{sx:{fontSize:"1rem"},children:"Only show unread"}),g.jsx(x7,{disabled:i,checked:u,onChange:h})]}),g.jsx(Hn,{variant:"outlined",className:"view-all",onClick:o,startIcon:g.jsx(_7,{}),disabled:!((x=l==null?void 0:l.filter(w=>!(w!=null&&w.isRead)))!=null&&x.length),style:{backgroundColor:"transparent"},sx:{fontSize:"1rem",fontWeight:"300",p:0,border:"none",textTransform:"none",color:w=>w.palette.primary.notifyTextColor,"&:hover":{color:w=>w.palette.primary.notifyActiveText,background:"transparent",boxShadow:"none",border:"none"},"&.Mui-disabled":{opacity:.5,color:w=>`${w.palette.primary.notifyActiveText}!important`,background:"transparent",boxShadow:"none",border:"none"}},children:"Mark all as read"})]})]})},V7=({data:e,handleClose:t})=>{var b;const[n,r]=R.useState(1),[o,i]=R.useState(10),[a,l]=R.useState(((b=e==null?void 0:e.notificationDetails)==null?void 0:b.length)||0),[c,u]=R.useState("sku_name"),[d,f]=R.useState("asc"),[p,h]=R.useState([]),[y,m]=R.useState("");return R.useEffect(()=>{var x;if(y||c){const w=f8(e==null?void 0:e.notificationDetails,a7,y);if(c){const C=p8(w,c,d?"asc":"desc");h(pp(C,n,o)),l(C.length);return}h(pp(w,n,o)),l(w.length);return}h(pp(e==null?void 0:e.notificationDetails,n,o)),l((x=e==null?void 0:e.notificationDetails)==null?void 0:x.length)},[y,e==null?void 0:e.notificationDetails,n,o,d,c]),g.jsxs(g.Fragment,{children:[g.jsxs(ft,{direction:"row",justifyContent:"space-between",sx:{padding:"1.5rem 2rem",borderBottom:"0.1rem solid",borderColor:x=>x.palette.primary.notifyBorderColor},children:[g.jsx(nt,{component:"h2",sx:{fontSize:"1.4rem",color:x=>x.palette.primary.notifyActiveText},children:(e==null?void 0:e.message)||""}),g.jsx(ye,{onClick:t,sx:{cursor:"pointer"},children:g.jsx(hn,{url:Ke.CloseCircle})})]}),g.jsx(Pl,{children:g.jsx(Bp,{tableProps:{data:p,columns:{...y7(),isManageable:!1},sort:{sortField:c,sortDir:d,onSort:x=>{var C;const w=(C=x==null?void 0:x.column)==null?void 0:C.key;f(O=>c===w&&O==="asc"?"desc":"asc"),u(w)}},pagination:{selectedPage:n,rowPerPage:o,totalRecords:a,onPageChange:x=>{r(x)},onPageSizeChange:x=>{i(x==null?void 0:x.value),r(1)}}},toolbarProps:{defaultTools:{search:{isRequired:!0,onChange:x=>{const w=x.target.value;w&&r(1),m(w)},placeholder:"Search..."}}}})}),g.jsx(El,{sx:{padding:"1.5rem 2rem"}})]})},W7=({baseUrl:e})=>{const{alertDialogProps:t,showDetailsProps:n,fetchNotification:r,isMarkAllAsRead:o}=gw({baseUrl:e});return g.jsxs(g.Fragment,{children:[g.jsx(ye,{sx:{display:"flex",justifyContent:"center",cursor:"pointer",marginTop:"0.6rem"},onClick:()=>{var i;r(),(i=t==null?void 0:t.setOpen)==null||i.call(t,!0)},children:g.jsx($7,{count:o.count})}),g.jsx(xw,{...t,children:g.jsx(L7,{...t})}),g.jsx(xw,{...n,children:g.jsx(V7,{...n})})]})},z7=({baseUrl:e})=>g.jsx(Fn,{children:g.jsx(R7,{children:g.jsx(W7,{baseUrl:e})})}),U7=({rightChild:e,leftChild:t,isDrawerMerged:n,isDrawerOpen:r,drawerTitle:o,showExpand:i,onCloseClick:a,onMergeClick:l,onExpandClick:c,isDrawerExpanded:u,styles:d,showMerge:f})=>{const p=It();return g.jsx(ye,{sx:{position:"relative",overflow:"hidden"},children:g.jsxs(ao,{container:!0,sx:{height:"100%"},children:[g.jsx(ao,{item:!0,sx:{width:n?d!=null&&d.drawerWidth?`calc(${"100%"-(d==null?void 0:d.drawerWidth)})`:"75%":"100%",position:"relative",zIndex:3,height:"calc(100vh - 7rem)",p:"0rem 1.5rem",overflow:"auto"},children:t}),r&&!n&&g.jsxs(g.Fragment,{children:[g.jsx(ye,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"#07080B80",backdropFilter:"blur(3px)",zIndex:3,transition:"opacity 0.3s ease-in-out"}}),g.jsx(ye,{onClick:a,sx:{position:"fixed",top:0,left:0,width:"100%",height:"100%",backgroundColor:"transparent",zIndex:4}})]}),e&&g.jsxs(ao,{item:!0,sx:{width:u?"90%":(d==null?void 0:d.drawerWidth)||"25%",position:n?"relative":"absolute",top:0,right:0,height:"calc(100vh - 7rem)",backgroundColor:p.palette.primary.notifyBackground,transform:r?"translateX(0)":"translateX(100%)",transition:"transform 0.4s ease-in-out , width 0.4s ease-in-out",zIndex:4,borderLeft:`0.1rem solid ${p.palette.primary.notifyBorderColor}`,display:"flex",flexDirection:"column"},children:[g.jsxs(ft,{direction:"row",alignItems:"center",sx:{width:"100%",flexShrink:0,paddingBottom:"0.8rem",px:2,pt:"0.8rem",borderBottom:h=>`0.1rem solid ${h.palette.primary.notifyBorderColor}`},children:[!u&&f&&g.jsxs(g.Fragment,{children:[g.jsx(ye,{component:"img",src:Ke.Merge,sx:{display:"flex",justifyContent:"center",alignItems:"center",cursor:"pointer"},onClick:l}),g.jsx(yi,{orientation:"vertical",flexItem:!0,sx:{mx:"1rem",height:"auto!important",borderColor:p.palette.primary.notifyBorderColor}})]}),g.jsxs(ft,{direction:"row",justifyContent:"space-between",alignItems:"center",flexGrow:1,children:[g.jsxs(ft,{direction:"row",gap:"0.5rem",alignItems:"center",onClick:a,sx:{cursor:"pointer"},children:[g.jsx(hn,{url:Ke.CrossLight}),g.jsx(nt,{sx:{fontSize:"1.2rem",color:p.palette.primary.notifyTextColor},children:o})]}),g.jsx(ft,{direction:"row",gap:"0.5rem",alignItems:"center",children:i&&g.jsx(ye,{onClick:c,sx:{cursor:"pointer"},children:g.jsx(ye,{component:"img",src:u?Ke.Collapse:Ke.Expand})})})]})]}),g.jsx(ye,{sx:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"},overflow:"auto",px:2},children:e})]})]})})},Ew=({layoutChildren:e,layoutProps:t})=>g.jsx(Fn,{children:g.jsx(U7,{...e,...t})});Ew.propTypes={layoutChildren:s.object.isRequired,layoutProps:s.object.isRequired},vt.Button=mo,vt.Checkbox=sc,vt.DatePicker=l8,vt.Grid=Bp,vt.Header=fw,vt.InputField=s1,vt.Loader=N8,vt.Notification=z7,vt.Select=l1,vt.SliderLayout=Ew,vt.Switch=f1,vt.TextField=xc,vt.ToastProvider=R8,vt.toast=k8,Object.defineProperty(vt,Symbol.toStringTag,{value:"Module"})});
|
|
327
327
|
//# sourceMappingURL=index.umd.js.map
|