@twilio-labs/dev-phone-ui
Version:
A react-based UI for the Twilio CLI softphone plugin
2 lines • 2.48 MB
JavaScript
/*! For license information please see vendor.bundle.f276ef119516c9916051.js.LICENSE.txt */
(self.webpackChunk_twilio_labs_dev_phone_ui=self.webpackChunk_twilio_labs_dev_phone_ui||[]).push([[502],{39812:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AccountSwitcher:()=>m,AccountSwitcherBadge:()=>w,AccountSwitcherGroup:()=>v,AccountSwitcherItem:()=>b,AccountSwitcherItemRadio:()=>_,AccountSwitcherSeparator:()=>y,useAccountSwitcherState:()=>a.EH});var n=r(7552),o=r(72306),a=r(25771),i=Object.defineProperty,s=Object.defineProperties,l=Object.getOwnPropertyDescriptors,c=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,d=Object.prototype.propertyIsEnumerable,f=(e,t,r)=>t in e?i(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,p=(e,t)=>{for(var r in t||(t={}))u.call(t,r)&&f(e,r,t[r]);if(c)for(var r of c(t))d.call(t,r)&&f(e,r,t[r]);return e},h=(e,t)=>s(e,l(t)),g=(e,t)=>{var r={};for(var n in e)u.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&c)for(var n of c(e))t.indexOf(n)<0&&d.call(e,n)&&(r[n]=e[n]);return r},m=n.forwardRef(((e,t)=>{var r=e,{children:a,element:i="ACCOUNT_SWITCHER"}=r,s=g(r,["children","element"]);return n.createElement(o.Menu,h(p({element:i},s),{ref:t}),a)}));m.displayName="AccountSwitcher",m.propTypes=o.MenuPropTypes;var v=n.forwardRef(((e,t)=>{var r=e,{children:a,element:i="ACCOUNT_SWITCHER_GROUP",label:s}=r,l=g(r,["children","element","label"]);return n.createElement(o.MenuGroup,h(p({label:s,element:i},l),{ref:t}),a)}));v.displayName="AccountSwitcherGroup",v.propTypes=o.MenuGroupPropTypes;var y=n.forwardRef(((e,t)=>{var r=e,{children:a,element:i="ACCOUNT_SWITCHER_SEPARATOR"}=r,s=g(r,["children","element"]);return n.createElement(o.MenuSeparator,h(p({element:i},s),{ref:t}),a)}));y.displayName="AccountSwitcherSeparator";var b=n.forwardRef(((e,t)=>{var r=e,{children:a,element:i="ACCOUNT_SWITCHER_ITEM"}=r,s=g(r,["children","element"]);return n.createElement(o.MenuItem,h(p({element:i},s),{ref:t}),a)}));b.displayName="AccountSwitcherItem",b.propTypes=o.MenuItemPropTypes;var _=n.forwardRef(((e,t)=>{var r=e,{children:a,element:i="ACCOUNT_SWITCHER_ITEM_RADIO"}=r,s=g(r,["children","element"]);return n.createElement(o.MenuItemRadio,h(p({element:i},s),{ref:t}),a)}));_.displayName="AccountSwitcherItemRadio",_.propTypes=o.MenuItemRadioPropTypes;var w=n.forwardRef(((e,t)=>{var r=e,{children:a,element:i="ACCOUNT_SWITCHER_BADGE"}=r,s=g(r,["children","element"]);return n.createElement(o.MenuBadge,h(p({element:i},s),{variant:"default",ref:t}),a)})),x=o.MenuBadgePropTypes,{variant:k}=x,S=g(x,["variant"]);w.displayName="AccountSwitcherBadge",w.propTypes=S},98780:(e,t,r)=>{"use strict";r.r(t),r.d(t,{AlertDialog:()=>y});var n=r(7552),o=r(15152),a=r.n(o),i=r(77445),s=r(2117),l=r(19096),c=r(32644),u=r(71171),d=r(56805),f=r(11045),p=r(19421),h=n.forwardRef((({children:e,element:t="ALERT_DIALOG_HEADER",headingID:r,...o},a)=>n.createElement(l.Box,{...(0,l.safelySpreadBoxProps)(o),as:"div",padding:"space90",flexShrink:0,border:"none",element:`${t}_WRAPPER`,ref:a},n.createElement(u.Heading,{as:"h3",element:t,marginBottom:"space0",variant:"heading30",id:r},e))));h.displayName="AlertDialogHeader",h.propTypes={children:a().string.isRequired,headingID:a().string.isRequired,element:a().string};var g=n.forwardRef((({bodyID:e,children:t,element:r="ALERT_DIALOG_BODY",...o},a)=>n.createElement(l.Box,{...(0,l.safelySpreadBoxProps)(o),as:"div",overflowY:"auto",padding:"space90",paddingTop:"space0",element:r,id:e,ref:a},t)));g.displayName="AlertDialogBody",g.propTypes={bodyID:a().string.isRequired,children:a().node.isRequired,element:a().string};var m=(0,d.I4)(c.ModalDialogContent)((()=>(0,d.AH)({maxWidth:"size40"})));m.displayName="AlertDialogContent";var v=n.forwardRef((({destructive:e,element:t="ALERT_DIALOG_FOOTER",onConfirm:r,onConfirmLabel:o,onDismiss:a,onDismissLabel:i,...s},c)=>{let u=e?"destructive":"primary";return n.createElement(l.Box,{...(0,l.safelySpreadBoxProps)(s),as:"div",flexShrink:0,display:"flex",padding:"space90",paddingTop:"space0",border:"none",element:t,justifyContent:"flex-end",ref:c},n.createElement(p.Stack,{orientation:"horizontal",spacing:"space50"},n.createElement(f.Button,{variant:"secondary",onClick:a},i),n.createElement(f.Button,{variant:u,onClick:r},o)))}));v.displayName="AlertDialogFooter",v.propTypes={destructive:a().bool,element:a().string,onConfirm:a().func.isRequired,onConfirmLabel:a().string.isRequired,onDismiss:a().func.isRequired,onDismissLabel:a().string.isRequired};var y=n.forwardRef((({children:e,destructive:t,element:r="ALERT_DIALOG",heading:o,isOpen:a,onConfirm:u,onConfirmLabel:d,onDismiss:f,onDismissLabel:p,...y},b)=>{let _=(0,s.pn)(a,{from:{opacity:0,transform:"scale(0.675)"},enter:{opacity:1,transform:"scale(1)"},leave:{opacity:0,transform:"scale(0.675)"},config:{mass:.5,tension:370,friction:26}}),w=(0,i.useUID)(),x=(0,i.useUID)();return n.createElement(n.Fragment,null,_(((i,s)=>s&&n.createElement(c.ModalDialogOverlay,{isOpen:a,style:{opacity:i.opacity}},n.createElement(l.Box,{as:m,...(0,l.safelySpreadBoxProps)(y),"aria-labelledby":w,"aria-describedby":x,element:r,ref:b,role:"alertdialog",style:i},n.createElement(h,{headingID:w,element:`${r}_HEADER`},o),n.createElement(g,{bodyID:x,element:`${r}_BODY`},e),n.createElement(v,{destructive:t,element:`${r}_FOOTER`,onDismiss:f,onDismissLabel:p,onConfirm:u,onConfirmLabel:d}))))))}));y.displayName="AlertDialog",y.propTypes={children:a().node.isRequired,destructive:a().bool,element:a().string,heading:a().string.isRequired,isOpen:a().bool.isRequired,onConfirm:a().func.isRequired,onConfirmLabel:a().string.isRequired,onDismiss:a().func.isRequired,onDismissLabel:a().string.isRequired}},59127:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Alert:()=>y,AlertBackgroundColors:()=>m,AlertRoles:()=>h,AlertTextColors:()=>v,AlertVariants:()=>g});var n=r(7552),o=r(15152),a=r.n(o),i=r(19096),s=r(22269),l=r(11045),c=r(64264),u=r(33849),d=r(89895),f=r(97430),p=r(75053),h={ERROR:"alert",NEUTRAL:"status",WARNING:"alert"},g={ERROR:"error",NEUTRAL:"neutral",WARNING:"warning"},m={ERROR:"colorBackgroundErrorWeakest",NEUTRAL:"colorBackgroundNeutralWeakest",WARNING:"colorBackgroundWarningWeakest"},v={ERROR:"colorTextError",NEUTRAL:"colorTextNeutral",WARNING:"colorTextWarningStrong"},y=n.forwardRef((({children:e,onDismiss:t,variant:r,role:o,element:a="ALERT",i18nDismissLabel:y="Dismiss alert",i18nErrorLabel:b="(error)",i18nNeutralLabel:_="(information)",i18nWarningLabel:w="(warning)",...x},k)=>{let S={error:b,neutral:_,warning:w};return n.createElement(i.Box,{...(0,i.safelySpreadBoxProps)(x),backgroundColor:m[r.toUpperCase()],paddingLeft:"space60",paddingRight:"space60",paddingTop:"space60",paddingBottom:"space60",element:a,variant:r,ref:k,role:o??h[r.toUpperCase()]},n.createElement(s.MediaObject,{as:"div"},n.createElement(s.MediaFigure,{as:"div",spacing:"space30"},((e,t,r)=>{switch(e){case g.ERROR:return n.createElement(d.I,{element:`${t}_ICON`,color:"colorTextIconError",decorative:!1,title:r,size:"sizeIcon20"});case g.WARNING:return n.createElement(p.i,{element:`${t}_ICON`,color:"colorTextIconWarning",decorative:!1,title:r,size:"sizeIcon20"});case g.NEUTRAL:default:return n.createElement(f.r,{element:`${t}_ICON`,color:"colorTextIconNeutral",decorative:!1,title:r,size:"sizeIcon20"})}})(r,a,S[r])),n.createElement(s.MediaBody,{as:"div"},n.createElement(i.Box,{color:v[r.toUpperCase()]},e)),t&&"function"==typeof t&&n.createElement(s.MediaFigure,{align:"end",spacing:"space60"},n.createElement(l.Button,{onClick:t,variant:"secondary_icon",size:"reset",element:`${a}_DISMISS_BUTTON`},n.createElement(u.U,{element:`${a}_DISMISS_ICON`,decorative:!0,size:"sizeIcon20"}),n.createElement(c.ScreenReaderOnly,null,y)))))}));y.displayName="Alert",y.propTypes={children:a().node.isRequired,onDismiss:a().func,role:a().string,variant:a().oneOf(Object.values(g)).isRequired,element:a().string,i18nDismissLabel:a().string,i18nErrorLabel:a().string,i18nNeutralLabel:a().string,i18nWarningLabel:a().string}},98716:(e,t,r)=>{"use strict";r.r(t),r.d(t,{Anchor:()=>g,isExternalUrl:()=>p,secureExternalLink:()=>h});var n=r(7552),o=r(19096),a=r(32252),i=r(15152),s=r.n(i),l={children:s().node.isRequired,href:s().string.isRequired,rel:s().string,showExternal:s().bool,tabIndex:s().oneOf([0,-1]),target:s().oneOf(["_self","_blank","_parent","_top"]),variant:s().oneOf(["default","inverse"]),element:s().string,i18nExternalLinkLabel:s().string},c=n.forwardRef(((e,t)=>n.createElement(o.Box,{...e,as:"a",color:"colorTextLink",fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",outline:"none",ref:t,textDecoration:"underline",_active:{color:"colorTextLinkStrongest",textDecoration:"none"},_focus:{boxShadow:"shadowFocus",color:"colorTextLink",textDecoration:"underline"},_hover:{color:"colorTextLinkStronger",textDecoration:"none"}},e.children)));c.displayName="DefaultAnchor";var u=n.forwardRef(((e,t)=>n.createElement(o.Box,{...e,as:"a",color:"colorTextInverse",fontSize:"inherit",fontWeight:"inherit",lineHeight:"inherit",outline:"none",ref:t,textDecoration:"underline",_active:{color:"colorTextInverse",textDecoration:"none"},_focus:{boxShadow:"shadowFocusInverse",color:"colorTextInverse",textDecoration:"underline"},_hover:{color:"colorTextInverse",textDecoration:"none"}},e.children)));u.displayName="InverseAnchor";var d={inverse:u,default:c},f=/^(https?:)\S*$/,p=e=>f.test(e),h=e=>{if(p(e))return{rel:"noreferrer noopener",target:"_blank"}},g=n.forwardRef((({element:e="ANCHOR",variant:t="default",showExternal:r,display:i,height:s,minHeight:l,maxHeight:c,width:u,minWidth:f,maxWidth:p,size:g,margin:m,marginBottom:v,marginLeft:y,marginRight:b,marginTop:_,marginX:w=null,marginY:x=null,padding:k,paddingBottom:S,paddingLeft:E,paddingRight:T,paddingTop:C,paddingX:I=null,paddingY:O=null,verticalAlign:P,i18nExternalLinkLabel:R="(link takes you to an external page)",...B},D)=>{let A=d[t];return n.createElement(A,{href:B.href,ref:D,variant:t,...h(B.href),...(0,o.safelySpreadBoxProps)(B),element:e,display:i,height:s,minHeight:l,maxHeight:c,width:u,minWidth:f,maxWidth:p,size:g,margin:m,marginBottom:v,marginLeft:y,marginRight:b,marginTop:_,marginX:w,marginY:x,padding:k,paddingBottom:S,paddingLeft:E,paddingRight:T,paddingTop:C,paddingX:I,paddingY:O,verticalAlign:P},r?n.createElement(o.Box,{as:"span"},B.children,n.createElement(o.Box,{as:"span",display:"inline-block",flexShrink:0,verticalAlign:"middle"},n.createElement(a.H,{decorative:!1,title:R}))):B.children)}));g.displayName="Anchor",g.propTypes=l},2117:(e,t,r)=>{"use strict";r.d(t,{CS:()=>Ur,Ib:()=>qr,RV:()=>j,pn:()=>_r,zh:()=>br});var n=r(7552),o=r(28485),a=w(),i=e=>v(e,a),s=w();i.write=e=>v(e,s);var l=w();i.onStart=e=>v(e,l);var c=w();i.onFrame=e=>v(e,c);var u=w();i.onFinish=e=>v(e,u);var d=[];i.setTimeout=(e,t)=>{let r=i.now()+t,n=()=>{let e=d.findIndex((e=>e.cancel==n));~e&&d.splice(e,1),g-=~e?1:0},o={time:r,handler:e,cancel:n};return d.splice(f(r),0,o),g+=1,y(),o};var f=e=>~(~d.findIndex((t=>t.time>e))||~d.length);i.cancel=e=>{l.delete(e),c.delete(e),a.delete(e),s.delete(e),u.delete(e)},i.sync=e=>{m=!0,i.batchedUpdates(e),m=!1},i.throttle=e=>{let t;function r(){try{e(...t)}finally{t=null}}function n(...e){t=e,i.onStart(r)}return n.handler=e,n.cancel=()=>{l.delete(r),t=null},n};var p=typeof window<"u"?window.requestAnimationFrame:()=>{};i.use=e=>p=e,i.now=typeof performance<"u"?()=>performance.now():Date.now,i.batchedUpdates=e=>e(),i.catch=console.error,i.frameLoop="always",i.advance=()=>{"demand"!==i.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):_()};var h=-1,g=0,m=!1;function v(e,t){m?(t.delete(e),e(0)):(t.add(e),y())}function y(){h<0&&(h=0,"demand"!==i.frameLoop&&p(b))}function b(){~h&&(p(b),i.batchedUpdates(_))}function _(){let e=h;h=i.now();let t=f(h);t&&(x(d.splice(0,t),(e=>e.handler())),g-=t),l.flush(),a.flush(e?Math.min(64,h-e):16.667),c.flush(),s.flush(),u.flush(),g||(h=-1)}function w(){let e=new Set,t=e;return{add(r){g+=t!=e||e.has(r)?0:1,e.add(r)},delete:r=>(g-=t==e&&e.has(r)?1:0,e.delete(r)),flush(r){t.size&&(e=new Set,g-=t.size,x(t,(t=>t(r)&&e.add(t))),g+=e.size,t=e)}}}function x(e,t){e.forEach((e=>{try{t(e)}catch(e){i.catch(e)}}))}function k(){}var S={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function E(e,t){if(S.arr(e)){if(!S.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 T=(e,t)=>e.forEach(t);function C(e,t,r){if(S.arr(e))for(let n=0;n<e.length;n++)t.call(r,e[n],`${n}`);else for(let n in e)e.hasOwnProperty(n)&&t.call(r,e[n],n)}var I=e=>S.und(e)?[]:S.arr(e)?e:[e];function O(e,t){if(e.size){let r=Array.from(e);e.clear(),T(r,t)}}var P,R,B=(e,...t)=>O(e,(e=>e(...t))),D=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),A=null,N=!1,M=k,j=Object.freeze({__proto__:null,get createStringInterpolator(){return P},get to(){return R},get colors(){return A},get skipAnimation(){return N},get willAdvance(){return M},assign:e=>{e.to&&(R=e.to),e.now&&(i.now=e.now),void 0!==e.colors&&(A=e.colors),null!=e.skipAnimation&&(N=e.skipAnimation),e.createStringInterpolator&&(P=e.createStringInterpolator),e.requestAnimationFrame&&i.use(e.requestAnimationFrame),e.batchedUpdates&&(i.batchedUpdates=e.batchedUpdates),e.willAdvance&&(M=e.willAdvance),e.frameLoop&&(i.frameLoop=e.frameLoop)}}),L=new Set,z=[],W=[],F=0,U={get idle(){return!L.size&&!z.length},start(e){F>e.priority?(L.add(e),i.onStart(H)):($(e),i(V))},advance:V,sort(e){if(F)i.onFrame((()=>U.sort(e)));else{let t=z.indexOf(e);~t&&(z.splice(t,1),q(e))}},clear(){z=[],L.clear()}};function H(){L.forEach($),L.clear(),i(V)}function $(e){z.includes(e)||q(e)}function q(e){z.splice(function(t){let r=t.findIndex((t=>t.priority>e.priority));return r<0?t.length:r}(z),0,e)}function V(e){let t=W;for(let r=0;r<z.length;r++){let n=z[r];F=n.priority,n.idle||(M(n),n.advance(e),n.idle||t.push(n))}return F=0,(W=z).length=0,(z=t).length>0}var G="[-+]?\\d*\\.?\\d+",K=G+"%";function Y(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}var X=new RegExp("rgb"+Y(G,G,G)),J=new RegExp("rgba"+Y(G,G,G,G)),Q=new RegExp("hsl"+Y(G,K,K)),Z=new RegExp("hsla"+Y(G,K,K,G)),ee=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,te=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,re=/^#([0-9a-fA-F]{6})$/,ne=/^#([0-9a-fA-F]{8})$/;function oe(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function ae(e,t,r){let n=r<.5?r*(1+t):r+t-r*t,o=2*r-n,a=oe(o,n,e+1/3),i=oe(o,n,e),s=oe(o,n,e-1/3);return Math.round(255*a)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function ie(e){let t=parseInt(e,10);return t<0?0:t>255?255:t}function se(e){return(parseFloat(e)%360+360)%360/360}function le(e){let t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function ce(e){let t=parseFloat(e);return t<0?0:t>100?1:t/100}function ue(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=re.exec(e))?parseInt(t[1]+"ff",16)>>>0:A&&void 0!==A[e]?A[e]:(t=X.exec(e))?(ie(t[1])<<24|ie(t[2])<<16|ie(t[3])<<8|255)>>>0:(t=J.exec(e))?(ie(t[1])<<24|ie(t[2])<<16|ie(t[3])<<8|le(t[4]))>>>0:(t=ee.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=ne.exec(e))?parseInt(t[1],16)>>>0:(t=te.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Q.exec(e))?(255|ae(se(t[1]),ce(t[2]),ce(t[3])))>>>0:(t=Z.exec(e))?(ae(se(t[1]),ce(t[2]),ce(t[3]))|le(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}var de=(e,t,r)=>{if(S.fun(e))return e;if(S.arr(e))return de({range:e,output:t,extrapolate:r});if(S.str(e.output[0]))return P(e);let n=e,o=n.output,a=n.range||[0,1],i=n.extrapolateLeft||n.extrapolate||"extend",s=n.extrapolateRight||n.extrapolate||"extend",l=n.easing||(e=>e);return e=>{let t=function(e,t){for(var r=1;r<t.length-1&&!(t[r]>=e);++r);return r-1}(e,a);return function(e,t,r,n,o,a,i,s,l){let c=l?l(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>r){if("identity"===s)return c;"clamp"===s&&(c=r)}return n===o?n:t===r?e<=t?n:o:(t===-1/0?c=-c:r===1/0?c-=t:c=(c-t)/(r-t),c=a(c),n===-1/0?c=-c:o===1/0?c+=n:c=c*(o-n)+n,c)}(e,a[t],a[t+1],o[t],o[t+1],l,i,s,n.map)}};function fe(){return fe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},fe.apply(this,arguments)}var pe=Symbol.for("FluidValue.get"),he=Symbol.for("FluidValue.observers"),ge=e=>Boolean(e&&e[pe]),me=e=>e&&e[pe]?e[pe]():e,ve=e=>e[he]||null;function ye(e,t){let r=e[he];r&&r.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}var be=class{constructor(e){if(this[pe]=void 0,this[he]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");_e(this,e)}},_e=(e,t)=>Se(e,pe,t);function we(e,t){if(e[pe]){let r=e[he];r||Se(e,he,r=new Set),r.has(t)||(r.add(t),e.observerAdded&&e.observerAdded(r.size,t))}return t}function xe(e,t){let r=e[he];if(r&&r.has(t)){let n=r.size-1;n?r.delete(t):e[he]=null,e.observerRemoved&&e.observerRemoved(n,t)}}var ke,Se=(e,t,r)=>Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0}),Ee=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Te=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Ce=new RegExp(`(${Ee.source})(%|[a-z]+)`,"i"),Ie=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Oe=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Pe=e=>{let[t,r]=Re(e);if(!t||D())return e;let n=window.getComputedStyle(document.documentElement).getPropertyValue(t);return n?n.trim():r&&r.startsWith("--")?window.getComputedStyle(document.documentElement).getPropertyValue(r)||e:r&&Oe.test(r)?Pe(r):r||e},Re=e=>{let t=Oe.exec(e);if(!t)return[,];let[,r,n]=t;return[r,n]},Be=(e,t,r,n,o)=>`rgba(${Math.round(t)}, ${Math.round(r)}, ${Math.round(n)}, ${o})`,De=e=>{ke||(ke=A?new RegExp(`(${Object.keys(A).join("|")})(?!\\w)`,"g"):/^\b$/);let t=e.output.map((e=>me(e).replace(Oe,Pe).replace(Te,ue).replace(ke,ue))),r=t.map((e=>e.match(Ee).map(Number))),n=r[0].map(((e,t)=>r.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>de(fe({},e,{output:t}))));return e=>{var r;let o=!Ce.test(t[0])&&(null==(r=t.find((e=>Ce.test(e))))?void 0:r.replace(Ee,"")),a=0;return t[0].replace(Ee,(()=>`${n[a++](e)}${o||""}`)).replace(Ie,Be)}},Ae="react-spring: ",Ne=e=>{let t=e,r=!1;if("function"!=typeof t)throw new TypeError(`${Ae}once requires a function parameter`);return(...e)=>{r||(t(...e),r=!0)}},Me=Ne(console.warn);var je=Ne(console.warn);function Le(e){return S.str(e)&&("#"==e[0]||/\d/.test(e)||!D()&&Oe.test(e)||e in(A||{}))}var ze=typeof window<"u"&&window.document&&window.document.createElement?n.useLayoutEffect:n.useEffect,We=()=>{let e=(0,n.useRef)(!1);return ze((()=>(e.current=!0,()=>{e.current=!1})),[]),e};function Fe(){let e=(0,n.useState)()[1],t=We();return()=>{t.current&&e(Math.random())}}var Ue=e=>(0,n.useEffect)(e,He),He=[];function $e(e){let t=(0,n.useRef)();return(0,n.useEffect)((()=>{t.current=e})),t.current}var qe=Symbol.for("Animated:node"),Ve=e=>e&&e[qe],Ge=(e,t)=>{return r=e,n=qe,o=t,Object.defineProperty(r,n,{value:o,writable:!0,configurable:!0});var r,n,o},Ke=e=>e&&e[qe]&&e[qe].getPayload(),Ye=class{constructor(){this.payload=void 0,Ge(this,this)}getPayload(){return this.payload||[]}},Xe=class extends Ye{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,S.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new Xe(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return S.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){let{done:e}=this;this.done=!1,S.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},Je=class extends Xe{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=de({output:[e,e]})}static create(e){return new Je(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(S.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=de({output:[this.getValue(),e]})),this._value=0,super.reset()}},Qe={dependencies:null},Ze=class extends Ye{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){let t={};return C(this.source,((r,n)=>{var o;(o=r)&&o[qe]===o?t[n]=r.getValue(e):ge(r)?t[n]=me(r):e||(t[n]=r)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&T(this.payload,(e=>e.reset()))}_makePayload(e){if(e){let t=new Set;return C(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Qe.dependencies&&ge(e)&&Qe.dependencies.add(e);let t=Ke(e);t&&T(t,(e=>this.add(e)))}},et=class extends Ze{constructor(e){super(e)}static create(e){return new et(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){let t=this.getPayload();return e.length==t.length?t.map(((t,r)=>t.setValue(e[r]))).some(Boolean):(super.setValue(e.map(tt)),!0)}};function tt(e){return(Le(e)?Je:Xe).create(e)}function rt(e){let t=Ve(e);return t?t.constructor:S.arr(e)?et:Le(e)?Je:Xe}function nt(){return nt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},nt.apply(this,arguments)}var ot=(e,t)=>{let r=!S.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,n.forwardRef)(((o,a)=>{let s=(0,n.useRef)(null),l=r&&(0,n.useCallback)((e=>{s.current=function(e,t){return e&&(S.fun(e)?e(t):e.current=t),t}(a,e)}),[a]),[c,u]=function(e,t){let r=new Set;return Qe.dependencies=r,e.style&&(e=nt({},e,{style:t.createAnimatedStyle(e.style)})),e=new Ze(e),Qe.dependencies=null,[e,r]}(o,t),d=Fe(),f=()=>{let e=s.current;r&&!e||!1===(!!e&&t.applyAnimatedValues(e,c.getValue(!0)))&&d()},p=new at(f,u),h=(0,n.useRef)();ze((()=>(h.current=p,T(u,(e=>we(e,p))),()=>{h.current&&(T(h.current.deps,(e=>xe(e,h.current))),i.cancel(h.current.update))}))),(0,n.useEffect)(f,[]),Ue((()=>()=>{let e=h.current;T(e.deps,(t=>xe(t,e)))}));let g=t.getComponentProps(c.getValue());return n.createElement(e,nt({},g,{ref:l}))}))},at=class{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&i.write(this.update)}},it=Symbol.for("AnimatedComponent"),st=e=>S.str(e)?e:e&&S.str(e.displayName)?e.displayName:S.fun(e)&&e.name||null;function lt(){return lt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},lt.apply(this,arguments)}function ct(e,...t){return S.fun(e)?e(...t):e}var ut=(e,t)=>!0===e||!!(t&&e&&(S.fun(e)?e(t):I(e).includes(t))),dt=(e,t)=>S.obj(e)?t&&e[t]:e,ft=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,pt=e=>e,ht=(e,t=pt)=>{let r=gt;e.default&&!0!==e.default&&(e=e.default,r=Object.keys(e));let n={};for(let o of r){let r=t(e[o],o);S.und(r)||(n[o]=r)}return n},gt=["config","onProps","onStart","onChange","onPause","onResume","onRest"],mt={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 vt(e){let t=function(e){let t={},r=0;if(C(e,((e,n)=>{mt[n]||(t[n]=e,r++)})),r)return t}(e);if(t){let r={to:t};return C(e,((e,n)=>n in t||(r[n]=e))),r}return lt({},e)}function yt(e){return e=me(e),S.arr(e)?e.map(yt):Le(e)?j.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function bt(e){for(let t in e)return!0;return!1}function _t(e){return S.fun(e)||S.arr(e)&&S.obj(e[0])}function wt(e,t){var r;null==(r=e.ref)||r.delete(e),null==t||t.delete(e)}function xt(e,t){var r;t&&e.ref!==t&&(null==(r=e.ref)||r.delete(e),t.add(e),e.ref=t)}Math.PI,Math.PI;var kt=lt({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1}),St=class{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,kt)}};function Et(e,t){if(S.und(t.decay)){let r=!S.und(t.tension)||!S.und(t.friction);(r||!S.und(t.frequency)||!S.und(t.damping)||!S.und(t.mass))&&(e.duration=void 0,e.decay=void 0),r&&(e.frequency=void 0)}else e.duration=void 0}var Tt=[],Ct=class{constructor(){this.changed=!1,this.values=Tt,this.toValues=null,this.fromValues=Tt,this.to=void 0,this.from=void 0,this.config=new St,this.immediate=!1}};function It(e,{key:t,props:r,defaultProps:n,state:o,actions:a}){return new Promise(((s,l)=>{var c;let u,d,f=ut(null!=(c=r.cancel)?c:null==n?void 0:n.cancel,t);if(f)g();else{S.und(r.pause)||(o.paused=ut(r.pause,t));let e=null==n?void 0:n.pause;!0!==e&&(e=o.paused||ut(e,t)),u=ct(r.delay||0,t),e?(o.resumeQueue.add(h),a.pause()):(a.resume(),h())}function p(){o.resumeQueue.add(h),o.timeouts.delete(d),d.cancel(),u=d.time-i.now()}function h(){u>0&&!j.skipAnimation?(o.delayed=!0,d=i.setTimeout(g,u),o.pauseQueue.add(p),o.timeouts.add(d)):g()}function g(){o.delayed&&(o.delayed=!1),o.pauseQueue.delete(p),o.timeouts.delete(d),e<=(o.cancelId||0)&&(f=!0);try{a.start(lt({},r,{callId:e,cancel:f}),s)}catch(e){l(e)}}}))}var Ot=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Bt(e.get()):t.every((e=>e.noop))?Pt(e.get()):Rt(e.get(),t.every((e=>e.finished))),Pt=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Rt=(e,t,r=!1)=>({value:e,finished:t,cancelled:r}),Bt=e=>({value:e,cancelled:!0,finished:!1});function Dt(e,t,r,n){let{callId:o,parentId:a,onRest:s}=t,{asyncTo:l,promise:c}=r;return a||e!==l||t.reset?r.promise=(async()=>{r.asyncId=o,r.asyncTo=e;let u,d,f,p=ht(t,((e,t)=>"onRest"===t?void 0:e)),h=new Promise(((e,t)=>(u=e,d=t))),g=e=>{let t=o<=(r.cancelId||0)&&Bt(n)||o!==r.asyncId&&Rt(n,!1);if(t)throw e.result=t,d(e),e},m=(e,t)=>{let a=new Nt,i=new Mt;return(async()=>{if(j.skipAnimation)throw At(r),i.result=Rt(n,!1),d(i),i;g(a);let s=S.obj(e)?lt({},e):lt({},t,{to:e});s.parentId=o,C(p,((e,t)=>{S.und(s[t])&&(s[t]=e)}));let l=await n.start(s);return g(a),r.paused&&await new Promise((e=>{r.resumeQueue.add(e)})),l})()};if(j.skipAnimation)return At(r),Rt(n,!1);try{let t;t=S.arr(e)?(async e=>{for(let t of e)await m(t)})(e):Promise.resolve(e(m,n.stop.bind(n))),await Promise.all([t.then(u),h]),f=Rt(n.get(),!0,!1)}catch(e){if(e instanceof Nt)f=e.result;else{if(!(e instanceof Mt))throw e;f=e.result}}finally{o==r.asyncId&&(r.asyncId=a,r.asyncTo=a?l:void 0,r.promise=a?c:void 0)}return S.fun(s)&&i.batchedUpdates((()=>{s(f,n,n.item)})),f})():c}function At(e,t){O(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}var Nt=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."),this.result=void 0}},Mt=class extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}},jt=e=>e instanceof zt,Lt=1,zt=class extends be{constructor(...e){super(...e),this.id=Lt++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){let e=Ve(this);return e&&e.getValue()}to(...e){return j.to(this,e)}interpolate(...e){return Me(`${Ae}The "interpolate" function is deprecated in v9 (use "to" instead)`),j.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){ye(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||U.sort(this),ye(this,{type:"priority",parent:this,priority:e})}},Wt=Symbol.for("SpringPhase"),Ft=e=>(1&e[Wt])>0,Ut=e=>(2&e[Wt])>0,Ht=e=>(4&e[Wt])>0,$t=(e,t)=>t?e[Wt]|=3:e[Wt]&=-3,qt=(e,t)=>t?e[Wt]|=4:e[Wt]&=-5,Vt=class extends zt{constructor(e,t){if(super(),this.key=void 0,this.animation=new Ct,this.queue=void 0,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,!S.und(e)||!S.und(t)){let r=S.obj(e)?lt({},e):lt({},t,{from:e});S.und(r.default)&&(r.default=!0),this.start(r)}}get idle(){return!(Ut(this)||this._state.asyncTo)||Ht(this)}get goal(){return me(this.animation.to)}get velocity(){let e=Ve(this);return e instanceof Xe?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Ft(this)}get isAnimating(){return Ut(this)}get isPaused(){return Ht(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,r=!1,n=this.animation,{config:o,toValues:a}=n,i=Ke(n.to);!i&&ge(n.to)&&(a=I(me(n.to))),n.values.forEach(((s,l)=>{if(s.done)return;let c=s.constructor==Je?1:i?i[l].lastPosition:a[l],u=n.immediate,d=c;if(!u){if(d=s.lastPosition,o.tension<=0)return void(s.done=!0);let t,r=s.elapsedTime+=e,a=n.fromValues[l],i=null!=s.v0?s.v0:s.v0=S.arr(o.velocity)?o.velocity[l]:o.velocity;if(S.und(o.duration))if(o.decay){let e=!0===o.decay?.998:o.decay,n=Math.exp(-(1-e)*r);d=a+i/(1-e)*(1-n),u=Math.abs(s.lastPosition-d)<.1,t=i*n}else{t=null==s.lastVelocity?i:s.lastVelocity;let r,n=o.precision||(a==c?.005:Math.min(1,.001*Math.abs(c-a))),l=o.restVelocity||n/10,f=o.clamp?0:o.bounce,p=!S.und(f),h=a==c?s.v0>0:a<c,g=!1,m=1,v=Math.ceil(e/m);for(let e=0;e<v&&(r=Math.abs(t)>l,r||(u=Math.abs(c-d)<=n,!u));++e)p&&(g=d==c||d>c==h,g&&(t=-t*f,d=c)),t+=(1e-6*-o.tension*(d-c)+.001*-o.friction*t)/o.mass*m,d+=t*m}else{let n=1;o.duration>0&&(this._memoizedDuration!==o.duration&&(this._memoizedDuration=o.duration,s.durationProgress>0&&(s.elapsedTime=o.duration*s.durationProgress,r=s.elapsedTime+=e)),n=(o.progress||0)+r/this._memoizedDuration,n=n>1?1:n<0?0:n,s.durationProgress=n),d=a+o.easing(n)*(c-a),t=(d-s.lastPosition)/e,u=1==n}s.lastVelocity=t,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[l].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,o.round)&&(r=!0)}));let s=Ve(this),l=s.getValue();if(t){let e=me(n.to);l===e&&!r||o.decay?r&&o.decay&&this._onChange(l):(s.setValue(e),this._onChange(e)),this._stop()}else r&&this._onChange(l)}set(e){return i.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Ut(this)){let{to:e,config:t}=this.animation;i.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 S.und(e)?(r=this.queue||[],this.queue=[]):r=[S.obj(e)?e:lt({},t,{to:e})],Promise.all(r.map((e=>this._update(e)))).then((e=>Ot(this,e)))}stop(e){let{to:t}=this.animation;return this._focus(this.get()),At(this._state,e&&this._lastCallId),i.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){let t=this.key||"",{to:r,from:n}=e;r=S.obj(r)?r[t]:r,(null==r||_t(r))&&(r=void 0),n=S.obj(n)?n[t]:n,null==n&&(n=void 0);let o={to:r,from:n};return Ft(this)||(e.reverse&&([r,n]=[n,r]),n=me(n),S.und(n)?Ve(this)||this._set(r):this._set(n)),o}_update(e,t){let r=lt({},e),{key:n,defaultProps:o}=this;r.default&&Object.assign(o,ht(r,((e,t)=>/^on/.test(t)?dt(e,n):e))),Zt(this,r,"onProps"),er(this,"onProps",r,this);let a=this._prepareNode(r);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?");let i=this._state;return It(++this._lastCallId,{key:n,props:r,defaultProps:o,state:i,actions:{pause:()=>{Ht(this)||(qt(this,!0),B(i.pauseQueue),er(this,"onPause",Rt(this,Gt(this,this.animation.to)),this))},resume:()=>{Ht(this)&&(qt(this,!1),Ut(this)&&this._resume(),B(i.resumeQueue),er(this,"onResume",Rt(this,Gt(this,this.animation.to)),this))},start:this._merge.bind(this,a)}}).then((e=>{if(r.loop&&e.finished&&(!t||!e.noop)){let e=Kt(r);if(e)return this._update(e,!0)}return e}))}_merge(e,t,r){if(t.cancel)return this.stop(!0),r(Bt(this));let n=!S.und(e.to),o=!S.und(e.from);if(n||o){if(!(t.callId>this._lastToId))return r(Bt(this));this._lastToId=t.callId}let{key:a,defaultProps:s,animation:l}=this,{to:c,from:u}=l,{to:d=c,from:f=u}=e;o&&!n&&(!t.default||S.und(d))&&(d=f),t.reverse&&([d,f]=[f,d]);let p=!E(f,u);p&&(l.from=f),f=me(f);let h=!E(d,c);h&&this._focus(d);let g=_t(t.to),{config:m}=l,{decay:v,velocity:y}=m;(n||o)&&(m.velocity=0),t.config&&!g&&function(e,t,r){r&&(Et(r=lt({},r),t),t=lt({},r,t)),Et(e,t),Object.assign(e,t);for(let t in kt)null==e[t]&&(e[t]=kt[t]);let{mass:n,frequency:o,damping:a}=e;S.und(o)||(o<.01&&(o=.01),a<0&&(a=0),e.tension=Math.pow(2*Math.PI/o,2)*n,e.friction=4*Math.PI*a*n/o)}(m,ct(t.config,a),t.config!==s.config?ct(s.config,a):void 0);let b=Ve(this);if(!b||S.und(d))return r(Rt(this,!0));let _=S.und(t.reset)?o&&!t.default:!S.und(f)&&ut(t.reset,a),w=_?f:this.get(),x=yt(d),k=S.num(x)||S.arr(x)||Le(x),C=!g&&(!k||ut(s.immediate||t.immediate,a));if(h){let e=rt(d);if(e!==b.constructor){if(!C)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(x)}}let O=b.constructor,P=ge(d),R=!1;if(!P){let e=_||!Ft(this)&&p;(h||e)&&(R=E(yt(w),x),P=!R),(!E(l.immediate,C)&&!C||!E(m.decay,v)||!E(m.velocity,y))&&(P=!0)}if(R&&Ut(this)&&(l.changed&&!_?P=!0:P||this._stop(c)),!g&&((P||ge(c))&&(l.values=b.getPayload(),l.toValues=ge(d)?null:O==Je?[1]:I(x)),l.immediate!=C&&(l.immediate=C,!C&&!_&&this._set(c)),P)){let{onRest:e}=l;T(Qt,(e=>Zt(this,t,e)));let n=Rt(this,Gt(this,c));B(this._pendingCalls,n),this._pendingCalls.add(r),l.changed&&i.batchedUpdates((()=>{l.changed=!_,null==e||e(n,this),_?ct(s.onRest,n):null==l.onStart||l.onStart(n,this)}))}_&&this._set(w),g?r(Dt(t.to,t,this._state,this)):P?this._start():Ut(this)&&!h?this._pendingCalls.add(r):r(Pt(w))}_focus(e){let t=this.animation;e!==t.to&&(ve(this)&&this._detach(),t.to=e,ve(this)&&this._attach())}_attach(){let e=0,{to:t}=this.animation;ge(t)&&(we(t,this),jt(t)&&(e=t.priority+1)),this.priority=e}_detach(){let{to:e}=this.animation;ge(e)&&xe(e,this)}_set(e,t=!0){let r=me(e);if(!S.und(r)){let e=Ve(this);if(!e||!E(r,e.getValue())){let n=rt(r);e&&e.constructor==n?e.setValue(r):Ge(this,n.create(r)),e&&i.batchedUpdates((()=>{this._onChange(r,t)}))}}return Ve(this)}_onStart(){let e=this.animation;e.changed||(e.changed=!0,er(this,"onStart",Rt(this,Gt(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),ct(this.animation.onChange,e,this)),ct(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){let e=this.animation;Ve(this).reset(me(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Ut(this)||($t(this,!0),Ht(this)||this._resume())}_resume(){j.skipAnimation?this.finish():U.start(this)}_stop(e,t){if(Ut(this)){$t(this,!1);let r=this.animation;T(r.values,(e=>{e.done=!0})),r.toValues&&(r.onChange=r.onPause=r.onResume=void 0),ye(this,{type:"idle",parent:this});let n=t?Bt(this.get()):Rt(this.get(),Gt(this,null!=e?e:r.to));B(this._pendingCalls,n),r.changed&&(r.changed=!1,er(this,"onRest",n,this))}}};function Gt(e,t){let r=yt(t);return E(yt(e.get()),r)}function Kt(e,t=e.loop,r=e.to){let n=ct(t);if(n){let o=!0!==n&&vt(n),a=(o||e).reverse,i=!o||o.reset;return Yt(lt({},e,{loop:t,default:!1,pause:void 0,to:!a||_t(r)?r:void 0,from:i?e.from:void 0,reset:i},o))}}function Yt(e){let{to:t,from:r}=e=vt(e),n=new Set;return S.obj(t)&&Jt(t,n),S.obj(r)&&Jt(r,n),e.keys=n.size?Array.from(n):null,e}function Xt(e){let t=Yt(e);return S.und(t.default)&&(t.default=ht(t)),t}function Jt(e,t){C(e,((e,r)=>null!=e&&t.add(r)))}var Qt=["onStart","onRest","onChange","onPause","onResume"];function Zt(e,t,r){e.animation[r]=t[r]!==ft(t,r)?dt(t[r],e.key):void 0}function er(e,t,...r){var n,o,a,i;null==(n=(o=e.animation)[t])||n.call(o,...r),null==(a=(i=e.defaultProps)[t])||a.call(i,...r)}var tr=["onStart","onChange","onRest"],rr=1,nr=class{constructor(e,t){this.id=rr++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,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(lt({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(){let e={};return this.each(((t,r)=>e[r]=t.get())),e}set(e){for(let t in e){let r=e[t];S.und(r)||this.springs[t].set(r)}}update(e){return e&&this.queue.push(Yt(e)),this}start(e){let{queue:t}=this;return e?t=I(e).map(Yt):this.queue=[],this._flush?this._flush(this,t):(ur(this,t),or(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){let r=this.springs;T(I(t),(t=>r[t].stop(!!e)))}else At(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(S.und(e))this.start({pause:!0});else{let t=this.springs;T(I(e),(e=>t[e].pause()))}return this}resume(e){if(S.und(e))this.start({pause:!1});else{let t=this.springs;T(I(e),(e=>t[e].resume()))}return this}each(e){C(this.springs,e)}_onFrame(){let{onStart:e,onChange:t,onRest:r}=this._events,n=this._active.size>0,o=this._changed.size>0;(n&&!this._started||o&&!this._started)&&(this._started=!0,O(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));let a=!n&&this._started,i=o||a&&r.size?this.get():null;o&&t.size&&O(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),a&&(this._started=!1,O(r,(([e,t])=>{t.value=i,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}i.onFrame(this._onFrame)}};function or(e,t){return Promise.all(t.map((t=>ar(e,t)))).then((t=>Ot(e,t)))}async function ar(e,t,r){let{keys:n,to:o,from:a,loop:s,onRest:l,onResolve:c}=t,u=S.obj(t.default)&&t.default;s&&(t.loop=!1),!1===o&&(t.to=null),!1===a&&(t.from=null);let d=S.arr(o)||S.fun(o)?o:void 0;d?(t.to=void 0,t.onRest=void 0,u&&(u.onRest=void 0)):T(tr,(r=>{let n=t[r];if(S.fun(n)){let o=e._events[r];t[r]=({finished:e,cancelled:t})=>{let r=o.get(n);r?(e||(r.finished=!1),t&&(r.cancelled=!0)):o.set(n,{value:null,finished:e||!1,cancelled:t||!1})},u&&(u[r]=t[r])}}));let f=e._state;t.pause===!f.paused?(f.paused=t.pause,B(t.pause?f.pauseQueue:f.resumeQueue)):f.paused&&(t.pause=!0);let p=(n||Object.keys(e.springs)).map((r=>e.springs[r].start(t))),h=!0===t.cancel||!0===ft(t,"cancel");(d||h&&f.asyncId)&&p.push(It(++e._lastAsyncId,{props:t,state:f,actions:{pause:k,resume:k,start(t,r){h?(At(f,e._lastAsyncId),r(Bt(e))):(t.onRest=l,r(Dt(d,t,f,e)))}}})),f.paused&&await new Promise((e=>{f.resumeQueue.add(e)}));let g=Ot(e,await Promise.all(p));if(s&&g.finished&&(!r||!g.noop)){let r=Kt(t,s,o);if(r)return ur(e,[r]),ar(e,r,!0)}return c&&i.batchedUpdates((()=>c(g,e,e.item))),g}function ir(e,t){let r=lt({},e.springs);return t&&T(I(t),(e=>{S.und(e.keys)&&(e=Yt(e)),S.obj(e.to)||(e=lt({},e,{to:void 0})),cr(r,e,(e=>lr(e)))})),sr(e,r),r}function sr(e,t){C(t,((t,r)=>{e.springs[r]||(e.springs[r]=t,we(t,e))}))}function lr(e,t){let r=new Vt;return r.key=e,t&&we(r,t),r}function cr(e,t,r){t.keys&&T(t.keys,(n=>{(e[n]||(e[n]=r(n)))._prepareNode(t)}))}function ur(e,t){T(t,(t=>{cr(e.springs,t,(t=>lr(t,e)))}))}var dr,fr,pr=["children"],hr=e=>{let{children:t}=e,r=function(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}(e,pr),o=(0,n.useContext)(gr),a=r.pause||!!o.pause,i=r.immediate||!!o.immediate;r=function(e,t){let[r]=(0,n.useState)((()=>({inputs:t,result:e()}))),o=(0,n.useRef)(),a=o.current,i=a;return i?Boolean(t&&i.inputs&&function(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}(t,i.inputs))||(i={inputs:t,result:e()}):i=r,(0,n.useEffect)((()=>{o.current=i,a==r&&(r.inputs=r.result=void 0)}),[i]),i.result}((()=>({pause:a,immediate:i})),[a,i]);let{Provider:s}=gr;return n.createElement(s,{value:r},t)},gr=(dr=hr,fr={},Object.assign(dr,n.createContext(fr)),dr.Provider._context=dr,dr.Consumer._context=dr,dr);hr.Provider=gr.Provider,hr.Consumer=gr.Consumer;var mr,vr,yr=()=>{let e=[],t=function(t){je(`${Ae}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`);let n=[];return T(e,((e,o)=>{if(S.und(t))n.push(e.start());else{let a=r(t,e,o);a&&n.push(e.start(a))}})),n};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){let r=e.indexOf(t);~r&&e.splice(r,1)},t.pause=function(){return T(e,(e=>e.pause(...arguments))),this},t.resume=function(){return T(e,(e=>e.resume(...arguments))),this},t.set=function(t){T(e,(e=>e.set(t)))},t.start=function(t){let r=[];return T(e,((e,n)=>{if(S.und(t))r.push(e.start());else{let o=this._getProps(t,e,n);o&&r.push(e.start(o))}})),r},t.stop=function(){return T(e,(e=>e.stop(...arguments))),this},t.update=function(t){return T(e,((e,r)=>e.update(this._getProps(t,e,r)))),this};let r=function(e,t,r){return S.fun(e)?e(r,t):e};return t._getProps=r,t};function br(e,t){let r=S.fun(e),[[o],a]=function(e,t,r){let o=S.fun(t)&&t;o&&!r&&(r=[]);let a=(0,n.useMemo)((()=>o||3==arguments.length?yr():void 0),[]),i=(0,n.useRef)(0),s=Fe(),l=(0,n.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){let r=ir(e,t);return i.current>0&&!l.queue.length&&!Object.keys(r).some((t=>!e.springs[t]))?or(e,t):new Promise((n=>{sr(e,r),l.queue.push((()=>{n(or(e,t))})),s()}))}})),[]),c=(0,n.useRef)([...l.ctrls]),u=[],d=$e(e)||0;function f(e,r){for(let n=e;n<r;n++){let e=c.current[n]||(c.current[n]=new nr(null,l.flush)),r=o?o(n,e):t[n];r&&(u[n]=Xt(r))}}(0,n.useMemo)((()=>{T(c.current.slice(e,d),(e=>{wt(e,a),e.stop(!0)})),c.current.length=e,f(d,e)}),[e]),(0,n.useMemo)((()=>{f(0,Math.min(d,e))}),r);let p=c.current.map(((e,t)=>ir(e,u[t]))),h=(0,n.useContext)(hr),g=$e(h),m=h!==g&&bt(h);ze((()=>{i.current++,l.ctrls=c.current;let{queue:e}=l;e.length&&(l.queue=[],T(e,(e=>e()))),T(c.current,((e,t)=>{null==a||a.add(e),m&&e.start({default:h});let r=u[t];r&&(xt(e,r.ref),e.ref?e.queue.push(r):e.start(r))}))})),Ue((()=>()=>{T(l.ctrls,(e=>e.stop(!0)))}));let v=p.map((e=>lt({},e)));return a?[v,a]:v}(1,r?e:[e],r?t||[]:t);return r||2==arguments.length?[o,a]:o}function _r(e,t,r){let o=S.fun(t)&&t,{reset:a,sort:i,trail:s=0,expires:l=!0,exitBeforeEnter:c=!1,onDestroyed:u,ref:d,config:f}=o?o():t,p=(0,n.useMemo)((()=>o||3==arguments.length?yr():void 0),[]),h=I(e),g=[],m=(0,n.useRef)(null),v=a?null:m.current;ze((()=>{m.current=g})),Ue((()=>(T(m.current,(e=>{var t;null==(t=e.ctrl.ref)||t.add(e.ctrl);let r=E.get(e);r&&e.ctrl.start(r.payload)})),()=>{T(m.current,(e=>{e.expired&&clearTimeout(e.expirationId),wt(e.ctrl,p),e.ctrl.stop(!0)}))})));let y=function(e,{key:t,keys:r=t},n){if(null===r){let t=new Set;return e.map((e=>{let r=n&&n.find((r=>r.item===e&&r.phase!==mr.LEAVE&&!t.has(r)));return r?(t.add(r),r.key):wr++}))}return S.und(r)?e:S.fun(r)?e.map(r):I(r)}(h,o?o():t,v),b=a&&m.current||[];ze((()=>T(b,(({ctrl:e,item:t,key:r})=>{wt(e,p),ct(u,t,r)}))));let _=[];if(v&&T(v,((e,t)=>{e.expired?(clearTimeout(e.expirationId),b.push(e)):~(t=_[t]=y.indexOf(e.key))&&(g[t]=e)})),T(h,((e,t)=>{g[t]||(g[t]={key:y[t],item:e,phase:mr.MOUNT,ctrl:new nr},g[t].ctrl.item=e)})),_.length){let e=-1,{leave:r}=o?o():t;T(_,((t,n)=>{let o=v[n];~t?(e=g.indexOf(o),g[e]=lt({},o,{item:h[t]})):r&&g.splice(++e,0,o)}))}S.fun(i)&&g.sort(((e,t)=>i(e.item,t.item)));let w=-s,x=Fe(),k=ht(t),E=new Map,C=(0,n.useRef)(new Map),O=(0,n.useRef)(!1);T(g,((e,r)=>{let n,a,i=e.key,u=e.phase,p=o?o():t,h=ct(p.delay||0,i);if(u==mr.MOUNT)n=p.enter,a=mr.ENTER;else{let e=y.indexOf(i)<0;if(u!=mr.LEAVE)if(e)n=p.leave,a=mr.LEAVE;else{if(!(n=p.update))return;a=mr.UPDATE}else{if(e)return;n=p.enter,a=mr.ENTER}}if(n=ct(n,e.item,r),n=S.obj(n)?vt(n):{to:n},!n.config){let t=f||k.config;n.config=ct(t,e.item,r,a)}w+=s;let g=lt({},k,{delay:h+w,ref:d,immediate:p.immediate,reset:!1},n);if(a==mr.ENTER&&S.und(g.from)){let n=o?o():t,a=S.und(n.initial)||v?n.from:n.initial;g.from=ct(a,e.item,r)}let{onResolve:b}=g;g.onResolve=e=>{ct(b,e);let t=m.current,r=t.find((e=>e.key===i));if(r&&(!e.cancelled||r.phase==mr.UPDATE)&&r.ctrl.idle){let e=t.every((e=>e.ctrl.idle));if(r.phase==mr.LEAVE){let t=ct(l,r.item);if(!1!==t){let n=!0===t?0:t;if(r.expired=!0,!e&&n>0)return void(n<=2147483647&&(r.expirationId=setTimeout(x,n)))}}e&&t.some((e=>e.expired))&&(C.current.delete(r),c&&(O.current=!0),x())}};let _=ir(e.ctrl,g);a===mr.LEAVE&&c?C.current.set(e,{phase:a,springs:_,payload:g}):E.set(e,{phase:a,springs:_,payload:g})}));let P=(0,n.useContext)(hr),R=$e(P),B=P!==R&&bt(P);ze((()=>{B&&T(g,(e=>{e.ctrl.start({default:P})}))}),[P]),T(E,((e,t)=>{if(C.current.size){let e=g.findIndex((e=>e.key===t.key));g.splice(e,1)}})),ze((()=>{T(C.current.size?C.current:E,(({phase:e,payload:t},r)=>{let{ctrl:n}=r;r.phase=e,null==p||p.add(n),B&&e==mr.ENTER&&n.start({default:P}),t&&(xt(n,t.ref),n.ref&&!O.current?n.update(t):(n.start(t),O.current&&(O.current=!1)))}))}),a?void 0:r);let D=e=>n.createElement(n.Fragment,null,g.map(((t,r)=>{let{springs:o}=E.get(t)||t.ctrl,a=e(lt({},o),t.item,t,r);return a&&a.type?n.createElement(a.type,lt({},a.props,{key:S.str(t.key)||S.num(t.key)?t.key:t.ctrl.id,ref:a.ref})):a})));return p?[D,p]:D}(vr=mr||(mr={})).MOUNT="mount",vr.ENTER="enter",vr.UPDATE="update",vr.LEAVE="leave";var wr=1,xr=class extends zt{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=de(...t);let r=this._get(),n=rt(r);Ge(this,n.create(r))}advance(e){let t=this._get();E(t,this.get())||(Ve(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Sr(this._active)&&Er(this)}_get(){let e=S.arr(this.source)?this.source.map(me):I(me(this.source));return this.calc(...e)}_start(){this.idle&&!Sr(this._active)&&(this.idle=!1,T(Ke(this),(e=>{e.done=!1})),j.skipAnimation?(i.batchedUpdates((()=>this.advance())),Er(this)):U.start(this))}_attach(){let e=1;T(I(this.source),(t=>{ge(t)&&we(t,this),jt(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){T(I(this.source),(e=>{ge(e)&&xe(e,this)})),this._active.clear(),Er(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=I(this.source).reduce(((e,t)=>Math.max(e,(jt(t)?t.priority:0)+1)),0))}};function kr(e){return!1!==e.idle}function Sr(e){return!e.size||Array.from(e).every(kr)}function Er(e){e.idle||(e.idle=!0,T(Ke(e),(e=>{e.done=!0})),ye(e,{type:"idle",parent:e}))}function Tr(e,t){if(null==e)return{};var r,n,o={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],!(t.indexOf(r)>=0)&&(o[r]=e[r]);return o}j.assign({createStringInterpolator:De,to:(e,t)=>new xr(e,t)}),U.advance;var Cr=["style","children","scrollTop","scrollLeft"],Ir=/^--/;function Or(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Ir.test(e)||Rr.hasOwnProperty(e)&&Rr[e]?(""+t).trim():t+"px"}var Pr={},Rr={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},Br=["Webkit","Ms","Moz","O"];Rr=Object.keys(Rr).reduce(((e,t)=>(Br.forEach((r=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(r,t)]=e[t])),e)),Rr);var Dr=["x","y","z"],Ar=/^(matrix|translate|scale|rotate|skew)/,Nr=/^(translate)/,Mr=/^(rotate|skew)/,jr=(e,t)=>S.num(e)&&0!==e?e+t:e,Lr=(e,t)=>S.arr(e)?e.every((e=>Lr(e,t))):S.num(e)?e===t:parseFloat(e)===t,zr=class extends Ze{constructor(e){let{x:t,y:r,z:n}=e,o=Tr(e,Dr),a=[],i=[];(t||r||n)&&(a.push([t||0,r||0,n||0]),i.push((e=>[`translate3d(${e.map((e=>jr(e,"px"))).join(",")})`,Lr(e,0)]))),C(o,((e,t)=>{if("transform"===t)a.push([e||""]),i.push((e=>[e,""===e]));else if(Ar.test(t)){if(delete o[t],S.und(e))return;let r=Nr.test(t)?"px":Mr.test(t)?"deg":"";a.push(I(e)),i.push("rotate3d"===t?([e,t,n,o])=>[`rotate3d(${e},${t},${n},${jr(o,r)})`,Lr(o,0)]:e=>[`${t}(${e.map((e=>jr(e,r))).join(",")})`,Lr(e,t.startsWith("scale")?1:0)])}})),a.length&&(o.transform=new Wr(a,i)),super(o)}},Wr=class extends be{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return T(this.inputs,((r,n)=>{let o=me(r[0]),[a,i]=this.transforms[n](S.arr(o)?o:r.map(me));e+=" "+a,t=t&&i})),t?"none":e}observerAdded(e){1==e&&T(this.inputs,(e=>T(e,(e=>ge(e)&&we(e,this)))))}observerRemoved(e){0==e&&T(this.inputs,(e=>T(e,(e=>ge(e)&&xe(e,this)))))}eventObserved(e){"change"==e.type&&(t