@reearth/core 0.0.7-alpha.72 → 0.0.7-alpha.75

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.js CHANGED
@@ -96441,7 +96441,7 @@ function gXe({ error: e, resetErrorBoundary: t }) {
96441
96441
  /* @__PURE__ */ ae.jsx("p", { children: /* @__PURE__ */ ae.jsx("button", { style: { color: "#fff" }, onClick: t, children: "Retry" }) })
96442
96442
  ] });
96443
96443
  }
96444
- const yXe = "0.0.7-alpha.72", bXe = ({ viewerProperty: e }) => {
96444
+ const yXe = "0.0.7-alpha.75", bXe = ({ viewerProperty: e }) => {
96445
96445
  const t = de(e);
96446
96446
  t.current = e;
96447
96447
  const n = he(
package/dist/core.umd.cjs CHANGED
@@ -6728,7 +6728,7 @@ vec3 getTurboColormap(const float v) {
6728
6728
  ${zb}
6729
6729
  ${dPe}
6730
6730
  ${lPe}
6731
- `,uniforms:{...Qr(u,["color","frustumLength","blackPoint","whitePoint","gamma"]),globeDepthTexture:()=>c?.()??d._depthTexture}});if(r){const f=aPe({prefix:e,outputType:s,useGlobeDepth:a,getGlobeDepthTexture:c,uniforms:{textureScale:t,...Qr(u,["frustumLength","normalExponent","depthExponent"])}}),p=new M.PostProcessStageComposite({name:`${e}_ambient_occlusion_generate_and_filter`,stages:[h,f]});return d.uniforms.ambientOcclusionTexture=p.name,new M.PostProcessStageComposite({name:`${e}_ambient_occlusion`,stages:[p,d],inputPreviousStageTexture:!1,uniforms:fE([{stage:h,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:f,uniforms:["frustumLength","normalExponent","depthExponent"]},{stage:d,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}else return d.uniforms.ambientOcclusionTexture=h.name,new M.PostProcessStageComposite({name:`${e}_ambient_occlusion`,stages:[h,d],inputPreviousStageTexture:!1,uniforms:fE([{stage:h,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:d,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}const mPe=({enabled:e=!0,textureScale:t,directions:n,steps:i,denoise:r,accurateNormalReconstruction:o,outputType:s,useGlobeDepth:a,...c})=>{const{viewer:l}=ei(),u=l?.scene,h=mF({owner:u?.postProcessStages,keys:[t,i,n,r,o,s,a],create:()=>{const d=pPe({textureScale:t,steps:i,directions:n,denoise:r,accurateNormalReconstruction:o,outputType:s,useGlobeDepth:a,getGlobeDepthTexture:()=>u.context.uniformState.globeDepthTexture,uniforms:c});return d.enabled=e,d},transferOwnership:(d,f)=>(f?.add(d),()=>{f?.remove(d)})});return h.enabled=e,Object.assign(h.uniforms,c),u?.requestRender(),Gl(()=>{const d=u?.camera.frustum;if(d instanceof M.PerspectiveFrustum&&d.fovy!==void 0&&d.aspectRatio!==void 0){const f=1/Math.tan(d.fovy/2);h.uniforms.focalLength.x=f*d.aspectRatio,h.uniforms.focalLength.y=f}}),null},gPe=e=>{const t=ei(),[n,i]=R.useState(!1);return Gl(()=>{const r=t.scene;i(!r?.globe.depthTestAgainstTerrain);const{globeHeight:o}=r;if(!r||o==null)return;const s=r.camera.positionCartographic.height-o,a=r?.camera.frustum;a instanceof M.PerspectiveFrustum&&a.fov!==void 0&&(r.camera.frustum.near=M.Math.clamp(s-1,1,5)/Math.tan(a.fov/2))}),ce.jsx(mPe,{...e,useGlobeDepth:n})};var TN=(e=>(e[e.Occlusion=1]="Occlusion",e[e.Normal=2]="Normal",e[e.Depth=3]="Depth",e[e.Weight=4]="Weight",e[e.Shade=5]="Shade",e))(TN||{});const yPe={low:{directions:4,steps:4,textureScale:.5,maxRadius:30},medium:{directions:4,steps:8,textureScale:.5,maxRadius:40},high:{directions:8,steps:8,textureScale:1,maxRadius:40},extreme:{directions:16,steps:16,textureScale:1,maxRadius:40}},bPe="#00bebe",d0="#3B3CD0",_Pe="#FF9900",vPe="#3B3CD0";let Jl,wPe,xPe,Ql;const f0=({position:e,clampToGround:t=!1,index:n,isEditing:i,isSelected:r,isAddingPoint:o,isExtrudedControlPoint:s,handleControlPointMouseEvent:a})=>{const c=R.useRef(e);c.current=e;const l=Wo(()=>new wo((f,p)=>"getValue"in c.current?c.current.getValue(f,p):c.current,!1)),u=R.useMemo(()=>({position:l,billboard:{image:i?o?CPe():r?TPe():EPe():SPe(),width:i?16:8,height:i?16:8,heightReference:t?vl.CLAMP_TO_GROUND:vl.NONE,disableDepthTestDistance:1/0}}),[t,l,o,i,r]),h=R.useCallback(()=>{a?.(n,!!s,"mousedown")},[n,s,a]),d=R.useCallback(()=>{a?.(n,!!s,"click")},[n,s,a]);return ce.jsx(uc,{...u,onMouseDown:h,onClick:d})};function SPe(){if(Jl!=null)return Jl;Jl=document.createElement("canvas"),Jl.width=16,Jl.height=16;const e=Jl.getContext("2d");return Vn(e!=null),e.fillStyle="white",e.fillRect(3,3,10,10),e.strokeStyle="black",e.lineWidth=2,e.strokeRect(3,3,10,10),Jl}function EPe(){return CN(wPe,{size:32,color:"white",strokeColor:d0})}function TPe(){return CN(xPe,{size:32,color:"white",strokeColor:_Pe})}function CPe(){if(Ql!=null)return Ql;Ql=document.createElement("canvas"),Ql.width=32,Ql.height=32;const e=Ql.getContext("2d");return Vn(e!=null),e.beginPath(),e.arc(16,16,12,0,2*Math.PI),e.fillStyle="white",e.fill(),e.strokeStyle=vPe,e.lineWidth=4,e.stroke(),e.beginPath(),e.moveTo(16,8),e.lineTo(16,24),e.stroke(),e.moveTo(8,16),e.lineTo(24,16),e.stroke(),Ql}function CN(e,t){if(e!=null)return e;e=document.createElement("canvas"),e.width=t.size,e.height=t.size;const n=e.getContext("2d");return Vn(n!=null),n.beginPath(),n.arc(t.size/2,t.size/2,t.size/2-4,0,2*Math.PI),n.fillStyle=t.color,n.fill(),n.strokeStyle=t.strokeColor,n.lineWidth=4,n.stroke(),e}function RPe(e,t){if(typeof e=="function")return e(t),()=>{e(null)};if(e!=null)return e.current=t,()=>{e.current=null}}const p0=R.memo(R.forwardRef(({entities:e,...t},n)=>{const{viewer:i}=ei(),r=i?.scene,o=i?.entities,s=e??o,[a,c]=R.useState(()=>new io(t));return R.useEffect(()=>{c(new io(t))},[t.id]),R.useEffect(()=>(s?.add(a),()=>{s?.remove(a),r?.requestRender()}),[r,s,a]),R.useEffect(()=>RPe(n,a),[n,a]),Object.assign(a,Ka(t,"id")),r?.requestRender(),null})),IPe={padding:"5px",color:"#fff",backgroundColor:"#000",borderRadius:"5px",lineHeight:1},RN=({children:e})=>ce.jsx("div",{style:IPe,children:e}),IN=R.createContext({});function MN(e){const t=R.useRef(null);return t.current===null&&(t.current=e()),t.current}const MPe=typeof window<"u"?R.useLayoutEffect:R.useEffect,pE=R.createContext(null);function mE(e,t){e.indexOf(t)===-1&&e.push(t)}function Nb(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ia=(e,t,n)=>n>t?t:n<e?e:n;function gE(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Jh=()=>{},Ua=()=>{};typeof process<"u"&&process.env?.NODE_ENV!=="production"&&(Jh=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(gE(t,n))},Ua=(e,t,n)=>{if(!e)throw new Error(gE(t,n))});const Wa={},LN=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function PN(e){return typeof e=="object"&&e!==null}const ON=e=>/^0[^.\s]+$/u.test(e);function GN(e){let t;return()=>(t===void 0&&(t=e()),t)}const No=e=>e,LPe=(e,t)=>n=>t(e(n)),m0=(...e)=>e.reduce(LPe),g0=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i};class yE{constructor(){this.subscriptions=[]}add(t){return mE(this.subscriptions,t),()=>Nb(this.subscriptions,t)}notify(t,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,i);else for(let o=0;o<r;o++){const s=this.subscriptions[o];s&&s(t,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ko=e=>e*1e3,Xo=e=>e/1e3;function VN(e,t){return t?e*(1e3/t):0}const FN=new Set;function bE(e,t,n){e||FN.has(t)||(console.warn(gE(t,n)),FN.add(t))}const AN=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,PPe=1e-7,OPe=12;function GPe(e,t,n,i,r){let o,s,a=0;do s=t+(n-t)/2,o=AN(s,i,r)-e,o>0?n=s:t=s;while(Math.abs(o)>PPe&&++a<OPe);return s}function y0(e,t,n,i){if(e===t&&n===i)return No;const r=o=>GPe(o,0,1,e,n);return o=>o===0||o===1?o:AN(r(o),t,i)}const zN=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,NN=e=>t=>1-e(1-t),kN=y0(.33,1.53,.69,.99),_E=NN(kN),XN=zN(_E),ZN=e=>(e*=2)<1?.5*_E(e):.5*(2-Math.pow(2,-10*(e-1))),vE=e=>1-Math.sin(Math.acos(e)),DN=NN(vE),UN=zN(vE),VPe=y0(.42,0,1,1),FPe=y0(0,0,.58,1),WN=y0(.42,0,.58,1),APe=e=>Array.isArray(e)&&typeof e[0]!="number",BN=e=>Array.isArray(e)&&typeof e[0]=="number",YN={linear:No,easeIn:VPe,easeInOut:WN,easeOut:FPe,circIn:vE,circInOut:UN,circOut:DN,backIn:_E,backInOut:XN,backOut:kN,anticipate:ZN},zPe=e=>typeof e=="string",HN=e=>{if(BN(e)){Ua(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,i,r]=e;return y0(t,n,i,r)}else if(zPe(e))return Ua(YN[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),YN[e];return e},kb=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function NPe(e,t){let n=new Set,i=new Set,r=!1,o=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(u){s.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,h=!1,d=!1)=>{const p=d&&r?n:i;return h&&s.add(u),p.has(u)||p.add(u),u},cancel:u=>{i.delete(u),s.delete(u)},process:u=>{if(a=u,r){o=!0;return}r=!0,[n,i]=[i,n],n.forEach(c),n.clear(),r=!1,o&&(o=!1,l.process(u))}};return l}const kPe=40;function jN(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=kb.reduce((S,E)=>(S[E]=NPe(o),S),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:h,preRender:d,render:f,postRender:p}=s,m=()=>{const S=Wa.useManualTiming?r.timestamp:performance.now();n=!1,Wa.useManualTiming||(r.delta=i?1e3/60:Math.max(Math.min(S-r.timestamp,kPe),1)),r.timestamp=S,r.isProcessing=!0,a.process(r),c.process(r),l.process(r),u.process(r),h.process(r),d.process(r),f.process(r),p.process(r),r.isProcessing=!1,n&&t&&(i=!1,e(m))},y=()=>{n=!0,i=!0,r.isProcessing||e(m)};return{schedule:kb.reduce((S,E)=>{const C=s[E];return S[E]=(O,V=!1,A=!1)=>(n||y(),C.schedule(O,V,A)),S},{}),cancel:S=>{for(let E=0;E<kb.length;E++)s[kb[E]].cancel(S)},state:r,steps:s}}const{schedule:Tn,cancel:Bc,state:Xi,steps:wE}=jN(typeof requestAnimationFrame<"u"?requestAnimationFrame:No,!0);let Xb;function XPe(){Xb=void 0}const wr={now:()=>(Xb===void 0&&wr.set(Xi.isProcessing||Wa.useManualTiming?Xi.timestamp:performance.now()),Xb),set:e=>{Xb=e,queueMicrotask(XPe)}},KN=e=>t=>typeof t=="string"&&t.startsWith(e),JN=KN("--"),ZPe=KN("var(--"),xE=e=>ZPe(e)?DPe.test(e.split("/*")[0].trim()):!1,DPe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function QN(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Qh={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},b0={...Qh,transform:e=>ia(0,1,e)},Zb={...Qh,default:1},_0=e=>Math.round(e*1e5)/1e5,SE=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function UPe(e){return e==null}const WPe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,EE=(e,t)=>n=>!!(typeof n=="string"&&WPe.test(n)&&n.startsWith(e)||t&&!UPe(n)&&Object.prototype.hasOwnProperty.call(n,t)),qN=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,o,s,a]=i.match(SE);return{[e]:parseFloat(r),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},BPe=e=>ia(0,255,e),TE={...Qh,transform:e=>Math.round(BPe(e))},ql={test:EE("rgb","red"),parse:qN("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+TE.transform(e)+", "+TE.transform(t)+", "+TE.transform(n)+", "+_0(b0.transform(i))+")"};function YPe(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const CE={test:EE("#"),parse:YPe,transform:ql.transform},v0=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Yc=v0("deg"),ra=v0("%"),ct=v0("px"),HPe=v0("vh"),jPe=v0("vw"),$N={...ra,parse:e=>ra.parse(e)/100,transform:e=>ra.transform(e*100)},qh={test:EE("hsl","hue"),parse:qN("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+ra.transform(_0(t))+", "+ra.transform(_0(n))+", "+_0(b0.transform(i))+")"},hi={test:e=>ql.test(e)||CE.test(e)||qh.test(e),parse:e=>ql.test(e)?ql.parse(e):qh.test(e)?qh.parse(e):CE.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ql.transform(e):qh.transform(e),getAnimatableNone:e=>{const t=hi.parse(e);return t.alpha=0,hi.transform(t)}},KPe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function JPe(e){return isNaN(e)&&typeof e=="string"&&(e.match(SE)?.length||0)+(e.match(KPe)?.length||0)>0}const ek="number",tk="color",QPe="var",qPe="var(",nk="${}",$Pe=/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 w0(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let o=0;const a=t.replace($Pe,c=>(hi.test(c)?(i.color.push(o),r.push(tk),n.push(hi.parse(c))):c.startsWith(qPe)?(i.var.push(o),r.push(QPe),n.push(c)):(i.number.push(o),r.push(ek),n.push(parseFloat(c))),++o,nk)).split(nk);return{values:n,split:a,indexes:i,types:r}}function ik(e){return w0(e).values}function rk(e){const{split:t,types:n}=w0(e),i=t.length;return r=>{let o="";for(let s=0;s<i;s++)if(o+=t[s],r[s]!==void 0){const a=n[s];a===ek?o+=_0(r[s]):a===tk?o+=hi.transform(r[s]):o+=r[s]}return o}}const eOe=e=>typeof e=="number"?0:hi.test(e)?hi.getAnimatableNone(e):e;function tOe(e){const t=ik(e);return rk(e)(t.map(eOe))}const ys={test:JPe,parse:ik,createTransformer:rk,getAnimatableNone:tOe};function RE(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function nOe({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let r=0,o=0,s=0;if(!t)r=o=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;r=RE(c,a,e+1/3),o=RE(c,a,e),s=RE(c,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:i}}function Db(e,t){return n=>n>0?t:e}const Dn=(e,t,n)=>e+(t-e)*n,IE=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},iOe=[CE,ql,qh],rOe=e=>iOe.find(t=>t.test(e));function ok(e){const t=rOe(e);if(Jh(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===qh&&(n=nOe(n)),n}const sk=(e,t)=>{const n=ok(e),i=ok(t);if(!n||!i)return Db(e,t);const r={...n};return o=>(r.red=IE(n.red,i.red,o),r.green=IE(n.green,i.green,o),r.blue=IE(n.blue,i.blue,o),r.alpha=Dn(n.alpha,i.alpha,o),ql.transform(r))},ME=new Set(["none","hidden"]);function oOe(e,t){return ME.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function sOe(e,t){return n=>Dn(e,t,n)}function LE(e){return typeof e=="number"?sOe:typeof e=="string"?xE(e)?Db:hi.test(e)?sk:lOe:Array.isArray(e)?ak:typeof e=="object"?hi.test(e)?sk:aOe:Db}function ak(e,t){const n=[...e],i=n.length,r=e.map((o,s)=>LE(o)(o,t[s]));return o=>{for(let s=0;s<i;s++)n[s]=r[s](o);return n}}function aOe(e,t){const n={...e,...t},i={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(i[r]=LE(e[r])(e[r],t[r]));return r=>{for(const o in i)n[o]=i[o](r);return n}}function cOe(e,t){const n=[],i={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const o=t.types[r],s=e.indexes[o][i[o]],a=e.values[s]??0;n[r]=a,i[o]++}return n}const lOe=(e,t)=>{const n=ys.createTransformer(t),i=w0(e),r=w0(t);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?ME.has(e)&&!r.values.length||ME.has(t)&&!i.values.length?oOe(e,t):m0(ak(cOe(i,r),r.values),n):(Jh(!0,`Complex values '${e}' and '${t}' 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.`,"complex-values-different"),Db(e,t))};function ck(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Dn(e,t,n):LE(e)(e,t)}const uOe=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Tn.update(t,n),stop:()=>Bc(t),now:()=>Xi.isProcessing?Xi.timestamp:wr.now()}},lk=(e,t,n=10)=>{let i="";const r=Math.max(Math.round(t/n),2);for(let o=0;o<r;o++)i+=Math.round(e(o/(r-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Ub=2e4;function PE(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<Ub;)t+=n,i=e.next(t);return t>=Ub?1/0:t}function hOe(e,t=100,n){const i=n({...e,keyframes:[0,t]}),r=Math.min(PE(i),Ub);return{type:"keyframes",ease:o=>i.next(r*o).value/t,duration:Xo(r)}}const dOe=5;function uk(e,t,n){const i=Math.max(t-dOe,0);return VN(n-e(i),t-i)}const Un={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},OE=.001;function fOe({duration:e=Un.duration,bounce:t=Un.bounce,velocity:n=Un.velocity,mass:i=Un.mass}){let r,o;Jh(e<=ko(Un.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=ia(Un.minDamping,Un.maxDamping,s),e=ia(Un.minDuration,Un.maxDuration,Xo(e)),s<1?(r=l=>{const u=l*s,h=u*e,d=u-n,f=GE(l,s),p=Math.exp(-h);return OE-d/f*p},o=l=>{const h=l*s*e,d=h*n+n,f=Math.pow(s,2)*Math.pow(l,2)*e,p=Math.exp(-h),m=GE(Math.pow(l,2),s);return(-r(l)+OE>0?-1:1)*((d-f)*p)/m}):(r=l=>{const u=Math.exp(-l*e),h=(l-n)*e+1;return-OE+u*h},o=l=>{const u=Math.exp(-l*e),h=(n-l)*(e*e);return u*h});const a=5/e,c=mOe(r,o,a);if(e=ko(e),isNaN(c))return{stiffness:Un.stiffness,damping:Un.damping,duration:e};{const l=Math.pow(c,2)*i;return{stiffness:l,damping:s*2*Math.sqrt(i*l),duration:e}}}const pOe=12;function mOe(e,t,n){let i=n;for(let r=1;r<pOe;r++)i=i-e(i)/t(i);return i}function GE(e,t){return e*Math.sqrt(1-t*t)}const gOe=["duration","bounce"],yOe=["stiffness","damping","mass"];function hk(e,t){return t.some(n=>e[n]!==void 0)}function bOe(e){let t={velocity:Un.velocity,stiffness:Un.stiffness,damping:Un.damping,mass:Un.mass,isResolvedFromDuration:!1,...e};if(!hk(e,yOe)&&hk(e,gOe))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,o=2*ia(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Un.mass,stiffness:r,damping:o}}else{const n=fOe({...e,velocity:0});t={...t,...n,mass:Un.mass},t.isResolvedFromDuration=!0}return t}function Wb(e=Un.visualDuration,t=Un.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:r}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:c,damping:l,mass:u,duration:h,velocity:d,isResolvedFromDuration:f}=bOe({...n,velocity:-Xo(n.velocity||0)}),p=d||0,m=l/(2*Math.sqrt(c*u)),y=s-o,g=Xo(Math.sqrt(c/u)),v=Math.abs(y)<5;i||(i=v?Un.restSpeed.granular:Un.restSpeed.default),r||(r=v?Un.restDelta.granular:Un.restDelta.default);let S;if(m<1){const C=GE(g,m);S=O=>{const V=Math.exp(-m*g*O);return s-V*((p+m*g*y)/C*Math.sin(C*O)+y*Math.cos(C*O))}}else if(m===1)S=C=>s-Math.exp(-g*C)*(y+(p+g*y)*C);else{const C=g*Math.sqrt(m*m-1);S=O=>{const V=Math.exp(-m*g*O),A=Math.min(C*O,300);return s-V*((p+m*g*y)*Math.sinh(A)+C*y*Math.cosh(A))/C}}const E={calculatedDuration:f&&h||null,next:C=>{const O=S(C);if(f)a.done=C>=h;else{let V=C===0?p:0;m<1&&(V=C===0?ko(p):uk(S,C,O));const A=Math.abs(V)<=i,G=Math.abs(s-O)<=r;a.done=A&&G}return a.value=a.done?s:O,a},toString:()=>{const C=Math.min(PE(E),Ub),O=lk(V=>E.next(C*V).value,C,30);return C+"ms "+O},toTransition:()=>{}};return E}Wb.applyToOptions=e=>{const t=hOe(e,100,Wb);return e.ease=t.ease,e.duration=ko(t.duration),e.type="keyframes",e};function VE({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:c,restDelta:l=.5,restSpeed:u}){const h=e[0],d={done:!1,value:h},f=A=>a!==void 0&&A<a||c!==void 0&&A>c,p=A=>a===void 0?c:c===void 0||Math.abs(a-A)<Math.abs(c-A)?a:c;let m=n*t;const y=h+m,g=s===void 0?y:s(y);g!==y&&(m=g-h);const v=A=>-m*Math.exp(-A/i),S=A=>g+v(A),E=A=>{const G=v(A),N=S(A);d.done=Math.abs(G)<=l,d.value=d.done?g:N};let C,O;const V=A=>{f(d.value)&&(C=A,O=Wb({keyframes:[d.value,p(d.value)],velocity:uk(S,A,d.value),damping:r,stiffness:o,restDelta:l,restSpeed:u}))};return V(0),{calculatedDuration:null,next:A=>{let G=!1;return!O&&C===void 0&&(G=!0,E(A),V(A)),C!==void 0&&A>=C?O.next(A-C):(!G&&E(A),d)}}}function _Oe(e,t,n){const i=[],r=n||Wa.mix||ck,o=e.length-1;for(let s=0;s<o;s++){let a=r(e[s],e[s+1]);if(t){const c=Array.isArray(t)?t[s]||No:t;a=m0(c,a)}i.push(a)}return i}function vOe(e,t,{clamp:n=!0,ease:i,mixer:r}={}){const o=e.length;if(Ua(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=_Oe(t,i,r),c=a.length,l=u=>{if(s&&u<e[0])return t[0];let h=0;if(c>1)for(;h<e.length-2&&!(u<e[h+1]);h++);const d=g0(e[h],e[h+1],u);return a[h](d)};return n?u=>l(ia(e[0],e[o-1],u)):l}function wOe(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=g0(0,t,i);e.push(Dn(n,1,r))}}function xOe(e){const t=[0];return wOe(t,e.length-1),t}function SOe(e,t){return e.map(n=>n*t)}function EOe(e,t){return e.map(()=>t||WN).splice(0,e.length-1)}function $h({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=APe(i)?i.map(HN):HN(i),o={done:!1,value:t[0]},s=SOe(n&&n.length===t.length?n:xOe(t),e),a=vOe(s,t,{ease:Array.isArray(r)?r:EOe(t,r)});return{calculatedDuration:e,next:c=>(o.value=a(c),o.done=c>=e,o)}}const TOe=e=>e!==null;function FE(e,{repeat:t,repeatType:n="loop"},i,r=1){const o=e.filter(TOe),a=r<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!a||i===void 0?o[a]:i}const COe={decay:VE,inertia:VE,tween:$h,keyframes:$h,spring:Wb};function dk(e){typeof e.type=="string"&&(e.type=COe[e.type])}class AE{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const ROe=e=>e/100;class zE extends AE{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==wr.now()&&this.tick(wr.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;dk(t);const{type:n=$h,repeat:i=0,repeatDelay:r=0,repeatType:o,velocity:s=0}=t;let{keyframes:a}=t;const c=n||$h;process.env.NODE_ENV!=="production"&&c!==$h&&Ua(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==$h&&typeof a[0]!="number"&&(this.mixKeyframes=m0(ROe,ck(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});o==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-s})),l.calculatedDuration===null&&(l.calculatedDuration=PE(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(i+1)-r,this.generator=l}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:i,totalDuration:r,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return i.next(0);const{delay:l=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let S=this.currentTime,E=i;if(h){const A=Math.min(this.currentTime,r)/a;let G=Math.floor(A),N=A%1;!N&&A>=1&&(N=1),N===1&&G--,G=Math.min(G,h+1),G%2&&(d==="reverse"?(N=1-N,f&&(N-=f/a)):d==="mirror"&&(E=s)),S=ia(0,1,N)*a}const C=v?{done:!1,value:u[0]}:E.next(S);o&&!v&&(C.value=o(C.value));let{done:O}=C;!v&&c!==null&&(O=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const V=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return V&&p!==VE&&(C.value=FE(u,this.options,y,this.speed)),m&&m(C.value),V&&this.finish(),C}then(t,n){return this.finished.then(t,n)}get duration(){return Xo(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Xo(t)}get time(){return Xo(this.currentTime)}set time(t){t=ko(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(wr.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Xo(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=uOe,startTime:n}=this.options;this.driver||(this.driver=t(r=>this.tick(r))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(wr.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function IOe(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const $l=e=>e*180/Math.PI,NE=e=>{const t=$l(Math.atan2(e[1],e[0]));return kE(t)},MOe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:NE,rotateZ:NE,skewX:e=>$l(Math.atan(e[1])),skewY:e=>$l(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},kE=e=>(e=e%360,e<0&&(e+=360),e),fk=NE,pk=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),mk=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),LOe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:pk,scaleY:mk,scale:e=>(pk(e)+mk(e))/2,rotateX:e=>kE($l(Math.atan2(e[6],e[5]))),rotateY:e=>kE($l(Math.atan2(-e[2],e[0]))),rotateZ:fk,rotate:fk,skewX:e=>$l(Math.atan(e[4])),skewY:e=>$l(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function XE(e){return e.includes("scale")?1:0}function ZE(e,t){if(!e||e==="none")return XE(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,r;if(n)i=LOe,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=MOe,r=a}if(!r)return XE(t);const o=i[t],s=r[1].split(",").map(OOe);return typeof o=="function"?o(s):s[o]}const POe=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ZE(n,t)};function OOe(e){return parseFloat(e.trim())}const ed=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],td=new Set(ed),gk=e=>e===Qh||e===ct,GOe=new Set(["x","y","z"]),VOe=ed.filter(e=>!GOe.has(e));function FOe(e){const t=[];return VOe.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Hc={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>ZE(t,"x"),y:(e,{transform:t})=>ZE(t,"y")};Hc.translateX=Hc.x,Hc.translateY=Hc.y;const eu=new Set;let DE=!1,UE=!1,WE=!1;function yk(){if(UE){const e=Array.from(eu).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=FOe(i);r.length&&(n.set(i,r),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([o,s])=>{i.getValue(o)?.set(s)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}UE=!1,DE=!1,eu.forEach(e=>e.complete(WE)),eu.clear()}function bk(){eu.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(UE=!0)})}function AOe(){WE=!0,bk(),yk(),WE=!1}class BE{constructor(t,n,i,r,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=r,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(eu.add(this),DE||(DE=!0,Tn.read(bk),Tn.resolveKeyframes(yk))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:r}=this;if(t[0]===null){const o=r?.get(),s=t[t.length-1];if(o!==void 0)t[0]=o;else if(i&&n){const a=i.readValue(n,s);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=s),r&&o===void 0&&r.set(t[0])}IOe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),eu.delete(this)}cancel(){this.state==="scheduled"&&(eu.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const zOe=e=>e.startsWith("--");function _k(e,t,n){zOe(t)?e.style.setProperty(t,n):e.style[t]=n}const NOe={};function vk(e,t){const n=GN(e);return()=>NOe[t]??n()}const kOe=vk(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),wk=vk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),x0=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,xk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:x0([0,.65,.55,1]),circOut:x0([.55,0,1,.45]),backIn:x0([.31,.01,.66,-.59]),backOut:x0([.33,1.53,.69,.99])};function Sk(e,t){if(e)return typeof e=="function"?wk()?lk(e,t):"ease-out":BN(e)?x0(e):Array.isArray(e)?e.map(n=>Sk(n,t)||xk.easeOut):xk[e]}function XOe(e,t,n,{delay:i=0,duration:r=300,repeat:o=0,repeatType:s="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[t]:n};c&&(u.offset=c);const h=Sk(a,r);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"};return l&&(d.pseudoElement=l),e.animate(u,d)}function Ek(e){return typeof e=="function"&&"applyToOptions"in e}function ZOe({type:e,...t}){return Ek(e)&&wk()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Tk extends AE{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:r,pseudoElement:o,allowFlatten:s=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!o,this.allowFlatten=s,this.options=t,Ua(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const l=ZOe(t);this.animation=XOe(n,i,r,l,o),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=FE(r,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),_k(n,i,u),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Xo(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Xo(t)}get time(){return Xo(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ko(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:i,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&kOe()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),No):r(this)}}const Ck={anticipate:ZN,backInOut:XN,circInOut:UN};function DOe(e){return e in Ck}function UOe(e){typeof e.ease=="string"&&DOe(e.ease)&&(e.ease=Ck[e.ease])}const YE=10;class WOe extends Tk{constructor(t){UOe(t),dk(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:r,element:o,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new zE({...s,autoplay:!1}),c=Math.max(YE,wr.now()-this.startTime),l=ia(0,YE,c-YE),u=a.sample(c).value,{name:h}=this.options;o&&h&&_k(o,h,u),n.setWithVelocity(a.sample(Math.max(0,c-l)).value,u,l),a.stop()}}const Rk=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ys.test(e)||e==="0")&&!e.startsWith("url("));function BOe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function YOe(e,t,n,i){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],s=Rk(r,t),a=Rk(o,t);return Jh(s===a,`You are trying to animate ${t} from "${r}" to "${o}". "${s?o:r}" is not an animatable value.`,"value-not-animatable"),!s||!a?!1:BOe(e)||(n==="spring"||Ek(n))&&i}function HE(e){e.duration=0,e.type="keyframes"}const HOe=new Set(["opacity","clipPath","filter","transform"]),jOe=GN(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function KOe(e){const{motionValue:t,name:n,repeatDelay:i,repeatType:r,damping:o,type:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=t.owner.getProps();return jOe()&&n&&HOe.has(n)&&(n!=="transform"||!l)&&!c&&!i&&r!=="mirror"&&o!==0&&s!=="inertia"}const JOe=40;class QOe extends AE{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s="loop",keyframes:a,name:c,motionValue:l,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=wr.now();const d={autoplay:t,delay:n,type:i,repeat:r,repeatDelay:o,repeatType:s,name:c,motionValue:l,element:u,...h},f=u?.KeyframeResolver||BE;this.keyframeResolver=new f(a,(p,m,y)=>this.onKeyframesResolved(p,m,d,!y),c,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,r){this.keyframeResolver=void 0;const{name:o,type:s,velocity:a,delay:c,isHandoff:l,onUpdate:u}=i;this.resolvedAt=wr.now(),YOe(t,o,s,a)||((Wa.instantAnimations||!c)&&u?.(FE(t,i,n)),t[0]=t[t.length-1],HE(i),i.repeat=0);const d={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>JOe?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},f=!l&&KOe(d),p=d.motionValue?.owner?.current,m=f?new WOe({...d,element:p}):new zE(d);m.finished.then(()=>{this.notifyFinished()}).catch(No),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),AOe()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Ik(e,t,n,i=0,r=1){const o=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*i;return typeof n=="function"?n(o,s):r===1?o*i:a-o*i}const qOe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $Oe(e){const t=qOe.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}const eGe=4;function Mk(e,t,n=1){Ua(n<=eGe,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,r]=$Oe(e);if(!i)return;const o=window.getComputedStyle(t).getPropertyValue(i);if(o){const s=o.trim();return LN(s)?parseFloat(s):s}return xE(r)?Mk(r,t,n+1):r}const tGe={type:"spring",stiffness:500,damping:25,restSpeed:10},nGe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),iGe={type:"keyframes",duration:.8},rGe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},oGe=(e,{keyframes:t})=>t.length>2?iGe:td.has(e)?e.startsWith("scale")?nGe(t[1]):tGe:rGe,sGe=e=>e!==null;function aGe(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(sGe),o=t&&n!=="loop"&&t%2===1?0:r.length-1;return r[o]}function Lk(e,t){if(e?.inherit&&t){const{inherit:n,...i}=e;return{...t,...i}}return e}function jE(e,t){const n=e?.[t]??e?.default??e;return n!==e?Lk(n,e):n}function cGe({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:o,repeatType:s,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const KE=(e,t,n,i={},r,o)=>s=>{const a=jE(i,e)||{},c=a.delay||i.delay||0;let{elapsed:l=0}=i;l=l-ko(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:r};cGe(a)||Object.assign(u,oGe(e,u)),u.duration&&(u.duration=ko(u.duration)),u.repeatDelay&&(u.repeatDelay=ko(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(HE(u),u.delay===0&&(h=!0)),(Wa.instantAnimations||Wa.skipAnimations||r?.shouldSkipAnimations)&&(h=!0,HE(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!o&&t.get()!==void 0){const d=aGe(u.keyframes,a);if(d!==void 0){Tn.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new zE(u):new QOe(u)};function Pk(e){const t=[{},{}];return e?.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function JE(e,t,n,i){if(typeof t=="function"){const[r,o]=Pk(i);t=t(n!==void 0?n:e.custom,r,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,o]=Pk(i);t=t(n!==void 0?n:e.custom,r,o)}return t}function nd(e,t,n){const i=e.getProps();return JE(i,t,n!==void 0?n:i.custom,e)}const Ok=new Set(["width","height","top","left","right","bottom",...ed]),Gk=30,lGe=e=>!isNaN(parseFloat(e));class uGe{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const r=wr.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=wr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=lGe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&bE(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new yE);const i=this.events[t].add(n);return t==="change"?()=>{i(),Tn.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=wr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Gk)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Gk);return VN(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function tu(e,t){return new uGe(e,t)}const QE=e=>Array.isArray(e);function hGe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,tu(n))}function dGe(e){return QE(e)?e[e.length-1]||0:e}function fGe(e,t){const n=nd(e,t);let{transitionEnd:i={},transition:r={},...o}=n||{};o={...o,...i};for(const s in o){const a=dGe(o[s]);hGe(e,s,a)}}const ir=e=>!!(e&&e.getVelocity);function pGe(e){return!!(ir(e)&&e.add)}function qE(e,t){const n=e.getValue("willChange");if(pGe(n))return n.add(t);if(!n&&Wa.WillChange){const i=new Wa.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function $E(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Vk="data-"+$E("framerAppearId");function Fk(e){return e.props[Vk]}function mGe({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function Ak(e,t,{delay:n=0,transitionOverride:i,type:r}={}){let{transition:o,transitionEnd:s,...a}=t;const c=e.getDefaultTransition();o=o?Lk(o,c):c;const l=o?.reduceMotion;i&&(o=i);const u=[],h=r&&e.animationState&&e.animationState.getState()[r];for(const d in a){const f=e.getValue(d,e.latestValues[d]??null),p=a[d];if(p===void 0||h&&mGe(h,d))continue;const m={delay:n,...jE(o||{},d)},y=f.get();if(y!==void 0&&!f.isAnimating&&!Array.isArray(p)&&p===y&&!m.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const E=Fk(e);if(E){const C=window.MotionHandoffAnimation(E,d,Tn);C!==null&&(m.startTime=C,g=!0)}}qE(e,d);const v=l??e.shouldReduceMotion;f.start(KE(d,f,p,v&&Ok.has(d)?{type:!1}:m,e,g));const S=f.animation;S&&u.push(S)}if(s){const d=()=>Tn.update(()=>{s&&fGe(e,s)});u.length?Promise.all(u).then(d):d()}return u}function eT(e,t,n={}){const i=nd(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(Ak(e,i,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:h}=r;return gGe(e,t,c,l,u,h,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[c,l]=a==="beforeChildren"?[o,s]:[s,o];return c().then(()=>l())}else return Promise.all([o(),s(n.delay)])}function gGe(e,t,n=0,i=0,r=0,o=1,s){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(eT(c,t,{...s,delay:n+(typeof i=="function"?0:i)+Ik(e.variantChildren,c,i,r,o)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function yGe(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(o=>eT(e,o,n));i=Promise.all(r)}else if(typeof t=="string")i=eT(e,t,n);else{const r=typeof t=="function"?nd(e,t,n.custom):t;i=Promise.all(Ak(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const bGe={test:e=>e==="auto",parse:e=>e},zk=e=>t=>t.test(e),Nk=[Qh,ct,ra,Yc,jPe,HPe,bGe],kk=e=>Nk.find(zk(e));function _Ge(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ON(e):!0}const vGe=new Set(["brightness","contrast","saturate","opacity"]);function wGe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(SE)||[];if(!i)return e;const r=n.replace(i,"");let o=vGe.has(t)?1:0;return i!==n&&(o*=100),t+"("+o+r+")"}const xGe=/\b([a-z-]*)\(.*?\)/gu,tT={...ys,getAnimatableNone:e=>{const t=e.match(xGe);return t?t.map(wGe).join(" "):e}},nT={...ys,getAnimatableNone:e=>{const t=ys.parse(e);return ys.createTransformer(e)(t.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},Xk={...Qh,transform:Math.round},iT={borderWidth:ct,borderTopWidth:ct,borderRightWidth:ct,borderBottomWidth:ct,borderLeftWidth:ct,borderRadius:ct,borderTopLeftRadius:ct,borderTopRightRadius:ct,borderBottomRightRadius:ct,borderBottomLeftRadius:ct,width:ct,maxWidth:ct,height:ct,maxHeight:ct,top:ct,right:ct,bottom:ct,left:ct,inset:ct,insetBlock:ct,insetBlockStart:ct,insetBlockEnd:ct,insetInline:ct,insetInlineStart:ct,insetInlineEnd:ct,padding:ct,paddingTop:ct,paddingRight:ct,paddingBottom:ct,paddingLeft:ct,paddingBlock:ct,paddingBlockStart:ct,paddingBlockEnd:ct,paddingInline:ct,paddingInlineStart:ct,paddingInlineEnd:ct,margin:ct,marginTop:ct,marginRight:ct,marginBottom:ct,marginLeft:ct,marginBlock:ct,marginBlockStart:ct,marginBlockEnd:ct,marginInline:ct,marginInlineStart:ct,marginInlineEnd:ct,fontSize:ct,backgroundPositionX:ct,backgroundPositionY:ct,...{rotate:Yc,rotateX:Yc,rotateY:Yc,rotateZ:Yc,scale:Zb,scaleX:Zb,scaleY:Zb,scaleZ:Zb,skew:Yc,skewX:Yc,skewY:Yc,distance:ct,translateX:ct,translateY:ct,translateZ:ct,x:ct,y:ct,z:ct,perspective:ct,transformPerspective:ct,opacity:b0,originX:$N,originY:$N,originZ:ct},zIndex:Xk,fillOpacity:b0,strokeOpacity:b0,numOctaves:Xk},SGe={...iT,color:hi,backgroundColor:hi,outlineColor:hi,fill:hi,stroke:hi,borderColor:hi,borderTopColor:hi,borderRightColor:hi,borderBottomColor:hi,borderLeftColor:hi,filter:tT,WebkitFilter:tT,mask:nT,WebkitMask:nT},Zk=e=>SGe[e],EGe=new Set([tT,nT]);function Dk(e,t){let n=Zk(e);return EGe.has(n)||(n=ys),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const TGe=new Set(["auto","none","0"]);function CGe(e,t,n){let i=0,r;for(;i<e.length&&!r;){const o=e[i];typeof o=="string"&&!TGe.has(o)&&w0(o).values.length&&(r=e[i]),i++}if(r&&n)for(const o of t)e[o]=Dk(n,r)}class RGe extends BE{constructor(t,n,i,r,o){super(t,n,i,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let h=t[u];if(typeof h=="string"&&(h=h.trim(),xE(h))){const d=Mk(h,n.current);d!==void 0&&(t[u]=d),u===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Ok.has(i)||t.length!==2)return;const[r,o]=t,s=kk(r),a=kk(o),c=QN(r),l=QN(o);if(c!==l&&Hc[i]){this.needsMeasurement=!0;return}if(s!==a)if(gk(s)&&gk(a))for(let u=0;u<t.length;u++){const h=t[u];typeof h=="string"&&(t[u]=parseFloat(h))}else Hc[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,i=[];for(let r=0;r<t.length;r++)(t[r]===null||_Ge(t[r]))&&i.push(r);i.length&&CGe(t,i,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:i}=this;if(!t||!t.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Hc[i](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(i,r).jump(r,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:i}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,s=i[o];i[o]=Hc[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{t.getValue(a).set(c)}),this.resolveNoneKeyframes()}}const IGe=new Set(["opacity","clipPath","filter","transform"]);function Uk(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;const r=n?.[e]??i.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e).filter(i=>i!=null)}const Wk=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function MGe(e){return PN(e)&&"offsetHeight"in e}const{schedule:rT}=jN(queueMicrotask,!1),bs={x:!1,y:!1};function Bk(){return bs.x||bs.y}function LGe(e){return e==="x"||e==="y"?bs[e]?null:(bs[e]=!0,()=>{bs[e]=!1}):bs.x||bs.y?null:(bs.x=bs.y=!0,()=>{bs.x=bs.y=!1})}function Yk(e,t){const n=Uk(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function PGe(e){return!(e.pointerType==="touch"||Bk())}function OGe(e,t,n={}){const[i,r,o]=Yk(e,n);return i.forEach(s=>{let a=!1,c=!1,l;const u=()=>{s.removeEventListener("pointerleave",p)},h=y=>{l&&(l(y),l=void 0),u()},d=y=>{a=!1,window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d),c&&(c=!1,h(y))},f=()=>{a=!0,window.addEventListener("pointerup",d,r),window.addEventListener("pointercancel",d,r)},p=y=>{if(y.pointerType!=="touch"){if(a){c=!0;return}h(y)}},m=y=>{if(!PGe(y))return;c=!1;const g=t(s,y);typeof g=="function"&&(l=g,s.addEventListener("pointerleave",p,r))};s.addEventListener("pointerenter",m,r),s.addEventListener("pointerdown",f,r)}),o}const Hk=(e,t)=>t?e===t?!0:Hk(e,t.parentElement):!1,oT=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,GGe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function VGe(e){return GGe.has(e.tagName)||e.isContentEditable===!0}const FGe=new Set(["INPUT","SELECT","TEXTAREA"]);function AGe(e){return FGe.has(e.tagName)||e.isContentEditable===!0}const Bb=new WeakSet;function jk(e){return t=>{t.key==="Enter"&&e(t)}}function sT(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const zGe=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=jk(()=>{if(Bb.has(n))return;sT(n,"down");const r=jk(()=>{sT(n,"up")}),o=()=>sT(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function Kk(e){return oT(e)&&!Bk()}const Jk=new WeakSet;function NGe(e,t,n={}){const[i,r,o]=Yk(e,n),s=a=>{const c=a.currentTarget;if(!Kk(a)||Jk.has(a))return;Bb.add(c),n.stopPropagation&&Jk.add(a);const l=t(c,a),u=(f,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",d),Bb.has(c)&&Bb.delete(c),Kk(f)&&typeof l=="function"&&l(f,{success:p})},h=f=>{u(f,c===window||c===document||n.useGlobalTarget||Hk(c,f.target))},d=f=>{u(f,!1)};window.addEventListener("pointerup",h,r),window.addEventListener("pointercancel",d,r)};return i.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,r),MGe(a)&&(a.addEventListener("focus",l=>zGe(l,r)),!VGe(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function aT(e){return PN(e)&&"ownerSVGElement"in e}const Yb=new WeakMap;let Hb;const Qk=(e,t,n)=>(i,r)=>r&&r[0]?r[0][e+"Size"]:aT(i)&&"getBBox"in i?i.getBBox()[t]:i[n],kGe=Qk("inline","width","offsetWidth"),XGe=Qk("block","height","offsetHeight");function ZGe({target:e,borderBoxSize:t}){Yb.get(e)?.forEach(n=>{n(e,{get width(){return kGe(e,t)},get height(){return XGe(e,t)}})})}function DGe(e){e.forEach(ZGe)}function UGe(){typeof ResizeObserver>"u"||(Hb=new ResizeObserver(DGe))}function WGe(e,t){Hb||UGe();const n=Uk(e);return n.forEach(i=>{let r=Yb.get(i);r||(r=new Set,Yb.set(i,r)),r.add(t),Hb?.observe(i)}),()=>{n.forEach(i=>{const r=Yb.get(i);r?.delete(t),r?.size||Hb?.unobserve(i)})}}const jb=new Set;let id;function BGe(){id=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};jb.forEach(t=>t(e))},window.addEventListener("resize",id)}function YGe(e){return jb.add(e),id||BGe(),()=>{jb.delete(e),!jb.size&&typeof id=="function"&&(window.removeEventListener("resize",id),id=void 0)}}function qk(e,t){return typeof e=="function"?YGe(e):WGe(e,t)}function HGe(e){return aT(e)&&e.tagName==="svg"}const jGe=[...Nk,hi,ys],KGe=e=>jGe.find(zk(e)),$k=()=>({translate:0,scale:1,origin:0,originPoint:0}),rd=()=>({x:$k(),y:$k()}),eX=()=>({min:0,max:0}),vi=()=>({x:eX(),y:eX()}),JGe=new WeakMap;function Kb(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function S0(e){return typeof e=="string"||Array.isArray(e)}const cT=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],lT=["initial",...cT];function Jb(e){return Kb(e.animate)||lT.some(t=>S0(e[t]))}function tX(e){return!!(Jb(e)||e.variants)}function QGe(e,t,n){for(const i in t){const r=t[i],o=n[i];if(ir(r))e.addValue(i,r);else if(ir(o))e.addValue(i,tu(r,{owner:e}));else if(o!==r)if(e.hasValue(i)){const s=e.getValue(i);s.liveStyle===!0?s.jump(r):s.hasAnimated||s.set(r)}else{const s=e.getStaticValue(i);e.addValue(i,tu(s!==void 0?s:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const uT={current:null},nX={current:!1},qGe=typeof window<"u";function $Ge(){if(nX.current=!0,!!qGe)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>uT.current=e.matches;e.addEventListener("change",t),t()}else uT.current=!1}const iX=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Qb={};function rX(e){Qb=e}function eVe(){return Qb}class tVe{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:r,skipAnimations:o,blockInitialAnimation:s,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=BE,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=wr.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Tn.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=o,this.options=c,this.blockInitialAnimation=!!s,this.isControllingVariants=Jb(n),this.isVariantNode=tX(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];l[f]!==void 0&&ir(p)&&p.set(l[f])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,JGe.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(nX.current||$Ge(),this.shouldReduceMotion=uT.current),process.env.NODE_ENV!=="production"&&bE(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Bc(this.notifyUpdate),Bc(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&IGe.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:a,times:c,ease:l,duration:u}=n.accelerate,h=new Tk({element:this.current,name:t,keyframes:a,times:c,ease:l,duration:ko(u)}),d=s(h);this.valueSubscriptions.set(t,()=>{d(),h.cancel()});return}const i=td.has(t);i&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Tn.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Qb){const n=Qb[t];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[t]&&r&&i(this.props)&&(this.features[t]=new r(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):vi()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<iX.length;i++){const r=iX[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const o="on"+r,s=t[o];s&&(this.propEventSubscriptions[r]=this.on(r,s))}this.prevMotionValues=QGe(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const i=this.values.get(t);n!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=tu(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(LN(i)||ON(i))?i=parseFloat(i):!KGe(i)&&ys.test(n)&&(i=Dk(t,n)),this.setBaseTarget(t,ir(i)?i.get():i)),ir(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=JE(this.props,n,this.presenceContext?.custom);o&&(i=o[t])}if(n&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!ir(r)?r:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new yE),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){rT.render(this.render)}}class oX extends tVe{constructor(){super(...arguments),this.KeyframeResolver=RGe}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const i=t.style;return i?i[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ir(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class jc{constructor(t){this.isMounted=!1,this.node=t}update(){}}function sX({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function nVe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function iVe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function hT(e){return e===void 0||e===1}function dT({scale:e,scaleX:t,scaleY:n}){return!hT(e)||!hT(t)||!hT(n)}function nu(e){return dT(e)||aX(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function aX(e){return cX(e.x)||cX(e.y)}function cX(e){return e&&e!=="0%"}function qb(e,t,n){const i=e-n,r=t*i;return n+r}function lX(e,t,n,i,r){return r!==void 0&&(e=qb(e,r,i)),qb(e,n,i)+t}function fT(e,t=0,n=1,i,r){e.min=lX(e.min,t,n,i,r),e.max=lX(e.max,t,n,i,r)}function uX(e,{x:t,y:n}){fT(e.x,t.translate,t.scale,t.originPoint),fT(e.y,n.translate,n.scale,n.originPoint)}const hX=.999999999999,dX=1.0000000000001;function rVe(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let o,s;for(let a=0;a<r;a++){o=n[a],s=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&sd(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,uX(e,s)),i&&nu(o.latestValues)&&sd(e,o.latestValues))}t.x<dX&&t.x>hX&&(t.x=1),t.y<dX&&t.y>hX&&(t.y=1)}function od(e,t){e.min=e.min+t,e.max=e.max+t}function fX(e,t,n,i,r=.5){const o=Dn(e.min,e.max,r);fT(e,t,n,o,i)}function pX(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function sd(e,t){fX(e.x,pX(t.x,e.x),t.scaleX,t.scale,t.originX),fX(e.y,pX(t.y,e.y),t.scaleY,t.scale,t.originY)}function mX(e,t){return sX(iVe(e.getBoundingClientRect(),t))}function oVe(e,t,n){const i=mX(e,n),{scroll:r}=t;return r&&(od(i.x,r.offset.x),od(i.y,r.offset.y)),i}const sVe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},aVe=ed.length;function cVe(e,t,n){let i="",r=!0;for(let o=0;o<aVe;o++){const s=ed[o],a=e[s];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(s.startsWith("scale")?1:0);else{const l=parseFloat(a);c=s.startsWith("scale")?l===1:l===0}if(!c||n){const l=Wk(a,iT[s]);if(!c){r=!1;const u=sVe[s]||s;i+=`${u}(${l}) `}n&&(t[s]=l)}}return i=i.trim(),n?i=n(t,r?"":i):r&&(i="none"),i}function pT(e,t,n){const{style:i,vars:r,transformOrigin:o}=e;let s=!1,a=!1;for(const c in t){const l=t[c];if(td.has(c)){s=!0;continue}else if(JN(c)){r[c]=l;continue}else{const u=Wk(l,iT[c]);c.startsWith("origin")?(a=!0,o[c]=u):i[c]=u}}if(t.transform||(s||n?i.transform=cVe(t,e.transform,n):i.transform&&(i.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=o;i.transformOrigin=`${c} ${l} ${u}`}}function gX(e,{style:t,vars:n},i,r){const o=e.style;let s;for(s in t)o[s]=t[s];r?.applyProjectionStyles(o,i);for(s in n)o.setProperty(s,n[s])}function yX(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const E0={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ct.test(e))e=parseFloat(e);else return e;const n=yX(e,t.target.x),i=yX(e,t.target.y);return`${n}% ${i}%`}},lVe={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=ys.parse(e);if(r.length>5)return i;const o=ys.createTransformer(e),s=typeof r[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;r[0+s]/=a,r[1+s]/=c;const l=Dn(a,c,.5);return typeof r[2+s]=="number"&&(r[2+s]/=l),typeof r[3+s]=="number"&&(r[3+s]/=l),o(r)}},mT={borderRadius:{...E0,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:E0,borderTopRightRadius:E0,borderBottomLeftRadius:E0,borderBottomRightRadius:E0,boxShadow:lVe};function bX(e,{layout:t,layoutId:n}){return td.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!mT[e]||e==="opacity")}function gT(e,t,n){const i=e.style,r=t?.style,o={};if(!i)return o;for(const s in i)(ir(i[s])||r&&ir(r[s])||bX(s,e)||n?.getValue(s)?.liveStyle!==void 0)&&(o[s]=i[s]);return o}function uVe(e){return window.getComputedStyle(e)}class hVe extends oX{constructor(){super(...arguments),this.type="html",this.renderInstance=gX}readValueFromInstance(t,n){if(td.has(n))return this.projection?.isProjecting?XE(n):POe(t,n);{const i=uVe(t),r=(JN(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return mX(t,n)}build(t,n,i){pT(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return gT(t,n,i)}}const dVe={offset:"stroke-dashoffset",array:"stroke-dasharray"},fVe={offset:"strokeDashoffset",array:"strokeDasharray"};function pVe(e,t,n=1,i=0,r=!0){e.pathLength=1;const o=r?dVe:fVe;e[o.offset]=`${-i}`,e[o.array]=`${t} ${n}`}const mVe=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function _X(e,{attrX:t,attrY:n,attrScale:i,pathLength:r,pathSpacing:o=1,pathOffset:s=0,...a},c,l,u){if(pT(e,a,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:d}=e;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const f of mVe)h[f]!==void 0&&(d[f]=h[f],delete h[f]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),i!==void 0&&(h.scale=i),r!==void 0&&pVe(h,r,o,s,!1)}const vX=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),wX=e=>typeof e=="string"&&e.toLowerCase()==="svg";function gVe(e,t,n,i){gX(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(vX.has(r)?r:$E(r),t.attrs[r])}function xX(e,t,n){const i=gT(e,t,n);for(const r in e)if(ir(e[r])||ir(t[r])){const o=ed.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[o]=e[r]}return i}class yVe extends oX{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=vi}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(td.has(n)){const i=Zk(n);return i&&i.default||0}return n=vX.has(n)?n:$E(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return xX(t,n,i)}build(t,n,i){_X(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,r){gVe(t,n,i,r)}mount(t){this.isSVGTag=wX(t.tagName),super.mount(t)}}const bVe=lT.length;function SX(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?SX(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<bVe;n++){const i=lT[n],r=e.props[i];(S0(r)||r===!1)&&(t[i]=r)}return t}function EX(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}const _Ve=[...cT].reverse(),vVe=cT.length;function wVe(e){return t=>Promise.all(t.map(({animation:n,options:i})=>yGe(e,n,i)))}function xVe(e){let t=wVe(e),n=TX(),i=!0,r=!1;const o=l=>(u,h)=>{const d=nd(e,h,l==="exit"?e.presenceContext?.custom:void 0);if(d){const{transition:f,transitionEnd:p,...m}=d;u={...u,...m,...p}}return u};function s(l){t=l(e)}function a(l){const{props:u}=e,h=SX(e.parent)||{},d=[],f=new Set;let p={},m=1/0;for(let g=0;g<vVe;g++){const v=_Ve[g],S=n[v],E=u[v]!==void 0?u[v]:h[v],C=S0(E),O=v===l?S.isActive:null;O===!1&&(m=g);let V=E===h[v]&&E!==u[v]&&C;if(V&&(i||r)&&e.manuallyAnimateOnMount&&(V=!1),S.protectedKeys={...p},!S.isActive&&O===null||!E&&!S.prevProp||Kb(E)||typeof E=="boolean")continue;if(v==="exit"&&S.isActive&&O!==!0){S.prevResolvedValues&&(p={...p,...S.prevResolvedValues});continue}const A=SVe(S.prevProp,E);let G=A||v===l&&S.isActive&&!V&&C||g>m&&C,N=!1;const k=Array.isArray(E)?E:[E];let P=k.reduce(o(v),{});O===!1&&(P={});const{prevResolvedValues:w={}}=S,x={...w,...P},I=Y=>{G=!0,f.has(Y)&&(N=!0,f.delete(Y)),S.needsAnimating[Y]=!0;const H=e.getValue(Y);H&&(H.liveStyle=!1)};for(const Y in x){const H=P[Y],J=w[Y];if(p.hasOwnProperty(Y))continue;let z=!1;QE(H)&&QE(J)?z=!EX(H,J):z=H!==J,z?H!=null?I(Y):f.add(Y):H!==void 0&&f.has(Y)?I(Y):S.protectedKeys[Y]=!0}S.prevProp=E,S.prevResolvedValues=P,S.isActive&&(p={...p,...P}),(i||r)&&e.blockInitialAnimation&&(G=!1);const X=V&&A;G&&(!X||N)&&d.push(...k.map(Y=>{const H={type:v};if(typeof Y=="string"&&(i||r)&&!X&&e.manuallyAnimateOnMount&&e.parent){const{parent:J}=e,z=nd(J,Y);if(J.enteringChildren&&z){const{delayChildren:W}=z.transition||{};H.delay=Ik(J.enteringChildren,e,W)}}return{animation:Y,options:H}}))}if(f.size){const g={};if(typeof u.initial!="boolean"){const v=nd(e,Array.isArray(u.initial)?u.initial[0]:u.initial);v&&v.transition&&(g.transition=v.transition)}f.forEach(v=>{const S=e.getBaseTarget(v),E=e.getValue(v);E&&(E.liveStyle=!0),g[v]=S??null}),d.push({animation:g})}let y=!!d.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),i=!1,r=!1,y?t(d):Promise.resolve()}function c(l,u){if(n[l].isActive===u)return Promise.resolve();e.variantChildren?.forEach(d=>d.animationState?.setActive(l,u)),n[l].isActive=u;const h=a(l);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:a,setActive:c,setAnimateFunction:s,getState:()=>n,reset:()=>{n=TX(),r=!0}}}function SVe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!EX(t,e):!1}function iu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function TX(){return{animate:iu(!0),whileInView:iu(),whileHover:iu(),whileTap:iu(),whileDrag:iu(),whileFocus:iu(),exit:iu()}}function CX(e,t){e.min=t.min,e.max=t.max}function _s(e,t){CX(e.x,t.x),CX(e.y,t.y)}function RX(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const IX=1e-4,EVe=1-IX,TVe=1+IX,MX=.01,CVe=0-MX,RVe=0+MX;function xr(e){return e.max-e.min}function IVe(e,t,n){return Math.abs(e-t)<=n}function LX(e,t,n,i=.5){e.origin=i,e.originPoint=Dn(t.min,t.max,e.origin),e.scale=xr(n)/xr(t),e.translate=Dn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=EVe&&e.scale<=TVe||isNaN(e.scale))&&(e.scale=1),(e.translate>=CVe&&e.translate<=RVe||isNaN(e.translate))&&(e.translate=0)}function T0(e,t,n,i){LX(e.x,t.x,n.x,i?i.originX:void 0),LX(e.y,t.y,n.y,i?i.originY:void 0)}function PX(e,t,n){e.min=n.min+t.min,e.max=e.min+xr(t)}function MVe(e,t,n){PX(e.x,t.x,n.x),PX(e.y,t.y,n.y)}function OX(e,t,n){e.min=t.min-n.min,e.max=e.min+xr(t)}function $b(e,t,n){OX(e.x,t.x,n.x),OX(e.y,t.y,n.y)}function GX(e,t,n,i,r){return e-=t,e=qb(e,1/n,i),r!==void 0&&(e=qb(e,1/r,i)),e}function LVe(e,t=0,n=1,i=.5,r,o=e,s=e){if(ra.test(t)&&(t=parseFloat(t),t=Dn(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Dn(o.min,o.max,i);e===o&&(a-=t),e.min=GX(e.min,t,n,a,r),e.max=GX(e.max,t,n,a,r)}function VX(e,t,[n,i,r],o,s){LVe(e,t[n],t[i],t[r],t.scale,o,s)}const PVe=["x","scaleX","originX"],OVe=["y","scaleY","originY"];function FX(e,t,n,i){VX(e.x,t,PVe,n?n.x:void 0,i?i.x:void 0),VX(e.y,t,OVe,n?n.y:void 0,i?i.y:void 0)}function AX(e){return e.translate===0&&e.scale===1}function zX(e){return AX(e.x)&&AX(e.y)}function NX(e,t){return e.min===t.min&&e.max===t.max}function GVe(e,t){return NX(e.x,t.x)&&NX(e.y,t.y)}function kX(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function XX(e,t){return kX(e.x,t.x)&&kX(e.y,t.y)}function ZX(e){return xr(e.x)/xr(e.y)}function DX(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function oa(e){return[e("x"),e("y")]}function VVe(e,t,n){let i="";const r=e.x.translate/t.x,o=e.y.translate/t.y,s=n?.z||0;if((r||o||s)&&(i=`translate3d(${r}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:h,rotateY:d,skewX:f,skewY:p}=n;l&&(i=`perspective(${l}px) ${i}`),u&&(i+=`rotate(${u}deg) `),h&&(i+=`rotateX(${h}deg) `),d&&(i+=`rotateY(${d}deg) `),f&&(i+=`skewX(${f}deg) `),p&&(i+=`skewY(${p}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(i+=`scale(${a}, ${c})`),i||"none"}const UX=["TopLeft","TopRight","BottomLeft","BottomRight"],FVe=UX.length,WX=e=>typeof e=="string"?parseFloat(e):e,BX=e=>typeof e=="number"||ct.test(e);function AVe(e,t,n,i,r,o){r?(e.opacity=Dn(0,n.opacity??1,zVe(i)),e.opacityExit=Dn(t.opacity??1,0,NVe(i))):o&&(e.opacity=Dn(t.opacity??1,n.opacity??1,i));for(let s=0;s<FVe;s++){const a=`border${UX[s]}Radius`;let c=YX(t,a),l=YX(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||BX(c)===BX(l)?(e[a]=Math.max(Dn(WX(c),WX(l),i),0),(ra.test(l)||ra.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=Dn(t.rotate||0,n.rotate||0,i))}function YX(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const zVe=HX(0,.5,DN),NVe=HX(.5,.95,No);function HX(e,t,n){return i=>i<e?0:i>t?1:n(g0(e,t,i))}function kVe(e,t,n){const i=ir(e)?e:tu(e);return i.start(KE("",i,t,n)),i.animation}function C0(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}const XVe=(e,t)=>e.depth-t.depth;class ZVe{constructor(){this.children=[],this.isDirty=!1}add(t){mE(this.children,t),this.isDirty=!0}remove(t){Nb(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(XVe),this.isDirty=!1,this.children.forEach(t)}}function DVe(e,t){const n=wr.now(),i=({timestamp:r})=>{const o=r-n;o>=t&&(Bc(i),e(o-t))};return Tn.setup(i,!0),()=>Bc(i)}function e1(e){return ir(e)?e.get():e}class UVe{constructor(){this.members=[]}add(t){mE(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const r=i.instance;(!r||r.isConnected===!1)&&!i.snapshot&&(Nb(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(Nb(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){for(let n=this.members.indexOf(t)-1;n>=0;n--){const i=this.members[n];if(i.isPresent!==!1&&i.instance?.isConnected!==!1)return this.promote(i),!0}return!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:r}=i.options,{layoutDependency:o}=t.options;(r===void 0||r!==o)&&(t.resumeFrom=i,n&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const t1={hasAnimatedSinceResize:!0,hasEverUpdated:!1},yT=["","X","Y","Z"],WVe=1e3;let BVe=0;function bT(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function jX(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Fk(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Tn,!(r||o))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&jX(i)}function KX({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(s={},a=t?.()){this.id=BVe++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jVe),this.nodes.forEach(qVe),this.nodes.forEach($Ve),this.nodes.forEach(KVe)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new ZVe)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new yE),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const c=this.eventHandlers.get(s);c&&c.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=aT(s)&&!HGe(s),this.instance=s;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let u,h=0;const d=()=>this.root.updateBlockedByResize=!1;Tn.read(()=>{h=window.innerWidth}),e(s,()=>{const f=window.innerWidth;f!==h&&(h=f,this.root.updateBlockedByResize=!0,u&&u(),u=DVe(d,250),t1.hasAnimatedSinceResize&&(t1.hasAnimatedSinceResize=!1,this.nodes.forEach(qX)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:d,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||l.getDefaultTransition()||r9e,{onLayoutAnimationStart:m,onLayoutAnimationComplete:y}=l.getProps(),g=!this.targetLayout||!XX(this.targetLayout,f),v=!h&&d;if(this.options.layoutRoot||this.resumeFrom||v||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const S={...jE(p,"layout"),onPlay:m,onComplete:y};(l.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S),this.setAnimationOrigin(u,v)}else h||qX(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Bc(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(e9e),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&jX(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(JX);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(QX);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(QVe),this.nodes.forEach(YVe),this.nodes.forEach(HVe)):this.nodes.forEach(QX),this.clearAllSnapshots();const a=wr.now();Xi.delta=ia(0,1e3/60,a-Xi.timestamp),Xi.timestamp=a,Xi.isProcessing=!0,wE.update.process(Xi),wE.preRender.process(Xi),wE.render.process(Xi),Xi.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,rT.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(JVe),this.sharedNodes.forEach(t9e)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Tn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Tn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!xr(this.snapshot.measuredBox.x)&&!xr(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=vi(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const c=i(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!r)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!zX(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;s&&this.instance&&(a||nu(this.latestValues)||u)&&(r(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return s&&(c=this.removeTransform(c)),o9e(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return vi();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(s9e))){const{scroll:l}=this.root;l&&(od(a.x,l.offset.x),od(a.y,l.offset.y))}return a}removeElementScroll(s){const a=vi();if(_s(a,s),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const l=this.path[c],{scroll:u,options:h}=l;l!==this.root&&u&&h.layoutScroll&&(u.wasRoot&&_s(a,s),od(a.x,u.offset.x),od(a.y,u.offset.y))}return a}applyTransform(s,a=!1){const c=vi();_s(c,s);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&sd(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),nu(u.latestValues)&&sd(c,u.latestValues)}return nu(this.latestValues)&&sd(c,this.latestValues),c}removeTransform(s){const a=vi();_s(a,s);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!nu(l.latestValues))continue;dT(l.latestValues)&&l.updateSnapshot();const u=vi(),h=l.measurePageBox();_s(u,h),FX(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return nu(this.latestValues)&&FX(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Xi.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(s||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!this.layout||!(u||h))return;this.resolvedRelativeTargetAt=Xi.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=vi(),this.targetWithTransforms=vi()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),MVe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):_s(this.target,this.layout.layoutBox),uX(this.target,this.targetDelta)):_s(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||dT(this.parent.latestValues)||aX(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,a,c){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=vi(),this.relativeTargetOrigin=vi(),$b(this.relativeTargetOrigin,a,c),_s(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),a=!!this.resumingFrom||this!==s;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Xi.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;_s(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,d=this.treeScale.y;rVe(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=vi());const{target:f}=s;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(RX(this.prevProjectionDelta.x,this.projectionDelta.x),RX(this.prevProjectionDelta.y,this.projectionDelta.y)),T0(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==d||!DX(this.projectionDelta.x,this.prevProjectionDelta.x)||!DX(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=rd(),this.projectionDelta=rd(),this.projectionDeltaWithTransform=rd()}setAnimationOrigin(s,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},h=rd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=vi(),f=c?c.source:void 0,p=this.layout?this.layout.source:void 0,m=f!==p,y=this.getStack(),g=!y||y.members.length<=1,v=!!(m&&!g&&this.options.crossfade===!0&&!this.path.some(i9e));this.animationProgress=0;let S;this.mixTargetDelta=E=>{const C=E/1e3;$X(h.x,s.x,C),$X(h.y,s.y,C),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($b(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),n9e(this.relativeTarget,this.relativeTargetOrigin,d,C),S&&GVe(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=vi()),_s(S,this.relativeTarget)),m&&(this.animationValues=u,AVe(u,l,this.latestValues,C,v,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Bc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Tn.update(()=>{t1.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=tu(0)),this.motionValue.jump(0,!1),this.currentAnimation=kVe(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(WVe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=s;if(!(!a||!c||!l)){if(this!==s&&this.layout&&l&&rZ(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||vi();const h=xr(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+h;const d=xr(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+d}_s(a,c),sd(a,u),T0(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new UVe),this.sharedNodes.get(s).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:c}=s;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&bT("z",s,l,this.animationValues);for(let u=0;u<yT.length;u++)bT(`rotate${yT[u]}`,s,l,this.animationValues),bT(`skew${yT[u]}`,s,l,this.animationValues);s.render();for(const u in l)s.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=e1(a?.pointerEvents)||"",s.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=e1(a?.pointerEvents)||""),this.hasProjected&&!nu(this.latestValues)&&(s.transform=c?c({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let h=VVe(this.projectionDeltaWithTransform,this.treeScale,u);c&&(h=c(u,h)),s.transform=h;const{x:d,y:f}=this.projectionDelta;s.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,l.animationValues?s.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const p in mT){if(u[p]===void 0)continue;const{correct:m,applyTo:y,isCSSVariable:g}=mT[p],v=h==="none"?u[p]:m(u[p],l);if(y){const S=y.length;for(let E=0;E<S;E++)s[y[E]]=v}else g?this.options.visualElement.renderState.vars[p]=v:s[p]=v}this.options.layoutId&&(s.pointerEvents=l===this?e1(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(JX),this.root.sharedNodes.clear()}}}function YVe(e){e.updateLayout()}function HVe(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:r}=e.options,o=t.source!==e.layout.source;r==="size"?oa(u=>{const h=o?t.measuredBox[u]:t.layoutBox[u],d=xr(h);h.min=n[u].min,h.max=h.min+d}):rZ(r,t.layoutBox,n)&&oa(u=>{const h=o?t.measuredBox[u]:t.layoutBox[u],d=xr(n[u]);h.max=h.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+d)});const s=rd();T0(s,n,t.layoutBox);const a=rd();o?T0(a,e.applyTransform(i,!0),t.measuredBox):T0(a,n,t.layoutBox);const c=!zX(s);let l=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:h,layout:d}=u;if(h&&d){const f=vi();$b(f,t.layoutBox,h.layoutBox);const p=vi();$b(p,n,d.layoutBox),XX(f,p)||(l=!0),u.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=f,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:s,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function jVe(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function KVe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function JVe(e){e.clearSnapshot()}function JX(e){e.clearMeasurements()}function QX(e){e.isLayoutDirty=!1}function QVe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function qX(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function qVe(e){e.resolveTargetDelta()}function $Ve(e){e.calcProjection()}function e9e(e){e.resetSkewAndRotation()}function t9e(e){e.removeLeadSnapshot()}function $X(e,t,n){e.translate=Dn(t.translate,0,n),e.scale=Dn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function eZ(e,t,n,i){e.min=Dn(t.min,n.min,i),e.max=Dn(t.max,n.max,i)}function n9e(e,t,n,i){eZ(e.x,t.x,n.x,i),eZ(e.y,t.y,n.y,i)}function i9e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const r9e={duration:.45,ease:[.4,0,.1,1]},tZ=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),nZ=tZ("applewebkit/")&&!tZ("chrome/")?Math.round:No;function iZ(e){e.min=nZ(e.min),e.max=nZ(e.max)}function o9e(e){iZ(e.x),iZ(e.y)}function rZ(e,t,n){return e==="position"||e==="preserve-aspect"&&!IVe(ZX(t),ZX(n),.2)}function s9e(e){return e!==e.root&&e.scroll?.wasRoot}const a9e=KX({attachResizeListener:(e,t)=>C0(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),_T={current:void 0},oZ=KX({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_T.current){const e=new a9e({});e.mount(window),e.setOptions({layoutScroll:!0}),_T.current=e}return _T.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),vT=R.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function c9e(e=!0){const t=R.useContext(pE);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,o=R.useId();R.useEffect(()=>{if(e)return r(o)},[e]);const s=R.useCallback(()=>e&&i&&i(o),[o,i,e]);return!n&&i?[!1,s]:[!0]}const sZ=R.createContext({strict:!1}),aZ={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"]};let cZ=!1;function l9e(){if(cZ)return;const e={};for(const t in aZ)e[t]={isEnabled:n=>aZ[t].some(i=>!!n[i])};rX(e),cZ=!0}function lZ(){return l9e(),eVe()}function u9e(e){const t=lZ();for(const n in e)t[n]={...t[n],...e[n]};rX(t)}const h9e=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function n1(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||h9e.has(e)}let uZ=e=>!n1(e);function d9e(e){typeof e=="function"&&(uZ=t=>t.startsWith("on")?!n1(t):e(t))}try{d9e(require("@emotion/is-prop-valid").default)}catch{}function f9e(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(uZ(r)||n===!0&&n1(r)||!t&&!n1(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}const i1=R.createContext({});function p9e(e,t){if(Jb(e)){const{initial:n,animate:i}=e;return{initial:n===!1||S0(n)?n:void 0,animate:S0(i)?i:void 0}}return e.inherit!==!1?t:{}}function m9e(e){const{initial:t,animate:n}=p9e(e,R.useContext(i1));return R.useMemo(()=>({initial:t,animate:n}),[hZ(t),hZ(n)])}function hZ(e){return Array.isArray(e)?e.join(" "):e}const wT=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function dZ(e,t,n){for(const i in t)!ir(t[i])&&!bX(i,n)&&(e[i]=t[i])}function g9e({transformTemplate:e},t){return R.useMemo(()=>{const n=wT();return pT(n,t,e),Object.assign({},n.vars,n.style)},[t])}function y9e(e,t){const n=e.style||{},i={};return dZ(i,n,e),Object.assign(i,g9e(e,t)),i}function b9e(e,t){const n={},i=y9e(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}const fZ=()=>({...wT(),attrs:{}});function _9e(e,t,n,i){const r=R.useMemo(()=>{const o=fZ();return _X(o,t,wX(i),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};dZ(o,e.style,e),r.style={...o,...r.style}}return r}const v9e=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function xT(e){return typeof e!="string"||e.includes("-")?!1:!!(v9e.indexOf(e)>-1||/[A-Z]/u.test(e))}function w9e(e,t,n,{latestValues:i},r,o=!1,s){const c=(s??xT(e)?_9e:b9e)(t,i,r,e),l=f9e(t,typeof e=="string",o),u=e!==R.Fragment?{...l,...c,ref:n}:{},{children:h}=t,d=R.useMemo(()=>ir(h)?h.get():h,[h]);return R.createElement(e,{...u,children:d})}function x9e({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,r){return{latestValues:S9e(n,i,r,e),renderState:t()}}function S9e(e,t,n,i){const r={},o=i(e,{});for(const d in o)r[d]=e1(o[d]);let{initial:s,animate:a}=e;const c=Jb(e),l=tX(e);t&&l&&!c&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const h=u?a:s;if(h&&typeof h!="boolean"&&!Kb(h)){const d=Array.isArray(h)?h:[h];for(let f=0;f<d.length;f++){const p=JE(e,d[f]);if(p){const{transitionEnd:m,transition:y,...g}=p;for(const v in g){let S=g[v];if(Array.isArray(S)){const E=u?S.length-1:0;S=S[E]}S!==null&&(r[v]=S)}for(const v in m)r[v]=m[v]}}}return r}const pZ=e=>(t,n)=>{const i=R.useContext(i1),r=R.useContext(pE),o=()=>x9e(e,t,i,r);return n?o():MN(o)},E9e=pZ({scrapeMotionValuesFromProps:gT,createRenderState:wT}),T9e=pZ({scrapeMotionValuesFromProps:xX,createRenderState:fZ}),C9e=Symbol.for("motionComponentSymbol");function R9e(e,t,n){const i=R.useRef(n);R.useInsertionEffect(()=>{i.current=n});const r=R.useRef(null);return R.useCallback(o=>{o&&e.onMount?.(o);const s=i.current;if(typeof s=="function")if(o){const a=s(o);typeof a=="function"&&(r.current=a)}else r.current?(r.current(),r.current=null):s(o);else s&&(s.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const mZ=R.createContext({});function ad(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function I9e(e,t,n,i,r,o){const{visualElement:s}=R.useContext(i1),a=R.useContext(sZ),c=R.useContext(pE),l=R.useContext(vT),u=l.reducedMotion,h=l.skipAnimations,d=R.useRef(null),f=R.useRef(!1);i=i||a.renderer,!d.current&&i&&(d.current=i(e,{visualState:t,parent:s,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:h,isSVG:o}),f.current&&d.current&&(d.current.manuallyAnimateOnMount=!0));const p=d.current,m=R.useContext(mZ);p&&!p.projection&&r&&(p.type==="html"||p.type==="svg")&&M9e(d.current,n,r,m);const y=R.useRef(!1);R.useInsertionEffect(()=>{p&&y.current&&p.update(n,c)});const g=n[Vk],v=R.useRef(!!g&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return MPe(()=>{f.current=!0,p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),v.current&&p.animationState&&p.animationState.animateChanges())}),R.useEffect(()=>{p&&(!v.current&&p.animationState&&p.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),v.current=!1),p.enteringChildren=void 0)}),p}function M9e(e,t,n,i){const{layoutId:r,layout:o,drag:s,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:gZ(e.parent)),e.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!s||a&&ad(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:c,layoutRoot:l})}function gZ(e){if(e)return e.options.allowProjection!==!1?e.projection:gZ(e.parent)}function ST(e,{forwardMotionProps:t=!1,type:n}={},i,r){i&&u9e(i);const o=n?n==="svg":xT(e),s=o?T9e:E9e;function a(l,u){let h;const d={...R.useContext(vT),...l,layoutId:L9e(l)},{isStatic:f}=d,p=m9e(l),m=s(l,f);if(!f&&typeof window<"u"){P9e(d,i);const y=O9e(d);h=y.MeasureLayout,p.visualElement=I9e(e,m,d,r,y.ProjectionNode,o)}return ce.jsxs(i1.Provider,{value:p,children:[h&&p.visualElement?ce.jsx(h,{visualElement:p.visualElement,...d}):null,w9e(e,l,R9e(m,p.visualElement,u),m,f,t,o)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=R.forwardRef(a);return c[C9e]=e,c}function L9e({layoutId:e}){const t=R.useContext(IN).id;return t&&e!==void 0?t+"-"+e:e}function P9e(e,t){const n=R.useContext(sZ).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const i="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Jh(!1,i,"lazy-strict-mode"):Ua(!1,i,"lazy-strict-mode")}}function O9e(e){const t=lZ(),{drag:n,layout:i}=t;if(!n&&!i)return{};const r={...n,...i};return{MeasureLayout:n?.isEnabled(e)||i?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function G9e(e,t){if(typeof Proxy>"u")return ST;const n=new Map,i=(o,s)=>ST(o,s,e,t),r=(o,s)=>(process.env.NODE_ENV!=="production"&&bE(!1,"motion() is deprecated. Use motion.create() instead."),i(o,s));return new Proxy(r,{get:(o,s)=>s==="create"?i:(n.has(s)||n.set(s,ST(s,void 0,e,t)),n.get(s))})}const V9e=(e,t)=>t.isSVG??xT(e)?new yVe(t):new hVe(t,{allowProjection:e!==R.Fragment});class F9e extends jc{constructor(t){super(t),t.animationState||(t.animationState=xVe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Kb(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let A9e=0;class z9e extends jc{constructor(){super(...arguments),this.id=A9e++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const N9e={animation:{Feature:F9e},exit:{Feature:z9e}};function R0(e){return{point:{x:e.pageX,y:e.pageY}}}const k9e=e=>t=>oT(t)&&e(t,R0(t));function I0(e,t,n,i){return C0(e,t,k9e(n),i)}const yZ=({current:e})=>e?e.ownerDocument.defaultView:null,bZ=(e,t)=>Math.abs(e-t);function X9e(e,t){const n=bZ(e.x,t.x),i=bZ(e.y,t.y);return Math.sqrt(n**2+i**2)}const _Z=new Set(["auto","scroll"]);class vZ{constructor(t,n,{transformPagePoint:i,contextWindow:r=window,dragSnapToOrigin:o=!1,distanceThreshold:s=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=f=>{this.handleScroll(f.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=TT(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=X9e(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:y}=f,{timestamp:g}=Xi;this.history.push({...y,timestamp:g});const{onStart:v,onMove:S}=this.handlers;p||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=ET(p,this.transformPagePoint),Tn.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:g}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=TT(f.type==="pointercancel"?this.lastMoveEventInfo:ET(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),y&&y(f,v)},!oT(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=s,this.contextWindow=r||window;const c=R0(t),l=ET(c,this.transformPagePoint),{point:u}=l,{timestamp:h}=Xi;this.history=[{...u,timestamp:h}];const{onSessionStart:d}=n;d&&d(t,TT(l,this.history)),this.removeListeners=m0(I0(this.contextWindow,"pointermove",this.handlePointerMove),I0(this.contextWindow,"pointerup",this.handlePointerUp),I0(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const i=getComputedStyle(n);(_Z.has(i.overflowX)||_Z.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const i=t===window,r=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:r.x-n.x,y:r.y-n.y};o.x===0&&o.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,r),Tn.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Bc(this.updatePoint)}}function ET(e,t){return t?{point:t(e.point)}:e}function wZ(e,t){return{x:e.x-t.x,y:e.y-t.y}}function TT({point:e},t){return{point:e,delta:wZ(e,xZ(t)),offset:wZ(e,Z9e(t)),velocity:D9e(t,.1)}}function Z9e(e){return e[0]}function xZ(e){return e[e.length-1]}function D9e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=xZ(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>ko(t)));)n--;if(!i)return{x:0,y:0};i===e[0]&&e.length>2&&r.timestamp-i.timestamp>ko(t)*2&&(i=e[1]);const o=Xo(r.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const s={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function U9e(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?Dn(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?Dn(n,e,i.max):Math.min(e,n)),e}function SZ(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function W9e(e,{top:t,left:n,bottom:i,right:r}){return{x:SZ(e.x,n,r),y:SZ(e.y,t,i)}}function EZ(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,i]=[i,n]),{min:n,max:i}}function B9e(e,t){return{x:EZ(e.x,t.x),y:EZ(e.y,t.y)}}function Y9e(e,t){let n=.5;const i=xr(e),r=xr(t);return r>i?n=g0(t.min,t.max-i,e.min):i>r&&(n=g0(e.min,e.max-r,t.min)),ia(0,1,n)}function H9e(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const CT=.35;function j9e(e=CT){return e===!1?e=0:e===!0&&(e=CT),{x:TZ(e,"left","right"),y:TZ(e,"top","bottom")}}function TZ(e,t,n){return{min:CZ(e,t),max:CZ(e,n)}}function CZ(e,t){return typeof e=="number"?e:e[t]||0}const K9e=new WeakMap;class J9e{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=vi(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=h=>{n&&this.snapToCursor(R0(h).point),this.stopAnimation()},s=(h,d)=>{const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=LGe(f),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),oa(g=>{let v=this.getAxisMotionValue(g).get()||0;if(ra.test(v)){const{projection:S}=this.visualElement;if(S&&S.layout){const E=S.layout.layoutBox[g];E&&(v=xr(E)*(parseFloat(v)/100))}}this.originPoint[g]=v}),m&&Tn.update(()=>m(h,d),!1,!0),qE(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(h,d)=>{this.latestPointerEvent=h,this.latestPanInfo=d;const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:m,onDrag:y}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:g}=d;if(p&&this.currentDirection===null){this.currentDirection=q9e(g),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,g),this.updateAxis("y",d.point,g),this.visualElement.render(),y&&Tn.update(()=>y(h,d),!1,!0)},c=(h,d)=>{this.latestPointerEvent=h,this.latestPanInfo=d,this.stop(h,d),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new vZ(t,{onSessionStart:o,onStart:s,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:i,contextWindow:yZ(this.visualElement),element:this.visualElement.current})}stop(t,n){const i=t||this.latestPointerEvent,r=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!r||!i)return;const{velocity:s}=r;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&Tn.postRender(()=>a(i,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,i){const{drag:r}=this.getProps();if(!i||!r1(t,r,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(s=U9e(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;t&&ad(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=W9e(i.layoutBox,t):this.constraints=!1,this.elastic=j9e(n),r!==this.constraints&&!ad(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&oa(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=H9e(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ad(t))return!1;const i=t.current;Ua(i!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=oVe(i,r.root,this.visualElement.getTransformPagePoint());let s=B9e(r.layout.layoutBox,o);if(n){const a=n(nVe(s));this.hasMutatedConstraints=!!a,a&&(s=sX(a))}return s}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=oa(u=>{if(!r1(u,n,this.currentDirection))return;let h=c&&c[u]||{};s&&(h={min:0,max:0});const d=r?200:1e6,f=r?40:1e7,p={type:"inertia",velocity:i?t[u]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(u,p)});return Promise.all(l).then(a)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return qE(this.visualElement,t),i.start(KE(t,i,0,n,this.visualElement,!1))}stopAnimation(){oa(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){oa(n=>{const{drag:i}=this.getProps();if(!r1(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(n);if(r&&r.layout){const{min:s,max:a}=r.layout.layoutBox[n],c=o.get()||0;o.set(t[n]-Dn(s,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!ad(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};oa(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const c=a.get();r[s]=Y9e({min:c,max:c},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),oa(s=>{if(!r1(s,t,null))return;const a=this.getAxisMotionValue(s),{min:c,max:l}=this.constraints[s];a.set(Dn(c,l,r[s]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;K9e.set(this.visualElement,this);const t=this.visualElement.current,n=I0(t,"pointerdown",l=>{const{drag:u,dragListener:h=!0}=this.getProps(),d=l.target,f=d!==t&&AGe(d);u&&h&&!f&&this.start(l)});let i;const r=()=>{const{dragConstraints:l}=this.getProps();ad(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),i||(i=Q9e(t,l.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Tn.read(r);const a=C0(window,"resize",()=>this.scalePositionWithinConstraints()),c=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(oa(h=>{const d=this.getAxisMotionValue(h);d&&(this.originPoint[h]+=l[h].translate,d.set(d.get()+l[h].translate))}),this.visualElement.render())}));return()=>{a(),n(),s(),c&&c(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:s=CT,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function RZ(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Q9e(e,t,n){const i=qk(e,RZ(n)),r=qk(t,RZ(n));return()=>{i(),r()}}function r1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function q9e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class $9e extends jc{constructor(t){super(t),this.removeGroupControls=No,this.removeListeners=No,this.controls=new J9e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||No}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const RT=e=>(t,n)=>{e&&Tn.update(()=>e(t,n),!1,!0)};class eFe extends jc{constructor(){super(...arguments),this.removePointerDownListener=No}onPointerDown(t){this.session=new vZ(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:yZ(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:RT(t),onStart:RT(n),onMove:RT(i),onEnd:(o,s)=>{delete this.session,r&&Tn.postRender(()=>r(o,s))}}}mount(){this.removePointerDownListener=I0(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let IT=!1;class tFe extends R.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),i&&i.register&&r&&i.register(o),IT&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),t1.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:r,isPresent:o}=this.props,{projection:s}=i;return s&&(s.isPresent=o,t.layoutDependency!==n&&s.setOptions({...s.options,layoutDependency:n}),IT=!0,r||t.layoutDependency!==n||n===void 0||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Tn.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),rT.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=t;IT=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function IZ(e){const[t,n]=c9e(),i=R.useContext(IN);return ce.jsx(tFe,{...e,layoutGroup:i,switchLayoutGroup:R.useContext(mZ),isPresent:t,safeToRemove:n})}const nFe={pan:{Feature:eFe},drag:{Feature:$9e,ProjectionNode:oZ,MeasureLayout:IZ}};function MZ(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,o=i[r];o&&Tn.postRender(()=>o(t,R0(t)))}class iFe extends jc{mount(){const{current:t}=this.node;t&&(this.unmount=OGe(t,(n,i)=>(MZ(this.node,i,"Start"),r=>MZ(this.node,r,"End"))))}unmount(){}}class rFe extends jc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=m0(C0(this.node.current,"focus",()=>this.onFocus()),C0(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function LZ(e,t,n){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),o=i[r];o&&Tn.postRender(()=>o(t,R0(t)))}class oFe extends jc{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=NGe(t,(r,o)=>(LZ(this.node,o,"Start"),(s,{success:a})=>LZ(this.node,s,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const MT=new WeakMap,LT=new WeakMap,sFe=e=>{const t=MT.get(e.target);t&&t(e)},aFe=e=>{e.forEach(sFe)};function cFe({root:e,...t}){const n=e||document;LT.has(n)||LT.set(n,{});const i=LT.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(aFe,{root:e,...t})),i[r]}function lFe(e,t,n){const i=cFe(t);return MT.set(e,n),i.observe(e),()=>{MT.delete(e),i.unobserve(e)}}const uFe={some:0,all:1};class hFe extends jc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:uFe[r]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,o&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),d=l?u:h;d&&d(c)};return lFe(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(dFe(t,n))&&this.startObserver()}unmount(){}}function dFe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const fFe={...N9e,...{inView:{Feature:hFe},tap:{Feature:oFe},focus:{Feature:rFe},hover:{Feature:iFe}},...nFe,...{layout:{ProjectionNode:oZ,MeasureLayout:IZ}}},pFe=G9e(fFe,V9e);function PZ(e){const t=MN(()=>tu(e)),{isStatic:n}=R.useContext(vT);if(n){const[,i]=R.useState(e);R.useEffect(()=>t.on("change",i),[])}return t}function PT(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mFe(e,t){var n=R.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(i){var r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}})[0];return n.callback=t,n.facade}var gFe=typeof window<"u"?A0.useLayoutEffect:A0.useEffect,OZ=new WeakMap;function yFe(e,t){var n=mFe(null,function(i){return e.forEach(function(r){return PT(r,i)})});return gFe(function(){var i=OZ.get(n);if(i){var r=new Set(i),o=new Set(e),s=n.current;r.forEach(function(a){o.has(a)||PT(a,null)}),o.forEach(function(a){r.has(a)||PT(a,s)})}OZ.set(n,e)},[e]),n}const bFe=new cs(it.WGS84,b.ZERO),OT=R.forwardRef(({position:e,children:t,...n},i)=>{const r=Wo(()=>new b);e?.clone(r);const o=PZ(""),s=PZ("none"),{toWindowPosition:a,getCamera:c,toXYZ:l,isPositionVisible:u}=li(),h=R.useRef(null);Gl(()=>{if(h.current==null)return;let f;try{const v=a?.([r.x,r.y,r.z]);f=new me(v?.[0],v?.[1])}catch{s.set("none");return}const p=c?.();if(!p)return;const m=l?.(p?.lng,p?.lat,p?.height);if(!m)return;if(bFe.cameraPosition=new b(m[0],m[1],m[2]),f==null||f.x<0||f.y<0||f.x>window.innerWidth||f.y>window.innerHeight||!u?.([r.x,r.y,r.z])){s.set("none");return}const y=`calc(${f.x}px - 50%)`,g=`calc(${f.y}px - 50%)`;o.set(`translate(${y}, ${g})`),s.set("block")});const d=yFe([h,i]);return ce.jsx(pFe.div,{ref:d,...n,style:{...n.style,transform:o,display:s,position:"absolute",pointerEvents:"none",left:0,top:0},children:t})});OT.displayName="ScreenSpaceElement";const _Fe=({a:e,b:t,color:n})=>{const i=R.useRef([e,t]);i.current=[e,t];const r=Wo(()=>new wo(()=>i.current,!1)),o=R.useMemo(()=>({polyline:{positions:r,width:1.5,material:new Ol({color:n,dashLength:8})}}),[n,r]);return ce.jsx(p0,{...o})},vFe=({a:e,b:t,extrudedHeight:n,color:i,showLine:r})=>{const o=Wo(()=>new b);return ce.jsxs(ce.Fragment,{children:[ce.jsx(OT,{position:b.midpoint(e,t,o),children:ce.jsx(RN,{children:n<1e3?`${n.toFixed(1)} m`:`${(n/1e3).toFixed(1)} km`})}),r&&ce.jsx(_Fe,{a:e,b:t,color:i})]})},GZ=R.memo(({geometryOptions:{controlPoints:e,type:t},extrudedHeight:n,color:i,isEditing:r,extrudedPoint:o,centroidBasePoint:s,centroidExtrudedPoint:a,catchedExtrudedPoint:c,handleControlPointMouseEvent:l})=>{const u=e[e.length-1],h=o?new b(...o):void 0,d=s?new b(...s):void 0,f=a?new b(...a):void 0;return ce.jsxs(ce.Fragment,{children:[h&&ce.jsxs(ce.Fragment,{children:[ce.jsx(f0,{index:-1,position:h,isEditing:r,isExtrudedControlPoint:!0,handleControlPointMouseEvent:l}),(!r||c)&&ce.jsx(vFe,{a:u,b:h,extrudedHeight:n,color:r?B.fromCssColorString(d0):i,showLine:t!=="extrudedPolygon"})]}),d&&ce.jsx(f0,{index:-1,position:d,isEditing:r,isExtrudedControlPoint:!0}),f&&ce.jsx(f0,{index:-1,position:f,isEditing:r,isExtrudedControlPoint:!0})]})});GZ.displayName="ExtrudedControlPoints";const wFe=({id:e,hierarchy:t,extrudedHeight:n,color:i,disableShadow:r=!1,isEditing:o})=>{const s=R.useRef(t);s.current=t;const c=Wo(()=>new wo(()=>s.current,!1)),l=R.useRef(n);l.current=n;const h=Wo(()=>new wo(()=>l.current,!1)),d=R.useMemo(()=>({polygon:{hierarchy:c,heightReference:vl.RELATIVE_TO_TERRAIN,extrudedHeight:h,extrudedHeightReference:vl.RELATIVE_TO_TERRAIN,fill:!0,outline:!0,outlineWidth:1,outlineColor:o?B.fromCssColorString(d0):i?.withAlpha(1),material:new Rl(o?i?.withAlpha(.2):i),classificationType:eo.TERRAIN,shadows:r?Zf.DISABLED:Zf.ENABLED}}),[h,r,c,i,o]),{requestRender:f}=li();return f?.(),ce.jsx(p0,{id:e,...d})},xFe=({dynamic:e=!1,hierarchy:t,color:n})=>{const i=R.useRef(t);i.current=t;const r=Wo(()=>new wo(()=>i.current,!1)),o=e?r:t,s=R.useMemo(()=>({polygon:{hierarchy:o,fill:!0,material:n?.withAlpha(.5),classificationType:eo.TERRAIN}}),[n,o]),{requestRender:a}=li();return a?.(),ce.jsx(p0,{...s})},SFe=({dynamic:e=!1,positions:t,color:n,isEditing:i})=>{const r=R.useRef(t);r.current=t;const o=Wo(()=>new wo(()=>r.current,!e)),s=e?o:t,a=R.useMemo(()=>({polyline:{positions:s,width:1.5,material:i?B.fromCssColorString(d0):n,classificationType:eo.TERRAIN,clampToGround:!0}}),[n,s,i]),{requestRender:c}=li();return c?.(),ce.jsx(p0,{...a})},VZ=new b,FZ=R.memo(({geometryOptions:{type:e,controlPoints:t},isEditing:n,handleAddControlPoint:i})=>{if(!["polyline","polygon","extrudedPolygon"].includes(e))return null;const r=[];for(let o=0;o<t.length-1;o++){const s=t[o+1],a=b.midpoint(t[o],s,VZ);r.push(a.clone())}if(e==="polygon"||e==="extrudedPolygon"){const o=b.midpoint(t[t.length-1],t[0],VZ);r.push(o.clone())}return ce.jsx(ce.Fragment,{children:r.map((o,s)=>ce.jsx(f0,{position:o,isAddingPoint:!0,index:s,clampToGround:!0,isEditing:n,handleControlPointMouseEvent:()=>i?.([o.x,o.y,o.z],s)},s))})});FZ.displayName="SurfaceAddingPoints";const EFe=({a:e,b:t,color:n})=>{const i=R.useRef([e,t]);i.current=[e,t];const r=Wo(()=>new wo(()=>i.current,!1)),o=R.useMemo(()=>({polyline:{positions:r,width:1.5,material:new Ol({color:n,dashLength:8}),classificationType:eo.TERRAIN,clampToGround:!0}}),[n,r]),{requestRender:s}=li();return s?.(),ce.jsx(p0,{...o})},TFe=({a:e,b:t,color:n,showLine:i=!1})=>{const r=Wo(()=>new b),{getSurfaceDistance:o}=li(),s=o?.(e,t);return s!==void 0?ce.jsxs(ce.Fragment,{children:[ce.jsx(OT,{position:b.midpoint(e,t,r),children:ce.jsx(RN,{children:s<1e3?`${s.toFixed(1)} m`:`${(s/1e3).toFixed(1)} km`})}),i&&ce.jsx(EFe,{a:e,b:t,color:n})]}):null},AZ=new b,zZ=R.memo(({geometryOptions:{type:e,controlPoints:t},color:n,isEditing:i,catchedControlPointIndex:r,selectedControlPointIndex:o,handleControlPointMouseEvent:s})=>{const a=[];if(t.length>=2)if(i){if(r!==void 0&&r!==-1)switch(e){case"polyline":r>0&&a.push({points:[t[r-1],t[r]],showLine:!1}),r<t.length-1&&a.push({points:[t[r],t[r+1]],showLine:!1});break;case"circle":case"extrudedCircle":r!==2&&a.push({points:[t[0],t[1]],showLine:!0});break;case"rectangle":case"extrudedRectangle":if(r<=1)a.push({points:[t[0],t[1]],showLine:!1});else if(r===2){const[c,l,u]=t,h=b.midpoint(c,l,AZ);a.push({points:[h,u],showLine:!0})}break;case"polygon":case"extrudedPolygon":a.push({points:[t[r],r===0?t[t.length-1]:t[r-1]],showLine:!1}),a.push({points:[t[r],r===t.length-1?t[0]:t[r+1]],showLine:!1});break}}else switch(e){case"rectangle":case"extrudedRectangle":if(t.length===2)a.push({points:t,showLine:!0});else if(t.length===3){const[c,l,u]=t,h=b.midpoint(c,l,AZ);a.push({points:[h,u],showLine:!0})}break;default:a.push({points:t.slice(-2),showLine:e==="circle"});break}return ce.jsxs(ce.Fragment,{children:[t.map((c,l)=>ce.jsx(f0,{position:c,index:l,isSelected:o===l,clampToGround:!0,isEditing:i,handleControlPointMouseEvent:s},l)),a.map(({points:c,showLine:l},u)=>ce.jsx(TFe,{a:c[0],b:c[1],color:i?B.fromCssColorString(d0):n,showLine:l},u))]})});zZ.displayName="SurfaceControlPoints";const NZ=R.memo(({geometryOptions:e,extrudedHeight:t,disableShadow:n,color:i,isEditing:r,extrudedPoint:o,centroidBasePoint:s,centroidExtrudedPoint:a,catchedControlPointIndex:c,catchedExtrudedPoint:l,selectedControlPointIndex:u,handleControlPointMouseEvent:h,handleAddControlPoint:d})=>{const f=R.useMemo(()=>e?{...e,controlPoints:e?.controlPoints.map(v=>new M.Cartesian3(...v))}:null,[e]),p=R.useMemo(()=>f?_N(f):null,[f]),{positionsArray:m,hierarchyArray:y}=R.useMemo(()=>p?.type==="Point"?{}:p?.type==="LineString"?{positionsArray:dF(p)}:p!=null?{positionsArray:dF(p),hierarchyArray:fF(p)}:{},[p]),g=R.useMemo(()=>B.fromCssColorString(i??bPe),[i]);return ce.jsxs(ce.Fragment,{children:[m?.map((v,S)=>ce.jsx(SFe,{dynamic:!0,positions:v,color:g,isEditing:r},S)),y?.map((v,S)=>ce.jsx(xFe,{dynamic:!0,hierarchy:v,color:g},S)),f!=null&&(!t||r)&&ce.jsx(zZ,{geometryOptions:f,color:g,isEditing:r,catchedControlPointIndex:c,selectedControlPointIndex:u,handleControlPointMouseEvent:h}),f!=null&&r&&ce.jsx(FZ,{geometryOptions:f,isEditing:r,handleAddControlPoint:d}),f!=null&&t&&ce.jsx(GZ,{geometryOptions:f,extrudedHeight:t,extrudedPoint:o,centroidBasePoint:s,centroidExtrudedPoint:a,catchedExtrudedPoint:l,color:g,isEditing:r,handleControlPointMouseEvent:h}),t&&y?.map((v,S)=>ce.jsx(wFe,{hierarchy:v,extrudedHeight:t,disableShadow:n,color:g,isEditing:r},S))]})});NZ.displayName="SketchComponent";const CFe=({className:e,style:t,property:n,time:i,camera:r,small:o,ready:s,children:a,selectedLayerId:c,isLayerDraggable:l,isLayerDragging:u,shouldRender:h,layerSelectionReason:d,meta:f,customProvider:p,displayCredits:m,hasCesiumIonAsset:y,layersRef:g,featureFlags:v,requestingRenderMode:S,timelineManagerRef:E,cameraForceHorizontalRoll:C,onLayerSelect:O,onCameraChange:V,onLayerDrag:A,onLayerDrop:G,onLayerEdit:N,onLayerSelectWithRectStart:k,onLayerSelectWithRectMove:P,onLayerSelectWithRectEnd:w,onMount:x,onLayerVisibility:I,onLayerLoad:X,onCreditsUpdate:D},Y)=>{const{cesium:H,mouseEventHandles:J,cesiumIonAccessToken:z,context:W,layerSelectWithRectEventHandlers:Q,sceneLight:q,sceneBackgroundColor:se,sceneMsaaSamples:xe,sceneMode:ge,cameraViewBoundaries:Fe,cameraViewOuterBoundaries:Pe,cameraViewBoundariesMaterial:fe,handleCameraChange:Ze,handleCameraMoveEnd:et,handleUpdate:tt,handleClick:Z,handleMount:pe,handleUnmount:ue,handleTilesChange:$,handleTerrainProviderChange:j}=rPe({ref:Y,property:n,time:i,selectedLayerId:c,selectionReason:d,meta:f,customProvider:p,layersRef:g,featureFlags:v,timelineManagerRef:E,isLayerDraggable:l,isLayerDragging:u,shouldRender:h,requestingRenderMode:S,camera:r,cameraForceHorizontalRoll:C,onLayerDrag:A,onLayerDrop:G,onLayerSelect:O,onLayerEdit:N,onLayerSelectWithRectStart:k,onLayerSelectWithRectMove:P,onLayerSelectWithRectEnd:w,onLayerVisibility:I,onLayerLoad:X,onCameraChange:V,onMount:x,onCreditsUpdate:D,hasCesiumIonAsset:y}),ee=n?.terrain?.enabled?n?.scene?.verticalExaggeration??1:1;return ce.jsxs(Ere,{ref:H,onUpdate:tt,className:e,requestRenderMode:!0,animation:!1,timeline:!1,baseLayer:!1,fullscreenButton:!1,homeButton:!1,geocoder:!1,infoBox:!1,baseLayerPicker:!1,navigationHelpButton:!1,projectionPicker:!1,sceneModePicker:!1,creditContainer:m?void 0:RFe,style:{width:o?"300px":"auto",height:o?"300px":"100%",display:s?void 0:"none",cursor:u?"grab":void 0,...t},shadows:!!n?.scene?.shadow?.enabled,onClick:Z,onDoubleClick:J.doubleClick,onMouseDown:J.mouseDown,onMouseUp:J.mouseUp,onRightClick:J.rightClick,onRightDown:J.rightDown,onRightUp:J.rightUp,onMiddleClick:J.middleClick,onMiddleDown:J.middleDown,onMiddleUp:J.middleUp,onMouseMove:J.mouseMove,onMouseEnter:J.mouseEnter,onMouseLeave:J.mouseLeave,onWheel:J.wheel,automaticallyTrackDataSourceClocks:!1,children:[ce.jsx(Bbe,{onMount:pe,onUnmount:ue}),ce.jsx(Koe,{timelineManagerRef:E}),ce.jsx(ebe,{tiles:n?.tiles,cesiumIonAccessToken:z,customProvider:p,onTilesChange:$}),ce.jsx(yF,{tileLabels:n?.tileLabels}),ce.jsx(ibe,{property:n,timelineManagerRef:E}),ce.jsxs(ZM,{useDefault:!0,children:[ce.jsx(hc,{type:M.ScreenSpaceEventType.LEFT_CLICK}),ce.jsx(hc,{type:M.ScreenSpaceEventType.LEFT_DOUBLE_CLICK})]}),ce.jsxs(ZM,{children:[ce.jsx(hc,{type:M.ScreenSpaceEventType.LEFT_DOWN,action:Q.start.handler}),ce.jsx(hc,{type:M.ScreenSpaceEventType.LEFT_DOWN,modifier:M.KeyboardEventModifier.SHIFT,action:Q.start.shift}),ce.jsx(hc,{type:M.ScreenSpaceEventType.MOUSE_MOVE,action:Q.move.handler}),ce.jsx(hc,{type:M.ScreenSpaceEventType.MOUSE_MOVE,modifier:M.KeyboardEventModifier.SHIFT,action:Q.move.shift}),ce.jsx(hc,{type:M.ScreenSpaceEventType.LEFT_UP,action:Q.end.handler}),ce.jsx(hc,{type:M.ScreenSpaceEventType.LEFT_UP,modifier:M.KeyboardEventModifier.SHIFT,action:Q.end.shift})]}),ce.jsx(fre,{maximumZoomDistance:n?.camera?.limiter?.enabled?n.camera?.limiter?.targetArea?.height??Number.POSITIVE_INFINITY:Number.POSITIVE_INFINITY,enableCollisionDetection:!n?.camera?.allowEnterGround}),ce.jsx(Hne,{percentageChanged:.2,onChange:Ze,onMoveEnd:et}),Fe&&n?.camera?.limiter?.showHelper&&ce.jsx(uc,{children:ce.jsx(ml,{positions:Fe,width:1,material:M.Color.RED,arcType:M.ArcType.RHUMB})}),Pe&&n?.camera?.limiter?.showHelper&&ce.jsx(uc,{children:ce.jsx(ml,{positions:Pe,width:1,material:fe,arcType:M.ArcType.RHUMB})}),ce.jsx(hre,{backgroundColor:se,light:q,mode:ge,msaaSamples:xe,useDepthPicking:!0,useWebVR:!!n?.scene?.vr||void 0,debugShowFramesPerSecond:!!n?.debug?.showFramesPerSecond,verticalExaggerationRelativeHeight:n?.scene?.verticalExaggerationRelativeHeight,verticalExaggeration:ee}),ce.jsx(yre,{show:n?.sky?.skyBox?.show??!0}),ce.jsx(wie,{enabled:n?.sky?.fog?.enabled??!0,density:n?.sky?.fog?.density}),ce.jsx(_re,{show:n?.sky?.sun?.show??!0}),ce.jsx(Hie,{show:n?.sky?.moon?.show??!0}),ce.jsx(mre,{show:n?.sky?.skyAtmosphere?.show??!0,atmosphereLightIntensity:n?.sky?.skyAtmosphere?.lightIntensity,saturationShift:n?.sky?.skyAtmosphere?.saturationShift,brightnessShift:n?.sky?.skyAtmosphere?.brightnessShift}),ce.jsx(Mse,{property:n,cesiumIonAccessToken:z,onTerrainProviderChange:j}),ce.jsx(CF.Provider,{value:W,children:s?a:null}),ce.jsx(gPe,{...yPe[n?.render?.ambientOcclusion?.quality||"low"],enabled:!!n?.render?.ambientOcclusion?.enabled,intensity:n?.render?.ambientOcclusion?.intensity??100,outputType:n?.render?.ambientOcclusion?.ambientOcclusionOnly?TN.Occlusion:null})]})},RFe=document.createElement("div"),kZ={cesium:{component:R.forwardRef(CFe),featureComponent:X5e,clusterComponent:joe,sketchComponent:NZ,delegatedDataTypes:["czml","wms","mvt","3dtiles","osm-buildings","reearth-buildings","google-photorealistic","kml"]}};function IFe({error:e,resetErrorBoundary:t}){const i=e?.message??String(e);return ce.jsxs("div",{children:[ce.jsx("h1",{children:"Oops! An Error Occurred"}),ce.jsx("p",{children:i}),ce.jsx("p",{children:ce.jsx("button",{style:{color:"#fff"},onClick:t,children:"Retry"})})]})}const MFe="0.0.7-alpha.72",LFe=({viewerProperty:e})=>{const t=R.useRef(e);t.current=e;const n=R.useMemo(()=>({get version(){return MFe},get viewerProperty(){return t.current}}),[]);R.useEffect(()=>{window.reearth_core=n},[n])},PFe=768,OFe=({wrapperRef:e})=>{const t=R.useMemo(()=>GFe(new URLSearchParams(window.location.search)),[]),[n,i]=R.useState({width:void 0,height:void 0,isMobile:void 0,query:t});return R.useEffect(()=>{const r=new ResizeObserver(o=>{const[s]=o;let a,c;if(s.contentBoxSize){const l=Array.isArray(s.contentBoxSize)?s.contentBoxSize[0]:s.contentBoxSize;a=l.inlineSize,c=l.blockSize}else s.contentRect?(a=s.contentRect.width,c=s.contentRect.height):(a=e.current?.clientWidth,c=e.current?.clientHeight);i(l=>({width:a,height:c,isMobile:a?a<=PFe:void 0,query:l.query}))});return e.current&&r.observe(e.current),()=>{r.disconnect()}},[e]),n};function GFe(e){const t={};for(const[n,i]of e)t[n]=i;return t}function VFe({camera:e,interactionMode:t,zoomedLayerId:n,viewerProperty:i,onLayerSelect:r,onCameraChange:o,onInteractionModeChange:s,onZoomToLayer:a,onLayerDrop:c,onSketchTypeChangeProp:l},u){const h=R.useRef(null);R.useImperativeHandle(u,()=>h.current,[]);const d=R.useRef(null),f=OFe({wrapperRef:d}),[p,m]=R.useState({}),[y,g]=R.useState(),[v,S]=R.useState(),E=R.useCallback(async(De,Tt,At,St,Xt)=>{const ni=p.layer?.layer?.type==="simple"&&p.layer?.layer?.data?.isSketchLayer;if(p.layerId===De&&p.featureId===Tt&&!ni)return;const Qn=await At?.(),kn=De&&Tt?(ni?Qn?.features?.find(Wn=>Wn.id===Tt):h.current?.engine.findComputedFeatureById?.(De,Tt))??Xt?.feature:void 0;g(De&&Tt?h.current?.engine.findFeatureById?.(De,Tt):void 0),S(kn),m(Wn=>Wn.layerId===De&&Wn.featureId===Tt?Wn:{layerId:De,featureId:Tt,layer:Qn,reason:St}),r?.(De,At,kn,St)},[p,r]),C=R.useRef(void 0),[O,V]=XZ(e,o),[A,G]=R.useState(!1),N=R.useCallback(De=>{G(!!De)},[]),[k,P]=XZ(t||"default",s);R.useEffect(()=>{k==="default"&&h?.current?.engine?.setCursor("auto")},[k]);const w=N0[k??"default"],x=R.useRef(void 0),I=R.useCallback(De=>{x.current=De},[]),X=R.useCallback(De=>{x.current?.(De)},[]),D=R.useRef(void 0),Y=R.useCallback(De=>{D.current=De},[]),H=R.useCallback(De=>{D.current?.(De)},[]),J=R.useRef(void 0),z=R.useCallback(De=>{J.current=De},[]),W=R.useCallback(De=>{J.current?.(De)},[]),Q=R.useRef(void 0),q=R.useCallback(De=>{Q.current=De},[]),se=R.useCallback(De=>{Q.current?.(De)},[]),xe=R.useRef(void 0),ge=R.useCallback(De=>{xe.current=De},[]),Fe=R.useCallback(De=>{xe.current?.(De)},[]),Pe=R.useRef(void 0),fe=R.useCallback(De=>{Pe.current=De},[]),Ze=R.useCallback(De=>{Pe.current?.(De)},[]),et=R.useRef([]),tt=R.useCallback(De=>{et.current.push(De)},[]),Z=R.useCallback(De=>{et.current.forEach(Tt=>Tt(De))},[]),pe=R.useRef([]),ue=R.useCallback(De=>{pe.current.push(De)},[]),$=R.useCallback(De=>{pe.current.forEach(Tt=>Tt(De))},[]),j=R.useRef([]),ee=R.useCallback(De=>{j.current.push(De)},[]),le=R.useCallback(De=>{j.current.forEach(Tt=>Tt(De))},[]),ye=R.useRef([]),re=R.useCallback(De=>{ye.current.push(De)},[]),Ie=R.useCallback((De,Tt)=>{ye.current.forEach(At=>At(De)),l?.(De,Tt)},[l]);R.useEffect(()=>{n&&(h.current?.engine?.lookAtLayer(n),a?.(void 0))},[n,a]);const[we,he]=R.useState(!1),ze=R.useCallback(()=>{he(!0)},[]),Qe=R.useCallback((De,Tt,At)=>{he(!1);const St=h.current?.layers.findById(De),Xt=St?.property.default.location?"default.location":St?.property.default.position?"default.position":void 0;At&&St&&St.propertyId&&Xt&&c?.(St.propertyId,Xt,At)},[c,h]),nt=R.useMemo(()=>({interactionMode:k,selectedLayer:p,selectedComputedFeature:v,viewport:f,handleCameraForceHorizontalRollChange:N,handleInteractionModeChange:P,onSketchPluginFeatureCreate:tt,onSketchPluginFeatureUpdate:ue,onSketchPluginFeatureDelete:ee,onSketchTypeChange:re,onLayerVisibility:Y,onLayerLoad:z,onLayerEdit:I,onLayerSelectWithRectStart:q,onLayerSelectWithRectMove:ge,onLayerSelectWithRectEnd:fe}),[k,p,v,f,P,N,I,tt,ue,ee,re,Y,z,q,ge,fe]),at=R.useMemo(()=>({position:"relative",width:"100%",height:"100%",overflow:"hidden"}),[]);return LFe({viewerProperty:i}),{mapRef:h,wrapperRef:d,selectedFeature:y,camera:O,featureFlags:w,isLayerDragging:we,timelineManagerRef:C,cameraForceHorizontalRoll:A,coreContextValue:nt,containerStyle:at,overriddenInteractionMode:k,handleLayerSelect:E,handleLayerDrag:ze,handleLayerDrop:Qe,handleLayerEdit:X,handleCameraChange:V,handleInteractionModeChange:P,handleSketchPluginFeatureCreate:Z,handleSketchPluginFeatureUpdate:$,handleSketchPluginFeatureDelete:le,handleSketchTypeChange:Ie,handleLayerVisibility:H,handleLayerLoad:W,handleLayerSelectWithRectStart:se,handleLayerSelectWithRectMove:Fe,handleLayerSelectWithRectEnd:Ze}}function XZ(e,t){const[n,i]=R.useState(e),r=R.useCallback(o=>{o&&(i(o),t?.(o))},[t]);return R.useEffect(()=>{i(e)},[e]),[n,r]}const FFe=R.memo(R.forwardRef(({engine:e,isBuilt:t,isEditable:n,viewerProperty:i,layers:r,clusters:o,small:s,ready:a,hiddenLayers:c,camera:l,time:u,interactionMode:h,shouldRender:d,meta:f,customProvider:p,displayCredits:m=!0,style:y,zoomedLayerId:g,children:v,onLayerDrop:S,onLayerSelect:E,onCameraChange:C,onZoomToLayer:O,onInteractionModeChange:V,onMount:A,onSketchTypeChangeProp:G,onSketchFeatureCreate:N,onSketchFeatureUpdate:k,onSketchFeatureDelete:P,onAPIReady:w,onCreditsUpdate:x},I)=>{const{mapRef:X,wrapperRef:D,selectedFeature:Y,camera:H,featureFlags:J,isLayerDragging:z,timelineManagerRef:W,cameraForceHorizontalRoll:Q,coreContextValue:q,containerStyle:se,overriddenInteractionMode:xe,handleLayerSelect:ge,handleLayerDrag:Fe,handleLayerDrop:Pe,handleLayerEdit:fe,handleCameraChange:Ze,handleInteractionModeChange:et,handleSketchPluginFeatureCreate:tt,handleSketchPluginFeatureUpdate:Z,handleSketchPluginFeatureDelete:pe,handleSketchTypeChange:ue,handleLayerVisibility:$,handleLayerLoad:j,handleLayerSelectWithRectStart:ee,handleLayerSelectWithRectMove:le,handleLayerSelectWithRectEnd:ye}=VFe({camera:l,interactionMode:h,zoomedLayerId:g,viewerProperty:i,onLayerSelect:E,onCameraChange:C,onZoomToLayer:O,onLayerDrop:S,onInteractionModeChange:V,onSketchTypeChangeProp:G},I);return ce.jsx(Uoe,{FallbackComponent:IFe,children:ce.jsx(Hoe,{mapRef:X,children:ce.jsxs("div",{ref:D,style:se,children:[ce.jsx(p5,{ref:X,isBuilt:t,isEditable:n,engine:e,layers:r,engines:kZ,camera:H,cameraForceHorizontalRoll:Q,clusters:o,hiddenLayers:c,isLayerDragging:z,isLayerDraggable:n,meta:f,customProvider:p,displayCredits:m,style:y,featureFlags:J,shouldRender:d,property:i,time:u,small:s,ready:a,timelineManagerRef:W,interactionMode:xe,selectedFeature:Y,onCameraChange:Ze,onLayerDrag:Fe,onLayerDrop:Pe,onLayerSelect:ge,onLayerEdit:fe,overrideInteractionMode:et,onSketchFeatureCreate:N,onSketchPluginFeatureCreate:tt,onSketchFeatureUpdate:k,onSketchPluginFeatureUpdate:Z,onSketchFeatureDelete:P,onSketchPluginFeatureDelete:pe,onSketchTypeChange:ue,onMount:A,onLayerVisibility:$,onLayerLoad:j,onLayerSelectWithRectStart:ee,onLayerSelectWithRectMove:le,onLayerSelectWithRectEnd:ye,onAPIReady:w,onCreditsUpdate:x}),ce.jsx(g5.Provider,{value:q,children:v})]})})})}));var cd=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},sa=[],Zo=[],AFe=typeof Uint8Array<"u"?Uint8Array:Array,GT=!1;function ZZ(){GT=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t<n;++t)sa[t]=e[t],Zo[e.charCodeAt(t)]=t;Zo[45]=62,Zo[95]=63}function zFe(e){GT||ZZ();var t,n,i,r,o,s,a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=e[a-2]==="="?2:e[a-1]==="="?1:0,s=new AFe(a*3/4-o),i=o>0?a-4:a;var c=0;for(t=0,n=0;t<i;t+=4,n+=3)r=Zo[e.charCodeAt(t)]<<18|Zo[e.charCodeAt(t+1)]<<12|Zo[e.charCodeAt(t+2)]<<6|Zo[e.charCodeAt(t+3)],s[c++]=r>>16&255,s[c++]=r>>8&255,s[c++]=r&255;return o===2?(r=Zo[e.charCodeAt(t)]<<2|Zo[e.charCodeAt(t+1)]>>4,s[c++]=r&255):o===1&&(r=Zo[e.charCodeAt(t)]<<10|Zo[e.charCodeAt(t+1)]<<4|Zo[e.charCodeAt(t+2)]>>2,s[c++]=r>>8&255,s[c++]=r&255),s}function NFe(e){return sa[e>>18&63]+sa[e>>12&63]+sa[e>>6&63]+sa[e&63]}function kFe(e,t,n){for(var i,r=[],o=t;o<n;o+=3)i=(e[o]<<16)+(e[o+1]<<8)+e[o+2],r.push(NFe(i));return r.join("")}function DZ(e){GT||ZZ();for(var t,n=e.length,i=n%3,r="",o=[],s=16383,a=0,c=n-i;a<c;a+=s)o.push(kFe(e,a,a+s>c?c:a+s));return i===1?(t=e[n-1],r+=sa[t>>2],r+=sa[t<<4&63],r+="=="):i===2&&(t=(e[n-2]<<8)+e[n-1],r+=sa[t>>10],r+=sa[t>>4&63],r+=sa[t<<2&63],r+="="),o.push(r),o.join("")}function o1(e,t,n,i,r){var o,s,a=r*8-i-1,c=(1<<a)-1,l=c>>1,u=-7,h=n?r-1:0,d=n?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=a;u>0;o=o*256+e[t+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=s*256+e[t+h],h+=d,u-=8);if(o===0)o=1-l;else{if(o===c)return s?NaN:(f?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-l}return(f?-1:1)*s*Math.pow(2,o-i)}function UZ(e,t,n,i,r,o){var s,a,c,l=o*8-r-1,u=(1<<l)-1,h=u>>1,d=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,p=i?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+h>=1?t+=d/c:t+=d*Math.pow(2,1-h),t*c>=2&&(s++,c/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(t*c-1)*Math.pow(2,r),s=s+h):(a=t*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;e[n+f]=a&255,f+=p,a/=256,r-=8);for(s=s<<r|a,l+=r;l>0;e[n+f]=s&255,f+=p,s/=256,l-=8);e[n+f-p]|=m*128}var XFe={}.toString,WZ=Array.isArray||function(e){return XFe.call(e)=="[object Array]"},ZFe=50;_e.TYPED_ARRAY_SUPPORT=cd.TYPED_ARRAY_SUPPORT!==void 0?cd.TYPED_ARRAY_SUPPORT:!0,s1();function s1(){return _e.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Ba(e,t){if(s1()<t)throw new RangeError("Invalid typed array length");return _e.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=_e.prototype):(e===null&&(e=new _e(t)),e.length=t),e}function _e(e,t,n){if(!_e.TYPED_ARRAY_SUPPORT&&!(this instanceof _e))return new _e(e,t,n);if(typeof e=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return VT(this,e)}return BZ(this,e,t,n)}_e.poolSize=8192,_e._augment=function(e){return e.__proto__=_e.prototype,e};function BZ(e,t,n,i){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer?WFe(e,t,n,i):typeof t=="string"?UFe(e,t,n):BFe(e,t)}_e.from=function(e,t,n){return BZ(null,e,t,n)},_e.TYPED_ARRAY_SUPPORT&&(_e.prototype.__proto__=Uint8Array.prototype,_e.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&_e[Symbol.species]);function YZ(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function DFe(e,t,n,i){return YZ(t),t<=0?Ba(e,t):n!==void 0?typeof i=="string"?Ba(e,t).fill(n,i):Ba(e,t).fill(n):Ba(e,t)}_e.alloc=function(e,t,n){return DFe(null,e,t,n)};function VT(e,t){if(YZ(t),e=Ba(e,t<0?0:AT(t)|0),!_e.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}_e.allocUnsafe=function(e){return VT(null,e)},_e.allocUnsafeSlow=function(e){return VT(null,e)};function UFe(e,t,n){if((typeof n!="string"||n==="")&&(n="utf8"),!_e.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=HZ(t,n)|0;e=Ba(e,i);var r=e.write(t,n);return r!==i&&(e=e.slice(0,r)),e}function FT(e,t){var n=t.length<0?0:AT(t.length)|0;e=Ba(e,n);for(var i=0;i<n;i+=1)e[i]=t[i]&255;return e}function WFe(e,t,n,i){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");return n===void 0&&i===void 0?t=new Uint8Array(t):i===void 0?t=new Uint8Array(t,n):t=new Uint8Array(t,n,i),_e.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=_e.prototype):e=FT(e,t),e}function BFe(e,t){if(aa(t)){var n=AT(t.length)|0;return e=Ba(e,n),e.length===0||t.copy(e,0,0,n),e}if(t){if(typeof ArrayBuffer<"u"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||u4e(t.length)?Ba(e,0):FT(e,t);if(t.type==="Buffer"&&WZ(t.data))return FT(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function AT(e){if(e>=s1())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s1().toString(16)+" bytes");return e|0}_e.isBuffer=jr;function aa(e){return!!(e!=null&&e._isBuffer)}_e.compare=function(t,n){if(!aa(t)||!aa(n))throw new TypeError("Arguments must be Buffers");if(t===n)return 0;for(var i=t.length,r=n.length,o=0,s=Math.min(i,r);o<s;++o)if(t[o]!==n[o]){i=t[o],r=n[o];break}return i<r?-1:r<i?1:0},_e.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},_e.concat=function(t,n){if(!WZ(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return _e.alloc(0);var i;if(n===void 0)for(n=0,i=0;i<t.length;++i)n+=t[i].length;var r=_e.allocUnsafe(n),o=0;for(i=0;i<t.length;++i){var s=t[i];if(!aa(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r};function HZ(e,t){if(aa(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var n=e.length;if(n===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return l1(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return nD(e).length;default:if(i)return l1(e).length;t=(""+t).toLowerCase(),i=!0}}_e.byteLength=HZ;function YFe(e,t,n){var i=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return n4e(this,t,n);case"utf8":case"utf-8":return QZ(this,t,n);case"ascii":return e4e(this,t,n);case"latin1":case"binary":return t4e(this,t,n);case"base64":return qFe(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i4e(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}_e.prototype._isBuffer=!0;function ru(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}_e.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<t;n+=2)ru(this,n,n+1);return this},_e.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<t;n+=4)ru(this,n,n+3),ru(this,n+1,n+2);return this},_e.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<t;n+=8)ru(this,n,n+7),ru(this,n+1,n+6),ru(this,n+2,n+5),ru(this,n+3,n+4);return this},_e.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?QZ(this,0,t):YFe.apply(this,arguments)},_e.prototype.equals=function(t){if(!aa(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:_e.compare(this,t)===0},_e.prototype.inspect=function(){var t="",n=ZFe;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},_e.prototype.compare=function(t,n,i,r,o){if(!aa(t))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),i===void 0&&(i=t?t.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),n<0||i>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&n>=i)return 0;if(r>=o)return-1;if(n>=i)return 1;if(n>>>=0,i>>>=0,r>>>=0,o>>>=0,this===t)return 0;for(var s=o-r,a=i-n,c=Math.min(s,a),l=this.slice(r,o),u=t.slice(n,i),h=0;h<c;++h)if(l[h]!==u[h]){s=l[h],a=u[h];break}return s<a?-1:a<s?1:0};function jZ(e,t,n,i,r){if(e.length===0)return-1;if(typeof n=="string"?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0)if(r)n=0;else return-1;if(typeof t=="string"&&(t=_e.from(t,i)),aa(t))return t.length===0?-1:KZ(e,t,n,i,r);if(typeof t=="number")return t=t&255,_e.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):KZ(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function KZ(e,t,n,i,r){var o=1,s=e.length,a=t.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,n/=2}function c(f,p){return o===1?f[p]:f.readUInt16BE(p*o)}var l;if(r){var u=-1;for(l=n;l<s;l++)if(c(e,l)===c(t,u===-1?0:l-u)){if(u===-1&&(u=l),l-u+1===a)return u*o}else u!==-1&&(l-=l-u),u=-1}else for(n+a>s&&(n=s-a),l=n;l>=0;l--){for(var h=!0,d=0;d<a;d++)if(c(e,l+d)!==c(t,d)){h=!1;break}if(h)return l}return-1}_e.prototype.includes=function(t,n,i){return this.indexOf(t,n,i)!==-1},_e.prototype.indexOf=function(t,n,i){return jZ(this,t,n,i,!0)},_e.prototype.lastIndexOf=function(t,n,i){return jZ(this,t,n,i,!1)};function HFe(e,t,n,i){n=Number(n)||0;var r=e.length-n;i?(i=Number(i),i>r&&(i=r)):i=r;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s<i;++s){var a=parseInt(t.substr(s*2,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function jFe(e,t,n,i){return u1(l1(t,e.length-n),e,n,i)}function JZ(e,t,n,i){return u1(c4e(t),e,n,i)}function KFe(e,t,n,i){return JZ(e,t,n,i)}function JFe(e,t,n,i){return u1(nD(t),e,n,i)}function QFe(e,t,n,i){return u1(l4e(t,e.length-n),e,n,i)}_e.prototype.write=function(t,n,i,r){if(n===void 0)r="utf8",i=this.length,n=0;else if(i===void 0&&typeof n=="string")r=n,i=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(i)?(i=i|0,r===void 0&&(r="utf8")):(r=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-n;if((i===void 0||i>o)&&(i=o),t.length>0&&(i<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return HFe(this,t,n,i);case"utf8":case"utf-8":return jFe(this,t,n,i);case"ascii":return JZ(this,t,n,i);case"latin1":case"binary":return KFe(this,t,n,i);case"base64":return JFe(this,t,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return QFe(this,t,n,i);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},_e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function qFe(e,t,n){return t===0&&n===e.length?DZ(e):DZ(e.slice(t,n))}function QZ(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r<n;){var o=e[r],s=null,a=o>239?4:o>223?3:o>191?2:1;if(r+a<=n){var c,l,u,h;switch(a){case 1:o<128&&(s=o);break;case 2:c=e[r+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(s=h));break;case 3:c=e[r+1],l=e[r+2],(c&192)===128&&(l&192)===128&&(h=(o&15)<<12|(c&63)<<6|l&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:c=e[r+1],l=e[r+2],u=e[r+3],(c&192)===128&&(l&192)===128&&(u&192)===128&&(h=(o&15)<<18|(c&63)<<12|(l&63)<<6|u&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023),i.push(s),r+=a}return $Fe(i)}var qZ=4096;function $Fe(e){var t=e.length;if(t<=qZ)return String.fromCharCode.apply(String,e);for(var n="",i=0;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=qZ));return n}function e4e(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(e[r]&127);return i}function t4e(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(e[r]);return i}function n4e(e,t,n){var i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);for(var r="",o=t;o<n;++o)r+=a4e(e[o]);return r}function i4e(e,t,n){for(var i=e.slice(t,n),r="",o=0;o<i.length;o+=2)r+=String.fromCharCode(i[o]+i[o+1]*256);return r}_e.prototype.slice=function(t,n){var i=this.length;t=~~t,n=n===void 0?i:~~n,t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),n<0?(n+=i,n<0&&(n=0)):n>i&&(n=i),n<t&&(n=t);var r;if(_e.TYPED_ARRAY_SUPPORT)r=this.subarray(t,n),r.__proto__=_e.prototype;else{var o=n-t;r=new _e(o,void 0);for(var s=0;s<o;++s)r[s]=this[s+t]}return r};function Li(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}_e.prototype.readUIntLE=function(t,n,i){t=t|0,n=n|0,i||Li(t,n,this.length);for(var r=this[t],o=1,s=0;++s<n&&(o*=256);)r+=this[t+s]*o;return r},_e.prototype.readUIntBE=function(t,n,i){t=t|0,n=n|0,i||Li(t,n,this.length);for(var r=this[t+--n],o=1;n>0&&(o*=256);)r+=this[t+--n]*o;return r},_e.prototype.readUInt8=function(t,n){return n||Li(t,1,this.length),this[t]},_e.prototype.readUInt16LE=function(t,n){return n||Li(t,2,this.length),this[t]|this[t+1]<<8},_e.prototype.readUInt16BE=function(t,n){return n||Li(t,2,this.length),this[t]<<8|this[t+1]},_e.prototype.readUInt32LE=function(t,n){return n||Li(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},_e.prototype.readUInt32BE=function(t,n){return n||Li(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},_e.prototype.readIntLE=function(t,n,i){t=t|0,n=n|0,i||Li(t,n,this.length);for(var r=this[t],o=1,s=0;++s<n&&(o*=256);)r+=this[t+s]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*n)),r},_e.prototype.readIntBE=function(t,n,i){t=t|0,n=n|0,i||Li(t,n,this.length);for(var r=n,o=1,s=this[t+--r];r>0&&(o*=256);)s+=this[t+--r]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*n)),s},_e.prototype.readInt8=function(t,n){return n||Li(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},_e.prototype.readInt16LE=function(t,n){n||Li(t,2,this.length);var i=this[t]|this[t+1]<<8;return i&32768?i|4294901760:i},_e.prototype.readInt16BE=function(t,n){n||Li(t,2,this.length);var i=this[t+1]|this[t]<<8;return i&32768?i|4294901760:i},_e.prototype.readInt32LE=function(t,n){return n||Li(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},_e.prototype.readInt32BE=function(t,n){return n||Li(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},_e.prototype.readFloatLE=function(t,n){return n||Li(t,4,this.length),o1(this,t,!0,23,4)},_e.prototype.readFloatBE=function(t,n){return n||Li(t,4,this.length),o1(this,t,!1,23,4)},_e.prototype.readDoubleLE=function(t,n){return n||Li(t,8,this.length),o1(this,t,!0,52,8)},_e.prototype.readDoubleBE=function(t,n){return n||Li(t,8,this.length),o1(this,t,!1,52,8)};function Hr(e,t,n,i,r,o){if(!aa(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}_e.prototype.writeUIntLE=function(t,n,i,r){if(t=+t,n=n|0,i=i|0,!r){var o=Math.pow(2,8*i)-1;Hr(this,t,n,i,o,0)}var s=1,a=0;for(this[n]=t&255;++a<i&&(s*=256);)this[n+a]=t/s&255;return n+i},_e.prototype.writeUIntBE=function(t,n,i,r){if(t=+t,n=n|0,i=i|0,!r){var o=Math.pow(2,8*i)-1;Hr(this,t,n,i,o,0)}var s=i-1,a=1;for(this[n+s]=t&255;--s>=0&&(a*=256);)this[n+s]=t/a&255;return n+i},_e.prototype.writeUInt8=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,1,255,0),_e.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[n]=t&255,n+1};function a1(e,t,n,i){t<0&&(t=65535+t+1);for(var r=0,o=Math.min(e.length-n,2);r<o;++r)e[n+r]=(t&255<<8*(i?r:1-r))>>>(i?r:1-r)*8}_e.prototype.writeUInt16LE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,2,65535,0),_e.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):a1(this,t,n,!0),n+2},_e.prototype.writeUInt16BE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,2,65535,0),_e.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):a1(this,t,n,!1),n+2};function c1(e,t,n,i){t<0&&(t=4294967295+t+1);for(var r=0,o=Math.min(e.length-n,4);r<o;++r)e[n+r]=t>>>(i?r:3-r)*8&255}_e.prototype.writeUInt32LE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,4,4294967295,0),_e.TYPED_ARRAY_SUPPORT?(this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=t&255):c1(this,t,n,!0),n+4},_e.prototype.writeUInt32BE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,4,4294967295,0),_e.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):c1(this,t,n,!1),n+4},_e.prototype.writeIntLE=function(t,n,i,r){if(t=+t,n=n|0,!r){var o=Math.pow(2,8*i-1);Hr(this,t,n,i,o-1,-o)}var s=0,a=1,c=0;for(this[n]=t&255;++s<i&&(a*=256);)t<0&&c===0&&this[n+s-1]!==0&&(c=1),this[n+s]=(t/a>>0)-c&255;return n+i},_e.prototype.writeIntBE=function(t,n,i,r){if(t=+t,n=n|0,!r){var o=Math.pow(2,8*i-1);Hr(this,t,n,i,o-1,-o)}var s=i-1,a=1,c=0;for(this[n+s]=t&255;--s>=0&&(a*=256);)t<0&&c===0&&this[n+s+1]!==0&&(c=1),this[n+s]=(t/a>>0)-c&255;return n+i},_e.prototype.writeInt8=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,1,127,-128),_e.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[n]=t&255,n+1},_e.prototype.writeInt16LE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,2,32767,-32768),_e.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):a1(this,t,n,!0),n+2},_e.prototype.writeInt16BE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,2,32767,-32768),_e.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):a1(this,t,n,!1),n+2},_e.prototype.writeInt32LE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,4,2147483647,-2147483648),_e.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24):c1(this,t,n,!0),n+4},_e.prototype.writeInt32BE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),_e.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):c1(this,t,n,!1),n+4};function $Z(e,t,n,i,r,o){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function eD(e,t,n,i,r){return r||$Z(e,t,n,4),UZ(e,t,n,i,23,4),n+4}_e.prototype.writeFloatLE=function(t,n,i){return eD(this,t,n,!0,i)},_e.prototype.writeFloatBE=function(t,n,i){return eD(this,t,n,!1,i)};function tD(e,t,n,i,r){return r||$Z(e,t,n,8),UZ(e,t,n,i,52,8),n+8}_e.prototype.writeDoubleLE=function(t,n,i){return tD(this,t,n,!0,i)},_e.prototype.writeDoubleBE=function(t,n,i){return tD(this,t,n,!1,i)},_e.prototype.copy=function(t,n,i,r){if(i||(i=0),!r&&r!==0&&(r=this.length),n>=t.length&&(n=t.length),n||(n=0),r>0&&r<i&&(r=i),r===i||t.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-n<r-i&&(r=t.length-n+i);var o=r-i,s;if(this===t&&i<n&&n<r)for(s=o-1;s>=0;--s)t[s+n]=this[s+i];else if(o<1e3||!_e.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)t[s+n]=this[s+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+o),n);return o},_e.prototype.fill=function(t,n,i,r){if(typeof t=="string"){if(typeof n=="string"?(r=n,n=0,i=this.length):typeof i=="string"&&(r=i,i=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!_e.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else typeof t=="number"&&(t=t&255);if(n<0||this.length<n||this.length<i)throw new RangeError("Out of range index");if(i<=n)return this;n=n>>>0,i=i===void 0?this.length:i>>>0,t||(t=0);var s;if(typeof t=="number")for(s=n;s<i;++s)this[s]=t;else{var a=aa(t)?t:l1(new _e(t,r).toString()),c=a.length;for(s=0;s<i-n;++s)this[s+n]=a[s%c]}return this};var r4e=/[^+\/0-9A-Za-z-_]/g;function o4e(e){if(e=s4e(e).replace(r4e,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function s4e(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function a4e(e){return e<16?"0"+e.toString(16):e.toString(16)}function l1(e,t){t=t||1/0;for(var n,i=e.length,r=null,o=[],s=0;s<i;++s){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===i){(t-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),r=n;continue}n=(r-55296<<10|n-56320)+65536}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return o}function c4e(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function l4e(e,t){for(var n,i,r,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),i=n>>8,r=n%256,o.push(r),o.push(i);return o}function nD(e){return zFe(o4e(e))}function u1(e,t,n,i){for(var r=0;r<i&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function u4e(e){return e!==e}function jr(e){return e!=null&&(!!e._isBuffer||iD(e)||h4e(e))}function iD(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function h4e(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&iD(e.slice(0,0))}var zT;function Kc(){}Kc.prototype=Object.create(null);function Yt(){Yt.init.call(this)}Yt.EventEmitter=Yt,Yt.usingDomains=!1,Yt.prototype.domain=void 0,Yt.prototype._events=void 0,Yt.prototype._maxListeners=void 0,Yt.defaultMaxListeners=10,Yt.init=function(){this.domain=null,Yt.usingDomains&&zT.active&&!(this instanceof zT.Domain)&&(this.domain=zT.active),(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new Kc,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Yt.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this};function rD(e){return e._maxListeners===void 0?Yt.defaultMaxListeners:e._maxListeners}Yt.prototype.getMaxListeners=function(){return rD(this)};function d4e(e,t,n){if(t)e.call(n);else for(var i=e.length,r=M0(e,i),o=0;o<i;++o)r[o].call(n)}function f4e(e,t,n,i){if(t)e.call(n,i);else for(var r=e.length,o=M0(e,r),s=0;s<r;++s)o[s].call(n,i)}function p4e(e,t,n,i,r){if(t)e.call(n,i,r);else for(var o=e.length,s=M0(e,o),a=0;a<o;++a)s[a].call(n,i,r)}function m4e(e,t,n,i,r,o){if(t)e.call(n,i,r,o);else for(var s=e.length,a=M0(e,s),c=0;c<s;++c)a[c].call(n,i,r,o)}function g4e(e,t,n,i){if(t)e.apply(n,i);else for(var r=e.length,o=M0(e,r),s=0;s<r;++s)o[s].apply(n,i)}Yt.prototype.emit=function(t){var n,i,r,o,s,a,c,l=t==="error";if(a=this._events,a)l=l&&a.error==null;else if(!l)return!1;if(c=this.domain,l){if(n=arguments[1],c)n||(n=new Error('Uncaught, unspecified "error" event')),n.domainEmitter=this,n.domain=c,n.domainThrown=!1,c.emit("error",n);else{if(n instanceof Error)throw n;var u=new Error('Uncaught, unspecified "error" event. ('+n+")");throw u.context=n,u}return!1}if(i=a[t],!i)return!1;var h=typeof i=="function";switch(r=arguments.length,r){case 1:d4e(i,h,this);break;case 2:f4e(i,h,this,arguments[1]);break;case 3:p4e(i,h,this,arguments[1],arguments[2]);break;case 4:m4e(i,h,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(r-1),s=1;s<r;s++)o[s-1]=arguments[s];g4e(i,h,this,o)}return!0};function oD(e,t,n,i){var r,o,s;if(typeof n!="function")throw new TypeError('"listener" argument must be a function');if(o=e._events,o?(o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]):(o=e._events=new Kc,e._eventsCount=0),!s)s=o[t]=n,++e._eventsCount;else if(typeof s=="function"?s=o[t]=i?[n,s]:[s,n]:i?s.unshift(n):s.push(n),!s.warned&&(r=rD(e),r&&r>0&&s.length>r)){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=s.length,y4e(a)}return e}function y4e(e){typeof console.warn=="function"?console.warn(e):console.log(e)}Yt.prototype.addListener=function(t,n){return oD(this,t,n,!1)},Yt.prototype.on=Yt.prototype.addListener,Yt.prototype.prependListener=function(t,n){return oD(this,t,n,!0)};function sD(e,t,n){var i=!1;function r(){e.removeListener(t,r),i||(i=!0,n.apply(e,arguments))}return r.listener=n,r}Yt.prototype.once=function(t,n){if(typeof n!="function")throw new TypeError('"listener" argument must be a function');return this.on(t,sD(this,t,n)),this},Yt.prototype.prependOnceListener=function(t,n){if(typeof n!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(t,sD(this,t,n)),this},Yt.prototype.removeListener=function(t,n){var i,r,o,s,a;if(typeof n!="function")throw new TypeError('"listener" argument must be a function');if(r=this._events,!r)return this;if(i=r[t],!i)return this;if(i===n||i.listener&&i.listener===n)--this._eventsCount===0?this._events=new Kc:(delete r[t],r.removeListener&&this.emit("removeListener",t,i.listener||n));else if(typeof i!="function"){for(o=-1,s=i.length;s-- >0;)if(i[s]===n||i[s].listener&&i[s].listener===n){a=i[s].listener,o=s;break}if(o<0)return this;if(i.length===1){if(i[0]=void 0,--this._eventsCount===0)return this._events=new Kc,this;delete r[t]}else b4e(i,o);r.removeListener&&this.emit("removeListener",t,a||n)}return this},Yt.prototype.removeAllListeners=function(t){var n,i;if(i=this._events,!i)return this;if(!i.removeListener)return arguments.length===0?(this._events=new Kc,this._eventsCount=0):i[t]&&(--this._eventsCount===0?this._events=new Kc:delete i[t]),this;if(arguments.length===0){for(var r=Object.keys(i),o=0,s;o<r.length;++o)s=r[o],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=new Kc,this._eventsCount=0,this}if(n=i[t],typeof n=="function")this.removeListener(t,n);else if(n)do this.removeListener(t,n[n.length-1]);while(n[0]);return this},Yt.prototype.listeners=function(t){var n,i,r=this._events;return r?(n=r[t],n?typeof n=="function"?i=[n.listener||n]:i=_4e(n):i=[]):i=[],i},Yt.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):aD.call(e,t)},Yt.prototype.listenerCount=aD;function aD(e){var t=this._events;if(t){var n=t[e];if(typeof n=="function")return 1;if(n)return n.length}return 0}Yt.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function b4e(e,t){for(var n=t,i=n+1,r=e.length;i<r;n+=1,i+=1)e[n]=e[i];e.pop()}function M0(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}function _4e(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function cD(){throw new Error("setTimeout has not been defined")}function lD(){throw new Error("clearTimeout has not been defined")}var Jc=cD,Qc=lD;typeof cd.setTimeout=="function"&&(Jc=setTimeout),typeof cd.clearTimeout=="function"&&(Qc=clearTimeout);function uD(e){if(Jc===setTimeout)return setTimeout(e,0);if((Jc===cD||!Jc)&&setTimeout)return Jc=setTimeout,setTimeout(e,0);try{return Jc(e,0)}catch{try{return Jc.call(null,e,0)}catch{return Jc.call(this,e,0)}}}function v4e(e){if(Qc===clearTimeout)return clearTimeout(e);if((Qc===lD||!Qc)&&clearTimeout)return Qc=clearTimeout,clearTimeout(e);try{return Qc(e)}catch{try{return Qc.call(null,e)}catch{return Qc.call(this,e)}}}var Ya=[],ld=!1,ou,h1=-1;function w4e(){!ld||!ou||(ld=!1,ou.length?Ya=ou.concat(Ya):h1=-1,Ya.length&&hD())}function hD(){if(!ld){var e=uD(w4e);ld=!0;for(var t=Ya.length;t;){for(ou=Ya,Ya=[];++h1<t;)ou&&ou[h1].run();h1=-1,t=Ya.length}ou=null,ld=!1,v4e(e)}}function Do(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ya.push(new dD(e,t)),Ya.length===1&&!ld&&uD(hD)}function dD(e,t){this.fun=e,this.array=t}dD.prototype.run=function(){this.fun.apply(null,this.array)};var x4e={},L0=cd.performance||{};L0.now||L0.mozNow||L0.msNow||L0.oNow||L0.webkitNow;var d1={env:x4e},NT;typeof Object.create=="function"?NT=function(t,n){t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:NT=function(t,n){t.super_=n;var i=function(){};i.prototype=n.prototype,t.prototype=new i,t.prototype.constructor=t};var ud=NT,S4e=/%[sdj%]/g;function E4e(e){if(!UT(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(qc(arguments[n]));return t.join(" ")}for(var n=1,i=arguments,r=i.length,o=String(e).replace(S4e,function(a){if(a==="%%")return"%";if(n>=r)return a;switch(a){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch{return"[Circular]"}default:return a}}),s=i[n];n<r;s=i[++n])DT(s)||!P0(s)?o+=" "+s:o+=" "+qc(s);return o}function fD(e,t){if($c(cd.process))return function(){return fD(e,t).apply(this,arguments)};if(d1.noDeprecation===!0)return e;var n=!1;function i(){if(!n){if(d1.throwDeprecation)throw new Error(t);d1.traceDeprecation?console.trace(t):console.error(t),n=!0}return e.apply(this,arguments)}return i}var f1={},kT;function T4e(e){if($c(kT)&&(kT=d1.env.NODE_DEBUG||""),e=e.toUpperCase(),!f1[e])if(new RegExp("\\b"+e+"\\b","i").test(kT)){var t=0;f1[e]=function(){var n=E4e.apply(null,arguments);console.error("%s %d: %s",e,t,n)}}else f1[e]=function(){};return f1[e]}function qc(e,t){var n={seen:[],stylize:R4e};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),pD(t)?n.showHidden=t:t&&V4e(n,t),$c(n.showHidden)&&(n.showHidden=!1),$c(n.depth)&&(n.depth=2),$c(n.colors)&&(n.colors=!1),$c(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=C4e),p1(n,e,n.depth)}qc.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},qc.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function C4e(e,t){var n=qc.styles[t];return n?"\x1B["+qc.colors[n][0]+"m"+e+"\x1B["+qc.colors[n][1]+"m":e}function R4e(e,t){return e}function I4e(e){var t={};return e.forEach(function(n,i){t[n]=!0}),t}function p1(e,t,n){if(e.customInspect&&t&&YT(t.inspect)&&t.inspect!==qc&&!(t.constructor&&t.constructor.prototype===t)){var i=t.inspect(n,e);return UT(i)||(i=p1(e,i,n)),i}var r=M4e(e,t);if(r)return r;var o=Object.keys(t),s=I4e(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),BT(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return XT(t);if(o.length===0){if(YT(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(WT(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(mD(t))return e.stylize(Date.prototype.toString.call(t),"date");if(BT(t))return XT(t)}var c="",l=!1,u=["{","}"];if(O4e(t)&&(l=!0,u=["[","]"]),YT(t)){var h=t.name?": "+t.name:"";c=" [Function"+h+"]"}if(WT(t)&&(c=" "+RegExp.prototype.toString.call(t)),mD(t)&&(c=" "+Date.prototype.toUTCString.call(t)),BT(t)&&(c=" "+XT(t)),o.length===0&&(!l||t.length==0))return u[0]+c+u[1];if(n<0)return WT(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var d;return l?d=L4e(e,t,n,s,o):d=o.map(function(f){return ZT(e,t,n,s,f,l)}),e.seen.pop(),P4e(d,c,u)}function M4e(e,t){if($c(t))return e.stylize("undefined","undefined");if(UT(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(G4e(t))return e.stylize(""+t,"number");if(pD(t))return e.stylize(""+t,"boolean");if(DT(t))return e.stylize("null","null")}function XT(e){return"["+Error.prototype.toString.call(e)+"]"}function L4e(e,t,n,i,r){for(var o=[],s=0,a=t.length;s<a;++s)gD(t,String(s))?o.push(ZT(e,t,n,i,String(s),!0)):o.push("");return r.forEach(function(c){c.match(/^\d+$/)||o.push(ZT(e,t,n,i,c,!0))}),o}function ZT(e,t,n,i,r,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]},c.get?c.set?a=e.stylize("[Getter/Setter]","special"):a=e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),gD(i,r)||(s="["+r+"]"),a||(e.seen.indexOf(c.value)<0?(DT(n)?a=p1(e,c.value,null):a=p1(e,c.value,n-1),a.indexOf(`
6731
+ `,uniforms:{...Qr(u,["color","frustumLength","blackPoint","whitePoint","gamma"]),globeDepthTexture:()=>c?.()??d._depthTexture}});if(r){const f=aPe({prefix:e,outputType:s,useGlobeDepth:a,getGlobeDepthTexture:c,uniforms:{textureScale:t,...Qr(u,["frustumLength","normalExponent","depthExponent"])}}),p=new M.PostProcessStageComposite({name:`${e}_ambient_occlusion_generate_and_filter`,stages:[h,f]});return d.uniforms.ambientOcclusionTexture=p.name,new M.PostProcessStageComposite({name:`${e}_ambient_occlusion`,stages:[p,d],inputPreviousStageTexture:!1,uniforms:fE([{stage:h,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:f,uniforms:["frustumLength","normalExponent","depthExponent"]},{stage:d,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}else return d.uniforms.ambientOcclusionTexture=h.name,new M.PostProcessStageComposite({name:`${e}_ambient_occlusion`,stages:[h,d],inputPreviousStageTexture:!1,uniforms:fE([{stage:h,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:d,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}const mPe=({enabled:e=!0,textureScale:t,directions:n,steps:i,denoise:r,accurateNormalReconstruction:o,outputType:s,useGlobeDepth:a,...c})=>{const{viewer:l}=ei(),u=l?.scene,h=mF({owner:u?.postProcessStages,keys:[t,i,n,r,o,s,a],create:()=>{const d=pPe({textureScale:t,steps:i,directions:n,denoise:r,accurateNormalReconstruction:o,outputType:s,useGlobeDepth:a,getGlobeDepthTexture:()=>u.context.uniformState.globeDepthTexture,uniforms:c});return d.enabled=e,d},transferOwnership:(d,f)=>(f?.add(d),()=>{f?.remove(d)})});return h.enabled=e,Object.assign(h.uniforms,c),u?.requestRender(),Gl(()=>{const d=u?.camera.frustum;if(d instanceof M.PerspectiveFrustum&&d.fovy!==void 0&&d.aspectRatio!==void 0){const f=1/Math.tan(d.fovy/2);h.uniforms.focalLength.x=f*d.aspectRatio,h.uniforms.focalLength.y=f}}),null},gPe=e=>{const t=ei(),[n,i]=R.useState(!1);return Gl(()=>{const r=t.scene;i(!r?.globe.depthTestAgainstTerrain);const{globeHeight:o}=r;if(!r||o==null)return;const s=r.camera.positionCartographic.height-o,a=r?.camera.frustum;a instanceof M.PerspectiveFrustum&&a.fov!==void 0&&(r.camera.frustum.near=M.Math.clamp(s-1,1,5)/Math.tan(a.fov/2))}),ce.jsx(mPe,{...e,useGlobeDepth:n})};var TN=(e=>(e[e.Occlusion=1]="Occlusion",e[e.Normal=2]="Normal",e[e.Depth=3]="Depth",e[e.Weight=4]="Weight",e[e.Shade=5]="Shade",e))(TN||{});const yPe={low:{directions:4,steps:4,textureScale:.5,maxRadius:30},medium:{directions:4,steps:8,textureScale:.5,maxRadius:40},high:{directions:8,steps:8,textureScale:1,maxRadius:40},extreme:{directions:16,steps:16,textureScale:1,maxRadius:40}},bPe="#00bebe",d0="#3B3CD0",_Pe="#FF9900",vPe="#3B3CD0";let Jl,wPe,xPe,Ql;const f0=({position:e,clampToGround:t=!1,index:n,isEditing:i,isSelected:r,isAddingPoint:o,isExtrudedControlPoint:s,handleControlPointMouseEvent:a})=>{const c=R.useRef(e);c.current=e;const l=Wo(()=>new wo((f,p)=>"getValue"in c.current?c.current.getValue(f,p):c.current,!1)),u=R.useMemo(()=>({position:l,billboard:{image:i?o?CPe():r?TPe():EPe():SPe(),width:i?16:8,height:i?16:8,heightReference:t?vl.CLAMP_TO_GROUND:vl.NONE,disableDepthTestDistance:1/0}}),[t,l,o,i,r]),h=R.useCallback(()=>{a?.(n,!!s,"mousedown")},[n,s,a]),d=R.useCallback(()=>{a?.(n,!!s,"click")},[n,s,a]);return ce.jsx(uc,{...u,onMouseDown:h,onClick:d})};function SPe(){if(Jl!=null)return Jl;Jl=document.createElement("canvas"),Jl.width=16,Jl.height=16;const e=Jl.getContext("2d");return Vn(e!=null),e.fillStyle="white",e.fillRect(3,3,10,10),e.strokeStyle="black",e.lineWidth=2,e.strokeRect(3,3,10,10),Jl}function EPe(){return CN(wPe,{size:32,color:"white",strokeColor:d0})}function TPe(){return CN(xPe,{size:32,color:"white",strokeColor:_Pe})}function CPe(){if(Ql!=null)return Ql;Ql=document.createElement("canvas"),Ql.width=32,Ql.height=32;const e=Ql.getContext("2d");return Vn(e!=null),e.beginPath(),e.arc(16,16,12,0,2*Math.PI),e.fillStyle="white",e.fill(),e.strokeStyle=vPe,e.lineWidth=4,e.stroke(),e.beginPath(),e.moveTo(16,8),e.lineTo(16,24),e.stroke(),e.moveTo(8,16),e.lineTo(24,16),e.stroke(),Ql}function CN(e,t){if(e!=null)return e;e=document.createElement("canvas"),e.width=t.size,e.height=t.size;const n=e.getContext("2d");return Vn(n!=null),n.beginPath(),n.arc(t.size/2,t.size/2,t.size/2-4,0,2*Math.PI),n.fillStyle=t.color,n.fill(),n.strokeStyle=t.strokeColor,n.lineWidth=4,n.stroke(),e}function RPe(e,t){if(typeof e=="function")return e(t),()=>{e(null)};if(e!=null)return e.current=t,()=>{e.current=null}}const p0=R.memo(R.forwardRef(({entities:e,...t},n)=>{const{viewer:i}=ei(),r=i?.scene,o=i?.entities,s=e??o,[a,c]=R.useState(()=>new io(t));return R.useEffect(()=>{c(new io(t))},[t.id]),R.useEffect(()=>(s?.add(a),()=>{s?.remove(a),r?.requestRender()}),[r,s,a]),R.useEffect(()=>RPe(n,a),[n,a]),Object.assign(a,Ka(t,"id")),r?.requestRender(),null})),IPe={padding:"5px",color:"#fff",backgroundColor:"#000",borderRadius:"5px",lineHeight:1},RN=({children:e})=>ce.jsx("div",{style:IPe,children:e}),IN=R.createContext({});function MN(e){const t=R.useRef(null);return t.current===null&&(t.current=e()),t.current}const MPe=typeof window<"u"?R.useLayoutEffect:R.useEffect,pE=R.createContext(null);function mE(e,t){e.indexOf(t)===-1&&e.push(t)}function Nb(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ia=(e,t,n)=>n>t?t:n<e?e:n;function gE(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Jh=()=>{},Ua=()=>{};typeof process<"u"&&process.env?.NODE_ENV!=="production"&&(Jh=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(gE(t,n))},Ua=(e,t,n)=>{if(!e)throw new Error(gE(t,n))});const Wa={},LN=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function PN(e){return typeof e=="object"&&e!==null}const ON=e=>/^0[^.\s]+$/u.test(e);function GN(e){let t;return()=>(t===void 0&&(t=e()),t)}const No=e=>e,LPe=(e,t)=>n=>t(e(n)),m0=(...e)=>e.reduce(LPe),g0=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i};class yE{constructor(){this.subscriptions=[]}add(t){return mE(this.subscriptions,t),()=>Nb(this.subscriptions,t)}notify(t,n,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](t,n,i);else for(let o=0;o<r;o++){const s=this.subscriptions[o];s&&s(t,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const ko=e=>e*1e3,Xo=e=>e/1e3;function VN(e,t){return t?e*(1e3/t):0}const FN=new Set;function bE(e,t,n){e||FN.has(t)||(console.warn(gE(t,n)),FN.add(t))}const AN=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,PPe=1e-7,OPe=12;function GPe(e,t,n,i,r){let o,s,a=0;do s=t+(n-t)/2,o=AN(s,i,r)-e,o>0?n=s:t=s;while(Math.abs(o)>PPe&&++a<OPe);return s}function y0(e,t,n,i){if(e===t&&n===i)return No;const r=o=>GPe(o,0,1,e,n);return o=>o===0||o===1?o:AN(r(o),t,i)}const zN=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,NN=e=>t=>1-e(1-t),kN=y0(.33,1.53,.69,.99),_E=NN(kN),XN=zN(_E),ZN=e=>(e*=2)<1?.5*_E(e):.5*(2-Math.pow(2,-10*(e-1))),vE=e=>1-Math.sin(Math.acos(e)),DN=NN(vE),UN=zN(vE),VPe=y0(.42,0,1,1),FPe=y0(0,0,.58,1),WN=y0(.42,0,.58,1),APe=e=>Array.isArray(e)&&typeof e[0]!="number",BN=e=>Array.isArray(e)&&typeof e[0]=="number",YN={linear:No,easeIn:VPe,easeInOut:WN,easeOut:FPe,circIn:vE,circInOut:UN,circOut:DN,backIn:_E,backInOut:XN,backOut:kN,anticipate:ZN},zPe=e=>typeof e=="string",HN=e=>{if(BN(e)){Ua(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,i,r]=e;return y0(t,n,i,r)}else if(zPe(e))return Ua(YN[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),YN[e];return e},kb=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function NPe(e,t){let n=new Set,i=new Set,r=!1,o=!1;const s=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(u){s.has(u)&&(l.schedule(u),e()),u(a)}const l={schedule:(u,h=!1,d=!1)=>{const p=d&&r?n:i;return h&&s.add(u),p.has(u)||p.add(u),u},cancel:u=>{i.delete(u),s.delete(u)},process:u=>{if(a=u,r){o=!0;return}r=!0,[n,i]=[i,n],n.forEach(c),n.clear(),r=!1,o&&(o=!1,l.process(u))}};return l}const kPe=40;function jN(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=kb.reduce((S,E)=>(S[E]=NPe(o),S),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:h,preRender:d,render:f,postRender:p}=s,m=()=>{const S=Wa.useManualTiming?r.timestamp:performance.now();n=!1,Wa.useManualTiming||(r.delta=i?1e3/60:Math.max(Math.min(S-r.timestamp,kPe),1)),r.timestamp=S,r.isProcessing=!0,a.process(r),c.process(r),l.process(r),u.process(r),h.process(r),d.process(r),f.process(r),p.process(r),r.isProcessing=!1,n&&t&&(i=!1,e(m))},y=()=>{n=!0,i=!0,r.isProcessing||e(m)};return{schedule:kb.reduce((S,E)=>{const C=s[E];return S[E]=(O,V=!1,A=!1)=>(n||y(),C.schedule(O,V,A)),S},{}),cancel:S=>{for(let E=0;E<kb.length;E++)s[kb[E]].cancel(S)},state:r,steps:s}}const{schedule:Tn,cancel:Bc,state:Xi,steps:wE}=jN(typeof requestAnimationFrame<"u"?requestAnimationFrame:No,!0);let Xb;function XPe(){Xb=void 0}const wr={now:()=>(Xb===void 0&&wr.set(Xi.isProcessing||Wa.useManualTiming?Xi.timestamp:performance.now()),Xb),set:e=>{Xb=e,queueMicrotask(XPe)}},KN=e=>t=>typeof t=="string"&&t.startsWith(e),JN=KN("--"),ZPe=KN("var(--"),xE=e=>ZPe(e)?DPe.test(e.split("/*")[0].trim()):!1,DPe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function QN(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Qh={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},b0={...Qh,transform:e=>ia(0,1,e)},Zb={...Qh,default:1},_0=e=>Math.round(e*1e5)/1e5,SE=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function UPe(e){return e==null}const WPe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,EE=(e,t)=>n=>!!(typeof n=="string"&&WPe.test(n)&&n.startsWith(e)||t&&!UPe(n)&&Object.prototype.hasOwnProperty.call(n,t)),qN=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,o,s,a]=i.match(SE);return{[e]:parseFloat(r),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},BPe=e=>ia(0,255,e),TE={...Qh,transform:e=>Math.round(BPe(e))},ql={test:EE("rgb","red"),parse:qN("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+TE.transform(e)+", "+TE.transform(t)+", "+TE.transform(n)+", "+_0(b0.transform(i))+")"};function YPe(e){let t="",n="",i="",r="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),i=e.substring(5,7),r=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),i=e.substring(3,4),r=e.substring(4,5),t+=t,n+=n,i+=i,r+=r),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const CE={test:EE("#"),parse:YPe,transform:ql.transform},v0=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Yc=v0("deg"),ra=v0("%"),ct=v0("px"),HPe=v0("vh"),jPe=v0("vw"),$N={...ra,parse:e=>ra.parse(e)/100,transform:e=>ra.transform(e*100)},qh={test:EE("hsl","hue"),parse:qN("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+ra.transform(_0(t))+", "+ra.transform(_0(n))+", "+_0(b0.transform(i))+")"},hi={test:e=>ql.test(e)||CE.test(e)||qh.test(e),parse:e=>ql.test(e)?ql.parse(e):qh.test(e)?qh.parse(e):CE.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?ql.transform(e):qh.transform(e),getAnimatableNone:e=>{const t=hi.parse(e);return t.alpha=0,hi.transform(t)}},KPe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function JPe(e){return isNaN(e)&&typeof e=="string"&&(e.match(SE)?.length||0)+(e.match(KPe)?.length||0)>0}const ek="number",tk="color",QPe="var",qPe="var(",nk="${}",$Pe=/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 w0(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let o=0;const a=t.replace($Pe,c=>(hi.test(c)?(i.color.push(o),r.push(tk),n.push(hi.parse(c))):c.startsWith(qPe)?(i.var.push(o),r.push(QPe),n.push(c)):(i.number.push(o),r.push(ek),n.push(parseFloat(c))),++o,nk)).split(nk);return{values:n,split:a,indexes:i,types:r}}function ik(e){return w0(e).values}function rk(e){const{split:t,types:n}=w0(e),i=t.length;return r=>{let o="";for(let s=0;s<i;s++)if(o+=t[s],r[s]!==void 0){const a=n[s];a===ek?o+=_0(r[s]):a===tk?o+=hi.transform(r[s]):o+=r[s]}return o}}const eOe=e=>typeof e=="number"?0:hi.test(e)?hi.getAnimatableNone(e):e;function tOe(e){const t=ik(e);return rk(e)(t.map(eOe))}const ys={test:JPe,parse:ik,createTransformer:rk,getAnimatableNone:tOe};function RE(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function nOe({hue:e,saturation:t,lightness:n,alpha:i}){e/=360,t/=100,n/=100;let r=0,o=0,s=0;if(!t)r=o=s=n;else{const a=n<.5?n*(1+t):n+t-n*t,c=2*n-a;r=RE(c,a,e+1/3),o=RE(c,a,e),s=RE(c,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:i}}function Db(e,t){return n=>n>0?t:e}const Dn=(e,t,n)=>e+(t-e)*n,IE=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},iOe=[CE,ql,qh],rOe=e=>iOe.find(t=>t.test(e));function ok(e){const t=rOe(e);if(Jh(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let n=t.parse(e);return t===qh&&(n=nOe(n)),n}const sk=(e,t)=>{const n=ok(e),i=ok(t);if(!n||!i)return Db(e,t);const r={...n};return o=>(r.red=IE(n.red,i.red,o),r.green=IE(n.green,i.green,o),r.blue=IE(n.blue,i.blue,o),r.alpha=Dn(n.alpha,i.alpha,o),ql.transform(r))},ME=new Set(["none","hidden"]);function oOe(e,t){return ME.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function sOe(e,t){return n=>Dn(e,t,n)}function LE(e){return typeof e=="number"?sOe:typeof e=="string"?xE(e)?Db:hi.test(e)?sk:lOe:Array.isArray(e)?ak:typeof e=="object"?hi.test(e)?sk:aOe:Db}function ak(e,t){const n=[...e],i=n.length,r=e.map((o,s)=>LE(o)(o,t[s]));return o=>{for(let s=0;s<i;s++)n[s]=r[s](o);return n}}function aOe(e,t){const n={...e,...t},i={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(i[r]=LE(e[r])(e[r],t[r]));return r=>{for(const o in i)n[o]=i[o](r);return n}}function cOe(e,t){const n=[],i={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const o=t.types[r],s=e.indexes[o][i[o]],a=e.values[s]??0;n[r]=a,i[o]++}return n}const lOe=(e,t)=>{const n=ys.createTransformer(t),i=w0(e),r=w0(t);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?ME.has(e)&&!r.values.length||ME.has(t)&&!i.values.length?oOe(e,t):m0(ak(cOe(i,r),r.values),n):(Jh(!0,`Complex values '${e}' and '${t}' 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.`,"complex-values-different"),Db(e,t))};function ck(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?Dn(e,t,n):LE(e)(e,t)}const uOe=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Tn.update(t,n),stop:()=>Bc(t),now:()=>Xi.isProcessing?Xi.timestamp:wr.now()}},lk=(e,t,n=10)=>{let i="";const r=Math.max(Math.round(t/n),2);for(let o=0;o<r;o++)i+=Math.round(e(o/(r-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},Ub=2e4;function PE(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<Ub;)t+=n,i=e.next(t);return t>=Ub?1/0:t}function hOe(e,t=100,n){const i=n({...e,keyframes:[0,t]}),r=Math.min(PE(i),Ub);return{type:"keyframes",ease:o=>i.next(r*o).value/t,duration:Xo(r)}}const dOe=5;function uk(e,t,n){const i=Math.max(t-dOe,0);return VN(n-e(i),t-i)}const Un={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},OE=.001;function fOe({duration:e=Un.duration,bounce:t=Un.bounce,velocity:n=Un.velocity,mass:i=Un.mass}){let r,o;Jh(e<=ko(Un.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=ia(Un.minDamping,Un.maxDamping,s),e=ia(Un.minDuration,Un.maxDuration,Xo(e)),s<1?(r=l=>{const u=l*s,h=u*e,d=u-n,f=GE(l,s),p=Math.exp(-h);return OE-d/f*p},o=l=>{const h=l*s*e,d=h*n+n,f=Math.pow(s,2)*Math.pow(l,2)*e,p=Math.exp(-h),m=GE(Math.pow(l,2),s);return(-r(l)+OE>0?-1:1)*((d-f)*p)/m}):(r=l=>{const u=Math.exp(-l*e),h=(l-n)*e+1;return-OE+u*h},o=l=>{const u=Math.exp(-l*e),h=(n-l)*(e*e);return u*h});const a=5/e,c=mOe(r,o,a);if(e=ko(e),isNaN(c))return{stiffness:Un.stiffness,damping:Un.damping,duration:e};{const l=Math.pow(c,2)*i;return{stiffness:l,damping:s*2*Math.sqrt(i*l),duration:e}}}const pOe=12;function mOe(e,t,n){let i=n;for(let r=1;r<pOe;r++)i=i-e(i)/t(i);return i}function GE(e,t){return e*Math.sqrt(1-t*t)}const gOe=["duration","bounce"],yOe=["stiffness","damping","mass"];function hk(e,t){return t.some(n=>e[n]!==void 0)}function bOe(e){let t={velocity:Un.velocity,stiffness:Un.stiffness,damping:Un.damping,mass:Un.mass,isResolvedFromDuration:!1,...e};if(!hk(e,yOe)&&hk(e,gOe))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,o=2*ia(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Un.mass,stiffness:r,damping:o}}else{const n=fOe({...e,velocity:0});t={...t,...n,mass:Un.mass},t.isResolvedFromDuration=!0}return t}function Wb(e=Un.visualDuration,t=Un.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:i,restDelta:r}=n;const o=n.keyframes[0],s=n.keyframes[n.keyframes.length-1],a={done:!1,value:o},{stiffness:c,damping:l,mass:u,duration:h,velocity:d,isResolvedFromDuration:f}=bOe({...n,velocity:-Xo(n.velocity||0)}),p=d||0,m=l/(2*Math.sqrt(c*u)),y=s-o,g=Xo(Math.sqrt(c/u)),v=Math.abs(y)<5;i||(i=v?Un.restSpeed.granular:Un.restSpeed.default),r||(r=v?Un.restDelta.granular:Un.restDelta.default);let S;if(m<1){const C=GE(g,m);S=O=>{const V=Math.exp(-m*g*O);return s-V*((p+m*g*y)/C*Math.sin(C*O)+y*Math.cos(C*O))}}else if(m===1)S=C=>s-Math.exp(-g*C)*(y+(p+g*y)*C);else{const C=g*Math.sqrt(m*m-1);S=O=>{const V=Math.exp(-m*g*O),A=Math.min(C*O,300);return s-V*((p+m*g*y)*Math.sinh(A)+C*y*Math.cosh(A))/C}}const E={calculatedDuration:f&&h||null,next:C=>{const O=S(C);if(f)a.done=C>=h;else{let V=C===0?p:0;m<1&&(V=C===0?ko(p):uk(S,C,O));const A=Math.abs(V)<=i,G=Math.abs(s-O)<=r;a.done=A&&G}return a.value=a.done?s:O,a},toString:()=>{const C=Math.min(PE(E),Ub),O=lk(V=>E.next(C*V).value,C,30);return C+"ms "+O},toTransition:()=>{}};return E}Wb.applyToOptions=e=>{const t=hOe(e,100,Wb);return e.ease=t.ease,e.duration=ko(t.duration),e.type="keyframes",e};function VE({keyframes:e,velocity:t=0,power:n=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:s,min:a,max:c,restDelta:l=.5,restSpeed:u}){const h=e[0],d={done:!1,value:h},f=A=>a!==void 0&&A<a||c!==void 0&&A>c,p=A=>a===void 0?c:c===void 0||Math.abs(a-A)<Math.abs(c-A)?a:c;let m=n*t;const y=h+m,g=s===void 0?y:s(y);g!==y&&(m=g-h);const v=A=>-m*Math.exp(-A/i),S=A=>g+v(A),E=A=>{const G=v(A),N=S(A);d.done=Math.abs(G)<=l,d.value=d.done?g:N};let C,O;const V=A=>{f(d.value)&&(C=A,O=Wb({keyframes:[d.value,p(d.value)],velocity:uk(S,A,d.value),damping:r,stiffness:o,restDelta:l,restSpeed:u}))};return V(0),{calculatedDuration:null,next:A=>{let G=!1;return!O&&C===void 0&&(G=!0,E(A),V(A)),C!==void 0&&A>=C?O.next(A-C):(!G&&E(A),d)}}}function _Oe(e,t,n){const i=[],r=n||Wa.mix||ck,o=e.length-1;for(let s=0;s<o;s++){let a=r(e[s],e[s+1]);if(t){const c=Array.isArray(t)?t[s]||No:t;a=m0(c,a)}i.push(a)}return i}function vOe(e,t,{clamp:n=!0,ease:i,mixer:r}={}){const o=e.length;if(Ua(o===t.length,"Both input and output ranges must be the same length","range-length"),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const s=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const a=_Oe(t,i,r),c=a.length,l=u=>{if(s&&u<e[0])return t[0];let h=0;if(c>1)for(;h<e.length-2&&!(u<e[h+1]);h++);const d=g0(e[h],e[h+1],u);return a[h](d)};return n?u=>l(ia(e[0],e[o-1],u)):l}function wOe(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=g0(0,t,i);e.push(Dn(n,1,r))}}function xOe(e){const t=[0];return wOe(t,e.length-1),t}function SOe(e,t){return e.map(n=>n*t)}function EOe(e,t){return e.map(()=>t||WN).splice(0,e.length-1)}function $h({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=APe(i)?i.map(HN):HN(i),o={done:!1,value:t[0]},s=SOe(n&&n.length===t.length?n:xOe(t),e),a=vOe(s,t,{ease:Array.isArray(r)?r:EOe(t,r)});return{calculatedDuration:e,next:c=>(o.value=a(c),o.done=c>=e,o)}}const TOe=e=>e!==null;function FE(e,{repeat:t,repeatType:n="loop"},i,r=1){const o=e.filter(TOe),a=r<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!a||i===void 0?o[a]:i}const COe={decay:VE,inertia:VE,tween:$h,keyframes:$h,spring:Wb};function dk(e){typeof e.type=="string"&&(e.type=COe[e.type])}class AE{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const ROe=e=>e/100;class zE extends AE{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==wr.now()&&this.tick(wr.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;dk(t);const{type:n=$h,repeat:i=0,repeatDelay:r=0,repeatType:o,velocity:s=0}=t;let{keyframes:a}=t;const c=n||$h;process.env.NODE_ENV!=="production"&&c!==$h&&Ua(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==$h&&typeof a[0]!="number"&&(this.mixKeyframes=m0(ROe,ck(a[0],a[1])),a=[0,100]);const l=c({...t,keyframes:a});o==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-s})),l.calculatedDuration===null&&(l.calculatedDuration=PE(l));const{calculatedDuration:u}=l;this.calculatedDuration=u,this.resolvedDuration=u+r,this.totalDuration=this.resolvedDuration*(i+1)-r,this.generator=l}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:i,totalDuration:r,mixKeyframes:o,mirroredGenerator:s,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return i.next(0);const{delay:l=0,keyframes:u,repeat:h,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-r/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const g=this.currentTime-l*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=r);let S=this.currentTime,E=i;if(h){const A=Math.min(this.currentTime,r)/a;let G=Math.floor(A),N=A%1;!N&&A>=1&&(N=1),N===1&&G--,G=Math.min(G,h+1),G%2&&(d==="reverse"?(N=1-N,f&&(N-=f/a)):d==="mirror"&&(E=s)),S=ia(0,1,N)*a}const C=v?{done:!1,value:u[0]}:E.next(S);o&&!v&&(C.value=o(C.value));let{done:O}=C;!v&&c!==null&&(O=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const V=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return V&&p!==VE&&(C.value=FE(u,this.options,y,this.speed)),m&&m(C.value),V&&this.finish(),C}then(t,n){return this.finished.then(t,n)}get duration(){return Xo(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Xo(t)}get time(){return Xo(this.currentTime)}set time(t){t=ko(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(wr.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Xo(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=uOe,startTime:n}=this.options;this.driver||(this.driver=t(r=>this.tick(r))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(wr.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),t.observe(this)}}function IOe(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const $l=e=>e*180/Math.PI,NE=e=>{const t=$l(Math.atan2(e[1],e[0]));return kE(t)},MOe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:NE,rotateZ:NE,skewX:e=>$l(Math.atan(e[1])),skewY:e=>$l(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},kE=e=>(e=e%360,e<0&&(e+=360),e),fk=NE,pk=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),mk=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),LOe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:pk,scaleY:mk,scale:e=>(pk(e)+mk(e))/2,rotateX:e=>kE($l(Math.atan2(e[6],e[5]))),rotateY:e=>kE($l(Math.atan2(-e[2],e[0]))),rotateZ:fk,rotate:fk,skewX:e=>$l(Math.atan(e[4])),skewY:e=>$l(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function XE(e){return e.includes("scale")?1:0}function ZE(e,t){if(!e||e==="none")return XE(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,r;if(n)i=LOe,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=MOe,r=a}if(!r)return XE(t);const o=i[t],s=r[1].split(",").map(OOe);return typeof o=="function"?o(s):s[o]}const POe=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return ZE(n,t)};function OOe(e){return parseFloat(e.trim())}const ed=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],td=new Set(ed),gk=e=>e===Qh||e===ct,GOe=new Set(["x","y","z"]),VOe=ed.filter(e=>!GOe.has(e));function FOe(e){const t=[];return VOe.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Hc={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>ZE(t,"x"),y:(e,{transform:t})=>ZE(t,"y")};Hc.translateX=Hc.x,Hc.translateY=Hc.y;const eu=new Set;let DE=!1,UE=!1,WE=!1;function yk(){if(UE){const e=Array.from(eu).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=FOe(i);r.length&&(n.set(i,r),i.render())}),e.forEach(i=>i.measureInitialState()),t.forEach(i=>{i.render();const r=n.get(i);r&&r.forEach(([o,s])=>{i.getValue(o)?.set(s)})}),e.forEach(i=>i.measureEndState()),e.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}UE=!1,DE=!1,eu.forEach(e=>e.complete(WE)),eu.clear()}function bk(){eu.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(UE=!0)})}function AOe(){WE=!0,bk(),yk(),WE=!1}class BE{constructor(t,n,i,r,o,s=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=i,this.motionValue=r,this.element=o,this.isAsync=s}scheduleResolve(){this.state="scheduled",this.isAsync?(eu.add(this),DE||(DE=!0,Tn.read(bk),Tn.resolveKeyframes(yk))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:i,motionValue:r}=this;if(t[0]===null){const o=r?.get(),s=t[t.length-1];if(o!==void 0)t[0]=o;else if(i&&n){const a=i.readValue(n,s);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=s),r&&o===void 0&&r.set(t[0])}IOe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),eu.delete(this)}cancel(){this.state==="scheduled"&&(eu.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const zOe=e=>e.startsWith("--");function _k(e,t,n){zOe(t)?e.style.setProperty(t,n):e.style[t]=n}const NOe={};function vk(e,t){const n=GN(e);return()=>NOe[t]??n()}const kOe=vk(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),wk=vk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),x0=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,xk={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:x0([0,.65,.55,1]),circOut:x0([.55,0,1,.45]),backIn:x0([.31,.01,.66,-.59]),backOut:x0([.33,1.53,.69,.99])};function Sk(e,t){if(e)return typeof e=="function"?wk()?lk(e,t):"ease-out":BN(e)?x0(e):Array.isArray(e)?e.map(n=>Sk(n,t)||xk.easeOut):xk[e]}function XOe(e,t,n,{delay:i=0,duration:r=300,repeat:o=0,repeatType:s="loop",ease:a="easeOut",times:c}={},l=void 0){const u={[t]:n};c&&(u.offset=c);const h=Sk(a,r);Array.isArray(h)&&(u.easing=h);const d={delay:i,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:o+1,direction:s==="reverse"?"alternate":"normal"};return l&&(d.pseudoElement=l),e.animate(u,d)}function Ek(e){return typeof e=="function"&&"applyToOptions"in e}function ZOe({type:e,...t}){return Ek(e)&&wk()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Tk extends AE{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:i,keyframes:r,pseudoElement:o,allowFlatten:s=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!o,this.allowFlatten=s,this.options=t,Ua(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const l=ZOe(t);this.animation=XOe(n,i,r,l,o),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=FE(r,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),_k(n,i,u),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){const t=this.options?.element;!this.isPseudoElement&&t?.isConnected&&this.animation.commitStyles?.()}get duration(){const t=this.animation.effect?.getComputedTiming?.().duration||0;return Xo(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Xo(t)}get time(){return Xo(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=ko(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:i,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,t&&kOe()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),No):r(this)}}const Ck={anticipate:ZN,backInOut:XN,circInOut:UN};function DOe(e){return e in Ck}function UOe(e){typeof e.ease=="string"&&DOe(e.ease)&&(e.ease=Ck[e.ease])}const YE=10;class WOe extends Tk{constructor(t){UOe(t),dk(t),super(t),t.startTime!==void 0&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:i,onComplete:r,element:o,...s}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const a=new zE({...s,autoplay:!1}),c=Math.max(YE,wr.now()-this.startTime),l=ia(0,YE,c-YE),u=a.sample(c).value,{name:h}=this.options;o&&h&&_k(o,h,u),n.setWithVelocity(a.sample(Math.max(0,c-l)).value,u,l),a.stop()}}const Rk=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ys.test(e)||e==="0")&&!e.startsWith("url("));function BOe(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function YOe(e,t,n,i){const r=e[0];if(r===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],s=Rk(r,t),a=Rk(o,t);return Jh(s===a,`You are trying to animate ${t} from "${r}" to "${o}". "${s?o:r}" is not an animatable value.`,"value-not-animatable"),!s||!a?!1:BOe(e)||(n==="spring"||Ek(n))&&i}function HE(e){e.duration=0,e.type="keyframes"}const HOe=new Set(["opacity","clipPath","filter","transform"]),jOe=GN(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function KOe(e){const{motionValue:t,name:n,repeatDelay:i,repeatType:r,damping:o,type:s}=e;if(!(t?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:l}=t.owner.getProps();return jOe()&&n&&HOe.has(n)&&(n!=="transform"||!l)&&!c&&!i&&r!=="mirror"&&o!==0&&s!=="inertia"}const JOe=40;class QOe extends AE{constructor({autoplay:t=!0,delay:n=0,type:i="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:s="loop",keyframes:a,name:c,motionValue:l,element:u,...h}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=wr.now();const d={autoplay:t,delay:n,type:i,repeat:r,repeatDelay:o,repeatType:s,name:c,motionValue:l,element:u,...h},f=u?.KeyframeResolver||BE;this.keyframeResolver=new f(a,(p,m,y)=>this.onKeyframesResolved(p,m,d,!y),c,l,u),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(t,n,i,r){this.keyframeResolver=void 0;const{name:o,type:s,velocity:a,delay:c,isHandoff:l,onUpdate:u}=i;this.resolvedAt=wr.now(),YOe(t,o,s,a)||((Wa.instantAnimations||!c)&&u?.(FE(t,i,n)),t[0]=t[t.length-1],HE(i),i.repeat=0);const d={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>JOe?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},f=!l&&KOe(d),p=d.motionValue?.owner?.current,m=f?new WOe({...d,element:p}):new zE(d);m.finished.then(()=>{this.notifyFinished()}).catch(No),this.pendingTimeline&&(this.stopTimeline=m.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),AOe()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}function Ik(e,t,n,i=0,r=1){const o=Array.from(e).sort((l,u)=>l.sortNodePosition(u)).indexOf(t),s=e.size,a=(s-1)*i;return typeof n=="function"?n(o,s):r===1?o*i:a-o*i}const qOe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function $Oe(e){const t=qOe.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}const eGe=4;function Mk(e,t,n=1){Ua(n<=eGe,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,r]=$Oe(e);if(!i)return;const o=window.getComputedStyle(t).getPropertyValue(i);if(o){const s=o.trim();return LN(s)?parseFloat(s):s}return xE(r)?Mk(r,t,n+1):r}const tGe={type:"spring",stiffness:500,damping:25,restSpeed:10},nGe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),iGe={type:"keyframes",duration:.8},rGe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},oGe=(e,{keyframes:t})=>t.length>2?iGe:td.has(e)?e.startsWith("scale")?nGe(t[1]):tGe:rGe,sGe=e=>e!==null;function aGe(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(sGe),o=t&&n!=="loop"&&t%2===1?0:r.length-1;return r[o]}function Lk(e,t){if(e?.inherit&&t){const{inherit:n,...i}=e;return{...t,...i}}return e}function jE(e,t){const n=e?.[t]??e?.default??e;return n!==e?Lk(n,e):n}function cGe({when:e,delay:t,delayChildren:n,staggerChildren:i,staggerDirection:r,repeat:o,repeatType:s,repeatDelay:a,from:c,elapsed:l,...u}){return!!Object.keys(u).length}const KE=(e,t,n,i={},r,o)=>s=>{const a=jE(i,e)||{},c=a.delay||i.delay||0;let{elapsed:l=0}=i;l=l-ko(c);const u={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-l,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{s(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:o?void 0:r};cGe(a)||Object.assign(u,oGe(e,u)),u.duration&&(u.duration=ko(u.duration)),u.repeatDelay&&(u.repeatDelay=ko(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(HE(u),u.delay===0&&(h=!0)),(Wa.instantAnimations||Wa.skipAnimations||r?.shouldSkipAnimations)&&(h=!0,HE(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!o&&t.get()!==void 0){const d=aGe(u.keyframes,a);if(d!==void 0){Tn.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new zE(u):new QOe(u)};function Pk(e){const t=[{},{}];return e?.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function JE(e,t,n,i){if(typeof t=="function"){const[r,o]=Pk(i);t=t(n!==void 0?n:e.custom,r,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[r,o]=Pk(i);t=t(n!==void 0?n:e.custom,r,o)}return t}function nd(e,t,n){const i=e.getProps();return JE(i,t,n!==void 0?n:i.custom,e)}const Ok=new Set(["width","height","top","left","right","bottom",...ed]),Gk=30,lGe=e=>!isNaN(parseFloat(e));class uGe{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const r=wr.now();if(this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=wr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=lGe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&bE(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new yE);const i=this.events[t].add(n);return t==="change"?()=>{i(),Tn.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-i}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=wr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Gk)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Gk);return VN(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),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.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function tu(e,t){return new uGe(e,t)}const QE=e=>Array.isArray(e);function hGe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,tu(n))}function dGe(e){return QE(e)?e[e.length-1]||0:e}function fGe(e,t){const n=nd(e,t);let{transitionEnd:i={},transition:r={},...o}=n||{};o={...o,...i};for(const s in o){const a=dGe(o[s]);hGe(e,s,a)}}const ir=e=>!!(e&&e.getVelocity);function pGe(e){return!!(ir(e)&&e.add)}function qE(e,t){const n=e.getValue("willChange");if(pGe(n))return n.add(t);if(!n&&Wa.WillChange){const i=new Wa.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function $E(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Vk="data-"+$E("framerAppearId");function Fk(e){return e.props[Vk]}function mGe({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function Ak(e,t,{delay:n=0,transitionOverride:i,type:r}={}){let{transition:o,transitionEnd:s,...a}=t;const c=e.getDefaultTransition();o=o?Lk(o,c):c;const l=o?.reduceMotion;i&&(o=i);const u=[],h=r&&e.animationState&&e.animationState.getState()[r];for(const d in a){const f=e.getValue(d,e.latestValues[d]??null),p=a[d];if(p===void 0||h&&mGe(h,d))continue;const m={delay:n,...jE(o||{},d)},y=f.get();if(y!==void 0&&!f.isAnimating&&!Array.isArray(p)&&p===y&&!m.velocity)continue;let g=!1;if(window.MotionHandoffAnimation){const E=Fk(e);if(E){const C=window.MotionHandoffAnimation(E,d,Tn);C!==null&&(m.startTime=C,g=!0)}}qE(e,d);const v=l??e.shouldReduceMotion;f.start(KE(d,f,p,v&&Ok.has(d)?{type:!1}:m,e,g));const S=f.animation;S&&u.push(S)}if(s){const d=()=>Tn.update(()=>{s&&fGe(e,s)});u.length?Promise.all(u).then(d):d()}return u}function eT(e,t,n={}){const i=nd(e,t,n.type==="exit"?e.presenceContext?.custom:void 0);let{transition:r=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(r=n.transitionOverride);const o=i?()=>Promise.all(Ak(e,i,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:h}=r;return gGe(e,t,c,l,u,h,n)}:()=>Promise.resolve(),{when:a}=r;if(a){const[c,l]=a==="beforeChildren"?[o,s]:[s,o];return c().then(()=>l())}else return Promise.all([o(),s(n.delay)])}function gGe(e,t,n=0,i=0,r=0,o=1,s){const a=[];for(const c of e.variantChildren)c.notify("AnimationStart",t),a.push(eT(c,t,{...s,delay:n+(typeof i=="function"?0:i)+Ik(e.variantChildren,c,i,r,o)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function yGe(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(o=>eT(e,o,n));i=Promise.all(r)}else if(typeof t=="string")i=eT(e,t,n);else{const r=typeof t=="function"?nd(e,t,n.custom):t;i=Promise.all(Ak(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const bGe={test:e=>e==="auto",parse:e=>e},zk=e=>t=>t.test(e),Nk=[Qh,ct,ra,Yc,jPe,HPe,bGe],kk=e=>Nk.find(zk(e));function _Ge(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||ON(e):!0}const vGe=new Set(["brightness","contrast","saturate","opacity"]);function wGe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(SE)||[];if(!i)return e;const r=n.replace(i,"");let o=vGe.has(t)?1:0;return i!==n&&(o*=100),t+"("+o+r+")"}const xGe=/\b([a-z-]*)\(.*?\)/gu,tT={...ys,getAnimatableNone:e=>{const t=e.match(xGe);return t?t.map(wGe).join(" "):e}},nT={...ys,getAnimatableNone:e=>{const t=ys.parse(e);return ys.createTransformer(e)(t.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},Xk={...Qh,transform:Math.round},iT={borderWidth:ct,borderTopWidth:ct,borderRightWidth:ct,borderBottomWidth:ct,borderLeftWidth:ct,borderRadius:ct,borderTopLeftRadius:ct,borderTopRightRadius:ct,borderBottomRightRadius:ct,borderBottomLeftRadius:ct,width:ct,maxWidth:ct,height:ct,maxHeight:ct,top:ct,right:ct,bottom:ct,left:ct,inset:ct,insetBlock:ct,insetBlockStart:ct,insetBlockEnd:ct,insetInline:ct,insetInlineStart:ct,insetInlineEnd:ct,padding:ct,paddingTop:ct,paddingRight:ct,paddingBottom:ct,paddingLeft:ct,paddingBlock:ct,paddingBlockStart:ct,paddingBlockEnd:ct,paddingInline:ct,paddingInlineStart:ct,paddingInlineEnd:ct,margin:ct,marginTop:ct,marginRight:ct,marginBottom:ct,marginLeft:ct,marginBlock:ct,marginBlockStart:ct,marginBlockEnd:ct,marginInline:ct,marginInlineStart:ct,marginInlineEnd:ct,fontSize:ct,backgroundPositionX:ct,backgroundPositionY:ct,...{rotate:Yc,rotateX:Yc,rotateY:Yc,rotateZ:Yc,scale:Zb,scaleX:Zb,scaleY:Zb,scaleZ:Zb,skew:Yc,skewX:Yc,skewY:Yc,distance:ct,translateX:ct,translateY:ct,translateZ:ct,x:ct,y:ct,z:ct,perspective:ct,transformPerspective:ct,opacity:b0,originX:$N,originY:$N,originZ:ct},zIndex:Xk,fillOpacity:b0,strokeOpacity:b0,numOctaves:Xk},SGe={...iT,color:hi,backgroundColor:hi,outlineColor:hi,fill:hi,stroke:hi,borderColor:hi,borderTopColor:hi,borderRightColor:hi,borderBottomColor:hi,borderLeftColor:hi,filter:tT,WebkitFilter:tT,mask:nT,WebkitMask:nT},Zk=e=>SGe[e],EGe=new Set([tT,nT]);function Dk(e,t){let n=Zk(e);return EGe.has(n)||(n=ys),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const TGe=new Set(["auto","none","0"]);function CGe(e,t,n){let i=0,r;for(;i<e.length&&!r;){const o=e[i];typeof o=="string"&&!TGe.has(o)&&w0(o).values.length&&(r=e[i]),i++}if(r&&n)for(const o of t)e[o]=Dk(n,r)}class RGe extends BE{constructor(t,n,i,r,o){super(t,n,i,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let u=0;u<t.length;u++){let h=t[u];if(typeof h=="string"&&(h=h.trim(),xE(h))){const d=Mk(h,n.current);d!==void 0&&(t[u]=d),u===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Ok.has(i)||t.length!==2)return;const[r,o]=t,s=kk(r),a=kk(o),c=QN(r),l=QN(o);if(c!==l&&Hc[i]){this.needsMeasurement=!0;return}if(s!==a)if(gk(s)&&gk(a))for(let u=0;u<t.length;u++){const h=t[u];typeof h=="string"&&(t[u]=parseFloat(h))}else Hc[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,i=[];for(let r=0;r<t.length;r++)(t[r]===null||_Ge(t[r]))&&i.push(r);i.length&&CGe(t,i,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:i}=this;if(!t||!t.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Hc[i](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&t.getValue(i,r).jump(r,!1)}measureEndState(){const{element:t,name:n,unresolvedKeyframes:i}=this;if(!t||!t.current)return;const r=t.getValue(n);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,s=i[o];i[o]=Hc[n](t.measureViewportBox(),window.getComputedStyle(t.current)),s!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=s),this.removedTransforms?.length&&this.removedTransforms.forEach(([a,c])=>{t.getValue(a).set(c)}),this.resolveNoneKeyframes()}}const IGe=new Set(["opacity","clipPath","filter","transform"]);function Uk(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;const r=n?.[e]??i.querySelectorAll(e);return r?Array.from(r):[]}return Array.from(e).filter(i=>i!=null)}const Wk=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function MGe(e){return PN(e)&&"offsetHeight"in e}const{schedule:rT}=jN(queueMicrotask,!1),bs={x:!1,y:!1};function Bk(){return bs.x||bs.y}function LGe(e){return e==="x"||e==="y"?bs[e]?null:(bs[e]=!0,()=>{bs[e]=!1}):bs.x||bs.y?null:(bs.x=bs.y=!0,()=>{bs.x=bs.y=!1})}function Yk(e,t){const n=Uk(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function PGe(e){return!(e.pointerType==="touch"||Bk())}function OGe(e,t,n={}){const[i,r,o]=Yk(e,n);return i.forEach(s=>{let a=!1,c=!1,l;const u=()=>{s.removeEventListener("pointerleave",p)},h=y=>{l&&(l(y),l=void 0),u()},d=y=>{a=!1,window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",d),c&&(c=!1,h(y))},f=()=>{a=!0,window.addEventListener("pointerup",d,r),window.addEventListener("pointercancel",d,r)},p=y=>{if(y.pointerType!=="touch"){if(a){c=!0;return}h(y)}},m=y=>{if(!PGe(y))return;c=!1;const g=t(s,y);typeof g=="function"&&(l=g,s.addEventListener("pointerleave",p,r))};s.addEventListener("pointerenter",m,r),s.addEventListener("pointerdown",f,r)}),o}const Hk=(e,t)=>t?e===t?!0:Hk(e,t.parentElement):!1,oT=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,GGe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function VGe(e){return GGe.has(e.tagName)||e.isContentEditable===!0}const FGe=new Set(["INPUT","SELECT","TEXTAREA"]);function AGe(e){return FGe.has(e.tagName)||e.isContentEditable===!0}const Bb=new WeakSet;function jk(e){return t=>{t.key==="Enter"&&e(t)}}function sT(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const zGe=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=jk(()=>{if(Bb.has(n))return;sT(n,"down");const r=jk(()=>{sT(n,"up")}),o=()=>sT(n,"cancel");n.addEventListener("keyup",r,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",i,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),t)};function Kk(e){return oT(e)&&!Bk()}const Jk=new WeakSet;function NGe(e,t,n={}){const[i,r,o]=Yk(e,n),s=a=>{const c=a.currentTarget;if(!Kk(a)||Jk.has(a))return;Bb.add(c),n.stopPropagation&&Jk.add(a);const l=t(c,a),u=(f,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",d),Bb.has(c)&&Bb.delete(c),Kk(f)&&typeof l=="function"&&l(f,{success:p})},h=f=>{u(f,c===window||c===document||n.useGlobalTarget||Hk(c,f.target))},d=f=>{u(f,!1)};window.addEventListener("pointerup",h,r),window.addEventListener("pointercancel",d,r)};return i.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",s,r),MGe(a)&&(a.addEventListener("focus",l=>zGe(l,r)),!VGe(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function aT(e){return PN(e)&&"ownerSVGElement"in e}const Yb=new WeakMap;let Hb;const Qk=(e,t,n)=>(i,r)=>r&&r[0]?r[0][e+"Size"]:aT(i)&&"getBBox"in i?i.getBBox()[t]:i[n],kGe=Qk("inline","width","offsetWidth"),XGe=Qk("block","height","offsetHeight");function ZGe({target:e,borderBoxSize:t}){Yb.get(e)?.forEach(n=>{n(e,{get width(){return kGe(e,t)},get height(){return XGe(e,t)}})})}function DGe(e){e.forEach(ZGe)}function UGe(){typeof ResizeObserver>"u"||(Hb=new ResizeObserver(DGe))}function WGe(e,t){Hb||UGe();const n=Uk(e);return n.forEach(i=>{let r=Yb.get(i);r||(r=new Set,Yb.set(i,r)),r.add(t),Hb?.observe(i)}),()=>{n.forEach(i=>{const r=Yb.get(i);r?.delete(t),r?.size||Hb?.unobserve(i)})}}const jb=new Set;let id;function BGe(){id=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};jb.forEach(t=>t(e))},window.addEventListener("resize",id)}function YGe(e){return jb.add(e),id||BGe(),()=>{jb.delete(e),!jb.size&&typeof id=="function"&&(window.removeEventListener("resize",id),id=void 0)}}function qk(e,t){return typeof e=="function"?YGe(e):WGe(e,t)}function HGe(e){return aT(e)&&e.tagName==="svg"}const jGe=[...Nk,hi,ys],KGe=e=>jGe.find(zk(e)),$k=()=>({translate:0,scale:1,origin:0,originPoint:0}),rd=()=>({x:$k(),y:$k()}),eX=()=>({min:0,max:0}),vi=()=>({x:eX(),y:eX()}),JGe=new WeakMap;function Kb(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function S0(e){return typeof e=="string"||Array.isArray(e)}const cT=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],lT=["initial",...cT];function Jb(e){return Kb(e.animate)||lT.some(t=>S0(e[t]))}function tX(e){return!!(Jb(e)||e.variants)}function QGe(e,t,n){for(const i in t){const r=t[i],o=n[i];if(ir(r))e.addValue(i,r);else if(ir(o))e.addValue(i,tu(r,{owner:e}));else if(o!==r)if(e.hasValue(i)){const s=e.getValue(i);s.liveStyle===!0?s.jump(r):s.hasAnimated||s.set(r)}else{const s=e.getStaticValue(i);e.addValue(i,tu(s!==void 0?s:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const uT={current:null},nX={current:!1},qGe=typeof window<"u";function $Ge(){if(nX.current=!0,!!qGe)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>uT.current=e.matches;e.addEventListener("change",t),t()}else uT.current=!1}const iX=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Qb={};function rX(e){Qb=e}function eVe(){return Qb}class tVe{scrapeMotionValuesFromProps(t,n,i){return{}}constructor({parent:t,props:n,presenceContext:i,reducedMotionConfig:r,skipAnimations:o,blockInitialAnimation:s,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=BE,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=wr.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Tn.render(this.render,!1,!0))};const{latestValues:l,renderState:u}=a;this.latestValues=l,this.baseTarget={...l},this.initialValues=n.initial?{...l}:{},this.renderState=u,this.parent=t,this.props=n,this.presenceContext=i,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=o,this.options=c,this.blockInitialAnimation=!!s,this.isControllingVariants=Jb(n),this.isVariantNode=tX(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const f in d){const p=d[f];l[f]!==void 0&&ir(p)&&p.set(l[f])}}mount(t){if(this.hasBeenMounted)for(const n in this.initialValues)this.values.get(n)?.jump(this.initialValues[n]),this.latestValues[n]=this.initialValues[n];this.current=t,JGe.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(nX.current||$Ge(),this.shouldReduceMotion=uT.current),process.env.NODE_ENV!=="production"&&bE(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled"),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Bc(this.notifyUpdate),Bc(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&IGe.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:a,times:c,ease:l,duration:u}=n.accelerate,h=new Tk({element:this.current,name:t,keyframes:a,times:c,ease:l,duration:ko(u)}),d=s(h);this.valueSubscriptions.set(t,()=>{d(),h.cancel()});return}const i=td.has(t);i&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Tn.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let o;typeof window<"u"&&window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{r(),o&&o(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Qb){const n=Qb[t];if(!n)continue;const{isEnabled:i,Feature:r}=n;if(!this.features[t]&&r&&i(this.props)&&(this.features[t]=new r(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):vi()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<iX.length;i++){const r=iX[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const o="on"+r,s=t[o];s&&(this.propEventSubscriptions[r]=this.on(r,s))}this.prevMotionValues=QGe(this,this.scrapeMotionValuesFromProps(t,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const i=this.values.get(t);n!==i&&(i&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let i=this.values.get(t);return i===void 0&&n!==void 0&&(i=tu(n===null?void 0:n,{owner:this}),this.addValue(t,i)),i}readValue(t,n){let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(LN(i)||ON(i))?i=parseFloat(i):!KGe(i)&&ys.test(n)&&(i=Dk(t,n)),this.setBaseTarget(t,ir(i)?i.get():i)),ir(i)?i.get():i}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const o=JE(this.props,n,this.presenceContext?.custom);o&&(i=o[t])}if(n&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!ir(r)?r:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new yE),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){rT.render(this.render)}}class oX extends tVe{constructor(){super(...arguments),this.KeyframeResolver=RGe}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const i=t.style;return i?i[n]:void 0}removeValueFromRenderState(t,{vars:n,style:i}){delete n[t],delete i[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;ir(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class jc{constructor(t){this.isMounted=!1,this.node=t}update(){}}function sX({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function nVe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function iVe(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),i=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function hT(e){return e===void 0||e===1}function dT({scale:e,scaleX:t,scaleY:n}){return!hT(e)||!hT(t)||!hT(n)}function nu(e){return dT(e)||aX(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function aX(e){return cX(e.x)||cX(e.y)}function cX(e){return e&&e!=="0%"}function qb(e,t,n){const i=e-n,r=t*i;return n+r}function lX(e,t,n,i,r){return r!==void 0&&(e=qb(e,r,i)),qb(e,n,i)+t}function fT(e,t=0,n=1,i,r){e.min=lX(e.min,t,n,i,r),e.max=lX(e.max,t,n,i,r)}function uX(e,{x:t,y:n}){fT(e.x,t.translate,t.scale,t.originPoint),fT(e.y,n.translate,n.scale,n.originPoint)}const hX=.999999999999,dX=1.0000000000001;function rVe(e,t,n,i=!1){const r=n.length;if(!r)return;t.x=t.y=1;let o,s;for(let a=0;a<r;a++){o=n[a],s=o.projectionDelta;const{visualElement:c}=o.options;c&&c.props.style&&c.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&sd(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,uX(e,s)),i&&nu(o.latestValues)&&sd(e,o.latestValues))}t.x<dX&&t.x>hX&&(t.x=1),t.y<dX&&t.y>hX&&(t.y=1)}function od(e,t){e.min=e.min+t,e.max=e.max+t}function fX(e,t,n,i,r=.5){const o=Dn(e.min,e.max,r);fT(e,t,n,o,i)}function pX(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function sd(e,t){fX(e.x,pX(t.x,e.x),t.scaleX,t.scale,t.originX),fX(e.y,pX(t.y,e.y),t.scaleY,t.scale,t.originY)}function mX(e,t){return sX(iVe(e.getBoundingClientRect(),t))}function oVe(e,t,n){const i=mX(e,n),{scroll:r}=t;return r&&(od(i.x,r.offset.x),od(i.y,r.offset.y)),i}const sVe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},aVe=ed.length;function cVe(e,t,n){let i="",r=!0;for(let o=0;o<aVe;o++){const s=ed[o],a=e[s];if(a===void 0)continue;let c=!0;if(typeof a=="number")c=a===(s.startsWith("scale")?1:0);else{const l=parseFloat(a);c=s.startsWith("scale")?l===1:l===0}if(!c||n){const l=Wk(a,iT[s]);if(!c){r=!1;const u=sVe[s]||s;i+=`${u}(${l}) `}n&&(t[s]=l)}}return i=i.trim(),n?i=n(t,r?"":i):r&&(i="none"),i}function pT(e,t,n){const{style:i,vars:r,transformOrigin:o}=e;let s=!1,a=!1;for(const c in t){const l=t[c];if(td.has(c)){s=!0;continue}else if(JN(c)){r[c]=l;continue}else{const u=Wk(l,iT[c]);c.startsWith("origin")?(a=!0,o[c]=u):i[c]=u}}if(t.transform||(s||n?i.transform=cVe(t,e.transform,n):i.transform&&(i.transform="none")),a){const{originX:c="50%",originY:l="50%",originZ:u=0}=o;i.transformOrigin=`${c} ${l} ${u}`}}function gX(e,{style:t,vars:n},i,r){const o=e.style;let s;for(s in t)o[s]=t[s];r?.applyProjectionStyles(o,i);for(s in n)o.setProperty(s,n[s])}function yX(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const E0={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ct.test(e))e=parseFloat(e);else return e;const n=yX(e,t.target.x),i=yX(e,t.target.y);return`${n}% ${i}%`}},lVe={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=ys.parse(e);if(r.length>5)return i;const o=ys.createTransformer(e),s=typeof r[0]!="number"?1:0,a=n.x.scale*t.x,c=n.y.scale*t.y;r[0+s]/=a,r[1+s]/=c;const l=Dn(a,c,.5);return typeof r[2+s]=="number"&&(r[2+s]/=l),typeof r[3+s]=="number"&&(r[3+s]/=l),o(r)}},mT={borderRadius:{...E0,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:E0,borderTopRightRadius:E0,borderBottomLeftRadius:E0,borderBottomRightRadius:E0,boxShadow:lVe};function bX(e,{layout:t,layoutId:n}){return td.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!mT[e]||e==="opacity")}function gT(e,t,n){const i=e.style,r=t?.style,o={};if(!i)return o;for(const s in i)(ir(i[s])||r&&ir(r[s])||bX(s,e)||n?.getValue(s)?.liveStyle!==void 0)&&(o[s]=i[s]);return o}function uVe(e){return window.getComputedStyle(e)}class hVe extends oX{constructor(){super(...arguments),this.type="html",this.renderInstance=gX}readValueFromInstance(t,n){if(td.has(n))return this.projection?.isProjecting?XE(n):POe(t,n);{const i=uVe(t),r=(JN(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return mX(t,n)}build(t,n,i){pT(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return gT(t,n,i)}}const dVe={offset:"stroke-dashoffset",array:"stroke-dasharray"},fVe={offset:"strokeDashoffset",array:"strokeDasharray"};function pVe(e,t,n=1,i=0,r=!0){e.pathLength=1;const o=r?dVe:fVe;e[o.offset]=`${-i}`,e[o.array]=`${t} ${n}`}const mVe=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function _X(e,{attrX:t,attrY:n,attrScale:i,pathLength:r,pathSpacing:o=1,pathOffset:s=0,...a},c,l,u){if(pT(e,a,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:d}=e;h.transform&&(d.transform=h.transform,delete h.transform),(d.transform||h.transformOrigin)&&(d.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),d.transform&&(d.transformBox=u?.transformBox??"fill-box",delete h.transformBox);for(const f of mVe)h[f]!==void 0&&(d[f]=h[f],delete h[f]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),i!==void 0&&(h.scale=i),r!==void 0&&pVe(h,r,o,s,!1)}const vX=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),wX=e=>typeof e=="string"&&e.toLowerCase()==="svg";function gVe(e,t,n,i){gX(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(vX.has(r)?r:$E(r),t.attrs[r])}function xX(e,t,n){const i=gT(e,t,n);for(const r in e)if(ir(e[r])||ir(t[r])){const o=ed.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[o]=e[r]}return i}class yVe extends oX{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=vi}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(td.has(n)){const i=Zk(n);return i&&i.default||0}return n=vX.has(n)?n:$E(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return xX(t,n,i)}build(t,n,i){_X(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,r){gVe(t,n,i,r)}mount(t){this.isSVGTag=wX(t.tagName),super.mount(t)}}const bVe=lT.length;function SX(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?SX(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<bVe;n++){const i=lT[n],r=e.props[i];(S0(r)||r===!1)&&(t[i]=r)}return t}function EX(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}const _Ve=[...cT].reverse(),vVe=cT.length;function wVe(e){return t=>Promise.all(t.map(({animation:n,options:i})=>yGe(e,n,i)))}function xVe(e){let t=wVe(e),n=TX(),i=!0,r=!1;const o=l=>(u,h)=>{const d=nd(e,h,l==="exit"?e.presenceContext?.custom:void 0);if(d){const{transition:f,transitionEnd:p,...m}=d;u={...u,...m,...p}}return u};function s(l){t=l(e)}function a(l){const{props:u}=e,h=SX(e.parent)||{},d=[],f=new Set;let p={},m=1/0;for(let g=0;g<vVe;g++){const v=_Ve[g],S=n[v],E=u[v]!==void 0?u[v]:h[v],C=S0(E),O=v===l?S.isActive:null;O===!1&&(m=g);let V=E===h[v]&&E!==u[v]&&C;if(V&&(i||r)&&e.manuallyAnimateOnMount&&(V=!1),S.protectedKeys={...p},!S.isActive&&O===null||!E&&!S.prevProp||Kb(E)||typeof E=="boolean")continue;if(v==="exit"&&S.isActive&&O!==!0){S.prevResolvedValues&&(p={...p,...S.prevResolvedValues});continue}const A=SVe(S.prevProp,E);let G=A||v===l&&S.isActive&&!V&&C||g>m&&C,N=!1;const k=Array.isArray(E)?E:[E];let P=k.reduce(o(v),{});O===!1&&(P={});const{prevResolvedValues:w={}}=S,x={...w,...P},I=Y=>{G=!0,f.has(Y)&&(N=!0,f.delete(Y)),S.needsAnimating[Y]=!0;const H=e.getValue(Y);H&&(H.liveStyle=!1)};for(const Y in x){const H=P[Y],J=w[Y];if(p.hasOwnProperty(Y))continue;let z=!1;QE(H)&&QE(J)?z=!EX(H,J):z=H!==J,z?H!=null?I(Y):f.add(Y):H!==void 0&&f.has(Y)?I(Y):S.protectedKeys[Y]=!0}S.prevProp=E,S.prevResolvedValues=P,S.isActive&&(p={...p,...P}),(i||r)&&e.blockInitialAnimation&&(G=!1);const X=V&&A;G&&(!X||N)&&d.push(...k.map(Y=>{const H={type:v};if(typeof Y=="string"&&(i||r)&&!X&&e.manuallyAnimateOnMount&&e.parent){const{parent:J}=e,z=nd(J,Y);if(J.enteringChildren&&z){const{delayChildren:W}=z.transition||{};H.delay=Ik(J.enteringChildren,e,W)}}return{animation:Y,options:H}}))}if(f.size){const g={};if(typeof u.initial!="boolean"){const v=nd(e,Array.isArray(u.initial)?u.initial[0]:u.initial);v&&v.transition&&(g.transition=v.transition)}f.forEach(v=>{const S=e.getBaseTarget(v),E=e.getValue(v);E&&(E.liveStyle=!0),g[v]=S??null}),d.push({animation:g})}let y=!!d.length;return i&&(u.initial===!1||u.initial===u.animate)&&!e.manuallyAnimateOnMount&&(y=!1),i=!1,r=!1,y?t(d):Promise.resolve()}function c(l,u){if(n[l].isActive===u)return Promise.resolve();e.variantChildren?.forEach(d=>d.animationState?.setActive(l,u)),n[l].isActive=u;const h=a(l);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:a,setActive:c,setAnimateFunction:s,getState:()=>n,reset:()=>{n=TX(),r=!0}}}function SVe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!EX(t,e):!1}function iu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function TX(){return{animate:iu(!0),whileInView:iu(),whileHover:iu(),whileTap:iu(),whileDrag:iu(),whileFocus:iu(),exit:iu()}}function CX(e,t){e.min=t.min,e.max=t.max}function _s(e,t){CX(e.x,t.x),CX(e.y,t.y)}function RX(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const IX=1e-4,EVe=1-IX,TVe=1+IX,MX=.01,CVe=0-MX,RVe=0+MX;function xr(e){return e.max-e.min}function IVe(e,t,n){return Math.abs(e-t)<=n}function LX(e,t,n,i=.5){e.origin=i,e.originPoint=Dn(t.min,t.max,e.origin),e.scale=xr(n)/xr(t),e.translate=Dn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=EVe&&e.scale<=TVe||isNaN(e.scale))&&(e.scale=1),(e.translate>=CVe&&e.translate<=RVe||isNaN(e.translate))&&(e.translate=0)}function T0(e,t,n,i){LX(e.x,t.x,n.x,i?i.originX:void 0),LX(e.y,t.y,n.y,i?i.originY:void 0)}function PX(e,t,n){e.min=n.min+t.min,e.max=e.min+xr(t)}function MVe(e,t,n){PX(e.x,t.x,n.x),PX(e.y,t.y,n.y)}function OX(e,t,n){e.min=t.min-n.min,e.max=e.min+xr(t)}function $b(e,t,n){OX(e.x,t.x,n.x),OX(e.y,t.y,n.y)}function GX(e,t,n,i,r){return e-=t,e=qb(e,1/n,i),r!==void 0&&(e=qb(e,1/r,i)),e}function LVe(e,t=0,n=1,i=.5,r,o=e,s=e){if(ra.test(t)&&(t=parseFloat(t),t=Dn(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=Dn(o.min,o.max,i);e===o&&(a-=t),e.min=GX(e.min,t,n,a,r),e.max=GX(e.max,t,n,a,r)}function VX(e,t,[n,i,r],o,s){LVe(e,t[n],t[i],t[r],t.scale,o,s)}const PVe=["x","scaleX","originX"],OVe=["y","scaleY","originY"];function FX(e,t,n,i){VX(e.x,t,PVe,n?n.x:void 0,i?i.x:void 0),VX(e.y,t,OVe,n?n.y:void 0,i?i.y:void 0)}function AX(e){return e.translate===0&&e.scale===1}function zX(e){return AX(e.x)&&AX(e.y)}function NX(e,t){return e.min===t.min&&e.max===t.max}function GVe(e,t){return NX(e.x,t.x)&&NX(e.y,t.y)}function kX(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function XX(e,t){return kX(e.x,t.x)&&kX(e.y,t.y)}function ZX(e){return xr(e.x)/xr(e.y)}function DX(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function oa(e){return[e("x"),e("y")]}function VVe(e,t,n){let i="";const r=e.x.translate/t.x,o=e.y.translate/t.y,s=n?.z||0;if((r||o||s)&&(i=`translate3d(${r}px, ${o}px, ${s}px) `),(t.x!==1||t.y!==1)&&(i+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:l,rotate:u,rotateX:h,rotateY:d,skewX:f,skewY:p}=n;l&&(i=`perspective(${l}px) ${i}`),u&&(i+=`rotate(${u}deg) `),h&&(i+=`rotateX(${h}deg) `),d&&(i+=`rotateY(${d}deg) `),f&&(i+=`skewX(${f}deg) `),p&&(i+=`skewY(${p}deg) `)}const a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(i+=`scale(${a}, ${c})`),i||"none"}const UX=["TopLeft","TopRight","BottomLeft","BottomRight"],FVe=UX.length,WX=e=>typeof e=="string"?parseFloat(e):e,BX=e=>typeof e=="number"||ct.test(e);function AVe(e,t,n,i,r,o){r?(e.opacity=Dn(0,n.opacity??1,zVe(i)),e.opacityExit=Dn(t.opacity??1,0,NVe(i))):o&&(e.opacity=Dn(t.opacity??1,n.opacity??1,i));for(let s=0;s<FVe;s++){const a=`border${UX[s]}Radius`;let c=YX(t,a),l=YX(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||BX(c)===BX(l)?(e[a]=Math.max(Dn(WX(c),WX(l),i),0),(ra.test(l)||ra.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=Dn(t.rotate||0,n.rotate||0,i))}function YX(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const zVe=HX(0,.5,DN),NVe=HX(.5,.95,No);function HX(e,t,n){return i=>i<e?0:i>t?1:n(g0(e,t,i))}function kVe(e,t,n){const i=ir(e)?e:tu(e);return i.start(KE("",i,t,n)),i.animation}function C0(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}const XVe=(e,t)=>e.depth-t.depth;class ZVe{constructor(){this.children=[],this.isDirty=!1}add(t){mE(this.children,t),this.isDirty=!0}remove(t){Nb(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(XVe),this.isDirty=!1,this.children.forEach(t)}}function DVe(e,t){const n=wr.now(),i=({timestamp:r})=>{const o=r-n;o>=t&&(Bc(i),e(o-t))};return Tn.setup(i,!0),()=>Bc(i)}function e1(e){return ir(e)?e.get():e}class UVe{constructor(){this.members=[]}add(t){mE(this.members,t);for(let n=this.members.length-1;n>=0;n--){const i=this.members[n];if(i===t||i===this.lead||i===this.prevLead)continue;const r=i.instance;(!r||r.isConnected===!1)&&!i.snapshot&&(Nb(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(Nb(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){for(let n=this.members.indexOf(t)-1;n>=0;n--){const i=this.members[n];if(i.isPresent!==!1&&i.instance?.isConnected!==!1)return this.promote(i),!0}return!1}promote(t,n){const i=this.lead;if(t!==i&&(this.prevLead=i,this.lead=t,t.show(),i)){i.updateSnapshot(),t.scheduleRender();const{layoutDependency:r}=i.options,{layoutDependency:o}=t.options;(r===void 0||r!==o)&&(t.resumeFrom=i,n&&(i.preserveOpacity=!0),i.snapshot&&(t.snapshot=i.snapshot,t.snapshot.latestValues=i.animationValues||i.latestValues),t.root?.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(t=>{t.options.onExitComplete?.(),t.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}}const t1={hasAnimatedSinceResize:!0,hasEverUpdated:!1},yT=["","X","Y","Z"],WVe=1e3;let BVe=0;function bT(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function jX(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Fk(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Tn,!(r||o))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&jX(i)}function KX({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(s={},a=t?.()){this.id=BVe++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(jVe),this.nodes.forEach(qVe),this.nodes.forEach($Ve),this.nodes.forEach(KVe)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=s,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new ZVe)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new yE),this.eventHandlers.get(s).add(a)}notifyListeners(s,...a){const c=this.eventHandlers.get(s);c&&c.notify(...a)}hasListeners(s){return this.eventHandlers.has(s)}mount(s){if(this.instance)return;this.isSVG=aT(s)&&!HGe(s),this.instance=s;const{layoutId:a,layout:c,visualElement:l}=this.options;if(l&&!l.current&&l.mount(s),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let u,h=0;const d=()=>this.root.updateBlockedByResize=!1;Tn.read(()=>{h=window.innerWidth}),e(s,()=>{const f=window.innerWidth;f!==h&&(h=f,this.root.updateBlockedByResize=!0,u&&u(),u=DVe(d,250),t1.hasAnimatedSinceResize&&(t1.hasAnimatedSinceResize=!1,this.nodes.forEach(qX)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&l&&(a||c)&&this.addEventListener("didUpdate",({delta:u,hasLayoutChanged:h,hasRelativeLayoutChanged:d,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const p=this.options.transition||l.getDefaultTransition()||r9e,{onLayoutAnimationStart:m,onLayoutAnimationComplete:y}=l.getProps(),g=!this.targetLayout||!XX(this.targetLayout,f),v=!h&&d;if(this.options.layoutRoot||this.resumeFrom||v||h&&(g||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const S={...jE(p,"layout"),onPlay:m,onComplete:y};(l.shouldReduceMotion||this.options.layoutRoot)&&(S.delay=0,S.type=!1),this.startAnimation(S),this.setAnimationOrigin(u,v)}else h||qX(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const s=this.getStack();s&&s.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Bc(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(e9e),this.animationId++)}getTransformTemplate(){const{visualElement:s}=this.options;return s&&s.getProps().transformTemplate}willUpdate(s=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&jX(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;const l=this.getTransformTemplate();this.prevTransformTemplateValue=l?l(this.latestValues,""):void 0,this.updateSnapshot(),s&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(JX);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(QX);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(QVe),this.nodes.forEach(YVe),this.nodes.forEach(HVe)):this.nodes.forEach(QX),this.clearAllSnapshots();const a=wr.now();Xi.delta=ia(0,1e3/60,a-Xi.timestamp),Xi.timestamp=a,Xi.isProcessing=!0,wE.update.process(Xi),wE.preRender.process(Xi),wE.render.process(Xi),Xi.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,rT.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(JVe),this.sharedNodes.forEach(t9e)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Tn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Tn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!xr(this.snapshot.measuredBox.x)&&!xr(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const s=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected=vi(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,s?s.layoutBox:void 0)}updateScroll(s="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===s&&(a=!1),a&&this.instance){const c=i(this.instance);this.scroll={animationId:this.root.animationId,phase:s,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!r)return;const s=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!zX(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;s&&this.instance&&(a||nu(this.latestValues)||u)&&(r(this.instance,l),this.shouldResetTransform=!1,this.scheduleRender())}measure(s=!0){const a=this.measurePageBox();let c=this.removeElementScroll(a);return s&&(c=this.removeTransform(c)),o9e(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return vi();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(s9e))){const{scroll:l}=this.root;l&&(od(a.x,l.offset.x),od(a.y,l.offset.y))}return a}removeElementScroll(s){const a=vi();if(_s(a,s),this.scroll?.wasRoot)return a;for(let c=0;c<this.path.length;c++){const l=this.path[c],{scroll:u,options:h}=l;l!==this.root&&u&&h.layoutScroll&&(u.wasRoot&&_s(a,s),od(a.x,u.offset.x),od(a.y,u.offset.y))}return a}applyTransform(s,a=!1){const c=vi();_s(c,s);for(let l=0;l<this.path.length;l++){const u=this.path[l];!a&&u.options.layoutScroll&&u.scroll&&u!==u.root&&sd(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),nu(u.latestValues)&&sd(c,u.latestValues)}return nu(this.latestValues)&&sd(c,this.latestValues),c}removeTransform(s){const a=vi();_s(a,s);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!nu(l.latestValues))continue;dT(l.latestValues)&&l.updateSnapshot();const u=vi(),h=l.measurePageBox();_s(u,h),FX(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return nu(this.latestValues)&&FX(a,this.latestValues),a}setTargetDelta(s){this.targetDelta=s,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(s){this.options={...this.options,...s,crossfade:s.crossfade!==void 0?s.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Xi.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(s=!1){const a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==a;if(!(s||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:u,layoutId:h}=this.options;if(!this.layout||!(u||h))return;this.resolvedRelativeTargetAt=Xi.timestamp;const d=this.getClosestProjectingParent();d&&this.linkedParentVersion!==d.layoutVersion&&!d.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(d&&d.layout?this.createRelativeTarget(d,this.layout.layoutBox,d.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=vi(),this.targetWithTransforms=vi()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),MVe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):_s(this.target,this.layout.layoutBox),uX(this.target,this.targetDelta)):_s(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,d&&!!d.resumingFrom==!!this.resumingFrom&&!d.options.layoutScroll&&d.target&&this.animationProgress!==1?this.createRelativeTarget(d,this.target,d.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||dT(this.parent.latestValues)||aX(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(s,a,c){this.relativeParent=s,this.linkedParentVersion=s.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=vi(),this.relativeTargetOrigin=vi(),$b(this.relativeTargetOrigin,a,c),_s(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){const s=this.getLead(),a=!!this.resumingFrom||this!==s;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Xi.timestamp&&(c=!1),c)return;const{layout:l,layoutId:u}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(l||u))return;_s(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,d=this.treeScale.y;rVe(this.layoutCorrected,this.treeScale,this.path,a),s.layout&&!s.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(s.target=s.layout.layoutBox,s.targetWithTransforms=vi());const{target:f}=s;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(RX(this.prevProjectionDelta.x,this.projectionDelta.x),RX(this.prevProjectionDelta.y,this.projectionDelta.y)),T0(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==d||!DX(this.projectionDelta.x,this.prevProjectionDelta.x)||!DX(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",f))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(s=!0){if(this.options.visualElement?.scheduleRender(),s){const a=this.getStack();a&&a.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=rd(),this.projectionDelta=rd(),this.projectionDeltaWithTransform=rd()}setAnimationOrigin(s,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},h=rd();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=vi(),f=c?c.source:void 0,p=this.layout?this.layout.source:void 0,m=f!==p,y=this.getStack(),g=!y||y.members.length<=1,v=!!(m&&!g&&this.options.crossfade===!0&&!this.path.some(i9e));this.animationProgress=0;let S;this.mixTargetDelta=E=>{const C=E/1e3;$X(h.x,s.x,C),$X(h.y,s.y,C),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&($b(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),n9e(this.relativeTarget,this.relativeTargetOrigin,d,C),S&&GVe(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=vi()),_s(S,this.relativeTarget)),m&&(this.animationValues=u,AVe(u,l,this.latestValues,C,v,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=C},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Bc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Tn.update(()=>{t1.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=tu(0)),this.motionValue.jump(0,!1),this.currentAnimation=kVe(this.motionValue,[0,1e3],{...s,velocity:0,isSync:!0,onUpdate:a=>{this.mixTargetDelta(a),s.onUpdate&&s.onUpdate(a)},onStop:()=>{},onComplete:()=>{s.onComplete&&s.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const s=this.getStack();s&&s.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(WVe),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const s=this.getLead();let{targetWithTransforms:a,target:c,layout:l,latestValues:u}=s;if(!(!a||!c||!l)){if(this!==s&&this.layout&&l&&rZ(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||vi();const h=xr(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+h;const d=xr(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+d}_s(a,c),sd(a,u),T0(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new UVe),this.sharedNodes.get(s).add(a);const l=a.options.initialPromotionConfig;a.promote({transition:l?l.transition:void 0,preserveFollowOpacity:l&&l.shouldPreserveFollowOpacity?l.shouldPreserveFollowOpacity(a):void 0})}isLead(){const s=this.getStack();return s?s.lead===this:!0}getLead(){const{layoutId:s}=this.options;return s?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:s}=this.options;return s?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:s}=this.options;if(s)return this.root.sharedNodes.get(s)}promote({needsReset:s,transition:a,preserveFollowOpacity:c}={}){const l=this.getStack();l&&l.promote(this,c),s&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const s=this.getStack();return s?s.relegate(this):!1}resetSkewAndRotation(){const{visualElement:s}=this.options;if(!s)return;let a=!1;const{latestValues:c}=s;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;const l={};c.z&&bT("z",s,l,this.animationValues);for(let u=0;u<yT.length;u++)bT(`rotate${yT[u]}`,s,l,this.animationValues),bT(`skew${yT[u]}`,s,l,this.animationValues);s.render();for(const u in l)s.setStaticValue(u,l[u]),this.animationValues&&(this.animationValues[u]=l[u]);s.scheduleRender()}applyProjectionStyles(s,a){if(!this.instance||this.isSVG)return;if(!this.isVisible){s.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,s.visibility="",s.opacity="",s.pointerEvents=e1(a?.pointerEvents)||"",s.transform=c?c(this.latestValues,""):"none";return}const l=this.getLead();if(!this.projectionDelta||!this.layout||!l.target){this.options.layoutId&&(s.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,s.pointerEvents=e1(a?.pointerEvents)||""),this.hasProjected&&!nu(this.latestValues)&&(s.transform=c?c({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let h=VVe(this.projectionDeltaWithTransform,this.treeScale,u);c&&(h=c(u,h)),s.transform=h;const{x:d,y:f}=this.projectionDelta;s.transformOrigin=`${d.origin*100}% ${f.origin*100}% 0`,l.animationValues?s.opacity=l===this?u.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:u.opacityExit:s.opacity=l===this?u.opacity!==void 0?u.opacity:"":u.opacityExit!==void 0?u.opacityExit:0;for(const p in mT){if(u[p]===void 0)continue;const{correct:m,applyTo:y,isCSSVariable:g}=mT[p],v=h==="none"?u[p]:m(u[p],l);if(y){const S=y.length;for(let E=0;E<S;E++)s[y[E]]=v}else g?this.options.visualElement.renderState.vars[p]=v:s[p]=v}this.options.layoutId&&(s.pointerEvents=l===this?e1(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(JX),this.root.sharedNodes.clear()}}}function YVe(e){e.updateLayout()}function HVe(e){const t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=e.layout,{animationType:r}=e.options,o=t.source!==e.layout.source;r==="size"?oa(u=>{const h=o?t.measuredBox[u]:t.layoutBox[u],d=xr(h);h.min=n[u].min,h.max=h.min+d}):rZ(r,t.layoutBox,n)&&oa(u=>{const h=o?t.measuredBox[u]:t.layoutBox[u],d=xr(n[u]);h.max=h.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[u].max=e.relativeTarget[u].min+d)});const s=rd();T0(s,n,t.layoutBox);const a=rd();o?T0(a,e.applyTransform(i,!0),t.measuredBox):T0(a,n,t.layoutBox);const c=!zX(s);let l=!1;if(!e.resumeFrom){const u=e.getClosestProjectingParent();if(u&&!u.resumeFrom){const{snapshot:h,layout:d}=u;if(h&&d){const f=vi();$b(f,t.layoutBox,h.layoutBox);const p=vi();$b(p,n,d.layoutBox),XX(f,p)||(l=!0),u.options.layoutRoot&&(e.relativeTarget=p,e.relativeTargetOrigin=f,e.relativeParent=u)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:a,layoutDelta:s,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){const{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function jVe(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function KVe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function JVe(e){e.clearSnapshot()}function JX(e){e.clearMeasurements()}function QX(e){e.isLayoutDirty=!1}function QVe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function qX(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function qVe(e){e.resolveTargetDelta()}function $Ve(e){e.calcProjection()}function e9e(e){e.resetSkewAndRotation()}function t9e(e){e.removeLeadSnapshot()}function $X(e,t,n){e.translate=Dn(t.translate,0,n),e.scale=Dn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function eZ(e,t,n,i){e.min=Dn(t.min,n.min,i),e.max=Dn(t.max,n.max,i)}function n9e(e,t,n,i){eZ(e.x,t.x,n.x,i),eZ(e.y,t.y,n.y,i)}function i9e(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const r9e={duration:.45,ease:[.4,0,.1,1]},tZ=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),nZ=tZ("applewebkit/")&&!tZ("chrome/")?Math.round:No;function iZ(e){e.min=nZ(e.min),e.max=nZ(e.max)}function o9e(e){iZ(e.x),iZ(e.y)}function rZ(e,t,n){return e==="position"||e==="preserve-aspect"&&!IVe(ZX(t),ZX(n),.2)}function s9e(e){return e!==e.root&&e.scroll?.wasRoot}const a9e=KX({attachResizeListener:(e,t)=>C0(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),_T={current:void 0},oZ=KX({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!_T.current){const e=new a9e({});e.mount(window),e.setOptions({layoutScroll:!0}),_T.current=e}return _T.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),vT=R.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function c9e(e=!0){const t=R.useContext(pE);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:r}=t,o=R.useId();R.useEffect(()=>{if(e)return r(o)},[e]);const s=R.useCallback(()=>e&&i&&i(o),[o,i,e]);return!n&&i?[!1,s]:[!0]}const sZ=R.createContext({strict:!1}),aZ={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"]};let cZ=!1;function l9e(){if(cZ)return;const e={};for(const t in aZ)e[t]={isEnabled:n=>aZ[t].some(i=>!!n[i])};rX(e),cZ=!0}function lZ(){return l9e(),eVe()}function u9e(e){const t=lZ();for(const n in e)t[n]={...t[n],...e[n]};rX(t)}const h9e=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function n1(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||h9e.has(e)}let uZ=e=>!n1(e);function d9e(e){typeof e=="function"&&(uZ=t=>t.startsWith("on")?!n1(t):e(t))}try{d9e(require("@emotion/is-prop-valid").default)}catch{}function f9e(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(uZ(r)||n===!0&&n1(r)||!t&&!n1(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}const i1=R.createContext({});function p9e(e,t){if(Jb(e)){const{initial:n,animate:i}=e;return{initial:n===!1||S0(n)?n:void 0,animate:S0(i)?i:void 0}}return e.inherit!==!1?t:{}}function m9e(e){const{initial:t,animate:n}=p9e(e,R.useContext(i1));return R.useMemo(()=>({initial:t,animate:n}),[hZ(t),hZ(n)])}function hZ(e){return Array.isArray(e)?e.join(" "):e}const wT=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function dZ(e,t,n){for(const i in t)!ir(t[i])&&!bX(i,n)&&(e[i]=t[i])}function g9e({transformTemplate:e},t){return R.useMemo(()=>{const n=wT();return pT(n,t,e),Object.assign({},n.vars,n.style)},[t])}function y9e(e,t){const n=e.style||{},i={};return dZ(i,n,e),Object.assign(i,g9e(e,t)),i}function b9e(e,t){const n={},i=y9e(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=i,n}const fZ=()=>({...wT(),attrs:{}});function _9e(e,t,n,i){const r=R.useMemo(()=>{const o=fZ();return _X(o,t,wX(i),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};dZ(o,e.style,e),r.style={...o,...r.style}}return r}const v9e=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function xT(e){return typeof e!="string"||e.includes("-")?!1:!!(v9e.indexOf(e)>-1||/[A-Z]/u.test(e))}function w9e(e,t,n,{latestValues:i},r,o=!1,s){const c=(s??xT(e)?_9e:b9e)(t,i,r,e),l=f9e(t,typeof e=="string",o),u=e!==R.Fragment?{...l,...c,ref:n}:{},{children:h}=t,d=R.useMemo(()=>ir(h)?h.get():h,[h]);return R.createElement(e,{...u,children:d})}function x9e({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,r){return{latestValues:S9e(n,i,r,e),renderState:t()}}function S9e(e,t,n,i){const r={},o=i(e,{});for(const d in o)r[d]=e1(o[d]);let{initial:s,animate:a}=e;const c=Jb(e),l=tX(e);t&&l&&!c&&e.inherit!==!1&&(s===void 0&&(s=t.initial),a===void 0&&(a=t.animate));let u=n?n.initial===!1:!1;u=u||s===!1;const h=u?a:s;if(h&&typeof h!="boolean"&&!Kb(h)){const d=Array.isArray(h)?h:[h];for(let f=0;f<d.length;f++){const p=JE(e,d[f]);if(p){const{transitionEnd:m,transition:y,...g}=p;for(const v in g){let S=g[v];if(Array.isArray(S)){const E=u?S.length-1:0;S=S[E]}S!==null&&(r[v]=S)}for(const v in m)r[v]=m[v]}}}return r}const pZ=e=>(t,n)=>{const i=R.useContext(i1),r=R.useContext(pE),o=()=>x9e(e,t,i,r);return n?o():MN(o)},E9e=pZ({scrapeMotionValuesFromProps:gT,createRenderState:wT}),T9e=pZ({scrapeMotionValuesFromProps:xX,createRenderState:fZ}),C9e=Symbol.for("motionComponentSymbol");function R9e(e,t,n){const i=R.useRef(n);R.useInsertionEffect(()=>{i.current=n});const r=R.useRef(null);return R.useCallback(o=>{o&&e.onMount?.(o);const s=i.current;if(typeof s=="function")if(o){const a=s(o);typeof a=="function"&&(r.current=a)}else r.current?(r.current(),r.current=null):s(o);else s&&(s.current=o);t&&(o?t.mount(o):t.unmount())},[t])}const mZ=R.createContext({});function ad(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function I9e(e,t,n,i,r,o){const{visualElement:s}=R.useContext(i1),a=R.useContext(sZ),c=R.useContext(pE),l=R.useContext(vT),u=l.reducedMotion,h=l.skipAnimations,d=R.useRef(null),f=R.useRef(!1);i=i||a.renderer,!d.current&&i&&(d.current=i(e,{visualState:t,parent:s,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:h,isSVG:o}),f.current&&d.current&&(d.current.manuallyAnimateOnMount=!0));const p=d.current,m=R.useContext(mZ);p&&!p.projection&&r&&(p.type==="html"||p.type==="svg")&&M9e(d.current,n,r,m);const y=R.useRef(!1);R.useInsertionEffect(()=>{p&&y.current&&p.update(n,c)});const g=n[Vk],v=R.useRef(!!g&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return MPe(()=>{f.current=!0,p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),v.current&&p.animationState&&p.animationState.animateChanges())}),R.useEffect(()=>{p&&(!v.current&&p.animationState&&p.animationState.animateChanges(),v.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),v.current=!1),p.enteringChildren=void 0)}),p}function M9e(e,t,n,i){const{layoutId:r,layout:o,drag:s,dragConstraints:a,layoutScroll:c,layoutRoot:l,layoutCrossfade:u}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:gZ(e.parent)),e.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!s||a&&ad(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:c,layoutRoot:l})}function gZ(e){if(e)return e.options.allowProjection!==!1?e.projection:gZ(e.parent)}function ST(e,{forwardMotionProps:t=!1,type:n}={},i,r){i&&u9e(i);const o=n?n==="svg":xT(e),s=o?T9e:E9e;function a(l,u){let h;const d={...R.useContext(vT),...l,layoutId:L9e(l)},{isStatic:f}=d,p=m9e(l),m=s(l,f);if(!f&&typeof window<"u"){P9e(d,i);const y=O9e(d);h=y.MeasureLayout,p.visualElement=I9e(e,m,d,r,y.ProjectionNode,o)}return ce.jsxs(i1.Provider,{value:p,children:[h&&p.visualElement?ce.jsx(h,{visualElement:p.visualElement,...d}):null,w9e(e,l,R9e(m,p.visualElement,u),m,f,t,o)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const c=R.forwardRef(a);return c[C9e]=e,c}function L9e({layoutId:e}){const t=R.useContext(IN).id;return t&&e!==void 0?t+"-"+e:e}function P9e(e,t){const n=R.useContext(sZ).strict;if(process.env.NODE_ENV!=="production"&&t&&n){const i="You have rendered a `motion` component within a `LazyMotion` component. This will break tree shaking. Import and render a `m` component instead.";e.ignoreStrict?Jh(!1,i,"lazy-strict-mode"):Ua(!1,i,"lazy-strict-mode")}}function O9e(e){const t=lZ(),{drag:n,layout:i}=t;if(!n&&!i)return{};const r={...n,...i};return{MeasureLayout:n?.isEnabled(e)||i?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function G9e(e,t){if(typeof Proxy>"u")return ST;const n=new Map,i=(o,s)=>ST(o,s,e,t),r=(o,s)=>(process.env.NODE_ENV!=="production"&&bE(!1,"motion() is deprecated. Use motion.create() instead."),i(o,s));return new Proxy(r,{get:(o,s)=>s==="create"?i:(n.has(s)||n.set(s,ST(s,void 0,e,t)),n.get(s))})}const V9e=(e,t)=>t.isSVG??xT(e)?new yVe(t):new hVe(t,{allowProjection:e!==R.Fragment});class F9e extends jc{constructor(t){super(t),t.animationState||(t.animationState=xVe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Kb(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let A9e=0;class z9e extends jc{constructor(){super(...arguments),this.id=A9e++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===i)return;const r=this.node.animationState.setActive("exit",!t);n&&!t&&r.then(()=>{n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const N9e={animation:{Feature:F9e},exit:{Feature:z9e}};function R0(e){return{point:{x:e.pageX,y:e.pageY}}}const k9e=e=>t=>oT(t)&&e(t,R0(t));function I0(e,t,n,i){return C0(e,t,k9e(n),i)}const yZ=({current:e})=>e?e.ownerDocument.defaultView:null,bZ=(e,t)=>Math.abs(e-t);function X9e(e,t){const n=bZ(e.x,t.x),i=bZ(e.y,t.y);return Math.sqrt(n**2+i**2)}const _Z=new Set(["auto","scroll"]);class vZ{constructor(t,n,{transformPagePoint:i,contextWindow:r=window,dragSnapToOrigin:o=!1,distanceThreshold:s=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=f=>{this.handleScroll(f.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=TT(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=X9e(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:y}=f,{timestamp:g}=Xi;this.history.push({...y,timestamp:g});const{onStart:v,onMove:S}=this.handlers;p||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=ET(p,this.transformPagePoint),Tn.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:g}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=TT(f.type==="pointercancel"?this.lastMoveEventInfo:ET(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),y&&y(f,v)},!oT(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=s,this.contextWindow=r||window;const c=R0(t),l=ET(c,this.transformPagePoint),{point:u}=l,{timestamp:h}=Xi;this.history=[{...u,timestamp:h}];const{onSessionStart:d}=n;d&&d(t,TT(l,this.history)),this.removeListeners=m0(I0(this.contextWindow,"pointermove",this.handlePointerMove),I0(this.contextWindow,"pointerup",this.handlePointerUp),I0(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const i=getComputedStyle(n);(_Z.has(i.overflowX)||_Z.has(i.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const i=t===window,r=i?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},o={x:r.x-n.x,y:r.y-n.y};o.x===0&&o.y===0||(i?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=o.x,this.lastMoveEventInfo.point.y+=o.y):this.history.length>0&&(this.history[0].x-=o.x,this.history[0].y-=o.y),this.scrollPositions.set(t,r),Tn.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Bc(this.updatePoint)}}function ET(e,t){return t?{point:t(e.point)}:e}function wZ(e,t){return{x:e.x-t.x,y:e.y-t.y}}function TT({point:e},t){return{point:e,delta:wZ(e,xZ(t)),offset:wZ(e,Z9e(t)),velocity:D9e(t,.1)}}function Z9e(e){return e[0]}function xZ(e){return e[e.length-1]}function D9e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=xZ(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>ko(t)));)n--;if(!i)return{x:0,y:0};i===e[0]&&e.length>2&&r.timestamp-i.timestamp>ko(t)*2&&(i=e[1]);const o=Xo(r.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const s={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function U9e(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?Dn(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?Dn(n,e,i.max):Math.min(e,n)),e}function SZ(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function W9e(e,{top:t,left:n,bottom:i,right:r}){return{x:SZ(e.x,n,r),y:SZ(e.y,t,i)}}function EZ(e,t){let n=t.min-e.min,i=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,i]=[i,n]),{min:n,max:i}}function B9e(e,t){return{x:EZ(e.x,t.x),y:EZ(e.y,t.y)}}function Y9e(e,t){let n=.5;const i=xr(e),r=xr(t);return r>i?n=g0(t.min,t.max-i,e.min):i>r&&(n=g0(e.min,e.max-r,t.min)),ia(0,1,n)}function H9e(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const CT=.35;function j9e(e=CT){return e===!1?e=0:e===!0&&(e=CT),{x:TZ(e,"left","right"),y:TZ(e,"top","bottom")}}function TZ(e,t,n){return{min:CZ(e,t),max:CZ(e,n)}}function CZ(e,t){return typeof e=="number"?e:e[t]||0}const K9e=new WeakMap;class J9e{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=vi(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const o=h=>{n&&this.snapToCursor(R0(h).point),this.stopAnimation()},s=(h,d)=>{const{drag:f,dragPropagation:p,onDragStart:m}=this.getProps();if(f&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=LGe(f),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=d,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),oa(g=>{let v=this.getAxisMotionValue(g).get()||0;if(ra.test(v)){const{projection:S}=this.visualElement;if(S&&S.layout){const E=S.layout.layoutBox[g];E&&(v=xr(E)*(parseFloat(v)/100))}}this.originPoint[g]=v}),m&&Tn.update(()=>m(h,d),!1,!0),qE(this.visualElement,"transform");const{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(h,d)=>{this.latestPointerEvent=h,this.latestPanInfo=d;const{dragPropagation:f,dragDirectionLock:p,onDirectionLock:m,onDrag:y}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:g}=d;if(p&&this.currentDirection===null){this.currentDirection=q9e(g),this.currentDirection!==null&&m&&m(this.currentDirection);return}this.updateAxis("x",d.point,g),this.updateAxis("y",d.point,g),this.visualElement.render(),y&&Tn.update(()=>y(h,d),!1,!0)},c=(h,d)=>{this.latestPointerEvent=h,this.latestPanInfo=d,this.stop(h,d),this.latestPointerEvent=null,this.latestPanInfo=null},l=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:u}=this.getProps();this.panSession=new vZ(t,{onSessionStart:o,onStart:s,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:i,contextWindow:yZ(this.visualElement),element:this.visualElement.current})}stop(t,n){const i=t||this.latestPointerEvent,r=n||this.latestPanInfo,o=this.isDragging;if(this.cancel(),!o||!r||!i)return;const{velocity:s}=r;this.startAnimation(s);const{onDragEnd:a}=this.getProps();a&&Tn.postRender(()=>a(i,r))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,i){const{drag:r}=this.getProps();if(!i||!r1(t,r,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(s=U9e(s,this.constraints[t],this.elastic[t])),o.set(s)}resolveConstraints(){const{dragConstraints:t,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;t&&ad(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=W9e(i.layoutBox,t):this.constraints=!1,this.elastic=j9e(n),r!==this.constraints&&!ad(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&oa(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=H9e(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!ad(t))return!1;const i=t.current;Ua(i!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=oVe(i,r.root,this.visualElement.getTransformPagePoint());let s=B9e(r.layout.layoutBox,o);if(n){const a=n(nVe(s));this.hasMutatedConstraints=!!a,a&&(s=sX(a))}return s}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=oa(u=>{if(!r1(u,n,this.currentDirection))return;let h=c&&c[u]||{};s&&(h={min:0,max:0});const d=r?200:1e6,f=r?40:1e7,p={type:"inertia",velocity:i?t[u]:0,bounceStiffness:d,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...o,...h};return this.startAxisValueAnimation(u,p)});return Promise.all(l).then(a)}startAxisValueAnimation(t,n){const i=this.getAxisMotionValue(t);return qE(this.visualElement,t),i.start(KE(t,i,0,n,this.visualElement,!1))}stopAnimation(){oa(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps(),r=i[n];return r||this.visualElement.getValue(t,(i.initial?i.initial[t]:void 0)||0)}snapToCursor(t){oa(n=>{const{drag:i}=this.getProps();if(!r1(n,i,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(n);if(r&&r.layout){const{min:s,max:a}=r.layout.layoutBox[n],c=o.get()||0;o.set(t[n]-Dn(s,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!ad(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};oa(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const c=a.get();r[s]=Y9e({min:c,max:c},this.constraints[s])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.constraints=!1,this.resolveConstraints(),oa(s=>{if(!r1(s,t,null))return;const a=this.getAxisMotionValue(s),{min:c,max:l}=this.constraints[s];a.set(Dn(c,l,r[s]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;K9e.set(this.visualElement,this);const t=this.visualElement.current,n=I0(t,"pointerdown",l=>{const{drag:u,dragListener:h=!0}=this.getProps(),d=l.target,f=d!==t&&AGe(d);u&&h&&!f&&this.start(l)});let i;const r=()=>{const{dragConstraints:l}=this.getProps();ad(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),i||(i=Q9e(t,l.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Tn.read(r);const a=C0(window,"resize",()=>this.scalePositionWithinConstraints()),c=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(oa(h=>{const d=this.getAxisMotionValue(h);d&&(this.originPoint[h]+=l[h].translate,d.set(d.get()+l[h].translate))}),this.visualElement.render())}));return()=>{a(),n(),s(),c&&c(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:s=CT,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function RZ(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function Q9e(e,t,n){const i=qk(e,RZ(n)),r=qk(t,RZ(n));return()=>{i(),r()}}function r1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function q9e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class $9e extends jc{constructor(t){super(t),this.removeGroupControls=No,this.removeListeners=No,this.controls=new J9e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||No}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const RT=e=>(t,n)=>{e&&Tn.update(()=>e(t,n),!1,!0)};class eFe extends jc{constructor(){super(...arguments),this.removePointerDownListener=No}onPointerDown(t){this.session=new vZ(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:yZ(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:RT(t),onStart:RT(n),onMove:RT(i),onEnd:(o,s)=>{delete this.session,r&&Tn.postRender(()=>r(o,s))}}}mount(){this.removePointerDownListener=I0(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let IT=!1;class tFe extends R.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i,layoutId:r}=this.props,{projection:o}=t;o&&(n.group&&n.group.add(o),i&&i.register&&r&&i.register(o),IT&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),t1.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:i,drag:r,isPresent:o}=this.props,{projection:s}=i;return s&&(s.isPresent=o,t.layoutDependency!==n&&s.setOptions({...s.options,layoutDependency:n}),IT=!0,r||t.layoutDependency!==n||n===void 0||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Tn.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),rT.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=t;IT=!0,r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function IZ(e){const[t,n]=c9e(),i=R.useContext(IN);return ce.jsx(tFe,{...e,layoutGroup:i,switchLayoutGroup:R.useContext(mZ),isPresent:t,safeToRemove:n})}const nFe={pan:{Feature:eFe},drag:{Feature:$9e,ProjectionNode:oZ,MeasureLayout:IZ}};function MZ(e,t,n){const{props:i}=e;e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,o=i[r];o&&Tn.postRender(()=>o(t,R0(t)))}class iFe extends jc{mount(){const{current:t}=this.node;t&&(this.unmount=OGe(t,(n,i)=>(MZ(this.node,i,"Start"),r=>MZ(this.node,r,"End"))))}unmount(){}}class rFe extends jc{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=m0(C0(this.node.current,"focus",()=>this.onFocus()),C0(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function LZ(e,t,n){const{props:i}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&i.whileTap&&e.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),o=i[r];o&&Tn.postRender(()=>o(t,R0(t)))}class oFe extends jc{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=NGe(t,(r,o)=>(LZ(this.node,o,"Start"),(s,{success:a})=>LZ(this.node,s,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const MT=new WeakMap,LT=new WeakMap,sFe=e=>{const t=MT.get(e.target);t&&t(e)},aFe=e=>{e.forEach(sFe)};function cFe({root:e,...t}){const n=e||document;LT.has(n)||LT.set(n,{});const i=LT.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver(aFe,{root:e,...t})),i[r]}function lFe(e,t,n){const i=cFe(t);return MT.set(e,n),i.observe(e),()=>{MT.delete(e),i.unobserve(e)}}const uFe={some:0,all:1};class hFe extends jc{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:i,amount:r="some",once:o}=t,s={root:n?n.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:uFe[r]},a=c=>{const{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,o&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);const{onViewportEnter:u,onViewportLeave:h}=this.node.getProps(),d=l?u:h;d&&d(c)};return lFe(this.node.current,s,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(dFe(t,n))&&this.startObserver()}unmount(){}}function dFe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const fFe={...N9e,...{inView:{Feature:hFe},tap:{Feature:oFe},focus:{Feature:rFe},hover:{Feature:iFe}},...nFe,...{layout:{ProjectionNode:oZ,MeasureLayout:IZ}}},pFe=G9e(fFe,V9e);function PZ(e){const t=MN(()=>tu(e)),{isStatic:n}=R.useContext(vT);if(n){const[,i]=R.useState(e);R.useEffect(()=>t.on("change",i),[])}return t}function PT(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function mFe(e,t){var n=R.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(i){var r=n.value;r!==i&&(n.value=i,n.callback(i,r))}}}})[0];return n.callback=t,n.facade}var gFe=typeof window<"u"?A0.useLayoutEffect:A0.useEffect,OZ=new WeakMap;function yFe(e,t){var n=mFe(null,function(i){return e.forEach(function(r){return PT(r,i)})});return gFe(function(){var i=OZ.get(n);if(i){var r=new Set(i),o=new Set(e),s=n.current;r.forEach(function(a){o.has(a)||PT(a,null)}),o.forEach(function(a){r.has(a)||PT(a,s)})}OZ.set(n,e)},[e]),n}const bFe=new cs(it.WGS84,b.ZERO),OT=R.forwardRef(({position:e,children:t,...n},i)=>{const r=Wo(()=>new b);e?.clone(r);const o=PZ(""),s=PZ("none"),{toWindowPosition:a,getCamera:c,toXYZ:l,isPositionVisible:u}=li(),h=R.useRef(null);Gl(()=>{if(h.current==null)return;let f;try{const v=a?.([r.x,r.y,r.z]);f=new me(v?.[0],v?.[1])}catch{s.set("none");return}const p=c?.();if(!p)return;const m=l?.(p?.lng,p?.lat,p?.height);if(!m)return;if(bFe.cameraPosition=new b(m[0],m[1],m[2]),f==null||f.x<0||f.y<0||f.x>window.innerWidth||f.y>window.innerHeight||!u?.([r.x,r.y,r.z])){s.set("none");return}const y=`calc(${f.x}px - 50%)`,g=`calc(${f.y}px - 50%)`;o.set(`translate(${y}, ${g})`),s.set("block")});const d=yFe([h,i]);return ce.jsx(pFe.div,{ref:d,...n,style:{...n.style,transform:o,display:s,position:"absolute",pointerEvents:"none",left:0,top:0},children:t})});OT.displayName="ScreenSpaceElement";const _Fe=({a:e,b:t,color:n})=>{const i=R.useRef([e,t]);i.current=[e,t];const r=Wo(()=>new wo(()=>i.current,!1)),o=R.useMemo(()=>({polyline:{positions:r,width:1.5,material:new Ol({color:n,dashLength:8})}}),[n,r]);return ce.jsx(p0,{...o})},vFe=({a:e,b:t,extrudedHeight:n,color:i,showLine:r})=>{const o=Wo(()=>new b);return ce.jsxs(ce.Fragment,{children:[ce.jsx(OT,{position:b.midpoint(e,t,o),children:ce.jsx(RN,{children:n<1e3?`${n.toFixed(1)} m`:`${(n/1e3).toFixed(1)} km`})}),r&&ce.jsx(_Fe,{a:e,b:t,color:i})]})},GZ=R.memo(({geometryOptions:{controlPoints:e,type:t},extrudedHeight:n,color:i,isEditing:r,extrudedPoint:o,centroidBasePoint:s,centroidExtrudedPoint:a,catchedExtrudedPoint:c,handleControlPointMouseEvent:l})=>{const u=e[e.length-1],h=o?new b(...o):void 0,d=s?new b(...s):void 0,f=a?new b(...a):void 0;return ce.jsxs(ce.Fragment,{children:[h&&ce.jsxs(ce.Fragment,{children:[ce.jsx(f0,{index:-1,position:h,isEditing:r,isExtrudedControlPoint:!0,handleControlPointMouseEvent:l}),(!r||c)&&ce.jsx(vFe,{a:u,b:h,extrudedHeight:n,color:r?B.fromCssColorString(d0):i,showLine:t!=="extrudedPolygon"})]}),d&&ce.jsx(f0,{index:-1,position:d,isEditing:r,isExtrudedControlPoint:!0}),f&&ce.jsx(f0,{index:-1,position:f,isEditing:r,isExtrudedControlPoint:!0})]})});GZ.displayName="ExtrudedControlPoints";const wFe=({id:e,hierarchy:t,extrudedHeight:n,color:i,disableShadow:r=!1,isEditing:o})=>{const s=R.useRef(t);s.current=t;const c=Wo(()=>new wo(()=>s.current,!1)),l=R.useRef(n);l.current=n;const h=Wo(()=>new wo(()=>l.current,!1)),d=R.useMemo(()=>({polygon:{hierarchy:c,heightReference:vl.RELATIVE_TO_TERRAIN,extrudedHeight:h,extrudedHeightReference:vl.RELATIVE_TO_TERRAIN,fill:!0,outline:!0,outlineWidth:1,outlineColor:o?B.fromCssColorString(d0):i?.withAlpha(1),material:new Rl(o?i?.withAlpha(.2):i),classificationType:eo.TERRAIN,shadows:r?Zf.DISABLED:Zf.ENABLED}}),[h,r,c,i,o]),{requestRender:f}=li();return f?.(),ce.jsx(p0,{id:e,...d})},xFe=({dynamic:e=!1,hierarchy:t,color:n})=>{const i=R.useRef(t);i.current=t;const r=Wo(()=>new wo(()=>i.current,!1)),o=e?r:t,s=R.useMemo(()=>({polygon:{hierarchy:o,fill:!0,material:n?.withAlpha(.5),classificationType:eo.TERRAIN}}),[n,o]),{requestRender:a}=li();return a?.(),ce.jsx(p0,{...s})},SFe=({dynamic:e=!1,positions:t,color:n,isEditing:i})=>{const r=R.useRef(t);r.current=t;const o=Wo(()=>new wo(()=>r.current,!e)),s=e?o:t,a=R.useMemo(()=>({polyline:{positions:s,width:1.5,material:i?B.fromCssColorString(d0):n,classificationType:eo.TERRAIN,clampToGround:!0}}),[n,s,i]),{requestRender:c}=li();return c?.(),ce.jsx(p0,{...a})},VZ=new b,FZ=R.memo(({geometryOptions:{type:e,controlPoints:t},isEditing:n,handleAddControlPoint:i})=>{if(!["polyline","polygon","extrudedPolygon"].includes(e))return null;const r=[];for(let o=0;o<t.length-1;o++){const s=t[o+1],a=b.midpoint(t[o],s,VZ);r.push(a.clone())}if(e==="polygon"||e==="extrudedPolygon"){const o=b.midpoint(t[t.length-1],t[0],VZ);r.push(o.clone())}return ce.jsx(ce.Fragment,{children:r.map((o,s)=>ce.jsx(f0,{position:o,isAddingPoint:!0,index:s,clampToGround:!0,isEditing:n,handleControlPointMouseEvent:()=>i?.([o.x,o.y,o.z],s)},s))})});FZ.displayName="SurfaceAddingPoints";const EFe=({a:e,b:t,color:n})=>{const i=R.useRef([e,t]);i.current=[e,t];const r=Wo(()=>new wo(()=>i.current,!1)),o=R.useMemo(()=>({polyline:{positions:r,width:1.5,material:new Ol({color:n,dashLength:8}),classificationType:eo.TERRAIN,clampToGround:!0}}),[n,r]),{requestRender:s}=li();return s?.(),ce.jsx(p0,{...o})},TFe=({a:e,b:t,color:n,showLine:i=!1})=>{const r=Wo(()=>new b),{getSurfaceDistance:o}=li(),s=o?.(e,t);return s!==void 0?ce.jsxs(ce.Fragment,{children:[ce.jsx(OT,{position:b.midpoint(e,t,r),children:ce.jsx(RN,{children:s<1e3?`${s.toFixed(1)} m`:`${(s/1e3).toFixed(1)} km`})}),i&&ce.jsx(EFe,{a:e,b:t,color:n})]}):null},AZ=new b,zZ=R.memo(({geometryOptions:{type:e,controlPoints:t},color:n,isEditing:i,catchedControlPointIndex:r,selectedControlPointIndex:o,handleControlPointMouseEvent:s})=>{const a=[];if(t.length>=2)if(i){if(r!==void 0&&r!==-1)switch(e){case"polyline":r>0&&a.push({points:[t[r-1],t[r]],showLine:!1}),r<t.length-1&&a.push({points:[t[r],t[r+1]],showLine:!1});break;case"circle":case"extrudedCircle":r!==2&&a.push({points:[t[0],t[1]],showLine:!0});break;case"rectangle":case"extrudedRectangle":if(r<=1)a.push({points:[t[0],t[1]],showLine:!1});else if(r===2){const[c,l,u]=t,h=b.midpoint(c,l,AZ);a.push({points:[h,u],showLine:!0})}break;case"polygon":case"extrudedPolygon":a.push({points:[t[r],r===0?t[t.length-1]:t[r-1]],showLine:!1}),a.push({points:[t[r],r===t.length-1?t[0]:t[r+1]],showLine:!1});break}}else switch(e){case"rectangle":case"extrudedRectangle":if(t.length===2)a.push({points:t,showLine:!0});else if(t.length===3){const[c,l,u]=t,h=b.midpoint(c,l,AZ);a.push({points:[h,u],showLine:!0})}break;default:a.push({points:t.slice(-2),showLine:e==="circle"});break}return ce.jsxs(ce.Fragment,{children:[t.map((c,l)=>ce.jsx(f0,{position:c,index:l,isSelected:o===l,clampToGround:!0,isEditing:i,handleControlPointMouseEvent:s},l)),a.map(({points:c,showLine:l},u)=>ce.jsx(TFe,{a:c[0],b:c[1],color:i?B.fromCssColorString(d0):n,showLine:l},u))]})});zZ.displayName="SurfaceControlPoints";const NZ=R.memo(({geometryOptions:e,extrudedHeight:t,disableShadow:n,color:i,isEditing:r,extrudedPoint:o,centroidBasePoint:s,centroidExtrudedPoint:a,catchedControlPointIndex:c,catchedExtrudedPoint:l,selectedControlPointIndex:u,handleControlPointMouseEvent:h,handleAddControlPoint:d})=>{const f=R.useMemo(()=>e?{...e,controlPoints:e?.controlPoints.map(v=>new M.Cartesian3(...v))}:null,[e]),p=R.useMemo(()=>f?_N(f):null,[f]),{positionsArray:m,hierarchyArray:y}=R.useMemo(()=>p?.type==="Point"?{}:p?.type==="LineString"?{positionsArray:dF(p)}:p!=null?{positionsArray:dF(p),hierarchyArray:fF(p)}:{},[p]),g=R.useMemo(()=>B.fromCssColorString(i??bPe),[i]);return ce.jsxs(ce.Fragment,{children:[m?.map((v,S)=>ce.jsx(SFe,{dynamic:!0,positions:v,color:g,isEditing:r},S)),y?.map((v,S)=>ce.jsx(xFe,{dynamic:!0,hierarchy:v,color:g},S)),f!=null&&(!t||r)&&ce.jsx(zZ,{geometryOptions:f,color:g,isEditing:r,catchedControlPointIndex:c,selectedControlPointIndex:u,handleControlPointMouseEvent:h}),f!=null&&r&&ce.jsx(FZ,{geometryOptions:f,isEditing:r,handleAddControlPoint:d}),f!=null&&t&&ce.jsx(GZ,{geometryOptions:f,extrudedHeight:t,extrudedPoint:o,centroidBasePoint:s,centroidExtrudedPoint:a,catchedExtrudedPoint:l,color:g,isEditing:r,handleControlPointMouseEvent:h}),t&&y?.map((v,S)=>ce.jsx(wFe,{hierarchy:v,extrudedHeight:t,disableShadow:n,color:g,isEditing:r},S))]})});NZ.displayName="SketchComponent";const CFe=({className:e,style:t,property:n,time:i,camera:r,small:o,ready:s,children:a,selectedLayerId:c,isLayerDraggable:l,isLayerDragging:u,shouldRender:h,layerSelectionReason:d,meta:f,customProvider:p,displayCredits:m,hasCesiumIonAsset:y,layersRef:g,featureFlags:v,requestingRenderMode:S,timelineManagerRef:E,cameraForceHorizontalRoll:C,onLayerSelect:O,onCameraChange:V,onLayerDrag:A,onLayerDrop:G,onLayerEdit:N,onLayerSelectWithRectStart:k,onLayerSelectWithRectMove:P,onLayerSelectWithRectEnd:w,onMount:x,onLayerVisibility:I,onLayerLoad:X,onCreditsUpdate:D},Y)=>{const{cesium:H,mouseEventHandles:J,cesiumIonAccessToken:z,context:W,layerSelectWithRectEventHandlers:Q,sceneLight:q,sceneBackgroundColor:se,sceneMsaaSamples:xe,sceneMode:ge,cameraViewBoundaries:Fe,cameraViewOuterBoundaries:Pe,cameraViewBoundariesMaterial:fe,handleCameraChange:Ze,handleCameraMoveEnd:et,handleUpdate:tt,handleClick:Z,handleMount:pe,handleUnmount:ue,handleTilesChange:$,handleTerrainProviderChange:j}=rPe({ref:Y,property:n,time:i,selectedLayerId:c,selectionReason:d,meta:f,customProvider:p,layersRef:g,featureFlags:v,timelineManagerRef:E,isLayerDraggable:l,isLayerDragging:u,shouldRender:h,requestingRenderMode:S,camera:r,cameraForceHorizontalRoll:C,onLayerDrag:A,onLayerDrop:G,onLayerSelect:O,onLayerEdit:N,onLayerSelectWithRectStart:k,onLayerSelectWithRectMove:P,onLayerSelectWithRectEnd:w,onLayerVisibility:I,onLayerLoad:X,onCameraChange:V,onMount:x,onCreditsUpdate:D,hasCesiumIonAsset:y}),ee=n?.terrain?.enabled?n?.scene?.verticalExaggeration??1:1;return ce.jsxs(Ere,{ref:H,onUpdate:tt,className:e,requestRenderMode:!0,animation:!1,timeline:!1,baseLayer:!1,fullscreenButton:!1,homeButton:!1,geocoder:!1,infoBox:!1,baseLayerPicker:!1,navigationHelpButton:!1,projectionPicker:!1,sceneModePicker:!1,creditContainer:m?void 0:RFe,style:{width:o?"300px":"auto",height:o?"300px":"100%",display:s?void 0:"none",cursor:u?"grab":void 0,...t},shadows:!!n?.scene?.shadow?.enabled,onClick:Z,onDoubleClick:J.doubleClick,onMouseDown:J.mouseDown,onMouseUp:J.mouseUp,onRightClick:J.rightClick,onRightDown:J.rightDown,onRightUp:J.rightUp,onMiddleClick:J.middleClick,onMiddleDown:J.middleDown,onMiddleUp:J.middleUp,onMouseMove:J.mouseMove,onMouseEnter:J.mouseEnter,onMouseLeave:J.mouseLeave,onWheel:J.wheel,automaticallyTrackDataSourceClocks:!1,children:[ce.jsx(Bbe,{onMount:pe,onUnmount:ue}),ce.jsx(Koe,{timelineManagerRef:E}),ce.jsx(ebe,{tiles:n?.tiles,cesiumIonAccessToken:z,customProvider:p,onTilesChange:$}),ce.jsx(yF,{tileLabels:n?.tileLabels}),ce.jsx(ibe,{property:n,timelineManagerRef:E}),ce.jsxs(ZM,{useDefault:!0,children:[ce.jsx(hc,{type:M.ScreenSpaceEventType.LEFT_CLICK}),ce.jsx(hc,{type:M.ScreenSpaceEventType.LEFT_DOUBLE_CLICK})]}),ce.jsxs(ZM,{children:[ce.jsx(hc,{type:M.ScreenSpaceEventType.LEFT_DOWN,action:Q.start.handler}),ce.jsx(hc,{type:M.ScreenSpaceEventType.LEFT_DOWN,modifier:M.KeyboardEventModifier.SHIFT,action:Q.start.shift}),ce.jsx(hc,{type:M.ScreenSpaceEventType.MOUSE_MOVE,action:Q.move.handler}),ce.jsx(hc,{type:M.ScreenSpaceEventType.MOUSE_MOVE,modifier:M.KeyboardEventModifier.SHIFT,action:Q.move.shift}),ce.jsx(hc,{type:M.ScreenSpaceEventType.LEFT_UP,action:Q.end.handler}),ce.jsx(hc,{type:M.ScreenSpaceEventType.LEFT_UP,modifier:M.KeyboardEventModifier.SHIFT,action:Q.end.shift})]}),ce.jsx(fre,{maximumZoomDistance:n?.camera?.limiter?.enabled?n.camera?.limiter?.targetArea?.height??Number.POSITIVE_INFINITY:Number.POSITIVE_INFINITY,enableCollisionDetection:!n?.camera?.allowEnterGround}),ce.jsx(Hne,{percentageChanged:.2,onChange:Ze,onMoveEnd:et}),Fe&&n?.camera?.limiter?.showHelper&&ce.jsx(uc,{children:ce.jsx(ml,{positions:Fe,width:1,material:M.Color.RED,arcType:M.ArcType.RHUMB})}),Pe&&n?.camera?.limiter?.showHelper&&ce.jsx(uc,{children:ce.jsx(ml,{positions:Pe,width:1,material:fe,arcType:M.ArcType.RHUMB})}),ce.jsx(hre,{backgroundColor:se,light:q,mode:ge,msaaSamples:xe,useDepthPicking:!0,useWebVR:!!n?.scene?.vr||void 0,debugShowFramesPerSecond:!!n?.debug?.showFramesPerSecond,verticalExaggerationRelativeHeight:n?.scene?.verticalExaggerationRelativeHeight,verticalExaggeration:ee}),ce.jsx(yre,{show:n?.sky?.skyBox?.show??!0}),ce.jsx(wie,{enabled:n?.sky?.fog?.enabled??!0,density:n?.sky?.fog?.density}),ce.jsx(_re,{show:n?.sky?.sun?.show??!0}),ce.jsx(Hie,{show:n?.sky?.moon?.show??!0}),ce.jsx(mre,{show:n?.sky?.skyAtmosphere?.show??!0,atmosphereLightIntensity:n?.sky?.skyAtmosphere?.lightIntensity,saturationShift:n?.sky?.skyAtmosphere?.saturationShift,brightnessShift:n?.sky?.skyAtmosphere?.brightnessShift}),ce.jsx(Mse,{property:n,cesiumIonAccessToken:z,onTerrainProviderChange:j}),ce.jsx(CF.Provider,{value:W,children:s?a:null}),ce.jsx(gPe,{...yPe[n?.render?.ambientOcclusion?.quality||"low"],enabled:!!n?.render?.ambientOcclusion?.enabled,intensity:n?.render?.ambientOcclusion?.intensity??100,outputType:n?.render?.ambientOcclusion?.ambientOcclusionOnly?TN.Occlusion:null})]})},RFe=document.createElement("div"),kZ={cesium:{component:R.forwardRef(CFe),featureComponent:X5e,clusterComponent:joe,sketchComponent:NZ,delegatedDataTypes:["czml","wms","mvt","3dtiles","osm-buildings","reearth-buildings","google-photorealistic","kml"]}};function IFe({error:e,resetErrorBoundary:t}){const i=e?.message??String(e);return ce.jsxs("div",{children:[ce.jsx("h1",{children:"Oops! An Error Occurred"}),ce.jsx("p",{children:i}),ce.jsx("p",{children:ce.jsx("button",{style:{color:"#fff"},onClick:t,children:"Retry"})})]})}const MFe="0.0.7-alpha.75",LFe=({viewerProperty:e})=>{const t=R.useRef(e);t.current=e;const n=R.useMemo(()=>({get version(){return MFe},get viewerProperty(){return t.current}}),[]);R.useEffect(()=>{window.reearth_core=n},[n])},PFe=768,OFe=({wrapperRef:e})=>{const t=R.useMemo(()=>GFe(new URLSearchParams(window.location.search)),[]),[n,i]=R.useState({width:void 0,height:void 0,isMobile:void 0,query:t});return R.useEffect(()=>{const r=new ResizeObserver(o=>{const[s]=o;let a,c;if(s.contentBoxSize){const l=Array.isArray(s.contentBoxSize)?s.contentBoxSize[0]:s.contentBoxSize;a=l.inlineSize,c=l.blockSize}else s.contentRect?(a=s.contentRect.width,c=s.contentRect.height):(a=e.current?.clientWidth,c=e.current?.clientHeight);i(l=>({width:a,height:c,isMobile:a?a<=PFe:void 0,query:l.query}))});return e.current&&r.observe(e.current),()=>{r.disconnect()}},[e]),n};function GFe(e){const t={};for(const[n,i]of e)t[n]=i;return t}function VFe({camera:e,interactionMode:t,zoomedLayerId:n,viewerProperty:i,onLayerSelect:r,onCameraChange:o,onInteractionModeChange:s,onZoomToLayer:a,onLayerDrop:c,onSketchTypeChangeProp:l},u){const h=R.useRef(null);R.useImperativeHandle(u,()=>h.current,[]);const d=R.useRef(null),f=OFe({wrapperRef:d}),[p,m]=R.useState({}),[y,g]=R.useState(),[v,S]=R.useState(),E=R.useCallback(async(De,Tt,At,St,Xt)=>{const ni=p.layer?.layer?.type==="simple"&&p.layer?.layer?.data?.isSketchLayer;if(p.layerId===De&&p.featureId===Tt&&!ni)return;const Qn=await At?.(),kn=De&&Tt?(ni?Qn?.features?.find(Wn=>Wn.id===Tt):h.current?.engine.findComputedFeatureById?.(De,Tt))??Xt?.feature:void 0;g(De&&Tt?h.current?.engine.findFeatureById?.(De,Tt):void 0),S(kn),m(Wn=>Wn.layerId===De&&Wn.featureId===Tt?Wn:{layerId:De,featureId:Tt,layer:Qn,reason:St}),r?.(De,At,kn,St)},[p,r]),C=R.useRef(void 0),[O,V]=XZ(e,o),[A,G]=R.useState(!1),N=R.useCallback(De=>{G(!!De)},[]),[k,P]=XZ(t||"default",s);R.useEffect(()=>{k==="default"&&h?.current?.engine?.setCursor("auto")},[k]);const w=N0[k??"default"],x=R.useRef(void 0),I=R.useCallback(De=>{x.current=De},[]),X=R.useCallback(De=>{x.current?.(De)},[]),D=R.useRef(void 0),Y=R.useCallback(De=>{D.current=De},[]),H=R.useCallback(De=>{D.current?.(De)},[]),J=R.useRef(void 0),z=R.useCallback(De=>{J.current=De},[]),W=R.useCallback(De=>{J.current?.(De)},[]),Q=R.useRef(void 0),q=R.useCallback(De=>{Q.current=De},[]),se=R.useCallback(De=>{Q.current?.(De)},[]),xe=R.useRef(void 0),ge=R.useCallback(De=>{xe.current=De},[]),Fe=R.useCallback(De=>{xe.current?.(De)},[]),Pe=R.useRef(void 0),fe=R.useCallback(De=>{Pe.current=De},[]),Ze=R.useCallback(De=>{Pe.current?.(De)},[]),et=R.useRef([]),tt=R.useCallback(De=>{et.current.push(De)},[]),Z=R.useCallback(De=>{et.current.forEach(Tt=>Tt(De))},[]),pe=R.useRef([]),ue=R.useCallback(De=>{pe.current.push(De)},[]),$=R.useCallback(De=>{pe.current.forEach(Tt=>Tt(De))},[]),j=R.useRef([]),ee=R.useCallback(De=>{j.current.push(De)},[]),le=R.useCallback(De=>{j.current.forEach(Tt=>Tt(De))},[]),ye=R.useRef([]),re=R.useCallback(De=>{ye.current.push(De)},[]),Ie=R.useCallback((De,Tt)=>{ye.current.forEach(At=>At(De)),l?.(De,Tt)},[l]);R.useEffect(()=>{n&&(h.current?.engine?.lookAtLayer(n),a?.(void 0))},[n,a]);const[we,he]=R.useState(!1),ze=R.useCallback(()=>{he(!0)},[]),Qe=R.useCallback((De,Tt,At)=>{he(!1);const St=h.current?.layers.findById(De),Xt=St?.property.default.location?"default.location":St?.property.default.position?"default.position":void 0;At&&St&&St.propertyId&&Xt&&c?.(St.propertyId,Xt,At)},[c,h]),nt=R.useMemo(()=>({interactionMode:k,selectedLayer:p,selectedComputedFeature:v,viewport:f,handleCameraForceHorizontalRollChange:N,handleInteractionModeChange:P,onSketchPluginFeatureCreate:tt,onSketchPluginFeatureUpdate:ue,onSketchPluginFeatureDelete:ee,onSketchTypeChange:re,onLayerVisibility:Y,onLayerLoad:z,onLayerEdit:I,onLayerSelectWithRectStart:q,onLayerSelectWithRectMove:ge,onLayerSelectWithRectEnd:fe}),[k,p,v,f,P,N,I,tt,ue,ee,re,Y,z,q,ge,fe]),at=R.useMemo(()=>({position:"relative",width:"100%",height:"100%",overflow:"hidden"}),[]);return LFe({viewerProperty:i}),{mapRef:h,wrapperRef:d,selectedFeature:y,camera:O,featureFlags:w,isLayerDragging:we,timelineManagerRef:C,cameraForceHorizontalRoll:A,coreContextValue:nt,containerStyle:at,overriddenInteractionMode:k,handleLayerSelect:E,handleLayerDrag:ze,handleLayerDrop:Qe,handleLayerEdit:X,handleCameraChange:V,handleInteractionModeChange:P,handleSketchPluginFeatureCreate:Z,handleSketchPluginFeatureUpdate:$,handleSketchPluginFeatureDelete:le,handleSketchTypeChange:Ie,handleLayerVisibility:H,handleLayerLoad:W,handleLayerSelectWithRectStart:se,handleLayerSelectWithRectMove:Fe,handleLayerSelectWithRectEnd:Ze}}function XZ(e,t){const[n,i]=R.useState(e),r=R.useCallback(o=>{o&&(i(o),t?.(o))},[t]);return R.useEffect(()=>{i(e)},[e]),[n,r]}const FFe=R.memo(R.forwardRef(({engine:e,isBuilt:t,isEditable:n,viewerProperty:i,layers:r,clusters:o,small:s,ready:a,hiddenLayers:c,camera:l,time:u,interactionMode:h,shouldRender:d,meta:f,customProvider:p,displayCredits:m=!0,style:y,zoomedLayerId:g,children:v,onLayerDrop:S,onLayerSelect:E,onCameraChange:C,onZoomToLayer:O,onInteractionModeChange:V,onMount:A,onSketchTypeChangeProp:G,onSketchFeatureCreate:N,onSketchFeatureUpdate:k,onSketchFeatureDelete:P,onAPIReady:w,onCreditsUpdate:x},I)=>{const{mapRef:X,wrapperRef:D,selectedFeature:Y,camera:H,featureFlags:J,isLayerDragging:z,timelineManagerRef:W,cameraForceHorizontalRoll:Q,coreContextValue:q,containerStyle:se,overriddenInteractionMode:xe,handleLayerSelect:ge,handleLayerDrag:Fe,handleLayerDrop:Pe,handleLayerEdit:fe,handleCameraChange:Ze,handleInteractionModeChange:et,handleSketchPluginFeatureCreate:tt,handleSketchPluginFeatureUpdate:Z,handleSketchPluginFeatureDelete:pe,handleSketchTypeChange:ue,handleLayerVisibility:$,handleLayerLoad:j,handleLayerSelectWithRectStart:ee,handleLayerSelectWithRectMove:le,handleLayerSelectWithRectEnd:ye}=VFe({camera:l,interactionMode:h,zoomedLayerId:g,viewerProperty:i,onLayerSelect:E,onCameraChange:C,onZoomToLayer:O,onLayerDrop:S,onInteractionModeChange:V,onSketchTypeChangeProp:G},I);return ce.jsx(Uoe,{FallbackComponent:IFe,children:ce.jsx(Hoe,{mapRef:X,children:ce.jsxs("div",{ref:D,style:se,children:[ce.jsx(p5,{ref:X,isBuilt:t,isEditable:n,engine:e,layers:r,engines:kZ,camera:H,cameraForceHorizontalRoll:Q,clusters:o,hiddenLayers:c,isLayerDragging:z,isLayerDraggable:n,meta:f,customProvider:p,displayCredits:m,style:y,featureFlags:J,shouldRender:d,property:i,time:u,small:s,ready:a,timelineManagerRef:W,interactionMode:xe,selectedFeature:Y,onCameraChange:Ze,onLayerDrag:Fe,onLayerDrop:Pe,onLayerSelect:ge,onLayerEdit:fe,overrideInteractionMode:et,onSketchFeatureCreate:N,onSketchPluginFeatureCreate:tt,onSketchFeatureUpdate:k,onSketchPluginFeatureUpdate:Z,onSketchFeatureDelete:P,onSketchPluginFeatureDelete:pe,onSketchTypeChange:ue,onMount:A,onLayerVisibility:$,onLayerLoad:j,onLayerSelectWithRectStart:ee,onLayerSelectWithRectMove:le,onLayerSelectWithRectEnd:ye,onAPIReady:w,onCreditsUpdate:x}),ce.jsx(g5.Provider,{value:q,children:v})]})})})}));var cd=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},sa=[],Zo=[],AFe=typeof Uint8Array<"u"?Uint8Array:Array,GT=!1;function ZZ(){GT=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t<n;++t)sa[t]=e[t],Zo[e.charCodeAt(t)]=t;Zo[45]=62,Zo[95]=63}function zFe(e){GT||ZZ();var t,n,i,r,o,s,a=e.length;if(a%4>0)throw new Error("Invalid string. Length must be a multiple of 4");o=e[a-2]==="="?2:e[a-1]==="="?1:0,s=new AFe(a*3/4-o),i=o>0?a-4:a;var c=0;for(t=0,n=0;t<i;t+=4,n+=3)r=Zo[e.charCodeAt(t)]<<18|Zo[e.charCodeAt(t+1)]<<12|Zo[e.charCodeAt(t+2)]<<6|Zo[e.charCodeAt(t+3)],s[c++]=r>>16&255,s[c++]=r>>8&255,s[c++]=r&255;return o===2?(r=Zo[e.charCodeAt(t)]<<2|Zo[e.charCodeAt(t+1)]>>4,s[c++]=r&255):o===1&&(r=Zo[e.charCodeAt(t)]<<10|Zo[e.charCodeAt(t+1)]<<4|Zo[e.charCodeAt(t+2)]>>2,s[c++]=r>>8&255,s[c++]=r&255),s}function NFe(e){return sa[e>>18&63]+sa[e>>12&63]+sa[e>>6&63]+sa[e&63]}function kFe(e,t,n){for(var i,r=[],o=t;o<n;o+=3)i=(e[o]<<16)+(e[o+1]<<8)+e[o+2],r.push(NFe(i));return r.join("")}function DZ(e){GT||ZZ();for(var t,n=e.length,i=n%3,r="",o=[],s=16383,a=0,c=n-i;a<c;a+=s)o.push(kFe(e,a,a+s>c?c:a+s));return i===1?(t=e[n-1],r+=sa[t>>2],r+=sa[t<<4&63],r+="=="):i===2&&(t=(e[n-2]<<8)+e[n-1],r+=sa[t>>10],r+=sa[t>>4&63],r+=sa[t<<2&63],r+="="),o.push(r),o.join("")}function o1(e,t,n,i,r){var o,s,a=r*8-i-1,c=(1<<a)-1,l=c>>1,u=-7,h=n?r-1:0,d=n?-1:1,f=e[t+h];for(h+=d,o=f&(1<<-u)-1,f>>=-u,u+=a;u>0;o=o*256+e[t+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=s*256+e[t+h],h+=d,u-=8);if(o===0)o=1-l;else{if(o===c)return s?NaN:(f?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-l}return(f?-1:1)*s*Math.pow(2,o-i)}function UZ(e,t,n,i,r,o){var s,a,c,l=o*8-r-1,u=(1<<l)-1,h=u>>1,d=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:o-1,p=i?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+h>=1?t+=d/c:t+=d*Math.pow(2,1-h),t*c>=2&&(s++,c/=2),s+h>=u?(a=0,s=u):s+h>=1?(a=(t*c-1)*Math.pow(2,r),s=s+h):(a=t*Math.pow(2,h-1)*Math.pow(2,r),s=0));r>=8;e[n+f]=a&255,f+=p,a/=256,r-=8);for(s=s<<r|a,l+=r;l>0;e[n+f]=s&255,f+=p,s/=256,l-=8);e[n+f-p]|=m*128}var XFe={}.toString,WZ=Array.isArray||function(e){return XFe.call(e)=="[object Array]"},ZFe=50;_e.TYPED_ARRAY_SUPPORT=cd.TYPED_ARRAY_SUPPORT!==void 0?cd.TYPED_ARRAY_SUPPORT:!0,s1();function s1(){return _e.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Ba(e,t){if(s1()<t)throw new RangeError("Invalid typed array length");return _e.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=_e.prototype):(e===null&&(e=new _e(t)),e.length=t),e}function _e(e,t,n){if(!_e.TYPED_ARRAY_SUPPORT&&!(this instanceof _e))return new _e(e,t,n);if(typeof e=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return VT(this,e)}return BZ(this,e,t,n)}_e.poolSize=8192,_e._augment=function(e){return e.__proto__=_e.prototype,e};function BZ(e,t,n,i){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer?WFe(e,t,n,i):typeof t=="string"?UFe(e,t,n):BFe(e,t)}_e.from=function(e,t,n){return BZ(null,e,t,n)},_e.TYPED_ARRAY_SUPPORT&&(_e.prototype.__proto__=Uint8Array.prototype,_e.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&_e[Symbol.species]);function YZ(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function DFe(e,t,n,i){return YZ(t),t<=0?Ba(e,t):n!==void 0?typeof i=="string"?Ba(e,t).fill(n,i):Ba(e,t).fill(n):Ba(e,t)}_e.alloc=function(e,t,n){return DFe(null,e,t,n)};function VT(e,t){if(YZ(t),e=Ba(e,t<0?0:AT(t)|0),!_e.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}_e.allocUnsafe=function(e){return VT(null,e)},_e.allocUnsafeSlow=function(e){return VT(null,e)};function UFe(e,t,n){if((typeof n!="string"||n==="")&&(n="utf8"),!_e.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=HZ(t,n)|0;e=Ba(e,i);var r=e.write(t,n);return r!==i&&(e=e.slice(0,r)),e}function FT(e,t){var n=t.length<0?0:AT(t.length)|0;e=Ba(e,n);for(var i=0;i<n;i+=1)e[i]=t[i]&255;return e}function WFe(e,t,n,i){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(i||0))throw new RangeError("'length' is out of bounds");return n===void 0&&i===void 0?t=new Uint8Array(t):i===void 0?t=new Uint8Array(t,n):t=new Uint8Array(t,n,i),_e.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=_e.prototype):e=FT(e,t),e}function BFe(e,t){if(aa(t)){var n=AT(t.length)|0;return e=Ba(e,n),e.length===0||t.copy(e,0,0,n),e}if(t){if(typeof ArrayBuffer<"u"&&t.buffer instanceof ArrayBuffer||"length"in t)return typeof t.length!="number"||u4e(t.length)?Ba(e,0):FT(e,t);if(t.type==="Buffer"&&WZ(t.data))return FT(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function AT(e){if(e>=s1())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s1().toString(16)+" bytes");return e|0}_e.isBuffer=jr;function aa(e){return!!(e!=null&&e._isBuffer)}_e.compare=function(t,n){if(!aa(t)||!aa(n))throw new TypeError("Arguments must be Buffers");if(t===n)return 0;for(var i=t.length,r=n.length,o=0,s=Math.min(i,r);o<s;++o)if(t[o]!==n[o]){i=t[o],r=n[o];break}return i<r?-1:r<i?1:0},_e.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},_e.concat=function(t,n){if(!WZ(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return _e.alloc(0);var i;if(n===void 0)for(n=0,i=0;i<t.length;++i)n+=t[i].length;var r=_e.allocUnsafe(n),o=0;for(i=0;i<t.length;++i){var s=t[i];if(!aa(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r};function HZ(e,t){if(aa(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var n=e.length;if(n===0)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return l1(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return nD(e).length;default:if(i)return l1(e).length;t=(""+t).toLowerCase(),i=!0}}_e.byteLength=HZ;function YFe(e,t,n){var i=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,t>>>=0,n<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return n4e(this,t,n);case"utf8":case"utf-8":return QZ(this,t,n);case"ascii":return e4e(this,t,n);case"latin1":case"binary":return t4e(this,t,n);case"base64":return qFe(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i4e(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}_e.prototype._isBuffer=!0;function ru(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}_e.prototype.swap16=function(){var t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var n=0;n<t;n+=2)ru(this,n,n+1);return this},_e.prototype.swap32=function(){var t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var n=0;n<t;n+=4)ru(this,n,n+3),ru(this,n+1,n+2);return this},_e.prototype.swap64=function(){var t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var n=0;n<t;n+=8)ru(this,n,n+7),ru(this,n+1,n+6),ru(this,n+2,n+5),ru(this,n+3,n+4);return this},_e.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?QZ(this,0,t):YFe.apply(this,arguments)},_e.prototype.equals=function(t){if(!aa(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:_e.compare(this,t)===0},_e.prototype.inspect=function(){var t="",n=ZFe;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},_e.prototype.compare=function(t,n,i,r,o){if(!aa(t))throw new TypeError("Argument must be a Buffer");if(n===void 0&&(n=0),i===void 0&&(i=t?t.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),n<0||i>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&n>=i)return 0;if(r>=o)return-1;if(n>=i)return 1;if(n>>>=0,i>>>=0,r>>>=0,o>>>=0,this===t)return 0;for(var s=o-r,a=i-n,c=Math.min(s,a),l=this.slice(r,o),u=t.slice(n,i),h=0;h<c;++h)if(l[h]!==u[h]){s=l[h],a=u[h];break}return s<a?-1:a<s?1:0};function jZ(e,t,n,i,r){if(e.length===0)return-1;if(typeof n=="string"?(i=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=r?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(r)return-1;n=e.length-1}else if(n<0)if(r)n=0;else return-1;if(typeof t=="string"&&(t=_e.from(t,i)),aa(t))return t.length===0?-1:KZ(e,t,n,i,r);if(typeof t=="number")return t=t&255,_e.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):KZ(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function KZ(e,t,n,i,r){var o=1,s=e.length,a=t.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,s/=2,a/=2,n/=2}function c(f,p){return o===1?f[p]:f.readUInt16BE(p*o)}var l;if(r){var u=-1;for(l=n;l<s;l++)if(c(e,l)===c(t,u===-1?0:l-u)){if(u===-1&&(u=l),l-u+1===a)return u*o}else u!==-1&&(l-=l-u),u=-1}else for(n+a>s&&(n=s-a),l=n;l>=0;l--){for(var h=!0,d=0;d<a;d++)if(c(e,l+d)!==c(t,d)){h=!1;break}if(h)return l}return-1}_e.prototype.includes=function(t,n,i){return this.indexOf(t,n,i)!==-1},_e.prototype.indexOf=function(t,n,i){return jZ(this,t,n,i,!0)},_e.prototype.lastIndexOf=function(t,n,i){return jZ(this,t,n,i,!1)};function HFe(e,t,n,i){n=Number(n)||0;var r=e.length-n;i?(i=Number(i),i>r&&(i=r)):i=r;var o=t.length;if(o%2!==0)throw new TypeError("Invalid hex string");i>o/2&&(i=o/2);for(var s=0;s<i;++s){var a=parseInt(t.substr(s*2,2),16);if(isNaN(a))return s;e[n+s]=a}return s}function jFe(e,t,n,i){return u1(l1(t,e.length-n),e,n,i)}function JZ(e,t,n,i){return u1(c4e(t),e,n,i)}function KFe(e,t,n,i){return JZ(e,t,n,i)}function JFe(e,t,n,i){return u1(nD(t),e,n,i)}function QFe(e,t,n,i){return u1(l4e(t,e.length-n),e,n,i)}_e.prototype.write=function(t,n,i,r){if(n===void 0)r="utf8",i=this.length,n=0;else if(i===void 0&&typeof n=="string")r=n,i=this.length,n=0;else if(isFinite(n))n=n|0,isFinite(i)?(i=i|0,r===void 0&&(r="utf8")):(r=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var o=this.length-n;if((i===void 0||i>o)&&(i=o),t.length>0&&(i<0||n<0)||n>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return HFe(this,t,n,i);case"utf8":case"utf-8":return jFe(this,t,n,i);case"ascii":return JZ(this,t,n,i);case"latin1":case"binary":return KFe(this,t,n,i);case"base64":return JFe(this,t,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return QFe(this,t,n,i);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},_e.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function qFe(e,t,n){return t===0&&n===e.length?DZ(e):DZ(e.slice(t,n))}function QZ(e,t,n){n=Math.min(e.length,n);for(var i=[],r=t;r<n;){var o=e[r],s=null,a=o>239?4:o>223?3:o>191?2:1;if(r+a<=n){var c,l,u,h;switch(a){case 1:o<128&&(s=o);break;case 2:c=e[r+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(s=h));break;case 3:c=e[r+1],l=e[r+2],(c&192)===128&&(l&192)===128&&(h=(o&15)<<12|(c&63)<<6|l&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:c=e[r+1],l=e[r+2],u=e[r+3],(c&192)===128&&(l&192)===128&&(u&192)===128&&(h=(o&15)<<18|(c&63)<<12|(l&63)<<6|u&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,a=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023),i.push(s),r+=a}return $Fe(i)}var qZ=4096;function $Fe(e){var t=e.length;if(t<=qZ)return String.fromCharCode.apply(String,e);for(var n="",i=0;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=qZ));return n}function e4e(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(e[r]&127);return i}function t4e(e,t,n){var i="";n=Math.min(e.length,n);for(var r=t;r<n;++r)i+=String.fromCharCode(e[r]);return i}function n4e(e,t,n){var i=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>i)&&(n=i);for(var r="",o=t;o<n;++o)r+=a4e(e[o]);return r}function i4e(e,t,n){for(var i=e.slice(t,n),r="",o=0;o<i.length;o+=2)r+=String.fromCharCode(i[o]+i[o+1]*256);return r}_e.prototype.slice=function(t,n){var i=this.length;t=~~t,n=n===void 0?i:~~n,t<0?(t+=i,t<0&&(t=0)):t>i&&(t=i),n<0?(n+=i,n<0&&(n=0)):n>i&&(n=i),n<t&&(n=t);var r;if(_e.TYPED_ARRAY_SUPPORT)r=this.subarray(t,n),r.__proto__=_e.prototype;else{var o=n-t;r=new _e(o,void 0);for(var s=0;s<o;++s)r[s]=this[s+t]}return r};function Li(e,t,n){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}_e.prototype.readUIntLE=function(t,n,i){t=t|0,n=n|0,i||Li(t,n,this.length);for(var r=this[t],o=1,s=0;++s<n&&(o*=256);)r+=this[t+s]*o;return r},_e.prototype.readUIntBE=function(t,n,i){t=t|0,n=n|0,i||Li(t,n,this.length);for(var r=this[t+--n],o=1;n>0&&(o*=256);)r+=this[t+--n]*o;return r},_e.prototype.readUInt8=function(t,n){return n||Li(t,1,this.length),this[t]},_e.prototype.readUInt16LE=function(t,n){return n||Li(t,2,this.length),this[t]|this[t+1]<<8},_e.prototype.readUInt16BE=function(t,n){return n||Li(t,2,this.length),this[t]<<8|this[t+1]},_e.prototype.readUInt32LE=function(t,n){return n||Li(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},_e.prototype.readUInt32BE=function(t,n){return n||Li(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},_e.prototype.readIntLE=function(t,n,i){t=t|0,n=n|0,i||Li(t,n,this.length);for(var r=this[t],o=1,s=0;++s<n&&(o*=256);)r+=this[t+s]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*n)),r},_e.prototype.readIntBE=function(t,n,i){t=t|0,n=n|0,i||Li(t,n,this.length);for(var r=n,o=1,s=this[t+--r];r>0&&(o*=256);)s+=this[t+--r]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*n)),s},_e.prototype.readInt8=function(t,n){return n||Li(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},_e.prototype.readInt16LE=function(t,n){n||Li(t,2,this.length);var i=this[t]|this[t+1]<<8;return i&32768?i|4294901760:i},_e.prototype.readInt16BE=function(t,n){n||Li(t,2,this.length);var i=this[t+1]|this[t]<<8;return i&32768?i|4294901760:i},_e.prototype.readInt32LE=function(t,n){return n||Li(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},_e.prototype.readInt32BE=function(t,n){return n||Li(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},_e.prototype.readFloatLE=function(t,n){return n||Li(t,4,this.length),o1(this,t,!0,23,4)},_e.prototype.readFloatBE=function(t,n){return n||Li(t,4,this.length),o1(this,t,!1,23,4)},_e.prototype.readDoubleLE=function(t,n){return n||Li(t,8,this.length),o1(this,t,!0,52,8)},_e.prototype.readDoubleBE=function(t,n){return n||Li(t,8,this.length),o1(this,t,!1,52,8)};function Hr(e,t,n,i,r,o){if(!aa(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw new RangeError('"value" argument is out of bounds');if(n+i>e.length)throw new RangeError("Index out of range")}_e.prototype.writeUIntLE=function(t,n,i,r){if(t=+t,n=n|0,i=i|0,!r){var o=Math.pow(2,8*i)-1;Hr(this,t,n,i,o,0)}var s=1,a=0;for(this[n]=t&255;++a<i&&(s*=256);)this[n+a]=t/s&255;return n+i},_e.prototype.writeUIntBE=function(t,n,i,r){if(t=+t,n=n|0,i=i|0,!r){var o=Math.pow(2,8*i)-1;Hr(this,t,n,i,o,0)}var s=i-1,a=1;for(this[n+s]=t&255;--s>=0&&(a*=256);)this[n+s]=t/a&255;return n+i},_e.prototype.writeUInt8=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,1,255,0),_e.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[n]=t&255,n+1};function a1(e,t,n,i){t<0&&(t=65535+t+1);for(var r=0,o=Math.min(e.length-n,2);r<o;++r)e[n+r]=(t&255<<8*(i?r:1-r))>>>(i?r:1-r)*8}_e.prototype.writeUInt16LE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,2,65535,0),_e.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):a1(this,t,n,!0),n+2},_e.prototype.writeUInt16BE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,2,65535,0),_e.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):a1(this,t,n,!1),n+2};function c1(e,t,n,i){t<0&&(t=4294967295+t+1);for(var r=0,o=Math.min(e.length-n,4);r<o;++r)e[n+r]=t>>>(i?r:3-r)*8&255}_e.prototype.writeUInt32LE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,4,4294967295,0),_e.TYPED_ARRAY_SUPPORT?(this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=t&255):c1(this,t,n,!0),n+4},_e.prototype.writeUInt32BE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,4,4294967295,0),_e.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):c1(this,t,n,!1),n+4},_e.prototype.writeIntLE=function(t,n,i,r){if(t=+t,n=n|0,!r){var o=Math.pow(2,8*i-1);Hr(this,t,n,i,o-1,-o)}var s=0,a=1,c=0;for(this[n]=t&255;++s<i&&(a*=256);)t<0&&c===0&&this[n+s-1]!==0&&(c=1),this[n+s]=(t/a>>0)-c&255;return n+i},_e.prototype.writeIntBE=function(t,n,i,r){if(t=+t,n=n|0,!r){var o=Math.pow(2,8*i-1);Hr(this,t,n,i,o-1,-o)}var s=i-1,a=1,c=0;for(this[n+s]=t&255;--s>=0&&(a*=256);)t<0&&c===0&&this[n+s+1]!==0&&(c=1),this[n+s]=(t/a>>0)-c&255;return n+i},_e.prototype.writeInt8=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,1,127,-128),_e.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[n]=t&255,n+1},_e.prototype.writeInt16LE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,2,32767,-32768),_e.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):a1(this,t,n,!0),n+2},_e.prototype.writeInt16BE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,2,32767,-32768),_e.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):a1(this,t,n,!1),n+2},_e.prototype.writeInt32LE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,4,2147483647,-2147483648),_e.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24):c1(this,t,n,!0),n+4},_e.prototype.writeInt32BE=function(t,n,i){return t=+t,n=n|0,i||Hr(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),_e.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):c1(this,t,n,!1),n+4};function $Z(e,t,n,i,r,o){if(n+i>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function eD(e,t,n,i,r){return r||$Z(e,t,n,4),UZ(e,t,n,i,23,4),n+4}_e.prototype.writeFloatLE=function(t,n,i){return eD(this,t,n,!0,i)},_e.prototype.writeFloatBE=function(t,n,i){return eD(this,t,n,!1,i)};function tD(e,t,n,i,r){return r||$Z(e,t,n,8),UZ(e,t,n,i,52,8),n+8}_e.prototype.writeDoubleLE=function(t,n,i){return tD(this,t,n,!0,i)},_e.prototype.writeDoubleBE=function(t,n,i){return tD(this,t,n,!1,i)},_e.prototype.copy=function(t,n,i,r){if(i||(i=0),!r&&r!==0&&(r=this.length),n>=t.length&&(n=t.length),n||(n=0),r>0&&r<i&&(r=i),r===i||t.length===0||this.length===0)return 0;if(n<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-n<r-i&&(r=t.length-n+i);var o=r-i,s;if(this===t&&i<n&&n<r)for(s=o-1;s>=0;--s)t[s+n]=this[s+i];else if(o<1e3||!_e.TYPED_ARRAY_SUPPORT)for(s=0;s<o;++s)t[s+n]=this[s+i];else Uint8Array.prototype.set.call(t,this.subarray(i,i+o),n);return o},_e.prototype.fill=function(t,n,i,r){if(typeof t=="string"){if(typeof n=="string"?(r=n,n=0,i=this.length):typeof i=="string"&&(r=i,i=this.length),t.length===1){var o=t.charCodeAt(0);o<256&&(t=o)}if(r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!_e.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else typeof t=="number"&&(t=t&255);if(n<0||this.length<n||this.length<i)throw new RangeError("Out of range index");if(i<=n)return this;n=n>>>0,i=i===void 0?this.length:i>>>0,t||(t=0);var s;if(typeof t=="number")for(s=n;s<i;++s)this[s]=t;else{var a=aa(t)?t:l1(new _e(t,r).toString()),c=a.length;for(s=0;s<i-n;++s)this[s+n]=a[s%c]}return this};var r4e=/[^+\/0-9A-Za-z-_]/g;function o4e(e){if(e=s4e(e).replace(r4e,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function s4e(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function a4e(e){return e<16?"0"+e.toString(16):e.toString(16)}function l1(e,t){t=t||1/0;for(var n,i=e.length,r=null,o=[],s=0;s<i;++s){if(n=e.charCodeAt(s),n>55295&&n<57344){if(!r){if(n>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(s+1===i){(t-=3)>-1&&o.push(239,191,189);continue}r=n;continue}if(n<56320){(t-=3)>-1&&o.push(239,191,189),r=n;continue}n=(r-55296<<10|n-56320)+65536}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,n<128){if((t-=1)<0)break;o.push(n)}else if(n<2048){if((t-=2)<0)break;o.push(n>>6|192,n&63|128)}else if(n<65536){if((t-=3)<0)break;o.push(n>>12|224,n>>6&63|128,n&63|128)}else if(n<1114112){if((t-=4)<0)break;o.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128)}else throw new Error("Invalid code point")}return o}function c4e(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function l4e(e,t){for(var n,i,r,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=e.charCodeAt(s),i=n>>8,r=n%256,o.push(r),o.push(i);return o}function nD(e){return zFe(o4e(e))}function u1(e,t,n,i){for(var r=0;r<i&&!(r+n>=t.length||r>=e.length);++r)t[r+n]=e[r];return r}function u4e(e){return e!==e}function jr(e){return e!=null&&(!!e._isBuffer||iD(e)||h4e(e))}function iD(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function h4e(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&iD(e.slice(0,0))}var zT;function Kc(){}Kc.prototype=Object.create(null);function Yt(){Yt.init.call(this)}Yt.EventEmitter=Yt,Yt.usingDomains=!1,Yt.prototype.domain=void 0,Yt.prototype._events=void 0,Yt.prototype._maxListeners=void 0,Yt.defaultMaxListeners=10,Yt.init=function(){this.domain=null,Yt.usingDomains&&zT.active&&!(this instanceof zT.Domain)&&(this.domain=zT.active),(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new Kc,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Yt.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||isNaN(t))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=t,this};function rD(e){return e._maxListeners===void 0?Yt.defaultMaxListeners:e._maxListeners}Yt.prototype.getMaxListeners=function(){return rD(this)};function d4e(e,t,n){if(t)e.call(n);else for(var i=e.length,r=M0(e,i),o=0;o<i;++o)r[o].call(n)}function f4e(e,t,n,i){if(t)e.call(n,i);else for(var r=e.length,o=M0(e,r),s=0;s<r;++s)o[s].call(n,i)}function p4e(e,t,n,i,r){if(t)e.call(n,i,r);else for(var o=e.length,s=M0(e,o),a=0;a<o;++a)s[a].call(n,i,r)}function m4e(e,t,n,i,r,o){if(t)e.call(n,i,r,o);else for(var s=e.length,a=M0(e,s),c=0;c<s;++c)a[c].call(n,i,r,o)}function g4e(e,t,n,i){if(t)e.apply(n,i);else for(var r=e.length,o=M0(e,r),s=0;s<r;++s)o[s].apply(n,i)}Yt.prototype.emit=function(t){var n,i,r,o,s,a,c,l=t==="error";if(a=this._events,a)l=l&&a.error==null;else if(!l)return!1;if(c=this.domain,l){if(n=arguments[1],c)n||(n=new Error('Uncaught, unspecified "error" event')),n.domainEmitter=this,n.domain=c,n.domainThrown=!1,c.emit("error",n);else{if(n instanceof Error)throw n;var u=new Error('Uncaught, unspecified "error" event. ('+n+")");throw u.context=n,u}return!1}if(i=a[t],!i)return!1;var h=typeof i=="function";switch(r=arguments.length,r){case 1:d4e(i,h,this);break;case 2:f4e(i,h,this,arguments[1]);break;case 3:p4e(i,h,this,arguments[1],arguments[2]);break;case 4:m4e(i,h,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(r-1),s=1;s<r;s++)o[s-1]=arguments[s];g4e(i,h,this,o)}return!0};function oD(e,t,n,i){var r,o,s;if(typeof n!="function")throw new TypeError('"listener" argument must be a function');if(o=e._events,o?(o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]):(o=e._events=new Kc,e._eventsCount=0),!s)s=o[t]=n,++e._eventsCount;else if(typeof s=="function"?s=o[t]=i?[n,s]:[s,n]:i?s.unshift(n):s.push(n),!s.warned&&(r=rD(e),r&&r>0&&s.length>r)){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=s.length,y4e(a)}return e}function y4e(e){typeof console.warn=="function"?console.warn(e):console.log(e)}Yt.prototype.addListener=function(t,n){return oD(this,t,n,!1)},Yt.prototype.on=Yt.prototype.addListener,Yt.prototype.prependListener=function(t,n){return oD(this,t,n,!0)};function sD(e,t,n){var i=!1;function r(){e.removeListener(t,r),i||(i=!0,n.apply(e,arguments))}return r.listener=n,r}Yt.prototype.once=function(t,n){if(typeof n!="function")throw new TypeError('"listener" argument must be a function');return this.on(t,sD(this,t,n)),this},Yt.prototype.prependOnceListener=function(t,n){if(typeof n!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(t,sD(this,t,n)),this},Yt.prototype.removeListener=function(t,n){var i,r,o,s,a;if(typeof n!="function")throw new TypeError('"listener" argument must be a function');if(r=this._events,!r)return this;if(i=r[t],!i)return this;if(i===n||i.listener&&i.listener===n)--this._eventsCount===0?this._events=new Kc:(delete r[t],r.removeListener&&this.emit("removeListener",t,i.listener||n));else if(typeof i!="function"){for(o=-1,s=i.length;s-- >0;)if(i[s]===n||i[s].listener&&i[s].listener===n){a=i[s].listener,o=s;break}if(o<0)return this;if(i.length===1){if(i[0]=void 0,--this._eventsCount===0)return this._events=new Kc,this;delete r[t]}else b4e(i,o);r.removeListener&&this.emit("removeListener",t,a||n)}return this},Yt.prototype.removeAllListeners=function(t){var n,i;if(i=this._events,!i)return this;if(!i.removeListener)return arguments.length===0?(this._events=new Kc,this._eventsCount=0):i[t]&&(--this._eventsCount===0?this._events=new Kc:delete i[t]),this;if(arguments.length===0){for(var r=Object.keys(i),o=0,s;o<r.length;++o)s=r[o],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=new Kc,this._eventsCount=0,this}if(n=i[t],typeof n=="function")this.removeListener(t,n);else if(n)do this.removeListener(t,n[n.length-1]);while(n[0]);return this},Yt.prototype.listeners=function(t){var n,i,r=this._events;return r?(n=r[t],n?typeof n=="function"?i=[n.listener||n]:i=_4e(n):i=[]):i=[],i},Yt.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):aD.call(e,t)},Yt.prototype.listenerCount=aD;function aD(e){var t=this._events;if(t){var n=t[e];if(typeof n=="function")return 1;if(n)return n.length}return 0}Yt.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function b4e(e,t){for(var n=t,i=n+1,r=e.length;i<r;n+=1,i+=1)e[n]=e[i];e.pop()}function M0(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}function _4e(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function cD(){throw new Error("setTimeout has not been defined")}function lD(){throw new Error("clearTimeout has not been defined")}var Jc=cD,Qc=lD;typeof cd.setTimeout=="function"&&(Jc=setTimeout),typeof cd.clearTimeout=="function"&&(Qc=clearTimeout);function uD(e){if(Jc===setTimeout)return setTimeout(e,0);if((Jc===cD||!Jc)&&setTimeout)return Jc=setTimeout,setTimeout(e,0);try{return Jc(e,0)}catch{try{return Jc.call(null,e,0)}catch{return Jc.call(this,e,0)}}}function v4e(e){if(Qc===clearTimeout)return clearTimeout(e);if((Qc===lD||!Qc)&&clearTimeout)return Qc=clearTimeout,clearTimeout(e);try{return Qc(e)}catch{try{return Qc.call(null,e)}catch{return Qc.call(this,e)}}}var Ya=[],ld=!1,ou,h1=-1;function w4e(){!ld||!ou||(ld=!1,ou.length?Ya=ou.concat(Ya):h1=-1,Ya.length&&hD())}function hD(){if(!ld){var e=uD(w4e);ld=!0;for(var t=Ya.length;t;){for(ou=Ya,Ya=[];++h1<t;)ou&&ou[h1].run();h1=-1,t=Ya.length}ou=null,ld=!1,v4e(e)}}function Do(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Ya.push(new dD(e,t)),Ya.length===1&&!ld&&uD(hD)}function dD(e,t){this.fun=e,this.array=t}dD.prototype.run=function(){this.fun.apply(null,this.array)};var x4e={},L0=cd.performance||{};L0.now||L0.mozNow||L0.msNow||L0.oNow||L0.webkitNow;var d1={env:x4e},NT;typeof Object.create=="function"?NT=function(t,n){t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:NT=function(t,n){t.super_=n;var i=function(){};i.prototype=n.prototype,t.prototype=new i,t.prototype.constructor=t};var ud=NT,S4e=/%[sdj%]/g;function E4e(e){if(!UT(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(qc(arguments[n]));return t.join(" ")}for(var n=1,i=arguments,r=i.length,o=String(e).replace(S4e,function(a){if(a==="%%")return"%";if(n>=r)return a;switch(a){case"%s":return String(i[n++]);case"%d":return Number(i[n++]);case"%j":try{return JSON.stringify(i[n++])}catch{return"[Circular]"}default:return a}}),s=i[n];n<r;s=i[++n])DT(s)||!P0(s)?o+=" "+s:o+=" "+qc(s);return o}function fD(e,t){if($c(cd.process))return function(){return fD(e,t).apply(this,arguments)};if(d1.noDeprecation===!0)return e;var n=!1;function i(){if(!n){if(d1.throwDeprecation)throw new Error(t);d1.traceDeprecation?console.trace(t):console.error(t),n=!0}return e.apply(this,arguments)}return i}var f1={},kT;function T4e(e){if($c(kT)&&(kT=d1.env.NODE_DEBUG||""),e=e.toUpperCase(),!f1[e])if(new RegExp("\\b"+e+"\\b","i").test(kT)){var t=0;f1[e]=function(){var n=E4e.apply(null,arguments);console.error("%s %d: %s",e,t,n)}}else f1[e]=function(){};return f1[e]}function qc(e,t){var n={seen:[],stylize:R4e};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),pD(t)?n.showHidden=t:t&&V4e(n,t),$c(n.showHidden)&&(n.showHidden=!1),$c(n.depth)&&(n.depth=2),$c(n.colors)&&(n.colors=!1),$c(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=C4e),p1(n,e,n.depth)}qc.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},qc.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function C4e(e,t){var n=qc.styles[t];return n?"\x1B["+qc.colors[n][0]+"m"+e+"\x1B["+qc.colors[n][1]+"m":e}function R4e(e,t){return e}function I4e(e){var t={};return e.forEach(function(n,i){t[n]=!0}),t}function p1(e,t,n){if(e.customInspect&&t&&YT(t.inspect)&&t.inspect!==qc&&!(t.constructor&&t.constructor.prototype===t)){var i=t.inspect(n,e);return UT(i)||(i=p1(e,i,n)),i}var r=M4e(e,t);if(r)return r;var o=Object.keys(t),s=I4e(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),BT(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return XT(t);if(o.length===0){if(YT(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(WT(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(mD(t))return e.stylize(Date.prototype.toString.call(t),"date");if(BT(t))return XT(t)}var c="",l=!1,u=["{","}"];if(O4e(t)&&(l=!0,u=["[","]"]),YT(t)){var h=t.name?": "+t.name:"";c=" [Function"+h+"]"}if(WT(t)&&(c=" "+RegExp.prototype.toString.call(t)),mD(t)&&(c=" "+Date.prototype.toUTCString.call(t)),BT(t)&&(c=" "+XT(t)),o.length===0&&(!l||t.length==0))return u[0]+c+u[1];if(n<0)return WT(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var d;return l?d=L4e(e,t,n,s,o):d=o.map(function(f){return ZT(e,t,n,s,f,l)}),e.seen.pop(),P4e(d,c,u)}function M4e(e,t){if($c(t))return e.stylize("undefined","undefined");if(UT(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(G4e(t))return e.stylize(""+t,"number");if(pD(t))return e.stylize(""+t,"boolean");if(DT(t))return e.stylize("null","null")}function XT(e){return"["+Error.prototype.toString.call(e)+"]"}function L4e(e,t,n,i,r){for(var o=[],s=0,a=t.length;s<a;++s)gD(t,String(s))?o.push(ZT(e,t,n,i,String(s),!0)):o.push("");return r.forEach(function(c){c.match(/^\d+$/)||o.push(ZT(e,t,n,i,c,!0))}),o}function ZT(e,t,n,i,r,o){var s,a,c;if(c=Object.getOwnPropertyDescriptor(t,r)||{value:t[r]},c.get?c.set?a=e.stylize("[Getter/Setter]","special"):a=e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),gD(i,r)||(s="["+r+"]"),a||(e.seen.indexOf(c.value)<0?(DT(n)?a=p1(e,c.value,null):a=p1(e,c.value,n-1),a.indexOf(`
6732
6732
  `)>-1&&(o?a=a.split(`
6733
6733
  `).map(function(l){return" "+l}).join(`
6734
6734
  `).substr(2):a=`
package/package.json CHANGED
@@ -1,9 +1,15 @@
1
1
  {
2
2
  "name": "@reearth/core",
3
- "version": "0.0.7-alpha.72",
3
+ "version": "0.0.7-alpha.75",
4
4
  "author": "Re:Earth contributors <community@reearth.io>",
5
5
  "license": "Apache-2.0",
6
6
  "description": "A library that abstracts a map engine as one common API.",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "git+https://github.com/reearth/core.git"
10
+ },
11
+ "homepage": "https://github.com/reearth/core#readme",
12
+ "bugs": "https://github.com/reearth/core/issues",
7
13
  "type": "module",
8
14
  "main": "dist/core.umd.cjs",
9
15
  "module": "dist/core.js",
@@ -131,5 +137,6 @@
131
137
  },
132
138
  "resolutions": {
133
139
  "jackspeak": "3.1.2"
134
- }
140
+ },
141
+ "packageManager": "npm@11.5.1+sha512.232e6f5d9e799bcb486920b3e9ba907fdf96e576cf7e8c9446c8162e33a416096a1d37a9e910d9a918f6b1f606791c99bc6bb61ee2569b496ec74af13d0dbd95"
135
142
  }