@root-axis/design-system
Version:
Yep! Just another Design System out there in the wild, wild web ðŸ¤
52 lines (46 loc) • 73.5 kB
JavaScript
var t,e;t=this,e=function(t,e){"use strict";const s=t=>(e,s)=>{void 0!==s?s.addInitializer((()=>{customElements.define(t,e)})):customElements.define(t,e)},i=globalThis,n=i.ShadowRoot&&(void 0===i.ShadyCSS||i.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,r=Symbol(),o=new WeakMap;let a=class{constructor(t,e,s){if(this.i=!0,s!==r)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const e=this.t;if(n&&void 0===t){const s=void 0!==e&&1===e.length;s&&(t=o.get(e)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),s&&o.set(e,t))}return t}toString(){return this.cssText}};const h=n?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new a("string"==typeof t?t:t+"",void 0,r))(e)})(t):t,{is:l,defineProperty:c,getOwnPropertyDescriptor:u,getOwnPropertyNames:d,getOwnPropertySymbols:f,getPrototypeOf:p}=Object,m=globalThis,v=m.trustedTypes,y=v?v.emptyScript:"",g=m.reactiveElementPolyfillSupport,b=(t,e)=>t,w={toAttribute(t,e){switch(e){case Boolean:t=t?y:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch{s=null}}return s}},k=(t,e)=>!l(t,e),x={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:k};Symbol.metadata??(Symbol.metadata=Symbol("metadata")),m.litPropertyMetadata??(m.litPropertyMetadata=new WeakMap);class S extends HTMLElement{static addInitializer(t){this.h(),(this.l??(this.l=[])).push(t)}static get observedAttributes(){return this.finalize(),this.u&&[...this.u.keys()]}static createProperty(t,e=x){if(e.state&&(e.attribute=!1),this.h(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&c(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=u(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return null==i?void 0:i.call(this)},set(e){const r=null==i?void 0:i.call(this);n.call(this,e),this.requestUpdate(t,r,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??x}static h(){if(this.hasOwnProperty(b("elementProperties")))return;const t=p(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(b("finalized")))return;if(this.finalized=!0,this.h(),this.hasOwnProperty(b("properties"))){const t=this.properties,e=[...d(t),...f(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this.u=new Map;for(const[t,e]of this.elementProperties){const s=this.p(t,e);void 0!==s&&this.u.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(h(t))}else void 0!==t&&e.push(h(t));return e}static p(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this.m=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this.v=null,this.k()}k(){var t;this.S=new Promise((t=>this.enableUpdating=t)),this.M=new Map,this.$(),this.requestUpdate(),null==(t=this.constructor.l)||t.forEach((t=>t(this)))}addController(t){var e;(this.C??(this.C=new Set)).add(t),void 0!==this.renderRoot&&this.isConnected&&(null==(e=t.hostConnected)||e.call(t))}removeController(t){var e;null==(e=this.C)||e.delete(t)}$(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this.m=t)}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((t,e)=>{if(n)t.adoptedStyleSheets=e.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const s of e){const e=document.createElement("style"),n=i.litNonce;void 0!==n&&e.setAttribute("nonce",n),e.textContent=s.cssText,t.appendChild(e)}})(t,this.constructor.elementStyles),t}connectedCallback(){var t;this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null==(t=this.C)||t.forEach((t=>{var e;return null==(e=t.hostConnected)?void 0:e.call(t)}))}enableUpdating(t){}disconnectedCallback(){var t;null==(t=this.C)||t.forEach((t=>{var e;return null==(e=t.hostDisconnected)?void 0:e.call(t)}))}attributeChangedCallback(t,e,s){this.A(t,s)}O(t,e){var s;const i=this.constructor.elementProperties.get(t),n=this.constructor.p(t,i);if(void 0!==n&&!0===i.reflect){const r=(void 0!==(null==(s=i.converter)?void 0:s.toAttribute)?i.converter:w).toAttribute(e,i.type);this.v=t,null==r?this.removeAttribute(n):this.setAttribute(n,r),this.v=null}}A(t,e){var s;const i=this.constructor,n=i.u.get(t);if(void 0!==n&&this.v!==n){const t=i.getPropertyOptions(n),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==(null==(s=t.converter)?void 0:s.fromAttribute)?t.converter:w;this.v=n,this[n]=r.fromAttribute(e,t.type),this.v=null}}requestUpdate(t,e,s){if(void 0!==t){if(s??(s=this.constructor.getPropertyOptions(t)),!(s.hasChanged??k)(this[t],e))return;this.P(t,e,s)}!1===this.isUpdatePending&&(this.S=this.T())}P(t,e,s){this.M.has(t)||this.M.set(t,e),!0===s.reflect&&this.v!==t&&(this.F??(this.F=new Set)).add(t)}async T(){this.isUpdatePending=!0;try{await this.S}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var t;if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??(this.renderRoot=this.createRenderRoot()),this.m){for(const[t,e]of this.m)this[t]=e;this.m=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t)!0!==s.wrapped||this.M.has(e)||void 0===this[e]||this.P(e,this[e],s)}let e=!1;const s=this.M;try{e=this.shouldUpdate(s),e?(this.willUpdate(s),null==(t=this.C)||t.forEach((t=>{var e;return null==(e=t.hostUpdate)?void 0:e.call(t)})),this.update(s)):this.V()}catch(t){throw e=!1,this.V(),t}e&&this.I(s)}willUpdate(t){}I(t){var e;null==(e=this.C)||e.forEach((t=>{var e;return null==(e=t.hostUpdated)?void 0:e.call(t)})),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}V(){this.M=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this.S}shouldUpdate(t){return!0}update(t){this.F&&(this.F=this.F.forEach((t=>this.O(t,this[t])))),this.V()}updated(t){}firstUpdated(t){}}S.elementStyles=[],S.shadowRootOptions={mode:"open"},S[b("elementProperties")]=new Map,S[b("finalized")]=new Map,null==g||g({ReactiveElement:S}),(m.reactiveElementVersions??(m.reactiveElementVersions=[])).push("2.0.4");const M={attribute:!0,type:String,converter:w,reflect:!1,hasChanged:k},$=(t=M,e,s)=>{const{kind:i,metadata:n}=s;let r=globalThis.litPropertyMetadata.get(n);if(void 0===r&&globalThis.litPropertyMetadata.set(n,r=new Map),r.set(s.name,t),"accessor"===i){const{name:i}=s;return{set(s){const n=e.get.call(this);e.set.call(this,s),this.requestUpdate(i,n,t)},init(e){return void 0!==e&&this.P(i,void 0,t),e}}}if("setter"===i){const{name:i}=s;return function(s){const n=this[i];e.call(this,s),this.requestUpdate(i,n,t)}}throw Error("Unsupported decorator location: "+i)};function C(t){return(e,s)=>"object"==typeof s?$(t,e,s):((t,e,s)=>{const i=e.hasOwnProperty(s);return e.constructor.createProperty(s,i?{...t,wrapped:!0}:t),i?Object.getOwnPropertyDescriptor(e,s):void 0})(t,e,s)}const A=e.css`
:host {
display: block;
overflow: hidden;
font-family: sans-serif;
width: 100%;
}
:host:has(details.light) {
border-bottom: 1px solid var(--color-neutral-600);
color: var(--color-neutral-700);
}
:host:has(details.dark) {
border-bottom: 1px solid var(--color-neutral-200);
color: var(--color-neutral-300);
}
details[open] {
svg {
rotate: 180deg;
}
}
details {
svg {
transition: 200ms;
}
}
summary {
align-items: center;
cursor: pointer;
display: flex;
font-size: 14px;
justify-content: space-between;
padding-block: var(--size-5);
font-weight: var(--font-weight-semibold);
&:focus-visible {
outline-style: solid;
outline-offset: -1px;
}
}
.content {
font-size: 14px;
& ::slotted(*) {
margin: 0;
padding: 0;
}
}
`,O=t=>t;let T=O,P=O;function F(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}"production"!==process.env.NODE_ENV&&(T=(t,e)=>{},P=(t,e)=>{if(!t)throw new Error(e)});class V{constructor(){this.subscriptions=[]}add(t){return function(t,e){-1===t.indexOf(e)&&t.push(e)}(this.subscriptions,t),()=>F(this.subscriptions,t)}notify(t,e,s){const i=this.subscriptions.length;if(i)if(1===i)this.subscriptions[0](t,e,s);else for(let n=0;n<i;n++){const i=this.subscriptions[n];i&&i(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function I(t,e){return e?t*(1e3/e):0}const D=new Set;function B(t,e,s){t||D.has(e)||D.add(e)}const z=["read","resolveKeyframes","update","preRender","render","postRender"],{schedule:j,cancel:E,state:R,steps:N}=function(t,e){let s=!1,i=!0;const n={delta:0,timestamp:0,isProcessing:!1},r=()=>s=!0,o=z.reduce(((t,e)=>(t[e]=function(t){let e=new Set,s=new Set,i=!1,n=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(e){r.has(e)&&(h.schedule(e),t()),e(o)}const h={schedule:(t,n=!1,o=!1)=>{const a=o&&i?e:s;return n&&r.add(t),a.has(t)||a.add(t),t},cancel:t=>{s.delete(t),r.delete(t)},process:t=>{o=t,i?n=!0:(i=!0,[e,s]=[s,e],s.clear(),e.forEach(a),i=!1,n&&(n=!1,h.process(t)))}};return h}(r),t)),{}),{read:a,resolveKeyframes:h,update:l,preRender:c,render:u,postRender:d}=o,f=()=>{const e=performance.now();s=!1,n.delta=i?1e3/60:Math.max(Math.min(e-n.timestamp,40),1),n.timestamp=e,n.isProcessing=!0,a.process(n),h.process(n),l.process(n),c.process(n),u.process(n),d.process(n),n.isProcessing=!1,s&&(i=!1,t(f))};return{schedule:z.reduce(((e,r)=>{const a=o[r];return e[r]=(e,r=!1,o=!1)=>(s||(s=!0,i=!0,n.isProcessing||t(f)),a.schedule(e,r,o)),e}),{}),cancel:t=>{for(let e=0;e<z.length;e++)o[z[e]].cancel(t)},state:n,steps:o}}(typeof requestAnimationFrame<"u"?requestAnimationFrame:O);let U;function L(){U=void 0}const K={now:()=>(void 0===U&&K.set(R.isProcessing?R.timestamp:performance.now()),U),set:t=>{U=t,queueMicrotask(L)}};class Y{constructor(t,e={}){this.version="11.13.4",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(t,e=!0)=>{const s=K.now();this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(t),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){var e;this.current=t,this.updatedAt=K.now(),null===this.canTrackVelocity&&void 0!==t&&(this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e))))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return"production"!==process.env.NODE_ENV&&B(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new V);const s=this.events[t].add(e);return"change"===t?()=>{s(),j.read((()=>{this.events.change.getSize()||this.stop()}))}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=K.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||t-this.updatedAt>30)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,30);return I(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()})).then((()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()}))}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function X(t,e){return new Y(t,e)}function W(t){let e;return()=>(void 0===e&&(e=t()),e)}const Z=W((()=>void 0!==window.ScrollTimeline));class _{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}then(t,e){return Promise.all(this.animations).then(t).catch(e)}getAll(t){return this.animations[0][t]}setAll(t,e){for(let s=0;s<this.animations.length;s++)this.animations[s][t]=e}attachTimeline(t,e){const s=this.animations.map((s=>Z()&&s.attachTimeline?s.attachTimeline(t):e(s)));return()=>{s.forEach(((t,e)=>{t&&t(),this.animations[e].stop()}))}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach((e=>e[t]()))}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const q=(t,e,s)=>{const i=e-t;return 0===i?1:(s-t)/i},H=(t,e,s=10)=>{let i="";const n=Math.max(Math.round(e/s),2);for(let e=0;e<n;e++)i+=t(q(0,n-1,e))+", ";return`linear(${i.substring(0,i.length-2)})`},G=t=>1e3*t,J=t=>t/1e3,Q=5;function tt(t,e,s){const i=Math.max(e-Q,0);return I(s-t(i),e-i)}const et=(t,e,s)=>s>e?e:s<t?t:s,st={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},it=.001,nt=12;function rt(t,e){return t*Math.sqrt(1-e*e)}const ot=2e4;function at(t){let e=0,s=t.next(e);for(;!s.done&&e<ot;)e+=50,s=t.next(e);return e>=ot?1/0:e}const ht=["duration","bounce"],lt=["stiffness","damping","mass"];function ct(t,e){return e.some((e=>void 0!==t[e]))}function ut(t=st.visualDuration,e=st.bounce){const s="object"!=typeof t?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:n}=s;const r=s.keyframes[0],o=s.keyframes[s.keyframes.length-1],a={done:!1,value:r},{stiffness:h,damping:l,mass:c,duration:u,velocity:d,isResolvedFromDuration:f}=function(t){let e={velocity:st.velocity,stiffness:st.stiffness,damping:st.damping,mass:st.mass,isResolvedFromDuration:!1,...t};if(!ct(t,lt)&&ct(t,ht))if(t.visualDuration){const s=t.visualDuration,i=2*Math.PI/(1.2*s),n=i*i,r=2*et(.05,1,1-t.bounce)*Math.sqrt(n);e={...e,mass:st.mass,stiffness:n,damping:r}}else{const s=function({duration:t=st.duration,bounce:e=st.bounce,velocity:s=st.velocity,mass:i=st.mass}){let n,r;T(t<=G(st.maxDuration),"Spring duration must be 10 seconds or less");let o=1-e;o=et(st.minDamping,st.maxDamping,o),t=et(st.minDuration,st.maxDuration,J(t)),o<1?(n=e=>{const i=e*o,n=i*t,r=i-s,a=rt(e,o),h=Math.exp(-n);return it-r/a*h},r=e=>{const i=e*o*t,r=i*s+s,a=Math.pow(o,2)*Math.pow(e,2)*t,h=Math.exp(-i),l=rt(Math.pow(e,2),o);return(-n(e)+it>0?-1:1)*((r-a)*h)/l}):(n=e=>Math.exp(-e*t)*((e-s)*t+1)-it,r=e=>Math.exp(-e*t)*(t*t*(s-e)));const a=function(t,e,s){let i=s;for(let s=1;s<nt;s++)i-=t(i)/e(i);return i}(n,r,5/t);if(t=G(t),isNaN(a))return{stiffness:st.stiffness,damping:st.damping,duration:t};{const e=Math.pow(a,2)*i;return{stiffness:e,damping:2*o*Math.sqrt(i*e),duration:t}}}(t);e={...e,...s,mass:st.mass},e.isResolvedFromDuration=!0}return e}({...s,velocity:-J(s.velocity||0)}),p=d||0,m=l/(2*Math.sqrt(h*c)),v=o-r,y=J(Math.sqrt(h/c)),g=Math.abs(v)<5;let b;if(i||(i=g?st.restSpeed.granular:st.restSpeed.default),n||(n=g?st.restDelta.granular:st.restDelta.default),m<1){const t=rt(y,m);b=e=>{const s=Math.exp(-m*y*e);return o-s*((p+m*y*v)/t*Math.sin(t*e)+v*Math.cos(t*e))}}else if(1===m)b=t=>o-Math.exp(-y*t)*(v+(p+y*v)*t);else{const t=y*Math.sqrt(m*m-1);b=e=>{const s=Math.exp(-m*y*e),i=Math.min(t*e,300);return o-s*((p+m*y*v)*Math.sinh(i)+t*v*Math.cosh(i))/t}}const w={calculatedDuration:f&&u||null,next:t=>{const e=b(t);if(f)a.done=t>=u;else{let s=0;m<1&&(s=0===t?G(p):tt(b,t,e));const r=Math.abs(s)<=i,h=Math.abs(o-e)<=n;a.done=r&&h}return a.value=a.done?o:e,a},toString:()=>{const t=Math.min(at(w),ot),e=H((e=>w.next(t*e).value),t,30);return t+"ms "+e}};return w}function dt(t,e=100,s){const i=s({...t,keyframes:[0,e]}),n=Math.min(at(i),ot);return{type:"keyframes",ease:t=>i.next(n*t).value/e,duration:J(n)}}const ft=(t,e,s)=>t+(e-t)*s;function pt(t,e){const s=t[t.length-1];for(let i=1;i<=e;i++){const n=q(0,e,i);t.push(ft(s,1,n))}}function mt(t){const e=[0];return pt(e,t.length-1),e}const vt=t=>!(!t||!t.getVelocity);function yt(t){return"object"==typeof t&&!Array.isArray(t)}function gt(t,e,s,i){return"string"==typeof t&&yt(e)?function(t,e,s){var i;if(t instanceof Element)return[t];if("string"==typeof t){let e=document;const n=null!==(i=null==s?void 0:s[t])&&void 0!==i?i:e.querySelectorAll(t);return n?Array.from(n):[]}return Array.from(t)}(t,0,i):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[t]}function bt(t){return"function"==typeof t}function wt(t,e,s,i){var n;return"number"==typeof e?e:e.startsWith("-")||e.startsWith("+")?Math.max(0,t+parseFloat(e)):"<"===e?s:null!==(n=i.get(e))&&void 0!==n?n:t}const kt=(t,e,s)=>{const i=e-t;return((s-t)%i+i)%i+t},xt=t=>Array.isArray(t)&&"number"!=typeof t[0];function St(t,e){return xt(t)?t[kt(0,t.length,e)]:t}function Mt(t,e,s,i,n,r){!function(t,e,s){for(let i=0;i<t.length;i++){const n=t[i];n.at>e&&n.at<s&&(F(t,n),i--)}}(t,n,r);for(let o=0;o<e.length;o++)t.push({value:e[o],at:ft(n,r,i[o]),easing:St(s,o)})}function $t(t,e){return t.at===e.at?null===t.value?1:null===e.value?-1:0:t.at-e.at}function Ct(t,e){return!e.has(t)&&e.set(t,{}),e.get(t)}function At(t,e){return e[t]||(e[t]=[]),e[t]}function Ot(t){return Array.isArray(t)?t:[t]}function Tt(t,e){return t&&t[e]?{...t,...t[e]}:{...t}}const Pt=t=>"number"==typeof t,Ft=t=>t.every(Pt),Vt=new WeakMap,It=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Dt=new Set(It),Bt={type:"spring",stiffness:500,damping:25,restSpeed:10},zt={type:"keyframes",duration:.8},jt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Et=(t,{keyframes:e})=>e.length>2?zt:Dt.has(t)?t.startsWith("scale")?(t=>({type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restSpeed:10}))(e[1]):Bt:jt;function Rt(t,e){return t?t[e]||t.default||t:void 0}const Nt=t=>null!==t;function Ut(t,{repeat:e,repeatType:s="loop"},i){const n=t.filter(Nt),r=e&&"loop"!==s&&e%2==1?0:n.length-1;return r&&void 0!==i?i:n[r]}const Lt=(t,e,s)=>(((1-3*s+3*e)*t+(3*s-6*e))*t+3*e)*t;function Kt(t,e,s,i){return t===e&&s===i?O:n=>0===n||1===n?n:Lt((e=>function(t,e,s,i,n){let r,o,a=0;do{o=e+(s-e)/2,r=Lt(o,i,n)-t,r>0?s=o:e=o}while(Math.abs(r)>1e-7&&++a<12);return o}(e,0,1,t,s))(n),e,i)}const Yt=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Xt=t=>e=>1-t(1-e),Wt=Kt(.33,1.53,.69,.99),Zt=Xt(Wt),_t=Yt(Zt),qt=t=>(t*=2)<1?.5*Zt(t):.5*(2-Math.pow(2,-10*(t-1))),Ht=t=>1-Math.sin(Math.acos(t)),Gt=Xt(Ht),Jt=Yt(Ht),Qt=t=>/^0[^.\s]+$/u.test(t),te=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),ee=t=>e=>"string"==typeof e&&e.startsWith(t),se=ee("--"),ie=ee("var(--"),ne=t=>!!ie(t)&&re.test(t.split("/*")[0].trim()),re=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,oe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ae(t,e,s=1){P(s<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[i,n]=function(t){const e=oe.exec(t);if(!e)return[,];const[,s,i,n]=e;return[`--${s??i}`,n]}(t);if(!i)return;const r=window.getComputedStyle(e).getPropertyValue(i);if(r){const t=r.trim();return te(t)?parseFloat(t):t}return ne(n)?ae(n,e,s+1):n}const he={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},le={...he,transform:t=>et(0,1,t)},ce={...he,default:1},ue=t=>({test:e=>"string"==typeof e&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),de=ue("deg"),fe=ue("%"),pe=ue("px"),me=ue("vh"),ve=ue("vw"),ye={...fe,parse:t=>fe.parse(t)/100,transform:t=>fe.transform(100*t)},ge=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),be=t=>t===he||t===pe,we=(t,e)=>parseFloat(t.split(", ")[e]),ke=(t,e)=>(s,{transform:i})=>{if("none"===i||!i)return 0;const n=i.match(/^matrix3d\((.+)\)$/u);if(n)return we(n[1],e);{const e=i.match(/^matrix\((.+)\)$/u);return e?we(e[1],t):0}},xe=new Set(["x","y","z"]),Se=It.filter((t=>!xe.has(t))),Me={width:({x:t},{paddingLeft:e="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),height:({y:t},{paddingTop:e="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:ke(4,13),y:ke(5,14)};Me.translateX=Me.x,Me.translateY=Me.y;const $e=t=>e=>e.test(t),Ce=[he,pe,fe,de,ve,me,{test:t=>"auto"===t,parse:t=>t}],Ae=t=>Ce.find($e(t)),Oe=new Set;let Te=!1,Pe=!1;function Fe(){if(Pe){const t=Array.from(Oe).filter((t=>t.needsMeasurement)),e=new Set(t.map((t=>t.element))),s=new Map;e.forEach((t=>{const e=function(t){const e=[];return Se.forEach((s=>{const i=t.getValue(s);void 0!==i&&(e.push([s,i.get()]),i.set(s.startsWith("scale")?1:0))})),e}(t);e.length&&(s.set(t,e),t.render())})),t.forEach((t=>t.measureInitialState())),e.forEach((t=>{t.render();const e=s.get(t);e&&e.forEach((([e,s])=>{var i;null===(i=t.getValue(e))||void 0===i||i.set(s)}))})),t.forEach((t=>t.measureEndState())),t.forEach((t=>{void 0!==t.suspendedScrollY&&window.scrollTo(0,t.suspendedScrollY)}))}Pe=!1,Te=!1,Oe.forEach((t=>t.complete())),Oe.clear()}function Ve(){Oe.forEach((t=>{t.readKeyframes(),t.needsMeasurement&&(Pe=!0)}))}class Ie{constructor(t,e,s,i,n,r=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=i,this.element=n,this.isAsync=r}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Oe.add(this),Te||(Te=!0,j.read(Ve),j.resolveKeyframes(Fe))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:i}=this;for(let n=0;n<t.length;n++)if(null===t[n])if(0===n){const n=null==i?void 0:i.get(),r=t[t.length-1];if(void 0!==n)t[0]=n;else if(s&&e){const i=s.readValue(e,r);null!=i&&(t[0]=i)}void 0===t[0]&&(t[0]=r),i&&void 0===n&&i.set(t[0])}else t[n]=t[n-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Oe.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Oe.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const De=t=>Math.round(1e5*t)/1e5,Be=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,ze=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,je=(t,e)=>s=>!!("string"==typeof s&&ze.test(s)&&s.startsWith(t)||e&&!function(t){return null==t}(s)&&Object.prototype.hasOwnProperty.call(s,e)),Ee=(t,e,s)=>i=>{if("string"!=typeof i)return i;const[n,r,o,a]=i.match(Be);return{[t]:parseFloat(n),[e]:parseFloat(r),[s]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},Re={...he,transform:t=>Math.round((t=>et(0,255,t))(t))},Ne={test:je("rgb","red"),parse:Ee("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:i=1})=>"rgba("+Re.transform(t)+", "+Re.transform(e)+", "+Re.transform(s)+", "+De(le.transform(i))+")"},Ue={test:je("#"),parse:function(t){let e="",s="",i="",n="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),i=t.substring(5,7),n=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),i=t.substring(3,4),n=t.substring(4,5),e+=e,s+=s,i+=i,n+=n),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(i,16),alpha:n?parseInt(n,16)/255:1}},transform:Ne.transform},Le={test:je("hsl","hue"),parse:Ee("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:i=1})=>"hsla("+Math.round(t)+", "+fe.transform(De(e))+", "+fe.transform(De(s))+", "+De(le.transform(i))+")"},Ke={test:t=>Ne.test(t)||Ue.test(t)||Le.test(t),parse:t=>Ne.test(t)?Ne.parse(t):Le.test(t)?Le.parse(t):Ue.parse(t),transform:t=>"string"==typeof t?t:t.hasOwnProperty("red")?Ne.transform(t):Le.transform(t)},Ye=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Xe="number",We="color",Ze="var",_e="var(",qe="${}",He=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Ge(t){const e=t.toString(),s=[],i={color:[],number:[],var:[]},n=[];let r=0;const o=e.replace(He,(t=>(Ke.test(t)?(i.color.push(r),n.push(We),s.push(Ke.parse(t))):t.startsWith(_e)?(i.var.push(r),n.push(Ze),s.push(t)):(i.number.push(r),n.push(Xe),s.push(parseFloat(t))),++r,qe))).split(qe);return{values:s,split:o,indexes:i,types:n}}function Je(t){return Ge(t).values}function Qe(t){const{split:e,types:s}=Ge(t),i=e.length;return t=>{let n="";for(let r=0;r<i;r++)if(n+=e[r],void 0!==t[r]){const e=s[r];n+=e===Xe?De(t[r]):e===We?Ke.transform(t[r]):t[r]}return n}}const ts=t=>"number"==typeof t?0:t,es={test:function(t){var e,s;return isNaN(t)&&"string"==typeof t&&((null===(e=t.match(Be))||void 0===e?void 0:e.length)||0)+((null===(s=t.match(Ye))||void 0===s?void 0:s.length)||0)>0},parse:Je,createTransformer:Qe,getAnimatableNone:function(t){const e=Je(t);return Qe(t)(e.map(ts))}},ss=new Set(["brightness","contrast","saturate","opacity"]);function is(t){const[e,s]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[i]=s.match(Be)||[];if(!i)return t;const n=s.replace(i,"");let r=ss.has(e)?1:0;return i!==s&&(r*=100),e+"("+r+n+")"}const ns=/\b([a-z-]*)\(.*?\)/gu,rs={...es,getAnimatableNone:t=>{const e=t.match(ns);return e?e.map(is).join(" "):t}},os={borderWidth:pe,borderTopWidth:pe,borderRightWidth:pe,borderBottomWidth:pe,borderLeftWidth:pe,borderRadius:pe,radius:pe,borderTopLeftRadius:pe,borderTopRightRadius:pe,borderBottomRightRadius:pe,borderBottomLeftRadius:pe,width:pe,maxWidth:pe,height:pe,maxHeight:pe,top:pe,right:pe,bottom:pe,left:pe,padding:pe,paddingTop:pe,paddingRight:pe,paddingBottom:pe,paddingLeft:pe,margin:pe,marginTop:pe,marginRight:pe,marginBottom:pe,marginLeft:pe,backgroundPositionX:pe,backgroundPositionY:pe},as={rotate:de,rotateX:de,rotateY:de,rotateZ:de,scale:ce,scaleX:ce,scaleY:ce,scaleZ:ce,skew:de,skewX:de,skewY:de,distance:pe,translateX:pe,translateY:pe,translateZ:pe,x:pe,y:pe,z:pe,perspective:pe,transformPerspective:pe,opacity:le,originX:ye,originY:ye,originZ:pe},hs={...he,transform:Math.round},ls={...os,...as,zIndex:hs,size:pe,fillOpacity:le,strokeOpacity:le,numOctaves:hs},cs={...ls,color:Ke,backgroundColor:Ke,outlineColor:Ke,fill:Ke,stroke:Ke,borderColor:Ke,borderTopColor:Ke,borderRightColor:Ke,borderBottomColor:Ke,borderLeftColor:Ke,filter:rs,WebkitFilter:rs},us=t=>cs[t];function ds(t,e){let s=us(t);return s!==rs&&(s=es),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const fs=new Set(["auto","none","0"]);class ps extends Ie{constructor(t,e,s,i,n){super(t,e,s,i,n,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:s}=this;if(!e||!e.current)return;super.readKeyframes();for(let s=0;s<t.length;s++){let i=t[s];if("string"==typeof i&&(i=i.trim(),ne(i))){const n=ae(i,e.current);void 0!==n&&(t[s]=n),s===t.length-1&&(this.finalKeyframe=i)}}if(this.resolveNoneKeyframes(),!ge.has(s)||2!==t.length)return;const[i,n]=t,r=Ae(i),o=Ae(n);if(r!==o)if(be(r)&&be(o))for(let e=0;e<t.length;e++){const s=t[e];"string"==typeof s&&(t[e]=parseFloat(s))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,s=[];for(let e=0;e<t.length;e++)("number"==typeof(i=t[e])?0===i:null===i||"none"===i||"0"===i||Qt(i))&&s.push(e);var i;s.length&&function(t,e,s){let i,n=0;for(;n<t.length&&!i;){const e=t[n];"string"==typeof e&&!fs.has(e)&&Ge(e).values.length&&(i=t[n]),n++}if(i&&s)for(const n of e)t[n]=ds(s,i)}(t,s,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:s}=this;if(!t||!t.current)return;"height"===s&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Me[s](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];void 0!==i&&t.getValue(s,i).jump(i,!1)}measureEndState(){var t;const{element:e,name:s,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const n=e.getValue(s);n&&n.jump(this.measuredOrigin,!1);const r=i.length-1,o=i[r];i[r]=Me[s](e.measureViewportBox(),window.getComputedStyle(e.current)),null!==o&&void 0===this.finalKeyframe&&(this.finalKeyframe=o),!(null===(t=this.removedTransforms)||void 0===t)&&t.length&&this.removedTransforms.forEach((([t,s])=>{e.getValue(t).set(s)})),this.resolveNoneKeyframes()}}const ms=(t,e)=>"zIndex"!==e&&!("number"!=typeof t&&!Array.isArray(t)&&("string"!=typeof t||!es.test(t)&&"0"!==t||t.startsWith("url(")));class vs{constructor({autoplay:t=!0,delay:e=0,type:s="keyframes",repeat:i=0,repeatDelay:n=0,repeatType:r="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=K.now(),this.options={autoplay:t,delay:e,type:s,repeat:i,repeatDelay:n,repeatType:r,...o},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt&&this.resolvedAt-this.createdAt>40?this.resolvedAt:this.createdAt}get resolved(){return!this.D&&!this.hasAttemptedResolve&&(Ve(),Fe()),this.D}onKeyframesResolved(t,e){this.resolvedAt=K.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:n,delay:r,onComplete:o,onUpdate:a,isGenerator:h}=this.options;if(!h&&!function(t,e,s,i){const n=t[0];if(null===n)return!1;if("display"===e||"visibility"===e)return!0;const r=t[t.length-1],o=ms(n,e),a=ms(r,e);return T(o===a,`You are trying to animate ${e} from "${n}" to "${r}". ${n} is not an animatable value - to enable this animation set ${n} to a value animatable to ${r} via the \`style\` property.`),!(!o||!a)&&(function(t){const e=t[0];if(1===t.length)return!0;for(let s=0;s<t.length;s++)if(t[s]!==e)return!0}(t)||("spring"===s||bt(s))&&i)}(t,s,i,n)){if(!r)return null==a||a(Ut(t,this.options,e)),null==o||o(),void this.resolveFinishedPromise();this.options.duration=0}const l=this.initPlayback(t,e);!1!==l&&(this.D={keyframes:t,finalKeyframe:e,...l},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise((t=>{this.resolveFinishedPromise=t}))}}function ys({keyframes:t,velocity:e=0,power:s=.8,timeConstant:i=325,bounceDamping:n=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:h,restDelta:l=.5,restSpeed:c}){const u=t[0],d={done:!1,value:u},f=t=>void 0===a?h:void 0===h||Math.abs(a-t)<Math.abs(h-t)?a:h;let p=s*e;const m=u+p,v=void 0===o?m:o(m);v!==m&&(p=v-u);const y=t=>-p*Math.exp(-t/i),g=t=>v+y(t),b=t=>{const e=y(t),s=g(t);d.done=Math.abs(e)<=l,d.value=d.done?v:s};let w,k;const x=t=>{(t=>void 0!==a&&t<a||void 0!==h&&t>h)(d.value)&&(w=t,k=ut({keyframes:[d.value,f(d.value)],velocity:tt(g,t,d.value),damping:n,stiffness:r,restDelta:l,restSpeed:c}))};return x(0),{calculatedDuration:null,next:t=>{let e=!1;return!k&&void 0===w&&(e=!0,b(t),x(t)),void 0!==w&&t>=w?k.next(t-w):(!e&&b(t),d)}}}const gs=Kt(.42,0,1,1),bs=Kt(0,0,.58,1),ws=Kt(.42,0,.58,1),ks=t=>Array.isArray(t)&&"number"==typeof t[0],xs={linear:O,easeIn:gs,easeInOut:ws,easeOut:bs,circIn:Ht,circInOut:Jt,circOut:Gt,backIn:Zt,backInOut:_t,backOut:Wt,anticipate:qt},Ss=t=>{if(ks(t)){P(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,s,i,n]=t;return Kt(e,s,i,n)}return"string"==typeof t?(P(void 0!==xs[t],`Invalid easing type '${t}'`),xs[t]):t},Ms=(t,e)=>s=>e(t(s)),$s=(...t)=>t.reduce(Ms);function Cs(t,e,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+6*(e-t)*s:s<.5?e:s<2/3?t+(e-t)*(2/3-s)*6:t}function As(t,e){return s=>s>0?e:t}const Os=(t,e,s)=>{const i=t*t,n=s*(e*e-i)+i;return n<0?0:Math.sqrt(n)},Ts=[Ue,Ne,Le];function Ps(t){const e=(t=>Ts.find((e=>e.test(t))))(t);if(T(!!e,`'${t}' is not an animatable color. Use the equivalent color code instead.`),!e)return!1;let s=e.parse(t);return e===Le&&(s=function({hue:t,saturation:e,lightness:s,alpha:i}){t/=360,s/=100;let n=0,r=0,o=0;if(e/=100){const i=s<.5?s*(1+e):s+e-s*e,a=2*s-i;n=Cs(a,i,t+1/3),r=Cs(a,i,t),o=Cs(a,i,t-1/3)}else n=r=o=s;return{red:Math.round(255*n),green:Math.round(255*r),blue:Math.round(255*o),alpha:i}}(s)),s}const Fs=(t,e)=>{const s=Ps(t),i=Ps(e);if(!s||!i)return As(t,e);const n={...s};return t=>(n.red=Os(s.red,i.red,t),n.green=Os(s.green,i.green,t),n.blue=Os(s.blue,i.blue,t),n.alpha=ft(s.alpha,i.alpha,t),Ne.transform(n))},Vs=new Set(["none","hidden"]);function Is(t,e){return s=>ft(t,e,s)}function Ds(t){return"number"==typeof t?Is:"string"==typeof t?ne(t)?As:Ke.test(t)?Fs:js:Array.isArray(t)?Bs:"object"==typeof t?Ke.test(t)?Fs:zs:As}function Bs(t,e){const s=[...t],i=s.length,n=t.map(((t,s)=>Ds(t)(t,e[s])));return t=>{for(let e=0;e<i;e++)s[e]=n[e](t);return s}}function zs(t,e){const s={...t,...e},i={};for(const n in s)void 0!==t[n]&&void 0!==e[n]&&(i[n]=Ds(t[n])(t[n],e[n]));return t=>{for(const e in i)s[e]=i[e](t);return s}}const js=(t,e)=>{const s=es.createTransformer(e),i=Ge(t),n=Ge(e);return i.indexes.var.length===n.indexes.var.length&&i.indexes.color.length===n.indexes.color.length&&i.indexes.number.length>=n.indexes.number.length?Vs.has(t)&&!n.values.length||Vs.has(e)&&!i.values.length?function(t,e){return Vs.has(t)?s=>s<=0?t:e:s=>s>=1?e:t}(t,e):$s(Bs(function(t,e){var s;const i=[],n={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const o=e.types[r],a=t.indexes[o][n[o]],h=null!==(s=t.values[a])&&void 0!==s?s:0;i[r]=h,n[o]++}return i}(i,n),n.values),s):(T(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),As(t,e))};function Es(t,e,s){return"number"==typeof t&&"number"==typeof e&&"number"==typeof s?ft(t,e,s):Ds(t)(t,e)}function Rs(t,e){return t.map((()=>e||ws)).splice(0,t.length-1)}function Ns({duration:t=300,keyframes:e,times:s,ease:i="easeInOut"}){const n=xt(i)?i.map(Ss):Ss(i),r={done:!1,value:e[0]},o=function(t,e){return t.map((t=>t*e))}(s&&s.length===e.length?s:mt(e),t),a=function(t,e,{clamp:s=!0,ease:i,mixer:n}={}){const r=t.length;if(P(r===e.length,"Both input and output ranges must be the same length"),1===r)return()=>e[0];if(2===r&&t[0]===t[1])return()=>e[1];t[0]>t[r-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=function(t,e,s){const i=[],n=s||Es,r=t.length-1;for(let s=0;s<r;s++){let r=n(t[s],t[s+1]);if(e){const t=Array.isArray(e)?e[s]||O:e;r=$s(t,r)}i.push(r)}return i}(e,i,n),a=o.length,h=e=>{let s=0;if(a>1)for(;s<t.length-2&&!(e<t[s+1]);s++);const i=q(t[s],t[s+1],e);return o[s](i)};return s?e=>h(et(t[0],t[r-1],e)):h}(o,e,{ease:Array.isArray(n)?n:Rs(e,n)});return{calculatedDuration:t,next:e=>(r.value=a(e),r.done=e>=t,r)}}const Us=t=>{const e=({timestamp:e})=>t(e);return{start:()=>j.update(e,!0),stop:()=>E(e),now:()=>R.isProcessing?R.timestamp:K.now()}},Ls={decay:ys,inertia:ys,tween:Ns,keyframes:Ns,spring:ut},Ks=t=>t/100;class Ys extends vs{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:t}=this.options;t&&t()};const{name:e,motionValue:s,element:i,keyframes:n}=this.options,r=(null==i?void 0:i.KeyframeResolver)||Ie;this.resolver=new r(n,((t,e)=>this.onKeyframesResolved(t,e)),e,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this.D&&Object.assign(this.D,this.initPlayback(this.D.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:n,velocity:r=0}=this.options,o=bt(e)?e:Ls[e]||Ns;let a,h;o!==Ns&&"number"!=typeof t[0]&&("production"!==process.env.NODE_ENV&&P(2===t.length,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${t}`),a=$s(Ks,Es(t[0],t[1])),t=[0,100]);const l=o({...this.options,keyframes:t});"mirror"===n&&(h=o({...this.options,keyframes:[...t].reverse(),velocity:-r})),null===l.calculatedDuration&&(l.calculatedDuration=at(l));const{calculatedDuration:c}=l,u=c+i;return{generator:l,mirroredGenerator:h,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:u,totalDuration:u*(s+1)-i}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&t?this.state=this.pendingPlayState:this.pause()}tick(t,e=!1){const{resolved:s}=this;if(!s){const{keyframes:t}=this.options;return{done:!0,value:t[t.length-1]}}const{finalKeyframe:i,generator:n,mirroredGenerator:r,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:h,totalDuration:l,resolvedDuration:c}=s;if(null===this.startTime)return n.next(0);const{delay:u,repeat:d,repeatType:f,repeatDelay:p,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-l/this.speed,this.startTime)),e?this.currentTime=t:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const v=this.currentTime-u*(this.speed>=0?1:-1),y=this.speed>=0?v<0:v>l;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=l);let g=this.currentTime,b=n;if(d){const t=Math.min(this.currentTime,l)/c;let e=Math.floor(t),s=t%1;!s&&t>=1&&(s=1),1===s&&e--,e=Math.min(e,d+1),!!(e%2)&&("reverse"===f?(s=1-s,p&&(s-=p/c)):"mirror"===f&&(b=r)),g=et(0,1,s)*c}const w=y?{done:!1,value:a[0]}:b.next(g);o&&(w.value=o(w.value));let{done:k}=w;!y&&null!==h&&(k=this.speed>=0?this.currentTime>=l:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&k);return x&&void 0!==i&&(w.value=Ut(a,this.options,i)),m&&m(w.value),x&&this.finish(),w}get duration(){const{resolved:t}=this;return t?J(t.calculatedDuration):0}get time(){return J(this.currentTime)}set time(t){t=G(t),this.currentTime=t,null!==this.holdTime||0===this.speed?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=J(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this.D)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:t=Us,onPlay:e,startTime:s}=this.options;this.driver||(this.driver=t((t=>this.tick(t)))),e&&e();const i=this.driver.now();null!==this.holdTime?this.startTime=i-this.holdTime:this.startTime?"finished"===this.state&&(this.startTime=i):this.startTime=s??this.calcStartTime(),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;this.D?(this.state="paused",this.holdTime=null!==(t=this.currentTime)&&void 0!==t?t:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Xs=new Set(["opacity","clipPath","filter","transform"]),Ws=void 0,Zs=function(t,e){const s=W((()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}));return()=>{var t;return null!==(t=Ws)&&void 0!==t?t:s()}}();function _s(t){return!!("function"==typeof t&&Zs()||!t||"string"==typeof t&&(t in Hs||Zs())||ks(t)||Array.isArray(t)&&t.every(_s))}const qs=([t,e,s,i])=>`cubic-bezier(${t}, ${e}, ${s}, ${i})`,Hs={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qs([0,.65,.55,1]),circOut:qs([.55,0,1,.45]),backIn:qs([.31,.01,.66,-.59]),backOut:qs([.33,1.53,.69,.99])};function Gs(t,e){if(t)return"function"==typeof t&&Zs()?H(t,e):ks(t)?qs(t):Array.isArray(t)?t.map((t=>Gs(t,e)||Hs.easeOut)):Hs[t]}function Js(t,e,s,{delay:i=0,duration:n=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:h}={}){const l={[e]:s};h&&(l.offset=h);const c=Gs(a,n);return Array.isArray(c)&&(l.easing=c),t.animate(l,{delay:i,duration:n,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:r+1,direction:"reverse"===o?"alternate":"normal"})}function Qs(t,e){t.timeline=e,t.onfinish=null}const ti=W((()=>Object.hasOwnProperty.call(Element.prototype,"animate"))),ei={anticipate:qt,backInOut:_t,circInOut:Jt};class si extends vs{constructor(t){super(t);const{name:e,motionValue:s,element:i,keyframes:n}=this.options;this.resolver=new ps(n,((t,e)=>this.onKeyframesResolved(t,e)),e,s,i),this.resolver.scheduleResolve()}initPlayback(t,e){var s;let{duration:i=300,times:n,ease:r,type:o,motionValue:a,name:h,startTime:l}=this.options;if(null===(s=a.owner)||void 0===s||!s.current)return!1;if("string"==typeof r&&Zs()&&r in ei&&(r=ei[r]),bt((c=this.options).type)||"spring"===c.type||!_s(c.ease)){const{onComplete:e,onUpdate:s,motionValue:a,element:h,...l}=this.options,c=function(t,e){const s=new Ys({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:t[0]};const n=[];let r=0;for(;!i.done&&r<2e4;)i=s.sample(r),n.push(i.value),r+=10;return{times:void 0,keyframes:n,duration:r-10,ease:"linear"}}(t,l);1===(t=c.keyframes).length&&(t[1]=t[0]),i=c.duration,n=c.times,r=c.ease,o="keyframes"}var c;const u=Js(a.owner.current,h,t,{...this.options,duration:i,times:n,ease:r});return u.startTime=l??this.calcStartTime(),this.pendingTimeline?(Qs(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:s}=this.options;a.set(Ut(t,this.options,e)),s&&s(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:i,times:n,type:o,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return J(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return J(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:s}=e;s.currentTime=G(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:s}=e;s.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(this.D){const{resolved:e}=this;if(!e)return O;const{animation:s}=e;Qs(s,t)}else this.pendingTimeline=t;return O}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;"finished"===e.playState&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:s,duration:i,type:n,ease:r,times:o}=t;if("idle"===e.playState||"finished"===e.playState)return;if(this.time){const{motionValue:t,onUpdate:e,onComplete:a,element:h,...l}=this.options,c=new Ys({...l,keyframes:s,duration:i,type:n,ease:r,times:o,isGenerator:!0}),u=G(this.time);t.setWithVelocity(c.sample(u-10).value,c.sample(u).value,10)}const{onStop:a}=this.options;a&&a(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:s,repeatDelay:i,repeatType:n,damping:r,type:o}=t;return ti()&&s&&Xs.has(s)&&e&&e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate&&!i&&"mirror"!==n&&0!==r&&"inertia"!==o}}const ii=(t,e,s,i={},n,r)=>o=>{const a=Rt(i,t)||{},h=a.delay||i.delay||0;let{elapsed:l=0}=i;l-=G(h);let c={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-l,onUpdate:t=>{e.set(t),a.onUpdate&&a.onUpdate(t)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:r?void 0:n};(function({when:t,delay:e,delayChildren:s,staggerChildren:i,staggerDirection:n,repeat:r,repeatType:o,repeatDelay:a,from:h,elapsed:l,...c}){return!!Object.keys(c).length})(a)||(c={...c,...Et(t,c)}),c.duration&&(c.duration=G(c.duration)),c.repeatDelay&&(c.repeatDelay=G(c.repeatDelay)),void 0!==c.from&&(c.keyframes[0]=c.from);let u=!1;if((!1===c.type||0===c.duration&&!c.repeatDelay)&&(c.duration=0,0===c.delay&&(u=!0)),u&&!r&&void 0!==e.get()){const t=Ut(c.keyframes,a);if(void 0!==t)return j.update((()=>{c.onUpdate(t),c.onComplete()})),new _([])}return!r&&si.supports(c)?new si(c):new Ys(c)},ni=t=>(t=>Array.isArray(t))(t)?t[t.length-1]||0:t;function ri(t){const e=[{},{}];return null==t||t.values.forEach(((t,s)=>{e[0][s]=t.get(),e[1][s]=t.getVelocity()})),e}function oi(t,e,s,i){if("function"==typeof e){const[n,r]=ri(i);e=e(void 0!==s?s:t.custom,n,r)}if("string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e){const[n,r]=ri(i);e=e(void 0!==s?s:t.custom,n,r)}return e}function ai(t,e,s){t.hasValue(e)?t.getValue(e).set(s):t.addValue(e,X(s))}const hi=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),li="data-"+hi("framerAppearId");function ci(t){return t.props[li]}function ui(t,e){const s=t.getValue("willChange");if(function(t){return!(!vt(t)||!t.add)}(s))return s.add(e)}function di({protectedKeys:t,needsAnimating:e},s){const i=t.hasOwnProperty(s)&&!0!==e[s];return e[s]=!1,i}function fi(t,e,{delay:s=0,transitionOverride:i,type:n}={}){var r;let{transition:o=t.getDefaultTransition(),transitionEnd:a,...h}=e;i&&(o=i);const l=[],c=n&&t.animationState&&t.animationState.getState()[n];for(const e in h){const i=t.getValue(e,null!==(r=t.latestValues[e])&&void 0!==r?r:null),n=h[e];if(void 0===n||c&&di(c,e))continue;const a={delay:s,...Rt(o||{},e)};let u=!1;if(window.MotionHandoffAnimation){const s=ci(t);if(s){const t=window.MotionHandoffAnimation(s,e,j);null!==t&&(a.startTime=t,u=!0)}}ui(t,e),i.start(ii(e,i,n,t.shouldReduceMotion&&Dt.has(e)?{type:!1}:a,t,u));const d=i.animation;d&&l.push(d)}return a&&Promise.all(l).then((()=>{j.update((()=>{a&&function(t,e){const s=function(t,e,s){const i=t.getProps();return oi(i,e,i.custom,t)}(t,e);let{transitionEnd:i={},transition:n={},...r}=s||{};r={...r,...i};for(const e in r)ai(t,e,ni(r[e]))}(t,a)}))})),l}const pi={};function mi(t,{layout:e,layoutId:s}){return Dt.has(t)||t.startsWith("origin")||(e||void 0!==s)&&(!!pi[t]||"opacity"===t)}function vi(t,e,s){var i;const{style:n}=t,r={};for(const o in n)(vt(n[o])||e.style&&vt(e.style[o])||mi(o,t)||void 0!==(null===(i=null==s?void 0:s.getValue(o))||void 0===i?void 0:i.liveStyle))&&(r[o]=n[o]);return r}const yi=typeof window<"u",gi={current:null},bi={current:!1},wi=["initial","animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"];function ki(t){return function(t){return null!==t&&"object"==typeof t&&"function"==typeof t.start}(t.animate)||wi.some((e=>function(t){return"string"==typeof t||Array.isArray(t)}(t[e])))}const xi={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Si={};for(const t in xi)Si[t]={isEnabled:e=>xi[t].some((t=>!!e[t]))};const Mi=[...Ce,Ke,es],$i=()=>({x:{min:0,max:0},y:{min:0,max:0}}),Ci=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class Ai{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:n,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ie,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdat