botech-library 1.0.4 → 1.0.30

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.
Files changed (33) hide show
  1. package/dist/cjs/index.js +1 -1
  2. package/dist/cjs/index.js.map +1 -1
  3. package/dist/esm/index.js +1 -1
  4. package/dist/esm/index.js.map +1 -1
  5. package/dist/types/__tests__/components/Modal/Modal.test.d.ts +2 -0
  6. package/dist/types/__tests__/components/Modal/Modal.test.d.ts.map +1 -0
  7. package/dist/types/components/Modal/Modal.d.ts +32 -0
  8. package/dist/types/components/Modal/Modal.d.ts.map +1 -0
  9. package/dist/types/components/Modal/ModalBody.d.ts +5 -0
  10. package/dist/types/components/Modal/ModalBody.d.ts.map +1 -0
  11. package/dist/types/components/Modal/ModalFooter.d.ts +5 -0
  12. package/dist/types/components/Modal/ModalFooter.d.ts.map +1 -0
  13. package/dist/types/components/Modal/ModalHeader.d.ts +12 -0
  14. package/dist/types/components/Modal/ModalHeader.d.ts.map +1 -0
  15. package/dist/types/components/Modal/index.d.ts +8 -0
  16. package/dist/types/components/Modal/index.d.ts.map +1 -0
  17. package/dist/types/components/Modal/useModal.d.ts +10 -0
  18. package/dist/types/components/Modal/useModal.d.ts.map +1 -0
  19. package/dist/types/components/Selector/MultiSelector.d.ts +4 -0
  20. package/dist/types/components/Selector/MultiSelector.d.ts.map +1 -0
  21. package/dist/types/components/Selector/SearchTest.d.ts +1 -0
  22. package/dist/types/components/Selector/SearchTest.d.ts.map +1 -0
  23. package/dist/types/components/Selector/SelectorExample.d.ts +4 -0
  24. package/dist/types/components/Selector/SelectorExample.d.ts.map +1 -0
  25. package/dist/types/components/Selector/SingleSelector.d.ts +4 -0
  26. package/dist/types/components/Selector/SingleSelector.d.ts.map +1 -0
  27. package/dist/types/components/Selector/index.d.ts +4 -0
  28. package/dist/types/components/Selector/index.d.ts.map +1 -0
  29. package/dist/types/components/Selector/types.d.ts +36 -0
  30. package/dist/types/components/Selector/types.d.ts.map +1 -0
  31. package/dist/types/components/index.d.ts +5 -0
  32. package/dist/types/components/index.d.ts.map +1 -1
  33. package/package.json +3 -1
package/dist/cjs/index.js CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";var t=require("react/jsx-runtime"),e=require("react"),n=require("sweetalert2"),i=require("axios");function s(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,i.get?i:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var o=s(e);const r=({variant:e="primary",size:n="md",onClick:i,children:s,className:o="",disabled:r=!1})=>{const a={primary:r?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-primary-botech hover:bg-primary-botech-400 text-white cursor-pointer",secondary:r?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-800 cursor-pointer",danger:r?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-red-500 hover:bg-red-600 text-white cursor-pointer"};return t.jsx("button",{className:`rounded font-medium transition-colors duration-300 ease-in-out ${{sm:"px-3 py-1.5 text-sm",md:"px-4 py-2",lg:"px-6 py-3 text-lg"}[n]} ${a[e]} ${o}`,onClick:r?void 0:i,disabled:r,children:s})};var a={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},l=e.createContext&&e.createContext(a),c=["attr","size","title"];function u(t,e){if(null==t)return{};var n,i,s=function(t,e){if(null==t)return{};var n={};for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){if(e.indexOf(i)>=0)continue;n[i]=t[i]}return n}(t,e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(s[n]=t[n])}return s}function h(){return h=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},h.apply(this,arguments)}function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,i)}return n}function p(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach(function(e){m(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function m(t,e,n){var i;return(e="symbol"==typeof(i=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var i=n.call(t,e||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"))?i:i+"")in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function f(t){return t&&t.map((t,n)=>e.createElement(t.tag,p({key:n},t.attr),f(t.child)))}function g(t){return n=>e.createElement(y,h({attr:p({},t.attr)},n),f(t.child))}function y(t){var n=n=>{var i,{attr:s,size:o,title:r}=t,a=u(t,c),l=o||n.size||"1em";return n.className&&(i=n.className),t.className&&(i=(i?i+" ":"")+t.className),e.createElement("svg",h({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,s,a,{className:i,style:p(p({color:t.color||n.color},n.style),t.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),r&&e.createElement("title",null,r),t.children)};return void 0!==l?e.createElement(l.Consumer,null,t=>n(t)):n(a)}function v(t){return g({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(t)}function x(t){return g({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 18 15 12 9 6"},child:[]}]})(t)}function b(t){return g({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"path",attr:{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},child:[]},{tag:"line",attr:{x1:"12",y1:"17",x2:"12.01",y2:"17"},child:[]}]})(t)}function w(t){return g({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"},child:[]},{tag:"polyline",attr:{points:"16 17 21 12 16 7"},child:[]},{tag:"line",attr:{x1:"21",y1:"12",x2:"9",y2:"12"},child:[]}]})(t)}function T(t){return g({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"3",y1:"12",x2:"21",y2:"12"},child:[]},{tag:"line",attr:{x1:"3",y1:"6",x2:"21",y2:"6"},child:[]},{tag:"line",attr:{x1:"3",y1:"18",x2:"21",y2:"18"},child:[]}]})(t)}function P(t){return g({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(t)}function S(t){return g({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(t)}const E=e.createContext({});function A(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const C="undefined"!=typeof window,j=C?e.useLayoutEffect:e.useEffect,k=e.createContext(null);function M(t,e){-1===t.indexOf(e)&&t.push(e)}function V(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const D=(t,e,n)=>n>e?e:n<t?t:n;let R=()=>{},L=()=>{};"production"!==process.env.NODE_ENV&&(R=(t,e)=>{t||"undefined"==typeof console||console.warn(e)},L=(t,e)=>{if(!t)throw new Error(e)});const N={},O=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function B(t){return"object"==typeof t&&null!==t}const F=t=>/^0[^.\s]+$/u.test(t);function I(t){let e;return()=>(void 0===e&&(e=t()),e)}const $=t=>t,U=(t,e)=>n=>e(t(n)),W=(...t)=>t.reduce(U),z=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i};class H{constructor(){this.subscriptions=[]}add(t){return M(this.subscriptions,t),()=>V(this.subscriptions,t)}notify(t,e,n){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,n);else for(let s=0;s<i;s++){const i=this.subscriptions[s];i&&i(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Y=t=>1e3*t,X=t=>t/1e3;function K(t,e){return e?t*(1e3/e):0}const q=new Set;function G(t,e,n){t||q.has(e)||(console.warn(e),n&&console.warn(n),q.add(e))}const _=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Z(t,e,n,i){if(t===e&&n===i)return $;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=_(r,i,s)-t,o>0?n=r:e=r}while(Math.abs(o)>1e-7&&++a<12);return r}(e,0,1,t,n);return t=>0===t||1===t?t:_(s(t),e,i)}const J=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Q=t=>e=>1-t(1-e),tt=Z(.33,1.53,.69,.99),et=Q(tt),nt=J(et),it=t=>(t*=2)<1?.5*et(t):.5*(2-Math.pow(2,-10*(t-1))),st=t=>1-Math.sin(Math.acos(t)),ot=Q(st),rt=J(st),at=Z(.42,0,1,1),lt=Z(0,0,.58,1),ct=Z(.42,0,.58,1),ut=t=>Array.isArray(t)&&"number"==typeof t[0],ht={linear:$,easeIn:at,easeInOut:ct,easeOut:lt,circIn:st,circInOut:rt,circOut:ot,backIn:et,backInOut:nt,backOut:tt,anticipate:it},dt=t=>{if(ut(t)){L(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,i,s]=t;return Z(e,n,i,s)}return"string"==typeof t?(L(void 0!==ht[t],`Invalid easing type '${t}'`),ht[t]):t},pt=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],mt={value:null,addProjectionMetrics:null};function ft(t,e){let n=!1,i=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,r=pt.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,i=new Set,s=!1,o=!1;const r=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(e){r.has(e)&&(u.schedule(e),t()),l++,e(a)}const u={schedule:(t,e=!1,o=!1)=>{const a=o&&s?n:i;return e&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{i.delete(t),r.delete(t)},process:t=>{a=t,s?o=!0:(s=!0,[n,i]=[i,n],n.forEach(c),e&&mt.value&&mt.value.frameloop[e].push(l),l=0,n.clear(),s=!1,o&&(o=!1,u.process(t)))}};return u}(o,e?n:void 0),t),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:d,render:p,postRender:m}=r,f=()=>{const o=N.useManualTiming?s.timestamp:performance.now();n=!1,N.useManualTiming||(s.delta=i?1e3/60:Math.max(Math.min(o-s.timestamp,40),1)),s.timestamp=o,s.isProcessing=!0,a.process(s),l.process(s),c.process(s),u.process(s),h.process(s),d.process(s),p.process(s),m.process(s),s.isProcessing=!1,n&&e&&(i=!1,t(f))};return{schedule:pt.reduce((e,o)=>{const a=r[o];return e[o]=(e,o=!1,r=!1)=>(n||(n=!0,i=!0,s.isProcessing||t(f)),a.schedule(e,o,r)),e},{}),cancel:t=>{for(let e=0;e<pt.length;e++)r[pt[e]].cancel(t)},state:s,steps:r}}const{schedule:gt,cancel:yt,state:vt,steps:xt}=ft("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:$,!0);let bt;function wt(){bt=void 0}const Tt={now:()=>(void 0===bt&&Tt.set(vt.isProcessing||N.useManualTiming?vt.timestamp:performance.now()),bt),set:t=>{bt=t,queueMicrotask(wt)}},Pt=t=>e=>"string"==typeof e&&e.startsWith(t),St=Pt("--"),Et=Pt("var(--"),At=t=>!!Et(t)&&Ct.test(t.split("/*")[0].trim()),Ct=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,jt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},kt={...jt,transform:t=>D(0,1,t)},Mt={...jt,default:1},Vt=t=>Math.round(1e5*t)/1e5,Dt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Rt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Lt=(t,e)=>n=>Boolean("string"==typeof n&&Rt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Nt=(t,e,n)=>i=>{if("string"!=typeof i)return i;const[s,o,r,a]=i.match(Dt);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Ot={...jt,transform:t=>Math.round((t=>D(0,255,t))(t))},Bt={test:Lt("rgb","red"),parse:Nt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Ot.transform(t)+", "+Ot.transform(e)+", "+Ot.transform(n)+", "+Vt(kt.transform(i))+")"};const Ft={test:Lt("#"),parse:function(t){let e="",n="",i="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,i+=i,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:s?parseInt(s,16)/255:1}},transform:Bt.transform},It=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),$t=It("deg"),Ut=It("%"),Wt=It("px"),zt=It("vh"),Ht=It("vw"),Yt=(()=>({...Ut,parse:t=>Ut.parse(t)/100,transform:t=>Ut.transform(100*t)}))(),Xt={test:Lt("hsl","hue"),parse:Nt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+Ut.transform(Vt(e))+", "+Ut.transform(Vt(n))+", "+Vt(kt.transform(i))+")"},Kt={test:t=>Bt.test(t)||Ft.test(t)||Xt.test(t),parse:t=>Bt.test(t)?Bt.parse(t):Xt.test(t)?Xt.parse(t):Ft.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Bt.transform(t):Xt.transform(t),getAnimatableNone:t=>{const e=Kt.parse(t);return e.alpha=0,Kt.transform(e)}},qt=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Gt="number",_t="color",Zt=/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 Jt(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},s=[];let o=0;const r=e.replace(Zt,t=>(Kt.test(t)?(i.color.push(o),s.push(_t),n.push(Kt.parse(t))):t.startsWith("var(")?(i.var.push(o),s.push("var"),n.push(t)):(i.number.push(o),s.push(Gt),n.push(parseFloat(t))),++o,"${}")).split("${}");return{values:n,split:r,indexes:i,types:s}}function Qt(t){return Jt(t).values}function te(t){const{split:e,types:n}=Jt(t),i=e.length;return t=>{let s="";for(let o=0;o<i;o++)if(s+=e[o],void 0!==t[o]){const e=n[o];s+=e===Gt?Vt(t[o]):e===_t?Kt.transform(t[o]):t[o]}return s}}const ee=t=>"number"==typeof t?0:Kt.test(t)?Kt.getAnimatableNone(t):t;const ne={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Dt)?.length||0)+(t.match(qt)?.length||0)>0},parse:Qt,createTransformer:te,getAnimatableNone:function(t){const e=Qt(t);return te(t)(e.map(ee))}};function ie(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function se(t,e){return n=>n>0?e:t}const oe=(t,e,n)=>t+(e-t)*n,re=(t,e,n)=>{const i=t*t,s=n*(e*e-i)+i;return s<0?0:Math.sqrt(s)},ae=[Ft,Bt,Xt];function le(t){const e=(n=t,ae.find(t=>t.test(n)));var n;if(R(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(e))return!1;let i=e.parse(t);return e===Xt&&(i=function({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,n/=100;let s=0,o=0,r=0;if(e/=100){const i=n<.5?n*(1+e):n+e-n*e,a=2*n-i;s=ie(a,i,t+1/3),o=ie(a,i,t),r=ie(a,i,t-1/3)}else s=o=r=n;return{red:Math.round(255*s),green:Math.round(255*o),blue:Math.round(255*r),alpha:i}}(i)),i}const ce=(t,e)=>{const n=le(t),i=le(e);if(!n||!i)return se(t,e);const s={...n};return t=>(s.red=re(n.red,i.red,t),s.green=re(n.green,i.green,t),s.blue=re(n.blue,i.blue,t),s.alpha=oe(n.alpha,i.alpha,t),Bt.transform(s))},ue=new Set(["none","hidden"]);function he(t,e){return n=>oe(t,e,n)}function de(t){return"number"==typeof t?he:"string"==typeof t?At(t)?se:Kt.test(t)?ce:fe:Array.isArray(t)?pe:"object"==typeof t?Kt.test(t)?ce:me:se}function pe(t,e){const n=[...t],i=n.length,s=t.map((t,n)=>de(t)(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}}function me(t,e){const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=de(t[s])(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}}const fe=(t,e)=>{const n=ne.createTransformer(e),i=Jt(t),s=Jt(e);return i.indexes.var.length===s.indexes.var.length&&i.indexes.color.length===s.indexes.color.length&&i.indexes.number.length>=s.indexes.number.length?ue.has(t)&&!s.values.length||ue.has(e)&&!i.values.length?function(t,e){return ue.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):W(pe(function(t,e){const n=[],i={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const o=e.types[s],r=t.indexes[o][i[o]],a=t.values[r]??0;n[s]=a,i[o]++}return n}(i,s),s.values),n):(R(!0,`Complex values '${t}' and '${e}' 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.`),se(t,e))};function ge(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return oe(t,e,n);return de(t)(t,e)}const ye=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>gt.update(e,t),stop:()=>yt(e),now:()=>vt.isProcessing?vt.timestamp:Tt.now()}},ve=(t,e,n=10)=>{let i="";const s=Math.max(Math.round(e/n),2);for(let e=0;e<s;e++)i+=Math.round(1e4*t(e/(s-1)))/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},xe=2e4;function be(t){let e=0;let n=t.next(e);for(;!n.done&&e<xe;)e+=50,n=t.next(e);return e>=xe?1/0:e}function we(t,e,n){const i=Math.max(e-5,0);return K(n-t(i),e-i)}const Te=100,Pe=10,Se=1,Ee=0,Ae=800,Ce=.3,je=.3,ke={granular:.01,default:2},Me={granular:.005,default:.5},Ve=.01,De=10,Re=.05,Le=1,Ne=.001;function Oe({duration:t=Ae,bounce:e=Ce,velocity:n=Ee,mass:i=Se}){let s,o;R(t<=Y(De),"Spring duration must be 10 seconds or less");let r=1-e;r=D(Re,Le,r),t=D(Ve,De,X(t)),r<1?(s=e=>{const i=e*r,s=i*t,o=i-n,a=Fe(e,r),l=Math.exp(-s);return Ne-o/a*l},o=e=>{const i=e*r*t,o=i*n+n,a=Math.pow(r,2)*Math.pow(e,2)*t,l=Math.exp(-i),c=Fe(Math.pow(e,2),r);return(-s(e)+Ne>0?-1:1)*((o-a)*l)/c}):(s=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,o=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let i=n;for(let n=1;n<Be;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t=Y(t),isNaN(a))return{stiffness:Te,damping:Pe,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}const Be=12;function Fe(t,e){return t*Math.sqrt(1-e*e)}const Ie=["duration","bounce"],$e=["stiffness","damping","mass"];function Ue(t,e){return e.some(e=>void 0!==t[e])}function We(t=je,e=Ce){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:s}=n;const o=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:p}=function(t){let e={velocity:Ee,stiffness:Te,damping:Pe,mass:Se,isResolvedFromDuration:!1,...t};if(!Ue(t,$e)&&Ue(t,Ie))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(1.2*n),s=i*i,o=2*D(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:Se,stiffness:s,damping:o}}else{const n=Oe(t);e={...e,...n,mass:Se},e.isResolvedFromDuration=!0}return e}({...n,velocity:-X(n.velocity||0)}),m=d||0,f=c/(2*Math.sqrt(l*u)),g=r-o,y=X(Math.sqrt(l/u)),v=Math.abs(g)<5;let x;if(i||(i=v?ke.granular:ke.default),s||(s=v?Me.granular:Me.default),f<1){const t=Fe(y,f);x=e=>{const n=Math.exp(-f*y*e);return r-n*((m+f*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===f)x=t=>r-Math.exp(-y*t)*(g+(m+y*g)*t);else{const t=y*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*y*e),i=Math.min(t*e,300);return r-n*((m+f*y*g)*Math.sinh(i)+t*g*Math.cosh(i))/t}}const b={calculatedDuration:p&&h||null,next:t=>{const e=x(t);if(p)a.done=t>=h;else{let n=0===t?m:0;f<1&&(n=0===t?Y(m):we(x,t,e));const o=Math.abs(n)<=i,l=Math.abs(r-e)<=s;a.done=o&&l}return a.value=a.done?r:e,a},toString:()=>{const t=Math.min(be(b),xe),e=ve(e=>b.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return b}function ze({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:r,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let m=n*e;const f=h+m,g=void 0===r?f:r(f);g!==f&&(m=g-h);const y=t=>-m*Math.exp(-t/i),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?g:n};let b,w;const T=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,w=We({keyframes:[d.value,p(d.value)],velocity:we(v,t,d.value),damping:s,stiffness:o,restDelta:c,restSpeed:u}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==b||(e=!0,x(t),T(t)),void 0!==b&&t>=b?w.next(t-b):(!e&&x(t),d)}}}function He(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;if(L(o===e.length,"Both input and output ranges must be the same length"),1===o)return()=>e[0];if(2===o&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const i=[],s=n||N.mix||ge,o=t.length-1;for(let n=0;n<o;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||$:e;o=W(t,o)}i.push(o)}return i}(e,i,s),l=a.length,c=n=>{if(r&&n<t[0])return e[0];let i=0;if(l>1)for(;i<t.length-2&&!(n<t[i+1]);i++);const s=z(t[i],t[i+1],n);return a[i](s)};return n?e=>c(D(t[0],t[o-1],e)):c}function Ye(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const s=z(0,e,i);t.push(oe(n,1,s))}}(e,t.length-1),e}function Xe({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(i)?i.map(dt):dt(i),o={done:!1,value:e[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Ye(e),t),a=He(r,e,{ease:Array.isArray(s)?s:(l=e,c=s,l.map(()=>c||ct).splice(0,l.length-1))});var l,c;return{calculatedDuration:t,next:e=>(o.value=a(e),o.done=e>=t,o)}}We.applyToOptions=t=>{const e=function(t,e=100,n){const i=n({...t,keyframes:[0,e]}),s=Math.min(be(i),xe);return{type:"keyframes",ease:t=>i.next(s*t).value/e,duration:X(s)}}(t,100,We);return t.ease=e.ease,t.duration=Y(e.duration),t.type="keyframes",t};const Ke=t=>null!==t;function qe(t,{repeat:e,repeatType:n="loop"},i,s=1){const o=t.filter(Ke),r=s<0||e&&"loop"!==n&&e%2==1?0:o.length-1;return r&&void 0!==i?i:o[r]}const Ge={decay:ze,inertia:ze,tween:Xe,keyframes:Xe,spring:We};function _e(t){"string"==typeof t.type&&(t.type=Ge[t.type])}class Ze{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const Je=t=>t/100;class Qe extends Ze{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==Tt.now()&&this.tick(Tt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;_e(t);const{type:e=Xe,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t;let{keyframes:r}=t;const a=e||Xe;"production"!==process.env.NODE_ENV&&a!==Xe&&L(r.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${r}`),a!==Xe&&"number"!=typeof r[0]&&(this.mixKeyframes=W(Je,ge(r[0],r[1])),r=[0,100]);const l=a({...t,keyframes:r});"mirror"===s&&(this.mirroredGenerator=a({...t,keyframes:[...r].reverse(),velocity:-o})),null===l.calculatedDuration&&(l.calculatedDuration=be(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:r,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:h,repeatDelay:d,type:p,onUpdate:m,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>i;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=i);let v=this.currentTime,x=n;if(u){const t=Math.min(this.currentTime,i)/r;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/r)):"mirror"===h&&(x=o)),v=D(0,1,n)*r}const b=y?{done:!1,value:c[0]}:x.next(v);s&&(b.value=s(b.value));let{done:w}=b;y||null===a||(w=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return T&&p!==ze&&(b.value=qe(c,this.options,f,this.speed)),m&&m(b.value),T&&this.finish(),b}then(t,e){return this.finished.then(t,e)}get duration(){return X(this.calculatedDuration)}get time(){return X(this.currentTime)}set time(t){t=Y(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Tt.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=X(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=ye,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Tt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const tn=t=>180*t/Math.PI,en=t=>{const e=tn(Math.atan2(t[1],t[0]));return sn(e)},nn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:en,rotateZ:en,skewX:t=>tn(Math.atan(t[1])),skewY:t=>tn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},sn=t=>((t%=360)<0&&(t+=360),t),on=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),rn=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),an={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:on,scaleY:rn,scale:t=>(on(t)+rn(t))/2,rotateX:t=>sn(tn(Math.atan2(t[6],t[5]))),rotateY:t=>sn(tn(Math.atan2(-t[2],t[0]))),rotateZ:en,rotate:en,skewX:t=>tn(Math.atan(t[4])),skewY:t=>tn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function ln(t){return t.includes("scale")?1:0}function cn(t,e){if(!t||"none"===t)return ln(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,s;if(n)i=an,s=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=nn,s=e}if(!s)return ln(e);const o=i[e],r=s[1].split(",").map(un);return"function"==typeof o?o(r):r[o]}function un(t){return parseFloat(t.trim())}const hn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],dn=(()=>new Set(hn))(),pn=t=>t===jt||t===Wt,mn=new Set(["x","y","z"]),fn=hn.filter(t=>!mn.has(t));const gn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>cn(e,"x"),y:(t,{transform:e})=>cn(e,"y")};gn.translateX=gn.x,gn.translateY=gn.y;const yn=new Set;let vn=!1,xn=!1,bn=!1;function wn(){if(xn){const t=Array.from(yn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return fn.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}xn=!1,vn=!1,yn.forEach(t=>t.complete(bn)),yn.clear()}function Tn(){yn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(xn=!0)})}class Pn{constructor(t,e,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(yn.add(this),vn||(vn=!0,gt.read(Tn),gt.resolveKeyframes(wn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:i}=this;if(null===t[0]){const s=i?.get(),o=t[t.length-1];if(void 0!==s)t[0]=s;else if(n&&e){const i=n.readValue(e,o);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=o),i&&void 0===s&&i.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),yn.delete(this)}cancel(){"scheduled"===this.state&&(yn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const Sn=I(()=>void 0!==window.ScrollTimeline),En={};function An(t,e){const n=I(t);return()=>En[e]??n()}const Cn=An(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),jn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,kn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jn([0,.65,.55,1]),circOut:jn([.55,0,1,.45]),backIn:jn([.31,.01,.66,-.59]),backOut:jn([.33,1.53,.69,.99])};function Mn(t,e){return t?"function"==typeof t?Cn()?ve(t,e):"ease-out":ut(t)?jn(t):Array.isArray(t)?t.map(t=>Mn(t,e)||kn.easeOut):kn[t]:void 0}function Vn(t,e,n,{delay:i=0,duration:s=300,repeat:o=0,repeatType:r="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=Mn(a,s);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"};c&&(d.pseudoElement=c);return t.animate(u,d)}function Dn(t){return"function"==typeof t&&"applyToOptions"in t}class Rn extends Ze{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:r,onComplete:a}=t;this.isPseudoElement=Boolean(s),this.allowFlatten=o,this.options=t,L("string"!=typeof t.type,'animateMini doesn\'t support "type" as a string. Did you mean to import { spring } from "motion"?');const l=function({type:t,...e}){return Dn(t)&&Cn()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Vn(e,n,i,l,s),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const t=qe(i,this.options,r,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return X(Number(t))}get time(){return X(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=Y(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&Sn()?(this.animation.timeline=t,$):e(this)}}const Ln={anticipate:it,backInOut:nt,circInOut:rt};function Nn(t){"string"==typeof t.ease&&t.ease in Ln&&(t.ease=Ln[t.ease])}class On extends Rn{constructor(t){Nn(t),_e(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:i,element:s,...o}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const r=new Qe({...o,autoplay:!1}),a=Y(this.finishedTime??this.time);e.setWithVelocity(r.sample(a-10).value,r.sample(a).value,10),r.stop()}}const Bn=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!ne.test(t)&&"0"!==t||t.startsWith("url(")));function Fn(t){return B(t)&&"offsetHeight"in t}const In=new Set(["opacity","clipPath","filter","transform"]),$n=I(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class Un extends Ze{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:r,name:a,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Tt.now();const h={autoplay:t,delay:e,type:n,repeat:i,repeatDelay:s,repeatType:o,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||Pn;this.keyframeResolver=new d(r,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,i){this.keyframeResolver=void 0;const{name:s,type:o,velocity:r,delay:a,isHandoff:l,onUpdate:c}=n;this.resolvedAt=Tt.now(),function(t,e,n,i){const s=t[0];if(null===s)return!1;if("display"===e||"visibility"===e)return!0;const o=t[t.length-1],r=Bn(s,e),a=Bn(o,e);return R(r===a,`You are trying to animate ${e} from "${s}" to "${o}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${o} via the \`style\` property.`),!(!r||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||Dn(n))&&i)}(t,s,o,r)||(!N.instantAnimations&&a||c?.(qe(t,n,e)),t[0]=t[t.length-1],n.duration=0,n.repeat=0);const u={startTime:i?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},h=!l&&function(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:s,damping:o,type:r}=t;if(!Fn(e?.owner?.current))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return $n()&&n&&In.has(n)&&("transform"!==n||!l)&&!a&&!i&&"mirror"!==s&&0!==o&&"inertia"!==r}(u)?new On({...u,element:u.motionValue.owner.current}):new Qe(u);h.finished.then(()=>this.notifyFinished()).catch($),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),bn=!0,Tn(),wn(),bn=!1),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const Wn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function zn(t,e,n=1){L(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[i,s]=function(t){const e=Wn.exec(t);if(!e)return[,];const[,n,i,s]=e;return[`--${n??i}`,s]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const t=o.trim();return O(t)?parseFloat(t):t}return At(s)?zn(s,e,n+1):s}function Hn(t,e){return t?.[e]??t?.default??t}const Yn=new Set(["width","height","top","left","right","bottom",...hn]),Xn=t=>e=>e.test(t),Kn=[jt,Wt,Ut,$t,Ht,zt,{test:t=>"auto"===t,parse:t=>t}],qn=t=>Kn.find(Xn(t));function Gn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||F(t))}const _n=new Set(["brightness","contrast","saturate","opacity"]);function Zn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(Dt)||[];if(!i)return t;const s=n.replace(i,"");let o=_n.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const Jn=/\b([a-z-]*)\(.*?\)/gu,Qn={...ne,getAnimatableNone:t=>{const e=t.match(Jn);return e?e.map(Zn).join(" "):t}},ti={...jt,transform:Math.round},ei={borderWidth:Wt,borderTopWidth:Wt,borderRightWidth:Wt,borderBottomWidth:Wt,borderLeftWidth:Wt,borderRadius:Wt,radius:Wt,borderTopLeftRadius:Wt,borderTopRightRadius:Wt,borderBottomRightRadius:Wt,borderBottomLeftRadius:Wt,width:Wt,maxWidth:Wt,height:Wt,maxHeight:Wt,top:Wt,right:Wt,bottom:Wt,left:Wt,padding:Wt,paddingTop:Wt,paddingRight:Wt,paddingBottom:Wt,paddingLeft:Wt,margin:Wt,marginTop:Wt,marginRight:Wt,marginBottom:Wt,marginLeft:Wt,backgroundPositionX:Wt,backgroundPositionY:Wt,...{rotate:$t,rotateX:$t,rotateY:$t,rotateZ:$t,scale:Mt,scaleX:Mt,scaleY:Mt,scaleZ:Mt,skew:$t,skewX:$t,skewY:$t,distance:Wt,translateX:Wt,translateY:Wt,translateZ:Wt,x:Wt,y:Wt,z:Wt,perspective:Wt,transformPerspective:Wt,opacity:kt,originX:Yt,originY:Yt,originZ:Wt},zIndex:ti,fillOpacity:kt,strokeOpacity:kt,numOctaves:ti},ni={...ei,color:Kt,backgroundColor:Kt,outlineColor:Kt,fill:Kt,stroke:Kt,borderColor:Kt,borderTopColor:Kt,borderRightColor:Kt,borderBottomColor:Kt,borderLeftColor:Kt,filter:Qn,WebkitFilter:Qn},ii=t=>ni[t];function si(t,e){let n=ii(t);return n!==Qn&&(n=ne),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const oi=new Set(["auto","none","0"]);class ri extends Pn{constructor(t,e,n,i,s){super(t,e,n,i,s,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let i=t[n];if("string"==typeof i&&(i=i.trim(),At(i))){const s=zn(i,e.current);void 0!==s&&(t[n]=s),n===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!Yn.has(n)||2!==t.length)return;const[i,s]=t,o=qn(i),r=qn(s);if(o!==r)if(pn(o)&&pn(r))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else gn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Gn(t[e]))&&n.push(e);n.length&&function(t,e,n){let i,s=0;for(;s<t.length&&!i;){const e=t[s];"string"==typeof e&&!oi.has(e)&&Jt(e).values.length&&(i=t[s]),s++}if(i&&n)for(const s of e)t[s]=si(n,i)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=gn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(n,i).jump(i,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const i=t.getValue(e);i&&i.jump(this.measuredOrigin,!1);const s=n.length-1,o=n[s];n[s]=gn[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const ai=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class li{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=Tt.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty();e&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Tt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return"production"!==process.env.NODE_ENV&&G(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new H);const n=this.events[t].add(e);return"change"===t?()=>{n(),gt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Tt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return K(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ci(t,e){return new li(t,e)}const{schedule:ui,cancel:hi}=ft(queueMicrotask,!1),di={x:!1,y:!1};function pi(){return di.x||di.y}function mi(t,e){const n=function(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let i=document;e&&(i=e.current);const s=n?.[t]??i.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}(t),i=new AbortController;return[n,{passive:!0,...e,signal:i.signal},()=>i.abort()]}function fi(t){return!("touch"===t.pointerType||pi())}const gi=(t,e)=>!!e&&(t===e||gi(t,e.parentElement)),yi=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,vi=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const xi=new WeakSet;function bi(t){return e=>{"Enter"===e.key&&t(e)}}function wi(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Ti(t){return yi(t)&&!pi()}function Pi(t,e,n={}){const[i,s,o]=mi(t,n),r=t=>{const i=t.currentTarget;if(!Ti(t))return;xi.add(i);const o=e(i,t),r=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),xi.has(i)&&xi.delete(i),Ti(t)&&"function"==typeof o&&o(t,{success:e})},a=t=>{r(t,i===window||i===document||n.useGlobalTarget||gi(i,t.target))},l=t=>{r(t,!1)};window.addEventListener("pointerup",a,s),window.addEventListener("pointercancel",l,s)};return i.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",r,s),Fn(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const i=bi(()=>{if(xi.has(n))return;wi(n,"down");const t=bi(()=>{wi(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>wi(n,"cancel"),e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)})(t,s)),e=t,vi.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))}),o}function Si(t){return B(t)&&"ownerSVGElement"in t}const Ei=t=>Boolean(t&&t.getVelocity),Ai=[...Kn,Kt,ne],Ci=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class ji extends o.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=e.offsetParent,n=Fn(t)&&t.offsetWidth||0,i=this.props.sizeRef.current;i.height=e.offsetHeight||0,i.width=e.offsetWidth||0,i.top=e.offsetTop,i.left=e.offsetLeft,i.right=n-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function ki({children:n,isPresent:i,anchorX:s}){const r=e.useId(),a=e.useRef(null),l=e.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:c}=e.useContext(Ci);return e.useInsertionEffect(()=>{const{width:t,height:e,top:n,left:o,right:u}=l.current;if(i||!a.current||!t||!e)return;const h="left"===s?`left: ${o}`:`right: ${u}`;a.current.dataset.motionPopId=r;const d=document.createElement("style");return c&&(d.nonce=c),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`\n [data-motion-pop-id="${r}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${h}px !important;\n top: ${n}px !important;\n }\n `),()=>{document.head.contains(d)&&document.head.removeChild(d)}},[i]),t.jsx(ji,{isPresent:i,childRef:a,sizeRef:l,children:o.cloneElement(n,{ref:a})})}const Mi=({children:n,initial:i,isPresent:s,onExitComplete:r,custom:a,presenceAffectsLayout:l,mode:c,anchorX:u})=>{const h=A(Vi),d=e.useId();let p=!0,m=e.useMemo(()=>(p=!1,{id:d,initial:i,isPresent:s,custom:a,onExitComplete:t=>{h.set(t,!0);for(const t of h.values())if(!t)return;r&&r()},register:t=>(h.set(t,!1),()=>h.delete(t))}),[s,h,r]);return l&&p&&(m={...m}),e.useMemo(()=>{h.forEach((t,e)=>h.set(e,!1))},[s]),o.useEffect(()=>{!s&&!h.size&&r&&r()},[s]),"popLayout"===c&&(n=t.jsx(ki,{isPresent:s,anchorX:u,children:n})),t.jsx(k.Provider,{value:m,children:n})};function Vi(){return new Map}function Di(t=!0){const n=e.useContext(k);if(null===n)return[!0,null];const{isPresent:i,onExitComplete:s,register:o}=n,r=e.useId();e.useEffect(()=>{if(t)return o(r)},[t]);const a=e.useCallback(()=>t&&s&&s(r),[r,s,t]);return!i&&s?[!1,a]:[!0]}const Ri=t=>t.key||"";function Li(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}const Ni=({children:n,custom:i,initial:s=!0,onExitComplete:o,presenceAffectsLayout:r=!0,mode:a="sync",propagate:l=!1,anchorX:c="left"})=>{const[u,h]=Di(l),d=e.useMemo(()=>Li(n),[n]),p=l&&!u?[]:d.map(Ri),m=e.useRef(!0),f=e.useRef(d),g=A(()=>new Map),[y,v]=e.useState(d),[x,b]=e.useState(d);j(()=>{m.current=!1,f.current=d;for(let t=0;t<x.length;t++){const e=Ri(x[t]);p.includes(e)?g.delete(e):!0!==g.get(e)&&g.set(e,!1)}},[x,p.length,p.join("-")]);const w=[];if(d!==y){let t=[...d];for(let e=0;e<x.length;e++){const n=x[e],i=Ri(n);p.includes(i)||(t.splice(e,0,n),w.push(n))}return"wait"===a&&w.length&&(t=w),b(Li(t)),v(d),null}"production"!==process.env.NODE_ENV&&"wait"===a&&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:T}=e.useContext(E);return t.jsx(t.Fragment,{children:x.map(e=>{const n=Ri(e),y=!(l&&!u)&&(d===x||p.includes(n));return t.jsx(Mi,{isPresent:y,initial:!(m.current&&!s)&&void 0,custom:i,presenceAffectsLayout:r,mode:a,onExitComplete:y?void 0:()=>{if(!g.has(n))return;g.set(n,!0);let t=!0;g.forEach(e=>{e||(t=!1)}),t&&(T?.(),b(f.current),l&&h?.(),o&&o())},anchorX:c,children:e},n)})})},Oi=e.createContext({strict:!1}),Bi={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"]},Fi={};for(const t in Bi)Fi[t]={isEnabled:e=>Bi[t].some(t=>!!e[t])};const Ii=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 $i(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Ii.has(t)}let Ui=t=>!$i(t);try{"function"==typeof(Wi=require("@emotion/is-prop-valid").default)&&(Ui=t=>t.startsWith("on")?!$i(t):Wi(t))}catch{}var Wi;function zi(t){if("undefined"==typeof Proxy)return t;const e=new Map;return new Proxy((...e)=>("production"!==process.env.NODE_ENV&&G(!1,"motion() is deprecated. Use motion.create() instead."),t(...e)),{get:(n,i)=>"create"===i?t:(e.has(i)||e.set(i,t(i)),e.get(i))})}const Hi=e.createContext({});function Yi(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function Xi(t){return"string"==typeof t||Array.isArray(t)}const Ki=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],qi=["initial",...Ki];function Gi(t){return Yi(t.animate)||qi.some(e=>Xi(t[e]))}function _i(t){return Boolean(Gi(t)||t.variants)}function Zi(t){const{initial:n,animate:i}=function(t,e){if(Gi(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Xi(e)?e:void 0,animate:Xi(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(Hi));return e.useMemo(()=>({initial:n,animate:i}),[Ji(n),Ji(i)])}function Ji(t){return Array.isArray(t)?t.join(" "):t}const Qi=Symbol.for("motionComponentSymbol");function ts(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function es(t,n,i){return e.useCallback(e=>{e&&t.onMount&&t.onMount(e),n&&(e?n.mount(e):n.unmount()),i&&("function"==typeof i?i(e):ts(i)&&(i.current=e))},[n])}const ns=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),is="data-"+ns("framerAppearId"),ss=e.createContext({});function os(t,n,i,s,o){const{visualElement:r}=e.useContext(Hi),a=e.useContext(Oi),l=e.useContext(k),c=e.useContext(Ci).reducedMotion,u=e.useRef(null);s=s||a.renderer,!u.current&&s&&(u.current=s(t,{visualState:n,parent:r,props:i,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:c}));const h=u.current,d=e.useContext(ss);!h||h.projection||!o||"html"!==h.type&&"svg"!==h.type||function(t,e,n,i){const{layoutId:s,layout:o,drag:r,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:rs(t.parent)),t.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:Boolean(r)||a&&ts(a),visualElement:t,animationType:"string"==typeof o?o:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:l,layoutRoot:c})}(u.current,i,o,d);const p=e.useRef(!1);e.useInsertionEffect(()=>{h&&p.current&&h.update(i,l)});const m=i[is],f=e.useRef(Boolean(m)&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return j(()=>{h&&(p.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),ui.render(h.render),f.current&&h.animationState&&h.animationState.animateChanges())}),e.useEffect(()=>{h&&(!f.current&&h.animationState&&h.animationState.animateChanges(),f.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(m)}),f.current=!1))}),h}function rs(t){if(t)return!1!==t.options.allowProjection?t.projection:rs(t.parent)}function as({preloadedFeatures:n,createVisualElement:i,useRender:s,useVisualState:o,Component:r}){function a(a,l){let c;const u={...e.useContext(Ci),...a,layoutId:ls(a)},{isStatic:h}=u,d=Zi(a),p=o(a,h);if(!h&&C){!function(t,n){const i=e.useContext(Oi).strict;if("production"!==process.env.NODE_ENV&&n&&i){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?R(!1,e):L(!1,e)}}(u,n);const t=function(t){const{drag:e,layout:n}=Fi;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}(u);c=t.MeasureLayout,d.visualElement=os(r,p,u,i,t.ProjectionNode)}return t.jsxs(Hi.Provider,{value:d,children:[c&&d.visualElement?t.jsx(c,{visualElement:d.visualElement,...u}):null,s(r,a,es(p,d.visualElement,l),p,h,d.visualElement)]})}n&&function(t){for(const e in t)Fi[e]={...Fi[e],...t[e]}}(n),a.displayName=`motion.${"string"==typeof r?r:`create(${r.displayName??r.name??""})`}`;const l=e.forwardRef(a);return l[Qi]=r,l}function ls({layoutId:t}){const n=e.useContext(E).id;return n&&void 0!==t?n+"-"+t:t}const cs={};function us(t,{layout:e,layoutId:n}){return dn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!cs[t]||"opacity"===t)}const hs={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ds=hn.length;function ps(t,e,n){const{style:i,vars:s,transformOrigin:o}=t;let r=!1,a=!1;for(const t in e){const n=e[t];if(dn.has(t))r=!0;else if(St(t))s[t]=n;else{const e=ai(n,ei[t]);t.startsWith("origin")?(a=!0,o[t]=e):i[t]=e}}if(e.transform||(r||n?i.transform=function(t,e,n){let i="",s=!0;for(let o=0;o<ds;o++){const r=hn[o],a=t[r];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(r.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=ai(a,ei[r]);l||(s=!1,i+=`${hs[r]||r}(${t}) `),n&&(e[r]=t)}}return i=i.trim(),n?i=n(e,s?"":i):s&&(i="none"),i}(e,t.transform,n):i.transform&&(i.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=o;i.transformOrigin=`${t} ${e} ${n}`}}const ms=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function fs(t,e,n){for(const i in e)Ei(e[i])||us(i,n)||(t[i]=e[i])}function gs(t,n){const i={};return fs(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return ps(e,n,t),Object.assign({},e.vars,e.style)},[n])}(t,n)),i}function ys(t,e){const n={},i=gs(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const vs={offset:"stroke-dashoffset",array:"stroke-dasharray"},xs={offset:"strokeDashoffset",array:"strokeDasharray"};function bs(t,{attrX:e,attrY:n,attrScale:i,pathLength:s,pathSpacing:o=1,pathOffset:r=0,...a},l,c,u){if(ps(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==i&&(h.scale=i),void 0!==s&&function(t,e,n=1,i=0,s=!0){t.pathLength=1;const o=s?vs:xs;t[o.offset]=Wt.transform(-i);const r=Wt.transform(e),a=Wt.transform(n);t[o.array]=`${r} ${a}`}(h,s,o,r,!1)}const ws=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Ts=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Ps(t,n,i,s){const o=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return bs(e,n,Ts(s),t.transformTemplate,t.style),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};fs(e,t.style,t),o.style={...e,...o.style}}return o}const Ss=["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 Es(t){return"string"==typeof t&&!t.includes("-")&&!!(Ss.indexOf(t)>-1||/[A-Z]/u.test(t))}function As(t=!1){return(n,i,s,{latestValues:o},r)=>{const a=(Es(n)?Ps:ys)(i,o,r,n),l=function(t,e,n){const i={};for(const s in t)"values"===s&&"object"==typeof t.values||(Ui(s)||!0===n&&$i(s)||!e&&!$i(s)||t.draggable&&s.startsWith("onDrag"))&&(i[s]=t[s]);return i}(i,"string"==typeof n,t),c=n!==e.Fragment?{...l,...a,ref:s}:{},{children:u}=i,h=e.useMemo(()=>Ei(u)?u.get():u,[u]);return e.createElement(n,{...c,children:h})}}function Cs(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function js(t,e,n,i){if("function"==typeof e){const[s,o]=Cs(i);e=e(void 0!==n?n:t.custom,s,o)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[s,o]=Cs(i);e=e(void 0!==n?n:t.custom,s,o)}return e}function ks(t){return Ei(t)?t.get():t}const Ms=t=>(n,i)=>{const s=e.useContext(Hi),o=e.useContext(k),r=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,s){return{latestValues:Vs(n,i,s,t),renderState:e()}}(t,n,s,o);return i?r():A(r)};function Vs(t,e,n,i){const s={},o=i(t,{});for(const t in o)s[t]=ks(o[t]);let{initial:r,animate:a}=t;const l=Gi(t),c=_i(t);e&&c&&!l&&!1!==t.inherit&&(void 0===r&&(r=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===r;const h=u?a:r;if(h&&"boolean"!=typeof h&&!Yi(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n<e.length;n++){const i=js(t,e[n]);if(i){const{transitionEnd:t,transition:e,...n}=i;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(s[t]=e)}for(const e in t)s[e]=t[e]}}}return s}function Ds(t,e,n){const{style:i}=t,s={};for(const o in i)(Ei(i[o])||e.style&&Ei(e.style[o])||us(o,t)||void 0!==n?.getValue(o)?.liveStyle)&&(s[o]=i[o]);return s}const Rs={useVisualState:Ms({scrapeMotionValuesFromProps:Ds,createRenderState:ms})};function Ls(t,e,n){const i=Ds(t,e,n);for(const n in t)if(Ei(t[n])||Ei(e[n])){i[-1!==hn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return i}const Ns={useVisualState:Ms({scrapeMotionValuesFromProps:Ls,createRenderState:ws})};function Os(t,e){return function(n,{forwardMotionProps:i}={forwardMotionProps:!1}){return as({...Es(n)?Ns:Rs,preloadedFeatures:t,useRender:As(i),createVisualElement:e,Component:n})}}function Bs(t,e,n){const i=t.getProps();return js(i,e,void 0!==n?n:i.custom,t)}const Fs=t=>Array.isArray(t);function Is(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,ci(n))}function $s(t){return Fs(t)?t[t.length-1]||0:t}function Us(t,e){const n=t.getValue("willChange");if(i=n,Boolean(Ei(i)&&i.add))return n.add(e);if(!n&&N.WillChange){const n=new N.WillChange("auto");t.addValue("willChange",n),n.add(e)}var i}function Ws(t){return t.props[is]}const zs=t=>null!==t;const Hs={type:"spring",stiffness:500,damping:25,restSpeed:10},Ys={type:"keyframes",duration:.8},Xs={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ks=(t,{keyframes:e})=>e.length>2?Ys:dn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Hs:Xs;const qs=(t,e,n,i={},s,o)=>r=>{const a=Hn(i,t)||{},l=a.delay||i.delay||0;let{elapsed:c=0}=i;c-=Y(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{r(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:o?void 0:s};(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(a)||Object.assign(u,Ks(t,u)),u.duration&&(u.duration=Y(u.duration)),u.repeatDelay&&(u.repeatDelay=Y(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let h=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(h=!0)),(N.instantAnimations||N.skipAnimations)&&(h=!0,u.duration=0,u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!o&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},i){const s=t.filter(zs),o=e&&"loop"!==n&&e%2==1?0:s.length-1;return o&&void 0!==i?i:s[o]}(u.keyframes,a);if(void 0!==t)return void gt.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new Qe(u):new Un(u)};function Gs({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}function _s(t,e,{delay:n=0,transitionOverride:i,type:s}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=e;i&&(o=i);const l=[],c=s&&t.animationState&&t.animationState.getState()[s];for(const e in a){const i=t.getValue(e,t.latestValues[e]??null),s=a[e];if(void 0===s||c&&Gs(c,e))continue;const r={delay:n,...Hn(o||{},e)},u=i.get();if(void 0!==u&&!i.isAnimating&&!Array.isArray(s)&&s===u&&!r.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){const n=Ws(t);if(n){const t=window.MotionHandoffAnimation(n,e,gt);null!==t&&(r.startTime=t,h=!0)}}Us(t,e),i.start(qs(e,i,s,t.shouldReduceMotion&&Yn.has(e)?{type:!1}:r,t,h));const d=i.animation;d&&l.push(d)}return r&&Promise.all(l).then(()=>{gt.update(()=>{r&&function(t,e){const n=Bs(t,e);let{transitionEnd:i={},transition:s={},...o}=n||{};o={...o,...i};for(const e in o)Is(t,e,$s(o[e]))}(t,r)})}),l}function Zs(t,e,n={}){const i=Bs(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(_s(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(i=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=s;return function(t,e,n=0,i=0,s=1,o){const r=[],a=(t.variantChildren.size-1)*i,l=1===s?(t=0)=>t*i:(t=0)=>a-t*i;return Array.from(t.variantChildren).sort(Js).forEach((t,i)=>{t.notify("AnimationStart",e),r.push(Zs(t,e,{...o,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,o+i,r,a,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(()=>e())}return Promise.all([o(),r(n.delay)])}function Js(t,e){return t.sortNodePosition(e)}function Qs(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const to=qi.length;function eo(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&eo(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<to;n++){const i=qi[n],s=t.props[i];(Xi(s)||!1===s)&&(e[i]=s)}return e}const no=[...Ki].reverse(),io=Ki.length;function so(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let i;if(t.notify("AnimationStart",e),Array.isArray(e)){const s=e.map(e=>Zs(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=Zs(t,e,n);else{const s="function"==typeof e?Bs(t,e,n.custom):e;i=Promise.all(_s(t,s,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function oo(t){let e=so(t),n=lo(),i=!0;const s=e=>(n,i)=>{const s=Bs(t,i,"exit"===e?t.presenceContext?.custom:void 0);if(s){const{transition:t,transitionEnd:e,...i}=s;n={...n,...i,...e}}return n};function o(o){const{props:r}=t,a=eo(t.parent)||{},l=[],c=new Set;let u={},h=1/0;for(let e=0;e<io;e++){const d=no[e],p=n[d],m=void 0!==r[d]?r[d]:a[d],f=Xi(m),g=d===o?p.isActive:null;!1===g&&(h=e);let y=m===a[d]&&m!==r[d]&&f;if(y&&i&&t.manuallyAnimateOnMount&&(y=!1),p.protectedKeys={...u},!p.isActive&&null===g||!m&&!p.prevProp||Yi(m)||"boolean"==typeof m)continue;const v=ro(p.prevProp,m);let x=v||d===o&&p.isActive&&!y&&f||e>h&&f,b=!1;const w=Array.isArray(m)?m:[m];let T=w.reduce(s(d),{});!1===g&&(T={});const{prevResolvedValues:P={}}=p,S={...P,...T},E=e=>{x=!0,c.has(e)&&(b=!0,c.delete(e)),p.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in S){const e=T[t],n=P[t];if(u.hasOwnProperty(t))continue;let i=!1;i=Fs(e)&&Fs(n)?!Qs(e,n):e!==n,i?null!=e?E(t):c.add(t):void 0!==e&&c.has(t)?E(t):p.protectedKeys[t]=!0}p.prevProp=m,p.prevResolvedValues=T,p.isActive&&(u={...u,...T}),i&&t.blockInitialAnimation&&(x=!1);x&&(!(y&&v)||b)&&l.push(...w.map(t=>({animation:t,options:{type:d}})))}if(c.size){const e={};if("boolean"!=typeof r.initial){const n=Bs(t,Array.isArray(r.initial)?r.initial[0]:r.initial);n&&n.transition&&(e.transition=n.transition)}c.forEach(n=>{const i=t.getBaseTarget(n),s=t.getValue(n);s&&(s.liveStyle=!0),e[n]=i??null}),l.push({animation:e})}let d=Boolean(l.length);return!i||!1!==r.initial&&r.initial!==r.animate||t.manuallyAnimateOnMount||(d=!1),i=!1,d?e(l):Promise.resolve()}return{animateChanges:o,setActive:function(e,i){if(n[e].isActive===i)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,i)),n[e].isActive=i;const s=o(e);for(const t in n)n[t].protectedKeys={};return s},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=lo(),i=!0}}}function ro(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Qs(e,t)}function ao(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function lo(){return{animate:ao(!0),whileInView:ao(),whileHover:ao(),whileTap:ao(),whileDrag:ao(),whileFocus:ao(),exit:ao()}}class co{constructor(t){this.isMounted=!1,this.node=t}update(){}}let uo=0;const ho={animation:{Feature:class extends co{constructor(t){super(t),t.animationState||(t.animationState=oo(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Yi(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends co{constructor(){super(...arguments),this.id=uo++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const i=this.node.animationState.setActive("exit",!t);e&&!t&&i.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function po(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function mo(t){return{point:{x:t.pageX,y:t.pageY}}}function fo(t,e,n,i){return po(t,e,(t=>e=>yi(e)&&t(e,mo(e)))(n),i)}function go({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function yo(t){return t.max-t.min}function vo(t,e,n,i=.5){t.origin=i,t.originPoint=oe(e.min,e.max,t.origin),t.scale=yo(n)/yo(e),t.translate=oe(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function xo(t,e,n,i){vo(t.x,e.x,n.x,i?i.originX:void 0),vo(t.y,e.y,n.y,i?i.originY:void 0)}function bo(t,e,n){t.min=n.min+e.min,t.max=t.min+yo(e)}function wo(t,e,n){t.min=e.min-n.min,t.max=t.min+yo(e)}function To(t,e,n){wo(t.x,e.x,n.x),wo(t.y,e.y,n.y)}const Po=()=>({x:{min:0,max:0},y:{min:0,max:0}});function So(t){return[t("x"),t("y")]}function Eo(t){return void 0===t||1===t}function Ao({scale:t,scaleX:e,scaleY:n}){return!Eo(t)||!Eo(e)||!Eo(n)}function Co(t){return Ao(t)||jo(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function jo(t){return ko(t.x)||ko(t.y)}function ko(t){return t&&"0%"!==t}function Mo(t,e,n){return n+e*(t-n)}function Vo(t,e,n,i,s){return void 0!==s&&(t=Mo(t,s,i)),Mo(t,n,i)+e}function Do(t,e=0,n=1,i,s){t.min=Vo(t.min,e,n,i,s),t.max=Vo(t.max,e,n,i,s)}function Ro(t,{x:e,y:n}){Do(t.x,e.translate,e.scale,e.originPoint),Do(t.y,n.translate,n.scale,n.originPoint)}const Lo=.999999999999,No=1.0000000000001;function Oo(t,e){t.min=t.min+e,t.max=t.max+e}function Bo(t,e,n,i,s=.5){Do(t,e,n,oe(t.min,t.max,s),i)}function Fo(t,e){Bo(t.x,e.x,e.scaleX,e.scale,e.originX),Bo(t.y,e.y,e.scaleY,e.scale,e.originY)}function Io(t,e){return go(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}(t.getBoundingClientRect(),e))}const $o=({current:t})=>t?t.ownerDocument.defaultView:null,Uo=(t,e)=>Math.abs(t-e);class Wo{constructor(t,e,{transformPagePoint:n,contextWindow:i,dragSnapToOrigin:s=!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 t=Yo(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Uo(t.x,e.x),i=Uo(t.y,e.y);return Math.sqrt(n**2+i**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:i}=t,{timestamp:s}=vt;this.history.push({...i,timestamp:s});const{onStart:o,onMove:r}=this.handlers;e||(o&&o(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),r&&r(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=zo(e,this.transformPagePoint),gt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:i,resumeAnimation:s}=this.handlers;if(this.dragSnapToOrigin&&s&&s(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const o=Yo("pointercancel"===t.type?this.lastMoveEventInfo:zo(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),i&&i(t,o)},!yi(t))return;this.dragSnapToOrigin=s,this.handlers=e,this.transformPagePoint=n,this.contextWindow=i||window;const o=zo(mo(t),this.transformPagePoint),{point:r}=o,{timestamp:a}=vt;this.history=[{...r,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,Yo(o,this.history)),this.removeListeners=W(fo(this.contextWindow,"pointermove",this.handlePointerMove),fo(this.contextWindow,"pointerup",this.handlePointerUp),fo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),yt(this.updatePoint)}}function zo(t,e){return e?{point:e(t.point)}:t}function Ho(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Yo({point:t},e){return{point:t,delta:Ho(t,Ko(e)),offset:Ho(t,Xo(e)),velocity:qo(e,.1)}}function Xo(t){return t[0]}function Ko(t){return t[t.length-1]}function qo(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=Ko(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>Y(e)));)n--;if(!i)return{x:0,y:0};const o=X(s.timestamp-i.timestamp);if(0===o)return{x:0,y:0};const r={x:(s.x-i.x)/o,y:(s.y-i.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function Go(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function _o(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}const Zo=.35;function Jo(t,e,n){return{min:Qo(t,e),max:Qo(t,n)}}function Qo(t,e){return"number"==typeof t?t:t[e]||0}const tr=new WeakMap;class er{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={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:i}=this.getProps();this.panSession=new Wo(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(mo(t).point)},onStart:(t,e)=>{const{drag:n,dragPropagation:i,onDragStart:s}=this.getProps();if(n&&!i&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(o=n)||"y"===o?di[o]?null:(di[o]=!0,()=>{di[o]=!1}):di.x||di.y?null:(di.x=di.y=!0,()=>{di.x=di.y=!1}),!this.openDragLock))return;var o;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),So(t=>{let e=this.getAxisMotionValue(t).get()||0;if(Ut.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const i=n.layout.layoutBox[t];if(i){e=yo(i)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),s&&gt.postRender(()=>s(t,e)),Us(this.visualElement,"transform");const{animationState:r}=this.visualElement;r&&r.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:r}=e;if(i&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(r),void(null!==this.currentDirection&&s&&s(this.currentDirection));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),o&&o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>So(t=>"paused"===this.getAnimationState(t)&&this.getAxisMotionValue(t).animation?.play())},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:i,contextWindow:$o(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&gt.postRender(()=>s(t,e))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!nr(t,i,this.currentDirection))return;const s=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},i){return void 0!==e&&t<e?t=i?oe(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?oe(n,t,i.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,i=this.constraints;t&&ts(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:Go(t.x,n,s),y:Go(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=Zo){return!1===t?t=0:!0===t&&(t=Zo),{x:Jo(t,"left","right"),y:Jo(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&So(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!ts(t))return!1;const n=t.current;L(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=Io(t,n),{scroll:s}=e;return s&&(Oo(i.x,s.offset.x),Oo(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:_o(t.x,e.x),y:_o(t.y,e.y)}}(i.layout.layoutBox,s);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(o));this.hasMutatedConstraints=!!t,t&&(o=go(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=So(r=>{if(!nr(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const c=i?200:1e6,u=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...s,...l};return this.startAxisValueAnimation(r,h)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return Us(this.visualElement,t),n.start(qs(t,n,0,e,this.visualElement,!1))}stopAnimation(){So(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){So(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),i=n[e];return i||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){So(e=>{const{drag:n}=this.getProps();if(!nr(e,n,this.currentDirection))return;const{projection:i}=this.visualElement,s=this.getAxisMotionValue(e);if(i&&i.layout){const{min:n,max:o}=i.layout.layoutBox[e];s.set(t[e]-oe(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!ts(e)||!n||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};So(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();i[t]=function(t,e){let n=.5;const i=yo(t),s=yo(e);return s>i?n=z(e.min,e.max-i,t.min):i>s&&(n=z(t.min,t.max-s,e.min)),D(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),So(e=>{if(!nr(e,t,null))return;const n=this.getAxisMotionValue(e),{min:s,max:o}=this.constraints[e];n.set(oe(s,o,i[e]))})}addListeners(){if(!this.visualElement.current)return;tr.set(this.visualElement,this);const t=fo(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();ts(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,i=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),gt.read(e);const s=po(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(So(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{s(),t(),i(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Zo,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function nr(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const ir=t=>(e,n)=>{t&&gt.postRender(()=>t(e,n))};const sr={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function or(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const rr={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!Wt.test(t))return t;t=parseFloat(t)}return`${or(t,e.target.x)}% ${or(t,e.target.y)}%`}},ar={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=ne.parse(t);if(s.length>5)return i;const o=ne.createTransformer(t),r="number"!=typeof s[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+r]/=a,s[1+r]/=l;const c=oe(a,l,.5);return"number"==typeof s[2+r]&&(s[2+r]/=c),"number"==typeof s[3+r]&&(s[3+r]/=c),o(s)}};class lr extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;!function(t){for(const e in t)cs[e]=t[e],St(e)&&(cs[e].isCSSVariable=!0)}(ur),s&&(e.group&&e.group.add(s),n&&n.register&&i&&n.register(s),s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),sr.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,{projection:o}=n;return o?(o.isPresent=s,i||t.layoutDependency!==e||void 0===e||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||gt.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ui.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function cr(n){const[i,s]=Di(),o=e.useContext(E);return t.jsx(lr,{...n,layoutGroup:o,switchLayoutGroup:e.useContext(ss),isPresent:i,safeToRemove:s})}const ur={borderRadius:{...rr,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:rr,borderTopRightRadius:rr,borderBottomLeftRadius:rr,borderBottomRightRadius:rr,boxShadow:ar};const hr=(t,e)=>t.depth-e.depth;class dr{constructor(){this.children=[],this.isDirty=!1}add(t){M(this.children,t),this.isDirty=!0}remove(t){V(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(hr),this.isDirty=!1,this.children.forEach(t)}}const pr=["TopLeft","TopRight","BottomLeft","BottomRight"],mr=pr.length,fr=t=>"string"==typeof t?parseFloat(t):t,gr=t=>"number"==typeof t||Wt.test(t);function yr(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const vr=br(0,.5,ot),xr=br(.5,.95,$);function br(t,e,n){return i=>i<t?0:i>e?1:n(z(t,e,i))}function wr(t,e){t.min=e.min,t.max=e.max}function Tr(t,e){wr(t.x,e.x),wr(t.y,e.y)}function Pr(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Sr(t,e,n,i,s){return t=Mo(t-=e,1/n,i),void 0!==s&&(t=Mo(t,1/s,i)),t}function Er(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){Ut.test(e)&&(e=parseFloat(e),e=oe(r.min,r.max,e/100)-r.min);if("number"!=typeof e)return;let a=oe(o.min,o.max,i);t===o&&(a-=e),t.min=Sr(t.min,e,n,a,s),t.max=Sr(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const Ar=["x","scaleX","originX"],Cr=["y","scaleY","originY"];function jr(t,e,n,i){Er(t.x,e,Ar,n?n.x:void 0,i?i.x:void 0),Er(t.y,e,Cr,n?n.y:void 0,i?i.y:void 0)}function kr(t){return 0===t.translate&&1===t.scale}function Mr(t){return kr(t.x)&&kr(t.y)}function Vr(t,e){return t.min===e.min&&t.max===e.max}function Dr(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Rr(t,e){return Dr(t.x,e.x)&&Dr(t.y,e.y)}function Lr(t){return yo(t.x)/yo(t.y)}function Nr(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Or{constructor(){this.members=[]}add(t){M(this.members,t),t.scheduleRender()}remove(t){if(V(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:i}=t.options;!1===i&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Br=["","X","Y","Z"],Fr={visibility:"hidden"};let Ir=0;function $r(t,e,n,i){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),i&&(i[t]=0))}function Ur(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Ws(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",gt,!(e||i))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&Ur(i)}function Wr({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t={},n=e?.()){this.id=Ir++,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(Yr),this.nodes.forEach(Jr),this.nodes.forEach(Qr),this.nodes.forEach(Xr)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new dr)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new H),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;var n;this.isSVG=Si(e)&&!(Si(n=e)&&"svg"===n.tagName),this.instance=e;const{layoutId:i,layout:s,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(s||i)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=Tt.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(yt(i),t(o-e))};return gt.setup(i,!0),()=>yt(i)}(i,250),sr.hasAnimatedSinceResize&&(sr.hasAnimatedSinceResize=!1,this.nodes.forEach(Zr))})}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&o&&(i||s)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:i})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const s=this.options.transition||o.getDefaultTransition()||oa,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Rr(this.targetLayout,i),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Hn(s,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c)}else e||Zr(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=i})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),yt(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(ta),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Ur(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const i=this.getTransformTemplate();this.prevTransformTemplateValue=i?i(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(qr);this.isUpdating||this.nodes.forEach(Gr),this.isUpdating=!1,this.nodes.forEach(_r),this.nodes.forEach(zr),this.nodes.forEach(Hr),this.clearAllSnapshots();const t=Tt.now();vt.delta=D(0,1e3/60,t-vt.timestamp),vt.timestamp=t,vt.isProcessing=!0,xt.update.process(vt),xt.preRender.process(vt),xt.render.process(vt),vt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ui.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Kr),this.sharedNodes.forEach(ea)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,gt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){gt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||yo(this.snapshot.measuredBox.x)||yo(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=i(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!s)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!Mr(this.projectionDelta),n=this.getTransformTemplate(),i=n?n(this.latestValues,""):void 0,o=i!==this.prevTransformTemplateValue;t&&this.instance&&(e||Co(this.latestValues)||o)&&(s(this.instance,i),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var i;return t&&(n=this.removeTransform(n)),la((i=n).x),la(i.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(ua))){const{scroll:t}=this.root;t&&(Oo(e.x,t.offset.x),Oo(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(Tr(e,t),this.scroll?.wasRoot)return e;for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:s,options:o}=i;i!==this.root&&s&&o.layoutScroll&&(s.wasRoot&&Tr(e,t),Oo(e.x,s.offset.x),Oo(e.y,s.offset.y))}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Tr(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];!e&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Fo(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),Co(i.latestValues)&&Fo(n,i.latestValues)}return Co(this.latestValues)&&Fo(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Tr(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!Co(n.latestValues))continue;Ao(n.latestValues)&&n.updateSnapshot();const i=Po();Tr(i,n.measurePageBox()),jr(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,i)}return Co(this.latestValues)&&jr(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==vt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==e;if(!(t||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:i,layoutId:s}=this.options;if(this.layout&&(i||s)){if(this.resolvedRelativeTargetAt=vt.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},To(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Tr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var o,r,a;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),o=this.target,r=this.relativeTarget,a=this.relativeParent.target,bo(o.x,r.x,a.x),bo(o.y,r.y,a.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Tr(this.target,this.layout.layoutBox),Ro(this.target,this.targetDelta)):Tr(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},To(this.relativeTargetOrigin,this.target,t.target),Tr(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Ao(this.parent.latestValues)&&!jo(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===vt.timestamp&&(n=!1),n)return;const{layout:i,layoutId:s}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!i&&!s)return;Tr(this.layoutCorrected,this.layout.layoutBox);const o=this.treeScale.x,r=this.treeScale.y;!function(t,e,n,i=!1){const s=n.length;if(!s)return;let o,r;e.x=e.y=1;for(let a=0;a<s;a++){o=n[a],r=o.projectionDelta;const{visualElement:s}=o.options;s&&s.props.style&&"contents"===s.props.style.display||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Fo(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,Ro(t,r)),i&&Co(o.latestValues)&&Fo(t,o.latestValues))}e.x<No&&e.x>Lo&&(e.x=1),e.y<No&&e.y>Lo&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(Pr(this.prevProjectionDelta.x,this.projectionDelta.x),Pr(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),xo(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===o&&this.treeScale.y===r&&Nr(this.projectionDelta.x,this.prevProjectionDelta.x)&&Nr(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const n=this.snapshot,i=n?n.latestValues:{},s={...this.latestValues},o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const r={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(sa));let h;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,p,m,f,g;na(o.x,t.x,n),na(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(To(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=r,g=n,ia(p.x,m.x,f.x,g),ia(p.y,m.y,f.y,g),h&&(l=this.relativeTarget,d=h,Vr(l.x,d.x)&&Vr(l.y,d.y))&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),Tr(h,this.relativeTarget)),a&&(this.animationValues=s,function(t,e,n,i,s,o){s?(t.opacity=oe(0,n.opacity??1,vr(i)),t.opacityExit=oe(e.opacity??1,0,xr(i))):o&&(t.opacity=oe(e.opacity??1,n.opacity??1,i));for(let s=0;s<mr;s++){const o=`border${pr[s]}Radius`;let r=yr(e,o),a=yr(n,o);void 0===r&&void 0===a||(r||(r=0),a||(a=0),0===r||0===a||gr(r)===gr(a)?(t[o]=Math.max(oe(fr(r),fr(a),i),0),(Ut.test(a)||Ut.test(r))&&(t[o]+="%")):t[o]=a)}(e.rotate||n.rotate)&&(t.rotate=oe(e.rotate||0,n.rotate||0,i))}(s,i,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(yt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=gt.update(()=>{sr.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=ci(0)),this.currentAnimation=function(t,e,n){const i=Ei(t)?t:ci(t);return i.start(qs("",i,e,n)),i.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},onComplete:()=>{t.onComplete&&t.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 t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:i,latestValues:s}=t;if(e&&n&&i){if(this!==t&&this.layout&&i&&ca(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=yo(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=yo(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Tr(e,n),Fo(e,s),xo(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Or);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const i=this.getStack();i&&i.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const i={};n.z&&$r("z",t,i,this.animationValues);for(let e=0;e<Br.length;e++)$r(`rotate${Br[e]}`,t,i,this.animationValues),$r(`skew${Br[e]}`,t,i,this.animationValues);t.render();for(const e in i)t.setStaticValue(e,i[e]),this.animationValues&&(this.animationValues[e]=i[e]);t.scheduleRender()}getProjectionStyles(t){if(!this.instance||this.isSVG)return;if(!this.isVisible)return Fr;const e={visibility:""},n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,e.opacity="",e.pointerEvents=ks(t?.pointerEvents)||"",e.transform=n?n(this.latestValues,""):"none",e;const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=ks(t?.pointerEvents)||""),this.hasProjected&&!Co(this.latestValues)&&(e.transform=n?n({},""):"none",this.hasProjected=!1),e}const s=i.animationValues||i.latestValues;this.applyTransformsToTarget(),e.transform=function(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y,r=n?.z||0;if((s||o||r)&&(i=`translate3d(${s}px, ${o}px, ${r}px) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:s,rotateY:o,skewX:r,skewY:a}=n;t&&(i=`perspective(${t}px) ${i}`),e&&(i+=`rotate(${e}deg) `),s&&(i+=`rotateX(${s}deg) `),o&&(i+=`rotateY(${o}deg) `),r&&(i+=`skewX(${r}deg) `),a&&(i+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(i+=`scale(${a}, ${l})`),i||"none"}(this.projectionDeltaWithTransform,this.treeScale,s),n&&(e.transform=n(s,e.transform));const{x:o,y:r}=this.projectionDelta;e.transformOrigin=`${100*o.origin}% ${100*r.origin}% 0`,i.animationValues?e.opacity=i===this?s.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:e.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const t in cs){if(void 0===s[t])continue;const{correct:n,applyTo:o,isCSSVariable:r}=cs[t],a="none"===e.transform?s[t]:n(s[t],i);if(o){const t=o.length;for(let n=0;n<t;n++)e[o[n]]=a}else r?this.options.visualElement.renderState.vars[t]=a:e[t]=a}return this.options.layoutId&&(e.pointerEvents=i===this?ks(t?.pointerEvents)||"":"none"),e}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(qr),this.root.sharedNodes.clear()}}}function zr(t){t.updateLayout()}function Hr(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:s}=t.options,o=e.source!==t.layout.source;"size"===s?So(t=>{const i=o?e.measuredBox[t]:e.layoutBox[t],s=yo(i);i.min=n[t].min,i.max=i.min+s}):ca(s,e.layoutBox,n)&&So(i=>{const s=o?e.measuredBox[i]:e.layoutBox[i],r=yo(n[i]);s.max=s.min+r,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[i].max=t.relativeTarget[i].min+r)});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};xo(r,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?xo(a,t.applyTransform(i,!0),e.measuredBox):xo(a,n,e.layoutBox);const l=!Mr(r);let c=!1;if(!t.resumeFrom){const i=t.getClosestProjectingParent();if(i&&!i.resumeFrom){const{snapshot:s,layout:o}=i;if(s&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};To(r,e.layoutBox,s.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};To(a,n,o.layoutBox),Rr(r,a)||(c=!0),i.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=i)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Yr(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Xr(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Kr(t){t.clearSnapshot()}function qr(t){t.clearMeasurements()}function Gr(t){t.isLayoutDirty=!1}function _r(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Zr(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Jr(t){t.resolveTargetDelta()}function Qr(t){t.calcProjection()}function ta(t){t.resetSkewAndRotation()}function ea(t){t.removeLeadSnapshot()}function na(t,e,n){t.translate=oe(e.translate,0,n),t.scale=oe(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ia(t,e,n,i){t.min=oe(e.min,n.min,i),t.max=oe(e.max,n.max,i)}function sa(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const oa={duration:.45,ease:[.4,0,.1,1]},ra=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),aa=ra("applewebkit/")&&!ra("chrome/")?Math.round:$;function la(t){t.min=aa(t.min),t.max=aa(t.max)}function ca(t,e,n){return"position"===t||"preserve-aspect"===t&&(i=Lr(e),s=Lr(n),o=.2,!(Math.abs(i-s)<=o));var i,s,o}function ua(t){return t!==t.root&&t.scroll?.wasRoot}const ha=Wr({attachResizeListener:(t,e)=>po(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),da={current:void 0},pa=Wr({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!da.current){const t=new ha({});t.mount(window),t.setOptions({layoutScroll:!0}),da.current=t}return da.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ma={pan:{Feature:class extends co{constructor(){super(...arguments),this.removePointerDownListener=$}onPointerDown(t){this.session=new Wo(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$o(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:ir(t),onStart:ir(e),onMove:n,onEnd:(t,e)=>{delete this.session,i&&gt.postRender(()=>i(t,e))}}}mount(){this.removePointerDownListener=fo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends co{constructor(t){super(t),this.removeGroupControls=$,this.removeListeners=$,this.controls=new er(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||$}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:pa,MeasureLayout:cr}};function fa(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover","Start"===n);const s=i["onHover"+n];s&&gt.postRender(()=>s(e,mo(e)))}function ga(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap","Start"===n);const s=i["onTap"+("End"===n?"":n)];s&&gt.postRender(()=>s(e,mo(e)))}const ya=new WeakMap,va=new WeakMap,xa=t=>{const e=ya.get(t.target);e&&e(t)},ba=t=>{t.forEach(xa)};function wa(t,e,n){const i=function({root:t,...e}){const n=t||document;va.has(n)||va.set(n,{});const i=va.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(ba,{root:t,...e})),i[s]}(e);return ya.set(t,n),i.observe(t),()=>{ya.delete(t),i.unobserve(t)}}const Ta={some:0,all:1};const Pa={inView:{Feature:class extends co{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:i="some",once:s}=t,o={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof i?i:Ta[i]};return wa(this.node.current,o,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,s&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:i}=this.node.getProps(),o=e?n:i;o&&o(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends co{mount(){const{current:t}=this.node;t&&(this.unmount=Pi(t,(t,e)=>(ga(this.node,e,"Start"),(t,{success:e})=>ga(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends co{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){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=W(po(this.node.current,"focus",()=>this.onFocus()),po(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends co{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[i,s,o]=mi(t,n),r=t=>{if(!fi(t))return;const{target:n}=t,i=e(n,t);if("function"!=typeof i||!n)return;const o=t=>{fi(t)&&(i(t),n.removeEventListener("pointerleave",o))};n.addEventListener("pointerleave",o,s)};return i.forEach(t=>{t.addEventListener("pointerenter",r,s)}),o}(t,(t,e)=>(fa(this.node,e,"Start"),t=>fa(this.node,t,"End"))))}unmount(){}}}},Sa={layout:{ProjectionNode:pa,MeasureLayout:cr}},Ea={current:null},Aa={current:!1};const Ca=new WeakMap;const ja=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ka{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:i,blockInitialAnimation:s,visualState:o},r={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Pn,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 t=Tt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,gt.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=o;this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=r,this.blockInitialAnimation=Boolean(s),this.isControllingVariants=Gi(e),this.isVariantNode=_i(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in u){const e=u[t];void 0!==a[t]&&Ei(e)&&e.set(a[t],!1)}}mount(t){this.current=t,Ca.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((t,e)=>this.bindToMotionValue(e,t)),Aa.current||function(){if(Aa.current=!0,C)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ea.current=t.matches;t.addListener(e),e()}else Ea.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Ea.current),"production"!==process.env.NODE_ENV&&G(!0!==this.shouldReduceMotion,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),yt(this.notifyUpdate),yt(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 e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=dn.has(t);n&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&gt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),s(),o&&o(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in Fi){const e=Fi[t];if(!e)continue;const{isEnabled:n,Feature:i}=e;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<ja.length;e++){const n=ja[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const i=t["on"+n];i&&(this.propEventSubscriptions[n]=this.on(n,i))}this.prevMotionValues=function(t,e,n){for(const i in e){const s=e[i],o=n[i];if(Ei(s))t.addValue(i,s);else if(Ei(o))t.addValue(i,ci(s,{owner:t}));else if(o!==s)if(t.hasValue(i)){const e=t.getValue(i);!0===e.liveStyle?e.jump(s):e.hasAnimated||e.set(s)}else{const e=t.getStaticValue(i);t.addValue(i,ci(void 0!==e?e:s,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=ci(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var i;return null!=n&&("string"==typeof n&&(O(n)||F(n))?n=parseFloat(n):(i=n,!Ai.find(Xn(i))&&ne.test(e)&&(n=si(t,e))),this.setBaseTarget(t,Ei(n)?n.get():n)),Ei(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const i=js(this.props,e,this.presenceContext?.custom);i&&(n=i[t])}if(e&&void 0!==n)return n;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||Ei(i)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new H),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class Ma extends ka{constructor(){super(...arguments),this.KeyframeResolver=ri}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ei(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Va(t,{style:e,vars:n},i,s){Object.assign(t.style,e,s&&s.getProjectionStyles(i));for(const e in n)t.style.setProperty(e,n[e])}class Da extends Ma{constructor(){super(...arguments),this.type="html",this.renderInstance=Va}readValueFromInstance(t,e){if(dn.has(e))return this.projection?.isProjecting?ln(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return cn(n,e)})(t,e);{const i=(n=t,window.getComputedStyle(n)),s=(St(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return Io(t,e)}build(t,e,n){ps(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Ds(t,e,n)}}const Ra=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"]);class La extends Ma{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Po}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(dn.has(e)){const t=ii(e);return t&&t.default||0}return e=Ra.has(e)?e:ns(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Ls(t,e,n)}build(t,e,n){bs(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,i){!function(t,e,n,i){Va(t,e,void 0,i);for(const n in e.attrs)t.setAttribute(Ra.has(n)?n:ns(n),e.attrs[n])}(t,e,0,i)}mount(t){this.isSVGTag=Ts(t.tagName),super.mount(t)}}const Na=zi(Os({...ho,...Pa,...ma,...Sa},(t,n)=>Es(t)?new La(n):new Da(n,{allowProjection:t!==e.Fragment})));function Oa(t,e,n,i){return new(n||(n=Promise))(function(s,o){function r(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?s(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(r,a)}l((i=i.apply(t,e||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const Ba=t=>{if("85"===t)return"/back85";if("87"===t)return"/back87";if("undefined"!=typeof window){if(window.location.hostname.toLowerCase().includes("seguimiento"))return"/back85"}return"/back87"},Fa=(t,e)=>Oa(void 0,void 0,void 0,function*(){const n=`${Ba(t)}/student/downloadExcel/${e||"PASS"}`;return(yield i.get(n,{responseType:"blob"})).data}),Ia=(t,e,n)=>Oa(void 0,void 0,void 0,function*(){const s=`${Ba(e)}/student/uploadExcel`,o=new FormData;o.append("receivedExcelFile",t),"85"===e&&n&&o.append("clientName",n);return(yield i.post(s,o,{transformRequest:[t=>t]})).data});var $a,Ua,Wa;!function(t){t.LEFT="left",t.CENTER="center",t.RIGHT="right"}($a||($a={})),function(t){t.EVEN="even",t.ODD="odd",t.HOVER="hover"}(Ua||(Ua={})),function(t){t.SM="sm",t.MD="md",t.LG="lg"}(Wa||(Wa={}));const za=t=>{switch(t){case $a.CENTER:return"text-center";case $a.RIGHT:return"text-right";default:return"text-left"}},Ha=t=>{switch(t){case Wa.SM:return{header:"px-2 py-2 text-xs",cell:"px-2 py-2 text-xs",table:"text-xs"};case Wa.LG:return{header:"px-6 py-4 text-base",cell:"px-6 py-4 text-base",table:"text-base"};default:return{header:"px-3 md:px-6 py-3 text-sm",cell:"px-3 md:px-6 py-4 text-sm",table:"text-sm"}}},Ya=t=>t%2==0?"bg-white":"bg-gray-50",Xa=({columns:e,size:n,hasActions:i})=>{const s=Ha(n);return t.jsx("thead",{className:"text-xs text-gray-700 uppercase bg-gray-50 sticky top-0 z-10",children:t.jsxs("tr",{children:[e.map(e=>t.jsx("th",{className:`${s.header} ${za(e.alignment)} ${e.className||""}`,style:e.width?{width:e.width}:void 0,children:e.header},e.key)),i&&t.jsx("th",{className:`${s.header} text-center sticky right-0 bg-gray-50`,children:"ACCIONES"})]})})},Ka=({columns:e,data:n,renderActions:i,size:s,onRowClick:o})=>{const r=Ha(s);return t.jsx("tbody",{children:n.map((n,s)=>t.jsxs("tr",{className:`${Ya(s)} hover:bg-gray-100 transition-colors duration-150 ${o?"cursor-pointer":""}`,onClick:()=>null==o?void 0:o(n),children:[e.map(e=>t.jsx("td",{className:`${r.cell} ${za(e.alignment)} ${e.className||""}`,children:e.accessor(n)},e.key)),i&&t.jsx("td",{className:`${r.cell} text-center sticky right-0 ${Ya(s)} shadow-[-2px_0_4px_rgba(0,0,0,0.1)]`,children:i(n)})]},s))})};exports.Button=r,exports.DownloadStudentsExcelButton=({backend:i,label:s="Descargar Lista de Estudiantes en Excel",fileName:o="students.xlsx",className:a,variant:l="primary",clientName:c,onSuccess:u,onError:h})=>{const[d,p]=e.useState(!1);return t.jsx(r,{variant:l,onClick:()=>Oa(void 0,void 0,void 0,function*(){var t,e,s,r,a,l,d;try{p(!0);let t=c;if("85"===i&&!t){const{value:e}=yield n.fire({title:"Cliente requerido",text:"Ingrese el nombre del cliente:",input:"text",inputPlaceholder:"Ej: GIMNASIO FEMENINO",showCancelButton:!0,confirmButtonText:"Continuar",cancelButtonText:"Cancelar",inputValidator:t=>{if(!t||""===t.trim())return"El nombre del cliente es requerido"}});if(!e)return void p(!1);t=e}const e=yield Fa(i,t),s=URL.createObjectURL(e),r=document.createElement("a");r.href=s,r.download=o,document.body.appendChild(r),r.click(),r.remove(),URL.revokeObjectURL(s),yield n.fire({title:"¡Descarga exitosa!",text:"El archivo se ha descargado correctamente",icon:"success",confirmButtonText:"OK"}),null==u||u()}catch(i){console.error("Download students excel failed",i);let o="No se pudo descargar el archivo. Por favor, inténtelo nuevamente.";const c=i;o=null!==(d=null!==(a=null!==(s=null===(e=null===(t=null==c?void 0:c.response)||void 0===t?void 0:t.data)||void 0===e?void 0:e.message)&&void 0!==s?s:"string"==typeof(null===(r=null==c?void 0:c.response)||void 0===r?void 0:r.data)?c.response.data:void 0)&&void 0!==a?a:(null===(l=null==c?void 0:c.response)||void 0===l?void 0:l.statusText)?`Error ${c.response.status}: ${c.response.statusText}`:void 0)&&void 0!==d?d:o,yield n.fire({title:"Error en la descarga",text:o,icon:"error",confirmButtonText:"OK"}),null==h||h(i)}finally{p(!1)}}),className:a,children:d?"Descargando...":s})},exports.GenericTable=({columns:n,data:i,renderActions:s,size:o=Wa.MD,className:r="",onRowClick:a,isLoading:l=!1,emptyMessage:c="No hay datos disponibles"})=>{const u=e.useRef(null),{visibleData:h}=((t,n)=>{const[i,s]=e.useState(t);return e.useEffect(()=>{const e=()=>{if(!n.current)return;const e=n.current.getBoundingClientRect(),i=window.innerHeight-e.top-100,o=Math.max(1,Math.floor(i/60));s(t.slice(0,o))};e();const i=()=>{e()};window.addEventListener("resize",i);const o=new ResizeObserver(e);return n.current&&o.observe(n.current),()=>{window.removeEventListener("resize",i),o.disconnect()}},[t,n]),{visibleData:i}})(i,u);return l?t.jsx("div",{className:"w-full shadow-md sm:rounded-lg bg-white",children:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx("div",{"data-testid":"loading-spinner",className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})})}):0===i.length?t.jsx("div",{className:"w-full shadow-md sm:rounded-lg bg-white",children:t.jsx("div",{className:"text-center py-8",children:t.jsx("p",{className:"text-gray-500",children:c})})}):t.jsx("div",{ref:u,className:`w-full shadow-md sm:rounded-lg bg-white ${r}`,children:t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-left text-gray-500",style:{minWidth:"max-content"},children:[t.jsx(Xa,{columns:n,size:o,hasActions:!!s}),t.jsx(Ka,{columns:n,data:h,renderActions:s,size:o,onRowClick:a})]})})})},exports.Header=({title:e,description:n,logoUrl:i,logoAlt:s="Logo",systemName:o="PASS",systemSubtitle:r="Sistema Escolar",onMenuToggle:a,showPageInfo:l=!0,className:c="flex flex-col sm:flex-row sm:items-end bg-primary-botech text-white p-3 sm:p-4 shadow-lg gap-3 sm:gap-0 justify-between",logoClassName:u="h-8 sm:h-10 object-contain",titleClassName:h="text-lg sm:text-xl font-bold",descriptionClassName:d="text-xs sm:text-sm opacity-80"})=>t.jsxs("div",{className:c,children:[t.jsxs("div",{className:"flex items-center gap-3 sm:gap-4",children:[t.jsx("button",{onClick:a,className:"p-2 rounded-lg hover:bg-primary-botech-600 transition-colors focus:outline-none focus:ring-2 focus:ring-white focus:ring-opacity-20 flex-shrink-0","aria-label":"Abrir menú",children:t.jsx(T,{className:"w-5 h-5 sm:w-6 sm:h-6"})}),t.jsxs("div",{className:"flex items-center min-w-0 flex-1",children:[t.jsx("div",{className:"flex items-center justify-center mr-2 sm:mr-3 flex-shrink-0",children:i?t.jsx("img",{src:i,alt:s,className:u}):t.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 bg-white bg-opacity-20 rounded-lg flex items-center justify-center border border-white border-opacity-30",children:t.jsx("span",{className:"text-white font-bold text-sm sm:text-lg",children:o.charAt(0)})})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("h1",{className:h,children:o}),t.jsx("p",{className:d,children:r})]})]})]}),l&&t.jsxs("div",{className:"text-left sm:text-right pt-2 sm:border-t-0 sm:pt-0",children:[t.jsx("h2",{className:"text-base sm:text-lg font-semibold",children:e}),t.jsx("p",{className:"text-xs sm:text-sm leading-tight opacity-80 truncate",children:n})]})]}),exports.IconButton=({leftIcon:e,rightIcon:n,children:i,onClick:s,className:o="",variant:r="primary",size:a="md",disabled:l=!1})=>{const c={primary:l?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-primary-botech hover:bg-primary-botech-400 text-white cursor-pointer",secondary:l?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-800 cursor-pointer",danger:l?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-red-500 hover:bg-red-600 text-white cursor-pointer"};return t.jsxs("button",{type:"button",className:`inline-flex items-center gap-2 rounded font-medium transition-colors duration-300 ease-in-out ${{sm:"px-3 py-1.5 text-sm",md:"px-4 py-2",lg:"px-6 py-3 text-lg"}[a]} ${c[r]} ${o}`,onClick:l?void 0:s,disabled:l,children:[e&&t.jsx("span",{className:"flex items-center",children:e}),i,n&&t.jsx("span",{className:"flex items-center",children:n})]})},exports.Sidebar=({isOpen:n,onClose:i,onToggle:s,menuItems:o,logoUrl:r,logoAlt:a="Logo",systemName:l="PASS",className:c="fixed inset-y-0 left-0 z-50 w-80 bg-white shadow-xl",overlayClassName:u="fixed inset-0 bg-black bg-opacity-25 z-40",desktopMenuClassName:h="h-full flex flex-col",showBottomMenu:d=!0,bottomMenuItems:p=[{id:"settings",label:"Configuración",icon:P,action:()=>{}},{id:"help",label:"Ayuda",icon:b,action:()=>{}},{id:"logout",label:"Cerrar Sesión",icon:w,action:()=>{}}],activePath:m="",onNavigate:f,children:g})=>{const[y,T]=e.useState(new Set),E=t=>m.includes(t),A=(e,n=!1)=>t.jsxs(Na.button,{whileHover:{scale:1.02},whileTap:{scale:.98},className:`w-full flex items-center justify-between py-3 rounded-lg transition-colors group ${n?"pr-4 pl-10":"px-4"} ${E(e.path)?"bg-primary-botech text-white":"text-gray-700 hover:bg-gray-100"}`,onClick:()=>{return t=e.path,f&&f(t),void i();var t},children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(e.icon,{className:"w-5 h-5"}),t.jsx("span",{className:"font-medium text-sm",children:e.label})]}),t.jsx(x,{className:"w-4 h-4 transition-transform "+(E(e.path)?"rotate-90":"group-hover:translate-x-1")})]},e.id),C=e=>{const n=y.has(e.id);return t.jsxs("div",{className:"mb-2",children:[t.jsxs(Na.button,{whileHover:{scale:1.02},whileTap:{scale:.98},className:"w-full flex items-center justify-between px-4 py-3 rounded-lg transition-colors group text-gray-700 hover:bg-gray-100",onClick:()=>{return t=e.id,void T(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n});var t},children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(e.icon,{className:"w-5 h-5"}),t.jsx("span",{className:"font-medium text-sm",children:e.label})]}),t.jsx(v,{className:"w-4 h-4 transition-transform "+(n?"rotate-180":"")})]}),t.jsx(Ni,{children:n&&t.jsx(Na.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:t.jsx("div",{className:"pt-2 space-y-1",children:e.children.map(t=>A(t,!0))})})})]},e.id)};return t.jsxs(t.Fragment,{children:[t.jsx(Ni,{children:n&&t.jsx(Na.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:u,onClick:i})}),t.jsx(Na.div,{initial:{x:"-100%"},animate:{x:n?0:"-100%"},transition:{type:"spring",stiffness:300,damping:30},className:c,children:t.jsxs("div",{className:h,children:[t.jsxs("div",{className:"p-4 border-b border-gray-200 flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("div",{className:"w-8 h-8 flex items-center justify-center",children:r?t.jsx("img",{src:r,alt:a,className:"h-full object-contain"}):t.jsx("div",{className:"h-full w-full bg-primary-botech rounded-lg flex items-center justify-center",children:t.jsx("span",{className:"text-white font-bold text-sm",children:l.charAt(0)})})}),t.jsx("h1",{className:"text-lg font-bold text-gray-800",children:l})]}),t.jsx("button",{onClick:i,className:"p-1 rounded-lg text-gray-500 hover:bg-gray-100 transition-colors",children:t.jsx(S,{className:"w-5 h-5"})})]}),t.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:t.jsx("nav",{className:"space-y-2",children:o.map(t=>"folder"===t.type?C(t.data):A(t.data))})}),d&&t.jsx("div",{className:"p-4 border-t border-gray-200",children:t.jsx("div",{className:"space-y-2",children:p.map(e=>t.jsxs("button",{onClick:e.action,className:"w-full flex items-center space-x-3 px-4 py-2 rounded-lg text-gray-700 hover:bg-gray-100 transition-colors",children:[t.jsx(e.icon,{className:"w-5 h-5"}),t.jsx("span",{className:"text-sm",children:e.label})]},e.id))})}),g&&t.jsx("div",{className:"p-4 border-t border-gray-200",children:g})]})})]})},exports.UploadStudentsExcelButton=({backend:i,label:s="Cargar Lista de Estudiantes en Excel",className:o,variant:a="primary",clientName:l,onSuccess:c,onError:u})=>{const h=e.useRef(null),[d,p]=e.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx(r,{variant:a,onClick:()=>{var t;null===(t=h.current)||void 0===t||t.click()},className:o,children:d?"Subiendo...":s}),t.jsx("input",{type:"file",accept:".xlsx,.xls",ref:h,className:"hidden",onChange:t=>Oa(void 0,void 0,void 0,function*(){var e,s,o,r,a,d,m,f;const g=null===(e=t.target.files)||void 0===e?void 0:e[0];if(!g)return;if([/\.xlsx$/i,/\.xls$/i].some(t=>t.test(g.name)))if(0!==g.size)try{p(!0);let t=l;if("85"===i&&!t){const{value:e}=yield n.fire({title:"Cliente requerido",text:"Ingrese el nombre del cliente:",input:"text",inputPlaceholder:"Ej: GIMNASIO FEMENINO",showCancelButton:!0,confirmButtonText:"Continuar",cancelButtonText:"Cancelar",inputValidator:t=>{if(!t||""===t.trim())return"El nombre del cliente es requerido"}});if(!e)return void p(!1);t=e}const e=yield Ia(g,i,t);let s="El archivo se ha cargado correctamente";(null==e?void 0:e.message)?s=e.message:"string"==typeof e&&(s=e),yield n.fire({title:"¡Carga exitosa!",text:s,icon:"success",confirmButtonText:"OK"}),null==c||c()}catch(t){console.error("Upload students excel failed",t),console.error("Error details:",t);let e="Hubo un problema al subir el archivo";const i=t;e=null!==(f=null!==(d=null!==(r=null===(o=null===(s=null==i?void 0:i.response)||void 0===s?void 0:s.data)||void 0===o?void 0:o.message)&&void 0!==r?r:"string"==typeof(null===(a=null==i?void 0:i.response)||void 0===a?void 0:a.data)?i.response.data:void 0)&&void 0!==d?d:(null===(m=null==i?void 0:i.response)||void 0===m?void 0:m.statusText)?`Error ${i.response.status}: ${i.response.statusText}`:void 0)&&void 0!==f?f:e,yield n.fire({title:"Error en la carga",text:e,icon:"error",confirmButtonText:"OK"}),null==u||u(t)}finally{h.current&&(h.current.value=""),p(!1)}else yield n.fire({title:"Archivo vacío",text:"El archivo seleccionado está vacío",icon:"warning",confirmButtonText:"OK"});else yield n.fire({title:"Archivo inválido",text:"El archivo debe ser un Excel (.xlsx o .xls)",icon:"warning",confirmButtonText:"OK"})})})]})},exports.downloadStudentsExcel=Fa,exports.generateTableColumns=function(t,e){return Object.keys(t).filter(t=>-1===e.indexOf(t)).map(t=>({key:t,header:t.charAt(0).toUpperCase()+t.slice(1).replace(/([A-Z])/g," $1").trim(),accessor:e=>{var n;return null!==(n=e[t])&&void 0!==n?n:"-"}}))},exports.getBackendPrefix=Ba,exports.uploadStudentsExcel=Ia;
1
+ "use strict";var t=require("react/jsx-runtime"),e=require("react"),n=require("sweetalert2"),s=require("axios"),i=require("react-dom");function r(t){var e=Object.create(null);return t&&Object.keys(t).forEach(function(n){if("default"!==n){var s=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,s.get?s:{enumerable:!0,get:function(){return t[n]}})}}),e.default=t,Object.freeze(e)}var o=r(e);const a=({variant:e="primary",size:n="md",onClick:s,children:i,className:r="",disabled:o=!1})=>{const a={primary:o?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-primary-botech hover:bg-primary-botech-400 text-white cursor-pointer",secondary:o?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-800 cursor-pointer",danger:o?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-red-500 hover:bg-red-600 text-white cursor-pointer"};return t.jsx("button",{className:`rounded font-medium transition-colors duration-300 ease-in-out ${{sm:"px-3 py-1.5 text-sm",md:"px-4 py-2",lg:"px-6 py-3 text-lg"}[n]} ${a[e]} ${r}`,onClick:o?void 0:s,disabled:o,children:i})},l=({leftIcon:e,rightIcon:n,children:s,onClick:i,className:r="",variant:o="primary",size:a="md",disabled:l=!1})=>{const c={primary:l?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-primary-botech hover:bg-primary-botech-400 text-white cursor-pointer",secondary:l?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-gray-200 hover:bg-gray-300 text-gray-800 cursor-pointer",danger:l?"bg-gray-300 text-gray-500 cursor-not-allowed":"bg-red-500 hover:bg-red-600 text-white cursor-pointer"};return t.jsxs("button",{type:"button",className:`inline-flex items-center gap-2 rounded font-medium transition-colors duration-300 ease-in-out ${{sm:"px-3 py-1.5 text-sm",md:"px-4 py-2",lg:"px-6 py-3 text-lg"}[a]} ${c[o]} ${r}`,onClick:l?void 0:i,disabled:l,children:[e&&t.jsx("span",{className:"flex items-center",children:e}),s,n&&t.jsx("span",{className:"flex items-center",children:n})]})};var c={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},u=e.createContext&&e.createContext(c),h=["attr","size","title"];function d(t,e){if(null==t)return{};var n,s,i=function(t,e){if(null==t)return{};var n={};for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){if(e.indexOf(s)>=0)continue;n[s]=t[s]}return n}(t,e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);for(s=0;s<r.length;s++)n=r[s],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i}function m(){return m=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},m.apply(this,arguments)}function p(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);e&&(s=s.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,s)}return n}function f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?p(Object(n),!0).forEach(function(e){g(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):p(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function g(t,e,n){var s;return(e="symbol"==typeof(s=function(t,e){if("object"!=typeof t||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var s=n.call(t,e||"default");if("object"!=typeof s)return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(e,"string"))?s:s+"")in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function y(t){return t&&t.map((t,n)=>e.createElement(t.tag,f({key:n},t.attr),y(t.child)))}function v(t){return n=>e.createElement(x,m({attr:f({},t.attr)},n),y(t.child))}function x(t){var n=n=>{var s,{attr:i,size:r,title:o}=t,a=d(t,h),l=r||n.size||"1em";return n.className&&(s=n.className),t.className&&(s=(s?s+" ":"")+t.className),e.createElement("svg",m({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,i,a,{className:s,style:f(f({color:t.color||n.color},n.style),t.style),height:l,width:l,xmlns:"http://www.w3.org/2000/svg"}),o&&e.createElement("title",null,o),t.children)};return void 0!==u?e.createElement(u.Consumer,null,t=>n(t)):n(c)}function b(t){return v({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"6 9 12 15 18 9"},child:[]}]})(t)}function w(t){return v({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"9 18 15 12 9 6"},child:[]}]})(t)}function T(t){return v({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"10"},child:[]},{tag:"path",attr:{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"},child:[]},{tag:"line",attr:{x1:"12",y1:"17",x2:"12.01",y2:"17"},child:[]}]})(t)}function j(t){return v({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"},child:[]},{tag:"polyline",attr:{points:"16 17 21 12 16 7"},child:[]},{tag:"line",attr:{x1:"21",y1:"12",x2:"9",y2:"12"},child:[]}]})(t)}function P(t){return v({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"3",y1:"12",x2:"21",y2:"12"},child:[]},{tag:"line",attr:{x1:"3",y1:"6",x2:"21",y2:"6"},child:[]},{tag:"line",attr:{x1:"3",y1:"18",x2:"21",y2:"18"},child:[]}]})(t)}function S(t){return v({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"circle",attr:{cx:"12",cy:"12",r:"3"},child:[]},{tag:"path",attr:{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"},child:[]}]})(t)}function E(t){return v({tag:"svg",attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"line",attr:{x1:"18",y1:"6",x2:"6",y2:"18"},child:[]},{tag:"line",attr:{x1:"6",y1:"6",x2:"18",y2:"18"},child:[]}]})(t)}const C=e.createContext({});function k(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const A="undefined"!=typeof window,M=A?e.useLayoutEffect:e.useEffect,N=e.createContext(null);function V(t,e){-1===t.indexOf(e)&&t.push(e)}function D(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const L=(t,e,n)=>n>e?e:n<t?t:n;let R=()=>{},O=()=>{};"production"!==process.env.NODE_ENV&&(R=(t,e)=>{t||"undefined"==typeof console||console.warn(e)},O=(t,e)=>{if(!t)throw new Error(e)});const B={},F=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function I(t){return"object"==typeof t&&null!==t}const $=t=>/^0[^.\s]+$/u.test(t);function U(t){let e;return()=>(void 0===e&&(e=t()),e)}const W=t=>t,z=(t,e)=>n=>e(t(n)),H=(...t)=>t.reduce(z),Y=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s};class K{constructor(){this.subscriptions=[]}add(t){return V(this.subscriptions,t),()=>D(this.subscriptions,t)}notify(t,e,n){const s=this.subscriptions.length;if(s)if(1===s)this.subscriptions[0](t,e,n);else for(let i=0;i<s;i++){const s=this.subscriptions[i];s&&s(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const X=t=>1e3*t,q=t=>t/1e3;function G(t,e){return e?t*(1e3/e):0}const _=new Set;function Z(t,e,n){t||_.has(e)||(console.warn(e),n&&console.warn(n),_.add(e))}const J=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Q(t,e,n,s){if(t===e&&n===s)return W;const i=e=>function(t,e,n,s,i){let r,o,a=0;do{o=e+(n-e)/2,r=J(o,s,i)-t,r>0?n=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,n);return t=>0===t||1===t?t:J(i(t),e,s)}const tt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,et=t=>e=>1-t(1-e),nt=Q(.33,1.53,.69,.99),st=et(nt),it=tt(st),rt=t=>(t*=2)<1?.5*st(t):.5*(2-Math.pow(2,-10*(t-1))),ot=t=>1-Math.sin(Math.acos(t)),at=et(ot),lt=tt(ot),ct=Q(.42,0,1,1),ut=Q(0,0,.58,1),ht=Q(.42,0,.58,1),dt=t=>Array.isArray(t)&&"number"==typeof t[0],mt={linear:W,easeIn:ct,easeInOut:ht,easeOut:ut,circIn:ot,circInOut:lt,circOut:at,backIn:st,backInOut:it,backOut:nt,anticipate:rt},pt=t=>{if(dt(t)){O(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,s,i]=t;return Q(e,n,s,i)}return"string"==typeof t?(O(void 0!==mt[t],`Invalid easing type '${t}'`),mt[t]):t},ft=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],gt={value:null,addProjectionMetrics:null};function yt(t,e){let n=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>n=!0,o=ft.reduce((t,n)=>(t[n]=function(t,e){let n=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1},l=0;function c(e){o.has(e)&&(u.schedule(e),t()),l++,e(a)}const u={schedule:(t,e=!1,r=!1)=>{const a=r&&i?n:s;return e&&o.add(t),a.has(t)||a.add(t),t},cancel:t=>{s.delete(t),o.delete(t)},process:t=>{a=t,i?r=!0:(i=!0,[n,s]=[s,n],n.forEach(c),e&&gt.value&&gt.value.frameloop[e].push(l),l=0,n.clear(),i=!1,r&&(r=!1,u.process(t)))}};return u}(r,e?n:void 0),t),{}),{setup:a,read:l,resolveKeyframes:c,preUpdate:u,update:h,preRender:d,render:m,postRender:p}=o,f=()=>{const r=B.useManualTiming?i.timestamp:performance.now();n=!1,B.useManualTiming||(i.delta=s?1e3/60:Math.max(Math.min(r-i.timestamp,40),1)),i.timestamp=r,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),h.process(i),d.process(i),m.process(i),p.process(i),i.isProcessing=!1,n&&e&&(s=!1,t(f))};return{schedule:ft.reduce((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(n||(n=!0,s=!0,i.isProcessing||t(f)),a.schedule(e,r,o)),e},{}),cancel:t=>{for(let e=0;e<ft.length;e++)o[ft[e]].cancel(t)},state:i,steps:o}}const{schedule:vt,cancel:xt,state:bt,steps:wt}=yt("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:W,!0);let Tt;function jt(){Tt=void 0}const Pt={now:()=>(void 0===Tt&&Pt.set(bt.isProcessing||B.useManualTiming?bt.timestamp:performance.now()),Tt),set:t=>{Tt=t,queueMicrotask(jt)}},St=t=>e=>"string"==typeof e&&e.startsWith(t),Et=St("--"),Ct=St("var(--"),kt=t=>!!Ct(t)&&At.test(t.split("/*")[0].trim()),At=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Mt={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},Nt={...Mt,transform:t=>L(0,1,t)},Vt={...Mt,default:1},Dt=t=>Math.round(1e5*t)/1e5,Lt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;const Rt=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ot=(t,e)=>n=>Boolean("string"==typeof n&&Rt.test(n)&&n.startsWith(t)||e&&!function(t){return null==t}(n)&&Object.prototype.hasOwnProperty.call(n,e)),Bt=(t,e,n)=>s=>{if("string"!=typeof s)return s;const[i,r,o,a]=s.match(Lt);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},Ft={...Mt,transform:t=>Math.round((t=>L(0,255,t))(t))},It={test:Ot("rgb","red"),parse:Bt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Ft.transform(t)+", "+Ft.transform(e)+", "+Ft.transform(n)+", "+Dt(Nt.transform(s))+")"};const $t={test:Ot("#"),parse:function(t){let e="",n="",s="",i="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),i=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),i=t.substring(4,5),e+=e,n+=n,s+=s,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}},transform:It.transform},Ut=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),Wt=Ut("deg"),zt=Ut("%"),Ht=Ut("px"),Yt=Ut("vh"),Kt=Ut("vw"),Xt=(()=>({...zt,parse:t=>zt.parse(t)/100,transform:t=>zt.transform(100*t)}))(),qt={test:Ot("hsl","hue"),parse:Bt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+zt.transform(Dt(e))+", "+zt.transform(Dt(n))+", "+Dt(Nt.transform(s))+")"},Gt={test:t=>It.test(t)||$t.test(t)||qt.test(t),parse:t=>It.test(t)?It.parse(t):qt.test(t)?qt.parse(t):$t.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?It.transform(t):qt.transform(t),getAnimatableNone:t=>{const e=Gt.parse(t);return e.alpha=0,Gt.transform(e)}},_t=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;const Zt="number",Jt="color",Qt=/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 te(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},i=[];let r=0;const o=e.replace(Qt,t=>(Gt.test(t)?(s.color.push(r),i.push(Jt),n.push(Gt.parse(t))):t.startsWith("var(")?(s.var.push(r),i.push("var"),n.push(t)):(s.number.push(r),i.push(Zt),n.push(parseFloat(t))),++r,"${}")).split("${}");return{values:n,split:o,indexes:s,types:i}}function ee(t){return te(t).values}function ne(t){const{split:e,types:n}=te(t),s=e.length;return t=>{let i="";for(let r=0;r<s;r++)if(i+=e[r],void 0!==t[r]){const e=n[r];i+=e===Zt?Dt(t[r]):e===Jt?Gt.transform(t[r]):t[r]}return i}}const se=t=>"number"==typeof t?0:Gt.test(t)?Gt.getAnimatableNone(t):t;const ie={test:function(t){return isNaN(t)&&"string"==typeof t&&(t.match(Lt)?.length||0)+(t.match(_t)?.length||0)>0},parse:ee,createTransformer:ne,getAnimatableNone:function(t){const e=ee(t);return ne(t)(e.map(se))}};function re(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function oe(t,e){return n=>n>0?e:t}const ae=(t,e,n)=>t+(e-t)*n,le=(t,e,n)=>{const s=t*t,i=n*(e*e-s)+s;return i<0?0:Math.sqrt(i)},ce=[$t,It,qt];function ue(t){const e=(n=t,ce.find(t=>t.test(n)));var n;if(R(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(e))return!1;let s=e.parse(t);return e===qt&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,r=0,o=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=re(a,s,t+1/3),r=re(a,s,t),o=re(a,s,t-1/3)}else i=r=o=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*o),alpha:s}}(s)),s}const he=(t,e)=>{const n=ue(t),s=ue(e);if(!n||!s)return oe(t,e);const i={...n};return t=>(i.red=le(n.red,s.red,t),i.green=le(n.green,s.green,t),i.blue=le(n.blue,s.blue,t),i.alpha=ae(n.alpha,s.alpha,t),It.transform(i))},de=new Set(["none","hidden"]);function me(t,e){return n=>ae(t,e,n)}function pe(t){return"number"==typeof t?me:"string"==typeof t?kt(t)?oe:Gt.test(t)?he:ye:Array.isArray(t)?fe:"object"==typeof t?Gt.test(t)?he:ge:oe}function fe(t,e){const n=[...t],s=n.length,i=t.map((t,n)=>pe(t)(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}}function ge(t,e){const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=pe(t[i])(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}}const ye=(t,e)=>{const n=ie.createTransformer(e),s=te(t),i=te(e);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?de.has(t)&&!i.values.length||de.has(e)&&!s.values.length?function(t,e){return de.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}(t,e):H(fe(function(t,e){const n=[],s={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const r=e.types[i],o=t.indexes[r][s[r]],a=t.values[o]??0;n[i]=a,s[r]++}return n}(s,i),i.values),n):(R(!0,`Complex values '${t}' and '${e}' 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.`),oe(t,e))};function ve(t,e,n){if("number"==typeof t&&"number"==typeof e&&"number"==typeof n)return ae(t,e,n);return pe(t)(t,e)}const xe=t=>{const e=({timestamp:e})=>t(e);return{start:(t=!0)=>vt.update(e,t),stop:()=>xt(e),now:()=>bt.isProcessing?bt.timestamp:Pt.now()}},be=(t,e,n=10)=>{let s="";const i=Math.max(Math.round(e/n),2);for(let e=0;e<i;e++)s+=Math.round(1e4*t(e/(i-1)))/1e4+", ";return`linear(${s.substring(0,s.length-2)})`},we=2e4;function Te(t){let e=0;let n=t.next(e);for(;!n.done&&e<we;)e+=50,n=t.next(e);return e>=we?1/0:e}function je(t,e,n){const s=Math.max(e-5,0);return G(n-t(s),e-s)}const Pe=100,Se=10,Ee=1,Ce=0,ke=800,Ae=.3,Me=.3,Ne={granular:.01,default:2},Ve={granular:.005,default:.5},De=.01,Le=10,Re=.05,Oe=1,Be=.001;function Fe({duration:t=ke,bounce:e=Ae,velocity:n=Ce,mass:s=Ee}){let i,r;R(t<=X(Le),"Spring duration must be 10 seconds or less");let o=1-e;o=L(Re,Oe,o),t=L(De,Le,q(t)),o<1?(i=e=>{const s=e*o,i=s*t,r=s-n,a=$e(e,o),l=Math.exp(-i);return Be-r/a*l},r=e=>{const s=e*o*t,r=s*n+n,a=Math.pow(o,2)*Math.pow(e,2)*t,l=Math.exp(-s),c=$e(Math.pow(e,2),o);return(-i(e)+Be>0?-1:1)*((r-a)*l)/c}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let s=n;for(let n=1;n<Ie;n++)s-=t(s)/e(s);return s}(i,r,5/t);if(t=X(t),isNaN(a))return{stiffness:Pe,damping:Se,duration:t};{const e=Math.pow(a,2)*s;return{stiffness:e,damping:2*o*Math.sqrt(s*e),duration:t}}}const Ie=12;function $e(t,e){return t*Math.sqrt(1-e*e)}const Ue=["duration","bounce"],We=["stiffness","damping","mass"];function ze(t,e){return e.some(e=>void 0!==t[e])}function He(t=Me,e=Ae){const n="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:i}=n;const r=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:m}=function(t){let e={velocity:Ce,stiffness:Pe,damping:Se,mass:Ee,isResolvedFromDuration:!1,...t};if(!ze(t,We)&&ze(t,Ue))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(1.2*n),i=s*s,r=2*L(.05,1,1-(t.bounce||0))*Math.sqrt(i);e={...e,mass:Ee,stiffness:i,damping:r}}else{const n=Fe(t);e={...e,...n,mass:Ee},e.isResolvedFromDuration=!0}return e}({...n,velocity:-q(n.velocity||0)}),p=d||0,f=c/(2*Math.sqrt(l*u)),g=o-r,y=q(Math.sqrt(l/u)),v=Math.abs(g)<5;let x;if(s||(s=v?Ne.granular:Ne.default),i||(i=v?Ve.granular:Ve.default),f<1){const t=$e(y,f);x=e=>{const n=Math.exp(-f*y*e);return o-n*((p+f*y*g)/t*Math.sin(t*e)+g*Math.cos(t*e))}}else if(1===f)x=t=>o-Math.exp(-y*t)*(g+(p+y*g)*t);else{const t=y*Math.sqrt(f*f-1);x=e=>{const n=Math.exp(-f*y*e),s=Math.min(t*e,300);return o-n*((p+f*y*g)*Math.sinh(s)+t*g*Math.cosh(s))/t}}const b={calculatedDuration:m&&h||null,next:t=>{const e=x(t);if(m)a.done=t>=h;else{let n=0===t?p:0;f<1&&(n=0===t?X(p):je(x,t,e));const r=Math.abs(n)<=s,l=Math.abs(o-e)<=i;a.done=r&&l}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(Te(b),we),e=be(e=>b.next(t*e).value,t,30);return t+"ms "+e},toTransition:()=>{}};return b}function Ye({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=t[0],d={done:!1,value:h},m=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let p=n*e;const f=h+p,g=void 0===o?f:o(f);g!==f&&(p=g-h);const y=t=>-p*Math.exp(-t/s),v=t=>g+y(t),x=t=>{const e=y(t),n=v(t);d.done=Math.abs(e)<=c,d.value=d.done?g:n};let b,w;const T=t=>{var e;(e=d.value,void 0!==a&&e<a||void 0!==l&&e>l)&&(b=t,w=He({keyframes:[d.value,m(d.value)],velocity:je(v,t,d.value),damping:i,stiffness:r,restDelta:c,restSpeed:u}))};return T(0),{calculatedDuration:null,next:t=>{let e=!1;return w||void 0!==b||(e=!0,x(t),T(t)),void 0!==b&&t>=b?w.next(t-b):(!e&&x(t),d)}}}function Ke(t,e,{clamp:n=!0,ease:s,mixer:i}={}){const r=t.length;if(O(r===e.length,"Both input and output ranges must be the same length"),1===r)return()=>e[0];if(2===r&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=function(t,e,n){const s=[],i=n||B.mix||ve,r=t.length-1;for(let n=0;n<r;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||W:e;r=H(t,r)}s.push(r)}return s}(e,s,i),l=a.length,c=n=>{if(o&&n<t[0])return e[0];let s=0;if(l>1)for(;s<t.length-2&&!(n<t[s+1]);s++);const i=Y(t[s],t[s+1],n);return a[s](i)};return n?e=>c(L(t[0],t[r-1],e)):c}function Xe(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const i=Y(0,e,s);t.push(ae(n,1,i))}}(e,t.length-1),e}function qe({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(s)?s.map(pt):pt(s),r={done:!1,value:e[0]},o=function(t,e){return t.map(t=>t*e)}(n&&n.length===e.length?n:Xe(e),t),a=Ke(o,e,{ease:Array.isArray(i)?i:(l=e,c=i,l.map(()=>c||ht).splice(0,l.length-1))});var l,c;return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}He.applyToOptions=t=>{const e=function(t,e=100,n){const s=n({...t,keyframes:[0,e]}),i=Math.min(Te(s),we);return{type:"keyframes",ease:t=>s.next(i*t).value/e,duration:q(i)}}(t,100,He);return t.ease=e.ease,t.duration=X(e.duration),t.type="keyframes",t};const Ge=t=>null!==t;function _e(t,{repeat:e,repeatType:n="loop"},s,i=1){const r=t.filter(Ge),o=i<0||e&&"loop"!==n&&e%2==1?0:r.length-1;return o&&void 0!==s?s:r[o]}const Ze={decay:Ye,inertia:Ye,tween:qe,keyframes:qe,spring:He};function Je(t){"string"==typeof t.type&&(t.type=Ze[t.type])}class Qe{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,e){return this.finished.then(t,e)}}const tn=t=>t/100;class en extends Qe{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:t}=this.options;t&&t.updatedAt!==Pt.now()&&this.tick(Pt.now()),this.isStopped=!0,"idle"!==this.state&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),!1===t.autoplay&&this.pause()}initAnimation(){const{options:t}=this;Je(t);const{type:e=qe,repeat:n=0,repeatDelay:s=0,repeatType:i,velocity:r=0}=t;let{keyframes:o}=t;const a=e||qe;"production"!==process.env.NODE_ENV&&a!==qe&&O(o.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${o}`),a!==qe&&"number"!=typeof o[0]&&(this.mixKeyframes=H(tn,ve(o[0],o[1])),o=[0,100]);const l=a({...t,keyframes:o});"mirror"===i&&(this.mirroredGenerator=a({...t,keyframes:[...o].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=Te(l));const{calculatedDuration:c}=l;this.calculatedDuration=c,this.resolvedDuration=c+s,this.totalDuration=this.resolvedDuration*(n+1)-s,this.generator=l}updateTime(t){const e=Math.round(t-this.startTime)*this.playbackSpeed;null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=e}tick(t,e=!1){const{generator:n,totalDuration:s,mixKeyframes:i,mirroredGenerator:r,resolvedDuration:o,calculatedDuration:a}=this;if(null===this.startTime)return n.next(0);const{delay:l=0,keyframes:c,repeat:u,repeatType:h,repeatDelay:d,type:m,onUpdate:p,finalKeyframe:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),e?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),y=this.playbackSpeed>=0?g<0:g>s;this.currentTime=Math.max(g,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=s);let v=this.currentTime,x=n;if(u){const t=Math.min(this.currentTime,s)/o;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,u+1);Boolean(e%2)&&("reverse"===h?(n=1-n,d&&(n-=d/o)):"mirror"===h&&(x=r)),v=L(0,1,n)*o}const b=y?{done:!1,value:c[0]}:x.next(v);i&&(b.value=i(b.value));let{done:w}=b;y||null===a||(w=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const T=null===this.holdTime&&("finished"===this.state||"running"===this.state&&w);return T&&m!==Ye&&(b.value=_e(c,this.options,f,this.speed)),p&&p(b.value),T&&this.finish(),b}then(t,e){return this.finished.then(t,e)}get duration(){return q(this.calculatedDuration)}get time(){return q(this.currentTime)}set time(t){t=X(t),this.currentTime=t,null===this.startTime||null!==this.holdTime||0===this.playbackSpeed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(t){this.updateTime(Pt.now());const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=q(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=xe,startTime:e}=this.options;this.driver||(this.driver=t(t=>this.tick(t))),this.options.onPlay?.();const n=this.driver.now();"finished"===this.state?(this.updateFinished(),this.startTime=n):null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime||(this.startTime=e??n),"finished"===this.state&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Pt.now()),this.holdTime=this.currentTime}complete(){"running"!==this.state&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}const nn=t=>180*t/Math.PI,sn=t=>{const e=nn(Math.atan2(t[1],t[0]));return on(e)},rn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:sn,rotateZ:sn,skewX:t=>nn(Math.atan(t[1])),skewY:t=>nn(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},on=t=>((t%=360)<0&&(t+=360),t),an=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),ln=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),cn={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:an,scaleY:ln,scale:t=>(an(t)+ln(t))/2,rotateX:t=>on(nn(Math.atan2(t[6],t[5]))),rotateY:t=>on(nn(Math.atan2(-t[2],t[0]))),rotateZ:sn,rotate:sn,skewX:t=>nn(Math.atan(t[4])),skewY:t=>nn(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function un(t){return t.includes("scale")?1:0}function hn(t,e){if(!t||"none"===t)return un(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(n)s=cn,i=n;else{const e=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=rn,i=e}if(!i)return un(e);const r=s[e],o=i[1].split(",").map(dn);return"function"==typeof r?r(o):o[r]}function dn(t){return parseFloat(t.trim())}const mn=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],pn=(()=>new Set(mn))(),fn=t=>t===Mt||t===Ht,gn=new Set(["x","y","z"]),yn=mn.filter(t=>!gn.has(t));const vn={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>hn(e,"x"),y:(t,{transform:e})=>hn(e,"y")};vn.translateX=vn.x,vn.translateY=vn.y;const xn=new Set;let bn=!1,wn=!1,Tn=!1;function jn(){if(wn){const t=Array.from(xn).filter(t=>t.needsMeasurement),e=new Set(t.map(t=>t.element)),n=new Map;e.forEach(t=>{const e=function(t){const e=[];return yn.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}(t);e.length&&(n.set(t,e),t.render())}),t.forEach(t=>t.measureInitialState()),e.forEach(t=>{t.render();const e=n.get(t);e&&e.forEach(([e,n])=>{t.getValue(e)?.set(n)})}),t.forEach(t=>t.measureEndState()),t.forEach(t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)})}wn=!1,bn=!1,xn.forEach(t=>t.complete(Tn)),xn.clear()}function Pn(){xn.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(wn=!0)})}class Sn{constructor(t,e,n,s,i,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=n,this.motionValue=s,this.element=i,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?(xn.add(this),bn||(bn=!0,vt.read(Pn),vt.resolveKeyframes(jn))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:n,motionValue:s}=this;if(null===t[0]){const i=s?.get(),r=t[t.length-1];if(void 0!==i)t[0]=i;else if(n&&e){const s=n.readValue(e,r);null!=s&&(t[0]=s)}void 0===t[0]&&(t[0]=r),s&&void 0===i&&s.set(t[0])}!function(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),xn.delete(this)}cancel(){"scheduled"===this.state&&(xn.delete(this),this.state="pending")}resume(){"pending"===this.state&&this.scheduleResolve()}}const En=U(()=>void 0!==window.ScrollTimeline),Cn={};function kn(t,e){const n=U(t);return()=>Cn[e]??n()}const An=kn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(t){return!1}return!0},"linearEasing"),Mn=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Nn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Mn([0,.65,.55,1]),circOut:Mn([.55,0,1,.45]),backIn:Mn([.31,.01,.66,-.59]),backOut:Mn([.33,1.53,.69,.99])};function Vn(t,e){return t?"function"==typeof t?An()?be(t,e):"ease-out":dt(t)?Mn(t):Array.isArray(t)?t.map(t=>Vn(t,e)||Nn.easeOut):Nn[t]:void 0}function Dn(t,e,n,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeOut",times:l}={},c=void 0){const u={[e]:n};l&&(u.offset=l);const h=Vn(a,i);Array.isArray(h)&&(u.easing=h);const d={delay:s,duration:i,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"};c&&(d.pseudoElement=c);return t.animate(u,d)}function Ln(t){return"function"==typeof t&&"applyToOptions"in t}class Rn extends Qe{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,!t)return;const{element:e,name:n,keyframes:s,pseudoElement:i,allowFlatten:r=!1,finalKeyframe:o,onComplete:a}=t;this.isPseudoElement=Boolean(i),this.allowFlatten=r,this.options=t,O("string"!=typeof t.type,'animateMini doesn\'t support "type" as a string. Did you mean to import { spring } from "motion"?');const l=function({type:t,...e}){return Ln(t)&&An()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}(t);this.animation=Dn(e,n,s,l,i),!1===l.autoplay&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const t=_e(s,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(t):function(t,e,n){(t=>t.startsWith("--"))(e)?t.style.setProperty(e,n):t.style[e]=n}(e,n,t),this.animation.cancel()}a?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),"finished"===this.state&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;"idle"!==t&&"finished"!==t&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return q(Number(t))}get time(){return q(Number(this.animation.currentTime)||0)}set time(t){this.finishedTime=null,this.animation.currentTime=X(t)}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return null!==this.finishedTime?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(t){this.animation.startTime=t}attachTimeline({timeline:t,observe:e}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&En()?(this.animation.timeline=t,W):e(this)}}const On={anticipate:rt,backInOut:it,circInOut:lt};function Bn(t){"string"==typeof t.ease&&t.ease in On&&(t.ease=On[t.ease])}class Fn extends Rn{constructor(t){Bn(t),Je(t),super(t),t.startTime&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:e,onUpdate:n,onComplete:s,element:i,...r}=this.options;if(!e)return;if(void 0!==t)return void e.set(t);const o=new en({...r,autoplay:!1}),a=X(this.finishedTime??this.time);e.setWithVelocity(o.sample(a-10).value,o.sample(a).value,10),o.stop()}}const In=(t,e)=>"zIndex"!==e&&(!("number"!=typeof t&&!Array.isArray(t))||!("string"!=typeof t||!ie.test(t)&&"0"!==t||t.startsWith("url(")));function $n(t){return I(t)&&"offsetHeight"in t}const Un=new Set(["opacity","clipPath","filter","transform"]),Wn=U(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class zn extends Qe{constructor({autoplay:t=!0,delay:e=0,type:n="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r="loop",keyframes:o,name:a,motionValue:l,element:c,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Pt.now();const h={autoplay:t,delay:e,type:n,repeat:s,repeatDelay:i,repeatType:r,name:a,motionValue:l,element:c,...u},d=c?.KeyframeResolver||Sn;this.keyframeResolver=new d(o,(t,e,n)=>this.onKeyframesResolved(t,e,h,!n),a,l,c),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,e,n,s){this.keyframeResolver=void 0;const{name:i,type:r,velocity:o,delay:a,isHandoff:l,onUpdate:c}=n;this.resolvedAt=Pt.now(),function(t,e,n,s){const i=t[0];if(null===i)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=In(i,e),a=In(r,e);return R(o===a,`You are trying to animate ${e} from "${i}" to "${r}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${r} via the \`style\` property.`),!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}(t)||("spring"===n||Ln(n))&&s)}(t,i,r,o)||(!B.instantAnimations&&a||c?.(_e(t,n,e)),t[0]=t[t.length-1],n.duration=0,n.repeat=0);const u={startTime:s?this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt:void 0,finalKeyframe:e,...n,keyframes:t},h=!l&&function(t){const{motionValue:e,name:n,repeatDelay:s,repeatType:i,damping:r,type:o}=t;if(!$n(e?.owner?.current))return!1;const{onUpdate:a,transformTemplate:l}=e.owner.getProps();return Wn()&&n&&Un.has(n)&&("transform"!==n||!l)&&!a&&!s&&"mirror"!==i&&0!==r&&"inertia"!==o}(u)?new Fn({...u,element:u.motionValue.owner.current}):new en(u);h.finished.then(()=>this.notifyFinished()).catch(W),this.pendingTimeline&&(this.stopTimeline=h.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(t,e){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Tn=!0,Pn(),jn(),Tn=!1),this._animation}get duration(){return this.animation.duration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const Hn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Yn(t,e,n=1){O(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[s,i]=function(t){const e=Hn.exec(t);if(!e)return[,];const[,n,s,i]=e;return[`--${n??s}`,i]}(t);if(!s)return;const r=window.getComputedStyle(e).getPropertyValue(s);if(r){const t=r.trim();return F(t)?parseFloat(t):t}return kt(i)?Yn(i,e,n+1):i}function Kn(t,e){return t?.[e]??t?.default??t}const Xn=new Set(["width","height","top","left","right","bottom",...mn]),qn=t=>e=>e.test(t),Gn=[Mt,Ht,zt,Wt,Kt,Yt,{test:t=>"auto"===t,parse:t=>t}],_n=t=>Gn.find(qn(t));function Zn(t){return"number"==typeof t?0===t:null===t||("none"===t||"0"===t||$(t))}const Jn=new Set(["brightness","contrast","saturate","opacity"]);function Qn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[s]=n.match(Lt)||[];if(!s)return t;const i=n.replace(s,"");let r=Jn.has(e)?1:0;return s!==n&&(r*=100),e+"("+r+i+")"}const ts=/\b([a-z-]*)\(.*?\)/gu,es={...ie,getAnimatableNone:t=>{const e=t.match(ts);return e?e.map(Qn).join(" "):t}},ns={...Mt,transform:Math.round},ss={borderWidth:Ht,borderTopWidth:Ht,borderRightWidth:Ht,borderBottomWidth:Ht,borderLeftWidth:Ht,borderRadius:Ht,radius:Ht,borderTopLeftRadius:Ht,borderTopRightRadius:Ht,borderBottomRightRadius:Ht,borderBottomLeftRadius:Ht,width:Ht,maxWidth:Ht,height:Ht,maxHeight:Ht,top:Ht,right:Ht,bottom:Ht,left:Ht,padding:Ht,paddingTop:Ht,paddingRight:Ht,paddingBottom:Ht,paddingLeft:Ht,margin:Ht,marginTop:Ht,marginRight:Ht,marginBottom:Ht,marginLeft:Ht,backgroundPositionX:Ht,backgroundPositionY:Ht,...{rotate:Wt,rotateX:Wt,rotateY:Wt,rotateZ:Wt,scale:Vt,scaleX:Vt,scaleY:Vt,scaleZ:Vt,skew:Wt,skewX:Wt,skewY:Wt,distance:Ht,translateX:Ht,translateY:Ht,translateZ:Ht,x:Ht,y:Ht,z:Ht,perspective:Ht,transformPerspective:Ht,opacity:Nt,originX:Xt,originY:Xt,originZ:Ht},zIndex:ns,fillOpacity:Nt,strokeOpacity:Nt,numOctaves:ns},is={...ss,color:Gt,backgroundColor:Gt,outlineColor:Gt,fill:Gt,stroke:Gt,borderColor:Gt,borderTopColor:Gt,borderRightColor:Gt,borderBottomColor:Gt,borderLeftColor:Gt,filter:es,WebkitFilter:es},rs=t=>is[t];function os(t,e){let n=rs(t);return n!==es&&(n=ie),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const as=new Set(["auto","none","0"]);class ls extends Sn{constructor(t,e,n,s,i){super(t,e,n,s,i,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:n}=this;if(!e||!e.current)return;super.readKeyframes();for(let n=0;n<t.length;n++){let s=t[n];if("string"==typeof s&&(s=s.trim(),kt(s))){const i=Yn(s,e.current);void 0!==i&&(t[n]=i),n===t.length-1&&(this.finalKeyframe=s)}}if(this.resolveNoneKeyframes(),!Xn.has(n)||2!==t.length)return;const[s,i]=t,r=_n(s),o=_n(i);if(r!==o)if(fn(r)&&fn(o))for(let e=0;e<t.length;e++){const n=t[e];"string"==typeof n&&(t[e]=parseFloat(n))}else vn[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,n=[];for(let e=0;e<t.length;e++)(null===t[e]||Zn(t[e]))&&n.push(e);n.length&&function(t,e,n){let s,i=0;for(;i<t.length&&!s;){const e=t[i];"string"==typeof e&&!as.has(e)&&te(e).values.length&&(s=t[i]),i++}if(s&&n)for(const i of e)t[i]=os(n,s)}(t,n,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:n}=this;if(!t||!t.current)return;"height"===n&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=vn[n](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const s=e[e.length-1];void 0!==s&&t.getValue(n,s).jump(s,!1)}measureEndState(){const{element:t,name:e,unresolvedKeyframes:n}=this;if(!t||!t.current)return;const s=t.getValue(e);s&&s.jump(this.measuredOrigin,!1);const i=n.length-1,r=n[i];n[i]=vn[e](t.measureViewportBox(),window.getComputedStyle(t.current)),null!==r&&void 0===this.finalKeyframe&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([e,n])=>{t.getValue(e).set(n)}),this.resolveNoneKeyframes()}}const cs=(t,e)=>e&&"number"==typeof t?e.transform(t):t;class us{constructor(t,e={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const n=Pt.now();if(this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const t of this.dependents)t.dirty();e&&this.events.renderRequest?.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=Pt.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return"production"!==process.env.NODE_ENV&&Z(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new K);const n=this.events[t].add(e);return"change"===t?()=>{n(),vt.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=Pt.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return G(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function hs(t,e){return new us(t,e)}const{schedule:ds,cancel:ms}=yt(queueMicrotask,!1),ps={x:!1,y:!1};function fs(){return ps.x||ps.y}function gs(t,e){const n=function(t,e,n){if(t instanceof EventTarget)return[t];if("string"==typeof t){let s=document;e&&(s=e.current);const i=n?.[t]??s.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}(t),s=new AbortController;return[n,{passive:!0,...e,signal:s.signal},()=>s.abort()]}function ys(t){return!("touch"===t.pointerType||fs())}const vs=(t,e)=>!!e&&(t===e||vs(t,e.parentElement)),xs=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary,bs=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);const ws=new WeakSet;function Ts(t){return e=>{"Enter"===e.key&&t(e)}}function js(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}function Ps(t){return xs(t)&&!fs()}function Ss(t,e,n={}){const[s,i,r]=gs(t,n),o=t=>{const s=t.currentTarget;if(!Ps(t))return;ws.add(s);const r=e(s,t),o=(t,e)=>{window.removeEventListener("pointerup",a),window.removeEventListener("pointercancel",l),ws.has(s)&&ws.delete(s),Ps(t)&&"function"==typeof r&&r(t,{success:e})},a=t=>{o(t,s===window||s===document||n.useGlobalTarget||vs(s,t.target))},l=t=>{o(t,!1)};window.addEventListener("pointerup",a,i),window.addEventListener("pointercancel",l,i)};return s.forEach(t=>{var e;(n.useGlobalTarget?window:t).addEventListener("pointerdown",o,i),$n(t)&&(t.addEventListener("focus",t=>((t,e)=>{const n=t.currentTarget;if(!n)return;const s=Ts(()=>{if(ws.has(n))return;js(n,"down");const t=Ts(()=>{js(n,"up")});n.addEventListener("keyup",t,e),n.addEventListener("blur",()=>js(n,"cancel"),e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)})(t,i)),e=t,bs.has(e.tagName)||-1!==e.tabIndex||t.hasAttribute("tabindex")||(t.tabIndex=0))}),r}function Es(t){return I(t)&&"ownerSVGElement"in t}const Cs=t=>Boolean(t&&t.getVelocity),ks=[...Gn,Gt,ie],As=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class Ms extends o.Component{getSnapshotBeforeUpdate(t){const e=this.props.childRef.current;if(e&&t.isPresent&&!this.props.isPresent){const t=e.offsetParent,n=$n(t)&&t.offsetWidth||0,s=this.props.sizeRef.current;s.height=e.offsetHeight||0,s.width=e.offsetWidth||0,s.top=e.offsetTop,s.left=e.offsetLeft,s.right=n-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function Ns({children:n,isPresent:s,anchorX:i}){const r=e.useId(),a=e.useRef(null),l=e.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:c}=e.useContext(As);return e.useInsertionEffect(()=>{const{width:t,height:e,top:n,left:o,right:u}=l.current;if(s||!a.current||!t||!e)return;const h="left"===i?`left: ${o}`:`right: ${u}`;a.current.dataset.motionPopId=r;const d=document.createElement("style");return c&&(d.nonce=c),document.head.appendChild(d),d.sheet&&d.sheet.insertRule(`\n [data-motion-pop-id="${r}"] {\n position: absolute !important;\n width: ${t}px !important;\n height: ${e}px !important;\n ${h}px !important;\n top: ${n}px !important;\n }\n `),()=>{document.head.contains(d)&&document.head.removeChild(d)}},[s]),t.jsx(Ms,{isPresent:s,childRef:a,sizeRef:l,children:o.cloneElement(n,{ref:a})})}const Vs=({children:n,initial:s,isPresent:i,onExitComplete:r,custom:a,presenceAffectsLayout:l,mode:c,anchorX:u})=>{const h=k(Ds),d=e.useId();let m=!0,p=e.useMemo(()=>(m=!1,{id:d,initial:s,isPresent:i,custom:a,onExitComplete:t=>{h.set(t,!0);for(const t of h.values())if(!t)return;r&&r()},register:t=>(h.set(t,!1),()=>h.delete(t))}),[i,h,r]);return l&&m&&(p={...p}),e.useMemo(()=>{h.forEach((t,e)=>h.set(e,!1))},[i]),o.useEffect(()=>{!i&&!h.size&&r&&r()},[i]),"popLayout"===c&&(n=t.jsx(Ns,{isPresent:i,anchorX:u,children:n})),t.jsx(N.Provider,{value:p,children:n})};function Ds(){return new Map}function Ls(t=!0){const n=e.useContext(N);if(null===n)return[!0,null];const{isPresent:s,onExitComplete:i,register:r}=n,o=e.useId();e.useEffect(()=>{if(t)return r(o)},[t]);const a=e.useCallback(()=>t&&i&&i(o),[o,i,t]);return!s&&i?[!1,a]:[!0]}const Rs=t=>t.key||"";function Os(t){const n=[];return e.Children.forEach(t,t=>{e.isValidElement(t)&&n.push(t)}),n}const Bs=({children:n,custom:s,initial:i=!0,onExitComplete:r,presenceAffectsLayout:o=!0,mode:a="sync",propagate:l=!1,anchorX:c="left"})=>{const[u,h]=Ls(l),d=e.useMemo(()=>Os(n),[n]),m=l&&!u?[]:d.map(Rs),p=e.useRef(!0),f=e.useRef(d),g=k(()=>new Map),[y,v]=e.useState(d),[x,b]=e.useState(d);M(()=>{p.current=!1,f.current=d;for(let t=0;t<x.length;t++){const e=Rs(x[t]);m.includes(e)?g.delete(e):!0!==g.get(e)&&g.set(e,!1)}},[x,m.length,m.join("-")]);const w=[];if(d!==y){let t=[...d];for(let e=0;e<x.length;e++){const n=x[e],s=Rs(n);m.includes(s)||(t.splice(e,0,n),w.push(n))}return"wait"===a&&w.length&&(t=w),b(Os(t)),v(d),null}"production"!==process.env.NODE_ENV&&"wait"===a&&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:T}=e.useContext(C);return t.jsx(t.Fragment,{children:x.map(e=>{const n=Rs(e),y=!(l&&!u)&&(d===x||m.includes(n));return t.jsx(Vs,{isPresent:y,initial:!(p.current&&!i)&&void 0,custom:s,presenceAffectsLayout:o,mode:a,onExitComplete:y?void 0:()=>{if(!g.has(n))return;g.set(n,!0);let t=!0;g.forEach(e=>{e||(t=!1)}),t&&(T?.(),b(f.current),l&&h?.(),r&&r())},anchorX:c,children:e},n)})})},Fs=e.createContext({strict:!1}),Is={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"]},$s={};for(const t in Is)$s[t]={isEnabled:e=>Is[t].some(t=>!!e[t])};const Us=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 Ws(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||Us.has(t)}let zs=t=>!Ws(t);try{"function"==typeof(Hs=require("@emotion/is-prop-valid").default)&&(zs=t=>t.startsWith("on")?!Ws(t):Hs(t))}catch{}var Hs;function Ys(t){if("undefined"==typeof Proxy)return t;const e=new Map;return new Proxy((...e)=>("production"!==process.env.NODE_ENV&&Z(!1,"motion() is deprecated. Use motion.create() instead."),t(...e)),{get:(n,s)=>"create"===s?t:(e.has(s)||e.set(s,t(s)),e.get(s))})}const Ks=e.createContext({});function Xs(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}function qs(t){return"string"==typeof t||Array.isArray(t)}const Gs=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],_s=["initial",...Gs];function Zs(t){return Xs(t.animate)||_s.some(e=>qs(t[e]))}function Js(t){return Boolean(Zs(t)||t.variants)}function Qs(t){const{initial:n,animate:s}=function(t,e){if(Zs(t)){const{initial:e,animate:n}=t;return{initial:!1===e||qs(e)?e:void 0,animate:qs(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(Ks));return e.useMemo(()=>({initial:n,animate:s}),[ti(n),ti(s)])}function ti(t){return Array.isArray(t)?t.join(" "):t}const ei=Symbol.for("motionComponentSymbol");function ni(t){return t&&"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function si(t,n,s){return e.useCallback(e=>{e&&t.onMount&&t.onMount(e),n&&(e?n.mount(e):n.unmount()),s&&("function"==typeof s?s(e):ni(s)&&(s.current=e))},[n])}const ii=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),ri="data-"+ii("framerAppearId"),oi=e.createContext({});function ai(t,n,s,i,r){const{visualElement:o}=e.useContext(Ks),a=e.useContext(Fs),l=e.useContext(N),c=e.useContext(As).reducedMotion,u=e.useRef(null);i=i||a.renderer,!u.current&&i&&(u.current=i(t,{visualState:n,parent:o,props:s,presenceContext:l,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:c}));const h=u.current,d=e.useContext(oi);!h||h.projection||!r||"html"!==h.type&&"svg"!==h.type||function(t,e,n,s){const{layoutId:i,layout:r,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:c,layoutCrossfade:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:li(t.parent)),t.projection.setOptions({layoutId:i,layout:r,alwaysMeasureLayout:Boolean(o)||a&&ni(a),visualElement:t,animationType:"string"==typeof r?r:"both",initialPromotionConfig:s,crossfade:u,layoutScroll:l,layoutRoot:c})}(u.current,s,r,d);const m=e.useRef(!1);e.useInsertionEffect(()=>{h&&m.current&&h.update(s,l)});const p=s[ri],f=e.useRef(Boolean(p)&&!window.MotionHandoffIsComplete?.(p)&&window.MotionHasOptimisedAnimation?.(p));return M(()=>{h&&(m.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),ds.render(h.render),f.current&&h.animationState&&h.animationState.animateChanges())}),e.useEffect(()=>{h&&(!f.current&&h.animationState&&h.animationState.animateChanges(),f.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(p)}),f.current=!1))}),h}function li(t){if(t)return!1!==t.options.allowProjection?t.projection:li(t.parent)}function ci({preloadedFeatures:n,createVisualElement:s,useRender:i,useVisualState:r,Component:o}){function a(a,l){let c;const u={...e.useContext(As),...a,layoutId:ui(a)},{isStatic:h}=u,d=Qs(a),m=r(a,h);if(!h&&A){!function(t,n){const s=e.useContext(Fs).strict;if("production"!==process.env.NODE_ENV&&n&&s){const e="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";t.ignoreStrict?R(!1,e):O(!1,e)}}(u,n);const t=function(t){const{drag:e,layout:n}=$s;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}(u);c=t.MeasureLayout,d.visualElement=ai(o,m,u,s,t.ProjectionNode)}return t.jsxs(Ks.Provider,{value:d,children:[c&&d.visualElement?t.jsx(c,{visualElement:d.visualElement,...u}):null,i(o,a,si(m,d.visualElement,l),m,h,d.visualElement)]})}n&&function(t){for(const e in t)$s[e]={...$s[e],...t[e]}}(n),a.displayName=`motion.${"string"==typeof o?o:`create(${o.displayName??o.name??""})`}`;const l=e.forwardRef(a);return l[ei]=o,l}function ui({layoutId:t}){const n=e.useContext(C).id;return n&&void 0!==t?n+"-"+t:t}const hi={};function di(t,{layout:e,layoutId:n}){return pn.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!hi[t]||"opacity"===t)}const mi={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},pi=mn.length;function fi(t,e,n){const{style:s,vars:i,transformOrigin:r}=t;let o=!1,a=!1;for(const t in e){const n=e[t];if(pn.has(t))o=!0;else if(Et(t))i[t]=n;else{const e=cs(n,ss[t]);t.startsWith("origin")?(a=!0,r[t]=e):s[t]=e}}if(e.transform||(o||n?s.transform=function(t,e,n){let s="",i=!0;for(let r=0;r<pi;r++){const o=mn[r],a=t[o];if(void 0===a)continue;let l=!0;if(l="number"==typeof a?a===(o.startsWith("scale")?1:0):0===parseFloat(a),!l||n){const t=cs(a,ss[o]);l||(i=!1,s+=`${mi[o]||o}(${t}) `),n&&(e[o]=t)}}return s=s.trim(),n?s=n(e,i?"":s):i&&(s="none"),s}(e,t.transform,n):s.transform&&(s.transform="none")),a){const{originX:t="50%",originY:e="50%",originZ:n=0}=r;s.transformOrigin=`${t} ${e} ${n}`}}const gi=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function yi(t,e,n){for(const s in e)Cs(e[s])||di(s,n)||(t[s]=e[s])}function vi(t,n){const s={};return yi(s,t.style||{},t),Object.assign(s,function({transformTemplate:t},n){return e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{}};return fi(e,n,t),Object.assign({},e.vars,e.style)},[n])}(t,n)),s}function xi(t,e){const n={},s=vi(t,e);return t.drag&&!1!==t.dragListener&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const bi={offset:"stroke-dashoffset",array:"stroke-dasharray"},wi={offset:"strokeDashoffset",array:"strokeDasharray"};function Ti(t,{attrX:e,attrY:n,attrScale:s,pathLength:i,pathSpacing:r=1,pathOffset:o=0,...a},l,c,u){if(fi(t,a,c),l)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:h,style:d}=t;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox),void 0!==e&&(h.x=e),void 0!==n&&(h.y=n),void 0!==s&&(h.scale=s),void 0!==i&&function(t,e,n=1,s=0,i=!0){t.pathLength=1;const r=i?bi:wi;t[r.offset]=Ht.transform(-s);const o=Ht.transform(e),a=Ht.transform(n);t[r.array]=`${o} ${a}`}(h,i,r,o,!1)}const ji=()=>({style:{},transform:{},transformOrigin:{},vars:{},attrs:{}}),Pi=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Si(t,n,s,i){const r=e.useMemo(()=>{const e={style:{},transform:{},transformOrigin:{},vars:{},attrs:{}};return Ti(e,n,Pi(i),t.transformTemplate,t.style),{...e.attrs,style:{...e.style}}},[n]);if(t.style){const e={};yi(e,t.style,t),r.style={...e,...r.style}}return r}const Ei=["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 Ci(t){return"string"==typeof t&&!t.includes("-")&&!!(Ei.indexOf(t)>-1||/[A-Z]/u.test(t))}function ki(t=!1){return(n,s,i,{latestValues:r},o)=>{const a=(Ci(n)?Si:xi)(s,r,o,n),l=function(t,e,n){const s={};for(const i in t)"values"===i&&"object"==typeof t.values||(zs(i)||!0===n&&Ws(i)||!e&&!Ws(i)||t.draggable&&i.startsWith("onDrag"))&&(s[i]=t[i]);return s}(s,"string"==typeof n,t),c=n!==e.Fragment?{...l,...a,ref:i}:{},{children:u}=s,h=e.useMemo(()=>Cs(u)?u.get():u,[u]);return e.createElement(n,{...c,children:h})}}function Ai(t){const e=[{},{}];return t?.values.forEach((t,n)=>{e[0][n]=t.get(),e[1][n]=t.getVelocity()}),e}function Mi(t,e,n,s){if("function"==typeof e){const[i,r]=Ai(s);e=e(void 0!==n?n:t.custom,i,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[i,r]=Ai(s);e=e(void 0!==n?n:t.custom,i,r)}return e}function Ni(t){return Cs(t)?t.get():t}const Vi=t=>(n,s)=>{const i=e.useContext(Ks),r=e.useContext(N),o=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e},n,s,i){return{latestValues:Di(n,s,i,t),renderState:e()}}(t,n,i,r);return s?o():k(o)};function Di(t,e,n,s){const i={},r=s(t,{});for(const t in r)i[t]=Ni(r[t]);let{initial:o,animate:a}=t;const l=Zs(t),c=Js(t);e&&c&&!l&&!1!==t.inherit&&(void 0===o&&(o=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===o;const h=u?a:o;if(h&&"boolean"!=typeof h&&!Xs(h)){const e=Array.isArray(h)?h:[h];for(let n=0;n<e.length;n++){const s=Mi(t,e[n]);if(s){const{transitionEnd:t,transition:e,...n}=s;for(const t in n){let e=n[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(i[t]=e)}for(const e in t)i[e]=t[e]}}}return i}function Li(t,e,n){const{style:s}=t,i={};for(const r in s)(Cs(s[r])||e.style&&Cs(e.style[r])||di(r,t)||void 0!==n?.getValue(r)?.liveStyle)&&(i[r]=s[r]);return i}const Ri={useVisualState:Vi({scrapeMotionValuesFromProps:Li,createRenderState:gi})};function Oi(t,e,n){const s=Li(t,e,n);for(const n in t)if(Cs(t[n])||Cs(e[n])){s[-1!==mn.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=t[n]}return s}const Bi={useVisualState:Vi({scrapeMotionValuesFromProps:Oi,createRenderState:ji})};function Fi(t,e){return function(n,{forwardMotionProps:s}={forwardMotionProps:!1}){return ci({...Ci(n)?Bi:Ri,preloadedFeatures:t,useRender:ki(s),createVisualElement:e,Component:n})}}function Ii(t,e,n){const s=t.getProps();return Mi(s,e,void 0!==n?n:s.custom,t)}const $i=t=>Array.isArray(t);function Ui(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,hs(n))}function Wi(t){return $i(t)?t[t.length-1]||0:t}function zi(t,e){const n=t.getValue("willChange");if(s=n,Boolean(Cs(s)&&s.add))return n.add(e);if(!n&&B.WillChange){const n=new B.WillChange("auto");t.addValue("willChange",n),n.add(e)}var s}function Hi(t){return t.props[ri]}const Yi=t=>null!==t;const Ki={type:"spring",stiffness:500,damping:25,restSpeed:10},Xi={type:"keyframes",duration:.8},qi={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Gi=(t,{keyframes:e})=>e.length>2?Xi:pn.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:Ki:qi;const _i=(t,e,n,s={},i,r)=>o=>{const a=Kn(s,t)||{},l=a.delay||s.delay||0;let{elapsed:c=0}=s;c-=X(l);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-c,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:i};(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length})(a)||Object.assign(u,Gi(t,u)),u.duration&&(u.duration=X(u.duration)),u.repeatDelay&&(u.repeatDelay=X(u.repeatDelay)),void 0!==u.from&&(u.keyframes[0]=u.from);let h=!1;if((!1===u.type||0===u.duration&&!u.repeatDelay)&&(u.duration=0,0===u.delay&&(h=!0)),(B.instantAnimations||B.skipAnimations)&&(h=!0,u.duration=0,u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!r&&void 0!==e.get()){const t=function(t,{repeat:e,repeatType:n="loop"},s){const i=t.filter(Yi),r=e&&"loop"!==n&&e%2==1?0:i.length-1;return r&&void 0!==s?s:i[r]}(u.keyframes,a);if(void 0!==t)return void vt.update(()=>{u.onUpdate(t),u.onComplete()})}return a.isSync?new en(u):new zn(u)};function Zi({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}function Ji(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:r=t.getDefaultTransition(),transitionEnd:o,...a}=e;s&&(r=s);const l=[],c=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const s=t.getValue(e,t.latestValues[e]??null),i=a[e];if(void 0===i||c&&Zi(c,e))continue;const o={delay:n,...Kn(r||{},e)},u=s.get();if(void 0!==u&&!s.isAnimating&&!Array.isArray(i)&&i===u&&!o.velocity)continue;let h=!1;if(window.MotionHandoffAnimation){const n=Hi(t);if(n){const t=window.MotionHandoffAnimation(n,e,vt);null!==t&&(o.startTime=t,h=!0)}}zi(t,e),s.start(_i(e,s,i,t.shouldReduceMotion&&Xn.has(e)?{type:!1}:o,t,h));const d=s.animation;d&&l.push(d)}return o&&Promise.all(l).then(()=>{vt.update(()=>{o&&function(t,e){const n=Ii(t,e);let{transitionEnd:s={},transition:i={},...r}=n||{};r={...r,...s};for(const e in r)Ui(t,e,Wi(r[e]))}(t,o)})}),l}function Qi(t,e,n={}){const s=Ii(t,e,"exit"===n.type?t.presenceContext?.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const r=s?()=>Promise.all(Ji(t,s,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:r=0,staggerChildren:o,staggerDirection:a}=i;return function(t,e,n=0,s=0,i=1,r){const o=[],a=(t.variantChildren.size-1)*s,l=1===i?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(tr).forEach((t,s)=>{t.notify("AnimationStart",e),o.push(Qi(t,e,{...r,delay:n+l(s)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(o)}(t,e,r+s,o,a,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[t,e]="beforeChildren"===a?[r,o]:[o,r];return t().then(()=>e())}return Promise.all([r(),o(n.delay)])}function tr(t,e){return t.sortNodePosition(e)}function er(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const nr=_s.length;function sr(t){if(!t)return;if(!t.isControllingVariants){const e=t.parent&&sr(t.parent)||{};return void 0!==t.props.initial&&(e.initial=t.props.initial),e}const e={};for(let n=0;n<nr;n++){const s=_s[n],i=t.props[s];(qs(i)||!1===i)&&(e[s]=i)}return e}const ir=[...Gs].reverse(),rr=Gs.length;function or(t){return e=>Promise.all(e.map(({animation:e,options:n})=>function(t,e,n={}){let s;if(t.notify("AnimationStart",e),Array.isArray(e)){const i=e.map(e=>Qi(t,e,n));s=Promise.all(i)}else if("string"==typeof e)s=Qi(t,e,n);else{const i="function"==typeof e?Ii(t,e,n.custom):e;s=Promise.all(Ji(t,i,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}(t,e,n)))}function ar(t){let e=or(t),n=ur(),s=!0;const i=e=>(n,s)=>{const i=Ii(t,s,"exit"===e?t.presenceContext?.custom:void 0);if(i){const{transition:t,transitionEnd:e,...s}=i;n={...n,...s,...e}}return n};function r(r){const{props:o}=t,a=sr(t.parent)||{},l=[],c=new Set;let u={},h=1/0;for(let e=0;e<rr;e++){const d=ir[e],m=n[d],p=void 0!==o[d]?o[d]:a[d],f=qs(p),g=d===r?m.isActive:null;!1===g&&(h=e);let y=p===a[d]&&p!==o[d]&&f;if(y&&s&&t.manuallyAnimateOnMount&&(y=!1),m.protectedKeys={...u},!m.isActive&&null===g||!p&&!m.prevProp||Xs(p)||"boolean"==typeof p)continue;const v=lr(m.prevProp,p);let x=v||d===r&&m.isActive&&!y&&f||e>h&&f,b=!1;const w=Array.isArray(p)?p:[p];let T=w.reduce(i(d),{});!1===g&&(T={});const{prevResolvedValues:j={}}=m,P={...j,...T},S=e=>{x=!0,c.has(e)&&(b=!0,c.delete(e)),m.needsAnimating[e]=!0;const n=t.getValue(e);n&&(n.liveStyle=!1)};for(const t in P){const e=T[t],n=j[t];if(u.hasOwnProperty(t))continue;let s=!1;s=$i(e)&&$i(n)?!er(e,n):e!==n,s?null!=e?S(t):c.add(t):void 0!==e&&c.has(t)?S(t):m.protectedKeys[t]=!0}m.prevProp=p,m.prevResolvedValues=T,m.isActive&&(u={...u,...T}),s&&t.blockInitialAnimation&&(x=!1);x&&(!(y&&v)||b)&&l.push(...w.map(t=>({animation:t,options:{type:d}})))}if(c.size){const e={};if("boolean"!=typeof o.initial){const n=Ii(t,Array.isArray(o.initial)?o.initial[0]:o.initial);n&&n.transition&&(e.transition=n.transition)}c.forEach(n=>{const s=t.getBaseTarget(n),i=t.getValue(n);i&&(i.liveStyle=!0),e[n]=s??null}),l.push({animation:e})}let d=Boolean(l.length);return!s||!1!==o.initial&&o.initial!==o.animate||t.manuallyAnimateOnMount||(d=!1),s=!1,d?e(l):Promise.resolve()}return{animateChanges:r,setActive:function(e,s){if(n[e].isActive===s)return Promise.resolve();t.variantChildren?.forEach(t=>t.animationState?.setActive(e,s)),n[e].isActive=s;const i=r(e);for(const t in n)n[t].protectedKeys={};return i},setAnimateFunction:function(n){e=n(t)},getState:()=>n,reset:()=>{n=ur(),s=!0}}}function lr(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!er(e,t)}function cr(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ur(){return{animate:cr(!0),whileInView:cr(),whileHover:cr(),whileTap:cr(),whileDrag:cr(),whileFocus:cr(),exit:cr()}}class hr{constructor(t){this.isMounted=!1,this.node=t}update(){}}let dr=0;const mr={animation:{Feature:class extends hr{constructor(t){super(t),t.animationState||(t.animationState=ar(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Xs(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}},exit:{Feature:class extends hr{constructor(){super(...arguments),this.id=dr++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;const s=this.node.animationState.setActive("exit",!t);e&&!t&&s.then(()=>{e(this.id)})}mount(){const{register:t,onExitComplete:e}=this.node.presenceContext||{};e&&e(this.id),t&&(this.unmount=t(this.id))}unmount(){}}}};function pr(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function fr(t){return{point:{x:t.pageX,y:t.pageY}}}function gr(t,e,n,s){return pr(t,e,(t=>e=>xs(e)&&t(e,fr(e)))(n),s)}function yr({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function vr(t){return t.max-t.min}function xr(t,e,n,s=.5){t.origin=s,t.originPoint=ae(e.min,e.max,t.origin),t.scale=vr(n)/vr(e),t.translate=ae(n.min,n.max,t.origin)-t.originPoint,(t.scale>=.9999&&t.scale<=1.0001||isNaN(t.scale))&&(t.scale=1),(t.translate>=-.01&&t.translate<=.01||isNaN(t.translate))&&(t.translate=0)}function br(t,e,n,s){xr(t.x,e.x,n.x,s?s.originX:void 0),xr(t.y,e.y,n.y,s?s.originY:void 0)}function wr(t,e,n){t.min=n.min+e.min,t.max=t.min+vr(e)}function Tr(t,e,n){t.min=e.min-n.min,t.max=t.min+vr(e)}function jr(t,e,n){Tr(t.x,e.x,n.x),Tr(t.y,e.y,n.y)}const Pr=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Sr(t){return[t("x"),t("y")]}function Er(t){return void 0===t||1===t}function Cr({scale:t,scaleX:e,scaleY:n}){return!Er(t)||!Er(e)||!Er(n)}function kr(t){return Cr(t)||Ar(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function Ar(t){return Mr(t.x)||Mr(t.y)}function Mr(t){return t&&"0%"!==t}function Nr(t,e,n){return n+e*(t-n)}function Vr(t,e,n,s,i){return void 0!==i&&(t=Nr(t,i,s)),Nr(t,n,s)+e}function Dr(t,e=0,n=1,s,i){t.min=Vr(t.min,e,n,s,i),t.max=Vr(t.max,e,n,s,i)}function Lr(t,{x:e,y:n}){Dr(t.x,e.translate,e.scale,e.originPoint),Dr(t.y,n.translate,n.scale,n.originPoint)}const Rr=.999999999999,Or=1.0000000000001;function Br(t,e){t.min=t.min+e,t.max=t.max+e}function Fr(t,e,n,s,i=.5){Dr(t,e,n,ae(t.min,t.max,i),s)}function Ir(t,e){Fr(t.x,e.x,e.scaleX,e.scale,e.originX),Fr(t.y,e.y,e.scaleY,e.scale,e.originY)}function $r(t,e){return yr(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}const Ur=({current:t})=>t?t.ownerDocument.defaultView:null,Wr=(t,e)=>Math.abs(t-e);class zr{constructor(t,e,{transformPagePoint:n,contextWindow:s,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 t=Kr(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=Wr(t.x,e.x),s=Wr(t.y,e.y);return Math.sqrt(n**2+s**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:s}=t,{timestamp:i}=bt;this.history.push({...s,timestamp:i});const{onStart:r,onMove:o}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=Hr(e,this.transformPagePoint),vt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:s,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const r=Kr("pointercancel"===t.type?this.lastMoveEventInfo:Hr(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,r),s&&s(t,r)},!xs(t))return;this.dragSnapToOrigin=i,this.handlers=e,this.transformPagePoint=n,this.contextWindow=s||window;const r=Hr(fr(t),this.transformPagePoint),{point:o}=r,{timestamp:a}=bt;this.history=[{...o,timestamp:a}];const{onSessionStart:l}=e;l&&l(t,Kr(r,this.history)),this.removeListeners=H(gr(this.contextWindow,"pointermove",this.handlePointerMove),gr(this.contextWindow,"pointerup",this.handlePointerUp),gr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),xt(this.updatePoint)}}function Hr(t,e){return e?{point:e(t.point)}:t}function Yr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Kr({point:t},e){return{point:t,delta:Yr(t,qr(e)),offset:Yr(t,Xr(e)),velocity:Gr(e,.1)}}function Xr(t){return t[0]}function qr(t){return t[t.length-1]}function Gr(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=qr(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>X(e)));)n--;if(!s)return{x:0,y:0};const r=q(i.timestamp-s.timestamp);if(0===r)return{x:0,y:0};const o={x:(i.x-s.x)/r,y:(i.y-s.y)/r};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function _r(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Zr(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}const Jr=.35;function Qr(t,e,n){return{min:to(t,e),max:to(t,n)}}function to(t,e){return"number"==typeof t?t:t[e]||0}const eo=new WeakMap;class no{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={x:{min:0,max:0},y:{min:0,max:0}},this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:s}=this.getProps();this.panSession=new zr(t,{onSessionStart:t=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),e&&this.snapToCursor(fr(t).point)},onStart:(t,e)=>{const{drag:n,dragPropagation:s,onDragStart:i}=this.getProps();if(n&&!s&&(this.openDragLock&&this.openDragLock(),this.openDragLock="x"===(r=n)||"y"===r?ps[r]?null:(ps[r]=!0,()=>{ps[r]=!1}):ps.x||ps.y?null:(ps.x=ps.y=!0,()=>{ps.x=ps.y=!1}),!this.openDragLock))return;var r;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Sr(t=>{let e=this.getAxisMotionValue(t).get()||0;if(zt.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const s=n.layout.layoutBox[t];if(s){e=vr(s)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),i&&vt.postRender(()=>i(t,e)),zi(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:s,onDirectionLock:i,onDrag:r}=this.getProps();if(!n&&!this.openDragLock)return;const{offset:o}=e;if(s&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(o),void(null!==this.currentDirection&&i&&i(this.currentDirection));this.updateAxis("x",e.point,o),this.updateAxis("y",e.point,o),this.visualElement.render(),r&&r(t,e)},onSessionEnd:(t,e)=>this.stop(t,e),resumeAnimation:()=>Sr(t=>"paused"===this.getAnimationState(t)&&this.getAxisMotionValue(t).animation?.play())},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:s,contextWindow:Ur(this.visualElement)})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:s}=e;this.startAnimation(s);const{onDragEnd:i}=this.getProps();i&&vt.postRender(()=>i(t,e))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:s}=this.getProps();if(!n||!so(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let r=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(r=function(t,{min:e,max:n},s){return void 0!==e&&t<e?t=s?ae(e,t,s.min):Math.max(t,e):void 0!==n&&t>n&&(t=s?ae(n,t,s.max):Math.min(t,n)),t}(r,this.constraints[t],this.elastic[t])),i.set(r)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,s=this.constraints;t&&ni(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:s,right:i}){return{x:_r(t.x,n,i),y:_r(t.y,e,s)}}(n.layoutBox,t),this.elastic=function(t=Jr){return!1===t?t=0:!0===t&&(t=Jr),{x:Qr(t,"left","right"),y:Qr(t,"top","bottom")}}(e),s!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Sr(t=>{!1!==this.constraints&&this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!ni(t))return!1;const n=t.current;O(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=function(t,e,n){const s=$r(t,n),{scroll:i}=e;return i&&(Br(s.x,i.offset.x),Br(s.y,i.offset.y)),s}(n,s.root,this.visualElement.getTransformPagePoint());let r=function(t,e){return{x:Zr(t.x,e.x),y:Zr(t.y,e.y)}}(s.layout.layoutBox,i);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(r));this.hasMutatedConstraints=!!t,t&&(r=yr(t))}return r}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:s,dragTransition:i,dragSnapToOrigin:r,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{},l=Sr(o=>{if(!so(o,e,this.currentDirection))return;let l=a&&a[o]||{};r&&(l={min:0,max:0});const c=s?200:1e6,u=s?40:1e7,h={type:"inertia",velocity:n?t[o]:0,bounceStiffness:c,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(o,h)});return Promise.all(l).then(o)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return zi(this.visualElement,t),n.start(_i(t,n,0,e,this.visualElement,!1))}stopAnimation(){Sr(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Sr(t=>this.getAxisMotionValue(t).animation?.pause())}getAnimationState(t){return this.getAxisMotionValue(t).animation?.state}getAxisMotionValue(t){const e=`_drag${t.toUpperCase()}`,n=this.visualElement.getProps(),s=n[e];return s||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){Sr(e=>{const{drag:n}=this.getProps();if(!so(e,n,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(e);if(s&&s.layout){const{min:n,max:r}=s.layout.layoutBox[e];i.set(t[e]-ae(n,r,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!ni(e)||!n||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Sr(t=>{const e=this.getAxisMotionValue(t);if(e&&!1!==this.constraints){const n=e.get();s[t]=function(t,e){let n=.5;const s=vr(t),i=vr(e);return i>s?n=Y(e.min,e.max-s,t.min):s>i&&(n=Y(t.min,t.max-i,e.min)),L(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Sr(e=>{if(!so(e,t,null))return;const n=this.getAxisMotionValue(e),{min:i,max:r}=this.constraints[e];n.set(ae(i,r,s[e]))})}addListeners(){if(!this.visualElement.current)return;eo.set(this.visualElement,this);const t=gr(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();ni(t)&&t.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,s=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),vt.read(e);const i=pr(window,"resize",()=>this.scalePositionWithinConstraints()),r=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Sr(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{i(),t(),s(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:r=Jr,dragMomentum:o=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:s,dragConstraints:i,dragElastic:r,dragMomentum:o}}}function so(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const io=t=>(e,n)=>{t&&vt.postRender(()=>t(e,n))};const ro={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function oo(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const ao={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!Ht.test(t))return t;t=parseFloat(t)}return`${oo(t,e.target.x)}% ${oo(t,e.target.y)}%`}},lo={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=ie.parse(t);if(i.length>5)return s;const r=ie.createTransformer(t),o="number"!=typeof i[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;i[0+o]/=a,i[1+o]/=l;const c=ae(a,l,.5);return"number"==typeof i[2+o]&&(i[2+o]/=c),"number"==typeof i[3+o]&&(i[3+o]/=c),r(i)}};class co extends e.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:s}=this.props,{projection:i}=t;!function(t){for(const e in t)hi[e]=t[e],Et(e)&&(hi[e].isCSSVariable=!0)}(ho),i&&(e.group&&e.group.add(i),n&&n.register&&s&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),ro.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:s,isPresent:i}=this.props,{projection:r}=n;return r?(r.isPresent=i,s||t.layoutDependency!==e||void 0===e||t.isPresent!==i?r.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?r.promote():r.relegate()||vt.postRender(()=>{const t=r.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),ds.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(s),n&&n.deregister&&n.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function uo(n){const[s,i]=Ls(),r=e.useContext(C);return t.jsx(co,{...n,layoutGroup:r,switchLayoutGroup:e.useContext(oi),isPresent:s,safeToRemove:i})}const ho={borderRadius:{...ao,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ao,borderTopRightRadius:ao,borderBottomLeftRadius:ao,borderBottomRightRadius:ao,boxShadow:lo};const mo=(t,e)=>t.depth-e.depth;class po{constructor(){this.children=[],this.isDirty=!1}add(t){V(this.children,t),this.isDirty=!0}remove(t){D(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(mo),this.isDirty=!1,this.children.forEach(t)}}const fo=["TopLeft","TopRight","BottomLeft","BottomRight"],go=fo.length,yo=t=>"string"==typeof t?parseFloat(t):t,vo=t=>"number"==typeof t||Ht.test(t);function xo(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const bo=To(0,.5,at),wo=To(.5,.95,W);function To(t,e,n){return s=>s<t?0:s>e?1:n(Y(t,e,s))}function jo(t,e){t.min=e.min,t.max=e.max}function Po(t,e){jo(t.x,e.x),jo(t.y,e.y)}function So(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Eo(t,e,n,s,i){return t=Nr(t-=e,1/n,s),void 0!==i&&(t=Nr(t,1/i,s)),t}function Co(t,e,[n,s,i],r,o){!function(t,e=0,n=1,s=.5,i,r=t,o=t){zt.test(e)&&(e=parseFloat(e),e=ae(o.min,o.max,e/100)-o.min);if("number"!=typeof e)return;let a=ae(r.min,r.max,s);t===r&&(a-=e),t.min=Eo(t.min,e,n,a,i),t.max=Eo(t.max,e,n,a,i)}(t,e[n],e[s],e[i],e.scale,r,o)}const ko=["x","scaleX","originX"],Ao=["y","scaleY","originY"];function Mo(t,e,n,s){Co(t.x,e,ko,n?n.x:void 0,s?s.x:void 0),Co(t.y,e,Ao,n?n.y:void 0,s?s.y:void 0)}function No(t){return 0===t.translate&&1===t.scale}function Vo(t){return No(t.x)&&No(t.y)}function Do(t,e){return t.min===e.min&&t.max===e.max}function Lo(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function Ro(t,e){return Lo(t.x,e.x)&&Lo(t.y,e.y)}function Oo(t){return vr(t.x)/vr(t.y)}function Bo(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Fo{constructor(){this.members=[]}add(t){V(this.members,t),t.scheduleRender()}remove(t){if(D(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex(e=>t===e);if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;!1===s&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const Io=["","X","Y","Z"],$o={visibility:"hidden"};let Uo=0;function Wo(t,e,n,s){const{latestValues:i}=e;i[t]&&(n[t]=i[t],e.setStaticValue(t,0),s&&(s[t]=0))}function zo(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Hi(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:e,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",vt,!(e||s))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&zo(s)}function Ho({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(t={},n=e?.()){this.id=Uo++,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(Xo),this.nodes.forEach(ta),this.nodes.forEach(ea),this.nodes.forEach(qo)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new po)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new K),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e){if(this.instance)return;var n;this.isSVG=Es(e)&&!(Es(n=e)&&"svg"===n.tagName),this.instance=e;const{layoutId:s,layout:i,visualElement:r}=this.options;if(r&&!r.current&&r.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(i||s)&&(this.isLayoutDirty=!0),t){let n;const s=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=Pt.now(),s=({timestamp:i})=>{const r=i-n;r>=e&&(xt(s),t(r-e))};return vt.setup(s,!0),()=>xt(s)}(s,250),ro.hasAnimatedSinceResize&&(ro.hasAnimatedSinceResize=!1,this.nodes.forEach(Qo))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&r&&(s||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeLayoutChanged:n,layout:s})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||r.getDefaultTransition()||aa,{onLayoutAnimationStart:o,onLayoutAnimationComplete:a}=r.getProps(),l=!this.targetLayout||!Ro(this.targetLayout,s),c=!e&&n;if(this.options.layoutRoot||this.resumeFrom||c||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const e={...Kn(i,"layout"),onPlay:o,onComplete:a};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e),this.setAnimationOrigin(t,c)}else e||Qo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=s})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),xt(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(na),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&zo(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const s=this.getTransformTemplate();this.prevTransformTemplateValue=s?s(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){this.updateScheduled=!1;if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(_o);this.isUpdating||this.nodes.forEach(Zo),this.isUpdating=!1,this.nodes.forEach(Jo),this.nodes.forEach(Yo),this.nodes.forEach(Ko),this.clearAllSnapshots();const t=Pt.now();bt.delta=L(0,1e3/60,t-bt.timestamp),bt.timestamp=t,bt.isProcessing=!0,wt.update.process(bt),wt.preRender.process(bt),wt.render.process(bt),bt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ds.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Go),this.sharedNodes.forEach(sa)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,vt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){vt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure(),!this.snapshot||vr(this.snapshot.measuredBox.x)||vr(this.snapshot.measuredBox.y)||(this.snapshot=void 0))}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let t=0;t<this.path.length;t++){this.path[t].updateScroll()}const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&this.instance){const e=s(this.instance);this.scroll={animationId:this.root.animationId,phase:t,isRoot:e,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:e}}}resetTransform(){if(!i)return;const t=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,e=this.projectionDelta&&!Vo(this.projectionDelta),n=this.getTransformTemplate(),s=n?n(this.latestValues,""):void 0,r=s!==this.prevTransformTemplateValue;t&&this.instance&&(e||kr(this.latestValues)||r)&&(i(this.instance,s),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var s;return t&&(n=this.removeTransform(n)),ua((s=n).x),ua(s.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return{x:{min:0,max:0},y:{min:0,max:0}};const e=t.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(da))){const{scroll:t}=this.root;t&&(Br(e.x,t.offset.x),Br(e.y,t.offset.y))}return e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};if(Po(e,t),this.scroll?.wasRoot)return e;for(let n=0;n<this.path.length;n++){const s=this.path[n],{scroll:i,options:r}=s;s!==this.root&&i&&r.layoutScroll&&(i.wasRoot&&Po(e,t),Br(e.x,i.offset.x),Br(e.y,i.offset.y))}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Po(n,t);for(let t=0;t<this.path.length;t++){const s=this.path[t];!e&&s.options.layoutScroll&&s.scroll&&s!==s.root&&Ir(n,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),kr(s.latestValues)&&Ir(n,s.latestValues)}return kr(this.latestValues)&&Ir(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Po(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!kr(n.latestValues))continue;Cr(n.latestValues)&&n.updateSnapshot();const s=Pr();Po(s,n.measurePageBox()),Mo(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,s)}return kr(this.latestValues)&&Mo(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==bt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){const e=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=e.isSharedProjectionDirty);const n=Boolean(this.resumingFrom)||this!==e;if(!(t||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:s,layoutId:i}=this.options;if(this.layout&&(s||i)){if(this.resolvedRelativeTargetAt=bt.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},jr(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Po(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var r,o,a;if(this.relativeTarget||this.targetDelta)if(this.target||(this.target={x:{min:0,max:0},y:{min:0,max:0}},this.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}}),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),r=this.target,o=this.relativeTarget,a=this.relativeParent.target,wr(r.x,o.x,a.x),wr(r.y,o.y,a.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Po(this.target,this.layout.layoutBox),Lr(this.target,this.targetDelta)):Po(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},jr(this.relativeTargetOrigin,this.target,t.target),Po(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Cr(this.parent.latestValues)&&!Ar(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const t=this.getLead(),e=Boolean(this.resumingFrom)||this!==t;let n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),e&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===bt.timestamp&&(n=!1),n)return;const{layout:s,layoutId:i}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!s&&!i)return;Po(this.layoutCorrected,this.layout.layoutBox);const r=this.treeScale.x,o=this.treeScale.y;!function(t,e,n,s=!1){const i=n.length;if(!i)return;let r,o;e.x=e.y=1;for(let a=0;a<i;a++){r=n[a],o=r.projectionDelta;const{visualElement:i}=r.options;i&&i.props.style&&"contents"===i.props.style.display||(s&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Ir(t,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,Lr(t,o)),s&&kr(r.latestValues)&&Ir(t,r.latestValues))}e.x<Or&&e.x>Rr&&(e.x=1),e.y<Or&&e.y>Rr&&(e.y=1)}(this.layoutCorrected,this.treeScale,this.path,e),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms={x:{min:0,max:0},y:{min:0,max:0}});const{target:a}=t;a?(this.projectionDelta&&this.prevProjectionDelta?(So(this.prevProjectionDelta.x,this.projectionDelta.x),So(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),br(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.treeScale.x===r&&this.treeScale.y===o&&Bo(this.projectionDelta.x,this.prevProjectionDelta.x)&&Bo(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.visualElement?.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDelta={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}},this.projectionDeltaWithTransform={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}}setAnimationOrigin(t,e=!1){const n=this.snapshot,s=n?n.latestValues:{},i={...this.latestValues},r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const o={x:{min:0,max:0},y:{min:0,max:0}},a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),c=!l||l.members.length<=1,u=Boolean(a&&!c&&!0===this.options.crossfade&&!this.path.some(oa));let h;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var l,d,m,p,f,g;ia(r.x,t.x,n),ia(r.y,t.y,n),this.setTargetDelta(r),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(jr(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),m=this.relativeTarget,p=this.relativeTargetOrigin,f=o,g=n,ra(m.x,p.x,f.x,g),ra(m.y,p.y,f.y,g),h&&(l=this.relativeTarget,d=h,Do(l.x,d.x)&&Do(l.y,d.y))&&(this.isProjectionDirty=!1),h||(h={x:{min:0,max:0},y:{min:0,max:0}}),Po(h,this.relativeTarget)),a&&(this.animationValues=i,function(t,e,n,s,i,r){i?(t.opacity=ae(0,n.opacity??1,bo(s)),t.opacityExit=ae(e.opacity??1,0,wo(s))):r&&(t.opacity=ae(e.opacity??1,n.opacity??1,s));for(let i=0;i<go;i++){const r=`border${fo[i]}Radius`;let o=xo(e,r),a=xo(n,r);void 0===o&&void 0===a||(o||(o=0),a||(a=0),0===o||0===a||vo(o)===vo(a)?(t[r]=Math.max(ae(yo(o),yo(a),s),0),(zt.test(a)||zt.test(o))&&(t[r]+="%")):t[r]=a)}(e.rotate||n.rotate)&&(t.rotate=ae(e.rotate||0,n.rotate||0,s))}(i,s,this.latestValues,n,u,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(xt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=vt.update(()=>{ro.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=hs(0)),this.currentAnimation=function(t,e,n){const s=Cs(t)?t:hs(t);return s.start(_i("",s,e,n)),s.animation}(this.motionValue,[0,1e3],{...t,velocity:0,isSync:!0,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onStop:()=>{},onComplete:()=>{t.onComplete&&t.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 t=this.getStack();t&&t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const t=this.getLead();let{targetWithTransforms:e,target:n,layout:s,latestValues:i}=t;if(e&&n&&s){if(this!==t&&this.layout&&s&&ha(this.options.animationType,this.layout.layoutBox,s.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=vr(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const s=vr(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+s}Po(e,n),Ir(e,i),br(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new Fo);this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){const{layoutId:t}=this.options;return t&&this.getStack()?.lead||this}getPrevLead(){const{layoutId:t}=this.options;return t?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const s=this.getStack();s&&s.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetSkewAndRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(e=!0),!e)return;const s={};n.z&&Wo("z",t,s,this.animationValues);for(let e=0;e<Io.length;e++)Wo(`rotate${Io[e]}`,t,s,this.animationValues),Wo(`skew${Io[e]}`,t,s,this.animationValues);t.render();for(const e in s)t.setStaticValue(e,s[e]),this.animationValues&&(this.animationValues[e]=s[e]);t.scheduleRender()}getProjectionStyles(t){if(!this.instance||this.isSVG)return;if(!this.isVisible)return $o;const e={visibility:""},n=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,e.opacity="",e.pointerEvents=Ni(t?.pointerEvents)||"",e.transform=n?n(this.latestValues,""):"none",e;const s=this.getLead();if(!this.projectionDelta||!this.layout||!s.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=Ni(t?.pointerEvents)||""),this.hasProjected&&!kr(this.latestValues)&&(e.transform=n?n({},""):"none",this.hasProjected=!1),e}const i=s.animationValues||s.latestValues;this.applyTransformsToTarget(),e.transform=function(t,e,n){let s="";const i=t.x.translate/e.x,r=t.y.translate/e.y,o=n?.z||0;if((i||r||o)&&(s=`translate3d(${i}px, ${r}px, ${o}px) `),1===e.x&&1===e.y||(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:t,rotate:e,rotateX:i,rotateY:r,skewX:o,skewY:a}=n;t&&(s=`perspective(${t}px) ${s}`),e&&(s+=`rotate(${e}deg) `),i&&(s+=`rotateX(${i}deg) `),r&&(s+=`rotateY(${r}deg) `),o&&(s+=`skewX(${o}deg) `),a&&(s+=`skewY(${a}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return 1===a&&1===l||(s+=`scale(${a}, ${l})`),s||"none"}(this.projectionDeltaWithTransform,this.treeScale,i),n&&(e.transform=n(i,e.transform));const{x:r,y:o}=this.projectionDelta;e.transformOrigin=`${100*r.origin}% ${100*o.origin}% 0`,s.animationValues?e.opacity=s===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:e.opacity=s===this?void 0!==i.opacity?i.opacity:"":void 0!==i.opacityExit?i.opacityExit:0;for(const t in hi){if(void 0===i[t])continue;const{correct:n,applyTo:r,isCSSVariable:o}=hi[t],a="none"===e.transform?i[t]:n(i[t],s);if(r){const t=r.length;for(let n=0;n<t;n++)e[r[n]]=a}else o?this.options.visualElement.renderState.vars[t]=a:e[t]=a}return this.options.layoutId&&(e.pointerEvents=s===this?Ni(t?.pointerEvents)||"":"none"),e}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>t.currentAnimation?.stop()),this.root.nodes.forEach(_o),this.root.sharedNodes.clear()}}}function Yo(t){t.updateLayout()}function Ko(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:i}=t.options,r=e.source!==t.layout.source;"size"===i?Sr(t=>{const s=r?e.measuredBox[t]:e.layoutBox[t],i=vr(s);s.min=n[t].min,s.max=s.min+i}):ha(i,e.layoutBox,n)&&Sr(s=>{const i=r?e.measuredBox[s]:e.layoutBox[s],o=vr(n[s]);i.max=i.min+o,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[s].max=t.relativeTarget[s].min+o)});const o={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};br(o,n,e.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};r?br(a,t.applyTransform(s,!0),e.measuredBox):br(a,n,e.layoutBox);const l=!Vo(o);let c=!1;if(!t.resumeFrom){const s=t.getClosestProjectingParent();if(s&&!s.resumeFrom){const{snapshot:i,layout:r}=s;if(i&&r){const o={x:{min:0,max:0},y:{min:0,max:0}};jr(o,e.layoutBox,i.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};jr(a,n,r.layoutBox),Ro(o,a)||(c=!0),s.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=o,t.relativeParent=s)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeLayoutChanged:c})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Xo(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function qo(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Go(t){t.clearSnapshot()}function _o(t){t.clearMeasurements()}function Zo(t){t.isLayoutDirty=!1}function Jo(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Qo(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function ta(t){t.resolveTargetDelta()}function ea(t){t.calcProjection()}function na(t){t.resetSkewAndRotation()}function sa(t){t.removeLeadSnapshot()}function ia(t,e,n){t.translate=ae(e.translate,0,n),t.scale=ae(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function ra(t,e,n,s){t.min=ae(e.min,n.min,s),t.max=ae(e.max,n.max,s)}function oa(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const aa={duration:.45,ease:[.4,0,.1,1]},la=t=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),ca=la("applewebkit/")&&!la("chrome/")?Math.round:W;function ua(t){t.min=ca(t.min),t.max=ca(t.max)}function ha(t,e,n){return"position"===t||"preserve-aspect"===t&&(s=Oo(e),i=Oo(n),r=.2,!(Math.abs(s-i)<=r));var s,i,r}function da(t){return t!==t.root&&t.scroll?.wasRoot}const ma=Ho({attachResizeListener:(t,e)=>pr(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),pa={current:void 0},fa=Ho({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!pa.current){const t=new ma({});t.mount(window),t.setOptions({layoutScroll:!0}),pa.current=t}return pa.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ga={pan:{Feature:class extends hr{constructor(){super(...arguments),this.removePointerDownListener=W}onPointerDown(t){this.session=new zr(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Ur(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:s}=this.node.getProps();return{onSessionStart:io(t),onStart:io(e),onMove:n,onEnd:(t,e)=>{delete this.session,s&&vt.postRender(()=>s(t,e))}}}mount(){this.removePointerDownListener=gr(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends hr{constructor(t){super(t),this.removeGroupControls=W,this.removeListeners=W,this.controls=new no(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||W}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:fa,MeasureLayout:uo}};function ya(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover","Start"===n);const i=s["onHover"+n];i&&vt.postRender(()=>i(e,fr(e)))}function va(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap","Start"===n);const i=s["onTap"+("End"===n?"":n)];i&&vt.postRender(()=>i(e,fr(e)))}const xa=new WeakMap,ba=new WeakMap,wa=t=>{const e=xa.get(t.target);e&&e(t)},Ta=t=>{t.forEach(wa)};function ja(t,e,n){const s=function({root:t,...e}){const n=t||document;ba.has(n)||ba.set(n,{});const s=ba.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Ta,{root:t,...e})),s[i]}(e);return xa.set(t,n),s.observe(t),()=>{xa.delete(t),s.unobserve(t)}}const Pa={some:0,all:1};const Sa={inView:{Feature:class extends hr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:i}=t,r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:Pa[s]};return ja(this.node.current,r,t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,i&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),r=e?n:s;r&&r(t)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends hr{mount(){const{current:t}=this.node;t&&(this.unmount=Ss(t,(t,e)=>(va(this.node,e,"Start"),(t,{success:e})=>va(this.node,t,e?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}},focus:{Feature:class extends hr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){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=H(pr(this.node.current,"focus",()=>this.onFocus()),pr(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends hr{mount(){const{current:t}=this.node;t&&(this.unmount=function(t,e,n={}){const[s,i,r]=gs(t,n),o=t=>{if(!ys(t))return;const{target:n}=t,s=e(n,t);if("function"!=typeof s||!n)return;const r=t=>{ys(t)&&(s(t),n.removeEventListener("pointerleave",r))};n.addEventListener("pointerleave",r,i)};return s.forEach(t=>{t.addEventListener("pointerenter",o,i)}),r}(t,(t,e)=>(ya(this.node,e,"Start"),t=>ya(this.node,t,"End"))))}unmount(){}}}},Ea={layout:{ProjectionNode:fa,MeasureLayout:uo}},Ca={current:null},ka={current:!1};const Aa=new WeakMap;const Ma=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Na{scrapeMotionValuesFromProps(t,e,n){return{}}constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,blockInitialAnimation:i,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Sn,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 t=Pt.now();this.renderScheduledAt<t&&(this.renderScheduledAt=t,vt.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=r;this.latestValues=a,this.baseTarget={...a},this.initialValues=e.initial?{...a}:{},this.renderState=l,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=Zs(e),this.isVariantNode=Js(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:c,...u}=this.scrapeMotionValuesFromProps(e,{},this);for(const t in u){const e=u[t];void 0!==a[t]&&Cs(e)&&e.set(a[t],!1)}}mount(t){this.current=t,Aa.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((t,e)=>this.bindToMotionValue(e,t)),ka.current||function(){if(ka.current=!0,A)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ca.current=t.matches;t.addListener(e),e()}else Ca.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Ca.current),"production"!==process.env.NODE_ENV&&Z(!0!==this.shouldReduceMotion,"You have Reduced Motion enabled on your device. Animations may not appear as expected."),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),xt(this.notifyUpdate),xt(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 e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const n=pn.has(t);n&&this.onBindTransform&&this.onBindTransform();const s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&vt.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);let r;window.MotionCheckAppearSync&&(r=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{s(),i(),r&&r(),e.owner&&e.stop()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}updateFeatures(){let t="animation";for(t in $s){const e=$s[t];if(!e)continue;const{isEnabled:n,Feature:s}=e;if(!this.features[t]&&s&&n(this.props)&&(this.features[t]=new s(this)),this.features[t]){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):{x:{min:0,max:0},y:{min:0,max:0}}}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Ma.length;e++){const n=Ma[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const s=t["on"+n];s&&(this.propEventSubscriptions[n]=this.on(n,s))}this.prevMotionValues=function(t,e,n){for(const s in e){const i=e[s],r=n[s];if(Cs(i))t.addValue(s,i);else if(Cs(r))t.addValue(s,hs(i,{owner:t}));else if(r!==i)if(t.hasValue(s)){const e=t.getValue(s);!0===e.liveStyle?e.jump(i):e.hasAnimated||e.set(i)}else{const e=t.getStaticValue(s);t.addValue(s,hs(void 0!==e?e:i,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const n=this.values.get(t);e!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=hs(null===e?void 0:e,{owner:this}),this.addValue(t,n)),n}readValue(t,e){let n=void 0===this.latestValues[t]&&this.current?this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options):this.latestValues[t];var s;return null!=n&&("string"==typeof n&&(F(n)||$(n))?n=parseFloat(n):(s=n,!ks.find(qn(s))&&ie.test(e)&&(n=os(t,e))),this.setBaseTarget(t,Cs(n)?n.get():n)),Cs(n)?n.get():n}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){const{initial:e}=this.props;let n;if("string"==typeof e||"object"==typeof e){const s=Mi(this.props,e,this.presenceContext?.custom);s&&(n=s[t])}if(e&&void 0!==n)return n;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||Cs(s)?void 0!==this.initialValues[t]&&void 0===n?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new K),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class Va extends Na{constructor(){super(...arguments),this.KeyframeResolver=ls}sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Cs(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function Da(t,{style:e,vars:n},s,i){Object.assign(t.style,e,i&&i.getProjectionStyles(s));for(const e in n)t.style.setProperty(e,n[e])}class La extends Va{constructor(){super(...arguments),this.type="html",this.renderInstance=Da}readValueFromInstance(t,e){if(pn.has(e))return this.projection?.isProjecting?un(e):((t,e)=>{const{transform:n="none"}=getComputedStyle(t);return hn(n,e)})(t,e);{const s=(n=t,window.getComputedStyle(n)),i=(Et(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return $r(t,e)}build(t,e,n){fi(t,e,n.transformTemplate)}scrapeMotionValuesFromProps(t,e,n){return Li(t,e,n)}}const Ra=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"]);class Oa extends Va{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Pr}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(pn.has(e)){const t=rs(e);return t&&t.default||0}return e=Ra.has(e)?e:ii(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,n){return Oi(t,e,n)}build(t,e,n){Ti(t,e,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,e,n,s){!function(t,e,n,s){Da(t,e,void 0,s);for(const n in e.attrs)t.setAttribute(Ra.has(n)?n:ii(n),e.attrs[n])}(t,e,0,s)}mount(t){this.isSVGTag=Pi(t.tagName),super.mount(t)}}const Ba=Ys(Fi({...mr,...Sa,...ga,...Ea},(t,n)=>Ci(t)?new Oa(n):new La(n,{allowProjection:t!==e.Fragment})));function Fa(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(s=Object.getOwnPropertySymbols(t);i<s.length;i++)e.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(t,s[i])&&(n[s[i]]=t[s[i]])}return n}function Ia(t,e,n,s){return new(n||(n=Promise))(function(i,r){function o(t){try{l(s.next(t))}catch(t){r(t)}}function a(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}l((s=s.apply(t,e||[])).next())})}"function"==typeof SuppressedError&&SuppressedError;const $a=t=>{if("85"===t)return"/back85";if("87"===t)return"/back87";if("undefined"!=typeof window){if(window.location.hostname.toLowerCase().includes("seguimiento"))return"/back85"}return"/back87"},Ua=(t,e)=>Ia(void 0,void 0,void 0,function*(){const n=`${$a(t)}/student/downloadExcel/${e||"PASS"}`;return(yield s.get(n,{responseType:"blob"})).data}),Wa=(t,e,n)=>Ia(void 0,void 0,void 0,function*(){const i=`${$a(e)}/student/uploadExcel`,r=new FormData;r.append("receivedExcelFile",t),"85"===e&&n&&r.append("clientName",n);return(yield s.post(i,r,{transformRequest:[t=>t]})).data}),za=e=>{var{title:n,description:s,onClose:i,showCloseIcon:r=!0,icon:o,actions:a,className:c=""}=e,u=Fa(e,["title","description","onClose","showCloseIcon","icon","actions","className"]);return t.jsxs("div",Object.assign({className:`flex items-center justify-between gap-4 p-6 bg-primary-botech text-white rounded-t-xl ${c}`},u,{children:[t.jsxs("div",{className:"flex items-start gap-3 min-w-0",children:[o&&t.jsx("span",{className:"mt-0.5 text-white",children:o}),t.jsxs("div",{className:"flex-1 min-w-0",children:[n&&t.jsx("h2",{className:"text-lg font-semibold text-white",id:"bo-modal-title",children:n}),s&&t.jsx("p",{className:"mt-1 text-sm text-white/80",id:"bo-modal-description",children:s})]})]}),t.jsxs("div",{className:"flex items-center gap-2",children:[a,r&&t.jsx(l,{variant:"secondary",size:"sm",onClick:i,className:"!bg-transparent hover:!bg-white/10 !text-white !px-2 !py-2",rightIcon:t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-5 w-5",children:t.jsx("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"})}),children:t.jsx("span",{className:"sr-only",children:"Cerrar"})})]})]}))},Ha=e=>{var{className:n=""}=e,s=Fa(e,["className"]);return t.jsx("div",Object.assign({className:`p-6 ${n}`},s))},Ya=e=>{var{className:n=""}=e,s=Fa(e,["className"]);return t.jsx("div",Object.assign({className:`flex justify-end gap-3 p-4 border-t border-gray-200 dark:border-gray-700 bg-gray-50 dark:bg-gray-900/40 ${n}`},s))},Ka={sm:"max-w-sm",md:"max-w-2xl",lg:"max-w-4xl",xl:"max-w-6xl"},Xa={hidden:{opacity:0},visible:{opacity:1},exit:{opacity:0}},qa={hidden:{opacity:0,scale:.98,y:12},visible:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.98,y:12}};const Ga=({open:n,onClose:s,title:r,description:o,size:a="md",footer:l,showCloseIcon:c=!0,hideHeader:u=!1,closeOnEsc:h=!0,closeOnClickOutside:d=!0,className:m="",children:p,initialFocusRef:f,headerClassName:g,overlayClassName:y,headerIcon:v,headerActions:x,zIndex:b})=>{const w=e.useRef(null),T=e.useRef(null);var j;j=n,e.useEffect(()=>{if(!j)return;const{overflow:t}=document.body.style;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=t}},[j]),function(t,n,s){e.useEffect(()=>{if(!t)return;const e=n.current;if(!e)return;const i=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'],r=()=>Array.from(e.querySelectorAll(i.join(","))).filter(t=>!t.hasAttribute("disabled")&&!t.getAttribute("aria-hidden")),o=document.activeElement;((null==s?void 0:s.current)||r()[0]||e).focus();const a=t=>{if("Tab"!==t.key)return;const n=r();if(0===n.length)return;const s=n[0],i=n[n.length-1];t.shiftKey?document.activeElement!==s&&document.activeElement!==e||(i.focus(),t.preventDefault()):document.activeElement===i&&(s.focus(),t.preventDefault())};return document.addEventListener("keydown",a),()=>{var t;document.removeEventListener("keydown",a),null===(t=null==o?void 0:o.focus)||void 0===t||t.call(o)}},[t,n,s])}(n,w,f);const P=e.useCallback(t=>{n&&"Escape"===t.key&&h&&(t.stopPropagation(),s())},[n,h,s]);e.useEffect(()=>{if(n)return document.addEventListener("keydown",P),()=>document.removeEventListener("keydown",P)},[n,P]);const S=t.jsx(Bs,{children:n&&t.jsxs("div",{className:"fixed inset-0 z-[1000] flex items-center justify-center",style:b?{zIndex:b}:void 0,"aria-hidden":!n,ref:T,children:[t.jsx(Ba.button,{type:"button","aria-label":"Cerrar modal",initial:"hidden",animate:"visible",exit:"exit",variants:Xa,onClick:()=>{d&&s()},className:`fixed inset-0 bg-black/50 ${null!=y?y:""}`}),t.jsxs(Ba.div,{role:"dialog","aria-modal":"true","aria-labelledby":r?"bo-modal-title":void 0,"aria-describedby":o?"bo-modal-description":void 0,initial:"hidden",animate:"visible",exit:"exit",variants:qa,transition:{duration:.18,ease:"easeOut"},className:`relative w-full ${Ka[a]} mx-4 max-h-[90vh] overflow-hidden rounded-xl bg-white dark:bg-gray-900 shadow-2xl ring-1 ring-black/5 ${m}`,onClick:t=>t.stopPropagation(),ref:w,children:[!u&&t.jsx(za,{title:r,description:o,onClose:s,showCloseIcon:c,className:g,icon:v,actions:x}),t.jsx("div",{className:"overflow-y-auto max-h-[calc(90vh-5rem)]",children:p}),l&&t.jsx(Ya,{children:l})]})]})});return"undefined"!=typeof document?i.createPortal(S,document.body):S};var _a,Za,Ja;Ga.Header=za,Ga.Body=Ha,Ga.Footer=Ya,function(t){t.LEFT="left",t.CENTER="center",t.RIGHT="right"}(_a||(_a={})),function(t){t.EVEN="even",t.ODD="odd",t.HOVER="hover"}(Za||(Za={})),function(t){t.SM="sm",t.MD="md",t.LG="lg"}(Ja||(Ja={}));const Qa=t=>{switch(t){case _a.CENTER:return"text-center";case _a.RIGHT:return"text-right";default:return"text-left"}},tl=t=>{switch(t){case Ja.SM:return{header:"px-2 py-2 text-xs",cell:"px-2 py-2 text-xs",table:"text-xs"};case Ja.LG:return{header:"px-6 py-4 text-base",cell:"px-6 py-4 text-base",table:"text-base"};default:return{header:"px-3 md:px-6 py-3 text-sm",cell:"px-3 md:px-6 py-4 text-sm",table:"text-sm"}}},el=t=>t%2==0?"bg-white":"bg-gray-50",nl=({columns:e,size:n,hasActions:s})=>{const i=tl(n);return t.jsx("thead",{className:"text-xs text-gray-700 uppercase bg-gray-50 sticky top-0 z-10",children:t.jsxs("tr",{children:[e.map(e=>t.jsx("th",{className:`${i.header} ${Qa(e.alignment)} ${e.className||""}`,style:e.width?{width:e.width}:void 0,children:e.header},e.key)),s&&t.jsx("th",{className:`${i.header} text-center sticky right-0 bg-gray-50`,children:"ACCIONES"})]})})},sl=({columns:e,data:n,renderActions:s,size:i,onRowClick:r})=>{const o=tl(i);return t.jsx("tbody",{children:n.map((n,i)=>t.jsxs("tr",{className:`${el(i)} hover:bg-gray-100 transition-colors duration-150 ${r?"cursor-pointer":""}`,onClick:()=>null==r?void 0:r(n),children:[e.map(e=>t.jsx("td",{className:`${o.cell} ${Qa(e.alignment)} ${e.className||""}`,children:e.accessor(n)},e.key)),s&&t.jsx("td",{className:`${o.cell} text-center sticky right-0 ${el(i)} shadow-[-2px_0_4px_rgba(0,0,0,0.1)]`,children:s(n)})]},i))})};exports.Button=a,exports.DownloadStudentsExcelButton=({backend:s,label:i="Descargar Lista de Estudiantes en Excel",fileName:r="students.xlsx",className:o,variant:l="primary",clientName:c,onSuccess:u,onError:h})=>{const[d,m]=e.useState(!1);return t.jsx(a,{variant:l,onClick:()=>Ia(void 0,void 0,void 0,function*(){var t,e,i,o,a,l,d;try{m(!0);let t=c;if("85"===s&&!t){const{value:e}=yield n.fire({title:"Cliente requerido",text:"Ingrese el nombre del cliente:",input:"text",inputPlaceholder:"Ej: GIMNASIO FEMENINO",showCancelButton:!0,confirmButtonText:"Continuar",cancelButtonText:"Cancelar",inputValidator:t=>{if(!t||""===t.trim())return"El nombre del cliente es requerido"}});if(!e)return void m(!1);t=e}const e=yield Ua(s,t),i=URL.createObjectURL(e),o=document.createElement("a");o.href=i,o.download=r,document.body.appendChild(o),o.click(),o.remove(),URL.revokeObjectURL(i),yield n.fire({title:"¡Descarga exitosa!",text:"El archivo se ha descargado correctamente",icon:"success",confirmButtonText:"OK"}),null==u||u()}catch(s){console.error("Download students excel failed",s);let r="No se pudo descargar el archivo. Por favor, inténtelo nuevamente.";const c=s;r=null!==(d=null!==(a=null!==(i=null===(e=null===(t=null==c?void 0:c.response)||void 0===t?void 0:t.data)||void 0===e?void 0:e.message)&&void 0!==i?i:"string"==typeof(null===(o=null==c?void 0:c.response)||void 0===o?void 0:o.data)?c.response.data:void 0)&&void 0!==a?a:(null===(l=null==c?void 0:c.response)||void 0===l?void 0:l.statusText)?`Error ${c.response.status}: ${c.response.statusText}`:void 0)&&void 0!==d?d:r,yield n.fire({title:"Error en la descarga",text:r,icon:"error",confirmButtonText:"OK"}),null==h||h(s)}finally{m(!1)}}),className:o,children:d?"Descargando...":i})},exports.GenericTable=({columns:n,data:s,renderActions:i,size:r=Ja.MD,className:o="",onRowClick:a,isLoading:l=!1,emptyMessage:c="No hay datos disponibles"})=>{const u=e.useRef(null),{visibleData:h}=((t,n)=>{const[s,i]=e.useState(t);return e.useEffect(()=>{const e=()=>{if(!n.current)return;const e=n.current.getBoundingClientRect(),s=window.innerHeight-e.top-100,r=Math.max(1,Math.floor(s/60));i(t.slice(0,r))};e();const s=()=>{e()};window.addEventListener("resize",s);const r=new ResizeObserver(e);return n.current&&r.observe(n.current),()=>{window.removeEventListener("resize",s),r.disconnect()}},[t,n]),{visibleData:s}})(s,u);return l?t.jsx("div",{className:"w-full shadow-md sm:rounded-lg bg-white",children:t.jsx("div",{className:"flex items-center justify-center py-8",children:t.jsx("div",{"data-testid":"loading-spinner",className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600"})})}):0===s.length?t.jsx("div",{className:"w-full shadow-md sm:rounded-lg bg-white",children:t.jsx("div",{className:"text-center py-8",children:t.jsx("p",{className:"text-gray-500",children:c})})}):t.jsx("div",{ref:u,className:`w-full shadow-md sm:rounded-lg bg-white ${o}`,children:t.jsx("div",{className:"overflow-x-auto",children:t.jsxs("table",{className:"w-full text-left text-gray-500",style:{minWidth:"max-content"},children:[t.jsx(nl,{columns:n,size:r,hasActions:!!i}),t.jsx(sl,{columns:n,data:h,renderActions:i,size:r,onRowClick:a})]})})})},exports.Header=({title:e,description:n,logoUrl:s,logoAlt:i="Logo",systemName:r="PASS",systemSubtitle:o="Sistema Escolar",onMenuToggle:a,showPageInfo:l=!0,className:c="flex flex-col sm:flex-row sm:items-end bg-primary-botech text-white p-3 sm:p-4 shadow-lg gap-3 sm:gap-0 justify-between",logoClassName:u="h-8 sm:h-10 object-contain",titleClassName:h="text-lg sm:text-xl font-bold",descriptionClassName:d="text-xs sm:text-sm opacity-80"})=>t.jsxs("div",{className:c,children:[t.jsxs("div",{className:"flex items-center gap-3 sm:gap-4",children:[t.jsx("button",{onClick:a,className:"p-2 rounded-lg hover:bg-primary-botech-600 transition-colors focus:outline-none focus:ring-2 focus:ring-white focus:ring-opacity-20 flex-shrink-0","aria-label":"Abrir menú",children:t.jsx(P,{className:"w-5 h-5 sm:w-6 sm:h-6"})}),t.jsxs("div",{className:"flex items-center min-w-0 flex-1",children:[t.jsx("div",{className:"flex items-center justify-center mr-2 sm:mr-3 flex-shrink-0",children:s?t.jsx("img",{src:s,alt:i,className:u}):t.jsx("div",{className:"w-8 h-8 sm:w-10 sm:h-10 bg-white bg-opacity-20 rounded-lg flex items-center justify-center border border-white border-opacity-30",children:t.jsx("span",{className:"text-white font-bold text-sm sm:text-lg",children:r.charAt(0)})})}),t.jsxs("div",{className:"min-w-0 flex-1",children:[t.jsx("h1",{className:h,children:r}),t.jsx("p",{className:d,children:o})]})]})]}),l&&t.jsxs("div",{className:"text-left sm:text-right pt-2 sm:border-t-0 sm:pt-0",children:[t.jsx("h2",{className:"text-base sm:text-lg font-semibold",children:e}),t.jsx("p",{className:"text-xs sm:text-sm leading-tight opacity-80 truncate",children:n})]})]}),exports.IconButton=l,exports.Modal=Ga,exports.ModalBody=Ha,exports.ModalFooter=Ya,exports.ModalHeader=za,exports.MultiSelector=({items:n,selectedItems:s=[],onSelectionChange:i,placeholder:r="Seleccionar elementos",searchPlaceholder:o="Buscar...",className:a="",disabled:l=!1,searchBy:c="both",caseSensitive:u=!1,exactMatch:h=!0,maxSelectedDisplay:d=3,renderItem:m,renderSelectedItem:p,renderSelectedBadge:f})=>{const[g,y]=e.useState(!1),[v,x]=e.useState(""),b=e.useRef(null),w=e.useRef(null);e.useEffect(()=>{const t=t=>{b.current&&!b.current.contains(t.target)&&y(!1)};if(g)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[g]),e.useEffect(()=>{g&&w.current&&w.current.focus()},[g]),e.useEffect(()=>{g||x("")},[g]);const T=((t,e)=>{if(!e.trim())return t;const n=e.trim(),s=u?n:n.toLowerCase();return t.filter(t=>{const e=u?t.name:t.name.toLowerCase(),n=u?t.id:t.id.toLowerCase();if(h)switch(c){case"name":return e===s;case"id":return n===s;case"both":return e===s||n===s;default:return!1}else switch(c){case"name":return e.includes(s);case"id":return n.includes(s);case"both":return e.includes(s)||n.includes(s);default:return!1}})})(n,v),j=t=>s.some(e=>e.id===t.id),P=t=>{i(s.filter(e=>e.id!==t.id))},S=()=>t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),E=()=>t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 13l4 4L19 7"})}),C=({item:e,onRemove:n})=>t.jsxs("span",{className:"inline-flex items-center px-2 py-1 text-xs font-medium bg-primary-botech-100 text-primary-botech-800 rounded-md",children:[p?p(e):e.name,t.jsx("button",{type:"button",onClick:t=>{t.stopPropagation(),n()},className:"ml-1 text-primary-botech-600 hover:text-primary-botech-800 transition-colors duration-200",children:t.jsx(S,{})})]}),k=s.slice(0,d),A=s.length-d;return t.jsxs("div",{ref:b,className:`relative w-full ${a}`,children:[t.jsxs("div",{className:`\n min-h-10 w-full flex items-center justify-between px-3 py-2 \n text-sm bg-white border border-gray-300 rounded-md shadow-sm cursor-pointer\n transition-colors duration-200\n ${l?"bg-gray-100 text-gray-400 cursor-not-allowed border-gray-200":"hover:border-primary-botech-400 focus-within:border-primary-botech focus-within:ring-1 focus-within:ring-primary-botech"}\n ${g?"border-primary-botech ring-1 ring-primary-botech":""}\n `,onClick:()=>{l||y(!g)},children:[t.jsx("div",{className:"flex-1 flex flex-wrap gap-1 items-center",children:0===s.length?t.jsx("span",{className:"text-gray-500",children:r}):t.jsxs(t.Fragment,{children:[k.map(e=>t.jsx("div",{onClick:t=>t.stopPropagation(),children:f?f(e,()=>P(e)):t.jsx(C,{item:e,onRemove:()=>P(e)})},e.id)),A>0&&t.jsxs("span",{className:"text-xs text-gray-500 bg-gray-100 px-2 py-1 rounded-md",children:["+",A," más"]})]})}),t.jsxs("div",{className:"flex items-center space-x-1 ml-2",children:[s.length>0&&!l&&t.jsx("button",{type:"button",onClick:t=>{t.stopPropagation(),i([])},className:"text-gray-400 hover:text-gray-600 transition-colors duration-200",children:t.jsx(S,{})}),t.jsx("div",{className:"text-gray-400 transition-transform duration-200 "+(g?"rotate-180":""),children:t.jsx(()=>t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),{})})]})]}),g&&t.jsxs("div",{className:"absolute z-50 w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg",children:[t.jsx("div",{className:"p-2 border-b border-gray-100",children:t.jsxs("div",{className:"relative",children:[t.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:t.jsx(()=>t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),{})}),t.jsx("input",{ref:w,type:"text",className:"block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md text-sm placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-primary-botech focus:border-primary-botech",placeholder:o,value:v,onChange:t=>x(t.target.value),onClick:t=>t.stopPropagation()})]})}),s.length>0&&t.jsxs("div",{className:"px-3 py-2 text-xs text-gray-600 bg-gray-50 border-b border-gray-100",children:[s.length," elemento(s) seleccionado(s)"]}),t.jsx("div",{className:"max-h-60 overflow-auto",children:0===T.length?t.jsx("div",{className:"px-3 py-2 text-sm text-gray-500",children:v?"No se encontraron coincidencias exactas":"No hay elementos disponibles"}):T.map(e=>{const n=j(e);return t.jsxs("div",{className:`\n px-3 py-2 text-sm cursor-pointer transition-colors duration-200 \n border-b border-gray-50 last:border-b-0 flex items-center justify-between\n ${n?"bg-primary-botech-50 hover:bg-primary-botech-100":"hover:bg-gray-50"}\n `,onClick:()=>(t=>{j(t)?i(s.filter(e=>e.id!==t.id)):i([...s,t])})(e),children:[t.jsx("div",{className:"flex-1",children:m?m(e):t.jsx("span",{className:""+(n?"text-primary-botech-900 font-medium":"text-gray-900"),children:e.name})}),n&&t.jsx("div",{className:"ml-2 text-primary-botech-600",children:t.jsx(E,{})})]},e.id)})})]})]})},exports.Sidebar=({isOpen:n,onClose:s,onToggle:i,menuItems:r,logoUrl:o,logoAlt:a="Logo",systemName:l="PASS",className:c="fixed inset-y-0 left-0 z-50 w-80 bg-white shadow-xl",overlayClassName:u="fixed inset-0 bg-black bg-opacity-25 z-40",desktopMenuClassName:h="h-full flex flex-col",showBottomMenu:d=!0,bottomMenuItems:m=[{id:"settings",label:"Configuración",icon:S,action:()=>{}},{id:"help",label:"Ayuda",icon:T,action:()=>{}},{id:"logout",label:"Cerrar Sesión",icon:j,action:()=>{}}],activePath:p="",onNavigate:f,children:g})=>{const[y,v]=e.useState(new Set),x=t=>p.includes(t),P=(e,n=!1)=>t.jsxs(Ba.button,{whileHover:{scale:1.02},whileTap:{scale:.98},className:`w-full flex items-center justify-between py-3 rounded-lg transition-colors group ${n?"pr-4 pl-10":"px-4"} ${x(e.path)?"bg-primary-botech text-white":"text-gray-700 hover:bg-gray-100"}`,onClick:()=>{return t=e.path,f&&f(t),void s();var t},children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(e.icon,{className:"w-5 h-5"}),t.jsx("span",{className:"font-medium text-sm",children:e.label})]}),t.jsx(w,{className:"w-4 h-4 transition-transform "+(x(e.path)?"rotate-90":"group-hover:translate-x-1")})]},e.id),C=e=>{const n=y.has(e.id);return t.jsxs("div",{className:"mb-2",children:[t.jsxs(Ba.button,{whileHover:{scale:1.02},whileTap:{scale:.98},className:"w-full flex items-center justify-between px-4 py-3 rounded-lg transition-colors group text-gray-700 hover:bg-gray-100",onClick:()=>{return t=e.id,void v(e=>{const n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n});var t},children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx(e.icon,{className:"w-5 h-5"}),t.jsx("span",{className:"font-medium text-sm",children:e.label})]}),t.jsx(b,{className:"w-4 h-4 transition-transform "+(n?"rotate-180":"")})]}),t.jsx(Bs,{children:n&&t.jsx(Ba.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"overflow-hidden",children:t.jsx("div",{className:"pt-2 space-y-1",children:e.children.map(t=>P(t,!0))})})})]},e.id)};return t.jsxs(t.Fragment,{children:[t.jsx(Bs,{children:n&&t.jsx(Ba.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:u,onClick:s})}),t.jsx(Ba.div,{initial:{x:"-100%"},animate:{x:n?0:"-100%"},transition:{type:"spring",stiffness:300,damping:30},className:c,children:t.jsxs("div",{className:h,children:[t.jsxs("div",{className:"p-4 border-b border-gray-200 flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center space-x-3",children:[t.jsx("div",{className:"w-8 h-8 flex items-center justify-center",children:o?t.jsx("img",{src:o,alt:a,className:"h-full object-contain"}):t.jsx("div",{className:"h-full w-full bg-primary-botech rounded-lg flex items-center justify-center",children:t.jsx("span",{className:"text-white font-bold text-sm",children:l.charAt(0)})})}),t.jsx("h1",{className:"text-lg font-bold text-gray-800",children:l})]}),t.jsx("button",{onClick:s,className:"p-1 rounded-lg text-gray-500 hover:bg-gray-100 transition-colors",children:t.jsx(E,{className:"w-5 h-5"})})]}),t.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:t.jsx("nav",{className:"space-y-2",children:r.map(t=>"folder"===t.type?C(t.data):P(t.data))})}),d&&t.jsx("div",{className:"p-4 border-t border-gray-200",children:t.jsx("div",{className:"space-y-2",children:m.map(e=>t.jsxs("button",{onClick:e.action,className:"w-full flex items-center space-x-3 px-4 py-2 rounded-lg text-gray-700 hover:bg-gray-100 transition-colors",children:[t.jsx(e.icon,{className:"w-5 h-5"}),t.jsx("span",{className:"text-sm",children:e.label})]},e.id))})}),g&&t.jsx("div",{className:"p-4 border-t border-gray-200",children:g})]})})]})},exports.SingleSelector=({items:n,selectedItem:s=null,onSelectionChange:i,placeholder:r="Seleccionar elemento",searchPlaceholder:o="Buscar...",className:a="",disabled:l=!1,searchBy:c="both",caseSensitive:u=!1,exactMatch:h=!0,renderItem:d,renderSelectedItem:m})=>{const[p,f]=e.useState(!1),[g,y]=e.useState(""),v=e.useRef(null),x=e.useRef(null);e.useEffect(()=>{const t=t=>{v.current&&!v.current.contains(t.target)&&f(!1)};if(p)return document.addEventListener("mousedown",t),()=>document.removeEventListener("mousedown",t)},[p]),e.useEffect(()=>{p&&x.current&&x.current.focus()},[p]),e.useEffect(()=>{p||y("")},[p]);const b=((t,e)=>{if(!e.trim())return t;const n=e.trim(),s=u?n:n.toLowerCase();return t.filter(t=>{const e=u?t.name:t.name.toLowerCase(),n=u?t.id:t.id.toLowerCase();if(h)switch(c){case"name":return e===s;case"id":return n===s;case"both":return e===s||n===s;default:return!1}else switch(c){case"name":return e.includes(s);case"id":return n.includes(s);case"both":return e.includes(s)||n.includes(s);default:return!1}})})(n,g);return t.jsxs("div",{ref:v,className:`relative w-full ${a}`,children:[t.jsxs("div",{className:`\n min-h-10 w-full flex items-center justify-between px-3 py-2 \n text-sm bg-white border border-gray-300 rounded-md shadow-sm cursor-pointer\n transition-colors duration-200\n ${l?"bg-gray-100 text-gray-400 cursor-not-allowed border-gray-200":"hover:border-primary-botech-400 focus-within:border-primary-botech focus-within:ring-1 focus-within:ring-primary-botech"}\n ${p?"border-primary-botech ring-1 ring-primary-botech":""}\n `,onClick:()=>{l||f(!p)},children:[t.jsx("div",{className:"flex-1 truncate",children:s?t.jsx("span",{className:"text-gray-900",children:m?m(s):s.name}):t.jsx("span",{className:"text-gray-500",children:r})}),t.jsxs("div",{className:"flex items-center space-x-1 ml-2",children:[s&&!l&&t.jsx("button",{type:"button",onClick:t=>{t.stopPropagation(),i(null)},className:"text-gray-400 hover:text-gray-600 transition-colors duration-200",children:t.jsx(()=>t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})}),{})}),t.jsx("div",{className:"text-gray-400 transition-transform duration-200 "+(p?"rotate-180":""),children:t.jsx(()=>t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})}),{})})]})]}),p&&t.jsxs("div",{className:"absolute z-50 w-full mt-1 bg-white border border-gray-300 rounded-md shadow-lg",children:[t.jsx("div",{className:"p-2 border-b border-gray-100",children:t.jsxs("div",{className:"relative",children:[t.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:t.jsx(()=>t.jsx("svg",{className:"w-4 h-4",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})}),{})}),t.jsx("input",{ref:x,type:"text",className:"block w-full pl-10 pr-3 py-2 border border-gray-300 rounded-md text-sm placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-primary-botech focus:border-primary-botech",placeholder:o,value:g,onChange:t=>y(t.target.value),onClick:t=>t.stopPropagation()})]})}),t.jsx("div",{className:"max-h-60 overflow-auto",children:0===b.length?t.jsx("div",{className:"px-3 py-2 text-sm text-gray-500",children:g?"No se encontraron coincidencias exactas":"No hay elementos disponibles"}):b.map(e=>t.jsx("div",{className:"px-3 py-2 text-sm cursor-pointer hover:bg-primary-botech-50 transition-colors duration-200 border-b border-gray-50 last:border-b-0",onClick:()=>(t=>{i(t),f(!1)})(e),children:d?d(e):t.jsx("span",{className:"text-gray-900",children:e.name})},e.id))})]})]})},exports.UploadStudentsExcelButton=({backend:s,label:i="Cargar Lista de Estudiantes en Excel",className:r,variant:o="primary",clientName:l,onSuccess:c,onError:u})=>{const h=e.useRef(null),[d,m]=e.useState(!1);return t.jsxs(t.Fragment,{children:[t.jsx(a,{variant:o,onClick:()=>{var t;null===(t=h.current)||void 0===t||t.click()},className:r,children:d?"Subiendo...":i}),t.jsx("input",{type:"file",accept:".xlsx,.xls",ref:h,className:"hidden",onChange:t=>Ia(void 0,void 0,void 0,function*(){var e,i,r,o,a,d,p,f;const g=null===(e=t.target.files)||void 0===e?void 0:e[0];if(!g)return;if([/\.xlsx$/i,/\.xls$/i].some(t=>t.test(g.name)))if(0!==g.size)try{m(!0);let t=l;if("85"===s&&!t){const{value:e}=yield n.fire({title:"Cliente requerido",text:"Ingrese el nombre del cliente:",input:"text",inputPlaceholder:"Ej: GIMNASIO FEMENINO",showCancelButton:!0,confirmButtonText:"Continuar",cancelButtonText:"Cancelar",inputValidator:t=>{if(!t||""===t.trim())return"El nombre del cliente es requerido"}});if(!e)return void m(!1);t=e}const e=yield Wa(g,s,t);let i="El archivo se ha cargado correctamente";(null==e?void 0:e.message)?i=e.message:"string"==typeof e&&(i=e),yield n.fire({title:"¡Carga exitosa!",text:i,icon:"success",confirmButtonText:"OK"}),null==c||c()}catch(t){console.error("Upload students excel failed",t),console.error("Error details:",t);let e="Hubo un problema al subir el archivo";const s=t;e=null!==(f=null!==(d=null!==(o=null===(r=null===(i=null==s?void 0:s.response)||void 0===i?void 0:i.data)||void 0===r?void 0:r.message)&&void 0!==o?o:"string"==typeof(null===(a=null==s?void 0:s.response)||void 0===a?void 0:a.data)?s.response.data:void 0)&&void 0!==d?d:(null===(p=null==s?void 0:s.response)||void 0===p?void 0:p.statusText)?`Error ${s.response.status}: ${s.response.statusText}`:void 0)&&void 0!==f?f:e,yield n.fire({title:"Error en la carga",text:e,icon:"error",confirmButtonText:"OK"}),null==u||u(t)}finally{h.current&&(h.current.value=""),m(!1)}else yield n.fire({title:"Archivo vacío",text:"El archivo seleccionado está vacío",icon:"warning",confirmButtonText:"OK"});else yield n.fire({title:"Archivo inválido",text:"El archivo debe ser un Excel (.xlsx o .xls)",icon:"warning",confirmButtonText:"OK"})})})]})},exports.downloadStudentsExcel=Ua,exports.generateTableColumns=function(t,e){return Object.keys(t).filter(t=>-1===e.indexOf(t)).map(t=>({key:t,header:t.charAt(0).toUpperCase()+t.slice(1).replace(/([A-Z])/g," $1").trim(),accessor:e=>{var n;return null!==(n=e[t])&&void 0!==n?n:"-"}}))},exports.getBackendPrefix=$a,exports.uploadStudentsExcel=Wa,exports.useModal=function(t=!1){const[n,s]=e.useState(t);return{open:n,onOpen:e.useCallback(()=>s(!0),[]),onClose:e.useCallback(()=>s(!1),[]),toggle:e.useCallback(()=>s(t=>!t),[]),setOpen:s}};
2
2
  //# sourceMappingURL=index.js.map