swipe-list-sdk
Version:
Shared SwipeList React SDK
33 lines • 87.1 kB
JavaScript
(function(ie,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],O):(ie=typeof globalThis<"u"?globalThis:ie||self,O(ie.SwipeListSDK={},ie.React,ie.ReactDOM))})(this,function(ie,O,sn){"use strict";function on(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const r in e)if(r!=="default"){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}}return t.default=e,Object.freeze(t)}const wt=on(O);var Et={exports:{}},xe={};/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var dr;function an(){if(dr)return xe;dr=1;var e=O,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,n=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(u,l,c){var f,p={},m=null,y=null;c!==void 0&&(m=""+c),l.key!==void 0&&(m=""+l.key),l.ref!==void 0&&(y=l.ref);for(f in l)i.call(l,f)&&!o.hasOwnProperty(f)&&(p[f]=l[f]);if(u&&u.defaultProps)for(f in l=u.defaultProps,l)p[f]===void 0&&(p[f]=l[f]);return{$$typeof:t,type:u,key:m,ref:y,props:p,_owner:n.current}}return xe.Fragment=r,xe.jsx=a,xe.jsxs=a,xe}var ke={};/**
* @license React
* react-jsx-runtime.development.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var hr;function un(){return hr||(hr=1,process.env.NODE_ENV!=="production"&&function(){var e=O,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),u=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),f=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),y=Symbol.for("react.offscreen"),w=Symbol.iterator,b="@@iterator";function T(s){if(s===null||typeof s!="object")return null;var d=w&&s[w]||s[b];return typeof d=="function"?d:null}var v=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(s){{for(var d=arguments.length,g=new Array(d>1?d-1:0),E=1;E<d;E++)g[E-1]=arguments[E];S("error",s,g)}}function S(s,d,g){{var E=v.ReactDebugCurrentFrame,R=E.getStackAddendum();R!==""&&(d+="%s",g=g.concat([R]));var C=g.map(function(k){return String(k)});C.unshift("Warning: "+d),Function.prototype.apply.call(console[s],console,C)}}var I=!1,j=!1,L=!1,U=!1,Te=!1,$;$=Symbol.for("react.module.reference");function pe(s){return!!(typeof s=="string"||typeof s=="function"||s===i||s===o||Te||s===n||s===c||s===f||U||s===y||I||j||L||typeof s=="object"&&s!==null&&(s.$$typeof===m||s.$$typeof===p||s.$$typeof===a||s.$$typeof===u||s.$$typeof===l||s.$$typeof===$||s.getModuleId!==void 0))}function W(s,d,g){var E=s.displayName;if(E)return E;var R=d.displayName||d.name||"";return R!==""?g+"("+R+")":g}function se(s){return s.displayName||"Context"}function B(s){if(s==null)return null;if(typeof s.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case i:return"Fragment";case r:return"Portal";case o:return"Profiler";case n:return"StrictMode";case c:return"Suspense";case f:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case u:var d=s;return se(d)+".Consumer";case a:var g=s;return se(g._context)+".Provider";case l:return W(s,s.render,"ForwardRef");case p:var E=s.displayName||null;return E!==null?E:B(s.type)||"Memo";case m:{var R=s,C=R._payload,k=R._init;try{return B(k(C))}catch{return null}}}return null}var oe=Object.assign,Xe=0,ji,Mi,Fi,Ni,Li,Ui,$i;function Bi(){}Bi.__reactDisabledLog=!0;function qo(){{if(Xe===0){ji=console.log,Mi=console.info,Fi=console.warn,Ni=console.error,Li=console.group,Ui=console.groupCollapsed,$i=console.groupEnd;var s={configurable:!0,enumerable:!0,value:Bi,writable:!0};Object.defineProperties(console,{info:s,log:s,warn:s,error:s,group:s,groupCollapsed:s,groupEnd:s})}Xe++}}function Ko(){{if(Xe--,Xe===0){var s={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:oe({},s,{value:ji}),info:oe({},s,{value:Mi}),warn:oe({},s,{value:Fi}),error:oe({},s,{value:Ni}),group:oe({},s,{value:Li}),groupCollapsed:oe({},s,{value:Ui}),groupEnd:oe({},s,{value:$i})})}Xe<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var nr=v.ReactCurrentDispatcher,sr;function vt(s,d,g){{if(sr===void 0)try{throw Error()}catch(R){var E=R.stack.trim().match(/\n( *(at )?)/);sr=E&&E[1]||""}return`
`+sr+s}}var or=!1,yt;{var zo=typeof WeakMap=="function"?WeakMap:Map;yt=new zo}function Yi(s,d){if(!s||or)return"";{var g=yt.get(s);if(g!==void 0)return g}var E;or=!0;var R=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var C;C=nr.current,nr.current=null,qo();try{if(d){var k=function(){throw Error()};if(Object.defineProperty(k.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(k,[])}catch(K){E=K}Reflect.construct(s,[],k)}else{try{k.call()}catch(K){E=K}s.call(k.prototype)}}else{try{throw Error()}catch(K){E=K}s()}}catch(K){if(K&&E&&typeof K.stack=="string"){for(var A=K.stack.split(`
`),Y=E.stack.split(`
`),M=A.length-1,N=Y.length-1;M>=1&&N>=0&&A[M]!==Y[N];)N--;for(;M>=1&&N>=0;M--,N--)if(A[M]!==Y[N]){if(M!==1||N!==1)do if(M--,N--,N<0||A[M]!==Y[N]){var X=`
`+A[M].replace(" at new "," at ");return s.displayName&&X.includes("<anonymous>")&&(X=X.replace("<anonymous>",s.displayName)),typeof s=="function"&&yt.set(s,X),X}while(M>=1&&N>=0);break}}}finally{or=!1,nr.current=C,Ko(),Error.prepareStackTrace=R}var Ae=s?s.displayName||s.name:"",me=Ae?vt(Ae):"";return typeof s=="function"&&yt.set(s,me),me}function Wo(s,d,g){return Yi(s,!1)}function Go(s){var d=s.prototype;return!!(d&&d.isReactComponent)}function _t(s,d,g){if(s==null)return"";if(typeof s=="function")return Yi(s,Go(s));if(typeof s=="string")return vt(s);switch(s){case c:return vt("Suspense");case f:return vt("SuspenseList")}if(typeof s=="object")switch(s.$$typeof){case l:return Wo(s.render);case p:return _t(s.type,d,g);case m:{var E=s,R=E._payload,C=E._init;try{return _t(C(R),d,g)}catch{}}}return""}var Je=Object.prototype.hasOwnProperty,qi={},Ki=v.ReactDebugCurrentFrame;function bt(s){if(s){var d=s._owner,g=_t(s.type,s._source,d?d.type:null);Ki.setExtraStackFrame(g)}else Ki.setExtraStackFrame(null)}function Ho(s,d,g,E,R){{var C=Function.call.bind(Je);for(var k in s)if(C(s,k)){var A=void 0;try{if(typeof s[k]!="function"){var Y=Error((E||"React class")+": "+g+" type `"+k+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof s[k]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Y.name="Invariant Violation",Y}A=s[k](d,k,E,g,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(M){A=M}A&&!(A instanceof Error)&&(bt(R),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",E||"React class",g,k,typeof A),bt(null)),A instanceof Error&&!(A.message in qi)&&(qi[A.message]=!0,bt(R),_("Failed %s type: %s",g,A.message),bt(null))}}}var Qo=Array.isArray;function ar(s){return Qo(s)}function Xo(s){{var d=typeof Symbol=="function"&&Symbol.toStringTag,g=d&&s[Symbol.toStringTag]||s.constructor.name||"Object";return g}}function Jo(s){try{return zi(s),!1}catch{return!0}}function zi(s){return""+s}function Wi(s){if(Jo(s))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Xo(s)),zi(s)}var Gi=v.ReactCurrentOwner,Zo={key:!0,ref:!0,__self:!0,__source:!0},Hi,Qi;function ea(s){if(Je.call(s,"ref")){var d=Object.getOwnPropertyDescriptor(s,"ref").get;if(d&&d.isReactWarning)return!1}return s.ref!==void 0}function ta(s){if(Je.call(s,"key")){var d=Object.getOwnPropertyDescriptor(s,"key").get;if(d&&d.isReactWarning)return!1}return s.key!==void 0}function ra(s,d){typeof s.ref=="string"&&Gi.current}function ia(s,d){{var g=function(){Hi||(Hi=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",d))};g.isReactWarning=!0,Object.defineProperty(s,"key",{get:g,configurable:!0})}}function na(s,d){{var g=function(){Qi||(Qi=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",d))};g.isReactWarning=!0,Object.defineProperty(s,"ref",{get:g,configurable:!0})}}var sa=function(s,d,g,E,R,C,k){var A={$$typeof:t,type:s,key:d,ref:g,props:k,_owner:C};return A._store={},Object.defineProperty(A._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(A,"_self",{configurable:!1,enumerable:!1,writable:!1,value:E}),Object.defineProperty(A,"_source",{configurable:!1,enumerable:!1,writable:!1,value:R}),Object.freeze&&(Object.freeze(A.props),Object.freeze(A)),A};function oa(s,d,g,E,R){{var C,k={},A=null,Y=null;g!==void 0&&(Wi(g),A=""+g),ta(d)&&(Wi(d.key),A=""+d.key),ea(d)&&(Y=d.ref,ra(d,R));for(C in d)Je.call(d,C)&&!Zo.hasOwnProperty(C)&&(k[C]=d[C]);if(s&&s.defaultProps){var M=s.defaultProps;for(C in M)k[C]===void 0&&(k[C]=M[C])}if(A||Y){var N=typeof s=="function"?s.displayName||s.name||"Unknown":s;A&&ia(k,N),Y&&na(k,N)}return sa(s,A,Y,R,E,Gi.current,k)}}var ur=v.ReactCurrentOwner,Xi=v.ReactDebugCurrentFrame;function Pe(s){if(s){var d=s._owner,g=_t(s.type,s._source,d?d.type:null);Xi.setExtraStackFrame(g)}else Xi.setExtraStackFrame(null)}var cr;cr=!1;function lr(s){return typeof s=="object"&&s!==null&&s.$$typeof===t}function Ji(){{if(ur.current){var s=B(ur.current.type);if(s)return`
Check the render method of \``+s+"`."}return""}}function aa(s){return""}var Zi={};function ua(s){{var d=Ji();if(!d){var g=typeof s=="string"?s:s.displayName||s.name;g&&(d=`
Check the top-level render call using <`+g+">.")}return d}}function en(s,d){{if(!s._store||s._store.validated||s.key!=null)return;s._store.validated=!0;var g=ua(d);if(Zi[g])return;Zi[g]=!0;var E="";s&&s._owner&&s._owner!==ur.current&&(E=" It was passed a child from "+B(s._owner.type)+"."),Pe(s),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',g,E),Pe(null)}}function tn(s,d){{if(typeof s!="object")return;if(ar(s))for(var g=0;g<s.length;g++){var E=s[g];lr(E)&&en(E,d)}else if(lr(s))s._store&&(s._store.validated=!0);else if(s){var R=T(s);if(typeof R=="function"&&R!==s.entries)for(var C=R.call(s),k;!(k=C.next()).done;)lr(k.value)&&en(k.value,d)}}}function ca(s){{var d=s.type;if(d==null||typeof d=="string")return;var g;if(typeof d=="function")g=d.propTypes;else if(typeof d=="object"&&(d.$$typeof===l||d.$$typeof===p))g=d.propTypes;else return;if(g){var E=B(d);Ho(g,s.props,"prop",E,s)}else if(d.PropTypes!==void 0&&!cr){cr=!0;var R=B(d);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",R||"Unknown")}typeof d.getDefaultProps=="function"&&!d.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function la(s){{for(var d=Object.keys(s.props),g=0;g<d.length;g++){var E=d[g];if(E!=="children"&&E!=="key"){Pe(s),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",E),Pe(null);break}}s.ref!==null&&(Pe(s),_("Invalid attribute `ref` supplied to `React.Fragment`."),Pe(null))}}var rn={};function nn(s,d,g,E,R,C){{var k=pe(s);if(!k){var A="";(s===void 0||typeof s=="object"&&s!==null&&Object.keys(s).length===0)&&(A+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Y=aa();Y?A+=Y:A+=Ji();var M;s===null?M="null":ar(s)?M="array":s!==void 0&&s.$$typeof===t?(M="<"+(B(s.type)||"Unknown")+" />",A=" Did you accidentally export a JSX literal instead of a component?"):M=typeof s,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",M,A)}var N=oa(s,d,g,R,C);if(N==null)return N;if(k){var X=d.children;if(X!==void 0)if(E)if(ar(X)){for(var Ae=0;Ae<X.length;Ae++)tn(X[Ae],s);Object.freeze&&Object.freeze(X)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else tn(X,s)}if(Je.call(d,"key")){var me=B(s),K=Object.keys(d).filter(function(ga){return ga!=="key"}),fr=K.length>0?"{key: someKey, "+K.join(": ..., ")+": ...}":"{key: someKey}";if(!rn[me+fr]){var ma=K.length>0?"{"+K.join(": ..., ")+": ...}":"{}";_(`A props object containing a "key" prop is being spread into JSX:
let props = %s;
<%s {...props} />
React keys must be passed directly to JSX without using spread:
let props = %s;
<%s key={someKey} {...props} />`,fr,me,ma,me),rn[me+fr]=!0}}return s===i?la(N):ca(N),N}}function fa(s,d,g){return nn(s,d,g,!0)}function da(s,d,g){return nn(s,d,g,!1)}var ha=da,pa=fa;ke.Fragment=i,ke.jsx=ha,ke.jsxs=pa}()),ke}process.env.NODE_ENV==="production"?Et.exports=an():Et.exports=un();var cn=Et.exports;const ln=({children:e})=>cn.jsx("div",{className:"swipe-card",children:e});function fn(e,t,r){return Math.max(t,Math.min(e,r))}const D={toVector(e,t){return e===void 0&&(e=t),Array.isArray(e)?e:[e,e]},add(e,t){return[e[0]+t[0],e[1]+t[1]]},sub(e,t){return[e[0]-t[0],e[1]-t[1]]},addTo(e,t){e[0]+=t[0],e[1]+=t[1]},subTo(e,t){e[0]-=t[0],e[1]-=t[1]}};function pr(e,t,r){return t===0||Math.abs(t)===1/0?Math.pow(e,r*5):e*t*r/(t+r*e)}function mr(e,t,r,i=.15){return i===0?fn(e,t,r):e<t?-pr(t-e,r-t,i)+t:e>r?+pr(e-r,r-t,i)+r:e}function dn(e,[t,r],[i,n]){const[[o,a],[u,l]]=e;return[mr(t,o,a,i),mr(r,u,l,n)]}function hn(e,t){if(typeof e!="object"||e===null)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var i=r.call(e,t);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function pn(e){var t=hn(e,"string");return typeof t=="symbol"?t:String(t)}function F(e,t,r){return t=pn(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(e,n).enumerable})),r.push.apply(r,i)}return r}function V(e){for(var t=1;t<arguments.length;t++){var r=arguments[t]!=null?arguments[t]:{};t%2?gr(Object(r),!0).forEach(function(i){F(e,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gr(Object(r)).forEach(function(i){Object.defineProperty(e,i,Object.getOwnPropertyDescriptor(r,i))})}return e}const vr={pointer:{start:"down",change:"move",end:"up"},mouse:{start:"down",change:"move",end:"up"},touch:{start:"start",change:"move",end:"end"},gesture:{start:"start",change:"change",end:"end"}};function yr(e){return e?e[0].toUpperCase()+e.slice(1):""}const mn=["enter","leave"];function gn(e=!1,t){return e&&!mn.includes(t)}function vn(e,t="",r=!1){const i=vr[e],n=i&&i[t]||t;return"on"+yr(e)+yr(n)+(gn(r,n)?"Capture":"")}const yn=["gotpointercapture","lostpointercapture"];function _n(e){let t=e.substring(2).toLowerCase();const r=!!~t.indexOf("passive");r&&(t=t.replace("passive",""));const i=yn.includes(t)?"capturecapture":"capture",n=!!~t.indexOf(i);return n&&(t=t.replace("capture","")),{device:t,capture:n,passive:r}}function bn(e,t=""){const r=vr[e],i=r&&r[t]||t;return e+i}function Ze(e){return"touches"in e}function _r(e){return Ze(e)?"touch":"pointerType"in e?e.pointerType:"mouse"}function wn(e){return Array.from(e.touches).filter(t=>{var r,i;return t.target===e.currentTarget||((r=e.currentTarget)===null||r===void 0||(i=r.contains)===null||i===void 0?void 0:i.call(r,t.target))})}function En(e){return e.type==="touchend"||e.type==="touchcancel"?e.changedTouches:e.targetTouches}function br(e){return Ze(e)?En(e)[0]:e}function St(e,t){try{const r=t.clientX-e.clientX,i=t.clientY-e.clientY,n=(t.clientX+e.clientX)/2,o=(t.clientY+e.clientY)/2,a=Math.hypot(r,i);return{angle:-(Math.atan2(r,i)*180)/Math.PI,distance:a,origin:[n,o]}}catch{}return null}function Sn(e){return wn(e).map(t=>t.identifier)}function wr(e,t){const[r,i]=Array.from(e.touches).filter(n=>t.includes(n.identifier));return St(r,i)}function Tt(e){const t=br(e);return Ze(e)?t.identifier:t.pointerId}function ge(e){const t=br(e);return[t.clientX,t.clientY]}const Er=40,Sr=800;function Tr(e){let{deltaX:t,deltaY:r,deltaMode:i}=e;return i===1?(t*=Er,r*=Er):i===2&&(t*=Sr,r*=Sr),[t,r]}function Tn(e){var t,r;const{scrollX:i,scrollY:n,scrollLeft:o,scrollTop:a}=e.currentTarget;return[(t=i??o)!==null&&t!==void 0?t:0,(r=n??a)!==null&&r!==void 0?r:0]}function Pn(e){const t={};if("buttons"in e&&(t.buttons=e.buttons),"shiftKey"in e){const{shiftKey:r,altKey:i,metaKey:n,ctrlKey:o}=e;Object.assign(t,{shiftKey:r,altKey:i,metaKey:n,ctrlKey:o})}return t}function et(e,...t){return typeof e=="function"?e(...t):e}function An(){}function xn(...e){return e.length===0?An:e.length===1?e[0]:function(){let t;for(const r of e)t=r.apply(this,arguments)||t;return t}}function Pr(e,t){return Object.assign({},t,e||{})}const kn=32;class Ar{constructor(t,r,i){this.ctrl=t,this.args=r,this.key=i,this.state||(this.state={},this.computeValues([0,0]),this.computeInitial(),this.init&&this.init(),this.reset())}get state(){return this.ctrl.state[this.key]}set state(t){this.ctrl.state[this.key]=t}get shared(){return this.ctrl.state.shared}get eventStore(){return this.ctrl.gestureEventStores[this.key]}get timeoutStore(){return this.ctrl.gestureTimeoutStores[this.key]}get config(){return this.ctrl.config[this.key]}get sharedConfig(){return this.ctrl.config.shared}get handler(){return this.ctrl.handlers[this.key]}reset(){const{state:t,shared:r,ingKey:i,args:n}=this;r[i]=t._active=t.active=t._blocked=t._force=!1,t._step=[!1,!1],t.intentional=!1,t._movement=[0,0],t._distance=[0,0],t._direction=[0,0],t._delta=[0,0],t._bounds=[[-1/0,1/0],[-1/0,1/0]],t.args=n,t.axis=void 0,t.memo=void 0,t.elapsedTime=t.timeDelta=0,t.direction=[0,0],t.distance=[0,0],t.overflow=[0,0],t._movementBound=[!1,!1],t.velocity=[0,0],t.movement=[0,0],t.delta=[0,0],t.timeStamp=0}start(t){const r=this.state,i=this.config;r._active||(this.reset(),this.computeInitial(),r._active=!0,r.target=t.target,r.currentTarget=t.currentTarget,r.lastOffset=i.from?et(i.from,r):r.offset,r.offset=r.lastOffset,r.startTime=r.timeStamp=t.timeStamp)}computeValues(t){const r=this.state;r._values=t,r.values=this.config.transform(t)}computeInitial(){const t=this.state;t._initial=t._values,t.initial=t.values}compute(t){const{state:r,config:i,shared:n}=this;r.args=this.args;let o=0;if(t&&(r.event=t,i.preventDefault&&t.cancelable&&r.event.preventDefault(),r.type=t.type,n.touches=this.ctrl.pointerIds.size||this.ctrl.touchIds.size,n.locked=!!document.pointerLockElement,Object.assign(n,Pn(t)),n.down=n.pressed=n.buttons%2===1||n.touches>0,o=t.timeStamp-r.timeStamp,r.timeStamp=t.timeStamp,r.elapsedTime=r.timeStamp-r.startTime),r._active){const L=r._delta.map(Math.abs);D.addTo(r._distance,L)}this.axisIntent&&this.axisIntent(t);const[a,u]=r._movement,[l,c]=i.threshold,{_step:f,values:p}=r;if(i.hasCustomTransform?(f[0]===!1&&(f[0]=Math.abs(a)>=l&&p[0]),f[1]===!1&&(f[1]=Math.abs(u)>=c&&p[1])):(f[0]===!1&&(f[0]=Math.abs(a)>=l&&Math.sign(a)*l),f[1]===!1&&(f[1]=Math.abs(u)>=c&&Math.sign(u)*c)),r.intentional=f[0]!==!1||f[1]!==!1,!r.intentional)return;const m=[0,0];if(i.hasCustomTransform){const[L,U]=p;m[0]=f[0]!==!1?L-f[0]:0,m[1]=f[1]!==!1?U-f[1]:0}else m[0]=f[0]!==!1?a-f[0]:0,m[1]=f[1]!==!1?u-f[1]:0;this.restrictToAxis&&!r._blocked&&this.restrictToAxis(m);const y=r.offset,w=r._active&&!r._blocked||r.active;w&&(r.first=r._active&&!r.active,r.last=!r._active&&r.active,r.active=n[this.ingKey]=r._active,t&&(r.first&&("bounds"in i&&(r._bounds=et(i.bounds,r)),this.setup&&this.setup()),r.movement=m,this.computeOffset()));const[b,T]=r.offset,[[v,_],[S,I]]=r._bounds;r.overflow=[b<v?-1:b>_?1:0,T<S?-1:T>I?1:0],r._movementBound[0]=r.overflow[0]?r._movementBound[0]===!1?r._movement[0]:r._movementBound[0]:!1,r._movementBound[1]=r.overflow[1]?r._movementBound[1]===!1?r._movement[1]:r._movementBound[1]:!1;const j=r._active?i.rubberband||[0,0]:[0,0];if(r.offset=dn(r._bounds,r.offset,j),r.delta=D.sub(r.offset,y),this.computeMovement(),w&&(!r.last||o>kn)){r.delta=D.sub(r.offset,y);const L=r.delta.map(Math.abs);D.addTo(r.distance,L),r.direction=r.delta.map(Math.sign),r._direction=r._delta.map(Math.sign),!r.first&&o>0&&(r.velocity=[L[0]/o,L[1]/o],r.timeDelta=o)}}emit(){const t=this.state,r=this.shared,i=this.config;if(t._active||this.clean(),(t._blocked||!t.intentional)&&!t._force&&!i.triggerAllEvents)return;const n=this.handler(V(V(V({},r),t),{},{[this.aliasKey]:t.values}));n!==void 0&&(t.memo=n)}clean(){this.eventStore.clean(),this.timeoutStore.clean()}}function On([e,t],r){const i=Math.abs(e),n=Math.abs(t);if(i>n&&i>r)return"x";if(n>i&&n>r)return"y"}class Oe extends Ar{constructor(...t){super(...t),F(this,"aliasKey","xy")}reset(){super.reset(),this.state.axis=void 0}init(){this.state.offset=[0,0],this.state.lastOffset=[0,0]}computeOffset(){this.state.offset=D.add(this.state.lastOffset,this.state.movement)}computeMovement(){this.state.movement=D.sub(this.state.offset,this.state.lastOffset)}axisIntent(t){const r=this.state,i=this.config;if(!r.axis&&t){const n=typeof i.axisThreshold=="object"?i.axisThreshold[_r(t)]:i.axisThreshold;r.axis=On(r._movement,n)}r._blocked=(i.lockDirection||!!i.axis)&&!r.axis||!!i.axis&&i.axis!==r.axis}restrictToAxis(t){if(this.config.axis||this.config.lockDirection)switch(this.state.axis){case"x":t[1]=0;break;case"y":t[0]=0;break}}}const xr=e=>e,kr=.15,Pt={enabled(e=!0){return e},eventOptions(e,t,r){return V(V({},r.shared.eventOptions),e)},preventDefault(e=!1){return e},triggerAllEvents(e=!1){return e},rubberband(e=0){switch(e){case!0:return[kr,kr];case!1:return[0,0];default:return D.toVector(e)}},from(e){if(typeof e=="function")return e;if(e!=null)return D.toVector(e)},transform(e,t,r){const i=e||r.shared.transform;if(this.hasCustomTransform=!!i,process.env.NODE_ENV==="development"){const n=i||xr;return o=>{const a=n(o);return(!isFinite(a[0])||!isFinite(a[1]))&&console.warn(`[@use-gesture]: config.transform() must produce a valid result, but it was: [${a[0]},${[1]}]`),a}}return i||xr},threshold(e){return D.toVector(e,0)}};process.env.NODE_ENV==="development"&&Object.assign(Pt,{domTarget(e){if(e!==void 0)throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");return NaN},lockDirection(e){if(e!==void 0)throw Error("[@use-gesture]: `lockDirection` option has been merged with `axis`. Use it as in `{ axis: 'lock' }`");return NaN},initial(e){if(e!==void 0)throw Error("[@use-gesture]: `initial` option has been renamed to `from`.");return NaN}});const In=0,fe=V(V({},Pt),{},{axis(e,t,{axis:r}){if(this.lockDirection=r==="lock",!this.lockDirection)return r},axisThreshold(e=In){return e},bounds(e={}){if(typeof e=="function")return o=>fe.bounds(e(o));if("current"in e)return()=>e.current;if(typeof HTMLElement=="function"&&e instanceof HTMLElement)return e;const{left:t=-1/0,right:r=1/0,top:i=-1/0,bottom:n=1/0}=e;return[[t,r],[i,n]]}}),Or={ArrowRight:(e,t=1)=>[e*t,0],ArrowLeft:(e,t=1)=>[-1*e*t,0],ArrowUp:(e,t=1)=>[0,-1*e*t],ArrowDown:(e,t=1)=>[0,e*t]};class Rn extends Oe{constructor(...t){super(...t),F(this,"ingKey","dragging")}reset(){super.reset();const t=this.state;t._pointerId=void 0,t._pointerActive=!1,t._keyboardActive=!1,t._preventScroll=!1,t._delayed=!1,t.swipe=[0,0],t.tap=!1,t.canceled=!1,t.cancel=this.cancel.bind(this)}setup(){const t=this.state;if(t._bounds instanceof HTMLElement){const r=t._bounds.getBoundingClientRect(),i=t.currentTarget.getBoundingClientRect(),n={left:r.left-i.left+t.offset[0],right:r.right-i.right+t.offset[0],top:r.top-i.top+t.offset[1],bottom:r.bottom-i.bottom+t.offset[1]};t._bounds=fe.bounds(n)}}cancel(){const t=this.state;t.canceled||(t.canceled=!0,t._active=!1,setTimeout(()=>{this.compute(),this.emit()},0))}setActive(){this.state._active=this.state._pointerActive||this.state._keyboardActive}clean(){this.pointerClean(),this.state._pointerActive=!1,this.state._keyboardActive=!1,super.clean()}pointerDown(t){const r=this.config,i=this.state;if(t.buttons!=null&&(Array.isArray(r.pointerButtons)?!r.pointerButtons.includes(t.buttons):r.pointerButtons!==-1&&r.pointerButtons!==t.buttons))return;const n=this.ctrl.setEventIds(t);r.pointerCapture&&t.target.setPointerCapture(t.pointerId),!(n&&n.size>1&&i._pointerActive)&&(this.start(t),this.setupPointer(t),i._pointerId=Tt(t),i._pointerActive=!0,this.computeValues(ge(t)),this.computeInitial(),r.preventScrollAxis&&_r(t)!=="mouse"?(i._active=!1,this.setupScrollPrevention(t)):r.delay>0?(this.setupDelayTrigger(t),r.triggerAllEvents&&(this.compute(t),this.emit())):this.startPointerDrag(t))}startPointerDrag(t){const r=this.state;r._active=!0,r._preventScroll=!0,r._delayed=!1,this.compute(t),this.emit()}pointerMove(t){const r=this.state,i=this.config;if(!r._pointerActive)return;const n=Tt(t);if(r._pointerId!==void 0&&n!==r._pointerId)return;const o=ge(t);if(document.pointerLockElement===t.target?r._delta=[t.movementX,t.movementY]:(r._delta=D.sub(o,r._values),this.computeValues(o)),D.addTo(r._movement,r._delta),this.compute(t),r._delayed&&r.intentional){this.timeoutStore.remove("dragDelay"),r.active=!1,this.startPointerDrag(t);return}if(i.preventScrollAxis&&!r._preventScroll)if(r.axis)if(r.axis===i.preventScrollAxis||i.preventScrollAxis==="xy"){r._active=!1,this.clean();return}else{this.timeoutStore.remove("startPointerDrag"),this.startPointerDrag(t);return}else return;this.emit()}pointerUp(t){this.ctrl.setEventIds(t);try{this.config.pointerCapture&&t.target.hasPointerCapture(t.pointerId)&&t.target.releasePointerCapture(t.pointerId)}catch{process.env.NODE_ENV==="development"&&console.warn("[@use-gesture]: If you see this message, it's likely that you're using an outdated version of `@react-three/fiber`. \n\nPlease upgrade to the latest version.")}const r=this.state,i=this.config;if(!r._active||!r._pointerActive)return;const n=Tt(t);if(r._pointerId!==void 0&&n!==r._pointerId)return;this.state._pointerActive=!1,this.setActive(),this.compute(t);const[o,a]=r._distance;if(r.tap=o<=i.tapsThreshold&&a<=i.tapsThreshold,r.tap&&i.filterTaps)r._force=!0;else{const[u,l]=r._delta,[c,f]=r._movement,[p,m]=i.swipe.velocity,[y,w]=i.swipe.distance,b=i.swipe.duration;if(r.elapsedTime<b){const T=Math.abs(u/r.timeDelta),v=Math.abs(l/r.timeDelta);T>p&&Math.abs(c)>y&&(r.swipe[0]=Math.sign(u)),v>m&&Math.abs(f)>w&&(r.swipe[1]=Math.sign(l))}}this.emit()}pointerClick(t){!this.state.tap&&t.detail>0&&(t.preventDefault(),t.stopPropagation())}setupPointer(t){const r=this.config,i=r.device;if(process.env.NODE_ENV==="development")try{if(i==="pointer"&&r.preventScrollDelay===void 0){const n="uv"in t?t.sourceEvent.currentTarget:t.currentTarget;window.getComputedStyle(n).touchAction==="auto"&&console.warn("[@use-gesture]: The drag target has its `touch-action` style property set to `auto`. It is recommended to add `touch-action: 'none'` so that the drag gesture behaves correctly on touch-enabled devices. For more information read this: https://use-gesture.netlify.app/docs/extras/#touch-action.\n\nThis message will only show in development mode. It won't appear in production. If this is intended, you can ignore it.",n)}}catch{}r.pointerLock&&t.currentTarget.requestPointerLock(),r.pointerCapture||(this.eventStore.add(this.sharedConfig.window,i,"change",this.pointerMove.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"end",this.pointerUp.bind(this)),this.eventStore.add(this.sharedConfig.window,i,"cancel",this.pointerUp.bind(this)))}pointerClean(){this.config.pointerLock&&document.pointerLockElement===this.state.currentTarget&&document.exitPointerLock()}preventScroll(t){this.state._preventScroll&&t.cancelable&&t.preventDefault()}setupScrollPrevention(t){this.state._preventScroll=!1,Cn(t);const r=this.eventStore.add(this.sharedConfig.window,"touch","change",this.preventScroll.bind(this),{passive:!1});this.eventStore.add(this.sharedConfig.window,"touch","end",r),this.eventStore.add(this.sharedConfig.window,"touch","cancel",r),this.timeoutStore.add("startPointerDrag",this.startPointerDrag.bind(this),this.config.preventScrollDelay,t)}setupDelayTrigger(t){this.state._delayed=!0,this.timeoutStore.add("dragDelay",()=>{this.state._step=[0,0],this.startPointerDrag(t)},this.config.delay)}keyDown(t){const r=Or[t.key];if(r){const i=this.state,n=t.shiftKey?10:t.altKey?.1:1;this.start(t),i._delta=r(this.config.keyboardDisplacement,n),i._keyboardActive=!0,D.addTo(i._movement,i._delta),this.compute(t),this.emit()}}keyUp(t){t.key in Or&&(this.state._keyboardActive=!1,this.setActive(),this.compute(t),this.emit())}bind(t){const r=this.config.device;t(r,"start",this.pointerDown.bind(this)),this.config.pointerCapture&&(t(r,"change",this.pointerMove.bind(this)),t(r,"end",this.pointerUp.bind(this)),t(r,"cancel",this.pointerUp.bind(this)),t("lostPointerCapture","",this.pointerUp.bind(this))),this.config.keys&&(t("key","down",this.keyDown.bind(this)),t("key","up",this.keyUp.bind(this))),this.config.filterTaps&&t("click","",this.pointerClick.bind(this),{capture:!0,passive:!1})}}function Cn(e){"persist"in e&&typeof e.persist=="function"&&e.persist()}const Ie=typeof window<"u"&&window.document&&window.document.createElement;function Ir(){return Ie&&"ontouchstart"in window}function Dn(){return Ir()||Ie&&window.navigator.maxTouchPoints>1}function Vn(){return Ie&&"onpointerdown"in window}function jn(){return Ie&&"exitPointerLock"in window.document}function Mn(){try{return"constructor"in GestureEvent}catch{return!1}}const G={isBrowser:Ie,gesture:Mn(),touch:Ir(),touchscreen:Dn(),pointer:Vn(),pointerLock:jn()},Fn=250,Nn=180,Ln=.5,Un=50,$n=250,Bn=10,Rr={mouse:0,touch:0,pen:8},Cr=V(V({},fe),{},{device(e,t,{pointer:{touch:r=!1,lock:i=!1,mouse:n=!1}={}}){return this.pointerLock=i&&G.pointerLock,G.touch&&r?"touch":this.pointerLock?"mouse":G.pointer&&!n?"pointer":G.touch?"touch":"mouse"},preventScrollAxis(e,t,{preventScroll:r}){if(this.preventScrollDelay=typeof r=="number"?r:r||r===void 0&&e?Fn:void 0,!(!G.touchscreen||r===!1))return e||(r!==void 0?"y":void 0)},pointerCapture(e,t,{pointer:{capture:r=!0,buttons:i=1,keys:n=!0}={}}){return this.pointerButtons=i,this.keys=n,!this.pointerLock&&this.device==="pointer"&&r},threshold(e,t,{filterTaps:r=!1,tapsThreshold:i=3,axis:n=void 0}){const o=D.toVector(e,r?i:n?1:0);return this.filterTaps=r,this.tapsThreshold=i,o},swipe({velocity:e=Ln,distance:t=Un,duration:r=$n}={}){return{velocity:this.transform(D.toVector(e)),distance:this.transform(D.toVector(t)),duration:r}},delay(e=0){switch(e){case!0:return Nn;case!1:return 0;default:return e}},axisThreshold(e){return e?V(V({},Rr),e):Rr},keyboardDisplacement(e=Bn){return e}});process.env.NODE_ENV==="development"&&Object.assign(Cr,{useTouch(e){if(e!==void 0)throw Error("[@use-gesture]: `useTouch` option has been renamed to `pointer.touch`. Use it as in `{ pointer: { touch: true } }`.");return NaN},experimental_preventWindowScrollY(e){if(e!==void 0)throw Error("[@use-gesture]: `experimental_preventWindowScrollY` option has been renamed to `preventScroll`.");return NaN},swipeVelocity(e){if(e!==void 0)throw Error("[@use-gesture]: `swipeVelocity` option has been renamed to `swipe.velocity`. Use it as in `{ swipe: { velocity: 0.5 } }`.");return NaN},swipeDistance(e){if(e!==void 0)throw Error("[@use-gesture]: `swipeDistance` option has been renamed to `swipe.distance`. Use it as in `{ swipe: { distance: 50 } }`.");return NaN},swipeDuration(e){if(e!==void 0)throw Error("[@use-gesture]: `swipeDuration` option has been renamed to `swipe.duration`. Use it as in `{ swipe: { duration: 250 } }`.");return NaN}});function Dr(e){const[t,r]=e.overflow,[i,n]=e._delta,[o,a]=e._direction;(t<0&&i>0&&o<0||t>0&&i<0&&o>0)&&(e._movement[0]=e._movementBound[0]),(r<0&&n>0&&a<0||r>0&&n<0&&a>0)&&(e._movement[1]=e._movementBound[1])}const Yn=30,qn=100;class Kn extends Ar{constructor(...t){super(...t),F(this,"ingKey","pinching"),F(this,"aliasKey","da")}init(){this.state.offset=[1,0],this.state.lastOffset=[1,0],this.state._pointerEvents=new Map}reset(){super.reset();const t=this.state;t._touchIds=[],t.canceled=!1,t.cancel=this.cancel.bind(this),t.turns=0}computeOffset(){const{type:t,movement:r,lastOffset:i}=this.state;t==="wheel"?this.state.offset=D.add(r,i):this.state.offset=[(1+r[0])*i[0],r[1]+i[1]]}computeMovement(){const{offset:t,lastOffset:r}=this.state;this.state.movement=[t[0]/r[0],t[1]-r[1]]}axisIntent(){const t=this.state,[r,i]=t._movement;if(!t.axis){const n=Math.abs(r)*Yn-Math.abs(i);n<0?t.axis="angle":n>0&&(t.axis="scale")}}restrictToAxis(t){this.config.lockDirection&&(this.state.axis==="scale"?t[1]=0:this.state.axis==="angle"&&(t[0]=0))}cancel(){const t=this.state;t.canceled||setTimeout(()=>{t.canceled=!0,t._active=!1,this.compute(),this.emit()},0)}touchStart(t){this.ctrl.setEventIds(t);const r=this.state,i=this.ctrl.touchIds;if(r._active&&r._touchIds.every(o=>i.has(o))||i.size<2)return;this.start(t),r._touchIds=Array.from(i).slice(0,2);const n=wr(t,r._touchIds);n&&this.pinchStart(t,n)}pointerStart(t){if(t.buttons!=null&&t.buttons%2!==1)return;this.ctrl.setEventIds(t),t.target.setPointerCapture(t.pointerId);const r=this.state,i=r._pointerEvents,n=this.ctrl.pointerIds;if(r._active&&Array.from(i.keys()).every(a=>n.has(a))||(i.size<2&&i.set(t.pointerId,t),r._pointerEvents.size<2))return;this.start(t);const o=St(...Array.from(i.values()));o&&this.pinchStart(t,o)}pinchStart(t,r){const i=this.state;i.origin=r.origin,this.computeValues([r.distance,r.angle]),this.computeInitial(),this.compute(t),this.emit()}touchMove(t){if(!this.state._active)return;const r=wr(t,this.state._touchIds);r&&this.pinchMove(t,r)}pointerMove(t){const r=this.state._pointerEvents;if(r.has(t.pointerId)&&r.set(t.pointerId,t),!this.state._active)return;const i=St(...Array.from(r.values()));i&&this.pinchMove(t,i)}pinchMove(t,r){const i=this.state,n=i._values[1],o=r.angle-n;let a=0;Math.abs(o)>270&&(a+=Math.sign(o)),this.computeValues([r.distance,r.angle-360*a]),i.origin=r.origin,i.turns=a,i._movement=[i._values[0]/i._initial[0]-1,i._values[1]-i._initial[1]],this.compute(t),this.emit()}touchEnd(t){this.ctrl.setEventIds(t),this.state._active&&this.state._touchIds.some(r=>!this.ctrl.touchIds.has(r))&&(this.state._active=!1,this.compute(t),this.emit())}pointerEnd(t){const r=this.state;this.ctrl.setEventIds(t);try{t.target.releasePointerCapture(t.pointerId)}catch{}r._pointerEvents.has(t.pointerId)&&r._pointerEvents.delete(t.pointerId),r._active&&r._pointerEvents.size<2&&(r._active=!1,this.compute(t),this.emit())}gestureStart(t){t.cancelable&&t.preventDefault();const r=this.state;r._active||(this.start(t),this.computeValues([t.scale,t.rotation]),r.origin=[t.clientX,t.clientY],this.compute(t),this.emit())}gestureMove(t){if(t.cancelable&&t.preventDefault(),!this.state._active)return;const r=this.state;this.computeValues([t.scale,t.rotation]),r.origin=[t.clientX,t.clientY];const i=r._movement;r._movement=[t.scale-1,t.rotation],r._delta=D.sub(r._movement,i),this.compute(t),this.emit()}gestureEnd(t){this.state._active&&(this.state._active=!1,this.compute(t),this.emit())}wheel(t){const r=this.config.modifierKey;r&&(Array.isArray(r)?!r.find(i=>t[i]):!t[r])||(this.state._active?this.wheelChange(t):this.wheelStart(t),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this)))}wheelStart(t){this.start(t),this.wheelChange(t)}wheelChange(t){"uv"in t||(t.cancelable&&t.preventDefault(),process.env.NODE_ENV==="development"&&!t.defaultPrevented&&console.warn("[@use-gesture]: To properly support zoom on trackpads, try using the `target` option.\n\nThis message will only appear in development mode."));const i=this.state;i._delta=[-Tr(t)[1]/qn*i.offset[0],0],D.addTo(i._movement,i._delta),Dr(i),this.state.origin=[t.clientX,t.clientY],this.compute(t),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){const r=this.config.device;r&&(t(r,"start",this[r+"Start"].bind(this)),t(r,"change",this[r+"Move"].bind(this)),t(r,"end",this[r+"End"].bind(this)),t(r,"cancel",this[r+"End"].bind(this)),t("lostPointerCapture","",this[r+"End"].bind(this))),this.config.pinchOnWheel&&t("wheel","",this.wheel.bind(this),{passive:!1})}}const zn=V(V({},Pt),{},{device(e,t,{shared:r,pointer:{touch:i=!1}={}}){if(r.target&&!G.touch&&G.gesture)return"gesture";if(G.touch&&i)return"touch";if(G.touchscreen){if(G.pointer)return"pointer";if(G.touch)return"touch"}},bounds(e,t,{scaleBounds:r={},angleBounds:i={}}){const n=a=>{const u=Pr(et(r,a),{min:-1/0,max:1/0});return[u.min,u.max]},o=a=>{const u=Pr(et(i,a),{min:-1/0,max:1/0});return[u.min,u.max]};return typeof r!="function"&&typeof i!="function"?[n(),o()]:a=>[n(a),o(a)]},threshold(e,t,r){return this.lockDirection=r.axis==="lock",D.toVector(e,this.lockDirection?[.1,3]:0)},modifierKey(e){return e===void 0?"ctrlKey":e},pinchOnWheel(e=!0){return e}});class Wn extends Oe{constructor(...t){super(...t),F(this,"ingKey","moving")}move(t){this.config.mouseOnly&&t.pointerType!=="mouse"||(this.state._active?this.moveChange(t):this.moveStart(t),this.timeoutStore.add("moveEnd",this.moveEnd.bind(this)))}moveStart(t){this.start(t),this.computeValues(ge(t)),this.compute(t),this.computeInitial(),this.emit()}moveChange(t){if(!this.state._active)return;const r=ge(t),i=this.state;i._delta=D.sub(r,i._values),D.addTo(i._movement,i._delta),this.computeValues(r),this.compute(t),this.emit()}moveEnd(t){this.state._active&&(this.state._active=!1,this.compute(t),this.emit())}bind(t){t("pointer","change",this.move.bind(this)),t("pointer","leave",this.moveEnd.bind(this))}}const Gn=V(V({},fe),{},{mouseOnly:(e=!0)=>e});class Hn extends Oe{constructor(...t){super(...t),F(this,"ingKey","scrolling")}scroll(t){this.state._active||this.start(t),this.scrollChange(t),this.timeoutStore.add("scrollEnd",this.scrollEnd.bind(this))}scrollChange(t){t.cancelable&&t.preventDefault();const r=this.state,i=Tn(t);r._delta=D.sub(i,r._values),D.addTo(r._movement,r._delta),this.computeValues(i),this.compute(t),this.emit()}scrollEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){t("scroll","",this.scroll.bind(this))}}const Qn=fe;class Xn extends Oe{constructor(...t){super(...t),F(this,"ingKey","wheeling")}wheel(t){this.state._active||this.start(t),this.wheelChange(t),this.timeoutStore.add("wheelEnd",this.wheelEnd.bind(this))}wheelChange(t){const r=this.state;r._delta=Tr(t),D.addTo(r._movement,r._delta),Dr(r),this.compute(t),this.emit()}wheelEnd(){this.state._active&&(this.state._active=!1,this.compute(),this.emit())}bind(t){t("wheel","",this.wheel.bind(this))}}const Jn=fe;class Zn extends Oe{constructor(...t){super(...t),F(this,"ingKey","hovering")}enter(t){this.config.mouseOnly&&t.pointerType!=="mouse"||(this.start(t),this.computeValues(ge(t)),this.compute(t),this.emit())}leave(t){if(this.config.mouseOnly&&t.pointerType!=="mouse")return;const r=this.state;if(!r._active)return;r._active=!1;const i=ge(t);r._movement=r._delta=D.sub(i,r._values),this.computeValues(i),this.compute(t),r.delta=r.movement,this.emit()}bind(t){t("pointer","enter",this.enter.bind(this)),t("pointer","leave",this.leave.bind(this))}}const es=V(V({},fe),{},{mouseOnly:(e=!0)=>e}),At=new Map,xt=new Map;function ts(e){At.set(e.key,e.engine),xt.set(e.key,e.resolver)}const rs={key:"drag",engine:Rn,resolver:Cr},is={key:"hover",engine:Zn,resolver:es},ns={key:"move",engine:Wn,resolver:Gn},ss={key:"pinch",engine:Kn,resolver:zn},os={key:"scroll",engine:Hn,resolver:Qn},as={key:"wheel",engine:Xn,resolver:Jn};function us(e,t){if(e==null)return{};var r={},i=Object.keys(e),n,o;for(o=0;o<i.length;o++)n=i[o],!(t.indexOf(n)>=0)&&(r[n]=e[n]);return r}function cs(e,t){if(e==null)return{};var r=us(e,t),i,n;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)i=o[n],!(t.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(e,i)&&(r[i]=e[i])}return r}const ls={target(e){if(e)return()=>"current"in e?e.current:e},enabled(e=!0){return e},window(e=G.isBrowser?window:void 0){return e},eventOptions({passive:e=!0,capture:t=!1}={}){return{passive:e,capture:t}},transform(e){return e}},fs=["target","eventOptions","window","enabled","transform"];function tt(e={},t){const r={};for(const[i,n]of Object.entries(t))switch(typeof n){case"function":if(process.env.NODE_ENV==="development"){const o=n.call(r,e[i],i,e);Number.isNaN(o)||(r[i]=o)}else r[i]=n.call(r,e[i],i,e);break;case"object":r[i]=tt(e[i],n);break;case"boolean":n&&(r[i]=e[i]);break}return r}function ds(e,t,r={}){const i=e,{target:n,eventOptions:o,window:a,enabled:u,transform:l}=i,c=cs(i,fs);if(r.shared=tt({target:n,eventOptions:o,window:a,enabled:u,transform:l},ls),t){const f=xt.get(t);r[t]=tt(V({shared:r.shared},c),f)}else for(const f in c){const p=xt.get(f);if(p)r[f]=tt(V({shared:r.shared},c[f]),p);else if(process.env.NODE_ENV==="development"&&!["drag","pinch","scroll","wheel","move","hover"].includes(f)){if(f==="domTarget")throw Error("[@use-gesture]: `domTarget` option has been renamed to `target`.");console.warn(`[@use-gesture]: Unknown config key \`${f}\` was used. Please read the documentation for further information.`)}}return r}class Vr{constructor(t,r){F(this,"_listeners",new Set),this._ctrl=t,this._gestureKey=r}add(t,r,i,n,o){const a=this._listeners,u=bn(r,i),l=this._gestureKey?this._ctrl.config[this._gestureKey].eventOptions:{},c=V(V({},l),o);t.addEventListener(u,n,c);const f=()=>{t.removeEventListener(u,n,c),a.delete(f)};return a.add(f),f}clean(){this._listeners.forEach(t=>t()),this._listeners.clear()}}class hs{constructor(){F(this,"_timeouts",new Map)}add(t,r,i=140,...n){this.remove(t),this._timeouts.set(t,window.setTimeout(r,i,...n))}remove(t){const r=this._timeouts.get(t);r&&window.clearTimeout(r)}clean(){this._timeouts.forEach(t=>void window.clearTimeout(t)),this._timeouts.clear()}}let ps=class{constructor(t){F(this,"gestures",new Set),F(this,"_targetEventStore",new Vr(this)),F(this,"gestureEventStores",{}),F(this,"gestureTimeoutStores",{}),F(this,"handlers",{}),F(this,"config",{}),F(this,"pointerIds",new Set),F(this,"touchIds",new Set),F(this,"state",{shared:{shiftKey:!1,metaKey:!1,ctrlKey:!1,altKey:!1}}),ms(this,t)}setEventIds(t){if(Ze(t))return this.touchIds=new Set(Sn(t)),this.touchIds;if("pointerId"in t)return t.type==="pointerup"||t.type==="pointercancel"?this.pointerIds.delete(t.pointerId):t.type==="pointerdown"&&this.pointerIds.add(t.pointerId),this.pointerIds}applyHandlers(t,r){this.handlers=t,this.nativeHandlers=r}applyConfig(t,r){this.config=ds(t,r,this.config)}clean(){this._targetEventStore.clean();for(const t of this.gestures)this.gestureEventStores[t].clean(),this.gestureTimeoutStores[t].clean()}effect(){return this.config.shared.target&&this.bind(),()=>this._targetEventStore.clean()}bind(...t){const r=this.config.shared,i={};let n;if(!(r.target&&(n=r.target(),!n))){if(r.enabled){for(const a of this.gestures){const u=this.config[a],l=jr(i,u.eventOptions,!!n);if(u.enabled){const c=At.get(a);new c(this,t,a).bind(l)}}const o=jr(i,r.eventOptions,!!n);for(const a in this.nativeHandlers)o(a,"",u=>this.nativeHandlers[a](V(V({},this.state.shared),{},{event:u,args:t})),void 0,!0)}for(const o in i)i[o]=xn(...i[o]);if(!n)return i;for(const o in i){const{device:a,capture:u,passive:l}=_n(o);this._targetEventStore.add(n,a,"",i[o],{capture:u,passive:l})}}}};function ve(e,t){e.gestures.add(t),e.gestureEventStores[t]=new Vr(e,t),e.gestureTimeoutStores[t]=new hs}function ms(e,t){t.drag&&ve(e,"drag"),t.wheel&&ve(e,"wheel"),t.scroll&&ve(e,"scroll"),t.move&&ve(e,"move"),t.pinch&&ve(e,"pinch"),t.hover&&ve(e,"hover")}const jr=(e,t,r)=>(i,n,o,a={},u=!1)=>{var l,c;const f=(l=a.capture)!==null&&l!==void 0?l:t.capture,p=(c=a.passive)!==null&&c!==void 0?c:t.passive;let m=u?i:vn(i,n,f);r&&p&&(m+="Passive"),e[m]=e[m]||[],e[m].push(o)},gs=/^on(Drag|Wheel|Scroll|Move|Pinch|Hover)/;function vs(e){const t={},r={},i=new Set;for(let n in e)gs.test(n)?(i.add(RegExp.lastMatch),r[n]=e[n]):t[n]=e[n];return[r,t,i]}function ye(e,t,r,i,n,o){if(!e.has(r))return;if(!At.has(i)){process.env.NODE_ENV==="development"&&console.warn(`[@use-gesture]: You've created a custom handler that that uses the \`${i}\` gesture but isn't properly configured.
Please add \`${i}Action\` when creating your handler.`);return}const a=r+"Start",u=r+"End",l=c=>{let f;return c.first&&a in t&&t[a](c),r in t&&(f=t[r](c)),c.last&&u in t&&t[u](c),f};n[i]=l,o[i]=o[i]||{}}function ys(e,t){const[r,i,n]=vs(e),o={};return ye(n,r,"onDrag","drag",o,t),ye(n,r,"onWheel","wheel",o,t),ye(n,r,"onScroll","scroll",o,t),ye(n,r,"onPinch","pinch",o,t),ye(n,r,"onMove","move",o,t),ye(n,r,"onHover","hover",o,t),{handlers:o,config:t,nativeHandlers:i}}function _s(e,t={},r,i){const n=O.useMemo(()=>new ps(e),[]);if(n.applyHandlers(e,i),n.applyConfig(t,r),O.useEffect(n.effect.bind(n)),O.useEffect(()=>n.clean.bind(n),[]),t.target===void 0)return n.bind.bind(n)}function bs(e){return e.forEach(ts),function(r,i){const{handlers:n,nativeHandlers:o,config:a}=ys(r,i||{});return _s(n,a,void 0,o)}}function ws(e,t){return bs([rs,ss,os,as,ns,is])(e,{})}var kt=Ce(),P=e=>Re(e,kt),Ot=Ce();P.write=e=>Re(e,Ot);var rt=Ce();P.onStart=e=>Re(e,rt);var It=Ce();P.onFrame=e=>Re(e,It);var Rt=Ce();P.onFinish=e=>Re(e,Rt);var _e=[];P.setTimeout=(e,t)=>{const r=P.now()+t,i=()=>{const o=_e.findIndex(a=>a.cancel==i);~o&&_e.splice(o,1),ue-=~o?1:0},n={time:r,handler:e,cancel:i};return _e.splice(Mr(r),0,n),ue+=1,Fr(),n};var Mr=e=>~(~_e.findIndex(t=>t.time>e)||~_e.length);P.cancel=e=>{rt.delete(e),It.delete(e),Rt.delete(e),kt.delete(e),Ot.delete(e)},P.sync=e=>{Dt=!0,P.batchedUpdates(e),Dt=!1},P.throttle=e=>{let t;function r(){try{e(...t)}finally{t=null}}function i(...n){t=n,P.onStart(r)}return i.handler=e,i.cancel=()=>{rt.delete(r),t=null},i};var Ct=typeof window<"u"?window.requestAnimationFrame:()=>{};P.use=e=>Ct=e,P.now=typeof performance<"u"?()=>performance.now():Date.now,P.batchedUpdates=e=>e(),P.catch=console.error,P.frameLoop="always",P.advance=()=>{P.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Lr()};var ae=-1,ue=0,Dt=!1;function Re(e,t){Dt?(t.delete(e),e(0)):(t.add(e),Fr())}function Fr(){ae<0&&(ae=0,P.frameLoop!=="demand"&&Ct(Nr))}function Es(){ae=-1}function Nr(){~ae&&(Ct(Nr),P.batchedUpdates(Lr))}function Lr(){const e=ae;ae=P.now();const t=Mr(ae);if(t&&(Ur(_e.splice(0,t),r=>r.handler()),ue-=t),!ue){Es();return}rt.flush(),kt.flush(e?Math.min(64,ae-e):16.667),It.flush(),Ot.flush(),Rt.flush()}function Ce(){let e=new Set,t=e;return{add(r){ue+=t==e&&!e.has(r)?1:0,e.add(r)},delete(r){return ue-=t==e&&e.has(r)?1:0,e.delete(r)},flush(r){t.size&&(e=new Set,ue-=t.size,Ur(t,i=>i(r)&&e.add(i)),ue+=e.size,t=e)}}}function Ur(e,t){e.forEach(r=>{try{t(r)}catch(i){P.catch(i)}})}var Ss=Object.defineProperty,Ts=(e,t)=>{for(var r in t)Ss(e,r,{get:t[r],enumerable:!0})},J={};Ts(J,{assign:()=>As,colors:()=>ce,createStringInterpolator:()=>Mt,skipAnimation:()=>Br,to:()=>$r,willAdvance:()=>Ft});function Vt(){}var Ps=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),h={arr:Array.isArray,obj:e=>!!e&&e.constructor.name==="Object",fun:e=>typeof e=="function",str:e=>typeof e=="string",num:e=>typeof e=="number",und:e=>e===void 0};function ne(e,t){if(h.arr(e)){if(!h.arr(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}return e===t}var x=(e,t)=>e.forEach(t);function te(e,t,r){if(h.arr(e)){for(let i=0;i<e.length;i++)t.call(r,e[i],`${i}`);return}for(const i in e)e.hasOwnProperty(i)&&t.call(r,e[i],i)}var z=e=>h.und(e)?[]:h.arr(e)?e:[e];function De(e,t){if(e.size){const r=Array.from(e);e.clear(),x(r,t)}}var Ve=(e,...t)=>De(e,r=>r(...t)),jt=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),Mt,$r,ce=null,Br=!1,Ft=Vt,As=e=>{e.to&&($r=e.to),e.now&&(P.now=e.now),e.colors!==void 0&&(ce=e.colors),e.skipAnimation!=null&&(Br=e.skipAnimation),e.createStringInterpolator&&(Mt=e.createStringInterpolator),e.requestAnimationFrame&&P.use(e.requestAnimationFrame),e.batchedUpdates&&(P.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Ft=e.willAdvance),e.frameLoop&&(P.frameLoop=e.frameLoop)},je=new Set,H=[],Nt=[],it=0,nt={get idle(){return!je.size&&!H.length},start(e){it>e.priority?(je.add(e),P.onStart(xs)):(Yr(e),P(Lt))},advance:Lt,sort(e){if(it)P.onFrame(()=>nt.sort(e));else{const t=H.indexOf(e);~t&&(H.splice(t,1),qr(e))}},clear(){H=[],je.clear()}};function xs(){je.forEach(Yr),je.clear(),P(Lt)}function Yr(e){H.includes(e)||qr(e)}function qr(e){H.splice(ks(H,t=>t.priority>e.priority),0,e)}function Lt(e){const t=Nt;for(let r=0;r<H.length;r++){const i=H[r];it=i.priority,i.idle||(Ft(i),i.advance(e),i.idle||t.push(i))}return it=0,Nt=H,Nt.length=0,H=t,H.length>0}function ks(e,t){const r=e.findIndex(t);return r<0?e.length:r}var Os={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Z="[-+]?\\d*\\.?\\d+",st=Z+"%";function ot(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var Is=new RegExp("rgb"+ot(Z,Z,Z)),Rs=new RegExp("rgba"+ot(Z,Z,Z,Z)),Cs=new RegExp("hsl"+ot(Z,st,st)),Ds=new RegExp("hsla"+ot(Z,st,st,Z)),Vs=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,js=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ms=/^#([0-9a-fA-F]{6})$/,Fs=/^#([0-9a-fA-F]{8})$/;function Ns(e){let t;return typeof e=="number"?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Ms.exec(e))?parseInt(t[1]+"ff",16)>>>0:ce&&ce[e]!==void 0?ce[e]:(t=Is.exec(e))?(be(t[1])<<24|be(t[2])<<16|be(t[3])<<8|255)>>>0:(t=Rs.exec(e))?(be(t[1])<<24|be(t[2])<<16|be(t[3])<<8|Wr(t[4]))>>>0:(t=Vs.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Fs.exec(e))?parseInt(t[1],16)>>>0:(t=js.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Cs.exec(e))?(Kr(zr(t[1]),at(t[2]),at(t[3]))|255)>>>0:(t=Ds.exec(e))?(Kr(zr(t[1]),at(t[2]),at(t[3]))|Wr(t[4]))>>>0:null}function Ut(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Kr(e,t,r){const i=r<.5?r*(1+t):r+t-r*t,n=2*r-i,o=Ut(n,i,e+1/3),a=Ut(n,i,e),u=Ut(n,i,e-1/3);return Math.round(o*255)<<24|Math.round(a*255)<<16|Math.round(u*255)<<8}function be(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function zr(e){return(parseFloat(e)%360+360)%360/360}function Wr(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(t*255)}function at(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Gr(e){let t=Ns(e);if(t===null)return e;t=t||0;const r=(t&4278190080)>>>24,i=(t&16711680)>>>16,n=(t&65280)>>>8,o=(t&255)/255;return`rgba(${r}, ${i}, ${n}, ${o})`}var Me=(e,t,r)=>{if(h.fun(e))return e;if(h.arr(e))return Me({range:e,output:t,extrapolate:r});if(h.str(e.output[0]))return Mt(e);const i=e,n=i.output,o=i.range||[0,1],a=i.extrapolateLeft||i.extrapolate||"extend",u=i.extrapolateRight||i.extrapolate||"extend",l=i.easing||(c=>c);return c=>{const f=Us(c,o);return Ls(c,o[f],o[f+1],n[f],n[f+1],l,a,u,i.map)}};function Ls(e,t,r,i,n,o,a,u,l){let c=l?l(e):e;if(c<t){if(a==="identity")return c;a==="clamp"&&(c=t)}if(c>r){if(u==="identity")return c;u==="clamp"&&(c=r)}return i===n?i:t===r?e<=t?i:n:(t===-1/0?c=-c:r===1/0?c=c-t:c=(c-t)/(r-t),c=o(c),i===-1/0?c=-c:n===1/0?c=c+i:c=c*(n-i)+i,c)}function Us(e,t){for(var r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}var $s={linear:e=>e},Fe=Symbol.for("FluidValue.get"),we=Symbol.for("FluidValue.observers"),Q=e=>!!(e&&e[Fe]),q=e=>e&&e[Fe]?e[Fe]():e,Hr=e=>e[we]||null;function Bs(e,t){e.eventObserved?e.eventObserved(t):e(t)}function Ne(e,t){const r=e[we];r&&r.forEach(i=>{Bs(i,t)})}var Qr=class{constructor(e){if(!e&&!(e=this.get))throw Error("Unknown getter");Ys(this,e)}},Ys=(e,t)=>Xr(e,Fe,t);function Ee(e,t){if(e[Fe]){let r=e[we];r||Xr(e,we,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function Le(e,t){const r=e[we];if(r&&r.has(t)){const i=r.size-1;i?r.delete(t):e[we]=null,e.observerRemoved&&e.observerRemoved(i,t)}}var Xr=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),ut=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,qs=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Jr=new RegExp(`(${ut.source})(%|[a-z]+)`,"i"),Ks=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,ct=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Zr=e=>{const[t,r]=zs(e);if(!t||jt())return e;const i=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(i)return i.trim();if(r&&r.startsWith("--")){const n=window.getComputedStyle(document.documentElement).getPropertyValue(r);return n||e}else{if(r&&ct.test(r))return Zr(r);if(r)return r}return e},zs=e=>{const t=ct.exec(e);if(!t)return[,];const[,r,i]=t;return[r,i]},$t,Ws=(e,t,r,i,n)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(i)}, ${n})`,ei=e=>{$t||($t=ce?new RegExp(`(${Object.keys(ce).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map(o=>q(o).replace(ct,Zr).replace(qs,Gr).replace($t,Gr)),r=t.map(o=>o.match(ut).map(Number)),n=r[0].map((o,a)=>r.map(u=>{if(!(a in u))throw Error('The arity of each "output" value must be equal');return u[a]})).map(o=>Me({...e,output:o}));return o=>{var l;const a=!Jr.test(t[0])&&((l=t.find(c=>Jr.test(c)))==null?void 0:l.replace(ut,""));let u=0;return t[0].replace(ut,()=>`${n[u++](o)}${a||""}`).replace(Ks,Ws)}},Bt="react-spring: ",ti=e=>{const t=e;let r=!1;if(typeof t!="function")throw new TypeError(`${Bt}once requires a function parameter`);return(...i)=>{r||(t(...i),r=!0)}},Gs=ti(console.warn);function Hs(){Gs(`${Bt}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var Qs=ti(console.warn);function Xs(){Qs(`${Bt}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function lt(e){return h.str(e)&&(e[0]=="#"||/\d/.test(e)||!jt()&&ct.test(e)||e in(ce||{}))}var Yt=jt()?O.useEffect:O.useLayoutEffect,Js=()=>{const e=O.useRef(!1);return Yt(()=>(e.current=!0,()=>{e.current=!1}),[]),e};function ri(){const e=O.useState()[1],t=Js();return()=>{t.current&&e(Math.random())}}function Zs(e,t){const[r]=O.useState(()=>({inputs:t,result:e()})),i=O.useRef(),n=i.current;let o=n;return o?t&&o.inputs&&eo(t,o.inputs)||(o={inputs:t,result:e()}):o=r,O.useEffect(()=>{i.current=o,n==r&&(r.inputs=r.result=void 0)},[o]),o.result}function eo(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}var ii=e=>O.useEffect(e,to),to=[];function ni(e){const t=O.useRef();return O.useEffect(()=>{t.current=e}),t.current}var Ue=Symbol.for("Animated:node"),ro=e=>!!e&&e[Ue]===e,re=e=>e&&e[Ue],qt=(e,t)=>Ps(e,Ue,t),ft=e=>e&&e[Ue]&&e[Ue].getPayload(),si=class{constructor(){qt(this,this)}getPayload(){return this.payload||[]}},$e=class extends si{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,h.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new $e(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return h.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,h.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Be=class extends $e{constructor(e){super(0),this._string=null,this._toString=Me({output:[e,e]})}static create(e){return new Be(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(h.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Me({output:[this.getValue(),e]})),this._value=0,super.reset()}},dt={dependencies:null},ht=class extends si{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return te(this.source,(r,i)=>{ro(r)?t[i]=r.getValue(e):Q(r)?t[i]=q(r):e||(t[i]=r)}),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&x(this.payload,e=>e.reset())}_makePayload(e){if(e){const t=new Set;return te(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){dt.dependencies&&Q(e)&&dt.dependencies.add(e);const t=ft(e);t&&x(t,r=>this.add(r))}},oi=class extends ht{constructor(e){super(e)}static create(e){return new oi(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((r,i)=>r.setValue(e[i])).some(Boolean):(super.setValue(e.map(io)),!0)}};function io(e){return(lt(e)?Be:$e).create(e)}function Kt(e){const t=re(e);return t?t.constructor:h.arr(e)?oi:lt(e)?Be:$e}var ai=(e,t)=>{const r=!h.fun(e)||e.prototype&&e.prototype.isReactComponent;return O.forwardRef((i,n)=>{const o=O.useRef(null),a=r&&O.useCallback(w=>{o.current=oo(n,w)},[n]),[u,l]=so(i,t),c=ri(),f=()=>{const w=o.current;if(r&&!w)return;(w?t.applyAnimatedValues(w,u.getValue(!0)):!1)===!1&&c()},p=new no(f,l),m=O.useRef();Yt(()=>(m.current=p,x(l,w=>Ee(w,p)),()=>{m.current&&(x(m.current.deps,w=>Le(w,m.current)),P.cancel(m.current.update))})),O.useEffect(f,[]),ii(()=>()=>{const w=m.current;x(w.deps,b=>Le(b,w))});const y=t.getComponentProps(u.getValue());return wt.createElement(e,{...y,ref:a})})},no=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){e.type=="change"&&P.write(this.update)}};function so(e,t){const r=new Set;return dt.dependencies=r,e.style&&(e={...e,style:t.createAnimatedStyle(e.style)}),e=new ht(e),dt.dependencies=null,[e,r]}function oo(e,t){return e&&(h.fun(e)?e(t):e.current=t),t}var ui=Symbol.for("AnimatedComponent"),ao=(e,{applyAnimatedValues:t=()=>!1,createAnimatedStyle:r=n=>new ht(n),getComponentProps:i=n=>n}={})=>{const n={applyAnimatedValues:t,createAnimatedStyle:r,getComponentProps:i},o=a=>{const u=ci(a)||"Anonymous";return h.str(a)?a=o[a]||(o[a]=ai(a,n)):a=a[ui]||(a[ui]=ai(a,n)),a.displayName=`Animated(${u})`,a};return te(e,(a,u)=>{h.arr(e)&&(u=ci(a)),o[u]=o(a)}),{animated:o}},ci=e=>h.str(e)?e:e&&h.str(e.displayName)?e.displayName:h.fun(e)&&e.name||null;function de(e,...t){return h.fun(e)?e(...t):e}var Ye=(e,t)=>e===!0||!!(t&&e&&(h.fun(e)?e(t):z(e).includes(t))),li=(e,t)=>h.obj(e)?t&&e[t]:e,fi=(e,t)=>e.default===!0?e[t]:e.default?e.default[t]:void 0,uo=e=>e,zt=(e,t=uo)=>{let r=co;e.default&&e.default!==!0&&(e=e.default,r=Object.keys(e));const i={};for(const n of r){const o=t(e[n],n);h.und(o)||(i[n]=o)}return i},co=["config","onProps","onStart","onChange","onPause","onResume","onRest"],lo={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function fo(e){const t={};let r=0;if(te(e,(i,n)=>{lo[n]||(t[n]=i,r++)}),r)return t}function di(e){const t=fo(e);if(t){const r={to:t};return te(e,(i,n)=>n in t||(r[n]=i)),r}return{...e}}function qe(e){return e=q(e),h.arr(e)?e.map(qe):lt(e)?J.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function ho(e){for(const t in e)return!0;return!1}function Wt(e){return h.fun(e)||h.arr(e)&&h.obj(e[0])}function po(e,t){var r;(r=e.ref)==null||r.delete(e),t==null||t.delete(e)}function mo(e,t){var r;t&&e.ref!==t&&((r=e.ref)==null||r.delete(e),t.add(e),e.ref=t)}var go={default:{tension:170,friction:26}},Gt={...go.default,mass:1,damping:1,easing:$s.linear,clamp:!1},vo=class{constructor(){this.velocity=0,Object.assign(this,Gt)}};function yo(e,t,r){r&&(r={...r},hi(r,t),t={...r,...t}),hi(e,t),Object.assign(e,t);for(const a in Gt)e[a]==null&&(e[a]=Gt[a]);let{frequency:i,damping:n}=e;const{mass:o}=e;return h.und(i)||(i<.01&&(i=.01),n<0&&(n=0),e.tension=Math.pow(2*Math.PI/i,2)*o,e.friction=4*Math.PI*n*o/i),e}function hi(e,t){if(!h.und(t.decay))e.duration=void 0;else{const r=!h.und(t.tension)||!h.und(t.friction);(r||!h.und(t.frequency)||!h.und(t.damping)||!h.und(t.mass))&&(e.duration=void 0,e.decay=void 0),r&&(e.frequency=void 0)}}var pi=[],_o=class{constructor(){this.changed=!1,this.values=pi,this.toValues=null,this.fromValues=pi,this.config=new vo,this.immediate=!1}};function mi(e,{key:t,props:r,defaultProps:i,state:n,actions:o}){return new Promise((a,u)=>{let l,c,f=Ye(r.cancel??(i==null?void 0:i.cancel),t);if(f)y();else{h.und(r.pause)||(n.paused=Ye(r.pause,t));let w=i==null?void 0:i.pause;w!==!0&&(w=n.paused||Ye(w,t)),l=de(r.delay||0,t),w?(n.resumeQueue.add(m),o.pause()):(o.resume(),m())}function p(){n.resumeQueue.add(m),n.timeouts.delete(c),c.cancel(),l=c.time-P.now()}function m(){l>0&&!J.skipAnimation?(n.delayed=!0,c=P.setTimeout(y,l),n.pauseQueue.add(p),n.timeouts.add(c)):y()}function y(){n.delayed&&(n.delayed=!1),n.pauseQueue.delete(p),n.timeouts.delete(c),e<=(n.cancelId||0)&&(f=!0);try{o.start({...r,callId:e,cancel:f},a)}catch(w){u(w)}}})}var Ht=(e,t)=>t.length==1?t[0]:t.some(r=>r.cancelled)?Se(e.get()):t.every(r=>r.noop)?gi(e.get()):ee(e.get(),t.every(r=>r.finished)),gi=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),ee=(e,t,r=!1)=>({value:e,finished:t,cancelled:r}),Se=e=>({value:e,cancelled:!0,finished:!1});function vi(e,t,r,i){const{callId:n,parentId:o,onRest:a}=t,{asyncTo:u,promise:l}=r;return!o&&e===u&&!t.reset?l:r.promise=(async()=>{r.asyncId=n,r.asyncTo=e;const c=zt(t,(T,v)=>v==="onRest"?void 0:T);let f,p;const m=new Promise((T,v)=>(f=T,p=v)),y=T=>{const v=n<=(r.cancelId||0)&&Se(i)||n!==r.asyncId&&ee(i,!1);if(v)throw T.result=v,p(T),T},w=(T,v)=>{const _=new yi,S=new _i;return(async()=>{if(J.skipAnimation)throw Ke(r),S.result=ee(i,!1),p(S),S;y(_);const I=h.obj(T)?{...T}:{...v,to:T};I.parentId=n,te(c,(L,U)=>{h.und(I[U])&&(I[U]=L)});const j=await i.start(I);return y(_),r.paused&&await new Promise(L=>{r.resumeQueue.add(L)}),j})()};let b;if(J.skipAnimation)return Ke(r),ee(i,!1);try{let T;h.arr(e)?T=(async v=>{for(const _ of v)await w(_)})(e):T=Promise.resolve(e(w,i.stop.bind(i))),await Promise.all([T.then(f),m]),b=ee(i.get(),!0,!1)}catch(T){if(T instanceof yi)b=T.result;else if(T instanceof _i)b=T.result;else throw T}finally{n==r.asyncId&&(r.asyncId=o,r.asyncTo=o?u:void 0,r.promise=o?l:void 0)}return h.fun(a)&&P.batchedUpdates(()=>{a(b,i,i.item)}),b})()}function Ke(e,t){De(e.timeouts,r=>r.cancel()),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var yi=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},_i=class extends Error{constructor(){super("SkipAnimationSignal")}},Qt=e=>e instanceof Xt,bo=1,Xt=class extends Qr{constructor(){super(...arguments),this.id=bo++,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=re(this);return e&&e.getValue()}to(...e){return J.to(this,e)}interpolate(...e){return Hs(),J.to(this,e)}toJSON(){return this.get()}observerAdded(e){e==1&&this._attach()}observerRemoved(e){e==0&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Ne(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||nt.sort(this),Ne(this,{type:"priority",parent:this,priority:e})}},he=Symbol.for("SpringPhase"),bi=1,Jt=2,Zt=4,er=e=>(e[he]&bi)>0,le=e=>(e[he]&Jt)>0,ze=e=>(e[he]&Zt)>0,wi=(e,t)=>t?e[he]|=Jt|bi:e[he]&=~Jt,Ei=(e,t)=>t?e[he]|=Zt:e[he]&=~Zt,wo=class extends Xt{constructor(e,t){if(super(),this.animation=new _o,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!h.und(e)||!h.und(t)){const r=h.obj(e)?{...e}:{...t,from:e};h.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(le(this)||this._state.asyncTo)||ze(this)}get goal(){return q(this.animation.to)}get velocity(){const e=re(this);return e instanceof $e?e.lastVelocity||0:e.getPayload().map(t=>t.lastVelocity||0)}get hasAnimated(){return er(this)}get isAnimating(){return le(this)}get isPaused(){return ze(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,r=!1;const i=this.animation;let{toValues:n}=i;const{config:o}=i,a=ft(i.to);!a&&Q(i.to)&&(n=z(q(i.to))),i.values.forEach((c,f)=>{if(c.done)return;const p=c.constructor==Be?1:a?a[f].lastPosition:n[f];let m=i.immediate,y=p;if(!m){if(y=c.lastPosition,o.tension<=0){c.done=!0;return}let w=c.elapsedTime+=e;const b=i.fromValues[f],T=c.v0!=null?c.v0:c.v0=h.arr(o.velocity)?o.velocity[f]:o.velocity;let v;const _=o.precision||(b==p?.005:Math.min(1,Math.abs(p-b)*.001));if(h.und(o.duration))if(o.decay){const S=o.decay===!0?.998:o.decay,I=Math.exp(-(1-S)*w);y=b+T/(1-S)*(1-I),m=Math.abs(c.lastPosition-y)<=_,v=T*I}else{v=c.lastVelocity==null?T:c.lastVelocity;const S=o.restVelocity||_/10,I=o.clamp?0:o.bounce,j=!h.und(I),L=b==p?c.v0>0:b<p;let U,Te=!1;const $=1,pe=Math.ceil(e/$);for(let W=0;W<pe&&(U=Math.abs(v)>S,!(!U&&(m=Math.abs(p-y)<=_,m)));++W){j&&(Te=y==p||y>p==L,Te&&(v=-v*I,y=p));const se=-o.tension*1e-6*(y-p),B=-o.friction*.001*v,oe=(se+B)/o.mass;v=v+oe*$,y=y+v*$}}else{let S=1;o.duration>0&&(this._memoizedDuration!==o.duration&&(this._memoizedDuration=o.duration,c.durationProgress>0&&(c.elapsedTime=o.duration*c.durationProgress,w=c.elapsedTime+=e)),S=(o.progress||0)+w/this._memoizedDuration,S=S>1?1:S<0?0:S,c.durationProgress=S),y=b+o.easing(S)*(p-b),v=(y-c.lastPosition)/e,m=S==1}c.lastVelocity=v,Number.isNaN(y)&&(console.warn("Got NaN while animating:",this),m=!0)}a&&!a[f].done&&(m=!1),m?c.done=!0:t=!1,c.setValue(y,o.round)&&(r=!0)});const u=re(this),l=u.getValue();if(t){const c=q(i.to);(l!==c||r)&&!o.decay?(u.setValue(c),this._onChange(c)):r&&o.decay&&this._onChange(l),this._stop()}else r&&this._onChange(l)}set(e){return P.batchedUpdates(()=>{this._stop(),this._focus(e),this._set(e)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(le(this)){const{to:e,config:t}=this.animation;P.batchedUpdates(()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()})}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let r;return h.und(e)?(r=this.queue||[],this.queue=[]):r=[h.obj(e)?e:{...t,to:e}],Promise.all(r.map(i=>this._update(i))).then(i=>Ht(this,i))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Ke(this._state,e&&this._lastCallId),P.batchedUpdates(()=>this._stop(t,e)),this}reset(){this._update({reset:!0})}eventObserved(e){e.type=="change"?this._start():e.type=="priority"&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:r,from:i}=e;r=h.obj(r)?r[t]:r,(r==null||Wt(r))&&(r=void 0),i=h.obj(i)?i[t]:i,i==null&&(i=void 0);const n={to:r,from:i};return er(this)||(e.reverse&&([r,i]=[i,r]),i=q(i),h.und(i)?re(this)||this._set(r):this._set(i)),n}_update({...e},t){const{key:r,defaultProps:i}=this;e.default&&Object.assign(i,zt(e,(a,u)=>/^on/.test(u)?li(a,r):a)),Pi(this,e,"onProps"),He(this,"onProps",e,this);const n=this._prepareNode(e);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const o=this._state;return mi(++this._lastCallId,{key:r,props:e,defaultProps:i,state:o,actions:{pause:()=>{ze(this)||(Ei(this,!0),Ve(o.pauseQueue),He(this,"onPause",ee(this,We(this,this.animation.to)),this))},resume:()=>{ze(this)&&(Ei(this,!1),le(this)&&this._resume(),Ve(o.resumeQueue),He(this,"onResume",ee(this,We(this,this.animation.to)),this))},start:this._merge.bind(this,n)}}).then(a=>{if(e.loop&&a.finished&&!(t&&a.noop)){const u=Si(e);if(u)return this._update(u,!0)}return a})}_merge(e,t,r){if(t.cancel)return this.stop(!0),r(Se(this));const i=!h.und(e.to),n=!h.und(e.from);if(i||n)if(t.callId>this._lastToId)this._lastToId=t.callId;else return r(Se(this));const{key:o,defaultProps:a,animation:u}=this,{to:l,from:c}=u;let{to:f=l,from:p=c}=e;n&&!i&&(!t.default||h.und(f))&&(f=p),t.reverse&&([f,p]=[p,f]);const m=!ne(p,c);m&&(u.from=p),p=q(p);const y=!ne(f,l);y&&this._focus(f);const w=Wt(t.to),{config:b}=u,{decay:T,velocity:v}=b;(i||n)&&(b.velocity=0),t.config&&!w&&yo(b,de(t.config,o),t.config!==a.config?de(a.config,o):void 0);let _=re(this);if(!_||h.und(f))return r(ee(this,!0));const S=h.und(t.reset)?n&&!t.default:!h.und(p)&&Ye(t.reset,o),I=S?p:this.get(),j=qe(f),L=h.num(j)||h.arr(j)||lt(j),U=!w&&(!L||Ye(a.immediate||t.immediate,o));if(y){const W=Kt(f);if(W!==_.constructor)if(U)_=this._set(j);else throw Error(`Cannot animate between ${_.constructor.name} and ${W.name}, as the "to" prop suggests`)}const Te=_.constructor;let $=Q(f),pe=!1;if(!$){const W=S||!er(this)&&m;(y||W)&&(pe=ne(qe(I),j),$=!pe),(!ne(u.immediate,U)&&!U||!ne(b.decay,T)||!ne(b.velocity,v))&&($=!0)}if(pe&&le(this)&&(u.changed&&!S?$=!0:$||this._stop(l)),!w&&(($||Q(l))&&(u.values=_.getPayload(),u.toValues=Q(f)?null:Te==Be?[1]:z(j)),u.immediate!=U&&(u.immediate=U,!U&&!S&&this._set(l)),$)){const{onRest:W}=u;x(So,B=>Pi(this,t,B));const se=ee(this,We(this,l));Ve(this._pendingCalls,se),this._pendingCalls.add(r),u.changed&&P.batchedUpdates(()=>{var B;u.changed=!S,W==null||W(se,this),S?de(a.onRest,se):(B=u.onStart)==null||B.call(u,se,this)})}S&&this._set(I),w?r(vi(t.to,t,this._state,this)):$?this._start():le(this)&&!y?this._pendingCalls.add(r):r(gi(I))}_focus(e){const t=this.animation;e!==t.to&&(Hr(this)&&this._detach(),t.to=e,Hr(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Q(t)&&(Ee(t,this),Qt(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Q(e)&&Le(e,this)}_set(e,t=!0){const r=q(e);if(!h.und(r)){const i=re(this);if(!i||!ne(r,i.getValue())){const n=Kt(r);!i||i.constructor!=n?qt(this,n.create(r)):i.setValue(r),i&&P.batchedUpdates(()=>{this._onChange(r,t)})}}return re(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,He(this,"onStart",ee(this,We(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),de(this.animation.onChange,e,this)),de(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;re(this).reset(q(e.to)),e.immediate||(e.fromValues=e.values.map(t=>t.lastPosition)),le(this)||(wi(this,!0),ze(this)||this._resume())}_resume(){J.skipAnimation?this.finish():nt.start(this)}_stop(e,t){if(le(this)){wi(this,!1);const r=this.animation;x(r.values,n=>{n.done=!0}),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),Ne(this,{type:"idle",parent:this});const i=t?Se(this.get()):ee(this.get(),We(this,e??r.to));Ve(this._pendingCalls,i),r.changed&&(r.changed=!1,He(this,"onRest",i,this))}}};function We(e,t){const r=qe(t),i=qe(e.get());return ne(i,r)}function Si(e,t=e.loop,r=e.to){const i=de(t);if(i){const n=i!==!0&&di(i),o=(n||e).reverse,a=!n||n.reset;return Ge({...e,loop:t,default:!1,pause:void 0,to:!o||Wt(r)?r:void 0,from:a?e.from:void 0,reset:a,...n})}}function Ge(e){const{to:t,from:r}=e=di(e),i=new Set;return h.obj(t)&&Ti(t,i),h.obj(r)&&Ti(r,i),e.keys=i.size?Array.from(i):null,e}function Eo(e){const t=Ge(e);return h.und(t.default)&&(t.default=zt(t)),t}function Ti(e,t){te(e,(r,i)=>r!=null&&t.add(i))}var So=["onStart","onRest","onChange","onPause","onResume"];function Pi(e,t,r){e.animation[r]=t[r]!==fi(t,r)?li(t[r],e.key):void 0}function He(e,t,...r){var i,n,o,a;(n=(i=e.animation)[t])==null||n.call(i,...r),(a=(o=e.defaultProps)[t])==null||a.call(o,...r)}var To=["onStart","onChange","onRest"],Po=1,Ao=class{constructor(e,t){this.id=Po++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start({default:!0,...e})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(e=>e.idle&&!e.isDelayed&&!e.isPaused)}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each((t,r)=>e[r]=t.get()),e}set(e){for(const t in e){const r=e[t];h.und(r)||this.springs[t].set(r)}}update(e){return e&&this.queue.push(Ge(e)),this}start(e){let{queue:t}=this;return e?t=z(e).map(Ge):this.queue=[],this._flush?this._flush(this,t):(Ri(this,t),tr(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const r=this.springs;x(z(t),i=>r[i].stop(!!e))}else Ke(this._state,this._lastAsyncId),this.each(r=>r.stop(!!e));return this}pause(e){if(h.und(e))this.start({pause:!0});else{const t=this.springs;x(z(e),r=>t[r].pause())}return this}resume(e){if(h.und(e))this.start({pause:!1});else{const t=this.springs;x(z(e),r=>t[r].resume())}return this}each(e){te(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:r}=this._events,i=this._active.size>0,n=this._changed.size>0;(i&&!this._started||n&&!this._started)&&(this._started=!0,De(e,([u,l])=>{l.value=this.get(),u(l,this,this._item)}));const o=!i&&this._started,a=n||o&&r.size?this.get():null;n&&t.size&&De(t,([u,l])=>{l.value=a,u(l,this,this._item)}),o&&(this._started=!1,De(r,([u,l])=>{l.value=a,u(l,this,this._item)}))}eventObserved(e){if(e.type=="change")this._changed.add(e.parent),e.idle||this._active.add(e.parent);else if(e.type=="idle")this._active.delete(e.parent);else return;P.onFrame(this._onFrame)}};function tr(e,t){return Promise.all(t.map(r=>Ai(e,r))).then(r=>Ht(e,r))}async function Ai(e,t,r){const{keys:i,to:n,from:o,loop:a,onRest:u,onResolve:l}=t,c=h.obj(t.default)&&t.default;a&&(t.loop=!1),n===!1&&(t.to=null),o===!1&&(t.from=null);const f=h.arr(n)||h.fun(n)?n:void 0;f?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):x(To,b=>{const T=t[b];if(h.fun(T)){const v=e._events[b];t[b]=({finished:_,cancelled:S})=>{const I=v.get(T);I?(_||(I.finished=!1),S&&(I.cancelled=!0)):v.set(T,{value:null,finished:_||!1,cancelled:S||!1})},c&&(c[b]=t[b])}});const p=e._state;t.pause===!p.paused?(p.paused=t.pause,Ve(t.pause?p.pauseQueue:p.resumeQueue)):p.paused&&(t.pause=!0);const m=(i||Object.keys(e.springs)).map(b=>e.springs[b].start(t)),y=t.cancel===!0||fi(t,"cancel")===!0;(f||y&&p.asyncId)&&m.push(mi(++e._lastAsyncId,{props:t,state:p,actions:{pause:Vt,resume:Vt,start(b,T){y?(Ke(p,e._lastAsyncId),T(Se(e))):(b.onRest=u,T(vi(f,b,p,e)))}}})),p.paused&&await new Promise(b=>{p.resumeQueue.add(b)});const w=Ht(e,await Promise.all(m));if(a&&w.finished&&!(r&&w.noop)){const b=Si(t,a,n);if(b)return Ri(e,[b]),Ai(e,b,!0)}return l&&P.batchedUpdates(()=>l(w,e,e.item)),w}function xi(e,t){const r={...e.springs};return t&&x(z(t),i=>{h.und(i.keys)&&(i=Ge(i)),h.obj(i.to)||(i={...i,to:void 0}),Ii(r,i,n=>Oi(n))}),ki(e,r),r}function ki(e,t){te(t,(r,i)=>{e.springs[i]||(e.springs[i]=r,Ee(r,e))})}function Oi(e,t){const r=new wo;return r.key=e,t&&Ee(r,t),r}function Ii(e,t,r){t.keys&&x(t.keys,i=>{(e[i]||(e[i]=r(i)))._prepareNode(t)})}function Ri(e,t){x(t,r=>{Ii(e.springs,r,i=>Oi(i,e))})}var pt=({children:e,...t})=>{const r=O.useContext(mt),i=t.pause||!!r.pause,n=t.immediate||!!r.immediate;t=Zs(()=>({pause:i,immediate:n}),[i,n]);const{Provider:o}=mt;return wt.createElement(o,{value:t},e)},mt=xo(pt,{});pt.Provider=mt.Provider,pt.Consumer=mt.Consumer;function xo(e,t){return Object.assign(e,wt.createContext(t)),e.Provider._context=e,e.Consumer._context=e,e}var ko=()=>{const e=[],t=function(i){Xs();const n=[];return x(e,(o,a)=>{if(h.und(i))n.push(o.start());else{const u=r(i,o,a);u&&n.push(o.start(u))}}),n};t.current=e,t.add=function(i){e.includes(i)||e.push(i)},t.delete=function(i){const n=e.indexOf(i);~n&&e.splice(n,1)},t.pause=function(){return x(e,i=>i.pause(...arguments)),this},t.resume=function(){return x(e,i=>i.resume(...arguments)),this},t.set=function(i){x(e,(n,o)=>{const a=h.fun(i)?i(o,n):i;a&&n.set(a)})},t.start=function(i){const n=[];return x(e,(o,a)=>{if(h.und(i))n.push(o.start());else{const u=this._getProps(i,o,a);u&&n.push(o.start(u))}}),n},t.stop=function(){return x(e,i=>i.stop(...arguments)),this},t.update=function(i){return x(e,(n,o)=>n.update(this._getProps(i,n,o))),this};const r=function(i,n,o){return h.fun(i)?i(o,n):i};return t._getProps=r,t};function Oo(e,t,r){const i=h.fun(t)&&t;i&&!r&&(r=[]);const n=O.useMemo(()=>i||arguments.length==3?ko():void 0,[]),o=O.useRef(0),a=ri(),u=O.useMemo(()=>({ctrls:[],queue:[],flush(v,_){const S=xi(v,_);return o.current>0&&!u.queue.length&&!Object.keys(S).some(j=>!v.springs[j])?tr(v,_):new Promise(j=>{ki(v,S),u.queue.push(()=>{j(tr(v,_))}),a()})}}),[]),l=O.useRef([...u.ctrls]),c=[],f=ni(e)||0;O.useMemo(()=>{x(l.current.slice(e,f),v=>{po(v,n),v.stop(!0)}),l.current.length=e,p(f,e)},[e]),O.useMemo(()=>{p(0,Math.min(f,e))},r);function p(v,_){for(let S=v;S<_;S++){const I=l.current[S]||(l.current[S]=new Ao(null,u.flush)),j=i?i(S,I):t[S];j&&(c[S]=Eo(j))}}const m=l.current.map((v,_)=>xi(v,c[_])),y=O.useContext(pt),w=ni(y),b=y!==w&&ho(y);Yt(()=>{o.current++,u.ctrls=l.current;const{queue:v}=u;v.length&&(u.queue=[],x(v,_=>_())),x(l.current,(_,S)=>{n==null||n.add(_),b&&_.start({default:y});const I=c[S];I&&(mo(_,I.ref),_.ref?_.queue.push(I):_.start(I))})}),ii(()=>()=>{x(u.ctrls,v=>v.stop(!0))});const T=m.map(v=>({...v}));return n?[T,n]:T}function Io(e,t){const r=h.fun(e),[[i],n]=Oo(1,r?e:[e],r?[]:t);return r||arguments.length==2?[i,n]:i}var Ro=class extends Xt{constructor(e,t){super(),this.source=e,this.idle=!0,this._active=new Set,this.calc=Me(...t);const r=this._get(),i=Kt(r);qt(this,i.create(r))}advance(e){const t=this._get(),r=this.get();ne(t,r)||(re(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Ci(this._active)&&rr(this)}_get(){const e=h.arr(this.source)?this.source.map(q):z(q(this.source));return this.calc(...e)}_start(){this.idle&&!Ci(this._active)&&(this.idle=!1,x(ft(this),e=>{e.done=!1}),J.skipAnimation?(P.batchedUpdates(()=>this.advance()),rr(this)):nt.start(this))}_attach(){let e=1;x(z(this.source),t=>{Q(t)&&Ee(t,this),Qt(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))}),this.priority=e,this._start()}_detach(){x(z(this.source),e=>{Q(e)&&Le(e,this)}),this._active.clear(),rr(this)}eventObserved(e){e.type=="change"?e.idle?this.advance():(this._active.add(e.parent),this._start()):e.type=="idle"?this._active.delete(e.parent):e.type=="priority"&&(this.priority=z(this.source).reduce((t,r)=>Math.max(t,(Qt(r)?r.priority:0)+1),0))}};function Co(e){return e.idle!==!1}function Ci(e){return!e.size||Array.from(e).every(Co)}function rr(e){e.idle||(e.idle=!0,x(ft(e),t=>{t.done=!0}),Ne(e,{type:"idle",parent:e}))}J.assign({createStringInterpolator:ei,to:(e,t)=>new Ro(e,t)});var Di=/^--/;function Do(e,t){return t==null||typeof t=="boolean"||t===""?"":typeof t=="number"&&t!==0&&!Di.test(e)&&!(Qe.hasOwnProperty(e)&&Qe[e])?t+"px":(""+t).trim()}var Vi={};function Vo(e,t){if(!e.nodeType||!e.setAttribute)return!1;const r=e.nodeName==="filter"||e.parentNode&&e.parentNode.nodeName==="filter",{className:i,style:n,children:o,scrollTop:a,scrollLeft:u,viewBox:l,...c}=t,f=Object.values(c),p=Object.keys(c).map(m=>r||e.hasAttribute(m)?m:Vi[m]||(Vi[m]=m.replace(/([A-Z])/g,y=>"-"+y.toLowerCase())));o!==void 0&&(e.textContent=o);for(const m in n)if(n.hasOwnProperty(m)){const y=Do(m,n[m]);Di.test(m)?e.style.setProperty(m,y):e.style[m]=y}p.forEach((m,y)=>{e.setAttribute(m,f[y])}),i!==void 0&&(e.className=i),a!==void 0&&(e.scrollTop=a),u!==void 0&&(e.scrollLeft=u),l!==void 0&&e.setAttribute("viewBox",l)}var Qe={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},jo=(e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1),Mo=["Webkit","Ms","Moz","O"];Qe=Object.keys(Qe).reduce((e,t)=>(Mo.forEach(r=>e[jo(r,t)]=e[t]),e),Qe);var Fo=/^(matrix|translate|scale|rotate|skew)/,No=/^(translate)/,Lo=/^(rotate|skew)/,ir=(e,t)=>h.num(e)&&e!==0?e+t:e,gt=(e,t)=>h.arr(e)?e.every(r=>gt(r,t)):h.num(e)?e===t:parseFloat(e)===t,Uo=class extends ht{constructor({x:e,y:t,z:r,...i}){const n=[],o=[];(e||t||r)&&(n.push([e||0,t||0,r||0]),o.push(a=>[`translate3d(${a.map(u=>ir(u,"px")).join(",")})`,gt(a,0)])),te(i,(a,u)=>{if(u==="transform")n.push([a||""]),o.push(l=>[l,l===""]);else if(Fo.test(u)){if(delete i[u],h.und(a))return;const l=No.test(u)?"px":Lo.test(u)?"deg":"";n.push(z(a)),o.push(u==="rotate3d"?([c,f,p,m])=>[`rotate3d(${c},${f},${p},${ir(m,l)})`,gt(m,0)]:c=>[`${u}(${c.map(f=>ir(f,l)).join(",")})`,gt(c,u.startsWith("scale")?1:0)])}}),n.length&&(i.transform=new $o(n,o)),super(i)}},$o=class extends Qr{constructor(e,t){super(),this.inputs=e,this.transforms=t,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return x(this.inputs,(r,i)=>{const n=q(r[0]),[o,a]=this.transforms[i](h.arr(n)?n:r.map(q));e+=" "+o,t=t&&a}),t?"none":e}observerAdded(e){e==1&&x(this.inputs,t=>x(t,r=>Q(r)&&Ee(r,this)))}observerRemoved(e){e==0&&x(this.inputs,t=>x(t,r=>Q(r)&&Le(r,this)))}eventObserved(e){e.type=="change"&&(this._value=null),Ne(this,e)}},Bo=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];J.assign({batchedUpdates:sn.unstable_batchedUpdates,createStringInterpolator:ei,colors:Os}),ao(Bo,{applyAnimatedValues:Vo,createAnimatedStyle:e=>new Uo(e),getComponentProps:({scrollTop:e,scrollLeft:t,...r})=>r});function Yo(e,t){const[{x:r},i]=Io(()=>({x:0}));return{bind:ws({onDrag:({down:o,movement:[a],direction:[u],velocity:l})=>{!o&&l>.2?(u>0?t():e(),i.start({x:0})):i.start({x:o?a:0})}}),style:{x:r}}}ie.SwipeCard=ln,ie.useSwipe=Yo,Object.defineProperty(ie,Symbol.toStringTag,{value:"Module"})});