framer-motion 9.0.2 → 9.0.3

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 (76) hide show
  1. package/dist/cjs/index.js +3344 -3260
  2. package/dist/es/animation/hooks/use-animated-state.mjs +3 -3
  3. package/dist/es/animation/index.mjs +3 -5
  4. package/dist/es/animation/legacy-popmotion/index.mjs +6 -2
  5. package/dist/es/animation/legacy-popmotion/inertia.mjs +4 -5
  6. package/dist/es/components/AnimatePresence/use-presence.mjs +0 -1
  7. package/dist/es/events/add-dom-event.mjs +6 -0
  8. package/dist/es/events/add-pointer-event.mjs +8 -0
  9. package/dist/es/events/use-dom-event.mjs +2 -5
  10. package/dist/es/gestures/drag/VisualElementDragControls.mjs +31 -30
  11. package/dist/es/gestures/drag/index.mjs +27 -0
  12. package/dist/es/gestures/focus.mjs +42 -0
  13. package/dist/es/gestures/hover.mjs +32 -0
  14. package/dist/es/gestures/{PanSession.mjs → pan/PanSession.mjs} +8 -8
  15. package/dist/es/gestures/pan/index.mjs +38 -0
  16. package/dist/es/gestures/press.mjs +109 -0
  17. package/dist/es/index.mjs +1 -1
  18. package/dist/es/motion/features/Feature.mjs +9 -0
  19. package/dist/es/motion/features/animation/exit.mjs +32 -0
  20. package/dist/es/motion/features/animation/index.mjs +38 -0
  21. package/dist/es/motion/features/animations.mjs +8 -37
  22. package/dist/es/motion/features/definitions.mjs +17 -23
  23. package/dist/es/motion/features/drag.mjs +12 -5
  24. package/dist/es/motion/features/gestures.mjs +16 -9
  25. package/dist/es/motion/features/layout/MeasureLayout.mjs +5 -5
  26. package/dist/es/motion/features/layout.mjs +11 -0
  27. package/dist/es/motion/features/load-features.mjs +4 -6
  28. package/dist/es/motion/features/viewport/index.mjs +96 -0
  29. package/dist/es/motion/index.mjs +12 -13
  30. package/dist/es/motion/utils/use-visual-element.mjs +8 -2
  31. package/dist/es/projection/geometry/delta-apply.mjs +9 -2
  32. package/dist/es/projection/geometry/delta-calc.mjs +2 -2
  33. package/dist/es/projection/geometry/delta-remove.mjs +2 -2
  34. package/dist/es/projection/node/DocumentProjectionNode.mjs +1 -1
  35. package/dist/es/projection/node/create-projection-node.mjs +65 -57
  36. package/dist/es/projection/node/group.mjs +5 -3
  37. package/dist/es/projection/shared/stack.mjs +7 -5
  38. package/dist/es/render/VisualElement.mjs +68 -47
  39. package/dist/es/render/dom/DOMVisualElement.mjs +1 -2
  40. package/dist/es/render/dom/features-max.mjs +2 -4
  41. package/dist/es/render/dom/motion.mjs +5 -6
  42. package/dist/es/render/dom/utils/create-config.mjs +1 -2
  43. package/dist/es/render/dom/value-types/animatable-none.mjs +3 -2
  44. package/dist/es/render/svg/SVGVisualElement.mjs +2 -2
  45. package/dist/es/render/utils/animation-state.mjs +6 -2
  46. package/dist/es/render/utils/animation.mjs +4 -4
  47. package/dist/es/render/utils/motion-values.mjs +1 -1
  48. package/dist/es/render/utils/setters.mjs +14 -9
  49. package/dist/es/value/index.mjs +1 -1
  50. package/dist/es/value/utils/is-motion-value.mjs +1 -1
  51. package/dist/framer-motion.dev.js +3341 -3257
  52. package/dist/framer-motion.js +1 -1
  53. package/dist/index.d.ts +85 -77
  54. package/dist/projection.dev.js +217 -177
  55. package/dist/size-rollup-dom-animation-assets.js +1 -1
  56. package/dist/size-rollup-dom-animation-m.js +1 -1
  57. package/dist/size-rollup-dom-animation.js +1 -1
  58. package/dist/size-rollup-dom-max-assets.js +1 -1
  59. package/dist/size-rollup-dom-max.js +1 -1
  60. package/dist/size-rollup-m.js +1 -1
  61. package/dist/size-rollup-motion.js +1 -1
  62. package/dist/size-webpack-dom-animation.js +1 -1
  63. package/dist/size-webpack-dom-max.js +1 -1
  64. package/dist/size-webpack-m.js +1 -1
  65. package/dist/three-entry.d.ts +74 -38
  66. package/package.json +8 -8
  67. package/dist/es/events/use-pointer-event.mjs +0 -11
  68. package/dist/es/gestures/drag/use-drag.mjs +0 -20
  69. package/dist/es/gestures/use-focus-gesture.mjs +0 -37
  70. package/dist/es/gestures/use-hover-gesture.mjs +0 -32
  71. package/dist/es/gestures/use-pan-gesture.mjs +0 -46
  72. package/dist/es/gestures/use-tap-gesture.mjs +0 -115
  73. package/dist/es/motion/features/layout/index.mjs +0 -7
  74. package/dist/es/motion/features/viewport/use-viewport.mjs +0 -97
  75. package/dist/es/motion/utils/VisualElementHandler.mjs +0 -19
  76. package/dist/es/motion/utils/make-renderless-component.mjs +0 -6
@@ -1 +1 @@
1
- import t,{useEffect as e,useRef as n,useContext as i,useId as s,createElement as o,useCallback as r,useMemo as a}from"react";import{t as l,v as u,w as c,x as h,y as d,z as p,A as m,B as f,C as v,D as g,a as y,u as x,M as T,P,E as V,F as b,g as E,L as A,S,d as w,r as C,G as M,H as D,I as R,J as B,o as k,K as L,N as F,O as j,i as I,Q as U,R as O,n as N,c as z,b as $,m as G,f as H,T as W,h as q,q as Y,U as X,V as K,s as Z,j as _,p as J,k as Q,l as tt}from"./size-rollup-dom-max-assets.js";const et=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function nt(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const it=t=>e=>et(e)&&t(e,nt(e)),st="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),ot="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(st()),1/60*1e3);const rt={delta:0,timestamp:0};let at=!0,lt=!1,ut=!1;const ct=["read","update","preRender","render","postRender"],ht=ct.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],i=0,s=!1,o=!1;const r=new WeakSet,a={schedule:(t,o=!1,a=!1)=>{const l=a&&s,u=l?e:n;return o&&r.add(t),-1===u.indexOf(t)&&(u.push(t),l&&s&&(i=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(s)o=!0;else{if(s=!0,[e,n]=[n,e],n.length=0,i=e.length,i)for(let n=0;n<i;n++){const i=e[n];i(l),r.has(i)&&(a.schedule(i),t())}s=!1,o&&(o=!1,a.process(l))}}};return a}(()=>lt=!0),t),{}),dt=ct.reduce((t,e)=>{const n=ht[e];return t[e]=(t,e=!1,i=!1)=>(lt||gt(),n.schedule(t,e,i)),t},{}),pt=ct.reduce((t,e)=>(t[e]=ht[e].cancel,t),{}),mt=ct.reduce((t,e)=>(t[e]=()=>ht[e].process(rt),t),{}),ft=t=>ht[t].process(rt),vt=t=>{lt=!1,rt.delta=at?1/60*1e3:Math.max(Math.min(t-rt.timestamp,40),1),rt.timestamp=t,ut=!0,ct.forEach(ft),ut=!1,lt&&(at=!1,ot(vt))},gt=()=>{lt=!0,at=!0,ut||ot(vt)},yt=t=>1e3*t;function xt(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function Tt(t,n,i,s){e(()=>{const e=t.current;if(i&&e)return xt(e,n,i,s)},[t,n,i,s])}function Pt(t,e,n,i){return xt(t,e,it(n),i)}function Vt(t,e,n,i){return Tt(t,e,n&&it(n),i)}const bt=(t,e)=>n=>e(t(n)),Et=(...t)=>t.reduce(bt),At=(t,e)=>Math.abs(t-e);class St{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=Mt(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=At(t.x,e.x),i=At(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}=rt;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=wt(e,this.transformPagePoint),dt.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{if(this.end(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const{onEnd:n,onSessionEnd:i}=this.handlers,s=Mt("pointercancel"===t.type?this.lastMoveEventInfo:wt(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,s),i&&i(t,s)},!et(t))return;this.handlers=e,this.transformPagePoint=n;const i=wt(nt(t),this.transformPagePoint),{point:s}=i,{timestamp:o}=rt;this.history=[{...s,timestamp:o}];const{onSessionStart:r}=e;r&&r(t,Mt(i,this.history)),this.removeListeners=Et(Pt(window,"pointermove",this.handlePointerMove),Pt(window,"pointerup",this.handlePointerUp),Pt(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),pt.update(this.updatePoint)}}function wt(t,e){return e?{point:e(t.point)}:t}function Ct(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Mt({point:t},e){return{point:t,delta:Ct(t,Rt(e)),offset:Ct(t,Dt(e)),velocity:Bt(e,.1)}}function Dt(t){return t[0]}function Rt(t){return t[t.length-1]}function Bt(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const s=Rt(t);for(;n>=0&&(i=t[n],!(s.timestamp-i.timestamp>yt(e)));)n--;if(!i)return{x:0,y:0};const o=(s.timestamp-i.timestamp)/1e3;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 kt(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Lt=kt("dragHorizontal"),Ft=kt("dragVertical");function jt(t){let e=!1;if("y"===t)e=Ft();else if("x"===t)e=Lt();else{const t=Lt(),n=Ft();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function It(){const t=jt(!0);return!t||(t(),!1)}const Ut=(t,e,n)=>{const i=e-t;return 0===i?1:(n-t)/i},Ot=(t,e,n)=>-n*t+n*e+t;function Nt(t){return t.max-t.min}function zt(t,e=0,n=.01){return Math.abs(t-e)<=n}function $t(t,e,n,i=.5){t.origin=i,t.originPoint=Ot(e.min,e.max,t.origin),t.scale=Nt(n)/Nt(e),(zt(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=Ot(n.min,n.max,t.origin)-t.originPoint,(zt(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Gt(t,e,n,i){$t(t.x,e.x,n.x,null==i?void 0:i.originX),$t(t.y,e.y,n.y,null==i?void 0:i.originY)}function Ht(t,e,n){t.min=n.min+e.min,t.max=t.min+Nt(e)}function Wt(t,e,n){t.min=e.min-n.min,t.max=t.min+Nt(e)}function qt(t,e,n){Wt(t.x,e.x,n.x),Wt(t.y,e.y,n.y)}function Yt(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 Xt(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 Kt=.35;function Zt(t,e,n){return{min:_t(t,e),max:_t(t,n)}}function _t(t,e){return"number"==typeof t?t:t[e]||0}var Jt;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(Jt||(Jt={}));function Qt(t){return[t("x"),t("y")]}function te({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function ee(t){return void 0===t||1===t}function ne({scale:t,scaleX:e,scaleY:n}){return!ee(t)||!ee(e)||!ee(n)}function ie(t){return ne(t)||se(t)||t.z||t.rotate||t.rotateX||t.rotateY}function se(t){return oe(t.x)||oe(t.y)}function oe(t){return t&&"0%"!==t}function re(t,e,n){return n+e*(t-n)}function ae(t,e,n,i,s){return void 0!==s&&(t=re(t,s,i)),re(t,n,i)+e}function le(t,e=0,n=1,i,s){t.min=ae(t.min,e,n,i,s),t.max=ae(t.max,e,n,i,s)}function ue(t,{x:e,y:n}){le(t.x,e.translate,e.scale,e.originPoint),le(t.y,n.translate,n.scale,n.originPoint)}function ce(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function he(t,e){t.min=t.min+e,t.max=t.max+e}function de(t,e,[n,i,s]){const o=void 0!==e[s]?e[s]:.5,r=Ot(t.min,t.max,o);le(t,e[n],e[i],r,e.scale)}const pe=["x","scaleX","originX"],me=["y","scaleY","originY"];function fe(t,e){de(t.x,e,pe),de(t.y,e,me)}function ve(t,e){return te(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 ge=!1,ye=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,xe=t=>e=>1-t(1-e),Te=t=>t*t,Pe=xe(Te),Ve=ye(Te),be=(t,e)=>n=>Boolean(u(n)&&c.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),Ee=(t,e,n)=>i=>{if(!u(i))return i;const[s,o,r,a]=i.match(h);return{[t]:parseFloat(s),[e]:parseFloat(o),[n]:parseFloat(r),alpha:void 0!==a?parseFloat(a):1}},Ae={...m,transform:t=>Math.round((t=>l(0,255,t))(t))},Se={test:be("rgb","red"),parse:Ee("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+Ae.transform(t)+", "+Ae.transform(e)+", "+Ae.transform(n)+", "+d(p.transform(i))+")"};const we={test:be("#"),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:Se.transform},Ce={test:be("hsl","hue"),parse:Ee("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+f.transform(d(e))+", "+f.transform(d(n))+", "+d(p.transform(i))+")"},Me={test:t=>Se.test(t)||we.test(t)||Ce.test(t),parse:t=>Se.test(t)?Se.parse(t):Ce.test(t)?Ce.parse(t):we.parse(t),transform:t=>u(t)?t:t.hasOwnProperty("red")?Se.transform(t):Ce.transform(t)};function De(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}const Re=(t,e,n)=>{const i=t*t;return Math.sqrt(Math.max(0,n*(e*e-i)+i))},Be=[we,Se,Ce];function ke(t){const e=(n=t,Be.find(t=>t.test(n)));var n;let i=e.parse(t);return e===Ce&&(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=De(a,i,t+1/3),o=De(a,i,t),r=De(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 Le=(t,e)=>{const n=ke(t),i=ke(e),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=Ot(n.alpha,i.alpha,t),Se.transform(s))};function Fe(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,i=0;const s=t.match(v);s&&(n=s.length,t=t.replace(v,"${c}"),e.push(...s.map(Me.parse)));const o=t.match(h);return o&&(i=o.length,t=t.replace(h,"${n}"),e.push(...o.map(m.parse))),{values:e,numColors:n,numNumbers:i,tokenised:t}}function je(t){return Fe(t).values}function Ie(t){const{values:e,numColors:n,tokenised:i}=Fe(t),s=e.length;return t=>{let e=i;for(let i=0;i<s;i++)e=e.replace(i<n?"${c}":"${n}",i<n?Me.transform(t[i]):d(t[i]));return e}}const Ue=t=>"number"==typeof t?0:t;const Oe={test:function(t){var e,n;return isNaN(t)&&u(t)&&((null===(e=t.match(h))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(v))||void 0===n?void 0:n.length)||0)>0},parse:je,createTransformer:Ie,getAnimatableNone:function(t){const e=je(t);return Ie(t)(e.map(Ue))}};function Ne(t,e){return"number"==typeof t?n=>Ot(t,e,n):Me.test(t)?Le(t,e):Ge(t,e)}const ze=(t,e)=>{const n=[...t],i=n.length,s=t.map((t,n)=>Ne(t,e[n]));return t=>{for(let e=0;e<i;e++)n[e]=s[e](t);return n}},$e=(t,e)=>{const n={...t,...e},i={};for(const s in n)void 0!==t[s]&&void 0!==e[s]&&(i[s]=Ne(t[s],e[s]));return t=>{for(const e in i)n[e]=i[e](t);return n}},Ge=(t,e)=>{const n=Oe.createTransformer(e),i=Fe(t),s=Fe(e);return i.numColors===s.numColors&&i.numNumbers>=s.numNumbers?Et(ze(i.values,s.values),n):n=>""+(n>0?e:t)},He=(t,e)=>n=>Ot(t,e,n);function We(t,e,n){const i=[],s=n||("number"==typeof(o=t[0])?He:"string"==typeof o?Me.test(o)?Le:Ge:Array.isArray(o)?ze:"object"==typeof o?$e:He);var o;const r=t.length-1;for(let n=0;n<r;n++){let o=s(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;o=Et(t,o)}i.push(o)}return i}function qe(t,e,{clamp:n=!0,ease:i,mixer:s}={}){const o=t.length;e.length,!i||!Array.isArray(i)||i.length,t[0]>t[o-1]&&(t=[...t].reverse(),e=[...e].reverse());const r=We(e,i,s),a=r.length,u=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const i=Ut(t[n],t[n+1],e);return r[n](i)};return n?e=>u(l(t[0],t[o-1],e)):u}const Ye=t=>t,Xe=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function Ke(t,e,n,i){if(t===e&&n===i)return Ye;const s=e=>function(t,e,n,i,s){let o,r,a=0;do{r=e+(n-e)/2,o=Xe(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:Xe(s(t),e,i)}const Ze=t=>1-Math.sin(Math.acos(t)),_e=xe(Ze),Je=ye(_e),Qe=Ke(.33,1.53,.69,.99),tn=xe(Qe),en=ye(tn),nn={linear:Ye,easeIn:Te,easeInOut:Ve,easeOut:Pe,circIn:Ze,circInOut:Je,circOut:_e,backIn:tn,backInOut:en,backOut:Qe,anticipate:t=>(t*=2)<1?.5*tn(t):.5*(2-Math.pow(2,-10*(t-1)))},sn=t=>{if(Array.isArray(t)){t.length;const[e,n,i,s]=t;return Ke(e,n,i,s)}return"string"==typeof t?nn[t]:t};function on({keyframes:t,ease:e=Ve,times:n,duration:i=300}){t=[...t];const s=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(sn):sn(e),o={done:!1,value:t[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(t),i);function a(){return qe(r,t,{ease:Array.isArray(s)?s:(e=t,n=s,e.map(()=>n||Ve).splice(0,e.length-1))});var e,n}let l=a();return{next:t=>(o.value=l(t),o.done=t>=i,o),flipTarget:()=>{t.reverse(),l=a()}}}function rn({duration:t=800,bounce:e=.25,velocity:n=0,mass:i=1}){let s,o,r=1-e;r=l(.05,1,r),t=l(.01,10,t/1e3),r<1?(s=e=>{const i=e*r,s=i*t;return.001-(i-n)/an(e,r)*Math.exp(-s)},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),u=an(Math.pow(e,2),r);return(.001-s(e)>0?-1:1)*((o-a)*l)/u}):(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<12;n++)i-=t(i)/e(i);return i}(s,o,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*r*Math.sqrt(i*e),duration:t}}}function an(t,e){return t*Math.sqrt(1-e*e)}function ln(t,e){return e?t*(1e3/e):0}const un=["duration","bounce"],cn=["stiffness","damping","mass"];function hn(t,e){return e.some(e=>void 0!==t[e])}function dn({keyframes:t,restDelta:e,restSpeed:n,...i}){let s=t[0],o=t[t.length-1];const r={done:!1,value:s},{stiffness:a,damping:l,mass:u,velocity:c,duration:h,isResolvedFromDuration:d}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!hn(t,cn)&&hn(t,un)){const n=rn(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(i);let p=pn,m=c?-c/1e3:0;const f=l/(2*Math.sqrt(a*u));function v(){const t=o-s,i=Math.sqrt(a/u)/1e3,r=Math.abs(t)<5;if(n||(n=r?.01:2),e||(e=r?.005:.5),f<1){const e=an(i,f);p=n=>{const s=Math.exp(-f*i*n);return o-s*((m+f*i*t)/e*Math.sin(e*n)+t*Math.cos(e*n))}}else if(1===f)p=e=>o-Math.exp(-i*e)*(t+(m+i*t)*e);else{const e=i*Math.sqrt(f*f-1);p=n=>{const s=Math.exp(-f*i*n),r=Math.min(e*n,300);return o-s*((m+f*i*t)*Math.sinh(r)+e*t*Math.cosh(r))/e}}}return v(),{next:t=>{const i=p(t);if(d)r.done=t>=h;else{let s=m;if(0!==t)if(f<1){const e=Math.max(0,t-5);s=ln(i-p(e),t-e)}else s=0;const a=Math.abs(s)<=n,l=Math.abs(o-i)<=e;r.done=a&&l}return r.value=r.done?o:i,r},flipTarget:()=>{m=-m,[s,o]=[o,s],v()}}}dn.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const pn=t=>0;const mn={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:i=350,restDelta:s=.5,modifyTarget:o}){const r=t[0],a={done:!1,value:r};let l=n*e;const u=r+l,c=void 0===o?u:o(u);return c!==u&&(l=c-r),{next:t=>{const e=-l*Math.exp(-t/i);return a.done=!(e>s||e<-s),a.value=a.done?c:c+e,a},flipTarget:()=>{}}},keyframes:on,tween:on,spring:dn};function fn(t,e,n=0){return t-e-n}const vn=t=>{const e=({delta:e})=>t(e);return{start:()=>dt.update(e,!0),stop:()=>pt.update(e)}};function gn({duration:t,driver:e=vn,elapsed:n=0,repeat:i=0,repeatType:s="loop",repeatDelay:o=0,keyframes:r,autoplay:a=!0,onPlay:l,onStop:u,onComplete:c,onRepeat:h,onUpdate:d,type:p="keyframes",...m}){var f,v;const g=n;let y,x,T=0,P=t,V=!1,b=!0;const E=mn[r.length>2?"keyframes":p]||on,A=r[0],S=r[r.length-1];let w={done:!1,value:A};(null===(v=(f=E).needsInterpolation)||void 0===v?void 0:v.call(f,A,S))&&(x=qe([0,100],[A,S],{clamp:!1}),r=[0,100]);const C=E({...m,duration:t,keyframes:r});function M(){T++,"reverse"===s?(b=T%2==0,n=function(t,e=0,n=0,i=!0){return i?fn(e+-t,e,n):e-(t-e)+n}(n,P,o,b)):(n=fn(n,P,o),"mirror"===s&&C.flipTarget()),V=!1,h&&h()}function D(t){b||(t=-t),n+=t,V||(w=C.next(Math.max(0,n)),x&&(w.value=x(w.value)),V=b?w.done:n<=0),d&&d(w.value),V&&(0===T&&(P=void 0!==P?P:n),T<i?function(t,e,n,i){return i?t>=e+n:t<=-n}(n,P,o,b)&&M():(y&&y.stop(),c&&c()))}return a&&(l&&l(),y=e(D),y.start()),{stop:()=>{u&&u(),y&&y.stop()},set currentTime(t){n=g,D(t)},sample:e=>{n=g;const i=t&&"number"==typeof t?Math.max(.5*t,50):50;let s=0;for(D(0);s<=e;){const t=e-s;D(Math.min(t,i)),s+=i}return w}}}const yn=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,xn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:yn([0,.65,.55,1]),circOut:yn([.55,0,1,.45]),backIn:yn([.31,.01,.66,-.59]),backOut:yn([.33,1.53,.69,.99])};function Tn(t){if(t)return Array.isArray(t)?yn(t):xn[t]}const Pn={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},Vn={},bn={};for(const t in Pn)bn[t]=()=>(void 0===Vn[t]&&(Vn[t]=Pn[t]()),Vn[t]);const En=new Set(["opacity"]);function An(t,e,{onUpdate:n,onComplete:i,...s}){if(!(bn.waapi()&&En.has(e)&&!s.repeatDelay&&"mirror"!==s.repeatType&&0!==s.damping))return!1;let{keyframes:o,duration:r=300,elapsed:a=0,ease:l}=s;if("spring"===s.type||!(!(u=s.ease)||Array.isArray(u)||"string"==typeof u&&xn[u])){if(s.repeat===1/0)return;const t=gn({...s,elapsed:0});let e={done:!1,value:o[0]};const n=[];let i=0;for(;!e.done&&i<2e4;)e=t.sample(i),n.push(e.value),i+=10;o=n,r=i-10,l="linear"}var u;const c=function(t,e,n,{delay:i=0,duration:s,repeat:o=0,repeatType:r="loop",ease:a,times:l}={}){return t.animate({[e]:n,offset:l},{delay:i,duration:s,easing:Tn(a),fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}(t.owner.current,e,o,{...s,delay:-a,duration:r,ease:l});return c.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(o,s)),dt.update(()=>c.cancel()),i&&i()},{get currentTime(){return c.currentTime||0},set currentTime(t){c.currentTime=t},stop:()=>{const{currentTime:e}=c;if(e){const n=gn({...s,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}dt.update(()=>c.cancel())}}}function Sn(t,e){const n=performance.now(),i=({timestamp:s})=>{const o=s-n;o>=e&&(pt.read(i),t(o-e))};return dt.read(i,!0),()=>pt.read(i)}function wn({keyframes:t,elapsed:e,onUpdate:n,onComplete:i}){const s=()=>{n&&n(t[t.length-1]),i&&i()};return e?{stop:Sn(s,-e)}:s()}const Cn=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Mn=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Dn=()=>({type:"keyframes",ease:"linear",duration:.3}),Rn={type:"keyframes",duration:.8},Bn={x:Cn,y:Cn,z:Cn,rotate:Cn,rotateX:Cn,rotateY:Cn,rotateZ:Cn,scaleX:Mn,scaleY:Mn,scale:Mn,opacity:Dn,backgroundColor:Dn,color:Dn,default:Mn},kn=(t,{keyframes:e})=>{if(e.length>2)return Rn;return(Bn[t]||Bn.default)(e[1])},Ln=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Oe.test(e)||e.startsWith("url("))),Fn=new Set(["brightness","contrast","saturate","opacity"]);function jn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(h)||[];if(!i)return t;const s=n.replace(i,"");let o=Fn.has(e)?1:0;return i!==n&&(o*=100),e+"("+o+s+")"}const In=/([a-z-]*)\(.*?\)/g,Un={...Oe,getAnimatableNone:t=>{const e=t.match(In);return e?e.map(jn).join(" "):t}},On={...g,color:Me,backgroundColor:Me,outlineColor:Me,fill:Me,stroke:Me,borderColor:Me,borderTopColor:Me,borderRightColor:Me,borderBottomColor:Me,borderLeftColor:Me,filter:Un,WebkitFilter:Un},Nn=t=>On[t];function zn(t,e){var n;let i=Nn(t);return i!==Un&&(i=Oe),null===(n=i.getAnimatableNone)||void 0===n?void 0:n.call(i,e)}function $n(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Gn(t){return"number"==typeof t?0:zn("",t)}function Hn(t,e){return t[e]||t.default||t}const Wn=(t,e,n,i={})=>s=>{const o=Hn(i,t)||{},r=o.delay||i.delay||0;let{elapsed:a=0}=i;a-=yt(r);const l=function(t,e,n,i){const s=Ln(e,n);let o=void 0!==i.from?i.from:t.get();return"none"===o&&s&&"string"==typeof n?o=zn(e,n):$n(o)&&"string"==typeof n?o=Gn(n):!Array.isArray(n)&&$n(n)&&"string"==typeof o&&(n=Gn(o)),Array.isArray(n)?(null===n[0]&&(n[0]=o),n):[o,n]}(e,t,n,o),u=l[0],c=l[l.length-1],h=Ln(t,u),d=Ln(t,c);let p={keyframes:l,velocity:e.getVelocity(),...o,elapsed:a,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{s(),o.onComplete&&o.onComplete()}};if(!h||!d||ge||!1===o.type)return wn(p);if("inertia"===o.type)return function({keyframes:t,velocity:e=0,min:n,max:i,power:s=.8,timeConstant:o=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:u,driver:c,onUpdate:h,onComplete:d,onStop:p}){const m=t[0];let f;function v(t){return void 0!==n&&t<n||void 0!==i&&t>i}function g(t){return void 0===n?i:void 0===i||Math.abs(n-t)<Math.abs(i-t)?n:i}function y(t){null==f||f.stop(),f=gn({keyframes:[0,1],velocity:0,...t,driver:c,onUpdate:e=>{var n;null==h||h(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:d,onStop:p})}function x(t){y({type:"spring",stiffness:r,damping:a,restDelta:l,...t})}if(v(m))x({velocity:e,keyframes:[m,g(m)]});else{let t=s*e+m;void 0!==u&&(t=u(t));const i=g(t),r=i===n?-1:1;let a,c;const h=t=>{a=c,c=t,e=ln(t-a,rt.delta),(1===r&&t>i||-1===r&&t<i)&&x({keyframes:[t,i],velocity:e})};y({type:"decay",keyframes:[m,0],velocity:e,timeConstant:o,power:s,restDelta:l,modifyTarget:u,onUpdate:v(t)?h:void 0})}return{stop:()=>null==f?void 0:f.stop()}}(p);(function({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:s,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(o)||(p={...p,...kn(t,p)}),p.duration&&(p.duration=yt(p.duration)),p.repeatDelay&&(p.repeatDelay=yt(p.repeatDelay));const m=e.owner,f=m&&m.current;if(m&&f instanceof HTMLElement&&!(null==m?void 0:m.getProps().onUpdate)){const n=An(e,t,p);if(n)return n}return gn(p)},qn=new WeakMap;class Yn{constructor(t){this.openGlobalLock=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}={}){if(!1===this.visualElement.isPresent)return;this.panSession=new St(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(nt(t,"page").point)},onStart:(t,e)=>{var n;const{drag:i,dragPropagation:s,onDragStart:o}=this.getProps();(!i||s||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=jt(i),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Qt(t=>{var e,n;let i=this.getAxisMotionValue(t).get()||0;if(f.test(i)){const s=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.layoutBox[t];if(s){i=Nt(s)*(parseFloat(i)/100)}}this.originPoint[t]=i}),null==o||o(t,e),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(Jt.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:i,onDirectionLock:s,onDrag:o}=this.getProps();if(!n&&!this.openGlobalLock)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&&(null==s||s(this.currentDirection)));this.updateAxis("x",e.point,r),this.updateAxis("y",e.point,r),this.visualElement.render(),null==o||o(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:i}=e;this.startAnimation(i);const{onDragEnd:s}=this.getProps();null==s||s(t,e)}cancel(){var t,e;this.isDragging=!1,this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!1),null===(t=this.panSession)||void 0===t||t.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(Jt.Drag,!1)}updateAxis(t,e,n){const{drag:i}=this.getProps();if(!n||!Xn(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?Ot(e,t,i.min):Math.max(t,e):void 0!==n&&t>n&&(t=i?Ot(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(),{layout:n}=this.visualElement.projection||{},i=this.constraints;t&&y(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:i,right:s}){return{x:Yt(t.x,n,s),y:Yt(t.y,e,i)}}(n.layoutBox,t),this.elastic=function(t=Kt){return!1===t?t=0:!0===t&&(t=Kt),{x:Zt(t,"left","right"),y:Zt(t,"top","bottom")}}(e),i!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&Qt(t=>{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||!y(t))return!1;const n=t.current,{projection:i}=this.visualElement;if(!i||!i.layout)return!1;const s=function(t,e,n){const i=ve(t,n),{scroll:s}=e;return s&&(he(i.x,s.offset.x),he(i.y,s.offset.y)),i}(n,i.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:Xt(t.x,e.x),y:Xt(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=te(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=Qt(r=>{if(!Xn(r,e,this.currentDirection))return;let l=(null==a?void 0:a[r])||{};o&&(l={min:0,max:0});const u=i?200:1e6,c=i?40:1e7,h={type:"inertia",velocity:n?t[r]:0,bounceStiffness:u,bounceDamping:c,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 n.start(Wn(t,n,0,e))}stopAnimation(){Qt(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var e;const n="_drag"+t.toUpperCase(),i=this.visualElement.getProps()[n];return i||this.visualElement.getValue(t,(null===(e=this.visualElement.getProps().initial)||void 0===e?void 0:e[t])||0)}snapToCursor(t){Qt(e=>{const{drag:n}=this.getProps();if(!Xn(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]-Ot(n,o,.5))}})}scalePositionWithinConstraints(){var t;if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!y(n)||!i||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Qt(t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();s[t]=function(t,e){let n=.5;const i=Nt(t),s=Nt(e);return s>i?n=Ut(e.min,e.max-i,t.min):i>s&&(n=Ut(t.min,t.max-s,e.min)),l(0,1,n)}({min:n,max:n},this.constraints[t])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout(),this.resolveConstraints(),Qt(t=>{if(!Xn(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:o}=this.constraints[t];n.set(Ot(i,o,s[t]))})}addListeners(){var t;if(!this.visualElement.current)return;qn.set(this.visualElement,this);const e=Pt(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),n=()=>{const{dragConstraints:t}=this.getProps();y(t)&&(this.constraints=this.resolveRefConstraints())},{projection:i}=this.visualElement,s=i.addEventListener("measure",n);i&&!i.layout&&(null===(t=i.root)||void 0===t||t.updateScroll(),i.updateLayout()),n();const o=xt(window,"resize",()=>this.scalePositionWithinConstraints()),r=i.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(Qt(e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))}),this.visualElement.render())});return()=>{o(),e(),s(),null==r||r()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=Kt,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:r}}}function Xn(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function Kn(t){return e(()=>()=>t(),[])}const Zn=t=>e=>(t(e),null),_n={pan:Zn((function({onPan:t,onPanStart:s,onPanEnd:o,onPanSessionStart:r,visualElement:a}){const l=t||s||o||r,u=n(null),{transformPagePoint:c}=i(T),h={onSessionStart:r,onStart:s,onMove:t,onEnd:(t,e)=>{u.current=null,o&&o(t,e)}};e(()=>{null!==u.current&&u.current.updateHandlers(h)}),Vt(a,"pointerdown",l&&function(t){u.current=new St(t,h,{transformPagePoint:c})}),Kn(()=>u.current&&u.current.end())})),drag:Zn((function(t){const{dragControls:n,visualElement:i}=t,s=x(()=>new Yn(i));e(()=>n&&n.subscribe(s),[s,n]),e(()=>s.addListeners(),[s])}))};function Jn(){const t=i(P);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:r}=t,a=s();e(()=>r(a),[]);return!n&&o?[!1,()=>o&&o(a)]:[!0]}function Qn(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const ti={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!V.test(t))return t;t=parseFloat(t)}return`${Qn(t,e.target.x)}% ${Qn(t,e.target.y)}%`}};function ei(t){return"string"==typeof t&&t.startsWith("var(--")}const ni=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function ii(t,e,n=1){const[i,s]=function(t){const e=ni.exec(t);if(!e)return[,];const[,n,i]=e;return[n,i]}(t);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);return o?o.trim():ei(s)?ii(s,e,n+1):s}const si={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,s=t.includes("var("),o=[];s&&(t=t.replace(ni,t=>(o.push(t),"_$css")));const r=Oe.parse(t);if(r.length>5)return i;const a=Oe.createTransformer(t),l="number"!=typeof r[0]?1:0,u=n.x.scale*e.x,c=n.y.scale*e.y;r[0+l]/=u,r[1+l]/=c;const h=Ot(u,c,.5);"number"==typeof r[2+l]&&(r[2+l]/=h),"number"==typeof r[3+l]&&(r[3+l]/=h);let d=a(r);if(s){let t=0;d=d.replace("_$css",()=>{const e=o[t];return t++,e})}return d}};class oi extends t.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;b(ri),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()})),E.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:i,isPresent:s}=this.props,o=n.projection;return o?(o.isPresent=s,i||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||dt.postRender(()=>{var t;(null===(t=o.getStack())||void 0===t?void 0:t.members.length)||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!t.currentAnimation&&t.isLead()&&this.safeToRemove())}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:i}=t;i&&(i.scheduleCheckAfterUnmount(),(null==e?void 0:e.group)&&e.group.remove(i),(null==n?void 0:n.deregister)&&n.deregister(i))}safeToRemove(){const{safeToRemove:t}=this.props;null==t||t()}render(){return null}}const ri={borderRadius:{...ti,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ti,borderTopRightRadius:ti,borderBottomLeftRadius:ti,borderBottomRightRadius:ti,boxShadow:si},ai={measureLayout:function(e){const[n,s]=Jn(),o=i(A);return t.createElement(oi,{...e,layoutGroup:o,switchLayoutGroup:i(S),isPresent:n,safeToRemove:s})}};function li(t,e){-1===t.indexOf(e)&&t.push(e)}function ui(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class ci{constructor(){this.subscriptions=[]}add(t){return li(this.subscriptions,t),()=>ui(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}}class hi{constructor(t,e={}){var n;this.version="9.0.2",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:i}=rt;this.lastUpdated!==i&&(this.timeDelta=n,this.lastUpdated=i,dt.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>dt.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new ci);const n=this.events[t].add(e);return"change"===t?()=>{n(),dt.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=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?ln(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e)||null,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(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function di(t,e){return new hi(t,e)}const pi=["TopLeft","TopRight","BottomLeft","BottomRight"],mi=pi.length,fi=t=>"string"==typeof t?parseFloat(t):t,vi=t=>"number"==typeof t||V.test(t);function gi(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const yi=Ti(0,.5,_e),xi=Ti(.5,.95,Ye);function Ti(t,e,n){return i=>i<t?0:i>e?1:n(Ut(t,e,i))}function Pi(t,e){t.min=e.min,t.max=e.max}function Vi(t,e){Pi(t.x,e.x),Pi(t.y,e.y)}function bi(t,e,n,i,s){return t=re(t-=e,1/n,i),void 0!==s&&(t=re(t,1/s,i)),t}function Ei(t,e,[n,i,s],o,r){!function(t,e=0,n=1,i=.5,s,o=t,r=t){if(f.test(e)){e=parseFloat(e);e=Ot(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let a=Ot(o.min,o.max,i);t===o&&(a-=e),t.min=bi(t.min,e,n,a,s),t.max=bi(t.max,e,n,a,s)}(t,e[n],e[i],e[s],e.scale,o,r)}const Ai=["x","scaleX","originX"],Si=["y","scaleY","originY"];function wi(t,e,n,i){Ei(t.x,e,Ai,null==n?void 0:n.x,null==i?void 0:i.x),Ei(t.y,e,Si,null==n?void 0:n.y,null==i?void 0:i.y)}function Ci(t){return 0===t.translate&&1===t.scale}function Mi(t){return Ci(t.x)&&Ci(t.y)}function Di(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function Ri(t){return Nt(t.x)/Nt(t.y)}class Bi{constructor(){this.members=[]}add(t){li(this.members,t),t.scheduleRender()}remove(t){if(ui(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){var n;const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.instance&&i.scheduleRender(),t.scheduleRender(),t.resumeFrom=i,e&&(t.resumeFrom.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),(null===(n=t.root)||void 0===n?void 0:n.isUpdating)&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;!1===s&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var e,n,i,s,o;null===(n=(e=t.options).onExitComplete)||void 0===n||n.call(e),null===(o=null===(i=t.resumingFrom)||void 0===i?void 0:(s=i.options).onExitComplete)||void 0===o||o.call(s)})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ki(t,e,n){let i="";const s=t.x.translate/e.x,o=t.y.translate/e.y;if((s||o)&&(i=`translate3d(${s}px, ${o}px, 0) `),1===e.x&&1===e.y||(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:s}=n;t&&(i+=`rotate(${t}deg) `),e&&(i+=`rotateX(${e}deg) `),s&&(i+=`rotateY(${s}deg) `)}const r=t.x.scale*e.x,a=t.y.scale*e.y;return 1===r&&1===a||(i+=`scale(${r}, ${a})`),i||"none"}const Li=(t,e)=>t.depth-e.depth;class Fi{constructor(){this.children=[],this.isDirty=!1}add(t){li(this.children,t),this.isDirty=!0}remove(t){ui(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(Li),this.isDirty=!1,this.children.forEach(t)}}const ji=["","X","Y","Z"];let Ii=0;function Ui({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:s}){return class{constructor(t,n={},i=(null==e?void 0:e())){this.id=Ii++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(zi),this.nodes.forEach(qi),this.nodes.forEach(Yi)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=i?i.root||i:this,this.path=i?[...i.path,i]:[],this.parent=i,this.depth=i?i.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new Fi)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new ci),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);null==n||n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){var i;if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:s,layout:o,visualElement:r}=this.options;if(r&&!r.current&&r.mount(e),this.root.nodes.add(this),null===(i=this.parent)||void 0===i||i.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(o||s)&&(this.isLayoutDirty=!0),t){let n;const i=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=Sn(i,250),E.hasAnimatedSinceResize&&(E.hasAnimatedSinceResize=!1,this.nodes.forEach(Wi))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&r&&(s||o)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:i})=>{var s,o,a,l,u;if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const c=null!==(o=null!==(s=this.options.transition)&&void 0!==s?s:r.getDefaultTransition())&&void 0!==o?o:Qi,{onLayoutAnimationStart:h,onLayoutAnimationComplete:d}=r.getProps(),p=!this.targetLayout||!Di(this.targetLayout,i)||n,m=!e&&n;if(this.options.layoutRoot||(null===(a=this.resumeFrom)||void 0===a?void 0:a.instance)||m||e&&(p||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,m);const e={...Hn(c,"layout"),onPlay:h,onComplete:d};(r.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||Wi(this),this.isLead()&&(null===(u=(l=this.options).onExitComplete)||void 0===u||u.call(l));this.targetLayout=i})}unmount(){var t,e;this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this),null===(t=this.getStack())||void 0===t||t.remove(this),null===(e=this.parent)||void 0===e||e.children.delete(this),this.instance=void 0,pt.preRender(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){var t;return this.isAnimationBlocked||(null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimationBlocked())||!1}startUpdate(){var t;this.isUpdateBlocked()||(this.isUpdating=!0,null===(t=this.nodes)||void 0===t||t.forEach(Xi),this.animationId++)}getTransformTemplate(){var t;return null===(t=this.options.visualElement)||void 0===t?void 0:t.getProps().transformTemplate}willUpdate(t=!0){var e,n,i;if(this.root.isUpdateBlocked())return void(null===(n=(e=this.options).onExitComplete)||void 0===n||n.call(e));if(!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:s,layout:o}=this.options;(void 0!==s||o)&&(this.prevTransformTemplateValue=null===(i=this.getTransformTemplate())||void 0===i?void 0:i(this.latestValues,""),this.updateSnapshot(),t&&this.notifyListeners("willUpdate"))}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(Gi);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(ts),this.potentialNodes.clear()),this.nodes.forEach(Hi),this.nodes.forEach(Oi),this.nodes.forEach(Ni),this.clearAllSnapshots(),mt.update(),mt.preRender(),mt.render())}clearAllSnapshots(){this.nodes.forEach($i),this.sharedNodes.forEach(Ki)}scheduleUpdateProjection(){dt.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){dt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){var t;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 e=this.layout;this.layout=this.measure(!1),this.layoutCorrected={x:{min:0,max:0},y:{min:0,max:0}},this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox),null===(t=this.options.visualElement)||void 0===t||t.notify("LayoutMeasure",this.layout.layoutBox,null==e?void 0:e.layoutBox)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:i(this.instance),offset:n(this.instance)})}resetTransform(){var t;if(!s)return;const e=this.isLayoutDirty||this.shouldResetTransform,n=this.projectionDelta&&!Mi(this.projectionDelta),i=null===(t=this.getTransformTemplate())||void 0===t?void 0:t(this.latestValues,""),o=i!==this.prevTransformTemplateValue;e&&(n||ie(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)),es((i=n).x),es(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(),{scroll:n}=this.root;return n&&(he(e.x,n.offset.x),he(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};Vi(e,t);for(let n=0;n<this.path.length;n++){const i=this.path[n],{scroll:s,options:o}=i;if(i!==this.root&&s&&o.layoutScroll){if(s.isRoot){Vi(e,t);const{scroll:n}=this.root;n&&(he(e.x,-n.offset.x),he(e.y,-n.offset.y))}he(e.x,s.offset.x),he(e.y,s.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};Vi(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&&fe(n,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),ie(i.latestValues)&&fe(n,i.latestValues)}return ie(this.latestValues)&&fe(n,this.latestValues),n}removeTransform(t){var e;const n={x:{min:0,max:0},y:{min:0,max:0}};Vi(n,t);for(let t=0;t<this.path.length;t++){const i=this.path[t];if(!i.instance)continue;if(!ie(i.latestValues))continue;ne(i.latestValues)&&i.updateSnapshot();const s={x:{min:0,max:0},y:{min:0,max:0}};Vi(s,i.measurePageBox()),wi(n,i.latestValues,null===(e=i.snapshot)||void 0===e?void 0:e.layoutBox,s)}return ie(this.latestValues)&&wi(n,this.latestValues),n}setTargetDelta(t){this.targetDelta=t,this.isProjectionDirty=!0,this.root.scheduleUpdateProjection()}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}resolveTargetDelta(){var t;const e=this.getLead();if(this.isProjectionDirty||(this.isProjectionDirty=e.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=e.isTransformDirty),!this.isProjectionDirty&&!this.attemptToResolveRelativeTarget)return;const{layout:n,layoutId:i}=this.options;if(this.layout&&(n||i)){if(!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},qt(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Vi(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var s,o,r;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&&(null===(t=this.relativeParent)||void 0===t?void 0:t.target)?(s=this.target,o=this.relativeTarget,r=this.relativeParent.target,Ht(s.x,o.x,r.x),Ht(s.y,o.y,r.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Vi(this.target,this.layout.layoutBox),ue(this.target,this.targetDelta)):Vi(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?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},qt(this.relativeTargetOrigin,this.target,t.target),Vi(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!ne(this.parent.latestValues)&&!se(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta||this.parent.options.layoutRoot)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){var t;const{isProjectionDirty:e,isTransformDirty:n}=this;this.isProjectionDirty=this.isTransformDirty=!1;const i=this.getLead(),s=Boolean(this.resumingFrom)||this!==i;let o=!0;if(e&&(o=!1),s&&n&&(o=!1),o)return;const{layout:r,layoutId:a}=this.options;if(this.isTreeAnimating=Boolean((null===(t=this.parent)||void 0===t?void 0:t.isTreeAnimating)||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!r&&!a)return;Vi(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,i=!1){var s,o;const r=n.length;if(!r)return;let a,l;e.x=e.y=1;for(let u=0;u<r;u++)a=n[u],l=a.projectionDelta,"contents"!==(null===(o=null===(s=a.instance)||void 0===s?void 0:s.style)||void 0===o?void 0:o.display)&&(i&&a.options.layoutScroll&&a.scroll&&a!==a.root&&fe(t,{x:-a.scroll.offset.x,y:-a.scroll.offset.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,ue(t,l)),i&&ie(a.latestValues)&&fe(t,a.latestValues));e.x=ce(e.x),e.y=ce(e.y)}(this.layoutCorrected,this.treeScale,this.path,s);const{target:l}=i;if(!l)return;this.projectionDelta||(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}});const u=this.treeScale.x,c=this.treeScale.y,h=this.projectionTransform;Gt(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=ki(this.projectionDelta,this.treeScale),this.projectionTransform===h&&this.treeScale.x===u&&this.treeScale.y===c||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){var e,n,i;null===(n=(e=this.options).scheduleRender)||void 0===n||n.call(e),t&&(null===(i=this.getStack())||void 0===i||i.scheduleRender()),this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){var n,i;const s=this.snapshot,o=(null==s?void 0:s.latestValues)||{},r={...this.latestValues},a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const l={x:{min:0,max:0},y:{min:0,max:0}},u=(null==s?void 0:s.source)!==(null===(n=this.layout)||void 0===n?void 0:n.source),c=((null===(i=this.getStack())||void 0===i?void 0:i.members.length)||0)<=1,h=Boolean(u&&!c&&!0===this.options.crossfade&&!this.path.some(Ji));this.animationProgress=0,this.mixTargetDelta=e=>{var n;const i=e/1e3;var s,d,p,m;Zi(a.x,t.x,i),Zi(a.y,t.y,i),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&(null===(n=this.relativeParent)||void 0===n?void 0:n.layout)&&(qt(l,this.layout.layoutBox,this.relativeParent.layout.layoutBox),s=this.relativeTarget,d=this.relativeTargetOrigin,p=l,m=i,_i(s.x,d.x,p.x,m),_i(s.y,d.y,p.y,m)),u&&(this.animationValues=r,function(t,e,n,i,s,o){s?(t.opacity=Ot(0,void 0!==n.opacity?n.opacity:1,yi(i)),t.opacityExit=Ot(void 0!==e.opacity?e.opacity:1,0,xi(i))):o&&(t.opacity=Ot(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,i));for(let s=0;s<mi;s++){const o=`border${pi[s]}Radius`;let r=gi(e,o),a=gi(n,o);if(void 0===r&&void 0===a)continue;r||(r=0),a||(a=0);0===r||0===a||vi(r)===vi(a)?(t[o]=Math.max(Ot(fi(r),fi(a),i),0),(f.test(a)||f.test(r))&&(t[o]+="%")):t[o]=a}(e.rotate||n.rotate)&&(t.rotate=Ot(e.rotate||0,n.rotate||0,i))}(r,o,this.latestValues,i,h,c)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=i},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){var e,n;this.notifyListeners("animationStart"),null===(e=this.currentAnimation)||void 0===e||e.stop(),this.resumingFrom&&(null===(n=this.resumingFrom.currentAnimation)||void 0===n||n.stop()),this.pendingAnimation&&(pt.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=dt.update(()=>{E.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const i=w(t)?t:di(t);return i.start(Wn("",i,e,n)),{stop:()=>i.stop(),isAnimating:()=>i.isAnimating()}}(0,1e3,{...t,onUpdate:e=>{var n;this.mixTargetDelta(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:()=>{var e;null===(e=t.onComplete)||void 0===e||e.call(t),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){var t;this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0),null===(t=this.getStack())||void 0===t||t.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){var t;this.currentAnimation&&(null===(t=this.mixTargetDelta)||void 0===t||t.call(this,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&&ns(this.options.animationType,this.layout.layoutBox,i.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Nt(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const i=Nt(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+i}Vi(e,n),fe(e,s),Gt(this.projectionDeltaWithTransform,this.layoutCorrected,e,s)}}registerSharedNode(t,e){var n,i,s;this.sharedNodes.has(t)||this.sharedNodes.set(t,new Bi);this.sharedNodes.get(t).add(e),e.promote({transition:null===(n=e.options.initialPromotionConfig)||void 0===n?void 0:n.transition,preserveFollowOpacity:null===(s=null===(i=e.options.initialPromotionConfig)||void 0===i?void 0:i.shouldPreserveFollowOpacity)||void 0===s?void 0:s.call(i,e)})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.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)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const i={};for(let e=0;e<ji.length;e++){const s="rotate"+ji[e];n[s]&&(i[s]=n[s],t.setStaticValue(s,0))}null==t||t.render();for(const e in i)t.setStaticValue(e,i[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n;const i={};if(!this.instance||this.isSVG)return i;if(!this.isVisible)return{visibility:"hidden"};i.visibility="";const s=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,i.opacity="",i.pointerEvents=C(t.pointerEvents)||"",i.transform=s?s(this.latestValues,""):"none",i;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=C(t.pointerEvents)||""),this.hasProjected&&!ie(this.latestValues)&&(e.transform=s?s({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),i.transform=ki(this.projectionDeltaWithTransform,this.treeScale,r),s&&(i.transform=s(r,i.transform));const{x:a,y:l}=this.projectionDelta;i.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?i.opacity=o===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:i.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in M){if(void 0===r[t])continue;const{correct:e,applyTo:n}=M[t],s="none"===i.transform?r[t]:e(r[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)i[n[e]]=s}else i[t]=s}return this.options.layoutId&&(i.pointerEvents=o===this?C(t.pointerEvents)||"":"none"),i}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(Gi),this.root.sharedNodes.clear()}}}function Oi(t){t.updateLayout()}function Ni(t){var e,n,i;const s=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&s&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:n}=t.layout,{animationType:i}=t.options,o=s.source!==t.layout.source;"size"===i?Qt(t=>{const n=o?s.measuredBox[t]:s.layoutBox[t],i=Nt(n);n.min=e[t].min,n.max=n.min+i}):ns(i,s.layoutBox,e)&&Qt(t=>{const n=o?s.measuredBox[t]:s.layoutBox[t],i=Nt(e[t]);n.max=n.min+i});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};Gt(r,e,s.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?Gt(a,t.applyTransform(n,!0),s.measuredBox):Gt(a,e,s.layoutBox);const l=!Mi(r);let u=!1;if(!t.resumeFrom){const n=t.getClosestProjectingParent();if(n&&!n.resumeFrom){const{snapshot:i,layout:o}=n;if(i&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};qt(r,s.layoutBox,i.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};qt(a,e,o.layoutBox),Di(r,a)||(u=!0),n.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=n)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:s,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else t.isLead()&&(null===(i=(n=t.options).onExitComplete)||void 0===i||i.call(n));t.options.transition=void 0}function zi(t){t.isProjectionDirty||(t.isProjectionDirty=Boolean(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=Boolean(t.parent&&t.parent.isTransformDirty))}function $i(t){t.clearSnapshot()}function Gi(t){t.clearMeasurements()}function Hi(t){const{visualElement:e}=t.options;(null==e?void 0:e.getProps().onBeforeLayoutMeasure)&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Wi(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function qi(t){t.resolveTargetDelta()}function Yi(t){t.calcProjection()}function Xi(t){t.resetRotation()}function Ki(t){t.removeLeadSnapshot()}function Zi(t,e,n){t.translate=Ot(e.translate,0,n),t.scale=Ot(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function _i(t,e,n,i){t.min=Ot(e.min,n.min,i),t.max=Ot(e.max,n.max,i)}function Ji(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Qi={duration:.45,ease:[.4,0,.1,1]};function ts(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const i=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);i&&t.mount(i,!0)}function es(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function ns(t,e,n){return"position"===t||"preserve-aspect"===t&&!zt(Ri(e),Ri(n),.2)}const is=Ui({attachResizeListener:(t,e)=>xt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),ss={current:void 0},os=Ui({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!ss.current){const t=new is(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),ss.current=t}return ss.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),rs=t=>/^0[^.\s]+$/.test(t),as=t=>e=>e.test(t),ls=[m,V,f,D,R,B,{test:t=>"auto"===t,parse:t=>t}],us=t=>ls.find(as(t)),cs=[...ls,Me,Oe],hs=t=>cs.find(as(t));function ds(t,e,n){const i=t.getProps();return k(i,e,void 0!==n?n:i.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function ps(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,di(n))}function ms(t,e){if(!e)return;return(e[t]||e.default||e).from}const fs=new Set(["width","height","top","left","right","bottom","x","y"]),vs=t=>fs.has(t),gs=t=>t===m||t===V;var ys;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(ys||(ys={}));const xs=(t,e)=>parseFloat(t.split(", ")[e]),Ts=(t,e)=>(n,{transform:i})=>{if("none"===i||!i)return 0;const s=i.match(/^matrix3d\((.+)\)$/);if(s)return xs(s[1],e);{const e=i.match(/^matrix\((.+)\)$/);return e?xs(e[1],t):0}},Ps=new Set(["x","y","z"]),Vs=F.filter(t=>!Ps.has(t));const bs={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:Ts(4,13),y:Ts(5,14)},Es=(t,e,n={},i={})=>{e={...e},i={...i};const s=Object.keys(e).filter(vs);let o=[],r=!1;const a=[];if(s.forEach(s=>{const l=t.getValue(s);if(!t.hasValue(s))return;let u=n[s],c=us(u);const h=e[s];let d;if(j(h)){const t=h.length,e=null===h[0]?1:0;u=h[e],c=us(u);for(let n=e;n<t;n++)d?us(h[n]):d=us(h[n])}else d=us(h);if(c!==d)if(gs(c)&&gs(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof h?e[s]=parseFloat(h):Array.isArray(h)&&d===V&&(e[s]=h.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==d?void 0:d.transform)&&(0===u||0===h)?0===u?l.set(d.transform(u)):e[s]=c.transform(h):(r||(o=function(t){const e=[];return Vs.forEach(n=>{const i=t.getValue(n);void 0!==i&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),r=!0),a.push(s),i[s]=void 0!==i[s]?i[s]:e[s],l.jump(h))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,s=((t,e,n)=>{const i=e.measureViewportBox(),s=e.current,o=getComputedStyle(s),{display:r}=o,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=bs[t](i,o)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const i=e.getValue(n);i&&i.jump(a[n]),t[n]=bs[n](l,o)}),t})(e,t,a);return o.length&&o.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),I&&null!==n&&window.scrollTo({top:n}),{target:s,transitionEnd:i}}return{target:e,transitionEnd:i}};function As(t,e,n,i){return(t=>Object.keys(t).some(vs))(e)?Es(t,e,n,i):{target:e,transitionEnd:i}}const Ss=(t,e,n,i)=>{const s=function(t,{...e},n){const i=t.current;if(!(i instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!ei(e))return;const n=ii(e,i);n&&t.set(n)});for(const t in e){const s=e[t];if(!ei(s))continue;const o=ii(s,i);o&&(e[t]=o,n&&void 0===n[t]&&(n[t]=s))}return{target:e,transitionEnd:n}}(t,e,i);return As(t,e=s.target,n,i=s.transitionEnd)},ws={current:null},Cs={current:!1};function Ms(t){return Boolean(w(t)&&t.add)}function Ds(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 Rs="data-"+U("framerAppearId");function Bs(t,e,n={}){var i;const s=ds(t,e,n.custom);let{transition:o=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const r=s?()=>ks(t,s,n):()=>Promise.resolve(),a=(null===(i=t.variantChildren)||void 0===i?void 0:i.size)?(i=0)=>{const{delayChildren:s=0,staggerChildren:r,staggerDirection:a}=o;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(Ls).forEach((t,i)=>{t.notify("AnimationStart",e),r.push(Bs(t,e,{...o,delay:n+l(i)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,s+i,r,a,n)}:()=>Promise.resolve(),{when:l}=o;if(l){const[t,e]="beforeChildren"===l?[r,a]:[a,r];return t().then(e)}return Promise.all([r(),a(n.delay)])}function ks(t,e,{delay:n=0,transitionOverride:i,type:s}={}){var o;let{transition:r=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const u=t.getValue("willChange");i&&(r=i);const c=[],h=s&&(null===(o=t.animationState)||void 0===o?void 0:o.getState()[s]);for(const e in l){const i=t.getValue(e),s=l[e];if(!i||void 0===s||h&&Fs(h,e))continue;const o={delay:n,elapsed:0,...r};if(window.HandoffAppearAnimations&&!i.hasAnimated){const n=t.getProps()[Rs];n&&(o.elapsed=window.HandoffAppearAnimations(n,e,i,dt))}let a=i.start(Wn(e,i,s,t.shouldReduceMotion&&O.has(e)?{type:!1}:o));Ms(u)&&(u.add(e),a=a.then(()=>u.remove(e))),c.push(a)}return Promise.all(c).then(()=>{a&&function(t,e){const n=ds(t,e);let{transitionEnd:i={},transition:s={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...i};for(const e in o){ps(t,e,L(o[e]))}}(t,a)})}function Ls(t,e){return t.sortNodePosition(e)}function Fs({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,i}const js=[Jt.Animate,Jt.InView,Jt.Focus,Jt.Hover,Jt.Tap,Jt.Drag,Jt.Exit],Is=[...js].reverse(),Us=js.length;function Os(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=>Bs(t,e,n));i=Promise.all(s)}else if("string"==typeof e)i=Bs(t,e,n);else{const s="function"==typeof e?ds(t,e,n.custom):e;i=ks(t,s,n)}return i.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function Ns(t){let e=Os(t);const n={[Jt.Animate]:$s(!0),[Jt.InView]:$s(),[Jt.Hover]:$s(),[Jt.Tap]:$s(),[Jt.Drag]:$s(),[Jt.Focus]:$s(),[Jt.Exit]:$s()};let i=!0;const s=(e,n)=>{const i=ds(t,n);if(i){const{transition:t,transitionEnd:n,...s}=i;e={...e,...s,...n}}return e};function o(o,r){const a=t.getProps(),l=t.getVariantContext(!0)||{},u=[],c=new Set;let h={},d=1/0;for(let e=0;e<Us;e++){const p=Is[e],m=n[p],f=void 0!==a[p]?a[p]:l[p],v=z(f),g=p===r?m.isActive:null;!1===g&&(d=e);let y=f===l[p]&&f!==a[p]&&v;if(y&&i&&t.manuallyAnimateOnMount&&(y=!1),m.protectedKeys={...h},!m.isActive&&null===g||!f&&!m.prevProp||N(f)||"boolean"==typeof f)continue;const x=zs(m.prevProp,f);let T=x||p===r&&m.isActive&&!y&&v||e>d&&v;const P=Array.isArray(f)?f:[f];let V=P.reduce(s,{});!1===g&&(V={});const{prevResolvedValues:b={}}=m,E={...b,...V},A=t=>{T=!0,c.delete(t),m.needsAnimating[t]=!0};for(const t in E){const e=V[t],n=b[t];h.hasOwnProperty(t)||(e!==n?j(e)&&j(n)?!Ds(e,n)||x?A(t):m.protectedKeys[t]=!0:void 0!==e?A(t):c.add(t):void 0!==e&&c.has(t)?A(t):m.protectedKeys[t]=!0)}m.prevProp=f,m.prevResolvedValues=V,m.isActive&&(h={...h,...V}),i&&t.blockInitialAnimation&&(T=!1),T&&!y&&u.push(...P.map(t=>({animation:t,options:{type:p,...o}})))}if(c.size){const e={};c.forEach(n=>{const i=t.getBaseTarget(n);void 0!==i&&(e[n]=i)}),u.push({animation:e})}let p=Boolean(u.length);return i&&!1===a.initial&&!t.manuallyAnimateOnMount&&(p=!1),i=!1,p?e(u):Promise.resolve()}return{animateChanges:o,setActive:function(e,i,s){var r;if(n[e].isActive===i)return Promise.resolve();null===(r=t.variantChildren)||void 0===r||r.forEach(t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,i)}),n[e].isActive=i;const a=o(s,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function zs(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!Ds(e,t)}function $s(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Gs=Object.keys(H),Hs=Gs.length,Ws=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const qs=["initial",...js],Ys=qs.length;class Xs extends class{constructor({parent:t,props:e,reducedMotionConfig:n,visualState:i},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.isPresent=!0,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.scheduleRender=()=>dt.render(this.render,!1,!0);const{latestValues:o,renderState:r}=i;this.latestValues=o,this.baseTarget={...o},this.initialValues=e.initial?{...o}:{},this.renderState=r,this.parent=t,this.props=e,this.depth=t?t.depth+1:0,this.reducedMotionConfig=n,this.options=s,this.isControllingVariants=$(e),this.isVariantNode=G(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:a,...l}=this.scrapeMotionValuesFromProps(e,{});for(const t in l){const e=l[t];void 0!==o[t]&&w(e)&&(e.set(o[t],!1),Ms(a)&&a.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){var e;this.current=t,this.projection&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=null===(e=this.parent)||void 0===e?void 0:e.addVariantChild(this)),this.values.forEach((t,e)=>this.bindToMotionValue(e,t)),Cs.current||function(){if(Cs.current=!0,I)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>ws.current=t.matches;t.addListener(e),e()}else ws.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||ws.current),this.parent&&this.parent.children.add(this),this.setProps(this.props)}unmount(){var t,e,n;null===(t=this.projection)||void 0===t||t.unmount(),pt.update(this.notifyUpdate),pt.render(this.render),this.valueSubscriptions.forEach(t=>t()),null===(e=this.removeFromVariantTree)||void 0===e||e.call(this),null===(n=this.parent)||void 0===n||n.children.delete(this);for(const t in this.events)this.events[t].clear();this.current=null}bindToMotionValue(t,e){const n=O.has(t),i=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&dt.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),s=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{i(),s()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,i,s,r,a){const l=[];for(let t=0;t<Hs;t++){const n=Gs[t],{isEnabled:i,Component:s}=H[n];i(e)&&s&&l.push(o(s,{key:n,...e,visualElement:this}))}if(!this.projection&&r){this.projection=new r(s,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:i,dragConstraints:o,layoutScroll:l,layoutRoot:u}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(i)||o&&y(o),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:a,layoutScroll:l,layoutRoot:u})}return l}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,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}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}setProps(t){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender();const e=this.props;this.props=t;for(let e=0;e<Ws.length;e++){const n=Ws[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){const{willChange:i}=e;for(const s in e){const o=e[s],r=n[s];if(w(o))t.addValue(s,o),Ms(i)&&i.add(s);else if(w(r))t.addValue(s,di(o,{owner:t})),Ms(i)&&i.remove(s);else if(r!==o)if(t.hasValue(s)){const e=t.getValue(s);!e.hasAnimated&&e.set(o)}else{const e=t.getStaticValue(s);t.addValue(s,di(void 0!==e?e:o,{owner:t}))}}for(const i in n)void 0===e[i]&&t.removeValue(i);return e}(this,this.scrapeMotionValuesFromProps(t,e),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){var e;return null===(e=this.props.variants)||void 0===e?void 0:e[t]}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){var t;return this.isVariantNode?this:null===(t=this.parent)||void 0===t?void 0:t.getClosestVariantNode()}getVariantContext(t=!1){var e,n;if(t)return null===(e=this.parent)||void 0===e?void 0:e.getVariantContext();if(!this.isControllingVariants){const t=(null===(n=this.parent)||void 0===n?void 0:n.getVariantContext())||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const i={};for(let t=0;t<Ys;t++){const e=qs[t],n=this.props[e];(z(n)||!1===n)&&(i[e]=n)}return i}addVariantChild(t){var e;const n=this.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),()=>n.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){var e;this.values.delete(t),null===(e=this.valueSubscriptions.get(t))||void 0===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=di(e,{owner:this}),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,i="string"==typeof n||"object"==typeof n?null===(e=k(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==i)return i;const s=this.getBaseTargetFromProps(this.props,t);return void 0===s||w(s)?void 0!==this.initialValues[t]&&void 0===i?void 0:this.baseTarget[t]:s}on(t,e){return this.events[t]||(this.events[t]=new ci),this.events[t].add(e)}notify(t,...e){var n;null===(n=this.events[t])||void 0===n||n.notify(...e)}}{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:i},s){let o=function(t,e,n){var i;const s={};for(const o in t){const t=ms(o,e);s[o]=void 0!==t?t:null===(i=n.getValue(o))||void 0===i?void 0:i.get()}return s}(n,t||{},this);if(i&&(e&&(e=i(e)),n&&(n=i(n)),o&&(o=i(o))),s){!function(t,e,n){var i,s;const o=Object.keys(e).filter(e=>!t.hasValue(e)),r=o.length;if(r)for(let a=0;a<r;a++){const r=o[a],l=e[r];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(s=null!==(i=n[r])&&void 0!==i?i:t.readValue(r))&&void 0!==s?s:e[r]),null!=u&&("string"==typeof u&&(/^\-?\d*\.?\d+$/.test(u)||rs(u))?u=parseFloat(u):!hs(u)&&Oe.test(l)&&(u=zn(r,l)),t.addValue(r,di(u,{owner:t})),void 0===n[r]&&(n[r]=u),null!==u&&t.setBaseTarget(r,u))}}(this,n,o);const t=Ss(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class Ks extends Xs{readValueFromInstance(t,e){if(O.has(e)){const t=Nn(e);return t&&t.default||0}{const i=(n=t,window.getComputedStyle(n)),s=(W(e)?i.getPropertyValue(e):i[e])||0;return"string"==typeof s?s.trim():s}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return ve(t,e)}build(t,e,n,i){q(t,e,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,e){return Y(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;w(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,i){X(t,e,n,i)}}const Zs={animation:Zn(({visualElement:t,animate:n})=>{t.animationState||(t.animationState=Ns(t)),N(n)&&e(()=>n.subscribe(t),[n])}),exit:Zn(t=>{const{custom:n,visualElement:s}=t,[o,r]=Jn(),a=i(P);e(()=>{s.isPresent=o;const t=s.animationState&&s.animationState.setActive(Jt.Exit,!o,{custom:a&&a.custom||n});t&&!o&&t.then(r)},[o])})};function _s(t,e,n,i){return(s,o)=>{"touch"===s.type||It()||(n&&t.animationState&&t.animationState.setActive(Jt.Hover,e),i&&i(s,o))}}const Js=(t,e)=>!!e&&(t===e||Js(t,e.parentElement));function Qs(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,nt(n))}const to=new WeakMap,eo=new WeakMap,no=t=>{const e=to.get(t.target);e&&e(t)},io=t=>{t.forEach(no)};function so(t,e,n){const i=function({root:t,...e}){const n=t||document;eo.has(n)||eo.set(n,{});const i=eo.get(n),s=JSON.stringify(e);return i[s]||(i[s]=new IntersectionObserver(io,{root:t,...e})),i[s]}(e);return to.set(t,n),i.observe(t),()=>{to.delete(t),i.unobserve(t)}}const oo={some:0,all:1};function ro(t,n,i,{root:s,margin:o,amount:r="some",once:a}){e(()=>{if(!t||!i.current)return;const e={root:null==s?void 0:s.current,rootMargin:o,threshold:"number"==typeof r?r:oo[r]};return so(i.current,e,t=>{const{isIntersecting:e}=t;if(n.isInView===e)return;if(n.isInView=e,a&&!e&&n.hasEnteredView)return;e&&(n.hasEnteredView=!0),i.animationState&&i.animationState.setActive(Jt.InView,e);const s=i.getProps(),o=e?s.onViewportEnter:s.onViewportLeave;o&&o(t)})},[t,s,o,r])}function ao(t,n,i,{fallback:s=!0}){e(()=>{t&&s&&requestAnimationFrame(()=>{n.hasEnteredView=!0;const{onViewportEnter:t}=i.getProps();t&&t(null),i.animationState&&i.animationState.setActive(Jt.InView,!0)})},[t])}const lo={inView:Zn((function({visualElement:t,whileInView:e,onViewportEnter:i,onViewportLeave:s,viewport:o={}}){const r=n({hasEnteredView:!1,isInView:!1});let a=Boolean(e||i||s);o.once&&r.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?ao:ro)(a,r.current,t,o)})),tap:Zn((function({onTap:t,onTapStart:e,onTapCancel:i,whileTap:s,visualElement:o,...a}){const l=t||e||i||s,u=n(!1),c=n(null),h={passive:!(e||t||i||a.onPointerDown)};function d(){c.current&&c.current(),c.current=null}function p(){d(),u.current=!1;return o.getProps().whileTap&&o.animationState&&o.animationState.setActive(Jt.Tap,!1),!It()}function m(t,e){var n,i,s,r;p()&&(Js(o.current,t.target)?null===(r=(s=o.getProps()).onTap)||void 0===r||r.call(s,t,e):null===(i=(n=o.getProps()).onTapCancel)||void 0===i||i.call(n,t,e))}function f(t,e){var n,i;p()&&(null===(i=(n=o.getProps()).onTapCancel)||void 0===i||i.call(n,t,e))}function v(t,e){var n;const i=o.getProps();i.whileTap&&o.animationState&&o.animationState.setActive(Jt.Tap,!0),null===(n=i.onTapStart)||void 0===n||n.call(i,t,e)}const g=[Boolean(e),Boolean(t),Boolean(s),o],y=r((t,e)=>{d(),u.current||(u.current=!0,c.current=Et(Pt(window,"pointerup",m,h),Pt(window,"pointercancel",f,h)),v(t,e))},g);Vt(o,"pointerdown",l?y:void 0,h);const x=r(()=>{const t=xt(o.current,"keydown",t=>{"Enter"!==t.key||u.current||(u.current=!0,c.current=xt(o.current,"keyup",()=>{"Enter"===t.key&&p()&&Qs("up",o.getProps().onTap)},h),Qs("down",v))}),e=xt(o.current,"blur",()=>{t(),e(),u.current&&Qs("cancel",f)})},g);Tt(o,"focus",l?x:void 0),Kn(d)})),focus:Zn((function({whileFocus:t,visualElement:e}){const i=n(!1),{animationState:s}=e,o=r(()=>{let t=!1;try{t=e.current.matches(":focus-visible")}catch(e){t=!0}t&&s&&(s.setActive(Jt.Focus,!0),i.current=!0)},[s]),a=r(()=>{i.current&&s&&(s.setActive(Jt.Focus,!1),i.current=!1)},[s]);Tt(e,"focus",t?o:void 0),Tt(e,"blur",t?a:void 0)})),hover:Zn((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:i}){Vt(i,"pointerenter",a(()=>t||n?_s(i,!0,Boolean(n),t):void 0,[t,Boolean(n),i]),{passive:!t}),Vt(i,"pointerleave",a(()=>e||n?_s(i,!1,Boolean(n),e):void 0,[t,Boolean(n),i]),{passive:!e})}))};class uo extends Xs{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){var n;return O.has(e)?(null===(n=Nn(e))||void 0===n?void 0:n.default)||0:(e=K.has(e)?e:U(e),t.getAttribute(e))}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return Z(t,e)}build(t,e,n,i){_(t,e,n,this.isSVGTag,i.transformTemplate)}renderInstance(t,e,n,i){J(t,e,n,i)}mount(t){this.isSVGTag=Q(t.tagName),super.mount(t)}}const co={...{renderer:(t,e)=>tt(t)?new uo(e,{enableHardwareAcceleration:!1}):new Ks(e,{enableHardwareAcceleration:!0}),...Zs,...lo},..._n,...ai,projectionNodeConstructor:os};export{co as domMax};
1
+ import{t,u as e,v as n,w as s,x as i,y as o,z as r,A as a,B as l,C as h,a as u,d as c,D as p,g as d,r as m,E as f,F as g,G as y,H as v,o as x,I as P,J as T,K as b,i as V,M as A,N as E,n as S,c as w,b as C,m as M,f as D,O as L,h as k,q as R,Q as B,P as F,R as j,L as I,S as U,T as O,s as N,j as z,p as $,k as G,l as H}from"./size-rollup-dom-max-assets.js";import W,{useContext as q,useId as Y,useEffect as X}from"react";class K{constructor(t){this.isMounted=!1,this.node=t}update(){}}const Z=t=>t;const _=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function J(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const Q="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),tt="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout(()=>t(Q()),1/60*1e3);const et={delta:0,timestamp:0};let nt=!0,st=!1,it=!1;const ot=["read","update","preRender","render","postRender"],rt=ot.reduce((t,e)=>(t[e]=function(t){let e=[],n=[],s=0,i=!1,o=!1;const r=new WeakSet,a={schedule:(t,o=!1,a=!1)=>{const l=a&&i,h=l?e:n;return o&&r.add(t),-1===h.indexOf(t)&&(h.push(t),l&&i&&(s=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:l=>{if(i)o=!0;else{if(i=!0,[e,n]=[n,e],n.length=0,s=e.length,s)for(let n=0;n<s;n++){const s=e[n];s(l),r.has(s)&&(a.schedule(s),t())}i=!1,o&&(o=!1,a.process(l))}}};return a}(()=>st=!0),t),{}),at=ot.reduce((t,e)=>{const n=rt[e];return t[e]=(t,e=!1,s=!1)=>(st||pt(),n.schedule(t,e,s)),t},{}),lt=ot.reduce((t,e)=>(t[e]=rt[e].cancel,t),{}),ht=ot.reduce((t,e)=>(t[e]=()=>rt[e].process(et),t),{}),ut=t=>rt[t].process(et),ct=t=>{st=!1,et.delta=nt?1/60*1e3:Math.max(Math.min(t-et.timestamp,40),1),et.timestamp=t,it=!0,ot.forEach(ut),it=!1,st&&(nt=!1,tt(ct))},pt=()=>{st=!0,nt=!0,it||tt(ct)},dt=t=>1e3*t;function mt(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function ft(t,e,n,s){return mt(t,e,(t=>e=>_(e)&&t(e,J(e)))(n),s)}const gt=(t,e)=>n=>e(t(n)),yt=(...t)=>t.reduce(gt),vt=(t,e)=>Math.abs(t-e);class xt{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=bt(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=vt(t.x,e.x),s=vt(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}=et;this.history.push({...s,timestamp:i});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=Pt(e,this.transformPagePoint),at.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{if(this.end(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const{onEnd:n,onSessionEnd:s}=this.handlers,i=bt("pointercancel"===t.type?this.lastMoveEventInfo:Pt(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),s&&s(t,i)},!_(t))return;this.handlers=e,this.transformPagePoint=n;const s=Pt(J(t),this.transformPagePoint),{point:i}=s,{timestamp:o}=et;this.history=[{...i,timestamp:o}];const{onSessionStart:r}=e;r&&r(t,bt(s,this.history)),this.removeListeners=yt(ft(window,"pointermove",this.handlePointerMove),ft(window,"pointerup",this.handlePointerUp),ft(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),lt.update(this.updatePoint)}}function Pt(t,e){return e?{point:e(t.point)}:t}function Tt(t,e){return{x:t.x-e.x,y:t.y-e.y}}function bt({point:t},e){return{point:t,delta:Tt(t,At(e)),offset:Tt(t,Vt(e)),velocity:Et(e,.1)}}function Vt(t){return t[0]}function At(t){return t[t.length-1]}function Et(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const i=At(t);for(;n>=0&&(s=t[n],!(i.timestamp-s.timestamp>dt(e)));)n--;if(!s)return{x:0,y:0};const o=(i.timestamp-s.timestamp)/1e3;if(0===o)return{x:0,y:0};const r={x:(i.x-s.x)/o,y:(i.y-s.y)/o};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function St(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const wt=St("dragHorizontal"),Ct=St("dragVertical");function Mt(t){let e=!1;if("y"===t)e=Ct();else if("x"===t)e=wt();else{const t=wt(),n=Ct();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Dt(){const t=Mt(!0);return!t||(t(),!1)}const Lt=(t,e,n)=>{const s=e-t;return 0===s?1:(n-t)/s},kt=(t,e,n)=>-n*t+n*e+t;function Rt(t){return t.max-t.min}function Bt(t,e=0,n=.01){return Math.abs(t-e)<=n}function Ft(t,e,n,s=.5){t.origin=s,t.originPoint=kt(e.min,e.max,t.origin),t.scale=Rt(n)/Rt(e),(Bt(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=kt(n.min,n.max,t.origin)-t.originPoint,(Bt(t.translate)||isNaN(t.translate))&&(t.translate=0)}function jt(t,e,n,s){Ft(t.x,e.x,n.x,s?s.originX:void 0),Ft(t.y,e.y,n.y,s?s.originY:void 0)}function It(t,e,n){t.min=n.min+e.min,t.max=t.min+Rt(e)}function Ut(t,e,n){t.min=e.min-n.min,t.max=t.min+Rt(e)}function Ot(t,e,n){Ut(t.x,e.x,n.x),Ut(t.y,e.y,n.y)}function Nt(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 zt(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 $t=.35;function Gt(t,e,n){return{min:Ht(t,e),max:Ht(t,n)}}function Ht(t,e){return"number"==typeof t?t:t[e]||0}var Wt;!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(Wt||(Wt={}));function qt(t){return[t("x"),t("y")]}function Yt({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function Xt(t){return void 0===t||1===t}function Kt({scale:t,scaleX:e,scaleY:n}){return!Xt(t)||!Xt(e)||!Xt(n)}function Zt(t){return Kt(t)||_t(t)||t.z||t.rotate||t.rotateX||t.rotateY}function _t(t){return Jt(t.x)||Jt(t.y)}function Jt(t){return t&&"0%"!==t}function Qt(t,e,n){return n+e*(t-n)}function te(t,e,n,s,i){return void 0!==i&&(t=Qt(t,i,s)),Qt(t,n,s)+e}function ee(t,e=0,n=1,s,i){t.min=te(t.min,e,n,s,i),t.max=te(t.max,e,n,s,i)}function ne(t,{x:e,y:n}){ee(t.x,e.translate,e.scale,e.originPoint),ee(t.y,n.translate,n.scale,n.originPoint)}function se(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function ie(t,e){t.min=t.min+e,t.max=t.max+e}function oe(t,e,[n,s,i]){const o=void 0!==e[i]?e[i]:.5,r=kt(t.min,t.max,o);ee(t,e[n],e[s],r,e.scale)}const re=["x","scaleX","originX"],ae=["y","scaleY","originY"];function le(t,e){oe(t.x,e,re),oe(t.y,e,ae)}function he(t,e){return Yt(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 ue=!1,ce=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,pe=t=>e=>1-t(1-e),de=t=>t*t,me=pe(de),fe=ce(de),ge=(t,s)=>i=>Boolean(e(i)&&n.test(i)&&i.startsWith(t)||s&&Object.prototype.hasOwnProperty.call(i,s)),ye=(t,n,i)=>o=>{if(!e(o))return o;const[r,a,l,h]=o.match(s);return{[t]:parseFloat(r),[n]:parseFloat(a),[i]:parseFloat(l),alpha:void 0!==h?parseFloat(h):1}},ve={...r,transform:e=>Math.round((e=>t(0,255,e))(e))},xe={test:ge("rgb","red"),parse:ye("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+ve.transform(t)+", "+ve.transform(e)+", "+ve.transform(n)+", "+i(o.transform(s))+")"};const Pe={test:ge("#"),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:xe.transform},Te={test:ge("hsl","hue"),parse:ye("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+a.transform(i(e))+", "+a.transform(i(n))+", "+i(o.transform(s))+")"},be={test:t=>xe.test(t)||Pe.test(t)||Te.test(t),parse:t=>xe.test(t)?xe.parse(t):Te.test(t)?Te.parse(t):Pe.parse(t),transform:t=>e(t)?t:t.hasOwnProperty("red")?xe.transform(t):Te.transform(t)};function Ve(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}const Ae=(t,e,n)=>{const s=t*t;return Math.sqrt(Math.max(0,n*(e*e-s)+s))},Ee=[Pe,xe,Te];function Se(t){const e=(n=t,Ee.find(t=>t.test(n)));var n;let s=e.parse(t);return e===Te&&(s=function({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,n/=100;let i=0,o=0,r=0;if(e/=100){const s=n<.5?n*(1+e):n+e-n*e,a=2*n-s;i=Ve(a,s,t+1/3),o=Ve(a,s,t),r=Ve(a,s,t-1/3)}else i=o=r=n;return{red:Math.round(255*i),green:Math.round(255*o),blue:Math.round(255*r),alpha:s}}(s)),s}const we=(t,e)=>{const n=Se(t),s=Se(e),i={...n};return t=>(i.red=Ae(n.red,s.red,t),i.green=Ae(n.green,s.green,t),i.blue=Ae(n.blue,s.blue,t),i.alpha=kt(n.alpha,s.alpha,t),xe.transform(i))};function Ce(t){"number"==typeof t&&(t=""+t);const e=[];let n=0,i=0;const o=t.match(l);o&&(n=o.length,t=t.replace(l,"${c}"),e.push(...o.map(be.parse)));const a=t.match(s);return a&&(i=a.length,t=t.replace(s,"${n}"),e.push(...a.map(r.parse))),{values:e,numColors:n,numNumbers:i,tokenised:t}}function Me(t){return Ce(t).values}function De(t){const{values:e,numColors:n,tokenised:s}=Ce(t),o=e.length;return t=>{let e=s;for(let s=0;s<o;s++)e=e.replace(s<n?"${c}":"${n}",s<n?be.transform(t[s]):i(t[s]));return e}}const Le=t=>"number"==typeof t?0:t;const ke={test:function(t){var n,i;return isNaN(t)&&e(t)&&((null===(n=t.match(s))||void 0===n?void 0:n.length)||0)+((null===(i=t.match(l))||void 0===i?void 0:i.length)||0)>0},parse:Me,createTransformer:De,getAnimatableNone:function(t){const e=Me(t);return De(t)(e.map(Le))}};function Re(t,e){return"number"==typeof t?n=>kt(t,e,n):be.test(t)?we(t,e):je(t,e)}const Be=(t,e)=>{const n=[...t],s=n.length,i=t.map((t,n)=>Re(t,e[n]));return t=>{for(let e=0;e<s;e++)n[e]=i[e](t);return n}},Fe=(t,e)=>{const n={...t,...e},s={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(s[i]=Re(t[i],e[i]));return t=>{for(const e in s)n[e]=s[e](t);return n}},je=(t,e)=>{const n=ke.createTransformer(e),s=Ce(t),i=Ce(e);return s.numColors===i.numColors&&s.numNumbers>=i.numNumbers?yt(Be(s.values,i.values),n):n=>""+(n>0?e:t)},Ie=(t,e)=>n=>kt(t,e,n);function Ue(t,e,n){const s=[],i=n||("number"==typeof(o=t[0])?Ie:"string"==typeof o?be.test(o)?we:je:Array.isArray(o)?Be:"object"==typeof o?Fe:Ie);var o;const r=t.length-1;for(let n=0;n<r;n++){let o=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;o=yt(t,o)}s.push(o)}return s}function Oe(e,n,{clamp:s=!0,ease:i,mixer:o}={}){const r=e.length;n.length,!i||!Array.isArray(i)||i.length,e[0]>e[r-1]&&(e=[...e].reverse(),n=[...n].reverse());const a=Ue(n,i,o),l=a.length,h=t=>{let n=0;if(l>1)for(;n<e.length-2&&!(t<e[n+1]);n++);const s=Lt(e[n],e[n+1],t);return a[n](s)};return s?n=>h(t(e[0],e[r-1],n)):h}const Ne=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function ze(t,e,n,s){if(t===e&&n===s)return Z;const i=e=>function(t,e,n,s,i){let o,r,a=0;do{r=e+(n-e)/2,o=Ne(r,s,i)-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:Ne(i(t),e,s)}const $e=t=>1-Math.sin(Math.acos(t)),Ge=pe($e),He=ce(Ge),We=ze(.33,1.53,.69,.99),qe=pe(We),Ye=ce(qe),Xe={linear:Z,easeIn:de,easeInOut:fe,easeOut:me,circIn:$e,circInOut:He,circOut:Ge,backIn:qe,backInOut:Ye,backOut:We,anticipate:t=>(t*=2)<1?.5*qe(t):.5*(2-Math.pow(2,-10*(t-1)))},Ke=t=>{if(Array.isArray(t)){t.length;const[e,n,s,i]=t;return ze(e,n,s,i)}return"string"==typeof t?Xe[t]:t};function Ze({keyframes:t,ease:e=fe,times:n,duration:s=300}){t=[...t];const i=(t=>Array.isArray(t)&&"number"!=typeof t[0])(e)?e.map(Ke):Ke(e),o={done:!1,value:t[0]},r=function(t,e){return t.map(t=>t*e)}(n&&n.length===t.length?n:function(t){const e=t.length;return t.map((t,n)=>0!==n?n/(e-1):0)}(t),s);function a(){return Oe(r,t,{ease:Array.isArray(i)?i:(e=t,n=i,e.map(()=>n||fe).splice(0,e.length-1))});var e,n}let l=a();return{next:t=>(o.value=l(t),o.done=t>=s,o),flipTarget:()=>{t.reverse(),l=a()}}}function _e({duration:e=800,bounce:n=.25,velocity:s=0,mass:i=1}){let o,r,a=1-n;a=t(.05,1,a),e=t(.01,10,e/1e3),a<1?(o=t=>{const n=t*a,i=n*e;return.001-(n-s)/Je(t,a)*Math.exp(-i)},r=t=>{const n=t*a*e,i=n*s+s,r=Math.pow(a,2)*Math.pow(t,2)*e,l=Math.exp(-n),h=Je(Math.pow(t,2),a);return(.001-o(t)>0?-1:1)*((i-r)*l)/h}):(o=t=>Math.exp(-t*e)*((t-s)*e+1)-.001,r=t=>Math.exp(-t*e)*(e*e*(s-t)));const l=function(t,e,n){let s=n;for(let n=1;n<12;n++)s-=t(s)/e(s);return s}(o,r,5/e);if(e*=1e3,isNaN(l))return{stiffness:100,damping:10,duration:e};{const t=Math.pow(l,2)*i;return{stiffness:t,damping:2*a*Math.sqrt(i*t),duration:e}}}function Je(t,e){return t*Math.sqrt(1-e*e)}function Qe(t,e){return e?t*(1e3/e):0}const tn=["duration","bounce"],en=["stiffness","damping","mass"];function nn(t,e){return e.some(e=>void 0!==t[e])}function sn({keyframes:t,restDelta:e,restSpeed:n,...s}){let i=t[0],o=t[t.length-1];const r={done:!1,value:i},{stiffness:a,damping:l,mass:h,velocity:u,duration:c,isResolvedFromDuration:p}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!nn(t,en)&&nn(t,tn)){const n=_e(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(s);let d=on,m=u?-u/1e3:0;const f=l/(2*Math.sqrt(a*h));function g(){const t=o-i,s=Math.sqrt(a/h)/1e3,r=Math.abs(t)<5;if(n||(n=r?.01:2),e||(e=r?.005:.5),f<1){const e=Je(s,f);d=n=>{const i=Math.exp(-f*s*n);return o-i*((m+f*s*t)/e*Math.sin(e*n)+t*Math.cos(e*n))}}else if(1===f)d=e=>o-Math.exp(-s*e)*(t+(m+s*t)*e);else{const e=s*Math.sqrt(f*f-1);d=n=>{const i=Math.exp(-f*s*n),r=Math.min(e*n,300);return o-i*((m+f*s*t)*Math.sinh(r)+e*t*Math.cosh(r))/e}}}return g(),{next:t=>{const s=d(t);if(p)r.done=t>=c;else{let i=m;if(0!==t)if(f<1){const e=Math.max(0,t-5);i=Qe(s-d(e),t-e)}else i=0;const a=Math.abs(i)<=n,l=Math.abs(o-s)<=e;r.done=a&&l}return r.value=r.done?o:s,r},flipTarget:()=>{m=-m,[i,o]=[o,i],g()}}}sn.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const on=t=>0;const rn={decay:function({keyframes:t=[0],velocity:e=0,power:n=.8,timeConstant:s=350,restDelta:i=.5,modifyTarget:o}){const r=t[0],a={done:!1,value:r};let l=n*e;const h=r+l,u=void 0===o?h:o(h);return u!==h&&(l=u-r),{next:t=>{const e=-l*Math.exp(-t/s);return a.done=!(e>i||e<-i),a.value=a.done?u:u+e,a},flipTarget:()=>{}}},keyframes:Ze,tween:Ze,spring:sn};function an(t,e,n=0){return t-e-n}const ln=t=>{const e=({delta:e})=>t(e);return{start:()=>at.update(e,!0),stop:()=>lt.update(e)}};function hn({duration:t,driver:e=ln,elapsed:n=0,repeat:s=0,repeatType:i="loop",repeatDelay:o=0,keyframes:r,autoplay:a=!0,onPlay:l,onStop:h,onComplete:u,onRepeat:c,onUpdate:p,type:d="keyframes",...m}){const f=n;let g,y,v=0,x=t,P=!1,T=!0;const b=rn[r.length>2?"keyframes":d]||Ze,V=r[0],A=r[r.length-1];let E={done:!1,value:V};const{needsInterpolation:S}=b;S&&S(V,A)&&(y=Oe([0,100],[V,A],{clamp:!1}),r=[0,100]);const w=b({...m,duration:t,keyframes:r});function C(){v++,"reverse"===i?(T=v%2==0,n=function(t,e=0,n=0,s=!0){return s?an(e+-t,e,n):e-(t-e)+n}(n,x,o,T)):(n=an(n,x,o),"mirror"===i&&w.flipTarget()),P=!1,c&&c()}function M(t){T||(t=-t),n+=t,P||(E=w.next(Math.max(0,n)),y&&(E.value=y(E.value)),P=T?E.done:n<=0),p&&p(E.value),P&&(0===v&&(x=void 0!==x?x:n),v<s?function(t,e,n,s){return s?t>=e+n:t<=-n}(n,x,o,T)&&C():(g&&g.stop(),u&&u()))}return a&&(l&&l(),g=e(M),g.start()),{stop:()=>{h&&h(),g&&g.stop()},set currentTime(t){n=f,M(t)},sample:e=>{n=f;const s=t&&"number"==typeof t?Math.max(.5*t,50):50;let i=0;for(M(0);i<=e;){const t=e-i;M(Math.min(t,s)),i+=s}return E}}}const un=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,cn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:un([0,.65,.55,1]),circOut:un([.55,0,1,.45]),backIn:un([.31,.01,.66,-.59]),backOut:un([.33,1.53,.69,.99])};function pn(t){if(t)return Array.isArray(t)?un(t):cn[t]}const dn={waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate")},mn={},fn={};for(const t in dn)fn[t]=()=>(void 0===mn[t]&&(mn[t]=dn[t]()),mn[t]);const gn=new Set(["opacity"]);function yn(t,e,{onUpdate:n,onComplete:s,...i}){if(!(fn.waapi()&&gn.has(e)&&!i.repeatDelay&&"mirror"!==i.repeatType&&0!==i.damping))return!1;let{keyframes:o,duration:r=300,elapsed:a=0,ease:l}=i;if("spring"===i.type||!(!(h=i.ease)||Array.isArray(h)||"string"==typeof h&&cn[h])){if(i.repeat===1/0)return;const t=hn({...i,elapsed:0});let e={done:!1,value:o[0]};const n=[];let s=0;for(;!e.done&&s<2e4;)e=t.sample(s),n.push(e.value),s+=10;o=n,r=s-10,l="linear"}var h;const u=function(t,e,n,{delay:s=0,duration:i,repeat:o=0,repeatType:r="loop",ease:a,times:l}={}){return t.animate({[e]:n,offset:l},{delay:s,duration:i,easing:pn(a),fill:"both",iterations:o+1,direction:"reverse"===r?"alternate":"normal"})}(t.owner.current,e,o,{...i,delay:-a,duration:r,ease:l});return u.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(o,i)),at.update(()=>u.cancel()),s&&s()},{get currentTime(){return u.currentTime||0},set currentTime(t){u.currentTime=t},stop:()=>{const{currentTime:e}=u;if(e){const n=hn({...i,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}at.update(()=>u.cancel())}}}function vn(t,e){const n=performance.now(),s=({timestamp:i})=>{const o=i-n;o>=e&&(lt.read(s),t(o-e))};return at.read(s,!0),()=>lt.read(s)}function xn({keyframes:t,elapsed:e,onUpdate:n,onComplete:s}){const i=()=>{n&&n(t[t.length-1]),s&&s()};return e?{stop:vn(i,-e)}:i()}const Pn=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Tn=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),bn=()=>({type:"keyframes",ease:"linear",duration:.3}),Vn={type:"keyframes",duration:.8},An={x:Pn,y:Pn,z:Pn,rotate:Pn,rotateX:Pn,rotateY:Pn,rotateZ:Pn,scaleX:Tn,scaleY:Tn,scale:Tn,opacity:bn,backgroundColor:bn,color:bn,default:Tn},En=(t,{keyframes:e})=>{if(e.length>2)return Vn;return(An[t]||An.default)(e[1])},Sn=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!ke.test(e)||e.startsWith("url("))),wn=new Set(["brightness","contrast","saturate","opacity"]);function Cn(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=n.match(s)||[];if(!i)return t;const o=n.replace(i,"");let r=wn.has(e)?1:0;return i!==n&&(r*=100),e+"("+r+o+")"}const Mn=/([a-z-]*)\(.*?\)/g,Dn={...ke,getAnimatableNone:t=>{const e=t.match(Mn);return e?e.map(Cn).join(" "):t}},Ln={...h,color:be,backgroundColor:be,outlineColor:be,fill:be,stroke:be,borderColor:be,borderTopColor:be,borderRightColor:be,borderBottomColor:be,borderLeftColor:be,filter:Dn,WebkitFilter:Dn},kn=t=>Ln[t];function Rn(t,e){let n=kn(t);return n!==Dn&&(n=ke),n.getAnimatableNone?n.getAnimatableNone(e):void 0}function Bn(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Fn(t){return"number"==typeof t?0:Rn("",t)}function jn(t,e){return t[e]||t.default||t}const In=(t,e,n,s={})=>i=>{const o=jn(s,t)||{},r=o.delay||s.delay||0;let{elapsed:a=0}=s;a-=dt(r);const l=function(t,e,n,s){const i=Sn(e,n);let o=void 0!==s.from?s.from:t.get();return"none"===o&&i&&"string"==typeof n?o=Rn(e,n):Bn(o)&&"string"==typeof n?o=Fn(n):!Array.isArray(n)&&Bn(n)&&"string"==typeof o&&(n=Fn(o)),Array.isArray(n)?(null===n[0]&&(n[0]=o),n):[o,n]}(e,t,n,o),h=l[0],u=l[l.length-1],c=Sn(t,h),p=Sn(t,u);let d={keyframes:l,velocity:e.getVelocity(),...o,elapsed:a,onUpdate:t=>{e.set(t),o.onUpdate&&o.onUpdate(t)},onComplete:()=>{i(),o.onComplete&&o.onComplete()}};if(!c||!p||ue||!1===o.type)return xn(d);if("inertia"===o.type)return function({keyframes:t,velocity:e=0,min:n,max:s,power:i=.8,timeConstant:o=750,bounceStiffness:r=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:h,driver:u,onUpdate:c,onComplete:p,onStop:d}){const m=t[0];let f;function g(t){return void 0!==n&&t<n||void 0!==s&&t>s}function y(t){return void 0===n?s:void 0===s||Math.abs(n-t)<Math.abs(s-t)?n:s}function v(t){f&&f.stop(),f=hn({keyframes:[0,1],velocity:0,...t,driver:u,onUpdate:e=>{c&&c(e),t.onUpdate&&t.onUpdate(e)},onComplete:p,onStop:d})}function x(t){v({type:"spring",stiffness:r,damping:a,restDelta:l,...t})}if(g(m))x({velocity:e,keyframes:[m,y(m)]});else{let t=i*e+m;void 0!==h&&(t=h(t));const s=y(t),r=s===n?-1:1;let a,u;const c=t=>{a=u,u=t,e=Qe(t-a,et.delta),(1===r&&t>s||-1===r&&t<s)&&x({keyframes:[t,s],velocity:e})};v({type:"decay",keyframes:[m,0],velocity:e,timeConstant:o,power:i,restDelta:l,modifyTarget:h,onUpdate:g(t)?c:void 0})}return{stop:()=>f&&f.stop()}}(d);if(function({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:i,repeat:o,repeatType:r,repeatDelay:a,from:l,elapsed:h,...u}){return!!Object.keys(u).length}(o)||(d={...d,...En(t,d)}),d.duration&&(d.duration=dt(d.duration)),d.repeatDelay&&(d.repeatDelay=dt(d.repeatDelay)),e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=yn(e,t,d);if(n)return n}return hn(d)},Un=new WeakMap;class On{constructor(t){this.openGlobalLock=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;this.panSession=new xt(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(J(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:s,onDragStart:i}=this.getProps();if(n&&!s&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Mt(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),qt(t=>{let e=this.getAxisMotionValue(t).get()||0;if(a.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const s=n.layout.layoutBox[t];if(s){e=Rt(s)*(parseFloat(e)/100)}}}this.originPoint[t]=e}),i&&i(t,e);const{animationState:o}=this.visualElement;o&&o.setActive(Wt.Drag,!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:s,onDirectionLock:i,onDrag:o}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:r}=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}(r),void(null!==this.currentDirection&&i&&i(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)},{transformPagePoint:this.visualElement.getTransformPagePoint()})}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&&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.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive(Wt.Drag,!1)}updateAxis(t,e,n){const{drag:s}=this.getProps();if(!n||!Nn(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=function(t,{min:e,max:n},s){return void 0!==e&&t<e?t=s?kt(e,t,s.min):Math.max(t,e):void 0!==n&&t>n&&(t=s?kt(n,t,s.max):Math.min(t,n)),t}(o,this.constraints[t],this.elastic[t])),i.set(o)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},s=this.constraints;t&&u(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:s,right:i}){return{x:Nt(t.x,n,i),y:Nt(t.y,e,s)}}(n.layoutBox,t),this.elastic=function(t=$t){return!1===t?t=0:!0===t&&(t=$t),{x:Gt(t,"left","right"),y:Gt(t,"top","bottom")}}(e),s!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&qt(t=>{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||!u(t))return!1;const n=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=function(t,e,n){const s=he(t,n),{scroll:i}=e;return i&&(ie(s.x,i.offset.x),ie(s.y,i.offset.y)),s}(n,s.root,this.visualElement.getTransformPagePoint());let o=function(t,e){return{x:zt(t.x,e.x),y:zt(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}}(o));this.hasMutatedConstraints=!!t,t&&(o=Yt(t))}return o}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:r}=this.getProps(),a=this.constraints||{},l=qt(r=>{if(!Nn(r,e,this.currentDirection))return;let l=a&&a[r]||{};o&&(l={min:0,max:0});const h=s?200:1e6,u=s?40:1e7,c={type:"inertia",velocity:n?t[r]:0,bounceStiffness:h,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(r,c)});return Promise.all(l).then(r)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(In(t,n,0,e))}stopAnimation(){qt(t=>this.getAxisMotionValue(t).stop())}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){qt(e=>{const{drag:n}=this.getProps();if(!Nn(e,n,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(e);if(s&&s.layout){const{min:n,max:o}=s.layout.layoutBox[e];i.set(t[e]-kt(n,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!u(n)||!s||!this.constraints)return;this.stopAnimation();const i={x:0,y:0};qt(e=>{const n=this.getAxisMotionValue(e);if(n){const s=n.get();i[e]=function(e,n){let s=.5;const i=Rt(e),o=Rt(n);return o>i?s=Lt(n.min,n.max-i,e.min):i>o&&(s=Lt(e.min,e.max-o,n.min)),t(0,1,s)}({min:s,max:s},this.constraints[e])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),qt(t=>{if(!Nn(t,e,null))return;const n=this.getAxisMotionValue(t),{min:s,max:o}=this.constraints[t];n.set(kt(s,o,i[t]))})}addListeners(){if(!this.visualElement.current)return;Un.set(this.visualElement,this);const t=ft(this.visualElement.current,"pointerdown",t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)}),e=()=>{const{dragConstraints:t}=this.getProps();u(t)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,s=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),e();const i=mt(window,"resize",()=>this.scalePositionWithinConstraints()),o=n.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(qt(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(),o&&o()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=$t,dragMomentum:r=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:r}}}function Nn(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}function zn(t,e){-1===t.indexOf(e)&&t.push(e)}function $n(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Gn{constructor(){this.subscriptions=[]}add(t){return zn(this.subscriptions,t),()=>$n(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}}class Hn{constructor(t,e={}){var n;this.version="9.0.3",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:s}=et;this.lastUpdated!==s&&(this.timeDelta=n,this.lastUpdated=s,at.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>at.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new Gn);const n=this.events[t].add(e);return"change"===t?()=>{n(),at.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=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Qe(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e)||null,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(){this.animation=null}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Wn(t,e){return new Hn(t,e)}const qn=["TopLeft","TopRight","BottomLeft","BottomRight"],Yn=qn.length,Xn=t=>"string"==typeof t?parseFloat(t):t,Kn=t=>"number"==typeof t||p.test(t);function Zn(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const _n=Qn(0,.5,Ge),Jn=Qn(.5,.95,Z);function Qn(t,e,n){return s=>s<t?0:s>e?1:n(Lt(t,e,s))}function ts(t,e){t.min=e.min,t.max=e.max}function es(t,e){ts(t.x,e.x),ts(t.y,e.y)}function ns(t,e,n,s,i){return t=Qt(t-=e,1/n,s),void 0!==i&&(t=Qt(t,1/i,s)),t}function ss(t,e,[n,s,i],o,r){!function(t,e=0,n=1,s=.5,i,o=t,r=t){if(a.test(e)){e=parseFloat(e);e=kt(r.min,r.max,e/100)-r.min}if("number"!=typeof e)return;let l=kt(o.min,o.max,s);t===o&&(l-=e),t.min=ns(t.min,e,n,l,i),t.max=ns(t.max,e,n,l,i)}(t,e[n],e[s],e[i],e.scale,o,r)}const is=["x","scaleX","originX"],os=["y","scaleY","originY"];function rs(t,e,n,s){ss(t.x,e,is,n?n.x:void 0,s?s.x:void 0),ss(t.y,e,os,n?n.y:void 0,s?s.y:void 0)}function as(t){return 0===t.translate&&1===t.scale}function ls(t){return as(t.x)&&as(t.y)}function hs(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}function us(t){return Rt(t.x)/Rt(t.y)}class cs{constructor(){this.members=[]}add(t){zn(this.members,t),t.scheduleRender()}remove(t){if($n(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)}}function ps(t,e,n){let s="";const i=t.x.translate/e.x,o=t.y.translate/e.y;if((i||o)&&(s=`translate3d(${i}px, ${o}px, 0) `),1===e.x&&1===e.y||(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:i}=n;t&&(s+=`rotate(${t}deg) `),e&&(s+=`rotateX(${e}deg) `),i&&(s+=`rotateY(${i}deg) `)}const r=t.x.scale*e.x,a=t.y.scale*e.y;return 1===r&&1===a||(s+=`scale(${r}, ${a})`),s||"none"}const ds=(t,e)=>t.depth-e.depth;class ms{constructor(){this.children=[],this.isDirty=!1}add(t){zn(this.children,t),this.isDirty=!0}remove(t){$n(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(ds),this.isDirty=!1,this.children.forEach(t)}}const fs=["","X","Y","Z"];let gs=0;function ys({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:i}){return class{constructor(t,n={},s=(null==e?void 0:e())){this.id=gs++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isTransformDirty=!1,this.isProjectionDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.potentialNodes=new Map,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.nodes.forEach(Ps),this.nodes.forEach(Es),this.nodes.forEach(Ss)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.elementId=t,this.latestValues=n,this.root=s?s.root||s:this,this.path=s?[...s.path,s]:[],this.parent=s,this.depth=s?s.depth+1:0,t&&this.root.registerPotentialNode(t,this);for(let t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new ms)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new Gn),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)}registerPotentialNode(t,e){this.potentialNodes.set(t,e)}mount(e,n=!1){if(this.instance)return;this.isSVG=e instanceof SVGElement&&"svg"!==e.tagName,this.instance=e;const{layoutId:s,layout:i,visualElement:o}=this.options;if(o&&!o.current&&o.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.elementId&&this.root.potentialNodes.delete(this.elementId),n&&(i||s)&&(this.isLayoutDirty=!0),t){let n;const s=()=>this.root.updateBlockedByResize=!1;t(e,()=>{this.root.updateBlockedByResize=!0,n&&n(),n=vn(s,250),d.hasAnimatedSinceResize&&(d.hasAnimatedSinceResize=!1,this.nodes.forEach(As))})}s&&this.root.registerSharedNode(s,this),!1!==this.options.animate&&o&&(s||i)&&this.addEventListener("didUpdate",({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:s})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||o.getDefaultTransition()||ks,{onLayoutAnimationStart:r,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!hs(this.targetLayout,s)||n,h=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||h||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,h);const e={...jn(i,"layout"),onPlay:r,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||0!==this.animationProgress||As(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,lt.preRender(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(ws),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!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")}didUpdate(){if(this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(bs);this.isUpdating&&(this.isUpdating=!1,this.potentialNodes.size&&(this.potentialNodes.forEach(Rs),this.potentialNodes.clear()),this.nodes.forEach(Vs),this.nodes.forEach(vs),this.nodes.forEach(xs),this.clearAllSnapshots(),ht.update(),ht.preRender(),ht.render())}clearAllSnapshots(){this.nodes.forEach(Ts),this.sharedNodes.forEach(Cs)}scheduleUpdateProjection(){at.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){at.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}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);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:s(this.instance),offset:n(this.instance)})}resetTransform(){if(!i)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!ls(this.projectionDelta),n=this.getTransformTemplate(),s=n?n(this.latestValues,""):void 0,o=s!==this.prevTransformTemplateValue;t&&(e||Zt(this.latestValues)||o)&&(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)),Bs((s=n).x),Bs(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(),{scroll:n}=this.root;return n&&(ie(e.x,n.offset.x),ie(e.y,n.offset.y)),e}removeElementScroll(t){const e={x:{min:0,max:0},y:{min:0,max:0}};es(e,t);for(let n=0;n<this.path.length;n++){const s=this.path[n],{scroll:i,options:o}=s;if(s!==this.root&&i&&o.layoutScroll){if(i.isRoot){es(e,t);const{scroll:n}=this.root;n&&(ie(e.x,-n.offset.x),ie(e.y,-n.offset.y))}ie(e.x,i.offset.x),ie(e.y,i.offset.y)}}return e}applyTransform(t,e=!1){const n={x:{min:0,max:0},y:{min:0,max:0}};es(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&&le(n,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),Zt(s.latestValues)&&le(n,s.latestValues)}return Zt(this.latestValues)&&le(n,this.latestValues),n}removeTransform(t){const e={x:{min:0,max:0},y:{min:0,max:0}};es(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!Zt(n.latestValues))continue;Kt(n.latestValues)&&n.updateSnapshot();const s={x:{min:0,max:0},y:{min:0,max:0}};es(s,n.measurePageBox()),rs(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,s)}return Zt(this.latestValues)&&rs(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.isProjectionDirty=!0,this.root.scheduleUpdateProjection()}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}resolveTargetDelta(){const t=this.getLead();if(this.isProjectionDirty||(this.isProjectionDirty=t.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=t.isTransformDirty),!this.isProjectionDirty&&!this.attemptToResolveRelativeTarget)return;const{layout:e,layoutId:n}=this.options;if(this.layout&&(e||n)){if(!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ot(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),es(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}var s,i,o;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?(s=this.target,i=this.relativeTarget,o=this.relativeParent.target,It(s.x,i.x,o.x),It(s.y,i.y,o.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):es(this.target,this.layout.layoutBox),ne(this.target,this.targetDelta)):es(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?(this.relativeParent=t,this.relativeTarget={x:{min:0,max:0},y:{min:0,max:0}},this.relativeTargetOrigin={x:{min:0,max:0},y:{min:0,max:0}},Ot(this.relativeTargetOrigin,this.target,t.target),es(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(this.parent&&!Kt(this.parent.latestValues)&&!_t(this.parent.latestValues))return(this.parent.relativeTarget||this.parent.targetDelta||this.parent.options.layoutRoot)&&this.parent.layout?this.parent:this.parent.getClosestProjectingParent()}calcProjection(){const{isProjectionDirty:t,isTransformDirty:e}=this;this.isProjectionDirty=this.isTransformDirty=!1;const n=this.getLead(),s=Boolean(this.resumingFrom)||this!==n;let i=!0;if(t&&(i=!1),s&&e&&(i=!1),i)return;const{layout:o,layoutId:r}=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||!o&&!r)return;es(this.layoutCorrected,this.layout.layoutBox),function(t,e,n,s=!1){const i=n.length;if(!i)return;let o,r;e.x=e.y=1;for(let a=0;a<i;a++){o=n[a],r=o.projectionDelta;const i=o.instance;i&&i.style&&"contents"===i.style.display||(s&&o.options.layoutScroll&&o.scroll&&o!==o.root&&le(t,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,ne(t,r)),s&&Zt(o.latestValues)&&le(t,o.latestValues))}e.x=se(e.x),e.y=se(e.y)}(this.layoutCorrected,this.treeScale,this.path,s);const{target:a}=n;if(!a)return;this.projectionDelta||(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}});const l=this.treeScale.x,h=this.treeScale.y,u=this.projectionTransform;jt(this.projectionDelta,this.layoutCorrected,a,this.latestValues),this.projectionTransform=ps(this.projectionDelta,this.treeScale),this.projectionTransform===u&&this.treeScale.x===l&&this.treeScale.y===h||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",a))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){const n=this.snapshot,s=n?n.latestValues:{},i={...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}},l=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),h=this.getStack(),u=!h||h.members.length<=1,c=Boolean(l&&!u&&!0===this.options.crossfade&&!this.path.some(Ls));this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;var h,p,d,m;Ms(o.x,t.x,n),Ms(o.y,t.y,n),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ot(r,this.layout.layoutBox,this.relativeParent.layout.layoutBox),h=this.relativeTarget,p=this.relativeTargetOrigin,d=r,m=n,Ds(h.x,p.x,d.x,m),Ds(h.y,p.y,d.y,m)),l&&(this.animationValues=i,function(t,e,n,s,i,o){i?(t.opacity=kt(0,void 0!==n.opacity?n.opacity:1,_n(s)),t.opacityExit=kt(void 0!==e.opacity?e.opacity:1,0,Jn(s))):o&&(t.opacity=kt(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,s));for(let i=0;i<Yn;i++){const o=`border${qn[i]}Radius`;let r=Zn(e,o),l=Zn(n,o);if(void 0===r&&void 0===l)continue;r||(r=0),l||(l=0);0===r||0===l||Kn(r)===Kn(l)?(t[o]=Math.max(kt(Xn(r),Xn(l),s),0),(a.test(l)||a.test(r))&&(t[o]+="%")):t[o]=l}(e.rotate||n.rotate)&&(t.rotate=kt(e.rotate||0,n.rotate||0,s))}(i,s,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(lt.update(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=at.update(()=>{d.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n={}){const s=c(t)?t:Wn(t);return s.start(In("",s,e,n)),{stop:()=>s.stop(),isAnimating:()=>s.isAnimating()}}(0,1e3,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},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&&Fs(this.options.animationType,this.layout.layoutBox,s.layoutBox)){n=this.target||{x:{min:0,max:0},y:{min:0,max:0}};const e=Rt(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const s=Rt(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+s}es(e,n),le(e,i),jt(this.projectionDeltaWithTransform,this.layoutCorrected,e,i)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new cs);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(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.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)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const s={};for(let e=0;e<fs.length;e++){const i="rotate"+fs[e];n[i]&&(s[i]=n[i],t.setStaticValue(i,0))}t.render();for(const e in s)t.setStaticValue(e,s[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n;const s={};if(!this.instance||this.isSVG)return s;if(!this.isVisible)return{visibility:"hidden"};s.visibility="";const i=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,s.opacity="",s.pointerEvents=m(t.pointerEvents)||"",s.transform=i?i(this.latestValues,""):"none",s;const o=this.getLead();if(!this.projectionDelta||!this.layout||!o.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=m(t.pointerEvents)||""),this.hasProjected&&!Zt(this.latestValues)&&(e.transform=i?i({},""):"none",this.hasProjected=!1),e}const r=o.animationValues||o.latestValues;this.applyTransformsToTarget(),s.transform=ps(this.projectionDeltaWithTransform,this.treeScale,r),i&&(s.transform=i(r,s.transform));const{x:a,y:l}=this.projectionDelta;s.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,o.animationValues?s.opacity=o===this?null!==(n=null!==(e=r.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:r.opacityExit:s.opacity=o===this?void 0!==r.opacity?r.opacity:"":void 0!==r.opacityExit?r.opacityExit:0;for(const t in f){if(void 0===r[t])continue;const{correct:e,applyTo:n}=f[t],i="none"===s.transform?r[t]:e(r[t],o);if(n){const t=n.length;for(let e=0;e<t;e++)s[n[e]]=i}else s[t]=i}return this.options.layoutId&&(s.pointerEvents=o===this?m(t.pointerEvents)||"":"none"),s}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()}),this.root.nodes.forEach(bs),this.root.sharedNodes.clear()}}}function vs(t){t.updateLayout()}function xs(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:s}=t.layout,{animationType:i}=t.options,o=n.source!==t.layout.source;"size"===i?qt(t=>{const s=o?n.measuredBox[t]:n.layoutBox[t],i=Rt(s);s.min=e[t].min,s.max=s.min+i}):Fs(i,n.layoutBox,e)&&qt(t=>{const s=o?n.measuredBox[t]:n.layoutBox[t],i=Rt(e[t]);s.max=s.min+i});const r={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};jt(r,e,n.layoutBox);const a={x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}};o?jt(a,t.applyTransform(s,!0),n.measuredBox):jt(a,e,n.layoutBox);const l=!ls(r);let h=!1;if(!t.resumeFrom){const s=t.getClosestProjectingParent();if(s&&!s.resumeFrom){const{snapshot:i,layout:o}=s;if(i&&o){const r={x:{min:0,max:0},y:{min:0,max:0}};Ot(r,n.layoutBox,i.layoutBox);const a={x:{min:0,max:0},y:{min:0,max:0}};Ot(a,e,o.layoutBox),hs(r,a)||(h=!0),s.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=r,t.relativeParent=s)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:r,hasLayoutChanged:l,hasRelativeTargetChanged:h})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function Ps(t){t.isProjectionDirty||(t.isProjectionDirty=Boolean(t.parent&&t.parent.isProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=Boolean(t.parent&&t.parent.isTransformDirty))}function Ts(t){t.clearSnapshot()}function bs(t){t.clearMeasurements()}function Vs(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function As(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0}function Es(t){t.resolveTargetDelta()}function Ss(t){t.calcProjection()}function ws(t){t.resetRotation()}function Cs(t){t.removeLeadSnapshot()}function Ms(t,e,n){t.translate=kt(e.translate,0,n),t.scale=kt(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ds(t,e,n,s){t.min=kt(e.min,n.min,s),t.max=kt(e.max,n.max,s)}function Ls(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const ks={duration:.45,ease:[.4,0,.1,1]};function Rs(t,e){let n=t.root;for(let e=t.path.length-1;e>=0;e--)if(Boolean(t.path[e].instance)){n=t.path[e];break}const s=(n&&n!==t.root?n.instance:document).querySelector(`[data-projection-id="${e}"]`);s&&t.mount(s,!0)}function Bs(t){t.min=Math.round(t.min),t.max=Math.round(t.max)}function Fs(t,e,n){return"position"===t||"preserve-aspect"===t&&!Bt(us(e),us(n),.2)}const js=ys({attachResizeListener:(t,e)=>mt(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Is={current:void 0},Us=ys({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Is.current){const t=new js(0,{});t.mount(window),t.setOptions({layoutScroll:!0}),Is.current=t}return Is.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)});function Os(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ns={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!p.test(t))return t;t=parseFloat(t)}return`${Os(t,e.target.x)}% ${Os(t,e.target.y)}%`}};function zs(t){return"string"==typeof t&&t.startsWith("var(--")}const $s=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Gs(t,e,n=1){const[s,i]=function(t){const e=$s.exec(t);if(!e)return[,];const[,n,s]=e;return[n,s]}(t);if(!s)return;const o=window.getComputedStyle(e).getPropertyValue(s);return o?o.trim():zs(i)?Gs(i,e,n+1):i}const Hs={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,i=t.includes("var("),o=[];i&&(t=t.replace($s,t=>(o.push(t),"_$css")));const r=ke.parse(t);if(r.length>5)return s;const a=ke.createTransformer(t),l="number"!=typeof r[0]?1:0,h=n.x.scale*e.x,u=n.y.scale*e.y;r[0+l]/=h,r[1+l]/=u;const c=kt(h,u,.5);"number"==typeof r[2+l]&&(r[2+l]/=c),"number"==typeof r[3+l]&&(r[3+l]/=c);let p=a(r);if(i){let t=0;p=p.replace("_$css",()=>{const e=o[t];return t++,e})}return p}},Ws=t=>/^0[^.\s]+$/.test(t),qs=t=>e=>e.test(t),Ys=[r,p,a,g,y,v,{test:t=>"auto"===t,parse:t=>t}],Xs=t=>Ys.find(qs(t)),Ks=[...Ys,be,ke],Zs=t=>Ks.find(qs(t));function _s(t,e,n){const s=t.getProps();return x(s,e,void 0!==n?n:s.custom,function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.get()),e}(t),function(t){const e={};return t.values.forEach((t,n)=>e[n]=t.getVelocity()),e}(t))}function Js(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Wn(n))}function Qs(t,e){if(!e)return;return(e[t]||e.default||e).from}const ti=new Set(["width","height","top","left","right","bottom","x","y"]),ei=t=>ti.has(t),ni=t=>t===r||t===p;var si;!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(si||(si={}));const ii=(t,e)=>parseFloat(t.split(", ")[e]),oi=(t,e)=>(n,{transform:s})=>{if("none"===s||!s)return 0;const i=s.match(/^matrix3d\((.+)\)$/);if(i)return ii(i[1],e);{const e=s.match(/^matrix\((.+)\)$/);return e?ii(e[1],t):0}},ri=new Set(["x","y","z"]),ai=T.filter(t=>!ri.has(t));const li={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:oi(4,13),y:oi(5,14)},hi=(t,e,n={},s={})=>{e={...e},s={...s};const i=Object.keys(e).filter(ei);let o=[],r=!1;const a=[];if(i.forEach(i=>{const l=t.getValue(i);if(!t.hasValue(i))return;let h=n[i],u=Xs(h);const c=e[i];let d;if(b(c)){const t=c.length,e=null===c[0]?1:0;h=c[e],u=Xs(h);for(let n=e;n<t;n++)d?Xs(c[n]):d=Xs(c[n])}else d=Xs(c);if(u!==d)if(ni(u)&&ni(d)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof c?e[i]=parseFloat(c):Array.isArray(c)&&d===p&&(e[i]=c.map(parseFloat))}else(null==u?void 0:u.transform)&&(null==d?void 0:d.transform)&&(0===h||0===c)?0===h?l.set(d.transform(h)):e[i]=u.transform(c):(r||(o=function(t){const e=[];return ai.forEach(n=>{const s=t.getValue(n);void 0!==s&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e.length&&t.render(),e}(t),r=!0),a.push(i),s[i]=void 0!==s[i]?s[i]:e[i],l.jump(c))}),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,i=((t,e,n)=>{const s=e.measureViewportBox(),i=e.current,o=getComputedStyle(i),{display:r}=o,a={};"none"===r&&e.setStaticValue("display",t.display||"block"),n.forEach(t=>{a[t]=li[t](s,o)}),e.render();const l=e.measureViewportBox();return n.forEach(n=>{const s=e.getValue(n);s&&s.jump(a[n]),t[n]=li[n](l,o)}),t})(e,t,a);return o.length&&o.forEach(([e,n])=>{t.getValue(e).set(n)}),t.render(),V&&null!==n&&window.scrollTo({top:n}),{target:i,transitionEnd:s}}return{target:e,transitionEnd:s}};function ui(t,e,n,s){return(t=>Object.keys(t).some(ei))(e)?hi(t,e,n,s):{target:e,transitionEnd:s}}const ci=(t,e,n,s)=>{const i=function(t,{...e},n){const s=t.current;if(!(s instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach(t=>{const e=t.get();if(!zs(e))return;const n=Gs(e,s);n&&t.set(n)});for(const t in e){const i=e[t];if(!zs(i))continue;const o=Gs(i,s);o&&(e[t]=o,n&&void 0===n[t]&&(n[t]=i))}return{target:e,transitionEnd:n}}(t,e,s);return ui(t,e=i.target,n,s=i.transitionEnd)},pi={current:null},di={current:!1};function mi(t){return Boolean(c(t)&&t.add)}function fi(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 gi="data-"+A("framerAppearId");function yi(t,e,n={}){const s=_s(t,e,n.custom);let{transition:i=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(i=n.transitionOverride);const o=s?()=>vi(t,s,n):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(s=0)=>{const{delayChildren:o=0,staggerChildren:r,staggerDirection:a}=i;return function(t,e,n=0,s=0,i=1,o){const r=[],a=(t.variantChildren.size-1)*s,l=1===i?(t=0)=>t*s:(t=0)=>a-t*s;return Array.from(t.variantChildren).sort(xi).forEach((t,s)=>{t.notify("AnimationStart",e),r.push(yi(t,e,{...o,delay:n+l(s)}).then(()=>t.notify("AnimationComplete",e)))}),Promise.all(r)}(t,e,o+s,r,a,n)}:()=>Promise.resolve(),{when:a}=i;if(a){const[t,e]="beforeChildren"===a?[o,r]:[r,o];return t().then(e)}return Promise.all([o(),r(n.delay)])}function vi(t,e,{delay:n=0,transitionOverride:s,type:i}={}){let{transition:o=t.getDefaultTransition(),transitionEnd:r,...a}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");s&&(o=s);const h=[],u=i&&t.animationState&&t.animationState.getState()[i];for(const e in a){const s=t.getValue(e),i=a[e];if(!s||void 0===i||u&&Pi(u,e))continue;const r={delay:n,elapsed:0,...o};if(window.HandoffAppearAnimations&&!s.hasAnimated){const n=t.getProps()[gi];n&&(r.elapsed=window.HandoffAppearAnimations(n,e,s,at))}let c=s.start(In(e,s,i,t.shouldReduceMotion&&E.has(e)?{type:!1}:r));mi(l)&&(l.add(e),c=c.then(()=>l.remove(e))),h.push(c)}return Promise.all(h).then(()=>{r&&function(t,e){const n=_s(t,e);let{transitionEnd:s={},transition:i={},...o}=n?t.makeTargetAnimatable(n,!1):{};o={...o,...s};for(const e in o){Js(t,e,P(o[e]))}}(t,r)})}function xi(t,e){return t.sortNodePosition(e)}function Pi({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,s}const Ti=[Wt.Animate,Wt.InView,Wt.Focus,Wt.Hover,Wt.Tap,Wt.Drag,Wt.Exit],bi=[...Ti].reverse(),Vi=Ti.length;function Ai(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=>yi(t,e,n));s=Promise.all(i)}else if("string"==typeof e)s=yi(t,e,n);else{const i="function"==typeof e?_s(t,e,n.custom):e;s=vi(t,i,n)}return s.then(()=>t.notify("AnimationComplete",e))}(t,e,n)))}function Ei(t){let e=Ai(t);const n={[Wt.Animate]:wi(!0),[Wt.InView]:wi(),[Wt.Hover]:wi(),[Wt.Tap]:wi(),[Wt.Drag]:wi(),[Wt.Focus]:wi(),[Wt.Exit]:wi()};let s=!0;const i=(e,n)=>{const s=_s(t,n);if(s){const{transition:t,transitionEnd:n,...i}=s;e={...e,...i,...n}}return e};function o(o,r){const a=t.getProps(),l=t.getVariantContext(!0)||{},h=[],u=new Set;let c={},p=1/0;for(let e=0;e<Vi;e++){const d=bi[e],m=n[d],f=void 0!==a[d]?a[d]:l[d],g=w(f),y=d===r?m.isActive:null;!1===y&&(p=e);let v=f===l[d]&&f!==a[d]&&g;if(v&&s&&t.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...c},!m.isActive&&null===y||!f&&!m.prevProp||S(f)||"boolean"==typeof f)continue;const x=Si(m.prevProp,f);let P=x||d===r&&m.isActive&&!v&&g||e>p&&g;const T=Array.isArray(f)?f:[f];let V=T.reduce(i,{});!1===y&&(V={});const{prevResolvedValues:A={}}=m,E={...A,...V},C=t=>{P=!0,u.delete(t),m.needsAnimating[t]=!0};for(const t in E){const e=V[t],n=A[t];c.hasOwnProperty(t)||(e!==n?b(e)&&b(n)?!fi(e,n)||x?C(t):m.protectedKeys[t]=!0:void 0!==e?C(t):u.add(t):void 0!==e&&u.has(t)?C(t):m.protectedKeys[t]=!0)}m.prevProp=f,m.prevResolvedValues=V,m.isActive&&(c={...c,...V}),s&&t.blockInitialAnimation&&(P=!1),P&&!v&&h.push(...T.map(t=>({animation:t,options:{type:d,...o}})))}if(u.size){const e={};u.forEach(n=>{const s=t.getBaseTarget(n);void 0!==s&&(e[n]=s)}),h.push({animation:e})}let d=Boolean(h.length);return s&&!1===a.initial&&!t.manuallyAnimateOnMount&&(d=!1),s=!1,d?e(h):Promise.resolve()}return{animateChanges:o,setActive:function(e,s,i){if(n[e].isActive===s)return Promise.resolve();t.variantChildren&&t.variantChildren.forEach(t=>{t.animationState&&t.animationState.setActive(e,s)}),n[e].isActive=s;const r=o(i,e);for(const t in n)n[t].protectedKeys={};return r},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Si(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!fi(e,t)}function wi(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const Ci=Object.keys(D),Mi=Ci.length,Di=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];const Li=["initial",...Ti],ki=Li.length;class Ri extends class{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:s,visualState:i},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,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.scheduleRender=()=>at.render(this.render,!1,!0);const{latestValues:r,renderState:a}=i;this.latestValues=r,this.baseTarget={...r},this.initialValues=e.initial?{...r}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=o,this.isControllingVariants=C(e),this.isVariantNode=M(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...h}=this.scrapeMotionValuesFromProps(e,{});for(const t in h){const e=h[t];void 0!==r[t]&&c(e)&&(e.set(r[t],!1),mi(l)&&l.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,this.projection&&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)),di.current||function(){if(di.current=!0,V)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>pi.current=t.matches;t.addListener(e),e()}else pi.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||pi.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),lt.update(this.notifyUpdate),lt.render(this.render),this.valueSubscriptions.forEach(t=>t()),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)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=E.has(t),s=e.on("change",e=>{this.latestValues[t]=e,this.props.onUpdate&&at.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,()=>{s(),i()})}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,s,i,o){let r,a;for(let t=0;t<Mi;t++){const n=Ci[t],{isEnabled:s,Feature:i,ProjectionNode:o,MeasureLayout:l}=D[n];o&&(r=o),s(e)&&(!this.features[n]&&i&&(this.features[n]=new i(this)),l&&(a=l))}if(!this.projection&&r){this.projection=new r(i,this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:s,dragConstraints:a,layoutScroll:l,layoutRoot:h}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(s)||a&&u(a),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:o,layoutScroll:l,layoutRoot:h})}return a}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update(this.props,this.prevProps):(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,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}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,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<Di.length;e++){const n=Di[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){const{willChange:s}=e;for(const i in e){const o=e[i],r=n[i];if(c(o))t.addValue(i,o),mi(s)&&s.add(i);else if(c(r))t.addValue(i,Wn(o,{owner:t})),mi(s)&&s.remove(i);else if(r!==o)if(t.hasValue(i)){const e=t.getValue(i);!e.hasAnimated&&e.set(o)}else{const e=t.getStaticValue(i);t.addValue(i,Wn(void 0!==e?e:o,{owner:t}))}}for(const s in n)void 0===e[s]&&t.removeValue(s);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),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}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<ki;t++){const n=Li[t],s=this.props[n];(w(s)||!1===s)&&(e[n]=s)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(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=Wn(e,{owner:this}),this.addValue(t,n)),n}readValue(t){return void 0===this.latestValues[t]&&this.current?this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,s="string"==typeof n||"object"==typeof n?null===(e=x(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==s)return s;const i=this.getBaseTargetFromProps(this.props,t);return void 0===i||c(i)?void 0!==this.initialValues[t]&&void 0===s?void 0:this.baseTarget[t]:i}on(t,e){return this.events[t]||(this.events[t]=new Gn),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}{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]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:s},i){let o=function(t,e,n){const s={};for(const i in t){const t=Qs(i,e);if(void 0!==t)s[i]=t;else{const t=n.getValue(i);t&&(s[i]=t.get())}}return s}(n,t||{},this);if(s&&(e&&(e=s(e)),n&&(n=s(n)),o&&(o=s(o))),i){!function(t,e,n){var s,i;const o=Object.keys(e).filter(e=>!t.hasValue(e)),r=o.length;if(r)for(let a=0;a<r;a++){const r=o[a],l=e[r];let h=null;Array.isArray(l)&&(h=l[0]),null===h&&(h=null!==(i=null!==(s=n[r])&&void 0!==s?s:t.readValue(r))&&void 0!==i?i:e[r]),null!=h&&("string"==typeof h&&(/^\-?\d*\.?\d+$/.test(h)||Ws(h))?h=parseFloat(h):!Zs(h)&&ke.test(l)&&(h=Rn(r,l)),t.addValue(r,Wn(h,{owner:t})),void 0===n[r]&&(n[r]=h),null!==h&&t.setBaseTarget(r,h))}}(this,n,o);const t=ci(this,n,o,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class Bi extends Ri{readValueFromInstance(t,e){if(E.has(e)){const t=kn(e);return t&&t.default||0}{const s=(n=t,window.getComputedStyle(n)),i=(L(e)?s.getPropertyValue(e):s[e])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return he(t,e)}build(t,e,n,s){k(t,e,n,s.transformTemplate)}scrapeMotionValuesFromProps(t,e){return R(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;c(t)&&(this.childSubscription=t.on("change",t=>{this.current&&(this.current.textContent=""+t)}))}renderInstance(t,e,n,s){B(t,e,n,s)}}class Fi extends W.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:s}=this.props,{projection:i}=t;j(Ii),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()})),d.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:s,isPresent:i}=this.props,o=n.projection;return o?(o.isPresent=i,s||t.layoutDependency!==e||void 0===e?o.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?o.promote():o.relegate()||at.postRender(()=>{const t=o.getStack();t&&t.members.length||this.safeToRemove()})),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),!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 ji(t){const[e,n]=function(){const t=q(F);if(null===t)return[!0,null];const{isPresent:e,onExitComplete:n,register:s}=t,i=Y();return X(()=>s(i),[]),!e&&n?[!1,()=>n&&n(i)]:[!0]}(),s=q(I);return W.createElement(Fi,{...t,layoutGroup:s,switchLayoutGroup:q(U),isPresent:e,safeToRemove:n})}const Ii={borderRadius:{...Ns,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ns,borderTopRightRadius:Ns,borderBottomLeftRadius:Ns,borderBottomRightRadius:Ns,boxShadow:Hs},Ui={pan:{Feature:class extends K{constructor(){super(...arguments),this.removePointerDownListener=Z}onPointerDown(t){this.session=new xt(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:s}=this.node.getProps();return{onSessionStart:t,onStart:e,onMove:n,onEnd:(t,e)=>{delete this.session,s&&s(t,e)}}}mount(){this.removePointerDownListener=ft(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 K{constructor(t){super(t),this.removeGroupControls=Z,this.removeListeners=Z,this.controls=new On(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Z}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Us,MeasureLayout:ji}},Oi={layout:{ProjectionNode:Us,MeasureLayout:ji}};let Ni=0;const zi={animation:{Feature:class extends K{constructor(t){super(t),t.animationState||(t.animationState=Ei(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),S(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends K{constructor(){super(...arguments),this.id=Ni++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e,custom:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===s)return;const i=this.node.animationState.setActive(Wt.Exit,!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&i.then(()=>e(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}};function $i(t,e){const n="pointer"+(e?"enter":"leave"),s="onHover"+(e?"Start":"End");return ft(t.current,n,(n,i)=>{if("touch"===n.type||Dt())return;const o=t.getProps();t.animationState&&o.whileHover&&t.animationState.setActive(Wt.Hover,e),o[s]&&o[s](n,i)},{passive:!t.getProps()[s]})}const Gi=(t,e)=>!!e&&(t===e||Gi(t,e.parentElement));function Hi(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,J(n))}const Wi=new WeakMap,qi=new WeakMap,Yi=t=>{const e=Wi.get(t.target);e&&e(t)},Xi=t=>{t.forEach(Yi)};function Ki(t,e,n){const s=function({root:t,...e}){const n=t||document;qi.has(n)||qi.set(n,{});const s=qi.get(n),i=JSON.stringify(e);return s[i]||(s[i]=new IntersectionObserver(Xi,{root:t,...e})),s[i]}(e);return Wi.set(t,n),s.observe(t),()=>{Wi.delete(t),s.unobserve(t)}}const Zi={some:0,all:1};const _i={inView:{Feature:class extends K{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}viewportFallback(){requestAnimationFrame(()=>{this.hasEnteredView=!0;const{onViewportEnter:t}=this.node.getProps();t&&t(null),this.node.animationState&&this.node.animationState.setActive(Wt.InView,!0)})}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:s="some",once:i,fallback:o=!0}=t;if("undefined"==typeof IntersectionObserver)return void(o&&this.viewportFallback());const r={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof s?s:Zi[s]};return Ki(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(Wt.InView,e);const{onViewportEnter:n,onViewportLeave:s}=this.node.getProps(),o=e?n:s;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 K{constructor(){super(...arguments),this.removeStartListeners=Z,this.removeEndListeners=Z,this.removeAccessibleListeners=Z,this.startPointerPress=(t,e)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),s=ft(window,"pointerup",(t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:s}=this.node.getProps();Gi(this.node.current,t.target)?n&&n(t,e):s&&s(t,e)},{passive:!(n.onTap||n.onPointerUp)}),i=ft(window,"pointercancel",(t,e)=>this.cancelPress(t,e),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=yt(s,i),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=mt(this.node.current,"keydown",t=>{if("Enter"!==t.key||this.isPressing)return;this.removeEndListeners(),this.removeEndListeners=mt(this.node.current,"keyup",t=>{"Enter"===t.key&&this.checkPressEnd()&&Hi("up",this.node.getProps().onTap)}),Hi("down",(t,e)=>{this.startPress(t,e)})}),e=mt(this.node.current,"blur",()=>{this.isPressing&&Hi("cancel",(t,e)=>this.cancelPress(t,e))});this.removeAccessibleListeners=yt(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:s}=this.node.getProps();s&&this.node.animationState&&this.node.animationState.setActive(Wt.Tap,!0),n&&n(t,e)}checkPressEnd(){this.removeEndListeners(),this.isPressing=!1;return this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive(Wt.Tap,!1),!Dt()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&n(t,e)}mount(){const t=this.node.getProps(),e=ft(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=mt(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=yt(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends K{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(Wt.Focus,!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive(Wt.Focus,!1),this.isActive=!1)}mount(){this.unmount=yt(mt(this.node.current,"focus",()=>this.onFocus()),mt(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}},hover:{Feature:class extends K{mount(){this.unmount=yt($i(this.node,!0),$i(this.node,!1))}unmount(){}}}};class Ji extends Ri{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(E.has(e)){const t=kn(e);return t&&t.default||0}return e=O.has(e)?e:A(e),t.getAttribute(e)}measureInstanceViewportBox(){return{x:{min:0,max:0},y:{min:0,max:0}}}scrapeMotionValuesFromProps(t,e){return N(t,e)}build(t,e,n,s){z(t,e,n,this.isSVGTag,s.transformTemplate)}renderInstance(t,e,n,s){$(t,e,n,s)}mount(t){this.isSVGTag=G(t.tagName),super.mount(t)}}const Qi={...{renderer:(t,e)=>H(t)?new Ji(e,{enableHardwareAcceleration:!1}):new Bi(e,{enableHardwareAcceleration:!0}),...zi,..._i},...Ui,...Oi};export{Qi as domMax};
@@ -1 +1 @@
1
- import*as t from"react";import e,{createContext as n,useContext as r,useLayoutEffect as o,useEffect as a,useRef as i,useCallback as s,useMemo as c,forwardRef as l,createElement as u}from"react";const f=n({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),d=n({});const m=n(null),p="undefined"!=typeof document,g=p?o:a,y=n({strict:!1});function h(t,e,n,o){const s=r(d).visualElement,c=r(y),l=r(m),u=r(f).reducedMotion,p=i();o=o||c.renderer,!p.current&&o&&(p.current=o(t,{visualState:e,parent:s,props:n,presenceId:l?l.id:void 0,blockInitialAnimation:!!l&&!1===l.initial,reducedMotionConfig:u}));const h=p.current;g(()=>{h&&h.render()});return(window.HandoffAppearAnimations?g:a)(()=>{h&&h.animationState&&h.animationState.animateChanges()}),h}function v(t,e,n){return s(r=>{var o;r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&("function"==typeof n?n(r):"object"==typeof(o=n)&&Object.prototype.hasOwnProperty.call(o,"current")&&(n.current=r))},[e])}function w(t){return"string"==typeof t||Array.isArray(t)}function b(t){return"object"==typeof t&&"function"==typeof t.start}const x=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function S(t){return b(t.animate)||x.some(e=>w(t[e]))}function V(t){const{initial:e,animate:n}=function(t,e){if(S(t)){const{initial:e,animate:n}=t;return{initial:!1===e||w(e)?e:void 0,animate:w(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,r(d));return c(()=>({initial:e,animate:n}),[A(e),A(n)])}function A(t){return Array.isArray(t)?t.join(" "):t}const C=t=>({isEnabled:e=>t.some(t=>!!e[t])}),E={measureLayout:C(["layout","layoutId","drag"]),animation:C(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:C(["exit"]),drag:C(["drag","dragControls"]),focus:C(["whileFocus"]),hover:C(["whileHover","onHoverStart","onHoverEnd"]),tap:C(["whileTap","onTap","onTapStart","onTapCancel"]),pan:C(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:C(["whileInView","onViewportEnter","onViewportLeave"])};function T(t){const e=i(null);return null===e.current&&(e.current=t()),e.current}const k=!1;let L=1;const O=n({});class P extends e.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:e}=this.props;return t&&t.setProps(e),null}componentDidUpdate(){}render(){return this.props.children}}const W=n({}),B=Symbol.for("motionComponentSymbol");function j({preloadedFeatures:e,createVisualElement:n,projectionNodeConstructor:o,useRender:a,useVisualState:i,Component:s}){e&&function(t){for(const e in t)"projectionNodeConstructor"===e?E.projectionNodeConstructor=t[e]:E[e].Component=t[e]}(e);const c=l((function(c,l){const u={...r(f),...c,layoutId:M(c)},{isStatic:m}=u;let g=null;const w=V(c),b=m?void 0:T(()=>{if(k)return L++}),x=i(c,m);if(!m&&p){w.visualElement=h(s,x,u,n);const t=r(W);w.visualElement&&(g=w.visualElement.loadFeatures(u,r(y).strict,e,b,o||E.projectionNodeConstructor,t))}return t.createElement(P,{visualElement:w.visualElement,props:u},g,t.createElement(d.Provider,{value:w},a(s,c,b,v(x,w.visualElement,l),x,m,w.visualElement)))}));return c[B]=s,c}function M({layoutId:t}){const e=r(O).id;return e&&void 0!==t?e+"-"+t:t}const R=["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 X(t){return"string"==typeof t&&!t.includes("-")&&!!(R.indexOf(t)>-1||/[A-Z]/.test(t))}const Y={},H=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],D=new Set(H);function $(t,{layout:e,layoutId:n}){return D.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Y[t]||"opacity"===t)}const F=t=>!!(null==t?void 0:t.getVelocity),I={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Z=(t,e)=>H.indexOf(t)-H.indexOf(e);function z(t){return t.startsWith("--")}const N=(t,e)=>e&&"number"==typeof t?e.transform(t):t,K={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},U={...K,transform:t=>((t,e,n)=>Math.min(Math.max(n,t),e))(0,1,t)},q={...K,default:1};const _=t=>({test:e=>function(t){return"string"==typeof t}(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),G=_("deg"),J=_("%"),Q=_("px"),tt={...J,parse:t=>J.parse(t)/100,transform:t=>J.transform(100*t)},et={...K,transform:Math.round},nt={borderWidth:Q,borderTopWidth:Q,borderRightWidth:Q,borderBottomWidth:Q,borderLeftWidth:Q,borderRadius:Q,radius:Q,borderTopLeftRadius:Q,borderTopRightRadius:Q,borderBottomRightRadius:Q,borderBottomLeftRadius:Q,width:Q,maxWidth:Q,height:Q,maxHeight:Q,size:Q,top:Q,right:Q,bottom:Q,left:Q,padding:Q,paddingTop:Q,paddingRight:Q,paddingBottom:Q,paddingLeft:Q,margin:Q,marginTop:Q,marginRight:Q,marginBottom:Q,marginLeft:Q,rotate:G,rotateX:G,rotateY:G,rotateZ:G,scale:q,scaleX:q,scaleY:q,scaleZ:q,skew:G,skewX:G,skewY:G,distance:Q,translateX:Q,translateY:Q,translateZ:Q,x:Q,y:Q,z:Q,perspective:Q,transformPerspective:Q,opacity:U,originX:tt,originY:tt,originZ:Q,zIndex:et,fillOpacity:U,strokeOpacity:U,numOctaves:et};function rt(t,e,n,r){const{style:o,vars:a,transform:i,transformKeys:s,transformOrigin:c}=t;s.length=0;let l=!1,u=!1,f=!0;for(const t in e){const n=e[t];if(z(t)){a[t]=n;continue}const r=nt[t],d=N(n,r);if(D.has(t)){if(l=!0,i[t]=d,s.push(t),!f)continue;n!==(r.default||0)&&(f=!1)}else t.startsWith("origin")?(u=!0,c[t]=d):o[t]=d}if(e.transform||(l||r?o.transform=function({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},o,a){let i="";e.sort(Z);for(const n of e)i+=`${I[n]||n}(${t[n]}) `;return n&&!t.z&&(i+="translateZ(0)"),i=i.trim(),a?i=a(t,o?"":i):r&&o&&(i="none"),i}(t,n,f,r):o.transform&&(o.transform="none")),u){const{originX:t="50%",originY:e="50%",originZ:n=0}=c;o.transformOrigin=`${t} ${e} ${n}`}}const ot=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function at(t,e,n){for(const r in e)F(e[r])||$(r,n)||(t[r]=e[r])}function it(t,e,n){const r={};return at(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},e,n){return c(()=>{const r={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return rt(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)},[e])}(t,e,n)),t.transformValues?t.transformValues(r):r}function st(t,e,n){const r={},o=it(t,e,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=o,r}const ct=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function lt(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||ct.has(t)}let ut=t=>!lt(t);try{(ft=require("@emotion/is-prop-valid").default)&&(ut=t=>t.startsWith("on")?!lt(t):ft(t))}catch(t){}var ft;function dt(t,e,n){return"string"==typeof t?t:Q.transform(e+n*t)}const mt={offset:"stroke-dashoffset",array:"stroke-dasharray"},pt={offset:"strokeDashoffset",array:"strokeDasharray"};function gt(t,{attrX:e,attrY:n,originX:r,originY:o,pathLength:a,pathSpacing:i=1,pathOffset:s=0,...c},l,u,f){if(rt(t,c,l,f),u)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:d,style:m,dimensions:p}=t;d.transform&&(p&&(m.transform=d.transform),delete d.transform),p&&(void 0!==r||void 0!==o||m.transform)&&(m.transformOrigin=function(t,e,n){return`${dt(e,t.x,t.width)} ${dt(n,t.y,t.height)}`}(p,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==a&&function(t,e,n=1,r=0,o=!0){t.pathLength=1;const a=o?mt:pt;t[a.offset]=Q.transform(-r);const i=Q.transform(e),s=Q.transform(n);t[a.array]=`${i} ${s}`}(d,a,i,s,!1)}const yt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}}),ht=t=>"string"==typeof t&&"svg"===t.toLowerCase();function vt(t,e,n,r){const o=c(()=>{const n={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return gt(n,e,{enableHardwareAcceleration:!1},ht(r),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};at(e,t.style,t),o.style={...e,...o.style}}return o}function wt(t=!1){return(e,n,r,o,{latestValues:a},i)=>{const s=(X(e)?vt:st)(n,a,i,e),l={...function(t,e,n){const r={};for(const o in t)"values"===o&&"object"==typeof t.values||(ut(o)||!0===n&&lt(o)||!e&&!lt(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(n,"string"==typeof e,t),...s,ref:o},{children:f}=n,d=c(()=>F(f)?f.get():f,[f]);return r&&(l["data-projection-id"]=r),u(e,{...l,children:d})}}const bt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function xt(t,e,n,r){!function(t,{style:e,vars:n},r,o){Object.assign(t.style,e,o&&o.getProjectionStyles(r));for(const e in n)t.style.setProperty(e,n[e])}(t,e,void 0,r);for(const n in e.attrs)t.setAttribute(bt.has(n)?n:n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),e.attrs[n])}function St(t,e){const{style:n}=t,r={};for(const o in n)(F(n[o])||e.style&&F(e.style[o])||$(o,t))&&(r[o]=n[o]);return r}function Vt(t){const e=F(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const At=t=>(e,n)=>{const o=r(d),a=r(m),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,o,a){const i={latestValues:Ct(r,o,a,t),renderState:e()};return n&&(i.mount=t=>n(r,t,i)),i}(t,e,o,a);return n?i():T(i)};function Ct(t,e,n,r){const o={},a=r(t,{});for(const t in a)o[t]=Vt(a[t]);let{initial:i,animate:s}=t;const c=S(t),l=function(t){return Boolean(S(t)||t.variants)}(t);e&&l&&!c&&!1!==t.inherit&&(void 0===i&&(i=e.initial),void 0===s&&(s=e.animate));let u=!!n&&!1===n.initial;u=u||!1===i;const f=u?s:i;if(f&&"boolean"!=typeof f&&!b(f)){(Array.isArray(f)?f:[f]).forEach(e=>{const n=function(t,e,n,r={},o={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,o)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,o)),e}(t,e);if(!n)return;const{transitionEnd:r,transition:a,...i}=n;for(const t in i){let e=i[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(o[t]=e)}for(const t in r)o[t]=r[t]})}return o}const Et={useVisualState:At({scrapeMotionValuesFromProps:function(t,e){const n=St(t,e);for(const r in t)if(F(t[r])||F(e[r])){n["x"===r||"y"===r?"attr"+r.toUpperCase():r]=t[r]}return n},createRenderState:yt,onMount:(t,e,{renderState:n,latestValues:r})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}gt(n,r,{enableHardwareAcceleration:!1},ht(e.tagName),t.transformTemplate),xt(e,n)}})},Tt={useVisualState:At({scrapeMotionValuesFromProps:St,createRenderState:ot})};const kt=function(t){function e(e,n={}){return j(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,r)=>(n.has(r)||n.set(r,e(r)),n.get(r))})}((function(t,{forwardMotionProps:e=!1},n,r,o){return{...X(t)?Et:Tt,preloadedFeatures:n,useRender:wt(e),createVisualElement:r,projectionNodeConstructor:o,Component:t}}));export{kt as m};
1
+ import*as t from"react";import{createContext as e,useContext as n,useLayoutEffect as r,useEffect as o,useRef as a,useInsertionEffect as i,useCallback as s,useMemo as c,forwardRef as l,createElement as u}from"react";const f=e({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),m=e({});const d=e(null),p="undefined"!=typeof document,g=p?r:o,y=e({strict:!1});function h(t,e,r,s){const c=n(m).visualElement,l=n(y),u=n(d),p=n(f).reducedMotion,h=a();s=s||l.renderer,!h.current&&s&&(h.current=s(t,{visualState:e,parent:c,props:r,presenceContext:u,blockInitialAnimation:!!u&&!1===u.initial,reducedMotionConfig:p}));const v=h.current;i(()=>{v&&v.update(r,u)}),g(()=>{v&&v.render()}),o(()=>{v&&v.updateFeatures()});return(window.HandoffAppearAnimations?g:o)(()=>{v&&v.animationState&&v.animationState.animateChanges()}),v}function v(t,e,n){return s(r=>{var o;r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&("function"==typeof n?n(r):"object"==typeof(o=n)&&Object.prototype.hasOwnProperty.call(o,"current")&&(n.current=r))},[e])}function w(t){return"string"==typeof t||Array.isArray(t)}function b(t){return"object"==typeof t&&"function"==typeof t.start}const x=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function S(t){return b(t.animate)||x.some(e=>w(t[e]))}function V(t){const{initial:e,animate:r}=function(t,e){if(S(t)){const{initial:e,animate:n}=t;return{initial:!1===e||w(e)?e:void 0,animate:w(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,n(m));return c(()=>({initial:e,animate:r}),[A(e),A(r)])}function A(t){return Array.isArray(t)?t.join(" "):t}const E={animation:["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"],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"]},T={};for(const t in E)T[t]={isEnabled:e=>E[t].some(t=>!!e[t])};function k(t){const e=a(null);return null===e.current&&(e.current=t()),e.current}const O=!1;let L=1;const P=e({}),W=e({}),C=Symbol.for("motionComponentSymbol");function B({preloadedFeatures:e,createVisualElement:r,useRender:o,useVisualState:a,Component:i}){e&&function(t){for(const e in t)T[e]={...T[e],...t[e]}}(e);const s=l((function(s,c){let l;const u={...n(f),...s,layoutId:M(s)},{isStatic:d}=u,g=V(s),w=d?void 0:k(()=>{if(O)return L++}),b=a(s,d);if(!d&&p){g.visualElement=h(i,b,u,r);const t=n(W),o=n(y).strict;g.visualElement&&(l=g.visualElement.loadFeatures(u,o,e,w,t))}return t.createElement(m.Provider,{value:g},l&&g.visualElement?t.createElement(l,{visualElement:g.visualElement,...u}):null,o(i,s,w,v(b,g.visualElement,c),b,d,g.visualElement))}));return s[C]=i,s}function M({layoutId:t}){const e=n(P).id;return e&&void 0!==t?e+"-"+t:t}const R=["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 X(t){return"string"==typeof t&&!t.includes("-")&&!!(R.indexOf(t)>-1||/[A-Z]/.test(t))}const Y={},H=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],F=new Set(H);function $(t,{layout:e,layoutId:n}){return F.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!Y[t]||"opacity"===t)}const j=t=>Boolean(t&&t.getVelocity),D={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},I=(t,e)=>H.indexOf(t)-H.indexOf(e);function Z(t){return t.startsWith("--")}const z=(t,e)=>e&&"number"==typeof t?e.transform(t):t,K={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},U={...K,transform:t=>((t,e,n)=>Math.min(Math.max(n,t),e))(0,1,t)},q={...K,default:1};const N=t=>({test:e=>function(t){return"string"==typeof t}(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),_=N("deg"),G=N("%"),J=N("px"),Q={...G,parse:t=>G.parse(t)/100,transform:t=>G.transform(100*t)},tt={...K,transform:Math.round},et={borderWidth:J,borderTopWidth:J,borderRightWidth:J,borderBottomWidth:J,borderLeftWidth:J,borderRadius:J,radius:J,borderTopLeftRadius:J,borderTopRightRadius:J,borderBottomRightRadius:J,borderBottomLeftRadius:J,width:J,maxWidth:J,height:J,maxHeight:J,size:J,top:J,right:J,bottom:J,left:J,padding:J,paddingTop:J,paddingRight:J,paddingBottom:J,paddingLeft:J,margin:J,marginTop:J,marginRight:J,marginBottom:J,marginLeft:J,rotate:_,rotateX:_,rotateY:_,rotateZ:_,scale:q,scaleX:q,scaleY:q,scaleZ:q,skew:_,skewX:_,skewY:_,distance:J,translateX:J,translateY:J,translateZ:J,x:J,y:J,z:J,perspective:J,transformPerspective:J,opacity:U,originX:Q,originY:Q,originZ:J,zIndex:tt,fillOpacity:U,strokeOpacity:U,numOctaves:tt};function nt(t,e,n,r){const{style:o,vars:a,transform:i,transformKeys:s,transformOrigin:c}=t;s.length=0;let l=!1,u=!1,f=!0;for(const t in e){const n=e[t];if(Z(t)){a[t]=n;continue}const r=et[t],m=z(n,r);if(F.has(t)){if(l=!0,i[t]=m,s.push(t),!f)continue;n!==(r.default||0)&&(f=!1)}else t.startsWith("origin")?(u=!0,c[t]=m):o[t]=m}if(e.transform||(l||r?o.transform=function({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:r=!0},o,a){let i="";e.sort(I);for(const n of e)i+=`${D[n]||n}(${t[n]}) `;return n&&!t.z&&(i+="translateZ(0)"),i=i.trim(),a?i=a(t,o?"":i):r&&o&&(i="none"),i}(t,n,f,r):o.transform&&(o.transform="none")),u){const{originX:t="50%",originY:e="50%",originZ:n=0}=c;o.transformOrigin=`${t} ${e} ${n}`}}const rt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function ot(t,e,n){for(const r in e)j(e[r])||$(r,n)||(t[r]=e[r])}function at(t,e,n){const r={};return ot(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},e,n){return c(()=>{const r={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return nt(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)},[e])}(t,e,n)),t.transformValues?t.transformValues(r):r}function it(t,e,n){const r={},o=at(t,e,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=o,r}const st=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function ct(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||st.has(t)}let lt=t=>!ct(t);try{(ut=require("@emotion/is-prop-valid").default)&&(lt=t=>t.startsWith("on")?!ct(t):ut(t))}catch(t){}var ut;function ft(t,e,n){return"string"==typeof t?t:J.transform(e+n*t)}const mt={offset:"stroke-dashoffset",array:"stroke-dasharray"},dt={offset:"strokeDashoffset",array:"strokeDasharray"};function pt(t,{attrX:e,attrY:n,originX:r,originY:o,pathLength:a,pathSpacing:i=1,pathOffset:s=0,...c},l,u,f){if(nt(t,c,l,f),u)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:m,style:d,dimensions:p}=t;m.transform&&(p&&(d.transform=m.transform),delete m.transform),p&&(void 0!==r||void 0!==o||d.transform)&&(d.transformOrigin=function(t,e,n){return`${ft(e,t.x,t.width)} ${ft(n,t.y,t.height)}`}(p,void 0!==r?r:.5,void 0!==o?o:.5)),void 0!==e&&(m.x=e),void 0!==n&&(m.y=n),void 0!==a&&function(t,e,n=1,r=0,o=!0){t.pathLength=1;const a=o?mt:dt;t[a.offset]=J.transform(-r);const i=J.transform(e),s=J.transform(n);t[a.array]=`${i} ${s}`}(m,a,i,s,!1)}const gt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}}),yt=t=>"string"==typeof t&&"svg"===t.toLowerCase();function ht(t,e,n,r){const o=c(()=>{const n={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return pt(n,e,{enableHardwareAcceleration:!1},yt(r),t.transformTemplate),{...n.attrs,style:{...n.style}}},[e]);if(t.style){const e={};ot(e,t.style,t),o.style={...e,...o.style}}return o}function vt(t=!1){return(e,n,r,o,{latestValues:a},i)=>{const s=(X(e)?ht:it)(n,a,i,e),l={...function(t,e,n){const r={};for(const o in t)"values"===o&&"object"==typeof t.values||(lt(o)||!0===n&&ct(o)||!e&&!ct(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(n,"string"==typeof e,t),...s,ref:o},{children:f}=n,m=c(()=>j(f)?f.get():f,[f]);return r&&(l["data-projection-id"]=r),u(e,{...l,children:m})}}const wt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function bt(t,e,n,r){!function(t,{style:e,vars:n},r,o){Object.assign(t.style,e,o&&o.getProjectionStyles(r));for(const e in n)t.style.setProperty(e,n[e])}(t,e,void 0,r);for(const n in e.attrs)t.setAttribute(wt.has(n)?n:n.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase(),e.attrs[n])}function xt(t,e){const{style:n}=t,r={};for(const o in n)(j(n[o])||e.style&&j(e.style[o])||$(o,t))&&(r[o]=n[o]);return r}function St(t){const e=j(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const Vt=t=>(e,r)=>{const o=n(m),a=n(d),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,o,a){const i={latestValues:At(r,o,a,t),renderState:e()};return n&&(i.mount=t=>n(r,t,i)),i}(t,e,o,a);return r?i():k(i)};function At(t,e,n,r){const o={},a=r(t,{});for(const t in a)o[t]=St(a[t]);let{initial:i,animate:s}=t;const c=S(t),l=function(t){return Boolean(S(t)||t.variants)}(t);e&&l&&!c&&!1!==t.inherit&&(void 0===i&&(i=e.initial),void 0===s&&(s=e.animate));let u=!!n&&!1===n.initial;u=u||!1===i;const f=u?s:i;if(f&&"boolean"!=typeof f&&!b(f)){(Array.isArray(f)?f:[f]).forEach(e=>{const n=function(t,e,n,r={},o={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,o)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,o)),e}(t,e);if(!n)return;const{transitionEnd:r,transition:a,...i}=n;for(const t in i){let e=i[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(o[t]=e)}for(const t in r)o[t]=r[t]})}return o}const Et={useVisualState:Vt({scrapeMotionValuesFromProps:function(t,e){const n=xt(t,e);for(const r in t)if(j(t[r])||j(e[r])){n["x"===r||"y"===r?"attr"+r.toUpperCase():r]=t[r]}return n},createRenderState:gt,onMount:(t,e,{renderState:n,latestValues:r})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}pt(n,r,{enableHardwareAcceleration:!1},yt(e.tagName),t.transformTemplate),bt(e,n)}})},Tt={useVisualState:Vt({scrapeMotionValuesFromProps:xt,createRenderState:rt})};const kt=function(t){function e(e,n={}){return B(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,r)=>(n.has(r)||n.set(r,e(r)),n.get(r))})}((function(t,{forwardMotionProps:e=!1},n,r){return{...X(t)?Et:Tt,preloadedFeatures:n,useRender:vt(e),createVisualElement:r,Component:t}}));export{kt as m};