@naisutech/react-tree
Version:
a hierarchical tree component for React written in Typescript
1 lines • 114 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("react"),require("styled-components")):"function"==typeof define&&define.amd?define(["exports","react","styled-components"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).ReactTree={},t.React,t.styled)}(this,(function(t,e,n){"use strict";function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}function i(t){if(t&&t.__esModule)return t;var e=Object.create(null);return t&&Object.keys(t).forEach((function(n){if("default"!==n){var o=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,o.get?o:{enumerable:!0,get:function(){return t[n]}})}})),e.default=t,Object.freeze(e)}var r=o(e),s=i(e),a=o(n),l=function(){return l=Object.assign||function(t){for(var e,n=1,o=arguments.length;n<o;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},l.apply(this,arguments)};function c(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n}function u(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var o,i,r=n.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(o=r.next()).done;)s.push(o.value)}catch(t){i={error:t}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(i)throw i.error}}return s}function d(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}const h=e.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),p=e.createContext({});const m=e.createContext(null),f="undefined"!=typeof document,g=f?e.useLayoutEffect:e.useEffect,v=e.createContext({strict:!1});function y(t,n,o,i){const r=e.useContext(p).visualElement,s=e.useContext(v),a=e.useContext(m),l=e.useContext(h).reducedMotion,c=e.useRef(void 0);i=i||s.renderer,!c.current&&i&&(c.current=i(t,{visualState:n,parent:r,props:o,presenceId:a?a.id:void 0,blockInitialAnimation:!!a&&!1===a.initial,reducedMotionConfig:l}));const u=c.current;return g((()=>{u&&u.syncRender()})),e.useEffect((()=>{u&&u.animationState&&u.animationState.animateChanges()})),g((()=>()=>u&&u.notifyUnmount()),[]),u}function x(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function b(t){return"string"==typeof t||Array.isArray(t)}function w(t){return"object"==typeof t&&"function"==typeof t.start}const E=["initial","animate","exit","whileHover","whileDrag","whileTap","whileFocus","whileInView"];function S(t){return w(t.animate)||E.some((e=>b(t[e])))}function T(t){return Boolean(S(t)||t.variants)}function C(t){const{initial:n,animate:o}=function(t,e){if(S(t)){const{initial:e,animate:n}=t;return{initial:!1===e||b(e)?e:void 0,animate:b(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,e.useContext(p));return e.useMemo((()=>({initial:n,animate:o})),[A(n),A(o)])}function A(t){return Array.isArray(t)?t.join(" "):t}const P=t=>({isEnabled:e=>t.some((t=>!!e[t]))}),V={measureLayout:P(["layout","layoutId","drag"]),animation:P(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView"]),exit:P(["exit"]),drag:P(["drag","dragControls"]),focus:P(["whileFocus"]),hover:P(["whileHover","onHoverStart","onHoverEnd"]),tap:P(["whileTap","onTap","onTapStart","onTapCancel"]),pan:P(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),inView:P(["whileInView","onViewportEnter","onViewportLeave"])};function L(t){for(const e in t)"projectionNodeConstructor"===e?V.projectionNodeConstructor=t[e]:V[e].Component=t[e]}function M(t){const n=e.useRef(null);return null===n.current&&(n.current=t()),n.current}const R={hasAnimatedSinceResize:!0,hasEverUpdated:!1};let O=1;const k=e.createContext({});class D extends r.default.Component{getSnapshotBeforeUpdate(){const{visualElement:t,props:e}=this.props;return t&&t.setProps(e),null}componentDidUpdate(){}render(){return this.props.children}}const j=e.createContext({}),I=Symbol.for("motionComponentSymbol");function N({preloadedFeatures:t,createVisualElement:n,projectionNodeConstructor:o,useRender:i,useVisualState:r,Component:a}){t&&L(t);const l=e.forwardRef((function(l,c){const u={...e.useContext(h),...l,layoutId:$(l)},{isStatic:d}=u;let m=null;const g=C(l),b=d?void 0:M((()=>{if(R.hasEverUpdated)return O++})),w=r(l,d);if(!d&&f){g.visualElement=y(a,w,u,n);const i=e.useContext(v).strict,r=e.useContext(j);g.visualElement&&(m=g.visualElement.loadFeatures(u,i,t,b,o||V.projectionNodeConstructor,r))}return s.createElement(D,{visualElement:g.visualElement,props:u},m,s.createElement(p.Provider,{value:g},i(a,l,b,function(t,n,o){return e.useCallback((e=>{e&&t.mount&&t.mount(e),n&&(e?n.mount(e):n.unmount()),o&&("function"==typeof o?o(e):x(o)&&(o.current=e))}),[n])}(w,g.visualElement,c),w,d,g.visualElement)))}));return l[I]=a,l}function $({layoutId:t}){const n=e.useContext(k).id;return n&&void 0!==t?n+"-"+t:t}function F(t){function e(e,n={}){return N(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,o)=>(n.has(o)||n.set(o,e(o)),n.get(o))})}const B=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function U(t){return"string"==typeof t&&!t.includes("-")&&!!(B.indexOf(t)>-1||/[A-Z]/.test(t))}const z={};const H=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Y=new Set(H);function W(t,{layout:e,layoutId:n}){return Y.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!z[t]||"opacity"===t)}const X=t=>!!(null==t?void 0:t.getVelocity),G={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},q=(t,e)=>H.indexOf(t)-H.indexOf(e);function K(t){return t.startsWith("--")}const Z=(t,e)=>e&&"number"==typeof t?e.transform(t):t,_=(t,e)=>n=>Math.max(Math.min(n,e),t),J=t=>t%1?Number(t.toFixed(5)):t,Q=/(-)?([\d]*\.?[\d])+/g,tt=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,et=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function nt(t){return"string"==typeof t}const ot={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},it=Object.assign(Object.assign({},ot),{transform:_(0,1)}),rt=Object.assign(Object.assign({},ot),{default:1}),st=t=>({test:e=>nt(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),at=st("deg"),lt=st("%"),ct=st("px"),ut=st("vh"),dt=st("vw"),ht=Object.assign(Object.assign({},lt),{parse:t=>lt.parse(t)/100,transform:t=>lt.transform(100*t)}),pt=(t,e)=>n=>Boolean(nt(n)&&et.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),mt=(t,e,n)=>o=>{if(!nt(o))return o;const[i,r,s,a]=o.match(Q);return{[t]:parseFloat(i),[e]:parseFloat(r),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ft={test:pt("hsl","hue"),parse:mt("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:o=1})=>"hsla("+Math.round(t)+", "+lt.transform(J(e))+", "+lt.transform(J(n))+", "+J(it.transform(o))+")"},gt=_(0,255),vt=Object.assign(Object.assign({},ot),{transform:t=>Math.round(gt(t))}),yt={test:pt("rgb","red"),parse:mt("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:o=1})=>"rgba("+vt.transform(t)+", "+vt.transform(e)+", "+vt.transform(n)+", "+J(it.transform(o))+")"};const xt={test:pt("#"),parse:function(t){let e="",n="",o="",i="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),i=t.substr(4,1),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:yt.transform},bt={test:t=>yt.test(t)||xt.test(t)||ft.test(t),parse:t=>yt.test(t)?yt.parse(t):ft.test(t)?ft.parse(t):xt.parse(t),transform:t=>nt(t)?t:t.hasOwnProperty("red")?yt.transform(t):ft.transform(t)},wt="${c}",Et="${n}";function St(t){"number"==typeof t&&(t=`${t}`);const e=[];let n=0;const o=t.match(tt);o&&(n=o.length,t=t.replace(tt,wt),e.push(...o.map(bt.parse)));const i=t.match(Q);return i&&(t=t.replace(Q,Et),e.push(...i.map(ot.parse))),{values:e,numColors:n,tokenised:t}}function Tt(t){return St(t).values}function Ct(t){const{values:e,numColors:n,tokenised:o}=St(t),i=e.length;return t=>{let e=o;for(let o=0;o<i;o++)e=e.replace(o<n?wt:Et,o<n?bt.transform(t[o]):J(t[o]));return e}}const At=t=>"number"==typeof t?0:t;const Pt={test:function(t){var e,n,o,i;return isNaN(t)&&nt(t)&&(null!==(n=null===(e=t.match(Q))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(i=null===(o=t.match(tt))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:Tt,createTransformer:Ct,getAnimatableNone:function(t){const e=Tt(t);return Ct(t)(e.map(At))}},Vt=new Set(["brightness","contrast","saturate","opacity"]);function Lt(t){let[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[o]=n.match(Q)||[];if(!o)return t;const i=n.replace(o,"");let r=Vt.has(e)?1:0;return o!==n&&(r*=100),e+"("+r+i+")"}const Mt=/([a-z-]*)\(.*?\)/g,Rt=Object.assign(Object.assign({},Pt),{getAnimatableNone:t=>{const e=t.match(Mt);return e?e.map(Lt).join(" "):t}}),Ot={...ot,transform:Math.round},kt={borderWidth:ct,borderTopWidth:ct,borderRightWidth:ct,borderBottomWidth:ct,borderLeftWidth:ct,borderRadius:ct,radius:ct,borderTopLeftRadius:ct,borderTopRightRadius:ct,borderBottomRightRadius:ct,borderBottomLeftRadius:ct,width:ct,maxWidth:ct,height:ct,maxHeight:ct,size:ct,top:ct,right:ct,bottom:ct,left:ct,padding:ct,paddingTop:ct,paddingRight:ct,paddingBottom:ct,paddingLeft:ct,margin:ct,marginTop:ct,marginRight:ct,marginBottom:ct,marginLeft:ct,rotate:at,rotateX:at,rotateY:at,rotateZ:at,scale:rt,scaleX:rt,scaleY:rt,scaleZ:rt,skew:at,skewX:at,skewY:at,distance:ct,translateX:ct,translateY:ct,translateZ:ct,x:ct,y:ct,z:ct,perspective:ct,transformPerspective:ct,opacity:it,originX:ht,originY:ht,originZ:ct,zIndex:Ot,fillOpacity:it,strokeOpacity:it,numOctaves:Ot};function Dt(t,e,n,o){const{style:i,vars:r,transform:s,transformKeys:a,transformOrigin:l}=t;a.length=0;let c=!1,u=!1,d=!0;for(const t in e){const n=e[t];if(K(t)){r[t]=n;continue}const o=kt[t],h=Z(n,o);if(Y.has(t)){if(c=!0,s[t]=h,a.push(t),!d)continue;n!==(o.default||0)&&(d=!1)}else t.startsWith("origin")?(u=!0,l[t]=h):i[t]=h}if(e.transform||(c||o?i.transform=function({transform:t,transformKeys:e},{enableHardwareAcceleration:n=!0,allowTransformNone:o=!0},i,r){let s="";e.sort(q);for(const n of e)s+=`${G[n]||n}(${t[n]}) `;return n&&!t.z&&(s+="translateZ(0)"),s=s.trim(),r?s=r(t,i?"":s):o&&i&&(s="none"),s}(t,n,d,o):i.transform&&(i.transform="none")),u){const{originX:t="50%",originY:e="50%",originZ:n=0}=l;i.transformOrigin=`${t} ${e} ${n}`}}const jt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}});function It(t,e,n){for(const o in e)X(e[o])||W(o,n)||(t[o]=e[o])}function Nt(t,n,o){const i={};return It(i,t.style||{},t),Object.assign(i,function({transformTemplate:t},n,o){return e.useMemo((()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};return Dt(e,n,{enableHardwareAcceleration:!o},t),Object.assign({},e.vars,e.style)}),[n])}(t,n,o)),t.transformValues?t.transformValues(i):i}function $t(t,e,n){const o={},i=Nt(t,e,n);return t.drag&&!1!==t.dragListener&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}const Ft=new Set(["initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","layoutDependency","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","dragSnapToOrigin","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","onHoverStart","onHoverEnd","layoutScroll","whileInView","onViewportEnter","onViewportLeave","viewport","whileTap","onTap","onTapStart","onTapCancel","animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag","whileInView","onPan","onPanStart","onPanSessionStart","onPanEnd"]);function Bt(t){return Ft.has(t)}let Ut=t=>!Bt(t);try{(zt=require("@emotion/is-prop-valid").default)&&(Ut=t=>t.startsWith("on")?!Bt(t):zt(t))}catch(t){}var zt;function Ht(t,e,n){return"string"==typeof t?t:ct.transform(e+n*t)}const Yt={offset:"stroke-dashoffset",array:"stroke-dasharray"},Wt={offset:"strokeDashoffset",array:"strokeDasharray"};function Xt(t,{attrX:e,attrY:n,originX:o,originY:i,pathLength:r,pathSpacing:s=1,pathOffset:a=0,...l},c,u){Dt(t,l,c,u),t.attrs=t.style,t.style={};const{attrs:d,style:h,dimensions:p}=t;d.transform&&(p&&(h.transform=d.transform),delete d.transform),p&&(void 0!==o||void 0!==i||h.transform)&&(h.transformOrigin=function(t,e,n){return`${Ht(e,t.x,t.width)} ${Ht(n,t.y,t.height)}`}(p,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==e&&(d.x=e),void 0!==n&&(d.y=n),void 0!==r&&function(t,e,n=1,o=0,i=!0){t.pathLength=1;const r=i?Yt:Wt;t[r.offset]=ct.transform(-o);const s=ct.transform(e),a=ct.transform(n);t[r.array]=`${s} ${a}`}(d,r,s,a,!1)}const Gt=()=>({style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}});function qt(t,n){const o=e.useMemo((()=>{const e={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{},attrs:{}};return Xt(e,n,{enableHardwareAcceleration:!1},t.transformTemplate),{...e.attrs,style:{...e.style}}}),[n]);if(t.style){const e={};It(e,t.style,t),o.style={...e,...o.style}}return o}function Kt(t=!1){return(n,o,i,r,{latestValues:s},a)=>{const l=(U(n)?qt:$t)(o,s,a),c=function(t,e,n){const o={};for(const i in t)(Ut(i)||!0===n&&Bt(i)||!e&&!Bt(i)||t.draggable&&i.startsWith("onDrag"))&&(o[i]=t[i]);return o}(o,"string"==typeof n,t),u={...c,...l,ref:r};return i&&(u["data-projection-id"]=i),e.createElement(n,u)}}const Zt=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function _t(t,{style:e,vars:n},o,i){Object.assign(t.style,e,i&&i.getProjectionStyles(o));for(const e in n)t.style.setProperty(e,n[e])}const Jt=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength"]);function Qt(t,e,n,o){_t(t,e,void 0,o);for(const n in e.attrs)t.setAttribute(Jt.has(n)?n:Zt(n),e.attrs[n])}function te(t){const{style:e}=t,n={};for(const o in e)(X(e[o])||W(o,t))&&(n[o]=e[o]);return n}function ee(t){const e=te(t);for(const n in t)if(X(t[n])){e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function ne(t,e,n,o={},i={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,o,i)),e}const oe=t=>Array.isArray(t),ie=t=>oe(t)?t[t.length-1]||0:t;function re(t){const e=X(t)?t.get():t;return n=e,Boolean(n&&"object"==typeof n&&n.mix&&n.toValue)?e.toValue():e;var n}const se=t=>(n,o)=>{const i=e.useContext(p),r=e.useContext(m),s=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},o,i,r){const s={latestValues:ae(o,i,r,t),renderState:e()};return n&&(s.mount=t=>n(o,t,s)),s}(t,n,i,r);return o?s():M(s)};function ae(t,e,n,o){const i={},r=o(t);for(const t in r)i[t]=re(r[t]);let{initial:s,animate:a}=t;const l=S(t),c=T(t);e&&c&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let u=!!n&&!1===n.initial;u=u||!1===s;const d=u?a:s;if(d&&"boolean"!=typeof d&&!w(d)){(Array.isArray(d)?d:[d]).forEach((e=>{const n=ne(t,e);if(!n)return;const{transitionEnd:o,transition:r,...s}=n;for(const t in s){let e=s[t];if(Array.isArray(e)){e=e[u?e.length-1:0]}null!==e&&(i[t]=e)}for(const t in o)i[t]=o[t]}))}return i}const le={useVisualState:se({scrapeMotionValuesFromProps:ee,createRenderState:Gt,onMount:(t,e,{renderState:n,latestValues:o})=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}Xt(n,o,{enableHardwareAcceleration:!1},t.transformTemplate),Qt(e,n)}})},ce={useVisualState:se({scrapeMotionValuesFromProps:te,createRenderState:jt})};var ue;function de(t,e,n,o={passive:!0}){return t.addEventListener(e,n,o),()=>t.removeEventListener(e,n)}function he(t,n,o,i){e.useEffect((()=>{const e=t.current;if(o&&e)return de(e,n,o,i)}),[t,n,o,i])}function pe(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function me(t){return!!t.touches}!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.InView="whileInView",t.Exit="exit"}(ue||(ue={}));const fe={pageX:0,pageY:0};function ge(t,e="page"){const n=t.touches[0]||t.changedTouches[0]||fe;return{x:n[e+"X"],y:n[e+"Y"]}}function ve(t,e="page"){return{x:t[e+"X"],y:t[e+"Y"]}}function ye(t,e="page"){return{point:me(t)?ge(t,e):ve(t,e)}}const xe=(t,e=!1)=>{const n=e=>t(e,ye(e));return e?(o=n,t=>{const e=t instanceof MouseEvent;(!e||e&&0===t.button)&&o(t)}):n;var o},be={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},we={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function Ee(t){return f&&null===window.onpointerdown?t:f&&null===window.ontouchstart?we[t]:f&&null===window.onmousedown?be[t]:t}function Se(t,e,n,o){return de(t,Ee(e),xe(n,"pointerdown"===e),o)}function Te(t,e,n,o){return he(t,Ee(e),n&&xe(n,"pointerdown"===e),o)}function Ce(t){let e=null;return()=>{const n=()=>{e=null};return null===e&&(e=t,n)}}const Ae=Ce("dragHorizontal"),Pe=Ce("dragVertical");function Ve(t){let e=!1;if("y"===t)e=Pe();else if("x"===t)e=Ae();else{const t=Ae(),n=Pe();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function Le(){const t=Ve(!0);return!t||(t(),!1)}function Me(t,e,n){return(o,i)=>{pe(o)&&!Le()&&(t.animationState&&t.animationState.setActive(ue.Hover,e),n&&n(o,i))}}const Re=(t,e)=>!!e&&(t===e||Re(t,e.parentElement));function Oe(t){return e.useEffect((()=>()=>t()),[])}var ke=function(){},De=function(){};"production"!==process.env.NODE_ENV&&(ke=function(t,e){t||"undefined"==typeof console||console.warn(e)},De=function(t,e){if(!t)throw new Error(e)});const je=(t,e,n)=>Math.min(Math.max(n,t),e),Ie=.001;function Ne({duration:t=800,bounce:e=.25,velocity:n=0,mass:o=1}){let i,r;ke(t<=1e4,"Spring duration must be 10 seconds or less");let s=1-e;s=je(.05,1,s),t=je(.01,10,t/1e3),s<1?(i=e=>{const o=e*s,i=o*t,r=o-n,a=$e(e,s),l=Math.exp(-i);return Ie-r/a*l},r=e=>{const o=e*s*t,r=o*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-o),c=$e(Math.pow(e,2),s);return(-i(e)+Ie>0?-1:1)*((r-a)*l)/c}):(i=e=>Math.exp(-e*t)*((e-n)*t+1)-.001,r=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let o=n;for(let n=1;n<12;n++)o-=t(o)/e(o);return o}(i,r,5/t);if(t*=1e3,isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*o;return{stiffness:e,damping:2*s*Math.sqrt(o*e),duration:t}}}function $e(t,e){return t*Math.sqrt(1-e*e)}const Fe=["duration","bounce"],Be=["stiffness","damping","mass"];function Ue(t,e){return e.some((e=>void 0!==t[e]))}function ze(t){var{from:e=0,to:n=1,restSpeed:o=2,restDelta:i}=t,r=c(t,["from","to","restSpeed","restDelta"]);const s={done:!1,value:e};let{stiffness:a,damping:l,mass:u,velocity:d,duration:h,isResolvedFromDuration:p}=function(t){let e=Object.assign({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Ue(t,Be)&&Ue(t,Fe)){const n=Ne(t);e=Object.assign(Object.assign(Object.assign({},e),n),{velocity:0,mass:1}),e.isResolvedFromDuration=!0}return e}(r),m=He,f=He;function g(){const t=d?-d/1e3:0,o=n-e,r=l/(2*Math.sqrt(a*u)),s=Math.sqrt(a/u)/1e3;if(void 0===i&&(i=Math.min(Math.abs(n-e)/100,.4)),r<1){const e=$e(s,r);m=i=>{const a=Math.exp(-r*s*i);return n-a*((t+r*s*o)/e*Math.sin(e*i)+o*Math.cos(e*i))},f=n=>{const i=Math.exp(-r*s*n);return r*s*i*(Math.sin(e*n)*(t+r*s*o)/e+o*Math.cos(e*n))-i*(Math.cos(e*n)*(t+r*s*o)-e*o*Math.sin(e*n))}}else if(1===r)m=e=>n-Math.exp(-s*e)*(o+(t+s*o)*e);else{const e=s*Math.sqrt(r*r-1);m=i=>{const a=Math.exp(-r*s*i),l=Math.min(e*i,300);return n-a*((t+r*s*o)*Math.sinh(l)+e*o*Math.cosh(l))/e}}}return g(),{next:t=>{const e=m(t);if(p)s.done=t>=h;else{const r=1e3*f(t),a=Math.abs(r)<=o,l=Math.abs(n-e)<=i;s.done=a&&l}return s.value=s.done?n:e,s},flipTarget:()=>{d=-d,[e,n]=[n,e],g()}}}ze.needsInterpolation=(t,e)=>"string"==typeof t||"string"==typeof e;const He=t=>0,Ye=(t,e,n)=>{const o=e-t;return 0===o?1:(n-t)/o},We=(t,e,n)=>-n*t+n*e+t;function Xe(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function Ge({hue:t,saturation:e,lightness:n,alpha:o}){t/=360,n/=100;let i=0,r=0,s=0;if(e/=100){const o=n<.5?n*(1+e):n+e-n*e,a=2*n-o;i=Xe(a,o,t+1/3),r=Xe(a,o,t),s=Xe(a,o,t-1/3)}else i=r=s=n;return{red:Math.round(255*i),green:Math.round(255*r),blue:Math.round(255*s),alpha:o}}const qe=(t,e,n)=>{const o=t*t,i=e*e;return Math.sqrt(Math.max(0,n*(i-o)+o))},Ke=[xt,yt,ft],Ze=t=>Ke.find((e=>e.test(t))),_e=t=>`'${t}' is not an animatable color. Use the equivalent color code instead.`,Je=(t,e)=>{let n=Ze(t),o=Ze(e);De(!!n,_e(t)),De(!!o,_e(e));let i=n.parse(t),r=o.parse(e);n===ft&&(i=Ge(i),n=yt),o===ft&&(r=Ge(r),o=yt);const s=Object.assign({},i);return t=>{for(const e in s)"alpha"!==e&&(s[e]=qe(i[e],r[e],t));return s.alpha=We(i.alpha,r.alpha,t),n.transform(s)}},Qe=t=>"number"==typeof t,tn=(t,e)=>n=>e(t(n)),en=(...t)=>t.reduce(tn);function nn(t,e){return Qe(t)?n=>We(t,e,n):bt.test(t)?Je(t,e):an(t,e)}const on=(t,e)=>{const n=[...t],o=n.length,i=t.map(((t,n)=>nn(t,e[n])));return t=>{for(let e=0;e<o;e++)n[e]=i[e](t);return n}},rn=(t,e)=>{const n=Object.assign(Object.assign({},t),e),o={};for(const i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=nn(t[i],e[i]));return t=>{for(const e in o)n[e]=o[e](t);return n}};function sn(t){const e=Pt.parse(t),n=e.length;let o=0,i=0,r=0;for(let t=0;t<n;t++)o||"number"==typeof e[t]?o++:void 0!==e[t].hue?r++:i++;return{parsed:e,numNumbers:o,numRGB:i,numHSL:r}}const an=(t,e)=>{const n=Pt.createTransformer(e),o=sn(t),i=sn(e);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&o.numNumbers>=i.numNumbers?en(on(o.parsed,i.parsed),n):(ke(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),n=>`${n>0?e:t}`)},ln=(t,e)=>n=>We(t,e,n);function cn(t,e,n){const o=[],i=n||("number"==typeof(r=t[0])?ln:"string"==typeof r?bt.test(r)?Je:an:Array.isArray(r)?on:"object"==typeof r?rn:void 0);var r;const s=t.length-1;for(let n=0;n<s;n++){let r=i(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]:e;r=en(t,r)}o.push(r)}return o}function un(t,e,{clamp:n=!0,ease:o,mixer:i}={}){const r=t.length;De(r===e.length,"Both input and output ranges must be the same length"),De(!o||!Array.isArray(o)||o.length===r-1,"Array of easing functions must be of length `input.length - 1`, as it applies to the transitions **between** the defined values."),t[0]>t[r-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());const s=cn(e,o,i),a=2===r?function([t,e],[n]){return o=>n(Ye(t,e,o))}(t,s):function(t,e){const n=t.length,o=n-1;return i=>{let r=0,s=!1;if(i<=t[0]?s=!0:i>=t[o]&&(r=o-1,s=!0),!s){let e=1;for(;e<n&&!(t[e]>i||e===o);e++);r=e-1}const a=Ye(t[r],t[r+1],i);return e[r](a)}}(t,s);return n?e=>a(je(t[0],t[r-1],e)):a}const dn=t=>e=>1-t(1-e),hn=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,pn=t=>e=>e*e*((t+1)*e-t),mn=t=>t,fn=(gn=2,t=>Math.pow(t,gn));var gn;const vn=dn(fn),yn=hn(fn),xn=t=>1-Math.sin(Math.acos(t)),bn=dn(xn),wn=hn(bn),En=pn(1.525),Sn=dn(En),Tn=hn(En),Cn=(t=>{const e=pn(t);return t=>(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))})(1.525),An=t=>{if(1===t||0===t)return t;const e=t*t;return t<.36363636363636365?7.5625*e:t<.7272727272727273?9.075*e-9.9*t+3.4:t<.9?12.066481994459833*e-19.63545706371191*t+8.898060941828255:10.8*t*t-20.52*t+10.72},Pn=dn(An);function Vn(t,e){return t.map((()=>e||yn)).splice(0,t.length-1)}function Ln({from:t=0,to:e=1,ease:n,offset:o,duration:i=300}){const r={done:!1,value:t},s=Array.isArray(e)?e:[t,e],a=function(t,e){return t.map((t=>t*e))}(o&&o.length===s.length?o:function(t){const e=t.length;return t.map(((t,n)=>0!==n?n/(e-1):0))}(s),i);function l(){return un(a,s,{ease:Array.isArray(n)?n:Vn(s,n)})}let c=l();return{next:t=>(r.value=c(t),r.done=t>=i,r),flipTarget:()=>{s.reverse(),c=l()}}}const Mn={keyframes:Ln,spring:ze,decay:function({velocity:t=0,from:e=0,power:n=.8,timeConstant:o=350,restDelta:i=.5,modifyTarget:r}){const s={done:!1,value:e};let a=n*t;const l=e+a,c=void 0===r?l:r(l);return c!==l&&(a=c-e),{next:t=>{const e=-a*Math.exp(-t/o);return s.done=!(e>i||e<-i),s.value=s.done?c:c+e,s},flipTarget:()=>{}}}};const Rn=1/60*1e3,On="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),kn="undefined"!=typeof window?t=>window.requestAnimationFrame(t):t=>setTimeout((()=>t(On())),Rn);let Dn=!0,jn=!1,In=!1;const Nn={delta:0,timestamp:0},$n=["read","update","preRender","render","postRender"],Fn=$n.reduce(((t,e)=>(t[e]=function(t){let e=[],n=[],o=0,i=!1,r=!1;const s=new WeakSet,a={schedule:(t,r=!1,a=!1)=>{const l=a&&i,c=l?e:n;return r&&s.add(t),-1===c.indexOf(t)&&(c.push(t),l&&i&&(o=e.length)),t},cancel:t=>{const e=n.indexOf(t);-1!==e&&n.splice(e,1),s.delete(t)},process:l=>{if(i)r=!0;else{if(i=!0,[e,n]=[n,e],n.length=0,o=e.length,o)for(let n=0;n<o;n++){const o=e[n];o(l),s.has(o)&&(a.schedule(o),t())}i=!1,r&&(r=!1,a.process(l))}}};return a}((()=>jn=!0)),t)),{}),Bn=$n.reduce(((t,e)=>{const n=Fn[e];return t[e]=(t,e=!1,o=!1)=>(jn||Wn(),n.schedule(t,e,o)),t}),{}),Un=$n.reduce(((t,e)=>(t[e]=Fn[e].cancel,t)),{}),zn=$n.reduce(((t,e)=>(t[e]=()=>Fn[e].process(Nn),t)),{}),Hn=t=>Fn[t].process(Nn),Yn=t=>{jn=!1,Nn.delta=Dn?Rn:Math.max(Math.min(t-Nn.timestamp,40),1),Nn.timestamp=t,In=!0,$n.forEach(Hn),In=!1,jn&&(Dn=!1,kn(Yn))},Wn=()=>{jn=!0,Dn=!0,In||kn(Yn)},Xn=()=>Nn;function Gn(t,e,n=0){return t-e-n}const qn=t=>{const e=({delta:e})=>t(e);return{start:()=>Bn.update(e,!0),stop:()=>Un.update(e)}};function Kn(t){var e,n,{from:o,autoplay:i=!0,driver:r=qn,elapsed:s=0,repeat:a=0,repeatType:l="loop",repeatDelay:u=0,onPlay:d,onStop:h,onComplete:p,onRepeat:m,onUpdate:f}=t,g=c(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]);let v,y,x,{to:b}=g,w=0,E=g.duration,S=!1,T=!0;const C=function(t){if(Array.isArray(t.to))return Ln;if(Mn[t.type])return Mn[t.type];const e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Ln:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?ze:Ln}(g);(null===(n=(e=C).needsInterpolation)||void 0===n?void 0:n.call(e,o,b))&&(x=un([0,100],[o,b],{clamp:!1}),o=0,b=100);const A=C(Object.assign(Object.assign({},g),{from:o,to:b}));function P(){w++,"reverse"===l?(T=w%2==0,s=function(t,e,n=0,o=!0){return o?Gn(e+-t,e,n):e-(t-e)+n}(s,E,u,T)):(s=Gn(s,E,u),"mirror"===l&&A.flipTarget()),S=!1,m&&m()}function V(t){if(T||(t=-t),s+=t,!S){const t=A.next(Math.max(0,s));y=t.value,x&&(y=x(y)),S=T?t.done:s<=0}null==f||f(y),S&&(0===w&&(null!=E||(E=s)),w<a?function(t,e,n,o){return o?t>=e+n:t<=-n}(s,E,u,T)&&P():(v.stop(),p&&p()))}return i&&(null==d||d(),v=r(V),v.start()),{stop:()=>{null==h||h(),v.stop()}}}function Zn(t,e){return e?t*(1e3/e):0}const _n=t=>t.hasOwnProperty("x")&&t.hasOwnProperty("y"),Jn=t=>_n(t)&&t.hasOwnProperty("z"),Qn=(t,e)=>Math.abs(t-e);function to(t,e){if(Qe(t)&&Qe(e))return Qn(t,e);if(_n(t)&&_n(e)){const n=Qn(t.x,e.x),o=Qn(t.y,e.y),i=Jn(t)&&Jn(e)?Qn(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}const eo=(t,e)=>1-3*e+3*t,no=(t,e)=>3*e-6*t,oo=t=>3*t,io=(t,e,n)=>((eo(e,n)*t+no(e,n))*t+oo(e))*t,ro=(t,e,n)=>3*eo(e,n)*t*t+2*no(e,n)*t+oo(e);const so=.1;function ao(t,e,n,o){if(t===e&&n===o)return mn;const i=new Float32Array(11);for(let e=0;e<11;++e)i[e]=io(e*so,t,n);function r(e){let o=0,r=1;for(;10!==r&&i[r]<=e;++r)o+=so;--r;const s=o+(e-i[r])/(i[r+1]-i[r])*so,a=ro(s,t,n);return a>=.001?function(t,e,n,o){for(let i=0;i<8;++i){const i=ro(e,n,o);if(0===i)return e;e-=(io(e,n,o)-t)/i}return e}(e,s,t,n):0===a?s:function(t,e,n,o,i){let r,s,a=0;do{s=e+(n-e)/2,r=io(s,o,i)-t,r>0?n=s:e=s}while(Math.abs(r)>1e-7&&++a<10);return s}(e,o,o+so,t,n)}return t=>0===t||1===t?t:io(r(t),e,o)}const lo="production",co="undefined"==typeof process||void 0===process.env?lo:process.env.NODE_ENV||lo,uo=new Set;function ho(t,e,n){t||uo.has(e)||(console.warn(e),n&&console.warn(n),uo.add(e))}const po=new WeakMap,mo=new WeakMap,fo=t=>{const e=po.get(t.target);e&&e(t)},go=t=>{t.forEach(fo)};function vo(t,e,n){const o=function({root:t,...e}){const n=t||document;mo.has(n)||mo.set(n,{});const o=mo.get(n),i=JSON.stringify(e);return o[i]||(o[i]=new IntersectionObserver(go,{root:t,...e})),o[i]}(e);return po.set(t,n),o.observe(t),()=>{po.delete(t),o.unobserve(t)}}const yo={some:0,all:1};function xo(t,n,o,{root:i,margin:r,amount:s="some",once:a}){e.useEffect((()=>{if(!t)return;const e={root:null==i?void 0:i.current,rootMargin:r,threshold:"number"==typeof s?s:yo[s]};return vo(o.getInstance(),e,(t=>{const{isIntersecting:e}=t;if(n.isInView===e)return;if(n.isInView=e,a&&!e&&n.hasEnteredView)return;e&&(n.hasEnteredView=!0),o.animationState&&o.animationState.setActive(ue.InView,e);const i=o.getProps(),r=e?i.onViewportEnter:i.onViewportLeave;r&&r(t)}))}),[t,i,r,s])}function bo(t,n,o,{fallback:i=!0}){e.useEffect((()=>{t&&i&&("production"!==co&&ho(!1,"IntersectionObserver not available on this device. whileInView animations will trigger on mount."),requestAnimationFrame((()=>{n.hasEnteredView=!0;const{onViewportEnter:t}=o.getProps();t&&t(null),o.animationState&&o.animationState.setActive(ue.InView,!0)})))}),[t])}const wo=t=>e=>(t(e),null),Eo={inView:wo((function({visualElement:t,whileInView:n,onViewportEnter:o,onViewportLeave:i,viewport:r={}}){const s=e.useRef({hasEnteredView:!1,isInView:!1});let a=Boolean(n||o||i);r.once&&s.current.hasEnteredView&&(a=!1),("undefined"==typeof IntersectionObserver?bo:xo)(a,s.current,t,r)})),tap:wo((function({onTap:t,onTapStart:n,onTapCancel:o,whileTap:i,visualElement:r}){const s=t||n||o||i,a=e.useRef(!1),l=e.useRef(null),c={passive:!(n||t||o||m)};function u(){l.current&&l.current(),l.current=null}function d(){return u(),a.current=!1,r.animationState&&r.animationState.setActive(ue.Tap,!1),!Le()}function h(e,n){d()&&(Re(r.getInstance(),e.target)?t&&t(e,n):o&&o(e,n))}function p(t,e){d()&&o&&o(t,e)}function m(t,e){u(),a.current||(a.current=!0,l.current=en(Se(window,"pointerup",h,c),Se(window,"pointercancel",p,c)),r.animationState&&r.animationState.setActive(ue.Tap,!0),n&&n(t,e))}Te(r,"pointerdown",s?m:void 0,c),Oe(u)})),focus:wo((function({whileFocus:t,visualElement:e}){const{animationState:n}=e;he(e,"focus",t?()=>{n&&n.setActive(ue.Focus,!0)}:void 0),he(e,"blur",t?()=>{n&&n.setActive(ue.Focus,!1)}:void 0)})),hover:wo((function({onHoverStart:t,onHoverEnd:e,whileHover:n,visualElement:o}){Te(o,"pointerenter",t||n?Me(o,!0,t):void 0,{passive:!t}),Te(o,"pointerleave",e||n?Me(o,!1,e):void 0,{passive:!e})}))};function So(){const t=e.useContext(m);if(null===t)return[!0,null];const{isPresent:n,onExitComplete:o,register:i}=t,r=e.useId();e.useEffect((()=>i(r)),[]);return!n&&o?[!1,()=>o&&o(r)]:[!0]}function To(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}const Co=t=>1e3*t,Ao={linear:mn,easeIn:fn,easeInOut:yn,easeOut:vn,circIn:xn,circInOut:wn,circOut:bn,backIn:En,backInOut:Tn,backOut:Sn,anticipate:Cn,bounceIn:Pn,bounceInOut:t=>t<.5?.5*(1-An(1-2*t)):.5*An(2*t-1)+.5,bounceOut:An},Po=t=>{if(Array.isArray(t)){De(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,o,i]=t;return ao(e,n,o,i)}return"string"==typeof t?(De(void 0!==Ao[t],`Invalid easing type '${t}'`),Ao[t]):t},Vo=(t,e)=>"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Pt.test(e)||e.startsWith("url("))),Lo=()=>({type:"spring",stiffness:500,damping:25,restSpeed:10}),Mo=t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}),Ro=()=>({type:"keyframes",ease:"linear",duration:.3}),Oo=t=>({type:"keyframes",duration:.8,values:t}),ko={x:Lo,y:Lo,z:Lo,rotate:Lo,rotateX:Lo,rotateY:Lo,rotateZ:Lo,scaleX:Mo,scaleY:Mo,scale:Mo,opacity:Ro,backgroundColor:Ro,color:Ro,default:Mo},Do=(t,e)=>{let n;return n=oe(e)?Oo:ko[t]||ko.default,{to:e,...n(e)}},jo={...kt,color:bt,backgroundColor:bt,outlineColor:bt,fill:bt,stroke:bt,borderColor:bt,borderTopColor:bt,borderRightColor:bt,borderBottomColor:bt,borderLeftColor:bt,filter:Rt,WebkitFilter:Rt},Io=t=>jo[t];function No(t,e){var n;let o=Io(t);return o!==Rt&&(o=Pt),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}const $o=!1;let Fo=!1;function Bo({ease:t,times:e,yoyo:n,flip:o,loop:i,...r}){const s={...r};return e&&(s.offset=e),r.duration&&(s.duration=Co(r.duration)),r.repeatDelay&&(s.repeatDelay=Co(r.repeatDelay)),t&&(s.ease=(t=>Array.isArray(t)&&"number"!=typeof t[0])(t)?t.map(Po):Po(t)),"tween"===r.type&&(s.type="keyframes"),(n||i||o)&&(ke(!Fo,"yoyo, loop and flip have been removed from the API. Replace with repeat and repeatType options."),Fo=!0,n?s.repeatType="reverse":i?s.repeatType="loop":o&&(s.repeatType="mirror"),s.repeat=i||n||o||r.repeat),"spring"!==r.type&&(s.type="keyframes"),s}function Uo(t,e,n){return Array.isArray(e.to)&&void 0===t.duration&&(t.duration=.8),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=[...t.to],t.to[0]=t.from)}(e),function({when:t,delay:e,delayChildren:n,staggerChildren:o,staggerDirection:i,repeat:r,repeatType:s,repeatDelay:a,from:l,...c}){return!!Object.keys(c).length}(t)||(t={...t,...Do(n,e.to)}),{...e,...Bo(t)}}function zo(t,e,n,o,i){const r=Wo(o,t)||{};let s=void 0!==r.from?r.from:e.get();const a=Vo(t,n);"none"===s&&a&&"string"==typeof n?s=No(t,n):Ho(s)&&"string"==typeof n?s=Yo(n):!Array.isArray(n)&&Ho(n)&&"string"==typeof s&&(n=Yo(s));const l=Vo(t,s);return ke(l===a,`You are trying to animate ${t} from "${s}" to "${n}". ${s} is not an animatable value - to enable this animation set ${s} to a value animatable to ${n} via the \`style\` property.`),l&&a&&!1!==r.type?function(){const o={from:s,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:t=>e.set(t)};return"inertia"===r.type||"decay"===r.type?function({from:t=0,velocity:e=0,min:n,max:o,power:i=.8,timeConstant:r=750,bounceStiffness:s=500,bounceDamping:a=10,restDelta:l=1,modifyTarget:c,driver:u,onUpdate:d,onComplete:h,onStop:p}){let m;function f(t){return void 0!==n&&t<n||void 0!==o&&t>o}function g(t){return void 0===n?o:void 0===o||Math.abs(n-t)<Math.abs(o-t)?n:o}function v(t){null==m||m.stop(),m=Kn(Object.assign(Object.assign({},t),{driver:u,onUpdate:e=>{var n;null==d||d(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:h,onStop:p}))}function y(t){v(Object.assign({type:"spring",stiffness:s,damping:a,restDelta:l},t))}if(f(t))y({from:t,velocity:e,to:g(t)});else{let o=i*e+t;void 0!==c&&(o=c(o));const s=g(o),a=s===n?-1:1;let u,d;const h=t=>{u=d,d=t,e=Zn(t-u,Xn().delta),(1===a&&t>s||-1===a&&t<s)&&y({from:t,to:s,velocity:e})};v({type:"decay",from:t,velocity:e,timeConstant:r,power:i,restDelta:l,modifyTarget:c,onUpdate:f(o)?h:void 0})}return{stop:()=>null==m?void 0:m.stop()}}({...o,...r}):Kn({...Uo(r,o,t),onUpdate:t=>{o.onUpdate(t),r.onUpdate&&r.onUpdate(t)},onComplete:()=>{o.onComplete(),r.onComplete&&r.onComplete()}})}:function(){const t=ie(n);return e.set(t),i(),r.onUpdate&&r.onUpdate(t),r.onComplete&&r.onComplete(),{stop:()=>{}}}}function Ho(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Yo(t){return"number"==typeof t?0:No("",t)}function Wo(t,e){return t[e]||t.default||t}function Xo(t,e,n,o={}){return $o&&(o={type:!1}),e.start((i=>{let r,s;const a=zo(t,e,n,o,i),l=function(t,e){var n,o;return null!==(o=null!==(n=(Wo(t,e)||{}).delay)&&void 0!==n?n:t.delay)&&void 0!==o?o:0}(o,t),c=()=>s=a();return l?r=window.setTimeout(c,Co(l)):c(),()=>{clearTimeout(r),s&&s.stop()}}))}const Go=t=>/^0[^.\s]+$/.test(t);function qo(t,e){-1===t.indexOf(e)&&t.push(e)}function Ko(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class Zo{constructor(){this.subscriptions=[]}add(t){return qo(this.subscriptions,t),()=>Ko(this.subscriptions,t)}notify(t,e,n){const o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(let i=0;i<o;i++){const o=this.subscriptions[i];o&&o(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}class _o{constructor(t){var e;this.version="7.5.0",this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Zo,this.velocityUpdateSubscribers=new Zo,this.renderSubscribers=new Zo,this.canTrackVelocity=!1,this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:o}=Xn();this.lastUpdated!==o&&(this.timeDelta=n,this.lastUpdated=o,Bn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.updateSubscribers.notify(this.current),this.velocityUpdateSubscribers.getSize()&&this.velocityUpdateSubscribers.notify(this.getVelocity()),e&&this.renderSubscribers.notify(this.current)},this.scheduleVelocityCheck=()=>Bn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.velocityUpdateSubscribers.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}onChange(t){return this.updateSubscribers.add(t)}clearListeners(){this.updateSubscribers.clear()}onRenderRequest(t){return t(this.get()),this.renderSubscribers.add(t)}attach(t){this.passiveEffect=t}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Zn(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.stopAnimation=t(e)})).then((()=>this.clearAnimation()))}stop(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()}isAnimating(){return!!this.stopAnimation}clearAnimation(){this.stopAnimation=null}destroy(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()}}function Jo(t){return new _o(t)}const Qo=t=>e=>e.test(t),ti=[ot,ct,lt,at,dt,ut,{test:t=>"auto"===t,parse:t=>t}],ei=t=>ti.find(Qo(t)),ni=[...ti,bt,Pt],oi=t=>ni.find(Qo(t));function ii(t,e,n){const o=t.getProps();return ne(o,e,void 0!==n?n:o.custom,function(t){const e={};return t.forEachValue(((t,n)=>e[n]=t.get())),e}(t),function(t){const e={};return t.forEachValue(((t,n)=>e[n]=t.getVelocity())),e}(t))}function ri(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Jo(n))}function si(t,e){if(!e)return;return(e[t]||e.default||e).from}function ai(t){return Boolean(X(t)&&t.add)}function li(t,e,n={}){var o;const i=ii(t,e,n.custom);let{transition:r=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const s=i?()=>ci(t,i,n):()=>Promise.resolve(),a=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?(o=0)=>{const{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=r;return function(t,e,n=0,o=0,i=1,r){const s=[],a=(t.variantChildren.size-1)*o,l=1===i?(t=0)=>t*o:(t=0)=>a-t*o;return Array.from(t.variantChildren).sort(ui).forEach(((t,o)=>{s.push(li(t,e,{...r,delay:n+l(o)}).then((()=>t.notifyAnimationComplete(e))))})),Promise.all(s)}(t,e,i+o,s,a,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[t,e]="beforeChildren"===l?[s,a]:[a,s];return t().then(e)}return Promise.all([s(),a(n.delay)])}function ci(t,e,{delay:n=0,transitionOverride:o,type:i}={}){var r;let{transition:s=t.getDefaultTransition(),transitionEnd:a,...l}=t.makeTargetAnimatable(e);const c=t.getValue("willChange");o&&(s=o);const u=[],d=i&&(null===(r=t.animationState)||void 0===r?void 0:r.getState()[i]);for(const e in l){const o=t.getValue(e),i=l[e];if(!o||void 0===i||d&&di(d,e))continue;let r={delay:n,...s};t.shouldReduceMotion&&Y.has(e)&&(r={...r,type:!1,delay:0});let a=Xo(e,o,i,r);ai(c)&&(c.add(e),a=a.then((()=>c.remove(e)))),u.push(a)}return Promise.all(u).then((()=>{a&&function(t,e){const n=ii(t,e);let{transitionEnd:o={},transition:i={},...r}=n?t.makeTargetAnimatable(n,!1):{};r={...r,...o};for(const e in r)ri(t,e,ie(r[e]))}(t,a)}))}function ui(t,e){return t.sortNodePosition(e)}function di({protectedKeys:t,needsAnimating:e},n){const o=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,o}const hi=[ue.Animate,ue.InView,ue.Focus,ue.Hover,ue.Tap,ue.Drag,ue.Exit],pi=[...hi].reverse(),mi=hi.length;function fi(t){return e=>Promise.all(e.map((({animation:e,options:n})=>function(t,e,n={}){let o;if(t.notifyAnimationStart(e),Array.isArray(e)){const i=e.map((e=>li(t,e,n)));o=Promise.all(i)}else if("string"==typeof e)o=li(t,e,n);else{const i="function"==typeof e?ii(t,e,n.custom):e;o=ci(t,i,n)}return o.then((()=>t.notifyAnimationComplete(e)))}(t,e,n))))}function gi(t){let e=fi(t);const n={[ue.Animate]:yi(!0),[ue.InView]:yi(),[ue.Hover]:yi(),[ue.Tap]:yi(),[ue.Drag]:yi(),[ue.Focus]:yi(),[ue.Exit]:yi()};let o=!0;const i=(e,n)=>{const o=ii(t,n);if(o){const{transition:t,transitionEnd:n,...i}=o;e={...e,...i,...n}}return e};function r(r,s){var a;const l=t.getProps(),c=t.getVariantContext(!0)||{},u=[],d=new Set;let h={},p=1/0;for(let e=0;e<mi;e++){const m=pi[e],f=n[m],g=null!==(a=l[m])&&void 0!==a?a:c[m],v=b(g),y=m===s?f.isActive:null;!1===y&&(p=e);let x=g===c[m]&&g!==l[m]&&v;if(x&&o&&t.manuallyAnimateOnMount&&(x=!1),f.protectedKeys={...h},!f.isActive&&null===y||!g&&!f.prevProp||w(g)||"boolean"==typeof g)continue;const E=vi(f.prevProp,g);let S=E||m===s&&f.isActive&&!x&&v||e>p&&v;const T=Array.isArray(g)?g:[g];let C=T.reduce(i,{});!1===y&&(C={});const{prevResolvedValues:A={}}=f,P={...A,...C},V=t=>{S=!0,d.delete(t),f.needsAnimating[t]=!0};for(const t in P){const e=C[t],n=A[t];h.hasOwnProperty(t)||(e!==n?oe(e)&&oe(n)?!To(e,n)||E?V(t):f.protectedKeys[t]=!0:void 0!==e?V(t):d.add(t):void 0!==e&&d.has(t)?V(t):f.protectedKeys[t]=!0)}f.prevProp=g,f.prevResolvedValues=C,f.isActive&&(h={...h,...C}),o&&t.blockInitialAnimation&&(S=!1),S&&!x&&u.push(...T.map((t=>({animation:t,options:{type:m,...r}}))))}if(d.size){const e={};d.forEach((n=>{const o=t.getBaseTarget(n);void 0!==o&&(e[n]=o)})),u.push({animation:e})}let m=Boolean(u.length);return o&&!1===l.initial&&!t.manuallyAnimateOnMount&&(m=!1),o=!1,m?e(u):Promise.resolve()}return{animateChanges:r,setActive:function(e,o,i){var s;if(n[e].isActive===o)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach((t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,o)})),n[e].isActive=o;const a=r(i,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function vi(t,e){return"string"==typeof e?e!==t:!!Array.isArray(e)&&!To(e,t)}function yi(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}const xi={animation:wo((({visualElement:t,animate:n})=>{t.animationState||(t.animationState=gi(t)),w(n)&&e.useEffect((()=>n.subscribe(t)),[n])})),exit:wo((t=>{const{custom:n,visualElement:o}=t,[i,r]=So(),s=e.useContext(m);e.useEffect((()=>{o.isPresent=i;const t=o.animationState&&o.animationState.setActive(ue.Exit,!i,{custom:s&&s.custom||n});t&&!i&&t.then(r)}),[i])}))};class bi{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=Si(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=to(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:o}=t,{timestamp:i}=Xn();this.history.push({...o,timestamp:i});const{onStart:r,onMove:s}=this.handlers;e||(r&&r(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=wi(e,this.transformPagePoint),pe(t)&&0===t.buttons?this.handlePointerUp(t,e):Bn.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{this.end();const{onEnd:n,onSessionEnd:o}=this.handlers,i=Si(wi(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,i),o&&o(t,i)},me(t)&&t.touches.length>1)return;this.handlers=e,this.transformPagePoint=n;const o=wi(ye(t),this.transformPagePoint),{point:i}=o,{timestamp:r}=Xn();this.history=[{...i,timestamp:r}];const{onSessionStart:s}=e;s&&s(t,Si(o,this.history)),this.removeListeners=en(Se(window,"pointermove",this.handlePointerMove),Se(window,"pointerup",this.handlePointerUp),Se(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),Un.update(this.updatePoint)}}function wi(t,e){return e?{point:e(t.point)}:t}function Ei(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Si({point:t},e){return{point:t,delta:Ei(t,Ci(e)),offset:Ei(t,Ti(e)),velocity:Ai(e,.1)}}function Ti(t){return t[0]}function Ci(t){return t[t.length-1]}function Ai(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,o=null;const i=Ci(t);for(;n>=0&&(o=t[n],!(i.timestamp-o.timestamp>Co(e)));)n--;if(!o)return{x:0,y:0};const r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};const s={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Pi(t){return t.max-t.min}function Vi(t,e=0,n=.01){return to(t,e)<n}function Li(t,e,n,o=.5){t.origin=o,t.originPoint=We(e.min,e.max,t.origin),t.scale=Pi(n)/Pi(e),(Vi(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=We(n.min,n.max,t.origin)-t.originPoint,(Vi(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Mi(t,e,n,o){Li(t.x,e.x,n.x,null==o?void 0:o.originX),Li(t.y,e.y,n.y,null==o?void 0:o.originY)}function Ri(t,e,n){t.min=n.min+e.min,t.max=t.min+Pi(e)}function Oi(t,e,n){t.min=e.min-n.min,t.max=t.min+Pi(e)}function ki(t,e,n){Oi(t.x,e.x,n.x),Oi(t.y,e.y,n.y)}function Di(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 ji(t,e){let n=e.min-t.min,o=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,o]=[o,n]),{min:n,max:o}}const Ii=.35;function Ni(t,e,n){return{min:$i(t,e),max:$i(t,n)}}function $i(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}function Fi(t){return[t("x"),t("y")]}function Bi({top:t,left:e,right:n,bottom:o}){return{x:{min:e,max:n},y:{min:t,max:o}}}function Ui(t){return void 0===t||1===t}function zi({scale:t,scaleX:e,scaleY:n}){return!Ui(t)||!Ui(e)||!Ui(n)}function Hi(t){return zi(t)||Yi(t.x)||Yi(t.y)||t.z||t.rotate||t.rotateX||t.rotateY}function Yi(t){return t&&"0%"!==t}function Wi(t,e,n){return n+e*(t-n)}function Xi(t,e,n,o,i){return void 0!==i&&(t=Wi(t,i,o)),Wi(t,n,o)+e}function Gi(t,e=0,n=1,o,i){t.min=Xi(t.min,e,n,o,i),t.max=Xi(t.max,e,n,o,i)}function qi(t,{x:e,y:n}){Gi(t.x,e.translate,e.scale,e.originPoint),Gi(t.y,n.translate,n.scale,n.originPoint)}function Ki(t,e){t.min=t.min+e,t.max=t.max+e}function Zi(t,e,[n,o,i]){const r=void 0!==e[i]?e[i]:.5,s=We(t.min,t.max,r);Gi(t,e[n],e[o],s,e.scale)}const _i=["x","scaleX","originX"],Ji=["y","scaleY","originY"];function Qi(t,e){Zi(t.x,e,_i),Zi(t.y,e,Ji)}function tr(t,e){return Bi(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),o=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:o.y,right:o.x}}(t.getBoundingClientRect(),e))}const er=new WeakMap;class nr{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 bi(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(ye(t,"page").point)},onStart:(t,e)=>{var n;const{drag:o,dragPropagation:i,onDragStart:r}=this.getProps();(!o||i||(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=Ve(o),this.openGlobalLock))&&(this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Fi((t=>{var e,n;let o=this.getAxisMotionValue(t).get()||0;if(lt.test(o)){const i=null===(n=null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout)||void 0===n?void 0:n.actual[t];if(i){o=Pi(i)*(parseFloat(o)/100)}}this.originPoint[t]=o})),null==r||r(t,e),null===(n=this.visualElement.animationState)||void 0===n||n.setActive(ue.Drag,!0))},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:o,onDirectionLock:i,onDrag:r}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(o&&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}(s),void(null!==this.currentDirection&&(null==i||i(this.currentDirection)));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.syncRender(),null==r||r(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:o}=e;this.startAnimation(