@reearth/core 0.0.7-alpha.58 → 0.0.7-alpha.59

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
@@ -96052,7 +96052,7 @@ const oXe = ({
96052
96052
  light: W,
96053
96053
  mode: re,
96054
96054
  msaaSamples: Q,
96055
- useDepthPicking: !1,
96055
+ useDepthPicking: !0,
96056
96056
  useWebVR: !!n?.scene?.vr || void 0,
96057
96057
  debugShowFramesPerSecond: !!n?.debug?.showFramesPerSecond,
96058
96058
  verticalExaggerationRelativeHeight: n?.scene?.verticalExaggerationRelativeHeight,
@@ -96110,7 +96110,7 @@ function uXe({ error: e, resetErrorBoundary: t }) {
96110
96110
  /* @__PURE__ */ ce.jsx("p", { children: /* @__PURE__ */ ce.jsx("button", { style: { color: "#fff" }, onClick: t, children: "Retry" }) })
96111
96111
  ] });
96112
96112
  }
96113
- const hXe = "0.0.7-alpha.58", dXe = ({ viewerProperty: e }) => {
96113
+ const hXe = "0.0.7-alpha.59", dXe = ({ viewerProperty: e }) => {
96114
96114
  const t = de(e);
96115
96115
  t.current = e;
96116
96116
  const n = he(
package/dist/core.umd.cjs CHANGED
@@ -6728,7 +6728,7 @@ vec3 getTurboColormap(const float v) {
6728
6728
  ${Ab}
6729
6729
  ${rPe}
6730
6730
  ${tPe}
6731
- `,uniforms:{...Br(u,["color","frustumLength","blackPoint","whitePoint","gamma"]),globeDepthTexture:()=>c?.()??d._depthTexture}});if(r){const f=$Le({prefix:e,outputType:s,useGlobeDepth:a,getGlobeDepthTexture:c,uniforms:{textureScale:t,...Br(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:dE([{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:dE([{stage:h,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:d,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}const aPe=({enabled:e=!0,textureScale:t,directions:n,steps:i,denoise:r,accurateNormalReconstruction:o,outputType:s,useGlobeDepth:a,...c})=>{const{viewer:l}=qn(),u=l?.scene,h=dF({owner:u?.postProcessStages,keys:[t,i,n,r,o,s,a],create:()=>{const d=sPe({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(),Ol(()=>{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},cPe=e=>{const t=qn(),[n,i]=R.useState(!1);return Ol(()=>{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))}),le.jsx(aPe,{...e,useGlobeDepth:n})};var xN=(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))(xN||{});const lPe={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}},uPe="#00bebe",u0="#3B3CD0",hPe="#FF9900",dPe="#3B3CD0";let Kl,fPe,pPe,Jl;const h0=({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=ko(()=>new go((f,p)=>"getValue"in c.current?c.current.getValue(f,p):c.current,!1)),u=R.useMemo(()=>({position:l,billboard:{image:i?o?bPe():r?yPe():gPe():mPe(),width:i?16:8,height:i?16:8,heightReference:t?_l.CLAMP_TO_GROUND:_l.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 le.jsx(lc,{...u,onMouseDown:h,onClick:d})};function mPe(){if(Kl!=null)return Kl;Kl=document.createElement("canvas"),Kl.width=16,Kl.height=16;const e=Kl.getContext("2d");return On(e!=null),e.fillStyle="white",e.fillRect(3,3,10,10),e.strokeStyle="black",e.lineWidth=2,e.strokeRect(3,3,10,10),Kl}function gPe(){return SN(fPe,{size:32,color:"white",strokeColor:u0})}function yPe(){return SN(pPe,{size:32,color:"white",strokeColor:hPe})}function bPe(){if(Jl!=null)return Jl;Jl=document.createElement("canvas"),Jl.width=32,Jl.height=32;const e=Jl.getContext("2d");return On(e!=null),e.beginPath(),e.arc(16,16,12,0,2*Math.PI),e.fillStyle="white",e.fill(),e.strokeStyle=dPe,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(),Jl}function SN(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 On(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 _Pe(e,t){if(typeof e=="function")return e(t),()=>{e(null)};if(e!=null)return e.current=t,()=>{e.current=null}}const d0=R.memo(R.forwardRef(({entities:e,...t},n)=>{const{viewer:i}=qn(),r=i?.scene,o=i?.entities,s=e??o,[a,c]=R.useState(()=>new Qr(t));return R.useEffect(()=>{c(new Qr(t))},[t.id]),R.useEffect(()=>(s?.add(a),()=>{s?.remove(a),r?.requestRender()}),[r,s,a]),R.useEffect(()=>_Pe(n,a),[n,a]),Object.assign(a,ja(t,"id")),r?.requestRender(),null})),vPe={padding:"5px",color:"#fff",backgroundColor:"#000",borderRadius:"5px",lineHeight:1},EN=({children:e})=>le.jsx("div",{style:vPe,children:e}),TN=R.createContext({});function CN(e){const t=R.useRef(null);return t.current===null&&(t.current=e()),t.current}const wPe=typeof window<"u"?R.useLayoutEffect:R.useEffect,fE=R.createContext(null);function pE(e,t){e.indexOf(t)===-1&&e.push(t)}function zb(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ta=(e,t,n)=>n>t?t:n<e?e:n;function mE(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Kh=()=>{},Da=()=>{};typeof process<"u"&&process.env?.NODE_ENV!=="production"&&(Kh=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(mE(t,n))},Da=(e,t,n)=>{if(!e)throw new Error(mE(t,n))});const Ua={},RN=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function IN(e){return typeof e=="object"&&e!==null}const MN=e=>/^0[^.\s]+$/u.test(e);function LN(e){let t;return()=>(t===void 0&&(t=e()),t)}const Go=e=>e,xPe=(e,t)=>n=>t(e(n)),f0=(...e)=>e.reduce(xPe),p0=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i};class gE{constructor(){this.subscriptions=[]}add(t){return pE(this.subscriptions,t),()=>zb(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 Vo=e=>e*1e3,Fo=e=>e/1e3;function PN(e,t){return t?e*(1e3/t):0}const ON=new Set;function yE(e,t,n){e||ON.has(t)||(console.warn(mE(t,n)),ON.add(t))}const GN=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,SPe=1e-7,EPe=12;function TPe(e,t,n,i,r){let o,s,a=0;do s=t+(n-t)/2,o=GN(s,i,r)-e,o>0?n=s:t=s;while(Math.abs(o)>SPe&&++a<EPe);return s}function m0(e,t,n,i){if(e===t&&n===i)return Go;const r=o=>TPe(o,0,1,e,n);return o=>o===0||o===1?o:GN(r(o),t,i)}const VN=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,FN=e=>t=>1-e(1-t),AN=m0(.33,1.53,.69,.99),bE=FN(AN),zN=VN(bE),NN=e=>(e*=2)<1?.5*bE(e):.5*(2-Math.pow(2,-10*(e-1))),_E=e=>1-Math.sin(Math.acos(e)),kN=FN(_E),XN=VN(_E),CPe=m0(.42,0,1,1),RPe=m0(0,0,.58,1),ZN=m0(.42,0,.58,1),IPe=e=>Array.isArray(e)&&typeof e[0]!="number",DN=e=>Array.isArray(e)&&typeof e[0]=="number",UN={linear:Go,easeIn:CPe,easeInOut:ZN,easeOut:RPe,circIn:_E,circInOut:XN,circOut:kN,backIn:bE,backInOut:zN,backOut:AN,anticipate:NN},MPe=e=>typeof e=="string",WN=e=>{if(DN(e)){Da(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,i,r]=e;return m0(t,n,i,r)}else if(MPe(e))return Da(UN[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),UN[e];return e},Nb=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function LPe(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 PPe=40;function BN(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=Nb.reduce((S,T)=>(S[T]=LPe(o),S),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:h,preRender:d,render:f,postRender:p}=s,m=()=>{const S=Ua.useManualTiming?r.timestamp:performance.now();n=!1,Ua.useManualTiming||(r.delta=i?1e3/60:Math.max(Math.min(S-r.timestamp,PPe),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:Nb.reduce((S,T)=>{const I=s[T];return S[T]=(O,G=!1,A=!1)=>(n||y(),I.schedule(O,G,A)),S},{}),cancel:S=>{for(let T=0;T<Nb.length;T++)s[Nb[T]].cancel(S)},state:r,steps:s}}const{schedule:Sn,cancel:Wc,state:Ni,steps:vE}=BN(typeof requestAnimationFrame<"u"?requestAnimationFrame:Go,!0);let kb;function OPe(){kb=void 0}const gr={now:()=>(kb===void 0&&gr.set(Ni.isProcessing||Ua.useManualTiming?Ni.timestamp:performance.now()),kb),set:e=>{kb=e,queueMicrotask(OPe)}},YN=e=>t=>typeof t=="string"&&t.startsWith(e),HN=YN("--"),GPe=YN("var(--"),wE=e=>GPe(e)?VPe.test(e.split("/*")[0].trim()):!1,VPe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function jN(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Jh={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},g0={...Jh,transform:e=>ta(0,1,e)},Xb={...Jh,default:1},y0=e=>Math.round(e*1e5)/1e5,xE=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function FPe(e){return e==null}const APe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,SE=(e,t)=>n=>!!(typeof n=="string"&&APe.test(n)&&n.startsWith(e)||t&&!FPe(n)&&Object.prototype.hasOwnProperty.call(n,t)),KN=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,o,s,a]=i.match(xE);return{[e]:parseFloat(r),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},zPe=e=>ta(0,255,e),EE={...Jh,transform:e=>Math.round(zPe(e))},Ql={test:SE("rgb","red"),parse:KN("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+EE.transform(e)+", "+EE.transform(t)+", "+EE.transform(n)+", "+y0(g0.transform(i))+")"};function NPe(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 TE={test:SE("#"),parse:NPe,transform:Ql.transform},b0=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Bc=b0("deg"),na=b0("%"),ct=b0("px"),kPe=b0("vh"),XPe=b0("vw"),JN={...na,parse:e=>na.parse(e)/100,transform:e=>na.transform(e*100)},Qh={test:SE("hsl","hue"),parse:KN("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+na.transform(y0(t))+", "+na.transform(y0(n))+", "+y0(g0.transform(i))+")"},ai={test:e=>Ql.test(e)||TE.test(e)||Qh.test(e),parse:e=>Ql.test(e)?Ql.parse(e):Qh.test(e)?Qh.parse(e):TE.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ql.transform(e):Qh.transform(e),getAnimatableNone:e=>{const t=ai.parse(e);return t.alpha=0,ai.transform(t)}},ZPe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function DPe(e){return isNaN(e)&&typeof e=="string"&&(e.match(xE)?.length||0)+(e.match(ZPe)?.length||0)>0}const QN="number",qN="color",UPe="var",WPe="var(",$N="${}",BPe=/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 _0(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let o=0;const a=t.replace(BPe,c=>(ai.test(c)?(i.color.push(o),r.push(qN),n.push(ai.parse(c))):c.startsWith(WPe)?(i.var.push(o),r.push(UPe),n.push(c)):(i.number.push(o),r.push(QN),n.push(parseFloat(c))),++o,$N)).split($N);return{values:n,split:a,indexes:i,types:r}}function ek(e){return _0(e).values}function tk(e){const{split:t,types:n}=_0(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===QN?o+=y0(r[s]):a===qN?o+=ai.transform(r[s]):o+=r[s]}return o}}const YPe=e=>typeof e=="number"?0:ai.test(e)?ai.getAnimatableNone(e):e;function HPe(e){const t=ek(e);return tk(e)(t.map(YPe))}const ds={test:DPe,parse:ek,createTransformer:tk,getAnimatableNone:HPe};function CE(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 jPe({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=CE(c,a,e+1/3),o=CE(c,a,e),s=CE(c,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:i}}function Zb(e,t){return n=>n>0?t:e}const kn=(e,t,n)=>e+(t-e)*n,RE=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},KPe=[TE,Ql,Qh],JPe=e=>KPe.find(t=>t.test(e));function nk(e){const t=JPe(e);if(Kh(!!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=jPe(n)),n}const ik=(e,t)=>{const n=nk(e),i=nk(t);if(!n||!i)return Zb(e,t);const r={...n};return o=>(r.red=RE(n.red,i.red,o),r.green=RE(n.green,i.green,o),r.blue=RE(n.blue,i.blue,o),r.alpha=kn(n.alpha,i.alpha,o),Ql.transform(r))},IE=new Set(["none","hidden"]);function QPe(e,t){return IE.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function qPe(e,t){return n=>kn(e,t,n)}function ME(e){return typeof e=="number"?qPe:typeof e=="string"?wE(e)?Zb:ai.test(e)?ik:tOe:Array.isArray(e)?rk:typeof e=="object"?ai.test(e)?ik:$Pe:Zb}function rk(e,t){const n=[...e],i=n.length,r=e.map((o,s)=>ME(o)(o,t[s]));return o=>{for(let s=0;s<i;s++)n[s]=r[s](o);return n}}function $Pe(e,t){const n={...e,...t},i={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(i[r]=ME(e[r])(e[r],t[r]));return r=>{for(const o in i)n[o]=i[o](r);return n}}function eOe(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 tOe=(e,t)=>{const n=ds.createTransformer(t),i=_0(e),r=_0(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?IE.has(e)&&!r.values.length||IE.has(t)&&!i.values.length?QPe(e,t):f0(rk(eOe(i,r),r.values),n):(Kh(!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"),Zb(e,t))};function ok(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?kn(e,t,n):ME(e)(e,t)}const nOe=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Sn.update(t,n),stop:()=>Wc(t),now:()=>Ni.isProcessing?Ni.timestamp:gr.now()}},sk=(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)})`},Db=2e4;function LE(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<Db;)t+=n,i=e.next(t);return t>=Db?1/0:t}function iOe(e,t=100,n){const i=n({...e,keyframes:[0,t]}),r=Math.min(LE(i),Db);return{type:"keyframes",ease:o=>i.next(r*o).value/t,duration:Fo(r)}}const rOe=5;function ak(e,t,n){const i=Math.max(t-rOe,0);return PN(n-e(i),t-i)}const Xn={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},PE=.001;function oOe({duration:e=Xn.duration,bounce:t=Xn.bounce,velocity:n=Xn.velocity,mass:i=Xn.mass}){let r,o;Kh(e<=Vo(Xn.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=ta(Xn.minDamping,Xn.maxDamping,s),e=ta(Xn.minDuration,Xn.maxDuration,Fo(e)),s<1?(r=l=>{const u=l*s,h=u*e,d=u-n,f=OE(l,s),p=Math.exp(-h);return PE-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=OE(Math.pow(l,2),s);return(-r(l)+PE>0?-1:1)*((d-f)*p)/m}):(r=l=>{const u=Math.exp(-l*e),h=(l-n)*e+1;return-PE+u*h},o=l=>{const u=Math.exp(-l*e),h=(n-l)*(e*e);return u*h});const a=5/e,c=aOe(r,o,a);if(e=Vo(e),isNaN(c))return{stiffness:Xn.stiffness,damping:Xn.damping,duration:e};{const l=Math.pow(c,2)*i;return{stiffness:l,damping:s*2*Math.sqrt(i*l),duration:e}}}const sOe=12;function aOe(e,t,n){let i=n;for(let r=1;r<sOe;r++)i=i-e(i)/t(i);return i}function OE(e,t){return e*Math.sqrt(1-t*t)}const cOe=["duration","bounce"],lOe=["stiffness","damping","mass"];function ck(e,t){return t.some(n=>e[n]!==void 0)}function uOe(e){let t={velocity:Xn.velocity,stiffness:Xn.stiffness,damping:Xn.damping,mass:Xn.mass,isResolvedFromDuration:!1,...e};if(!ck(e,lOe)&&ck(e,cOe))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,o=2*ta(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Xn.mass,stiffness:r,damping:o}}else{const n=oOe({...e,velocity:0});t={...t,...n,mass:Xn.mass},t.isResolvedFromDuration=!0}return t}function Ub(e=Xn.visualDuration,t=Xn.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}=uOe({...n,velocity:-Fo(n.velocity||0)}),p=d||0,m=l/(2*Math.sqrt(c*u)),y=s-o,g=Fo(Math.sqrt(c/u)),v=Math.abs(y)<5;i||(i=v?Xn.restSpeed.granular:Xn.restSpeed.default),r||(r=v?Xn.restDelta.granular:Xn.restDelta.default);let S;if(m<1){const I=OE(g,m);S=O=>{const G=Math.exp(-m*g*O);return s-G*((p+m*g*y)/I*Math.sin(I*O)+y*Math.cos(I*O))}}else if(m===1)S=I=>s-Math.exp(-g*I)*(y+(p+g*y)*I);else{const I=g*Math.sqrt(m*m-1);S=O=>{const G=Math.exp(-m*g*O),A=Math.min(I*O,300);return s-G*((p+m*g*y)*Math.sinh(A)+I*y*Math.cosh(A))/I}}const T={calculatedDuration:f&&h||null,next:I=>{const O=S(I);if(f)a.done=I>=h;else{let G=I===0?p:0;m<1&&(G=I===0?Vo(p):ak(S,I,O));const A=Math.abs(G)<=i,V=Math.abs(s-O)<=r;a.done=A&&V}return a.value=a.done?s:O,a},toString:()=>{const I=Math.min(LE(T),Db),O=sk(G=>T.next(I*G).value,I,30);return I+"ms "+O},toTransition:()=>{}};return T}Ub.applyToOptions=e=>{const t=iOe(e,100,Ub);return e.ease=t.ease,e.duration=Vo(t.duration),e.type="keyframes",e};function GE({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),T=A=>{const V=v(A),N=S(A);d.done=Math.abs(V)<=l,d.value=d.done?g:N};let I,O;const G=A=>{f(d.value)&&(I=A,O=Ub({keyframes:[d.value,p(d.value)],velocity:ak(S,A,d.value),damping:r,stiffness:o,restDelta:l,restSpeed:u}))};return G(0),{calculatedDuration:null,next:A=>{let V=!1;return!O&&I===void 0&&(V=!0,T(A),G(A)),I!==void 0&&A>=I?O.next(A-I):(!V&&T(A),d)}}}function hOe(e,t,n){const i=[],r=n||Ua.mix||ok,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]||Go:t;a=f0(c,a)}i.push(a)}return i}function dOe(e,t,{clamp:n=!0,ease:i,mixer:r}={}){const o=e.length;if(Da(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=hOe(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=p0(e[h],e[h+1],u);return a[h](d)};return n?u=>l(ta(e[0],e[o-1],u)):l}function fOe(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=p0(0,t,i);e.push(kn(n,1,r))}}function pOe(e){const t=[0];return fOe(t,e.length-1),t}function mOe(e,t){return e.map(n=>n*t)}function gOe(e,t){return e.map(()=>t||ZN).splice(0,e.length-1)}function qh({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=IPe(i)?i.map(WN):WN(i),o={done:!1,value:t[0]},s=mOe(n&&n.length===t.length?n:pOe(t),e),a=dOe(s,t,{ease:Array.isArray(r)?r:gOe(t,r)});return{calculatedDuration:e,next:c=>(o.value=a(c),o.done=c>=e,o)}}const yOe=e=>e!==null;function VE(e,{repeat:t,repeatType:n="loop"},i,r=1){const o=e.filter(yOe),a=r<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!a||i===void 0?o[a]:i}const bOe={decay:GE,inertia:GE,tween:qh,keyframes:qh,spring:Ub};function lk(e){typeof e.type=="string"&&(e.type=bOe[e.type])}class FE{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 _Oe=e=>e/100;class AE extends FE{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!==gr.now()&&this.tick(gr.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;lk(t);const{type:n=qh,repeat:i=0,repeatDelay:r=0,repeatType:o,velocity:s=0}=t;let{keyframes:a}=t;const c=n||qh;process.env.NODE_ENV!=="production"&&c!==qh&&Da(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==qh&&typeof a[0]!="number"&&(this.mixKeyframes=f0(_Oe,ok(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=LE(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,T=i;if(h){const A=Math.min(this.currentTime,r)/a;let V=Math.floor(A),N=A%1;!N&&A>=1&&(N=1),N===1&&V--,V=Math.min(V,h+1),V%2&&(d==="reverse"?(N=1-N,f&&(N-=f/a)):d==="mirror"&&(T=s)),S=ta(0,1,N)*a}const I=v?{done:!1,value:u[0]}:T.next(S);o&&!v&&(I.value=o(I.value));let{done:O}=I;!v&&c!==null&&(O=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const G=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return G&&p!==GE&&(I.value=VE(u,this.options,y,this.speed)),m&&m(I.value),G&&this.finish(),I}then(t,n){return this.finished.then(t,n)}get duration(){return Fo(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fo(t)}get time(){return Fo(this.currentTime)}set time(t){t=Vo(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(gr.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Fo(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=nOe,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(gr.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 vOe(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ql=e=>e*180/Math.PI,zE=e=>{const t=ql(Math.atan2(e[1],e[0]));return NE(t)},wOe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:zE,rotateZ:zE,skewX:e=>ql(Math.atan(e[1])),skewY:e=>ql(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},NE=e=>(e=e%360,e<0&&(e+=360),e),uk=zE,hk=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),dk=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),xOe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:hk,scaleY:dk,scale:e=>(hk(e)+dk(e))/2,rotateX:e=>NE(ql(Math.atan2(e[6],e[5]))),rotateY:e=>NE(ql(Math.atan2(-e[2],e[0]))),rotateZ:uk,rotate:uk,skewX:e=>ql(Math.atan(e[4])),skewY:e=>ql(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function kE(e){return e.includes("scale")?1:0}function XE(e,t){if(!e||e==="none")return kE(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,r;if(n)i=xOe,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=wOe,r=a}if(!r)return kE(t);const o=i[t],s=r[1].split(",").map(EOe);return typeof o=="function"?o(s):s[o]}const SOe=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return XE(n,t)};function EOe(e){return parseFloat(e.trim())}const $h=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ed=new Set($h),fk=e=>e===Jh||e===ct,TOe=new Set(["x","y","z"]),COe=$h.filter(e=>!TOe.has(e));function ROe(e){const t=[];return COe.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Yc={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})=>XE(t,"x"),y:(e,{transform:t})=>XE(t,"y")};Yc.translateX=Yc.x,Yc.translateY=Yc.y;const $l=new Set;let ZE=!1,DE=!1,UE=!1;function pk(){if(DE){const e=Array.from($l).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=ROe(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)})}DE=!1,ZE=!1,$l.forEach(e=>e.complete(UE)),$l.clear()}function mk(){$l.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(DE=!0)})}function IOe(){UE=!0,mk(),pk(),UE=!1}class WE{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?($l.add(this),ZE||(ZE=!0,Sn.read(mk),Sn.resolveKeyframes(pk))):(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])}vOe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),$l.delete(this)}cancel(){this.state==="scheduled"&&($l.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const MOe=e=>e.startsWith("--");function gk(e,t,n){MOe(t)?e.style.setProperty(t,n):e.style[t]=n}const LOe={};function yk(e,t){const n=LN(e);return()=>LOe[t]??n()}const POe=yk(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),bk=yk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),v0=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,_k={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:v0([0,.65,.55,1]),circOut:v0([.55,0,1,.45]),backIn:v0([.31,.01,.66,-.59]),backOut:v0([.33,1.53,.69,.99])};function vk(e,t){if(e)return typeof e=="function"?bk()?sk(e,t):"ease-out":DN(e)?v0(e):Array.isArray(e)?e.map(n=>vk(n,t)||_k.easeOut):_k[e]}function OOe(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=vk(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 wk(e){return typeof e=="function"&&"applyToOptions"in e}function GOe({type:e,...t}){return wk(e)&&bk()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class xk extends FE{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,Da(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const l=GOe(t);this.animation=OOe(n,i,r,l,o),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=VE(r,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),gk(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 Fo(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fo(t)}get time(){return Fo(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Vo(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&&POe()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),Go):r(this)}}const Sk={anticipate:NN,backInOut:zN,circInOut:XN};function VOe(e){return e in Sk}function FOe(e){typeof e.ease=="string"&&VOe(e.ease)&&(e.ease=Sk[e.ease])}const BE=10;class AOe extends xk{constructor(t){FOe(t),lk(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 AE({...s,autoplay:!1}),c=Math.max(BE,gr.now()-this.startTime),l=ta(0,BE,c-BE),u=a.sample(c).value,{name:h}=this.options;o&&h&&gk(o,h,u),n.setWithVelocity(a.sample(Math.max(0,c-l)).value,u,l),a.stop()}}const Ek=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ds.test(e)||e==="0")&&!e.startsWith("url("));function zOe(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 NOe(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=Ek(r,t),a=Ek(o,t);return Kh(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:zOe(e)||(n==="spring"||wk(n))&&i}function YE(e){e.duration=0,e.type="keyframes"}const kOe=new Set(["opacity","clipPath","filter","transform"]),XOe=LN(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ZOe(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 XOe()&&n&&kOe.has(n)&&(n!=="transform"||!l)&&!c&&!i&&r!=="mirror"&&o!==0&&s!=="inertia"}const DOe=40;class UOe extends FE{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=gr.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||WE;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=gr.now(),NOe(t,o,s,a)||((Ua.instantAnimations||!c)&&u?.(VE(t,i,n)),t[0]=t[t.length-1],YE(i),i.repeat=0);const d={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>DOe?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},f=!l&&ZOe(d),p=d.motionValue?.owner?.current,m=f?new AOe({...d,element:p}):new AE(d);m.finished.then(()=>{this.notifyFinished()}).catch(Go),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(),IOe()),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 Tk(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 WOe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function BOe(e){const t=WOe.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}const YOe=4;function Ck(e,t,n=1){Da(n<=YOe,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,r]=BOe(e);if(!i)return;const o=window.getComputedStyle(t).getPropertyValue(i);if(o){const s=o.trim();return RN(s)?parseFloat(s):s}return wE(r)?Ck(r,t,n+1):r}const HOe={type:"spring",stiffness:500,damping:25,restSpeed:10},jOe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),KOe={type:"keyframes",duration:.8},JOe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},QOe=(e,{keyframes:t})=>t.length>2?KOe:ed.has(e)?e.startsWith("scale")?jOe(t[1]):HOe:JOe,qOe=e=>e!==null;function $Oe(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(qOe),o=t&&n!=="loop"&&t%2===1?0:r.length-1;return r[o]}function Rk(e,t){if(e?.inherit&&t){const{inherit:n,...i}=e;return{...t,...i}}return e}function HE(e,t){const n=e?.[t]??e?.default??e;return n!==e?Rk(n,e):n}function eGe({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 jE=(e,t,n,i={},r,o)=>s=>{const a=HE(i,e)||{},c=a.delay||i.delay||0;let{elapsed:l=0}=i;l=l-Vo(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};eGe(a)||Object.assign(u,QOe(e,u)),u.duration&&(u.duration=Vo(u.duration)),u.repeatDelay&&(u.repeatDelay=Vo(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(YE(u),u.delay===0&&(h=!0)),(Ua.instantAnimations||Ua.skipAnimations||r?.shouldSkipAnimations)&&(h=!0,YE(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!o&&t.get()!==void 0){const d=$Oe(u.keyframes,a);if(d!==void 0){Sn.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new AE(u):new UOe(u)};function Ik(e){const t=[{},{}];return e?.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function KE(e,t,n,i){if(typeof t=="function"){const[r,o]=Ik(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]=Ik(i);t=t(n!==void 0?n:e.custom,r,o)}return t}function td(e,t,n){const i=e.getProps();return KE(i,t,n!==void 0?n:i.custom,e)}const Mk=new Set(["width","height","top","left","right","bottom",...$h]),Lk=30,tGe=e=>!isNaN(parseFloat(e));class nGe{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const r=gr.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=gr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=tGe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&yE(!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 gE);const i=this.events[t].add(n);return t==="change"?()=>{i(),Sn.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=gr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Lk)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Lk);return PN(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 eu(e,t){return new nGe(e,t)}const JE=e=>Array.isArray(e);function iGe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,eu(n))}function rGe(e){return JE(e)?e[e.length-1]||0:e}function oGe(e,t){const n=td(e,t);let{transitionEnd:i={},transition:r={},...o}=n||{};o={...o,...i};for(const s in o){const a=rGe(o[s]);iGe(e,s,a)}}const tr=e=>!!(e&&e.getVelocity);function sGe(e){return!!(tr(e)&&e.add)}function QE(e,t){const n=e.getValue("willChange");if(sGe(n))return n.add(t);if(!n&&Ua.WillChange){const i=new Ua.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function qE(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Pk="data-"+qE("framerAppearId");function Ok(e){return e.props[Pk]}function aGe({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function Gk(e,t,{delay:n=0,transitionOverride:i,type:r}={}){let{transition:o,transitionEnd:s,...a}=t;const c=e.getDefaultTransition();o=o?Rk(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&&aGe(h,d))continue;const m={delay:n,...HE(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 T=Ok(e);if(T){const I=window.MotionHandoffAnimation(T,d,Sn);I!==null&&(m.startTime=I,g=!0)}}QE(e,d);const v=l??e.shouldReduceMotion;f.start(jE(d,f,p,v&&Mk.has(d)?{type:!1}:m,e,g));const S=f.animation;S&&u.push(S)}if(s){const d=()=>Sn.update(()=>{s&&oGe(e,s)});u.length?Promise.all(u).then(d):d()}return u}function $E(e,t,n={}){const i=td(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(Gk(e,i,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:h}=r;return cGe(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 cGe(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($E(c,t,{...s,delay:n+(typeof i=="function"?0:i)+Tk(e.variantChildren,c,i,r,o)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function lGe(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(o=>$E(e,o,n));i=Promise.all(r)}else if(typeof t=="string")i=$E(e,t,n);else{const r=typeof t=="function"?td(e,t,n.custom):t;i=Promise.all(Gk(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const uGe={test:e=>e==="auto",parse:e=>e},Vk=e=>t=>t.test(e),Fk=[Jh,ct,na,Bc,XPe,kPe,uGe],Ak=e=>Fk.find(Vk(e));function hGe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||MN(e):!0}const dGe=new Set(["brightness","contrast","saturate","opacity"]);function fGe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(xE)||[];if(!i)return e;const r=n.replace(i,"");let o=dGe.has(t)?1:0;return i!==n&&(o*=100),t+"("+o+r+")"}const pGe=/\b([a-z-]*)\(.*?\)/gu,eT={...ds,getAnimatableNone:e=>{const t=e.match(pGe);return t?t.map(fGe).join(" "):e}},tT={...ds,getAnimatableNone:e=>{const t=ds.parse(e);return ds.createTransformer(e)(t.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},zk={...Jh,transform:Math.round},nT={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:Bc,rotateX:Bc,rotateY:Bc,rotateZ:Bc,scale:Xb,scaleX:Xb,scaleY:Xb,scaleZ:Xb,skew:Bc,skewX:Bc,skewY:Bc,distance:ct,translateX:ct,translateY:ct,translateZ:ct,x:ct,y:ct,z:ct,perspective:ct,transformPerspective:ct,opacity:g0,originX:JN,originY:JN,originZ:ct},zIndex:zk,fillOpacity:g0,strokeOpacity:g0,numOctaves:zk},mGe={...nT,color:ai,backgroundColor:ai,outlineColor:ai,fill:ai,stroke:ai,borderColor:ai,borderTopColor:ai,borderRightColor:ai,borderBottomColor:ai,borderLeftColor:ai,filter:eT,WebkitFilter:eT,mask:tT,WebkitMask:tT},Nk=e=>mGe[e],gGe=new Set([eT,tT]);function kk(e,t){let n=Nk(e);return gGe.has(n)||(n=ds),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const yGe=new Set(["auto","none","0"]);function bGe(e,t,n){let i=0,r;for(;i<e.length&&!r;){const o=e[i];typeof o=="string"&&!yGe.has(o)&&_0(o).values.length&&(r=e[i]),i++}if(r&&n)for(const o of t)e[o]=kk(n,r)}class _Ge extends WE{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(),wE(h))){const d=Ck(h,n.current);d!==void 0&&(t[u]=d),u===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Mk.has(i)||t.length!==2)return;const[r,o]=t,s=Ak(r),a=Ak(o),c=jN(r),l=jN(o);if(c!==l&&Yc[i]){this.needsMeasurement=!0;return}if(s!==a)if(fk(s)&&fk(a))for(let u=0;u<t.length;u++){const h=t[u];typeof h=="string"&&(t[u]=parseFloat(h))}else Yc[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,i=[];for(let r=0;r<t.length;r++)(t[r]===null||hGe(t[r]))&&i.push(r);i.length&&bGe(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=Yc[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]=Yc[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 vGe=new Set(["opacity","clipPath","filter","transform"]);function Xk(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 Zk=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function wGe(e){return IN(e)&&"offsetHeight"in e}const{schedule:iT}=BN(queueMicrotask,!1),fs={x:!1,y:!1};function Dk(){return fs.x||fs.y}function xGe(e){return e==="x"||e==="y"?fs[e]?null:(fs[e]=!0,()=>{fs[e]=!1}):fs.x||fs.y?null:(fs.x=fs.y=!0,()=>{fs.x=fs.y=!1})}function Uk(e,t){const n=Xk(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function SGe(e){return!(e.pointerType==="touch"||Dk())}function EGe(e,t,n={}){const[i,r,o]=Uk(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(!SGe(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 Wk=(e,t)=>t?e===t?!0:Wk(e,t.parentElement):!1,rT=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,TGe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function CGe(e){return TGe.has(e.tagName)||e.isContentEditable===!0}const RGe=new Set(["INPUT","SELECT","TEXTAREA"]);function IGe(e){return RGe.has(e.tagName)||e.isContentEditable===!0}const Wb=new WeakSet;function Bk(e){return t=>{t.key==="Enter"&&e(t)}}function oT(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const MGe=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=Bk(()=>{if(Wb.has(n))return;oT(n,"down");const r=Bk(()=>{oT(n,"up")}),o=()=>oT(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 Yk(e){return rT(e)&&!Dk()}const Hk=new WeakSet;function LGe(e,t,n={}){const[i,r,o]=Uk(e,n),s=a=>{const c=a.currentTarget;if(!Yk(a)||Hk.has(a))return;Wb.add(c),n.stopPropagation&&Hk.add(a);const l=t(c,a),u=(f,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",d),Wb.has(c)&&Wb.delete(c),Yk(f)&&typeof l=="function"&&l(f,{success:p})},h=f=>{u(f,c===window||c===document||n.useGlobalTarget||Wk(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),wGe(a)&&(a.addEventListener("focus",l=>MGe(l,r)),!CGe(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function sT(e){return IN(e)&&"ownerSVGElement"in e}const Bb=new WeakMap;let Yb;const jk=(e,t,n)=>(i,r)=>r&&r[0]?r[0][e+"Size"]:sT(i)&&"getBBox"in i?i.getBBox()[t]:i[n],PGe=jk("inline","width","offsetWidth"),OGe=jk("block","height","offsetHeight");function GGe({target:e,borderBoxSize:t}){Bb.get(e)?.forEach(n=>{n(e,{get width(){return PGe(e,t)},get height(){return OGe(e,t)}})})}function VGe(e){e.forEach(GGe)}function FGe(){typeof ResizeObserver>"u"||(Yb=new ResizeObserver(VGe))}function AGe(e,t){Yb||FGe();const n=Xk(e);return n.forEach(i=>{let r=Bb.get(i);r||(r=new Set,Bb.set(i,r)),r.add(t),Yb?.observe(i)}),()=>{n.forEach(i=>{const r=Bb.get(i);r?.delete(t),r?.size||Yb?.unobserve(i)})}}const Hb=new Set;let nd;function zGe(){nd=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Hb.forEach(t=>t(e))},window.addEventListener("resize",nd)}function NGe(e){return Hb.add(e),nd||zGe(),()=>{Hb.delete(e),!Hb.size&&typeof nd=="function"&&(window.removeEventListener("resize",nd),nd=void 0)}}function Kk(e,t){return typeof e=="function"?NGe(e):AGe(e,t)}function kGe(e){return sT(e)&&e.tagName==="svg"}const XGe=[...Fk,ai,ds],ZGe=e=>XGe.find(Vk(e)),Jk=()=>({translate:0,scale:1,origin:0,originPoint:0}),id=()=>({x:Jk(),y:Jk()}),Qk=()=>({min:0,max:0}),yi=()=>({x:Qk(),y:Qk()}),DGe=new WeakMap;function jb(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function w0(e){return typeof e=="string"||Array.isArray(e)}const aT=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cT=["initial",...aT];function Kb(e){return jb(e.animate)||cT.some(t=>w0(e[t]))}function qk(e){return!!(Kb(e)||e.variants)}function UGe(e,t,n){for(const i in t){const r=t[i],o=n[i];if(tr(r))e.addValue(i,r);else if(tr(o))e.addValue(i,eu(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,eu(s!==void 0?s:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const lT={current:null},$k={current:!1},WGe=typeof window<"u";function BGe(){if($k.current=!0,!!WGe)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>lT.current=e.matches;e.addEventListener("change",t),t()}else lT.current=!1}const eX=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Jb={};function tX(e){Jb=e}function YGe(){return Jb}class HGe{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=WE,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=gr.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Sn.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=Kb(n),this.isVariantNode=qk(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&&tr(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,DGe.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:($k.current||BGe(),this.shouldReduceMotion=lT.current),process.env.NODE_ENV!=="production"&&yE(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(),Wc(this.notifyUpdate),Wc(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&&vGe.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:a,times:c,ease:l,duration:u}=n.accelerate,h=new xk({element:this.current,name:t,keyframes:a,times:c,ease:l,duration:Vo(u)}),d=s(h);this.valueSubscriptions.set(t,()=>{d(),h.cancel()});return}const i=ed.has(t);i&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Sn.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 Jb){const n=Jb[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):yi()}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<eX.length;i++){const r=eX[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=UGe(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=eu(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"&&(RN(i)||MN(i))?i=parseFloat(i):!ZGe(i)&&ds.test(n)&&(i=kk(t,n)),this.setBaseTarget(t,tr(i)?i.get():i)),tr(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=KE(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&&!tr(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 gE),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){iT.render(this.render)}}class nX extends HGe{constructor(){super(...arguments),this.KeyframeResolver=_Ge}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;tr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Hc{constructor(t){this.isMounted=!1,this.node=t}update(){}}function iX({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function jGe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function KGe(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 uT(e){return e===void 0||e===1}function hT({scale:e,scaleX:t,scaleY:n}){return!uT(e)||!uT(t)||!uT(n)}function tu(e){return hT(e)||rX(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function rX(e){return oX(e.x)||oX(e.y)}function oX(e){return e&&e!=="0%"}function Qb(e,t,n){const i=e-n,r=t*i;return n+r}function sX(e,t,n,i,r){return r!==void 0&&(e=Qb(e,r,i)),Qb(e,n,i)+t}function dT(e,t=0,n=1,i,r){e.min=sX(e.min,t,n,i,r),e.max=sX(e.max,t,n,i,r)}function aX(e,{x:t,y:n}){dT(e.x,t.translate,t.scale,t.originPoint),dT(e.y,n.translate,n.scale,n.originPoint)}const cX=.999999999999,lX=1.0000000000001;function JGe(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&&od(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,aX(e,s)),i&&tu(o.latestValues)&&od(e,o.latestValues))}t.x<lX&&t.x>cX&&(t.x=1),t.y<lX&&t.y>cX&&(t.y=1)}function rd(e,t){e.min=e.min+t,e.max=e.max+t}function uX(e,t,n,i,r=.5){const o=kn(e.min,e.max,r);dT(e,t,n,o,i)}function hX(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function od(e,t){uX(e.x,hX(t.x,e.x),t.scaleX,t.scale,t.originX),uX(e.y,hX(t.y,e.y),t.scaleY,t.scale,t.originY)}function dX(e,t){return iX(KGe(e.getBoundingClientRect(),t))}function QGe(e,t,n){const i=dX(e,n),{scroll:r}=t;return r&&(rd(i.x,r.offset.x),rd(i.y,r.offset.y)),i}const qGe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$Ge=$h.length;function eVe(e,t,n){let i="",r=!0;for(let o=0;o<$Ge;o++){const s=$h[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=Zk(a,nT[s]);if(!c){r=!1;const u=qGe[s]||s;i+=`${u}(${l}) `}n&&(t[s]=l)}}return i=i.trim(),n?i=n(t,r?"":i):r&&(i="none"),i}function fT(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(ed.has(c)){s=!0;continue}else if(HN(c)){r[c]=l;continue}else{const u=Zk(l,nT[c]);c.startsWith("origin")?(a=!0,o[c]=u):i[c]=u}}if(t.transform||(s||n?i.transform=eVe(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 fX(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 pX(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const x0={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ct.test(e))e=parseFloat(e);else return e;const n=pX(e,t.target.x),i=pX(e,t.target.y);return`${n}% ${i}%`}},tVe={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=ds.parse(e);if(r.length>5)return i;const o=ds.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=kn(a,c,.5);return typeof r[2+s]=="number"&&(r[2+s]/=l),typeof r[3+s]=="number"&&(r[3+s]/=l),o(r)}},pT={borderRadius:{...x0,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:x0,borderTopRightRadius:x0,borderBottomLeftRadius:x0,borderBottomRightRadius:x0,boxShadow:tVe};function mX(e,{layout:t,layoutId:n}){return ed.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!pT[e]||e==="opacity")}function mT(e,t,n){const i=e.style,r=t?.style,o={};if(!i)return o;for(const s in i)(tr(i[s])||r&&tr(r[s])||mX(s,e)||n?.getValue(s)?.liveStyle!==void 0)&&(o[s]=i[s]);return o}function nVe(e){return window.getComputedStyle(e)}class iVe extends nX{constructor(){super(...arguments),this.type="html",this.renderInstance=fX}readValueFromInstance(t,n){if(ed.has(n))return this.projection?.isProjecting?kE(n):SOe(t,n);{const i=nVe(t),r=(HN(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return dX(t,n)}build(t,n,i){fT(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return mT(t,n,i)}}const rVe={offset:"stroke-dashoffset",array:"stroke-dasharray"},oVe={offset:"strokeDashoffset",array:"strokeDasharray"};function sVe(e,t,n=1,i=0,r=!0){e.pathLength=1;const o=r?rVe:oVe;e[o.offset]=`${-i}`,e[o.array]=`${t} ${n}`}const aVe=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function gX(e,{attrX:t,attrY:n,attrScale:i,pathLength:r,pathSpacing:o=1,pathOffset:s=0,...a},c,l,u){if(fT(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 aVe)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&&sVe(h,r,o,s,!1)}const yX=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"]),bX=e=>typeof e=="string"&&e.toLowerCase()==="svg";function cVe(e,t,n,i){fX(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(yX.has(r)?r:qE(r),t.attrs[r])}function _X(e,t,n){const i=mT(e,t,n);for(const r in e)if(tr(e[r])||tr(t[r])){const o=$h.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[o]=e[r]}return i}class lVe extends nX{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yi}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ed.has(n)){const i=Nk(n);return i&&i.default||0}return n=yX.has(n)?n:qE(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return _X(t,n,i)}build(t,n,i){gX(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,r){cVe(t,n,i,r)}mount(t){this.isSVGTag=bX(t.tagName),super.mount(t)}}const uVe=cT.length;function vX(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?vX(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<uVe;n++){const i=cT[n],r=e.props[i];(w0(r)||r===!1)&&(t[i]=r)}return t}function wX(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 hVe=[...aT].reverse(),dVe=aT.length;function fVe(e){return t=>Promise.all(t.map(({animation:n,options:i})=>lGe(e,n,i)))}function pVe(e){let t=fVe(e),n=xX(),i=!0,r=!1;const o=l=>(u,h)=>{const d=td(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=vX(e.parent)||{},d=[],f=new Set;let p={},m=1/0;for(let g=0;g<dVe;g++){const v=hVe[g],S=n[v],T=u[v]!==void 0?u[v]:h[v],I=w0(T),O=v===l?S.isActive:null;O===!1&&(m=g);let G=T===h[v]&&T!==u[v]&&I;if(G&&(i||r)&&e.manuallyAnimateOnMount&&(G=!1),S.protectedKeys={...p},!S.isActive&&O===null||!T&&!S.prevProp||jb(T)||typeof T=="boolean")continue;if(v==="exit"&&S.isActive&&O!==!0){S.prevResolvedValues&&(p={...p,...S.prevResolvedValues});continue}const A=mVe(S.prevProp,T);let V=A||v===l&&S.isActive&&!G&&I||g>m&&I,N=!1;const k=Array.isArray(T)?T:[T];let P=k.reduce(o(v),{});O===!1&&(P={});const{prevResolvedValues:w={}}=S,x={...w,...P},C=Y=>{V=!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],Q=w[Y];if(p.hasOwnProperty(Y))continue;let z=!1;JE(H)&&JE(Q)?z=!wX(H,Q):z=H!==Q,z?H!=null?C(Y):f.add(Y):H!==void 0&&f.has(Y)?C(Y):S.protectedKeys[Y]=!0}S.prevProp=T,S.prevResolvedValues=P,S.isActive&&(p={...p,...P}),(i||r)&&e.blockInitialAnimation&&(V=!1);const Z=G&&A;V&&(!Z||N)&&d.push(...k.map(Y=>{const H={type:v};if(typeof Y=="string"&&(i||r)&&!Z&&e.manuallyAnimateOnMount&&e.parent){const{parent:Q}=e,z=td(Q,Y);if(Q.enteringChildren&&z){const{delayChildren:W}=z.transition||{};H.delay=Tk(Q.enteringChildren,e,W)}}return{animation:Y,options:H}}))}if(f.size){const g={};if(typeof u.initial!="boolean"){const v=td(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),T=e.getValue(v);T&&(T.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=xX(),r=!0}}}function mVe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!wX(t,e):!1}function nu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function xX(){return{animate:nu(!0),whileInView:nu(),whileHover:nu(),whileTap:nu(),whileDrag:nu(),whileFocus:nu(),exit:nu()}}function SX(e,t){e.min=t.min,e.max=t.max}function ps(e,t){SX(e.x,t.x),SX(e.y,t.y)}function EX(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const TX=1e-4,gVe=1-TX,yVe=1+TX,CX=.01,bVe=0-CX,_Ve=0+CX;function yr(e){return e.max-e.min}function vVe(e,t,n){return Math.abs(e-t)<=n}function RX(e,t,n,i=.5){e.origin=i,e.originPoint=kn(t.min,t.max,e.origin),e.scale=yr(n)/yr(t),e.translate=kn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=gVe&&e.scale<=yVe||isNaN(e.scale))&&(e.scale=1),(e.translate>=bVe&&e.translate<=_Ve||isNaN(e.translate))&&(e.translate=0)}function S0(e,t,n,i){RX(e.x,t.x,n.x,i?i.originX:void 0),RX(e.y,t.y,n.y,i?i.originY:void 0)}function IX(e,t,n){e.min=n.min+t.min,e.max=e.min+yr(t)}function wVe(e,t,n){IX(e.x,t.x,n.x),IX(e.y,t.y,n.y)}function MX(e,t,n){e.min=t.min-n.min,e.max=e.min+yr(t)}function qb(e,t,n){MX(e.x,t.x,n.x),MX(e.y,t.y,n.y)}function LX(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 xVe(e,t=0,n=1,i=.5,r,o=e,s=e){if(na.test(t)&&(t=parseFloat(t),t=kn(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=kn(o.min,o.max,i);e===o&&(a-=t),e.min=LX(e.min,t,n,a,r),e.max=LX(e.max,t,n,a,r)}function PX(e,t,[n,i,r],o,s){xVe(e,t[n],t[i],t[r],t.scale,o,s)}const SVe=["x","scaleX","originX"],EVe=["y","scaleY","originY"];function OX(e,t,n,i){PX(e.x,t,SVe,n?n.x:void 0,i?i.x:void 0),PX(e.y,t,EVe,n?n.y:void 0,i?i.y:void 0)}function GX(e){return e.translate===0&&e.scale===1}function VX(e){return GX(e.x)&&GX(e.y)}function FX(e,t){return e.min===t.min&&e.max===t.max}function TVe(e,t){return FX(e.x,t.x)&&FX(e.y,t.y)}function AX(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function zX(e,t){return AX(e.x,t.x)&&AX(e.y,t.y)}function NX(e){return yr(e.x)/yr(e.y)}function kX(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ia(e){return[e("x"),e("y")]}function CVe(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 XX=["TopLeft","TopRight","BottomLeft","BottomRight"],RVe=XX.length,ZX=e=>typeof e=="string"?parseFloat(e):e,DX=e=>typeof e=="number"||ct.test(e);function IVe(e,t,n,i,r,o){r?(e.opacity=kn(0,n.opacity??1,MVe(i)),e.opacityExit=kn(t.opacity??1,0,LVe(i))):o&&(e.opacity=kn(t.opacity??1,n.opacity??1,i));for(let s=0;s<RVe;s++){const a=`border${XX[s]}Radius`;let c=UX(t,a),l=UX(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||DX(c)===DX(l)?(e[a]=Math.max(kn(ZX(c),ZX(l),i),0),(na.test(l)||na.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=kn(t.rotate||0,n.rotate||0,i))}function UX(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const MVe=WX(0,.5,kN),LVe=WX(.5,.95,Go);function WX(e,t,n){return i=>i<e?0:i>t?1:n(p0(e,t,i))}function PVe(e,t,n){const i=tr(e)?e:eu(e);return i.start(jE("",i,t,n)),i.animation}function E0(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}const OVe=(e,t)=>e.depth-t.depth;class GVe{constructor(){this.children=[],this.isDirty=!1}add(t){pE(this.children,t),this.isDirty=!0}remove(t){zb(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(OVe),this.isDirty=!1,this.children.forEach(t)}}function VVe(e,t){const n=gr.now(),i=({timestamp:r})=>{const o=r-n;o>=t&&(Wc(i),e(o-t))};return Sn.setup(i,!0),()=>Wc(i)}function $b(e){return tr(e)?e.get():e}class FVe{constructor(){this.members=[]}add(t){pE(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&&(zb(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(zb(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 e1={hasAnimatedSinceResize:!0,hasEverUpdated:!1},gT=["","X","Y","Z"],AVe=1e3;let zVe=0;function yT(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function BX(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ok(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Sn,!(r||o))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&BX(i)}function YX({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(s={},a=t?.()){this.id=zVe++,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(XVe),this.nodes.forEach(WVe),this.nodes.forEach(BVe),this.nodes.forEach(ZVe)},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 GVe)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new gE),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=sT(s)&&!kGe(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;Sn.read(()=>{h=window.innerWidth}),e(s,()=>{const f=window.innerWidth;f!==h&&(h=f,this.root.updateBlockedByResize=!0,u&&u(),u=VVe(d,250),e1.hasAnimatedSinceResize&&(e1.hasAnimatedSinceResize=!1,this.nodes.forEach(KX)))})}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()||JVe,{onLayoutAnimationStart:m,onLayoutAnimationComplete:y}=l.getProps(),g=!this.targetLayout||!zX(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={...HE(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||KX(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(),Wc(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(YVe),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&&BX(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(HX);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(jX);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(UVe),this.nodes.forEach(NVe),this.nodes.forEach(kVe)):this.nodes.forEach(jX),this.clearAllSnapshots();const a=gr.now();Ni.delta=ta(0,1e3/60,a-Ni.timestamp),Ni.timestamp=a,Ni.isProcessing=!0,vE.update.process(Ni),vE.preRender.process(Ni),vE.render.process(Ni),Ni.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,iT.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(DVe),this.sharedNodes.forEach(HVe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Sn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Sn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!yr(this.snapshot.measuredBox.x)&&!yr(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=yi(),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&&!VX(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;s&&this.instance&&(a||tu(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)),QVe(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return yi();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(qVe))){const{scroll:l}=this.root;l&&(rd(a.x,l.offset.x),rd(a.y,l.offset.y))}return a}removeElementScroll(s){const a=yi();if(ps(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&&ps(a,s),rd(a.x,u.offset.x),rd(a.y,u.offset.y))}return a}applyTransform(s,a=!1){const c=yi();ps(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&&od(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),tu(u.latestValues)&&od(c,u.latestValues)}return tu(this.latestValues)&&od(c,this.latestValues),c}removeTransform(s){const a=yi();ps(a,s);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!tu(l.latestValues))continue;hT(l.latestValues)&&l.updateSnapshot();const u=yi(),h=l.measurePageBox();ps(u,h),OX(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return tu(this.latestValues)&&OX(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!==Ni.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=Ni.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=yi(),this.targetWithTransforms=yi()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),wVe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ps(this.target,this.layout.layoutBox),aX(this.target,this.targetDelta)):ps(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||hT(this.parent.latestValues)||rX(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=yi(),this.relativeTargetOrigin=yi(),qb(this.relativeTargetOrigin,a,c),ps(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===Ni.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;ps(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,d=this.treeScale.y;JGe(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=yi());const{target:f}=s;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(EX(this.prevProjectionDelta.x,this.projectionDelta.x),EX(this.prevProjectionDelta.y,this.projectionDelta.y)),S0(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==d||!kX(this.projectionDelta.x,this.prevProjectionDelta.x)||!kX(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=id(),this.projectionDelta=id(),this.projectionDeltaWithTransform=id()}setAnimationOrigin(s,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},h=id();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=yi(),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(KVe));this.animationProgress=0;let S;this.mixTargetDelta=T=>{const I=T/1e3;JX(h.x,s.x,I),JX(h.y,s.y,I),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qb(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),jVe(this.relativeTarget,this.relativeTargetOrigin,d,I),S&&TVe(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=yi()),ps(S,this.relativeTarget)),m&&(this.animationValues=u,IVe(u,l,this.latestValues,I,v,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Wc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Sn.update(()=>{e1.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=eu(0)),this.motionValue.jump(0,!1),this.currentAnimation=PVe(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(AVe),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&&tZ(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||yi();const h=yr(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+h;const d=yr(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+d}ps(a,c),od(a,u),S0(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new FVe),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&&yT("z",s,l,this.animationValues);for(let u=0;u<gT.length;u++)yT(`rotate${gT[u]}`,s,l,this.animationValues),yT(`skew${gT[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=$b(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=$b(a?.pointerEvents)||""),this.hasProjected&&!tu(this.latestValues)&&(s.transform=c?c({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let h=CVe(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 pT){if(u[p]===void 0)continue;const{correct:m,applyTo:y,isCSSVariable:g}=pT[p],v=h==="none"?u[p]:m(u[p],l);if(y){const S=y.length;for(let T=0;T<S;T++)s[y[T]]=v}else g?this.options.visualElement.renderState.vars[p]=v:s[p]=v}this.options.layoutId&&(s.pointerEvents=l===this?$b(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(HX),this.root.sharedNodes.clear()}}}function NVe(e){e.updateLayout()}function kVe(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"?ia(u=>{const h=o?t.measuredBox[u]:t.layoutBox[u],d=yr(h);h.min=n[u].min,h.max=h.min+d}):tZ(r,t.layoutBox,n)&&ia(u=>{const h=o?t.measuredBox[u]:t.layoutBox[u],d=yr(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=id();S0(s,n,t.layoutBox);const a=id();o?S0(a,e.applyTransform(i,!0),t.measuredBox):S0(a,n,t.layoutBox);const c=!VX(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=yi();qb(f,t.layoutBox,h.layoutBox);const p=yi();qb(p,n,d.layoutBox),zX(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 XVe(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 ZVe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function DVe(e){e.clearSnapshot()}function HX(e){e.clearMeasurements()}function jX(e){e.isLayoutDirty=!1}function UVe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function KX(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function WVe(e){e.resolveTargetDelta()}function BVe(e){e.calcProjection()}function YVe(e){e.resetSkewAndRotation()}function HVe(e){e.removeLeadSnapshot()}function JX(e,t,n){e.translate=kn(t.translate,0,n),e.scale=kn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function QX(e,t,n,i){e.min=kn(t.min,n.min,i),e.max=kn(t.max,n.max,i)}function jVe(e,t,n,i){QX(e.x,t.x,n.x,i),QX(e.y,t.y,n.y,i)}function KVe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const JVe={duration:.45,ease:[.4,0,.1,1]},qX=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),$X=qX("applewebkit/")&&!qX("chrome/")?Math.round:Go;function eZ(e){e.min=$X(e.min),e.max=$X(e.max)}function QVe(e){eZ(e.x),eZ(e.y)}function tZ(e,t,n){return e==="position"||e==="preserve-aspect"&&!vVe(NX(t),NX(n),.2)}function qVe(e){return e!==e.root&&e.scroll?.wasRoot}const $Ve=YX({attachResizeListener:(e,t)=>E0(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),bT={current:void 0},nZ=YX({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!bT.current){const e=new $Ve({});e.mount(window),e.setOptions({layoutScroll:!0}),bT.current=e}return bT.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),_T=R.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function e9e(e=!0){const t=R.useContext(fE);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 iZ=R.createContext({strict:!1}),rZ={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 oZ=!1;function t9e(){if(oZ)return;const e={};for(const t in rZ)e[t]={isEnabled:n=>rZ[t].some(i=>!!n[i])};tX(e),oZ=!0}function sZ(){return t9e(),YGe()}function n9e(e){const t=sZ();for(const n in e)t[n]={...t[n],...e[n]};tX(t)}const i9e=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 t1(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||i9e.has(e)}let aZ=e=>!t1(e);function r9e(e){typeof e=="function"&&(aZ=t=>t.startsWith("on")?!t1(t):e(t))}try{r9e(require("@emotion/is-prop-valid").default)}catch{}function o9e(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(aZ(r)||n===!0&&t1(r)||!t&&!t1(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}const n1=R.createContext({});function s9e(e,t){if(Kb(e)){const{initial:n,animate:i}=e;return{initial:n===!1||w0(n)?n:void 0,animate:w0(i)?i:void 0}}return e.inherit!==!1?t:{}}function a9e(e){const{initial:t,animate:n}=s9e(e,R.useContext(n1));return R.useMemo(()=>({initial:t,animate:n}),[cZ(t),cZ(n)])}function cZ(e){return Array.isArray(e)?e.join(" "):e}const vT=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function lZ(e,t,n){for(const i in t)!tr(t[i])&&!mX(i,n)&&(e[i]=t[i])}function c9e({transformTemplate:e},t){return R.useMemo(()=>{const n=vT();return fT(n,t,e),Object.assign({},n.vars,n.style)},[t])}function l9e(e,t){const n=e.style||{},i={};return lZ(i,n,e),Object.assign(i,c9e(e,t)),i}function u9e(e,t){const n={},i=l9e(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 uZ=()=>({...vT(),attrs:{}});function h9e(e,t,n,i){const r=R.useMemo(()=>{const o=uZ();return gX(o,t,bX(i),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};lZ(o,e.style,e),r.style={...o,...r.style}}return r}const d9e=["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 wT(e){return typeof e!="string"||e.includes("-")?!1:!!(d9e.indexOf(e)>-1||/[A-Z]/u.test(e))}function f9e(e,t,n,{latestValues:i},r,o=!1,s){const c=(s??wT(e)?h9e:u9e)(t,i,r,e),l=o9e(t,typeof e=="string",o),u=e!==R.Fragment?{...l,...c,ref:n}:{},{children:h}=t,d=R.useMemo(()=>tr(h)?h.get():h,[h]);return R.createElement(e,{...u,children:d})}function p9e({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,r){return{latestValues:m9e(n,i,r,e),renderState:t()}}function m9e(e,t,n,i){const r={},o=i(e,{});for(const d in o)r[d]=$b(o[d]);let{initial:s,animate:a}=e;const c=Kb(e),l=qk(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"&&!jb(h)){const d=Array.isArray(h)?h:[h];for(let f=0;f<d.length;f++){const p=KE(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 T=u?S.length-1:0;S=S[T]}S!==null&&(r[v]=S)}for(const v in m)r[v]=m[v]}}}return r}const hZ=e=>(t,n)=>{const i=R.useContext(n1),r=R.useContext(fE),o=()=>p9e(e,t,i,r);return n?o():CN(o)},g9e=hZ({scrapeMotionValuesFromProps:mT,createRenderState:vT}),y9e=hZ({scrapeMotionValuesFromProps:_X,createRenderState:uZ}),b9e=Symbol.for("motionComponentSymbol");function _9e(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 dZ=R.createContext({});function sd(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function v9e(e,t,n,i,r,o){const{visualElement:s}=R.useContext(n1),a=R.useContext(iZ),c=R.useContext(fE),l=R.useContext(_T),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(dZ);p&&!p.projection&&r&&(p.type==="html"||p.type==="svg")&&w9e(d.current,n,r,m);const y=R.useRef(!1);R.useInsertionEffect(()=>{p&&y.current&&p.update(n,c)});const g=n[Pk],v=R.useRef(!!g&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return wPe(()=>{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 w9e(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:fZ(e.parent)),e.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!s||a&&sd(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:c,layoutRoot:l})}function fZ(e){if(e)return e.options.allowProjection!==!1?e.projection:fZ(e.parent)}function xT(e,{forwardMotionProps:t=!1,type:n}={},i,r){i&&n9e(i);const o=n?n==="svg":wT(e),s=o?y9e:g9e;function a(l,u){let h;const d={...R.useContext(_T),...l,layoutId:x9e(l)},{isStatic:f}=d,p=a9e(l),m=s(l,f);if(!f&&typeof window<"u"){S9e(d,i);const y=E9e(d);h=y.MeasureLayout,p.visualElement=v9e(e,m,d,r,y.ProjectionNode,o)}return le.jsxs(n1.Provider,{value:p,children:[h&&p.visualElement?le.jsx(h,{visualElement:p.visualElement,...d}):null,f9e(e,l,_9e(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[b9e]=e,c}function x9e({layoutId:e}){const t=R.useContext(TN).id;return t&&e!==void 0?t+"-"+e:e}function S9e(e,t){const n=R.useContext(iZ).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?Kh(!1,i,"lazy-strict-mode"):Da(!1,i,"lazy-strict-mode")}}function E9e(e){const t=sZ(),{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 T9e(e,t){if(typeof Proxy>"u")return xT;const n=new Map,i=(o,s)=>xT(o,s,e,t),r=(o,s)=>(process.env.NODE_ENV!=="production"&&yE(!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,xT(s,void 0,e,t)),n.get(s))})}const C9e=(e,t)=>t.isSVG??wT(e)?new lVe(t):new iVe(t,{allowProjection:e!==R.Fragment});class R9e extends Hc{constructor(t){super(t),t.animationState||(t.animationState=pVe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();jb(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 I9e=0;class M9e extends Hc{constructor(){super(...arguments),this.id=I9e++}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 L9e={animation:{Feature:R9e},exit:{Feature:M9e}};function T0(e){return{point:{x:e.pageX,y:e.pageY}}}const P9e=e=>t=>rT(t)&&e(t,T0(t));function C0(e,t,n,i){return E0(e,t,P9e(n),i)}const pZ=({current:e})=>e?e.ownerDocument.defaultView:null,mZ=(e,t)=>Math.abs(e-t);function O9e(e,t){const n=mZ(e.x,t.x),i=mZ(e.y,t.y);return Math.sqrt(n**2+i**2)}const gZ=new Set(["auto","scroll"]);class yZ{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=ET(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=O9e(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:y}=f,{timestamp:g}=Ni;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=ST(p,this.transformPagePoint),Sn.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=ET(f.type==="pointercancel"?this.lastMoveEventInfo:ST(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),y&&y(f,v)},!rT(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=s,this.contextWindow=r||window;const c=T0(t),l=ST(c,this.transformPagePoint),{point:u}=l,{timestamp:h}=Ni;this.history=[{...u,timestamp:h}];const{onSessionStart:d}=n;d&&d(t,ET(l,this.history)),this.removeListeners=f0(C0(this.contextWindow,"pointermove",this.handlePointerMove),C0(this.contextWindow,"pointerup",this.handlePointerUp),C0(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const i=getComputedStyle(n);(gZ.has(i.overflowX)||gZ.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),Sn.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Wc(this.updatePoint)}}function ST(e,t){return t?{point:t(e.point)}:e}function bZ(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ET({point:e},t){return{point:e,delta:bZ(e,_Z(t)),offset:bZ(e,G9e(t)),velocity:V9e(t,.1)}}function G9e(e){return e[0]}function _Z(e){return e[e.length-1]}function V9e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=_Z(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Vo(t)));)n--;if(!i)return{x:0,y:0};i===e[0]&&e.length>2&&r.timestamp-i.timestamp>Vo(t)*2&&(i=e[1]);const o=Fo(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 F9e(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?kn(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?kn(n,e,i.max):Math.min(e,n)),e}function vZ(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 A9e(e,{top:t,left:n,bottom:i,right:r}){return{x:vZ(e.x,n,r),y:vZ(e.y,t,i)}}function wZ(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 z9e(e,t){return{x:wZ(e.x,t.x),y:wZ(e.y,t.y)}}function N9e(e,t){let n=.5;const i=yr(e),r=yr(t);return r>i?n=p0(t.min,t.max-i,e.min):i>r&&(n=p0(e.min,e.max-r,t.min)),ta(0,1,n)}function k9e(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 TT=.35;function X9e(e=TT){return e===!1?e=0:e===!0&&(e=TT),{x:xZ(e,"left","right"),y:xZ(e,"top","bottom")}}function xZ(e,t,n){return{min:SZ(e,t),max:SZ(e,n)}}function SZ(e,t){return typeof e=="number"?e:e[t]||0}const Z9e=new WeakMap;class D9e{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=yi(),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(T0(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=xGe(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),ia(g=>{let v=this.getAxisMotionValue(g).get()||0;if(na.test(v)){const{projection:S}=this.visualElement;if(S&&S.layout){const T=S.layout.layoutBox[g];T&&(v=yr(T)*(parseFloat(v)/100))}}this.originPoint[g]=v}),m&&Sn.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=W9e(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&&Sn.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 yZ(t,{onSessionStart:o,onStart:s,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:i,contextWindow:pZ(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&&Sn.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||!i1(t,r,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(s=F9e(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&&sd(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=A9e(i.layoutBox,t):this.constraints=!1,this.elastic=X9e(n),r!==this.constraints&&!sd(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&ia(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=k9e(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!sd(t))return!1;const i=t.current;Da(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=QGe(i,r.root,this.visualElement.getTransformPagePoint());let s=z9e(r.layout.layoutBox,o);if(n){const a=n(jGe(s));this.hasMutatedConstraints=!!a,a&&(s=iX(a))}return s}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=ia(u=>{if(!i1(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(jE(t,i,0,n,this.visualElement,!1))}stopAnimation(){ia(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){ia(n=>{const{drag:i}=this.getProps();if(!i1(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]-kn(s,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!sd(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ia(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const c=a.get();r[s]=N9e({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(),ia(s=>{if(!i1(s,t,null))return;const a=this.getAxisMotionValue(s),{min:c,max:l}=this.constraints[s];a.set(kn(c,l,r[s]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Z9e.set(this.visualElement,this);const t=this.visualElement.current,n=C0(t,"pointerdown",l=>{const{drag:u,dragListener:h=!0}=this.getProps(),d=l.target,f=d!==t&&IGe(d);u&&h&&!f&&this.start(l)});let i;const r=()=>{const{dragConstraints:l}=this.getProps();sd(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),i||(i=U9e(t,l.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Sn.read(r);const a=E0(window,"resize",()=>this.scalePositionWithinConstraints()),c=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(ia(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=TT,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function EZ(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function U9e(e,t,n){const i=Kk(e,EZ(n)),r=Kk(t,EZ(n));return()=>{i(),r()}}function i1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function W9e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class B9e extends Hc{constructor(t){super(t),this.removeGroupControls=Go,this.removeListeners=Go,this.controls=new D9e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Go}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 CT=e=>(t,n)=>{e&&Sn.update(()=>e(t,n),!1,!0)};class Y9e extends Hc{constructor(){super(...arguments),this.removePointerDownListener=Go}onPointerDown(t){this.session=new yZ(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:pZ(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:CT(t),onStart:CT(n),onMove:CT(i),onEnd:(o,s)=>{delete this.session,r&&Sn.postRender(()=>r(o,s))}}}mount(){this.removePointerDownListener=C0(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 RT=!1;class H9e 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),RT&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),e1.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}),RT=!0,r||t.layoutDependency!==n||n===void 0||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Sn.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),iT.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=t;RT=!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 TZ(e){const[t,n]=e9e(),i=R.useContext(TN);return le.jsx(H9e,{...e,layoutGroup:i,switchLayoutGroup:R.useContext(dZ),isPresent:t,safeToRemove:n})}const j9e={pan:{Feature:Y9e},drag:{Feature:B9e,ProjectionNode:nZ,MeasureLayout:TZ}};function CZ(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&&Sn.postRender(()=>o(t,T0(t)))}class K9e extends Hc{mount(){const{current:t}=this.node;t&&(this.unmount=EGe(t,(n,i)=>(CZ(this.node,i,"Start"),r=>CZ(this.node,r,"End"))))}unmount(){}}class J9e extends Hc{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=f0(E0(this.node.current,"focus",()=>this.onFocus()),E0(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function RZ(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&&Sn.postRender(()=>o(t,T0(t)))}class Q9e extends Hc{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=LGe(t,(r,o)=>(RZ(this.node,o,"Start"),(s,{success:a})=>RZ(this.node,s,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const IT=new WeakMap,MT=new WeakMap,q9e=e=>{const t=IT.get(e.target);t&&t(e)},$9e=e=>{e.forEach(q9e)};function eFe({root:e,...t}){const n=e||document;MT.has(n)||MT.set(n,{});const i=MT.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver($9e,{root:e,...t})),i[r]}function tFe(e,t,n){const i=eFe(t);return IT.set(e,n),i.observe(e),()=>{IT.delete(e),i.unobserve(e)}}const nFe={some:0,all:1};class iFe extends Hc{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:nFe[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 tFe(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(rFe(t,n))&&this.startObserver()}unmount(){}}function rFe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const oFe={...L9e,...{inView:{Feature:iFe},tap:{Feature:Q9e},focus:{Feature:J9e},hover:{Feature:K9e}},...j9e,...{layout:{ProjectionNode:nZ,MeasureLayout:TZ}}},sFe=T9e(oFe,C9e);function IZ(e){const t=CN(()=>eu(e)),{isStatic:n}=R.useContext(_T);if(n){const[,i]=R.useState(e);R.useEffect(()=>t.on("change",i),[])}return t}function LT(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function aFe(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 cFe=typeof window<"u"?V0.useLayoutEffect:V0.useEffect,MZ=new WeakMap;function lFe(e,t){var n=aFe(null,function(i){return e.forEach(function(r){return LT(r,i)})});return cFe(function(){var i=MZ.get(n);if(i){var r=new Set(i),o=new Set(e),s=n.current;r.forEach(function(a){o.has(a)||LT(a,null)}),o.forEach(function(a){r.has(a)||LT(a,s)})}MZ.set(n,e)},[e]),n}const uFe=new is(rt.WGS84,b.ZERO),PT=R.forwardRef(({position:e,children:t,...n},i)=>{const r=ko(()=>new b);e?.clone(r);const o=IZ(""),s=IZ("none"),{toWindowPosition:a,getCamera:c,toXYZ:l,isPositionVisible:u}=oi(),h=R.useRef(null);Ol(()=>{if(h.current==null)return;let f;try{const v=a?.([r.x,r.y,r.z]);f=new pe(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(uFe.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=lFe([h,i]);return le.jsx(sFe.div,{ref:d,...n,style:{...n.style,transform:o,display:s,position:"absolute",pointerEvents:"none",left:0,top:0},children:t})});PT.displayName="ScreenSpaceElement";const hFe=({a:e,b:t,color:n})=>{const i=R.useRef([e,t]);i.current=[e,t];const r=ko(()=>new go(()=>i.current,!1)),o=R.useMemo(()=>({polyline:{positions:r,width:1.5,material:new Pl({color:n,dashLength:8})}}),[n,r]);return le.jsx(d0,{...o})},dFe=({a:e,b:t,extrudedHeight:n,color:i,showLine:r})=>{const o=ko(()=>new b);return le.jsxs(le.Fragment,{children:[le.jsx(PT,{position:b.midpoint(e,t,o),children:le.jsx(EN,{children:n<1e3?`${n.toFixed(1)} m`:`${(n/1e3).toFixed(1)} km`})}),r&&le.jsx(hFe,{a:e,b:t,color:i})]})},LZ=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 le.jsxs(le.Fragment,{children:[h&&le.jsxs(le.Fragment,{children:[le.jsx(h0,{index:-1,position:h,isEditing:r,isExtrudedControlPoint:!0,handleControlPointMouseEvent:l}),(!r||c)&&le.jsx(dFe,{a:u,b:h,extrudedHeight:n,color:r?B.fromCssColorString(u0):i,showLine:t!=="extrudedPolygon"})]}),d&&le.jsx(h0,{index:-1,position:d,isEditing:r,isExtrudedControlPoint:!0}),f&&le.jsx(h0,{index:-1,position:f,isEditing:r,isExtrudedControlPoint:!0})]})});LZ.displayName="ExtrudedControlPoints";const fFe=({id:e,hierarchy:t,extrudedHeight:n,color:i,disableShadow:r=!1,isEditing:o})=>{const s=R.useRef(t);s.current=t;const c=ko(()=>new go(()=>s.current,!1)),l=R.useRef(n);l.current=n;const h=ko(()=>new go(()=>l.current,!1)),d=R.useMemo(()=>({polygon:{hierarchy:c,heightReference:_l.RELATIVE_TO_TERRAIN,extrudedHeight:h,extrudedHeightReference:_l.RELATIVE_TO_TERRAIN,fill:!0,outline:!0,outlineWidth:1,outlineColor:o?B.fromCssColorString(u0):i?.withAlpha(1),material:new Cl(o?i?.withAlpha(.2):i),classificationType:jr.TERRAIN,shadows:r?Xf.DISABLED:Xf.ENABLED}}),[h,r,c,i,o]),{requestRender:f}=oi();return f?.(),le.jsx(d0,{id:e,...d})},pFe=({dynamic:e=!1,hierarchy:t,color:n})=>{const i=R.useRef(t);i.current=t;const r=ko(()=>new go(()=>i.current,!1)),o=e?r:t,s=R.useMemo(()=>({polygon:{hierarchy:o,fill:!0,material:n?.withAlpha(.5),classificationType:jr.TERRAIN}}),[n,o]),{requestRender:a}=oi();return a?.(),le.jsx(d0,{...s})},mFe=({dynamic:e=!1,positions:t,color:n,isEditing:i})=>{const r=R.useRef(t);r.current=t;const o=ko(()=>new go(()=>r.current,!e)),s=e?o:t,a=R.useMemo(()=>({polyline:{positions:s,width:1.5,material:i?B.fromCssColorString(u0):n,classificationType:jr.TERRAIN,clampToGround:!0}}),[n,s,i]),{requestRender:c}=oi();return c?.(),le.jsx(d0,{...a})},PZ=new b,OZ=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,PZ);r.push(a.clone())}if(e==="polygon"||e==="extrudedPolygon"){const o=b.midpoint(t[t.length-1],t[0],PZ);r.push(o.clone())}return le.jsx(le.Fragment,{children:r.map((o,s)=>le.jsx(h0,{position:o,isAddingPoint:!0,index:s,clampToGround:!0,isEditing:n,handleControlPointMouseEvent:()=>i?.([o.x,o.y,o.z],s)},s))})});OZ.displayName="SurfaceAddingPoints";const gFe=({a:e,b:t,color:n})=>{const i=R.useRef([e,t]);i.current=[e,t];const r=ko(()=>new go(()=>i.current,!1)),o=R.useMemo(()=>({polyline:{positions:r,width:1.5,material:new Pl({color:n,dashLength:8}),classificationType:jr.TERRAIN,clampToGround:!0}}),[n,r]),{requestRender:s}=oi();return s?.(),le.jsx(d0,{...o})},yFe=({a:e,b:t,color:n,showLine:i=!1})=>{const r=ko(()=>new b),{getSurfaceDistance:o}=oi(),s=o?.(e,t);return s!==void 0?le.jsxs(le.Fragment,{children:[le.jsx(PT,{position:b.midpoint(e,t,r),children:le.jsx(EN,{children:s<1e3?`${s.toFixed(1)} m`:`${(s/1e3).toFixed(1)} km`})}),i&&le.jsx(gFe,{a:e,b:t,color:n})]}):null},GZ=new b,VZ=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,GZ);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,GZ);a.push({points:[h,u],showLine:!0})}break;default:a.push({points:t.slice(-2),showLine:e==="circle"});break}return le.jsxs(le.Fragment,{children:[t.map((c,l)=>le.jsx(h0,{position:c,index:l,isSelected:o===l,clampToGround:!0,isEditing:i,handleControlPointMouseEvent:s},l)),a.map(({points:c,showLine:l},u)=>le.jsx(yFe,{a:c[0],b:c[1],color:i?B.fromCssColorString(u0):n,showLine:l},u))]})});VZ.displayName="SurfaceControlPoints";const FZ=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?gN(f):null,[f]),{positionsArray:m,hierarchyArray:y}=R.useMemo(()=>p?.type==="Point"?{}:p?.type==="LineString"?{positionsArray:lF(p)}:p!=null?{positionsArray:lF(p),hierarchyArray:uF(p)}:{},[p]),g=R.useMemo(()=>B.fromCssColorString(i??uPe),[i]);return le.jsxs(le.Fragment,{children:[m?.map((v,S)=>le.jsx(mFe,{dynamic:!0,positions:v,color:g,isEditing:r},S)),y?.map((v,S)=>le.jsx(pFe,{dynamic:!0,hierarchy:v,color:g},S)),f!=null&&(!t||r)&&le.jsx(VZ,{geometryOptions:f,color:g,isEditing:r,catchedControlPointIndex:c,selectedControlPointIndex:u,handleControlPointMouseEvent:h}),f!=null&&r&&le.jsx(OZ,{geometryOptions:f,isEditing:r,handleAddControlPoint:d}),f!=null&&t&&le.jsx(LZ,{geometryOptions:f,extrudedHeight:t,extrudedPoint:o,centroidBasePoint:s,centroidExtrudedPoint:a,catchedExtrudedPoint:l,color:g,isEditing:r,handleControlPointMouseEvent:h}),t&&y?.map((v,S)=>le.jsx(fFe,{hierarchy:v,extrudedHeight:t,disableShadow:n,color:g,isEditing:r},S))]})});FZ.displayName="SketchComponent";const bFe=({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,displayCredits:p,layersRef:m,featureFlags:y,requestingRenderMode:g,timelineManagerRef:v,cameraForceHorizontalRoll:S,onLayerSelect:T,onCameraChange:I,onLayerDrag:O,onLayerDrop:G,onLayerEdit:A,onLayerSelectWithRectStart:V,onLayerSelectWithRectMove:N,onLayerSelectWithRectEnd:k,onMount:P,onLayerVisibility:w,onLayerLoad:x,onCreditsUpdate:C},Z)=>{const{cesium:U,mouseEventHandles:Y,cesiumIonAccessToken:H,context:Q,layerSelectWithRectEventHandlers:z,sceneLight:W,sceneBackgroundColor:q,sceneMsaaSamples:$,sceneMode:se,cameraViewBoundaries:we,cameraViewOuterBoundaries:_e,cameraViewBoundariesMaterial:Fe,handleCameraChange:Ae,handleCameraMoveEnd:de,handleUpdate:Ze,handleClick:qe,handleMount:$e,handleUnmount:X,handleTilesChange:fe,handleTerrainProviderChange:he}=JLe({ref:Z,property:n,time:i,selectedLayerId:c,selectionReason:d,meta:f,layersRef:m,featureFlags:y,timelineManagerRef:v,isLayerDraggable:l,isLayerDragging:u,shouldRender:h,requestingRenderMode:g,camera:r,cameraForceHorizontalRoll:S,onLayerDrag:O,onLayerDrop:G,onLayerSelect:T,onLayerEdit:A,onLayerSelectWithRectStart:V,onLayerSelectWithRectMove:N,onLayerSelectWithRectEnd:k,onLayerVisibility:w,onLayerLoad:x,onCameraChange:I,onMount:P,onCreditsUpdate:C});return le.jsxs(mre,{ref:U,onUpdate:Ze,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:p?void 0:_Fe,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:qe,onDoubleClick:Y.doubleClick,onMouseDown:Y.mouseDown,onMouseUp:Y.mouseUp,onRightClick:Y.rightClick,onRightDown:Y.rightDown,onRightUp:Y.rightUp,onMiddleClick:Y.middleClick,onMiddleDown:Y.middleDown,onMiddleUp:Y.middleUp,onMouseMove:Y.mouseMove,onMouseEnter:Y.mouseEnter,onMouseLeave:Y.mouseLeave,onWheel:Y.wheel,automaticallyTrackDataSourceClocks:!1,children:[le.jsx(Abe,{onMount:$e,onUnmount:X}),le.jsx(Xoe,{timelineManagerRef:v}),le.jsx(Bye,{tiles:n?.tiles,cesiumIonAccessToken:H,onTilesChange:fe}),le.jsx(pF,{tileLabels:n?.tileLabels}),le.jsx(jye,{property:n,timelineManagerRef:v}),le.jsxs(NM,{useDefault:!0,children:[le.jsx(uc,{type:M.ScreenSpaceEventType.LEFT_CLICK}),le.jsx(uc,{type:M.ScreenSpaceEventType.LEFT_DOUBLE_CLICK})]}),le.jsxs(NM,{children:[le.jsx(uc,{type:M.ScreenSpaceEventType.LEFT_DOWN,action:z.start.handler}),le.jsx(uc,{type:M.ScreenSpaceEventType.LEFT_DOWN,modifier:M.KeyboardEventModifier.SHIFT,action:z.start.shift}),le.jsx(uc,{type:M.ScreenSpaceEventType.MOUSE_MOVE,action:z.move.handler}),le.jsx(uc,{type:M.ScreenSpaceEventType.MOUSE_MOVE,modifier:M.KeyboardEventModifier.SHIFT,action:z.move.shift}),le.jsx(uc,{type:M.ScreenSpaceEventType.LEFT_UP,action:z.end.handler}),le.jsx(uc,{type:M.ScreenSpaceEventType.LEFT_UP,modifier:M.KeyboardEventModifier.SHIFT,action:z.end.shift})]}),le.jsx(rre,{maximumZoomDistance:n?.camera?.limiter?.enabled?n.camera?.limiter?.targetArea?.height??Number.POSITIVE_INFINITY:Number.POSITIVE_INFINITY,enableCollisionDetection:!n?.camera?.allowEnterGround}),le.jsx(kne,{percentageChanged:.2,onChange:Ae,onMoveEnd:de}),we&&n?.camera?.limiter?.showHelper&&le.jsx(lc,{children:le.jsx(pl,{positions:we,width:1,material:M.Color.RED,arcType:M.ArcType.RHUMB})}),_e&&n?.camera?.limiter?.showHelper&&le.jsx(lc,{children:le.jsx(pl,{positions:_e,width:1,material:Fe,arcType:M.ArcType.RHUMB})}),le.jsx(nre,{backgroundColor:q,light:W,mode:se,msaaSamples:$,useDepthPicking:!1,useWebVR:!!n?.scene?.vr||void 0,debugShowFramesPerSecond:!!n?.debug?.showFramesPerSecond,verticalExaggerationRelativeHeight:n?.scene?.verticalExaggerationRelativeHeight,verticalExaggeration:n?.scene?.verticalExaggeration}),le.jsx(cre,{show:n?.sky?.skyBox?.show??!0}),le.jsx(fie,{enabled:n?.sky?.fog?.enabled??!0,density:n?.sky?.fog?.density}),le.jsx(ure,{show:n?.sky?.sun?.show??!0}),le.jsx(Nie,{show:n?.sky?.moon?.show??!0}),le.jsx(sre,{show:n?.sky?.skyAtmosphere?.show??!0,atmosphereLightIntensity:n?.sky?.skyAtmosphere?.lightIntensity,saturationShift:n?.sky?.skyAtmosphere?.saturationShift,brightnessShift:n?.sky?.skyAtmosphere?.brightnessShift}),le.jsx(_se,{property:n,cesiumIonAccessToken:H,onTerrainProviderChange:he}),le.jsx(SF.Provider,{value:Q,children:s?a:null}),le.jsx(cPe,{...lPe[n?.render?.ambientOcclusion?.quality||"low"],enabled:!!n?.render?.ambientOcclusion?.enabled,intensity:n?.render?.ambientOcclusion?.intensity??100,outputType:n?.render?.ambientOcclusion?.ambientOcclusionOnly?xN.Occlusion:null})]})},_Fe=document.createElement("div"),AZ={cesium:{component:R.forwardRef(bFe),featureComponent:O5e,clusterComponent:koe,sketchComponent:FZ,delegatedDataTypes:["czml","wms","mvt","3dtiles","osm-buildings","kml"]}};function vFe({error:e,resetErrorBoundary:t}){const i=e?.message??String(e);return le.jsxs("div",{children:[le.jsx("h1",{children:"Oops! An Error Occurred"}),le.jsx("p",{children:i}),le.jsx("p",{children:le.jsx("button",{style:{color:"#fff"},onClick:t,children:"Retry"})})]})}const wFe="0.0.7-alpha.58",xFe=({viewerProperty:e})=>{const t=R.useRef(e);t.current=e;const n=R.useMemo(()=>({get version(){return wFe},get viewerProperty(){return t.current}}),[]);R.useEffect(()=>{window.reearth_core=n},[n])},SFe=768,EFe=({wrapperRef:e})=>{const t=R.useMemo(()=>TFe(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<=SFe:void 0,query:l.query}))});return e.current&&r.observe(e.current),()=>{r.disconnect()}},[e]),n};function TFe(e){const t={};for(const[n,i]of e)t[n]=i;return t}function CFe({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=EFe({wrapperRef:d}),[p,m]=R.useState({}),[y,g]=R.useState(),[v,S]=R.useState(),T=R.useCallback(async(nt,wt,Qe,it,jt)=>{const Ii=p.layer?.layer?.type==="simple"&&p.layer?.layer?.data?.isSketchLayer;if(p.layerId===nt&&p.featureId===wt&&!Ii)return;const ci=await Qe?.(),Hn=nt&&wt?(Ii?ci?.features?.find(Qn=>Qn.id===wt):h.current?.engine.findComputedFeatureById?.(nt,wt))??jt?.feature:void 0;g(nt&&wt?h.current?.engine.findFeatureById?.(nt,wt):void 0),S(Hn),m(Qn=>Qn.layerId===nt&&Qn.featureId===wt?Qn:{layerId:nt,featureId:wt,layer:ci,reason:it}),r?.(nt,Qe,Hn,it)},[p,r]),I=R.useRef(void 0),[O,G]=zZ(e,o),[A,V]=R.useState(!1),N=R.useCallback(nt=>{V(!!nt)},[]),[k,P]=zZ(t||"default",s);R.useEffect(()=>{k==="default"&&h?.current?.engine?.setCursor("auto")},[k]);const w=A0[k??"default"],x=R.useRef(void 0),C=R.useCallback(nt=>{x.current=nt},[]),Z=R.useCallback(nt=>{x.current?.(nt)},[]),U=R.useRef(void 0),Y=R.useCallback(nt=>{U.current=nt},[]),H=R.useCallback(nt=>{U.current?.(nt)},[]),Q=R.useRef(void 0),z=R.useCallback(nt=>{Q.current=nt},[]),W=R.useCallback(nt=>{Q.current?.(nt)},[]),q=R.useRef(void 0),$=R.useCallback(nt=>{q.current=nt},[]),se=R.useCallback(nt=>{q.current?.(nt)},[]),we=R.useRef(void 0),_e=R.useCallback(nt=>{we.current=nt},[]),Fe=R.useCallback(nt=>{we.current?.(nt)},[]),Ae=R.useRef(void 0),de=R.useCallback(nt=>{Ae.current=nt},[]),Ze=R.useCallback(nt=>{Ae.current?.(nt)},[]),qe=R.useRef([]),$e=R.useCallback(nt=>{qe.current.push(nt)},[]),X=R.useCallback(nt=>{qe.current.forEach(wt=>wt(nt))},[]),fe=R.useRef([]),he=R.useCallback(nt=>{fe.current.push(nt)},[]),K=R.useCallback(nt=>{fe.current.forEach(wt=>wt(nt))},[]),j=R.useRef([]),ee=R.useCallback(nt=>{j.current.push(nt)},[]),ge=R.useCallback(nt=>{j.current.forEach(wt=>wt(nt))},[]),ae=R.useRef([]),ne=R.useCallback(nt=>{ae.current.push(nt)},[]),ye=R.useCallback((nt,wt)=>{ae.current.forEach(Qe=>Qe(nt)),l?.(nt,wt)},[l]);R.useEffect(()=>{n&&(h.current?.engine?.lookAtLayer(n),a?.(void 0))},[n,a]);const[Le,Te]=R.useState(!1),ze=R.useCallback(()=>{Te(!0)},[]),Je=R.useCallback((nt,wt,Qe)=>{Te(!1);const it=h.current?.layers.findById(nt),jt=it?.property.default.location?"default.location":it?.property.default.position?"default.position":void 0;Qe&&it&&it.propertyId&&jt&&c?.(it.propertyId,jt,Qe)},[c,h]),ut=R.useMemo(()=>({interactionMode:k,selectedLayer:p,selectedComputedFeature:v,viewport:f,handleCameraForceHorizontalRollChange:N,handleInteractionModeChange:P,onSketchPluginFeatureCreate:$e,onSketchPluginFeatureUpdate:he,onSketchPluginFeatureDelete:ee,onSketchTypeChange:ne,onLayerVisibility:Y,onLayerLoad:z,onLayerEdit:C,onLayerSelectWithRectStart:$,onLayerSelectWithRectMove:_e,onLayerSelectWithRectEnd:de}),[k,p,v,f,P,N,C,$e,he,ee,ne,Y,z,$,_e,de]),Et=R.useMemo(()=>({position:"relative",width:"100%",height:"100%",overflow:"hidden"}),[]);return xFe({viewerProperty:i}),{mapRef:h,wrapperRef:d,selectedFeature:y,camera:O,featureFlags:w,isLayerDragging:Le,timelineManagerRef:I,cameraForceHorizontalRoll:A,coreContextValue:ut,containerStyle:Et,overriddenInteractionMode:k,handleLayerSelect:T,handleLayerDrag:ze,handleLayerDrop:Je,handleLayerEdit:Z,handleCameraChange:G,handleInteractionModeChange:P,handleSketchPluginFeatureCreate:X,handleSketchPluginFeatureUpdate:K,handleSketchPluginFeatureDelete:ge,handleSketchTypeChange:ye,handleLayerVisibility:H,handleLayerLoad:W,handleLayerSelectWithRectStart:se,handleLayerSelectWithRectMove:Fe,handleLayerSelectWithRectEnd:Ze}}function zZ(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 RFe=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,displayCredits:p=!0,style:m,zoomedLayerId:y,children:g,onLayerDrop:v,onLayerSelect:S,onCameraChange:T,onZoomToLayer:I,onInteractionModeChange:O,onMount:G,onSketchTypeChangeProp:A,onSketchFeatureCreate:V,onSketchFeatureUpdate:N,onSketchFeatureDelete:k,onAPIReady:P,onCreditsUpdate:w},x)=>{const{mapRef:C,wrapperRef:Z,selectedFeature:U,camera:Y,featureFlags:H,isLayerDragging:Q,timelineManagerRef:z,cameraForceHorizontalRoll:W,coreContextValue:q,containerStyle:$,overriddenInteractionMode:se,handleLayerSelect:we,handleLayerDrag:_e,handleLayerDrop:Fe,handleLayerEdit:Ae,handleCameraChange:de,handleInteractionModeChange:Ze,handleSketchPluginFeatureCreate:qe,handleSketchPluginFeatureUpdate:$e,handleSketchPluginFeatureDelete:X,handleSketchTypeChange:fe,handleLayerVisibility:he,handleLayerLoad:K,handleLayerSelectWithRectStart:j,handleLayerSelectWithRectMove:ee,handleLayerSelectWithRectEnd:ge}=CFe({camera:l,interactionMode:h,zoomedLayerId:y,viewerProperty:i,onLayerSelect:S,onCameraChange:T,onZoomToLayer:I,onLayerDrop:v,onInteractionModeChange:O,onSketchTypeChangeProp:A},x);return le.jsx(Voe,{FallbackComponent:vFe,children:le.jsx(Noe,{mapRef:C,children:le.jsxs("div",{ref:Z,style:$,children:[le.jsx(h5,{ref:C,isBuilt:t,isEditable:n,engine:e,layers:r,engines:AZ,camera:Y,cameraForceHorizontalRoll:W,clusters:o,hiddenLayers:c,isLayerDragging:Q,isLayerDraggable:n,meta:f,displayCredits:p,style:m,featureFlags:H,shouldRender:d,property:i,time:u,small:s,ready:a,timelineManagerRef:z,interactionMode:se,selectedFeature:U,onCameraChange:de,onLayerDrag:_e,onLayerDrop:Fe,onLayerSelect:we,onLayerEdit:Ae,overrideInteractionMode:Ze,onSketchFeatureCreate:V,onSketchPluginFeatureCreate:qe,onSketchFeatureUpdate:N,onSketchPluginFeatureUpdate:$e,onSketchFeatureDelete:k,onSketchPluginFeatureDelete:X,onSketchTypeChange:fe,onMount:G,onLayerVisibility:he,onLayerLoad:K,onLayerSelectWithRectStart:j,onLayerSelectWithRectMove:ee,onLayerSelectWithRectEnd:ge,onAPIReady:P,onCreditsUpdate:w}),le.jsx(f5.Provider,{value:q,children:g})]})})})}));var ad=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},ra=[],Ao=[],IFe=typeof Uint8Array<"u"?Uint8Array:Array,OT=!1;function NZ(){OT=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t<n;++t)ra[t]=e[t],Ao[e.charCodeAt(t)]=t;Ao[45]=62,Ao[95]=63}function MFe(e){OT||NZ();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 IFe(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=Ao[e.charCodeAt(t)]<<18|Ao[e.charCodeAt(t+1)]<<12|Ao[e.charCodeAt(t+2)]<<6|Ao[e.charCodeAt(t+3)],s[c++]=r>>16&255,s[c++]=r>>8&255,s[c++]=r&255;return o===2?(r=Ao[e.charCodeAt(t)]<<2|Ao[e.charCodeAt(t+1)]>>4,s[c++]=r&255):o===1&&(r=Ao[e.charCodeAt(t)]<<10|Ao[e.charCodeAt(t+1)]<<4|Ao[e.charCodeAt(t+2)]>>2,s[c++]=r>>8&255,s[c++]=r&255),s}function LFe(e){return ra[e>>18&63]+ra[e>>12&63]+ra[e>>6&63]+ra[e&63]}function PFe(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(LFe(i));return r.join("")}function kZ(e){OT||NZ();for(var t,n=e.length,i=n%3,r="",o=[],s=16383,a=0,c=n-i;a<c;a+=s)o.push(PFe(e,a,a+s>c?c:a+s));return i===1?(t=e[n-1],r+=ra[t>>2],r+=ra[t<<4&63],r+="=="):i===2&&(t=(e[n-2]<<8)+e[n-1],r+=ra[t>>10],r+=ra[t>>4&63],r+=ra[t<<2&63],r+="="),o.push(r),o.join("")}function r1(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 XZ(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 OFe={}.toString,ZZ=Array.isArray||function(e){return OFe.call(e)=="[object Array]"},GFe=50;be.TYPED_ARRAY_SUPPORT=ad.TYPED_ARRAY_SUPPORT!==void 0?ad.TYPED_ARRAY_SUPPORT:!0,o1();function o1(){return be.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Wa(e,t){if(o1()<t)throw new RangeError("Invalid typed array length");return be.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=be.prototype):(e===null&&(e=new be(t)),e.length=t),e}function be(e,t,n){if(!be.TYPED_ARRAY_SUPPORT&&!(this instanceof be))return new be(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 GT(this,e)}return DZ(this,e,t,n)}be.poolSize=8192,be._augment=function(e){return e.__proto__=be.prototype,e};function DZ(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?AFe(e,t,n,i):typeof t=="string"?FFe(e,t,n):zFe(e,t)}be.from=function(e,t,n){return DZ(null,e,t,n)},be.TYPED_ARRAY_SUPPORT&&(be.prototype.__proto__=Uint8Array.prototype,be.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&be[Symbol.species]);function UZ(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 VFe(e,t,n,i){return UZ(t),t<=0?Wa(e,t):n!==void 0?typeof i=="string"?Wa(e,t).fill(n,i):Wa(e,t).fill(n):Wa(e,t)}be.alloc=function(e,t,n){return VFe(null,e,t,n)};function GT(e,t){if(UZ(t),e=Wa(e,t<0?0:FT(t)|0),!be.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}be.allocUnsafe=function(e){return GT(null,e)},be.allocUnsafeSlow=function(e){return GT(null,e)};function FFe(e,t,n){if((typeof n!="string"||n==="")&&(n="utf8"),!be.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=WZ(t,n)|0;e=Wa(e,i);var r=e.write(t,n);return r!==i&&(e=e.slice(0,r)),e}function VT(e,t){var n=t.length<0?0:FT(t.length)|0;e=Wa(e,n);for(var i=0;i<n;i+=1)e[i]=t[i]&255;return e}function AFe(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),be.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=be.prototype):e=VT(e,t),e}function zFe(e,t){if(oa(t)){var n=FT(t.length)|0;return e=Wa(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"||n4e(t.length)?Wa(e,0):VT(e,t);if(t.type==="Buffer"&&ZZ(t.data))return VT(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function FT(e){if(e>=o1())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o1().toString(16)+" bytes");return e|0}be.isBuffer=Ur;function oa(e){return!!(e!=null&&e._isBuffer)}be.compare=function(t,n){if(!oa(t)||!oa(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},be.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}},be.concat=function(t,n){if(!ZZ(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return be.alloc(0);var i;if(n===void 0)for(n=0,i=0;i<t.length;++i)n+=t[i].length;var r=be.allocUnsafe(n),o=0;for(i=0;i<t.length;++i){var s=t[i];if(!oa(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r};function WZ(e,t){if(oa(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 c1(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return $Z(e).length;default:if(i)return c1(e).length;t=(""+t).toLowerCase(),i=!0}}be.byteLength=WZ;function NFe(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 jFe(this,t,n);case"utf8":case"utf-8":return jZ(this,t,n);case"ascii":return YFe(this,t,n);case"latin1":case"binary":return HFe(this,t,n);case"base64":return WFe(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return KFe(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}be.prototype._isBuffer=!0;function iu(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}be.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)iu(this,n,n+1);return this},be.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)iu(this,n,n+3),iu(this,n+1,n+2);return this},be.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)iu(this,n,n+7),iu(this,n+1,n+6),iu(this,n+2,n+5),iu(this,n+3,n+4);return this},be.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?jZ(this,0,t):NFe.apply(this,arguments)},be.prototype.equals=function(t){if(!oa(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:be.compare(this,t)===0},be.prototype.inspect=function(){var t="",n=GFe;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},be.prototype.compare=function(t,n,i,r,o){if(!oa(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 BZ(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=be.from(t,i)),oa(t))return t.length===0?-1:YZ(e,t,n,i,r);if(typeof t=="number")return t=t&255,be.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):YZ(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function YZ(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}be.prototype.includes=function(t,n,i){return this.indexOf(t,n,i)!==-1},be.prototype.indexOf=function(t,n,i){return BZ(this,t,n,i,!0)},be.prototype.lastIndexOf=function(t,n,i){return BZ(this,t,n,i,!1)};function kFe(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 XFe(e,t,n,i){return l1(c1(t,e.length-n),e,n,i)}function HZ(e,t,n,i){return l1(e4e(t),e,n,i)}function ZFe(e,t,n,i){return HZ(e,t,n,i)}function DFe(e,t,n,i){return l1($Z(t),e,n,i)}function UFe(e,t,n,i){return l1(t4e(t,e.length-n),e,n,i)}be.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 kFe(this,t,n,i);case"utf8":case"utf-8":return XFe(this,t,n,i);case"ascii":return HZ(this,t,n,i);case"latin1":case"binary":return ZFe(this,t,n,i);case"base64":return DFe(this,t,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return UFe(this,t,n,i);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},be.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function WFe(e,t,n){return t===0&&n===e.length?kZ(e):kZ(e.slice(t,n))}function jZ(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 BFe(i)}var KZ=4096;function BFe(e){var t=e.length;if(t<=KZ)return String.fromCharCode.apply(String,e);for(var n="",i=0;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=KZ));return n}function YFe(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 HFe(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 jFe(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+=$Fe(e[o]);return r}function KFe(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}be.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(be.TYPED_ARRAY_SUPPORT)r=this.subarray(t,n),r.__proto__=be.prototype;else{var o=n-t;r=new be(o,void 0);for(var s=0;s<o;++s)r[s]=this[s+t]}return r};function Ri(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")}be.prototype.readUIntLE=function(t,n,i){t=t|0,n=n|0,i||Ri(t,n,this.length);for(var r=this[t],o=1,s=0;++s<n&&(o*=256);)r+=this[t+s]*o;return r},be.prototype.readUIntBE=function(t,n,i){t=t|0,n=n|0,i||Ri(t,n,this.length);for(var r=this[t+--n],o=1;n>0&&(o*=256);)r+=this[t+--n]*o;return r},be.prototype.readUInt8=function(t,n){return n||Ri(t,1,this.length),this[t]},be.prototype.readUInt16LE=function(t,n){return n||Ri(t,2,this.length),this[t]|this[t+1]<<8},be.prototype.readUInt16BE=function(t,n){return n||Ri(t,2,this.length),this[t]<<8|this[t+1]},be.prototype.readUInt32LE=function(t,n){return n||Ri(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},be.prototype.readUInt32BE=function(t,n){return n||Ri(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},be.prototype.readIntLE=function(t,n,i){t=t|0,n=n|0,i||Ri(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},be.prototype.readIntBE=function(t,n,i){t=t|0,n=n|0,i||Ri(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},be.prototype.readInt8=function(t,n){return n||Ri(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},be.prototype.readInt16LE=function(t,n){n||Ri(t,2,this.length);var i=this[t]|this[t+1]<<8;return i&32768?i|4294901760:i},be.prototype.readInt16BE=function(t,n){n||Ri(t,2,this.length);var i=this[t+1]|this[t]<<8;return i&32768?i|4294901760:i},be.prototype.readInt32LE=function(t,n){return n||Ri(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},be.prototype.readInt32BE=function(t,n){return n||Ri(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},be.prototype.readFloatLE=function(t,n){return n||Ri(t,4,this.length),r1(this,t,!0,23,4)},be.prototype.readFloatBE=function(t,n){return n||Ri(t,4,this.length),r1(this,t,!1,23,4)},be.prototype.readDoubleLE=function(t,n){return n||Ri(t,8,this.length),r1(this,t,!0,52,8)},be.prototype.readDoubleBE=function(t,n){return n||Ri(t,8,this.length),r1(this,t,!1,52,8)};function Dr(e,t,n,i,r,o){if(!oa(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")}be.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;Dr(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},be.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;Dr(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},be.prototype.writeUInt8=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,1,255,0),be.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[n]=t&255,n+1};function s1(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}be.prototype.writeUInt16LE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,2,65535,0),be.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):s1(this,t,n,!0),n+2},be.prototype.writeUInt16BE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,2,65535,0),be.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):s1(this,t,n,!1),n+2};function a1(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}be.prototype.writeUInt32LE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,4,4294967295,0),be.TYPED_ARRAY_SUPPORT?(this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=t&255):a1(this,t,n,!0),n+4},be.prototype.writeUInt32BE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,4,4294967295,0),be.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):a1(this,t,n,!1),n+4},be.prototype.writeIntLE=function(t,n,i,r){if(t=+t,n=n|0,!r){var o=Math.pow(2,8*i-1);Dr(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},be.prototype.writeIntBE=function(t,n,i,r){if(t=+t,n=n|0,!r){var o=Math.pow(2,8*i-1);Dr(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},be.prototype.writeInt8=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,1,127,-128),be.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[n]=t&255,n+1},be.prototype.writeInt16LE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,2,32767,-32768),be.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):s1(this,t,n,!0),n+2},be.prototype.writeInt16BE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,2,32767,-32768),be.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):s1(this,t,n,!1),n+2},be.prototype.writeInt32LE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,4,2147483647,-2147483648),be.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24):a1(this,t,n,!0),n+4},be.prototype.writeInt32BE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),be.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):a1(this,t,n,!1),n+4};function JZ(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 QZ(e,t,n,i,r){return r||JZ(e,t,n,4),XZ(e,t,n,i,23,4),n+4}be.prototype.writeFloatLE=function(t,n,i){return QZ(this,t,n,!0,i)},be.prototype.writeFloatBE=function(t,n,i){return QZ(this,t,n,!1,i)};function qZ(e,t,n,i,r){return r||JZ(e,t,n,8),XZ(e,t,n,i,52,8),n+8}be.prototype.writeDoubleLE=function(t,n,i){return qZ(this,t,n,!0,i)},be.prototype.writeDoubleBE=function(t,n,i){return qZ(this,t,n,!1,i)},be.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||!be.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},be.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"&&!be.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=oa(t)?t:c1(new be(t,r).toString()),c=a.length;for(s=0;s<i-n;++s)this[s+n]=a[s%c]}return this};var JFe=/[^+\/0-9A-Za-z-_]/g;function QFe(e){if(e=qFe(e).replace(JFe,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function qFe(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function $Fe(e){return e<16?"0"+e.toString(16):e.toString(16)}function c1(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 e4e(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function t4e(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 $Z(e){return MFe(QFe(e))}function l1(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 n4e(e){return e!==e}function Ur(e){return e!=null&&(!!e._isBuffer||eD(e)||i4e(e))}function eD(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function i4e(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&eD(e.slice(0,0))}var AT;function jc(){}jc.prototype=Object.create(null);function Ut(){Ut.init.call(this)}Ut.EventEmitter=Ut,Ut.usingDomains=!1,Ut.prototype.domain=void 0,Ut.prototype._events=void 0,Ut.prototype._maxListeners=void 0,Ut.defaultMaxListeners=10,Ut.init=function(){this.domain=null,Ut.usingDomains&&AT.active&&!(this instanceof AT.Domain)&&(this.domain=AT.active),(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new jc,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ut.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 tD(e){return e._maxListeners===void 0?Ut.defaultMaxListeners:e._maxListeners}Ut.prototype.getMaxListeners=function(){return tD(this)};function r4e(e,t,n){if(t)e.call(n);else for(var i=e.length,r=R0(e,i),o=0;o<i;++o)r[o].call(n)}function o4e(e,t,n,i){if(t)e.call(n,i);else for(var r=e.length,o=R0(e,r),s=0;s<r;++s)o[s].call(n,i)}function s4e(e,t,n,i,r){if(t)e.call(n,i,r);else for(var o=e.length,s=R0(e,o),a=0;a<o;++a)s[a].call(n,i,r)}function a4e(e,t,n,i,r,o){if(t)e.call(n,i,r,o);else for(var s=e.length,a=R0(e,s),c=0;c<s;++c)a[c].call(n,i,r,o)}function c4e(e,t,n,i){if(t)e.apply(n,i);else for(var r=e.length,o=R0(e,r),s=0;s<r;++s)o[s].apply(n,i)}Ut.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:r4e(i,h,this);break;case 2:o4e(i,h,this,arguments[1]);break;case 3:s4e(i,h,this,arguments[1],arguments[2]);break;case 4:a4e(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];c4e(i,h,this,o)}return!0};function nD(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 jc,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=tD(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,l4e(a)}return e}function l4e(e){typeof console.warn=="function"?console.warn(e):console.log(e)}Ut.prototype.addListener=function(t,n){return nD(this,t,n,!1)},Ut.prototype.on=Ut.prototype.addListener,Ut.prototype.prependListener=function(t,n){return nD(this,t,n,!0)};function iD(e,t,n){var i=!1;function r(){e.removeListener(t,r),i||(i=!0,n.apply(e,arguments))}return r.listener=n,r}Ut.prototype.once=function(t,n){if(typeof n!="function")throw new TypeError('"listener" argument must be a function');return this.on(t,iD(this,t,n)),this},Ut.prototype.prependOnceListener=function(t,n){if(typeof n!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(t,iD(this,t,n)),this},Ut.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 jc:(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 jc,this;delete r[t]}else u4e(i,o);r.removeListener&&this.emit("removeListener",t,a||n)}return this},Ut.prototype.removeAllListeners=function(t){var n,i;if(i=this._events,!i)return this;if(!i.removeListener)return arguments.length===0?(this._events=new jc,this._eventsCount=0):i[t]&&(--this._eventsCount===0?this._events=new jc: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 jc,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},Ut.prototype.listeners=function(t){var n,i,r=this._events;return r?(n=r[t],n?typeof n=="function"?i=[n.listener||n]:i=h4e(n):i=[]):i=[],i},Ut.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):rD.call(e,t)},Ut.prototype.listenerCount=rD;function rD(e){var t=this._events;if(t){var n=t[e];if(typeof n=="function")return 1;if(n)return n.length}return 0}Ut.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function u4e(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 R0(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}function h4e(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function oD(){throw new Error("setTimeout has not been defined")}function sD(){throw new Error("clearTimeout has not been defined")}var Kc=oD,Jc=sD;typeof ad.setTimeout=="function"&&(Kc=setTimeout),typeof ad.clearTimeout=="function"&&(Jc=clearTimeout);function aD(e){if(Kc===setTimeout)return setTimeout(e,0);if((Kc===oD||!Kc)&&setTimeout)return Kc=setTimeout,setTimeout(e,0);try{return Kc(e,0)}catch{try{return Kc.call(null,e,0)}catch{return Kc.call(this,e,0)}}}function d4e(e){if(Jc===clearTimeout)return clearTimeout(e);if((Jc===sD||!Jc)&&clearTimeout)return Jc=clearTimeout,clearTimeout(e);try{return Jc(e)}catch{try{return Jc.call(null,e)}catch{return Jc.call(this,e)}}}var Ba=[],cd=!1,ru,u1=-1;function f4e(){!cd||!ru||(cd=!1,ru.length?Ba=ru.concat(Ba):u1=-1,Ba.length&&cD())}function cD(){if(!cd){var e=aD(f4e);cd=!0;for(var t=Ba.length;t;){for(ru=Ba,Ba=[];++u1<t;)ru&&ru[u1].run();u1=-1,t=Ba.length}ru=null,cd=!1,d4e(e)}}function zo(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];Ba.push(new lD(e,t)),Ba.length===1&&!cd&&aD(cD)}function lD(e,t){this.fun=e,this.array=t}lD.prototype.run=function(){this.fun.apply(null,this.array)};var p4e={},I0=ad.performance||{};I0.now||I0.mozNow||I0.msNow||I0.oNow||I0.webkitNow;var h1={env:p4e},zT;typeof Object.create=="function"?zT=function(t,n){t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:zT=function(t,n){t.super_=n;var i=function(){};i.prototype=n.prototype,t.prototype=new i,t.prototype.constructor=t};var ld=zT,m4e=/%[sdj%]/g;function g4e(e){if(!DT(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(m4e,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])ZT(s)||!M0(s)?o+=" "+s:o+=" "+Qc(s);return o}function uD(e,t){if(qc(ad.process))return function(){return uD(e,t).apply(this,arguments)};if(h1.noDeprecation===!0)return e;var n=!1;function i(){if(!n){if(h1.throwDeprecation)throw new Error(t);h1.traceDeprecation?console.trace(t):console.error(t),n=!0}return e.apply(this,arguments)}return i}var d1={},NT;function y4e(e){if(qc(NT)&&(NT=h1.env.NODE_DEBUG||""),e=e.toUpperCase(),!d1[e])if(new RegExp("\\b"+e+"\\b","i").test(NT)){var t=0;d1[e]=function(){var n=g4e.apply(null,arguments);console.error("%s %d: %s",e,t,n)}}else d1[e]=function(){};return d1[e]}function Qc(e,t){var n={seen:[],stylize:_4e};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),hD(t)?n.showHidden=t:t&&C4e(n,t),qc(n.showHidden)&&(n.showHidden=!1),qc(n.depth)&&(n.depth=2),qc(n.colors)&&(n.colors=!1),qc(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=b4e),f1(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 b4e(e,t){var n=Qc.styles[t];return n?"\x1B["+Qc.colors[n][0]+"m"+e+"\x1B["+Qc.colors[n][1]+"m":e}function _4e(e,t){return e}function v4e(e){var t={};return e.forEach(function(n,i){t[n]=!0}),t}function f1(e,t,n){if(e.customInspect&&t&&BT(t.inspect)&&t.inspect!==Qc&&!(t.constructor&&t.constructor.prototype===t)){var i=t.inspect(n,e);return DT(i)||(i=f1(e,i,n)),i}var r=w4e(e,t);if(r)return r;var o=Object.keys(t),s=v4e(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),WT(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return kT(t);if(o.length===0){if(BT(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(UT(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(dD(t))return e.stylize(Date.prototype.toString.call(t),"date");if(WT(t))return kT(t)}var c="",l=!1,u=["{","}"];if(E4e(t)&&(l=!0,u=["[","]"]),BT(t)){var h=t.name?": "+t.name:"";c=" [Function"+h+"]"}if(UT(t)&&(c=" "+RegExp.prototype.toString.call(t)),dD(t)&&(c=" "+Date.prototype.toUTCString.call(t)),WT(t)&&(c=" "+kT(t)),o.length===0&&(!l||t.length==0))return u[0]+c+u[1];if(n<0)return UT(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var d;return l?d=x4e(e,t,n,s,o):d=o.map(function(f){return XT(e,t,n,s,f,l)}),e.seen.pop(),S4e(d,c,u)}function w4e(e,t){if(qc(t))return e.stylize("undefined","undefined");if(DT(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(T4e(t))return e.stylize(""+t,"number");if(hD(t))return e.stylize(""+t,"boolean");if(ZT(t))return e.stylize("null","null")}function kT(e){return"["+Error.prototype.toString.call(e)+"]"}function x4e(e,t,n,i,r){for(var o=[],s=0,a=t.length;s<a;++s)fD(t,String(s))?o.push(XT(e,t,n,i,String(s),!0)):o.push("");return r.forEach(function(c){c.match(/^\d+$/)||o.push(XT(e,t,n,i,c,!0))}),o}function XT(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")),fD(i,r)||(s="["+r+"]"),a||(e.seen.indexOf(c.value)<0?(ZT(n)?a=f1(e,c.value,null):a=f1(e,c.value,n-1),a.indexOf(`
6731
+ `,uniforms:{...Br(u,["color","frustumLength","blackPoint","whitePoint","gamma"]),globeDepthTexture:()=>c?.()??d._depthTexture}});if(r){const f=$Le({prefix:e,outputType:s,useGlobeDepth:a,getGlobeDepthTexture:c,uniforms:{textureScale:t,...Br(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:dE([{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:dE([{stage:h,uniforms:["intensity","maxRadius","bias","frustumLength","focalLength"]},{stage:d,uniforms:["color","blackPoint","whitePoint","gamma"]}])})}const aPe=({enabled:e=!0,textureScale:t,directions:n,steps:i,denoise:r,accurateNormalReconstruction:o,outputType:s,useGlobeDepth:a,...c})=>{const{viewer:l}=qn(),u=l?.scene,h=dF({owner:u?.postProcessStages,keys:[t,i,n,r,o,s,a],create:()=>{const d=sPe({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(),Ol(()=>{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},cPe=e=>{const t=qn(),[n,i]=R.useState(!1);return Ol(()=>{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))}),le.jsx(aPe,{...e,useGlobeDepth:n})};var xN=(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))(xN||{});const lPe={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}},uPe="#00bebe",u0="#3B3CD0",hPe="#FF9900",dPe="#3B3CD0";let Kl,fPe,pPe,Jl;const h0=({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=ko(()=>new go((f,p)=>"getValue"in c.current?c.current.getValue(f,p):c.current,!1)),u=R.useMemo(()=>({position:l,billboard:{image:i?o?bPe():r?yPe():gPe():mPe(),width:i?16:8,height:i?16:8,heightReference:t?_l.CLAMP_TO_GROUND:_l.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 le.jsx(lc,{...u,onMouseDown:h,onClick:d})};function mPe(){if(Kl!=null)return Kl;Kl=document.createElement("canvas"),Kl.width=16,Kl.height=16;const e=Kl.getContext("2d");return On(e!=null),e.fillStyle="white",e.fillRect(3,3,10,10),e.strokeStyle="black",e.lineWidth=2,e.strokeRect(3,3,10,10),Kl}function gPe(){return SN(fPe,{size:32,color:"white",strokeColor:u0})}function yPe(){return SN(pPe,{size:32,color:"white",strokeColor:hPe})}function bPe(){if(Jl!=null)return Jl;Jl=document.createElement("canvas"),Jl.width=32,Jl.height=32;const e=Jl.getContext("2d");return On(e!=null),e.beginPath(),e.arc(16,16,12,0,2*Math.PI),e.fillStyle="white",e.fill(),e.strokeStyle=dPe,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(),Jl}function SN(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 On(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 _Pe(e,t){if(typeof e=="function")return e(t),()=>{e(null)};if(e!=null)return e.current=t,()=>{e.current=null}}const d0=R.memo(R.forwardRef(({entities:e,...t},n)=>{const{viewer:i}=qn(),r=i?.scene,o=i?.entities,s=e??o,[a,c]=R.useState(()=>new Qr(t));return R.useEffect(()=>{c(new Qr(t))},[t.id]),R.useEffect(()=>(s?.add(a),()=>{s?.remove(a),r?.requestRender()}),[r,s,a]),R.useEffect(()=>_Pe(n,a),[n,a]),Object.assign(a,ja(t,"id")),r?.requestRender(),null})),vPe={padding:"5px",color:"#fff",backgroundColor:"#000",borderRadius:"5px",lineHeight:1},EN=({children:e})=>le.jsx("div",{style:vPe,children:e}),TN=R.createContext({});function CN(e){const t=R.useRef(null);return t.current===null&&(t.current=e()),t.current}const wPe=typeof window<"u"?R.useLayoutEffect:R.useEffect,fE=R.createContext(null);function pE(e,t){e.indexOf(t)===-1&&e.push(t)}function zb(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const ta=(e,t,n)=>n>t?t:n<e?e:n;function mE(e,t){return t?`${e}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${t}`:e}let Kh=()=>{},Da=()=>{};typeof process<"u"&&process.env?.NODE_ENV!=="production"&&(Kh=(e,t,n)=>{!e&&typeof console<"u"&&console.warn(mE(t,n))},Da=(e,t,n)=>{if(!e)throw new Error(mE(t,n))});const Ua={},RN=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);function IN(e){return typeof e=="object"&&e!==null}const MN=e=>/^0[^.\s]+$/u.test(e);function LN(e){let t;return()=>(t===void 0&&(t=e()),t)}const Go=e=>e,xPe=(e,t)=>n=>t(e(n)),f0=(...e)=>e.reduce(xPe),p0=(e,t,n)=>{const i=t-e;return i===0?1:(n-e)/i};class gE{constructor(){this.subscriptions=[]}add(t){return pE(this.subscriptions,t),()=>zb(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 Vo=e=>e*1e3,Fo=e=>e/1e3;function PN(e,t){return t?e*(1e3/t):0}const ON=new Set;function yE(e,t,n){e||ON.has(t)||(console.warn(mE(t,n)),ON.add(t))}const GN=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,SPe=1e-7,EPe=12;function TPe(e,t,n,i,r){let o,s,a=0;do s=t+(n-t)/2,o=GN(s,i,r)-e,o>0?n=s:t=s;while(Math.abs(o)>SPe&&++a<EPe);return s}function m0(e,t,n,i){if(e===t&&n===i)return Go;const r=o=>TPe(o,0,1,e,n);return o=>o===0||o===1?o:GN(r(o),t,i)}const VN=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,FN=e=>t=>1-e(1-t),AN=m0(.33,1.53,.69,.99),bE=FN(AN),zN=VN(bE),NN=e=>(e*=2)<1?.5*bE(e):.5*(2-Math.pow(2,-10*(e-1))),_E=e=>1-Math.sin(Math.acos(e)),kN=FN(_E),XN=VN(_E),CPe=m0(.42,0,1,1),RPe=m0(0,0,.58,1),ZN=m0(.42,0,.58,1),IPe=e=>Array.isArray(e)&&typeof e[0]!="number",DN=e=>Array.isArray(e)&&typeof e[0]=="number",UN={linear:Go,easeIn:CPe,easeInOut:ZN,easeOut:RPe,circIn:_E,circInOut:XN,circOut:kN,backIn:bE,backInOut:zN,backOut:AN,anticipate:NN},MPe=e=>typeof e=="string",WN=e=>{if(DN(e)){Da(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[t,n,i,r]=e;return m0(t,n,i,r)}else if(MPe(e))return Da(UN[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),UN[e];return e},Nb=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function LPe(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 PPe=40;function BN(e,t){let n=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,s=Nb.reduce((S,T)=>(S[T]=LPe(o),S),{}),{setup:a,read:c,resolveKeyframes:l,preUpdate:u,update:h,preRender:d,render:f,postRender:p}=s,m=()=>{const S=Ua.useManualTiming?r.timestamp:performance.now();n=!1,Ua.useManualTiming||(r.delta=i?1e3/60:Math.max(Math.min(S-r.timestamp,PPe),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:Nb.reduce((S,T)=>{const I=s[T];return S[T]=(O,G=!1,A=!1)=>(n||y(),I.schedule(O,G,A)),S},{}),cancel:S=>{for(let T=0;T<Nb.length;T++)s[Nb[T]].cancel(S)},state:r,steps:s}}const{schedule:Sn,cancel:Wc,state:Ni,steps:vE}=BN(typeof requestAnimationFrame<"u"?requestAnimationFrame:Go,!0);let kb;function OPe(){kb=void 0}const gr={now:()=>(kb===void 0&&gr.set(Ni.isProcessing||Ua.useManualTiming?Ni.timestamp:performance.now()),kb),set:e=>{kb=e,queueMicrotask(OPe)}},YN=e=>t=>typeof t=="string"&&t.startsWith(e),HN=YN("--"),GPe=YN("var(--"),wE=e=>GPe(e)?VPe.test(e.split("/*")[0].trim()):!1,VPe=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function jN(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Jh={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},g0={...Jh,transform:e=>ta(0,1,e)},Xb={...Jh,default:1},y0=e=>Math.round(e*1e5)/1e5,xE=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function FPe(e){return e==null}const APe=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,SE=(e,t)=>n=>!!(typeof n=="string"&&APe.test(n)&&n.startsWith(e)||t&&!FPe(n)&&Object.prototype.hasOwnProperty.call(n,t)),KN=(e,t,n)=>i=>{if(typeof i!="string")return i;const[r,o,s,a]=i.match(xE);return{[e]:parseFloat(r),[t]:parseFloat(o),[n]:parseFloat(s),alpha:a!==void 0?parseFloat(a):1}},zPe=e=>ta(0,255,e),EE={...Jh,transform:e=>Math.round(zPe(e))},Ql={test:SE("rgb","red"),parse:KN("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:i=1})=>"rgba("+EE.transform(e)+", "+EE.transform(t)+", "+EE.transform(n)+", "+y0(g0.transform(i))+")"};function NPe(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 TE={test:SE("#"),parse:NPe,transform:Ql.transform},b0=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Bc=b0("deg"),na=b0("%"),ct=b0("px"),kPe=b0("vh"),XPe=b0("vw"),JN={...na,parse:e=>na.parse(e)/100,transform:e=>na.transform(e*100)},Qh={test:SE("hsl","hue"),parse:KN("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:i=1})=>"hsla("+Math.round(e)+", "+na.transform(y0(t))+", "+na.transform(y0(n))+", "+y0(g0.transform(i))+")"},ai={test:e=>Ql.test(e)||TE.test(e)||Qh.test(e),parse:e=>Ql.test(e)?Ql.parse(e):Qh.test(e)?Qh.parse(e):TE.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ql.transform(e):Qh.transform(e),getAnimatableNone:e=>{const t=ai.parse(e);return t.alpha=0,ai.transform(t)}},ZPe=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function DPe(e){return isNaN(e)&&typeof e=="string"&&(e.match(xE)?.length||0)+(e.match(ZPe)?.length||0)>0}const QN="number",qN="color",UPe="var",WPe="var(",$N="${}",BPe=/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 _0(e){const t=e.toString(),n=[],i={color:[],number:[],var:[]},r=[];let o=0;const a=t.replace(BPe,c=>(ai.test(c)?(i.color.push(o),r.push(qN),n.push(ai.parse(c))):c.startsWith(WPe)?(i.var.push(o),r.push(UPe),n.push(c)):(i.number.push(o),r.push(QN),n.push(parseFloat(c))),++o,$N)).split($N);return{values:n,split:a,indexes:i,types:r}}function ek(e){return _0(e).values}function tk(e){const{split:t,types:n}=_0(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===QN?o+=y0(r[s]):a===qN?o+=ai.transform(r[s]):o+=r[s]}return o}}const YPe=e=>typeof e=="number"?0:ai.test(e)?ai.getAnimatableNone(e):e;function HPe(e){const t=ek(e);return tk(e)(t.map(YPe))}const ds={test:DPe,parse:ek,createTransformer:tk,getAnimatableNone:HPe};function CE(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 jPe({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=CE(c,a,e+1/3),o=CE(c,a,e),s=CE(c,a,e-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(s*255),alpha:i}}function Zb(e,t){return n=>n>0?t:e}const kn=(e,t,n)=>e+(t-e)*n,RE=(e,t,n)=>{const i=e*e,r=n*(t*t-i)+i;return r<0?0:Math.sqrt(r)},KPe=[TE,Ql,Qh],JPe=e=>KPe.find(t=>t.test(e));function nk(e){const t=JPe(e);if(Kh(!!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=jPe(n)),n}const ik=(e,t)=>{const n=nk(e),i=nk(t);if(!n||!i)return Zb(e,t);const r={...n};return o=>(r.red=RE(n.red,i.red,o),r.green=RE(n.green,i.green,o),r.blue=RE(n.blue,i.blue,o),r.alpha=kn(n.alpha,i.alpha,o),Ql.transform(r))},IE=new Set(["none","hidden"]);function QPe(e,t){return IE.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function qPe(e,t){return n=>kn(e,t,n)}function ME(e){return typeof e=="number"?qPe:typeof e=="string"?wE(e)?Zb:ai.test(e)?ik:tOe:Array.isArray(e)?rk:typeof e=="object"?ai.test(e)?ik:$Pe:Zb}function rk(e,t){const n=[...e],i=n.length,r=e.map((o,s)=>ME(o)(o,t[s]));return o=>{for(let s=0;s<i;s++)n[s]=r[s](o);return n}}function $Pe(e,t){const n={...e,...t},i={};for(const r in n)e[r]!==void 0&&t[r]!==void 0&&(i[r]=ME(e[r])(e[r],t[r]));return r=>{for(const o in i)n[o]=i[o](r);return n}}function eOe(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 tOe=(e,t)=>{const n=ds.createTransformer(t),i=_0(e),r=_0(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?IE.has(e)&&!r.values.length||IE.has(t)&&!i.values.length?QPe(e,t):f0(rk(eOe(i,r),r.values),n):(Kh(!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"),Zb(e,t))};function ok(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?kn(e,t,n):ME(e)(e,t)}const nOe=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Sn.update(t,n),stop:()=>Wc(t),now:()=>Ni.isProcessing?Ni.timestamp:gr.now()}},sk=(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)})`},Db=2e4;function LE(e){let t=0;const n=50;let i=e.next(t);for(;!i.done&&t<Db;)t+=n,i=e.next(t);return t>=Db?1/0:t}function iOe(e,t=100,n){const i=n({...e,keyframes:[0,t]}),r=Math.min(LE(i),Db);return{type:"keyframes",ease:o=>i.next(r*o).value/t,duration:Fo(r)}}const rOe=5;function ak(e,t,n){const i=Math.max(t-rOe,0);return PN(n-e(i),t-i)}const Xn={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},PE=.001;function oOe({duration:e=Xn.duration,bounce:t=Xn.bounce,velocity:n=Xn.velocity,mass:i=Xn.mass}){let r,o;Kh(e<=Vo(Xn.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let s=1-t;s=ta(Xn.minDamping,Xn.maxDamping,s),e=ta(Xn.minDuration,Xn.maxDuration,Fo(e)),s<1?(r=l=>{const u=l*s,h=u*e,d=u-n,f=OE(l,s),p=Math.exp(-h);return PE-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=OE(Math.pow(l,2),s);return(-r(l)+PE>0?-1:1)*((d-f)*p)/m}):(r=l=>{const u=Math.exp(-l*e),h=(l-n)*e+1;return-PE+u*h},o=l=>{const u=Math.exp(-l*e),h=(n-l)*(e*e);return u*h});const a=5/e,c=aOe(r,o,a);if(e=Vo(e),isNaN(c))return{stiffness:Xn.stiffness,damping:Xn.damping,duration:e};{const l=Math.pow(c,2)*i;return{stiffness:l,damping:s*2*Math.sqrt(i*l),duration:e}}}const sOe=12;function aOe(e,t,n){let i=n;for(let r=1;r<sOe;r++)i=i-e(i)/t(i);return i}function OE(e,t){return e*Math.sqrt(1-t*t)}const cOe=["duration","bounce"],lOe=["stiffness","damping","mass"];function ck(e,t){return t.some(n=>e[n]!==void 0)}function uOe(e){let t={velocity:Xn.velocity,stiffness:Xn.stiffness,damping:Xn.damping,mass:Xn.mass,isResolvedFromDuration:!1,...e};if(!ck(e,lOe)&&ck(e,cOe))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,i=2*Math.PI/(n*1.2),r=i*i,o=2*ta(.05,1,1-(e.bounce||0))*Math.sqrt(r);t={...t,mass:Xn.mass,stiffness:r,damping:o}}else{const n=oOe({...e,velocity:0});t={...t,...n,mass:Xn.mass},t.isResolvedFromDuration=!0}return t}function Ub(e=Xn.visualDuration,t=Xn.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}=uOe({...n,velocity:-Fo(n.velocity||0)}),p=d||0,m=l/(2*Math.sqrt(c*u)),y=s-o,g=Fo(Math.sqrt(c/u)),v=Math.abs(y)<5;i||(i=v?Xn.restSpeed.granular:Xn.restSpeed.default),r||(r=v?Xn.restDelta.granular:Xn.restDelta.default);let S;if(m<1){const I=OE(g,m);S=O=>{const G=Math.exp(-m*g*O);return s-G*((p+m*g*y)/I*Math.sin(I*O)+y*Math.cos(I*O))}}else if(m===1)S=I=>s-Math.exp(-g*I)*(y+(p+g*y)*I);else{const I=g*Math.sqrt(m*m-1);S=O=>{const G=Math.exp(-m*g*O),A=Math.min(I*O,300);return s-G*((p+m*g*y)*Math.sinh(A)+I*y*Math.cosh(A))/I}}const T={calculatedDuration:f&&h||null,next:I=>{const O=S(I);if(f)a.done=I>=h;else{let G=I===0?p:0;m<1&&(G=I===0?Vo(p):ak(S,I,O));const A=Math.abs(G)<=i,V=Math.abs(s-O)<=r;a.done=A&&V}return a.value=a.done?s:O,a},toString:()=>{const I=Math.min(LE(T),Db),O=sk(G=>T.next(I*G).value,I,30);return I+"ms "+O},toTransition:()=>{}};return T}Ub.applyToOptions=e=>{const t=iOe(e,100,Ub);return e.ease=t.ease,e.duration=Vo(t.duration),e.type="keyframes",e};function GE({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),T=A=>{const V=v(A),N=S(A);d.done=Math.abs(V)<=l,d.value=d.done?g:N};let I,O;const G=A=>{f(d.value)&&(I=A,O=Ub({keyframes:[d.value,p(d.value)],velocity:ak(S,A,d.value),damping:r,stiffness:o,restDelta:l,restSpeed:u}))};return G(0),{calculatedDuration:null,next:A=>{let V=!1;return!O&&I===void 0&&(V=!0,T(A),G(A)),I!==void 0&&A>=I?O.next(A-I):(!V&&T(A),d)}}}function hOe(e,t,n){const i=[],r=n||Ua.mix||ok,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]||Go:t;a=f0(c,a)}i.push(a)}return i}function dOe(e,t,{clamp:n=!0,ease:i,mixer:r}={}){const o=e.length;if(Da(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=hOe(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=p0(e[h],e[h+1],u);return a[h](d)};return n?u=>l(ta(e[0],e[o-1],u)):l}function fOe(e,t){const n=e[e.length-1];for(let i=1;i<=t;i++){const r=p0(0,t,i);e.push(kn(n,1,r))}}function pOe(e){const t=[0];return fOe(t,e.length-1),t}function mOe(e,t){return e.map(n=>n*t)}function gOe(e,t){return e.map(()=>t||ZN).splice(0,e.length-1)}function qh({duration:e=300,keyframes:t,times:n,ease:i="easeInOut"}){const r=IPe(i)?i.map(WN):WN(i),o={done:!1,value:t[0]},s=mOe(n&&n.length===t.length?n:pOe(t),e),a=dOe(s,t,{ease:Array.isArray(r)?r:gOe(t,r)});return{calculatedDuration:e,next:c=>(o.value=a(c),o.done=c>=e,o)}}const yOe=e=>e!==null;function VE(e,{repeat:t,repeatType:n="loop"},i,r=1){const o=e.filter(yOe),a=r<0||t&&n!=="loop"&&t%2===1?0:o.length-1;return!a||i===void 0?o[a]:i}const bOe={decay:GE,inertia:GE,tween:qh,keyframes:qh,spring:Ub};function lk(e){typeof e.type=="string"&&(e.type=bOe[e.type])}class FE{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 _Oe=e=>e/100;class AE extends FE{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!==gr.now()&&this.tick(gr.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;lk(t);const{type:n=qh,repeat:i=0,repeatDelay:r=0,repeatType:o,velocity:s=0}=t;let{keyframes:a}=t;const c=n||qh;process.env.NODE_ENV!=="production"&&c!==qh&&Da(a.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${a}`,"spring-two-frames"),c!==qh&&typeof a[0]!="number"&&(this.mixKeyframes=f0(_Oe,ok(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=LE(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,T=i;if(h){const A=Math.min(this.currentTime,r)/a;let V=Math.floor(A),N=A%1;!N&&A>=1&&(N=1),N===1&&V--,V=Math.min(V,h+1),V%2&&(d==="reverse"?(N=1-N,f&&(N-=f/a)):d==="mirror"&&(T=s)),S=ta(0,1,N)*a}const I=v?{done:!1,value:u[0]}:T.next(S);o&&!v&&(I.value=o(I.value));let{done:O}=I;!v&&c!==null&&(O=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);const G=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&O);return G&&p!==GE&&(I.value=VE(u,this.options,y,this.speed)),m&&m(I.value),G&&this.finish(),I}then(t,n){return this.finished.then(t,n)}get duration(){return Fo(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fo(t)}get time(){return Fo(this.currentTime)}set time(t){t=Vo(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(gr.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=Fo(this.currentTime))}play(){if(this.isStopped)return;const{driver:t=nOe,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(gr.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 vOe(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}const ql=e=>e*180/Math.PI,zE=e=>{const t=ql(Math.atan2(e[1],e[0]));return NE(t)},wOe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:zE,rotateZ:zE,skewX:e=>ql(Math.atan(e[1])),skewY:e=>ql(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},NE=e=>(e=e%360,e<0&&(e+=360),e),uk=zE,hk=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),dk=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),xOe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:hk,scaleY:dk,scale:e=>(hk(e)+dk(e))/2,rotateX:e=>NE(ql(Math.atan2(e[6],e[5]))),rotateY:e=>NE(ql(Math.atan2(-e[2],e[0]))),rotateZ:uk,rotate:uk,skewX:e=>ql(Math.atan(e[4])),skewY:e=>ql(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function kE(e){return e.includes("scale")?1:0}function XE(e,t){if(!e||e==="none")return kE(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,r;if(n)i=xOe,r=n;else{const a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=wOe,r=a}if(!r)return kE(t);const o=i[t],s=r[1].split(",").map(EOe);return typeof o=="function"?o(s):s[o]}const SOe=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return XE(n,t)};function EOe(e){return parseFloat(e.trim())}const $h=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ed=new Set($h),fk=e=>e===Jh||e===ct,TOe=new Set(["x","y","z"]),COe=$h.filter(e=>!TOe.has(e));function ROe(e){const t=[];return COe.forEach(n=>{const i=e.getValue(n);i!==void 0&&(t.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),t}const Yc={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})=>XE(t,"x"),y:(e,{transform:t})=>XE(t,"y")};Yc.translateX=Yc.x,Yc.translateY=Yc.y;const $l=new Set;let ZE=!1,DE=!1,UE=!1;function pk(){if(DE){const e=Array.from($l).filter(i=>i.needsMeasurement),t=new Set(e.map(i=>i.element)),n=new Map;t.forEach(i=>{const r=ROe(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)})}DE=!1,ZE=!1,$l.forEach(e=>e.complete(UE)),$l.clear()}function mk(){$l.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(DE=!0)})}function IOe(){UE=!0,mk(),pk(),UE=!1}class WE{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?($l.add(this),ZE||(ZE=!0,Sn.read(mk),Sn.resolveKeyframes(pk))):(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])}vOe(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),$l.delete(this)}cancel(){this.state==="scheduled"&&($l.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const MOe=e=>e.startsWith("--");function gk(e,t,n){MOe(t)?e.style.setProperty(t,n):e.style[t]=n}const LOe={};function yk(e,t){const n=LN(e);return()=>LOe[t]??n()}const POe=yk(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),bk=yk(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),v0=([e,t,n,i])=>`cubic-bezier(${e}, ${t}, ${n}, ${i})`,_k={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:v0([0,.65,.55,1]),circOut:v0([.55,0,1,.45]),backIn:v0([.31,.01,.66,-.59]),backOut:v0([.33,1.53,.69,.99])};function vk(e,t){if(e)return typeof e=="function"?bk()?sk(e,t):"ease-out":DN(e)?v0(e):Array.isArray(e)?e.map(n=>vk(n,t)||_k.easeOut):_k[e]}function OOe(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=vk(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 wk(e){return typeof e=="function"&&"applyToOptions"in e}function GOe({type:e,...t}){return wk(e)&&bk()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class xk extends FE{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,Da(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const l=GOe(t);this.animation=OOe(n,i,r,l,o),l.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!o){const u=VE(r,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(u),gk(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 Fo(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+Fo(t)}get time(){return Fo(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Vo(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&&POe()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),i&&(this.animation.rangeEnd=i),Go):r(this)}}const Sk={anticipate:NN,backInOut:zN,circInOut:XN};function VOe(e){return e in Sk}function FOe(e){typeof e.ease=="string"&&VOe(e.ease)&&(e.ease=Sk[e.ease])}const BE=10;class AOe extends xk{constructor(t){FOe(t),lk(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 AE({...s,autoplay:!1}),c=Math.max(BE,gr.now()-this.startTime),l=ta(0,BE,c-BE),u=a.sample(c).value,{name:h}=this.options;o&&h&&gk(o,h,u),n.setWithVelocity(a.sample(Math.max(0,c-l)).value,u,l),a.stop()}}const Ek=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ds.test(e)||e==="0")&&!e.startsWith("url("));function zOe(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 NOe(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=Ek(r,t),a=Ek(o,t);return Kh(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:zOe(e)||(n==="spring"||wk(n))&&i}function YE(e){e.duration=0,e.type="keyframes"}const kOe=new Set(["opacity","clipPath","filter","transform"]),XOe=LN(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ZOe(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 XOe()&&n&&kOe.has(n)&&(n!=="transform"||!l)&&!c&&!i&&r!=="mirror"&&o!==0&&s!=="inertia"}const DOe=40;class UOe extends FE{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=gr.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||WE;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=gr.now(),NOe(t,o,s,a)||((Ua.instantAnimations||!c)&&u?.(VE(t,i,n)),t[0]=t[t.length-1],YE(i),i.repeat=0);const d={startTime:r?this.resolvedAt?this.resolvedAt-this.createdAt>DOe?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:t},f=!l&&ZOe(d),p=d.motionValue?.owner?.current,m=f?new AOe({...d,element:p}):new AE(d);m.finished.then(()=>{this.notifyFinished()}).catch(Go),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(),IOe()),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 Tk(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 WOe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function BOe(e){const t=WOe.exec(e);if(!t)return[,];const[,n,i,r]=t;return[`--${n??i}`,r]}const YOe=4;function Ck(e,t,n=1){Da(n<=YOe,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[i,r]=BOe(e);if(!i)return;const o=window.getComputedStyle(t).getPropertyValue(i);if(o){const s=o.trim();return RN(s)?parseFloat(s):s}return wE(r)?Ck(r,t,n+1):r}const HOe={type:"spring",stiffness:500,damping:25,restSpeed:10},jOe=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),KOe={type:"keyframes",duration:.8},JOe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},QOe=(e,{keyframes:t})=>t.length>2?KOe:ed.has(e)?e.startsWith("scale")?jOe(t[1]):HOe:JOe,qOe=e=>e!==null;function $Oe(e,{repeat:t,repeatType:n="loop"},i){const r=e.filter(qOe),o=t&&n!=="loop"&&t%2===1?0:r.length-1;return r[o]}function Rk(e,t){if(e?.inherit&&t){const{inherit:n,...i}=e;return{...t,...i}}return e}function HE(e,t){const n=e?.[t]??e?.default??e;return n!==e?Rk(n,e):n}function eGe({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 jE=(e,t,n,i={},r,o)=>s=>{const a=HE(i,e)||{},c=a.delay||i.delay||0;let{elapsed:l=0}=i;l=l-Vo(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};eGe(a)||Object.assign(u,QOe(e,u)),u.duration&&(u.duration=Vo(u.duration)),u.repeatDelay&&(u.repeatDelay=Vo(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(YE(u),u.delay===0&&(h=!0)),(Ua.instantAnimations||Ua.skipAnimations||r?.shouldSkipAnimations)&&(h=!0,YE(u),u.delay=0),u.allowFlatten=!a.type&&!a.ease,h&&!o&&t.get()!==void 0){const d=$Oe(u.keyframes,a);if(d!==void 0){Sn.update(()=>{u.onUpdate(d),u.onComplete()});return}}return a.isSync?new AE(u):new UOe(u)};function Ik(e){const t=[{},{}];return e?.values.forEach((n,i)=>{t[0][i]=n.get(),t[1][i]=n.getVelocity()}),t}function KE(e,t,n,i){if(typeof t=="function"){const[r,o]=Ik(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]=Ik(i);t=t(n!==void 0?n:e.custom,r,o)}return t}function td(e,t,n){const i=e.getProps();return KE(i,t,n!==void 0?n:i.custom,e)}const Mk=new Set(["width","height","top","left","right","bottom",...$h]),Lk=30,tGe=e=>!isNaN(parseFloat(e));class nGe{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const r=gr.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=gr.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=tGe(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return process.env.NODE_ENV!=="production"&&yE(!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 gE);const i=this.events[t].add(n);return t==="change"?()=>{i(),Sn.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=gr.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Lk)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Lk);return PN(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 eu(e,t){return new nGe(e,t)}const JE=e=>Array.isArray(e);function iGe(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,eu(n))}function rGe(e){return JE(e)?e[e.length-1]||0:e}function oGe(e,t){const n=td(e,t);let{transitionEnd:i={},transition:r={},...o}=n||{};o={...o,...i};for(const s in o){const a=rGe(o[s]);iGe(e,s,a)}}const tr=e=>!!(e&&e.getVelocity);function sGe(e){return!!(tr(e)&&e.add)}function QE(e,t){const n=e.getValue("willChange");if(sGe(n))return n.add(t);if(!n&&Ua.WillChange){const i=new Ua.WillChange("auto");e.addValue("willChange",i),i.add(t)}}function qE(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const Pk="data-"+qE("framerAppearId");function Ok(e){return e.props[Pk]}function aGe({protectedKeys:e,needsAnimating:t},n){const i=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,i}function Gk(e,t,{delay:n=0,transitionOverride:i,type:r}={}){let{transition:o,transitionEnd:s,...a}=t;const c=e.getDefaultTransition();o=o?Rk(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&&aGe(h,d))continue;const m={delay:n,...HE(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 T=Ok(e);if(T){const I=window.MotionHandoffAnimation(T,d,Sn);I!==null&&(m.startTime=I,g=!0)}}QE(e,d);const v=l??e.shouldReduceMotion;f.start(jE(d,f,p,v&&Mk.has(d)?{type:!1}:m,e,g));const S=f.animation;S&&u.push(S)}if(s){const d=()=>Sn.update(()=>{s&&oGe(e,s)});u.length?Promise.all(u).then(d):d()}return u}function $E(e,t,n={}){const i=td(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(Gk(e,i,n)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:l=0,staggerChildren:u,staggerDirection:h}=r;return cGe(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 cGe(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($E(c,t,{...s,delay:n+(typeof i=="function"?0:i)+Tk(e.variantChildren,c,i,r,o)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function lGe(e,t,n={}){e.notify("AnimationStart",t);let i;if(Array.isArray(t)){const r=t.map(o=>$E(e,o,n));i=Promise.all(r)}else if(typeof t=="string")i=$E(e,t,n);else{const r=typeof t=="function"?td(e,t,n.custom):t;i=Promise.all(Gk(e,r,n))}return i.then(()=>{e.notify("AnimationComplete",t)})}const uGe={test:e=>e==="auto",parse:e=>e},Vk=e=>t=>t.test(e),Fk=[Jh,ct,na,Bc,XPe,kPe,uGe],Ak=e=>Fk.find(Vk(e));function hGe(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||MN(e):!0}const dGe=new Set(["brightness","contrast","saturate","opacity"]);function fGe(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[i]=n.match(xE)||[];if(!i)return e;const r=n.replace(i,"");let o=dGe.has(t)?1:0;return i!==n&&(o*=100),t+"("+o+r+")"}const pGe=/\b([a-z-]*)\(.*?\)/gu,eT={...ds,getAnimatableNone:e=>{const t=e.match(pGe);return t?t.map(fGe).join(" "):e}},tT={...ds,getAnimatableNone:e=>{const t=ds.parse(e);return ds.createTransformer(e)(t.map(i=>typeof i=="number"?0:typeof i=="object"?{...i,alpha:1}:i))}},zk={...Jh,transform:Math.round},nT={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:Bc,rotateX:Bc,rotateY:Bc,rotateZ:Bc,scale:Xb,scaleX:Xb,scaleY:Xb,scaleZ:Xb,skew:Bc,skewX:Bc,skewY:Bc,distance:ct,translateX:ct,translateY:ct,translateZ:ct,x:ct,y:ct,z:ct,perspective:ct,transformPerspective:ct,opacity:g0,originX:JN,originY:JN,originZ:ct},zIndex:zk,fillOpacity:g0,strokeOpacity:g0,numOctaves:zk},mGe={...nT,color:ai,backgroundColor:ai,outlineColor:ai,fill:ai,stroke:ai,borderColor:ai,borderTopColor:ai,borderRightColor:ai,borderBottomColor:ai,borderLeftColor:ai,filter:eT,WebkitFilter:eT,mask:tT,WebkitMask:tT},Nk=e=>mGe[e],gGe=new Set([eT,tT]);function kk(e,t){let n=Nk(e);return gGe.has(n)||(n=ds),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const yGe=new Set(["auto","none","0"]);function bGe(e,t,n){let i=0,r;for(;i<e.length&&!r;){const o=e[i];typeof o=="string"&&!yGe.has(o)&&_0(o).values.length&&(r=e[i]),i++}if(r&&n)for(const o of t)e[o]=kk(n,r)}class _Ge extends WE{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(),wE(h))){const d=Ck(h,n.current);d!==void 0&&(t[u]=d),u===t.length-1&&(this.finalKeyframe=h)}}if(this.resolveNoneKeyframes(),!Mk.has(i)||t.length!==2)return;const[r,o]=t,s=Ak(r),a=Ak(o),c=jN(r),l=jN(o);if(c!==l&&Yc[i]){this.needsMeasurement=!0;return}if(s!==a)if(fk(s)&&fk(a))for(let u=0;u<t.length;u++){const h=t[u];typeof h=="string"&&(t[u]=parseFloat(h))}else Yc[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,i=[];for(let r=0;r<t.length;r++)(t[r]===null||hGe(t[r]))&&i.push(r);i.length&&bGe(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=Yc[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]=Yc[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 vGe=new Set(["opacity","clipPath","filter","transform"]);function Xk(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 Zk=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function wGe(e){return IN(e)&&"offsetHeight"in e}const{schedule:iT}=BN(queueMicrotask,!1),fs={x:!1,y:!1};function Dk(){return fs.x||fs.y}function xGe(e){return e==="x"||e==="y"?fs[e]?null:(fs[e]=!0,()=>{fs[e]=!1}):fs.x||fs.y?null:(fs.x=fs.y=!0,()=>{fs.x=fs.y=!1})}function Uk(e,t){const n=Xk(e),i=new AbortController,r={passive:!0,...t,signal:i.signal};return[n,r,()=>i.abort()]}function SGe(e){return!(e.pointerType==="touch"||Dk())}function EGe(e,t,n={}){const[i,r,o]=Uk(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(!SGe(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 Wk=(e,t)=>t?e===t?!0:Wk(e,t.parentElement):!1,rT=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,TGe=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function CGe(e){return TGe.has(e.tagName)||e.isContentEditable===!0}const RGe=new Set(["INPUT","SELECT","TEXTAREA"]);function IGe(e){return RGe.has(e.tagName)||e.isContentEditable===!0}const Wb=new WeakSet;function Bk(e){return t=>{t.key==="Enter"&&e(t)}}function oT(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const MGe=(e,t)=>{const n=e.currentTarget;if(!n)return;const i=Bk(()=>{if(Wb.has(n))return;oT(n,"down");const r=Bk(()=>{oT(n,"up")}),o=()=>oT(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 Yk(e){return rT(e)&&!Dk()}const Hk=new WeakSet;function LGe(e,t,n={}){const[i,r,o]=Uk(e,n),s=a=>{const c=a.currentTarget;if(!Yk(a)||Hk.has(a))return;Wb.add(c),n.stopPropagation&&Hk.add(a);const l=t(c,a),u=(f,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",d),Wb.has(c)&&Wb.delete(c),Yk(f)&&typeof l=="function"&&l(f,{success:p})},h=f=>{u(f,c===window||c===document||n.useGlobalTarget||Wk(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),wGe(a)&&(a.addEventListener("focus",l=>MGe(l,r)),!CGe(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),o}function sT(e){return IN(e)&&"ownerSVGElement"in e}const Bb=new WeakMap;let Yb;const jk=(e,t,n)=>(i,r)=>r&&r[0]?r[0][e+"Size"]:sT(i)&&"getBBox"in i?i.getBBox()[t]:i[n],PGe=jk("inline","width","offsetWidth"),OGe=jk("block","height","offsetHeight");function GGe({target:e,borderBoxSize:t}){Bb.get(e)?.forEach(n=>{n(e,{get width(){return PGe(e,t)},get height(){return OGe(e,t)}})})}function VGe(e){e.forEach(GGe)}function FGe(){typeof ResizeObserver>"u"||(Yb=new ResizeObserver(VGe))}function AGe(e,t){Yb||FGe();const n=Xk(e);return n.forEach(i=>{let r=Bb.get(i);r||(r=new Set,Bb.set(i,r)),r.add(t),Yb?.observe(i)}),()=>{n.forEach(i=>{const r=Bb.get(i);r?.delete(t),r?.size||Yb?.unobserve(i)})}}const Hb=new Set;let nd;function zGe(){nd=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Hb.forEach(t=>t(e))},window.addEventListener("resize",nd)}function NGe(e){return Hb.add(e),nd||zGe(),()=>{Hb.delete(e),!Hb.size&&typeof nd=="function"&&(window.removeEventListener("resize",nd),nd=void 0)}}function Kk(e,t){return typeof e=="function"?NGe(e):AGe(e,t)}function kGe(e){return sT(e)&&e.tagName==="svg"}const XGe=[...Fk,ai,ds],ZGe=e=>XGe.find(Vk(e)),Jk=()=>({translate:0,scale:1,origin:0,originPoint:0}),id=()=>({x:Jk(),y:Jk()}),Qk=()=>({min:0,max:0}),yi=()=>({x:Qk(),y:Qk()}),DGe=new WeakMap;function jb(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function w0(e){return typeof e=="string"||Array.isArray(e)}const aT=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cT=["initial",...aT];function Kb(e){return jb(e.animate)||cT.some(t=>w0(e[t]))}function qk(e){return!!(Kb(e)||e.variants)}function UGe(e,t,n){for(const i in t){const r=t[i],o=n[i];if(tr(r))e.addValue(i,r);else if(tr(o))e.addValue(i,eu(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,eu(s!==void 0?s:r,{owner:e}))}}for(const i in n)t[i]===void 0&&e.removeValue(i);return t}const lT={current:null},$k={current:!1},WGe=typeof window<"u";function BGe(){if($k.current=!0,!!WGe)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>lT.current=e.matches;e.addEventListener("change",t),t()}else lT.current=!1}const eX=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Jb={};function tX(e){Jb=e}function YGe(){return Jb}class HGe{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=WE,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=gr.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Sn.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=Kb(n),this.isVariantNode=qk(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&&tr(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,DGe.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:($k.current||BGe(),this.shouldReduceMotion=lT.current),process.env.NODE_ENV!=="production"&&yE(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(),Wc(this.notifyUpdate),Wc(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&&vGe.has(t)&&this.current instanceof HTMLElement){const{factory:s,keyframes:a,times:c,ease:l,duration:u}=n.accelerate,h=new xk({element:this.current,name:t,keyframes:a,times:c,ease:l,duration:Vo(u)}),d=s(h);this.valueSubscriptions.set(t,()=>{d(),h.cancel()});return}const i=ed.has(t);i&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",s=>{this.latestValues[t]=s,this.props.onUpdate&&Sn.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 Jb){const n=Jb[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):yi()}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<eX.length;i++){const r=eX[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=UGe(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=eu(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"&&(RN(i)||MN(i))?i=parseFloat(i):!ZGe(i)&&ds.test(n)&&(i=kk(t,n)),this.setBaseTarget(t,tr(i)?i.get():i)),tr(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=KE(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&&!tr(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 gE),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){iT.render(this.render)}}class nX extends HGe{constructor(){super(...arguments),this.KeyframeResolver=_Ge}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;tr(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Hc{constructor(t){this.isMounted=!1,this.node=t}update(){}}function iX({top:e,left:t,right:n,bottom:i}){return{x:{min:t,max:n},y:{min:e,max:i}}}function jGe({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function KGe(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 uT(e){return e===void 0||e===1}function hT({scale:e,scaleX:t,scaleY:n}){return!uT(e)||!uT(t)||!uT(n)}function tu(e){return hT(e)||rX(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function rX(e){return oX(e.x)||oX(e.y)}function oX(e){return e&&e!=="0%"}function Qb(e,t,n){const i=e-n,r=t*i;return n+r}function sX(e,t,n,i,r){return r!==void 0&&(e=Qb(e,r,i)),Qb(e,n,i)+t}function dT(e,t=0,n=1,i,r){e.min=sX(e.min,t,n,i,r),e.max=sX(e.max,t,n,i,r)}function aX(e,{x:t,y:n}){dT(e.x,t.translate,t.scale,t.originPoint),dT(e.y,n.translate,n.scale,n.originPoint)}const cX=.999999999999,lX=1.0000000000001;function JGe(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&&od(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),s&&(t.x*=s.x.scale,t.y*=s.y.scale,aX(e,s)),i&&tu(o.latestValues)&&od(e,o.latestValues))}t.x<lX&&t.x>cX&&(t.x=1),t.y<lX&&t.y>cX&&(t.y=1)}function rd(e,t){e.min=e.min+t,e.max=e.max+t}function uX(e,t,n,i,r=.5){const o=kn(e.min,e.max,r);dT(e,t,n,o,i)}function hX(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function od(e,t){uX(e.x,hX(t.x,e.x),t.scaleX,t.scale,t.originX),uX(e.y,hX(t.y,e.y),t.scaleY,t.scale,t.originY)}function dX(e,t){return iX(KGe(e.getBoundingClientRect(),t))}function QGe(e,t,n){const i=dX(e,n),{scroll:r}=t;return r&&(rd(i.x,r.offset.x),rd(i.y,r.offset.y)),i}const qGe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$Ge=$h.length;function eVe(e,t,n){let i="",r=!0;for(let o=0;o<$Ge;o++){const s=$h[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=Zk(a,nT[s]);if(!c){r=!1;const u=qGe[s]||s;i+=`${u}(${l}) `}n&&(t[s]=l)}}return i=i.trim(),n?i=n(t,r?"":i):r&&(i="none"),i}function fT(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(ed.has(c)){s=!0;continue}else if(HN(c)){r[c]=l;continue}else{const u=Zk(l,nT[c]);c.startsWith("origin")?(a=!0,o[c]=u):i[c]=u}}if(t.transform||(s||n?i.transform=eVe(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 fX(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 pX(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const x0={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(ct.test(e))e=parseFloat(e);else return e;const n=pX(e,t.target.x),i=pX(e,t.target.y);return`${n}% ${i}%`}},tVe={correct:(e,{treeScale:t,projectionDelta:n})=>{const i=e,r=ds.parse(e);if(r.length>5)return i;const o=ds.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=kn(a,c,.5);return typeof r[2+s]=="number"&&(r[2+s]/=l),typeof r[3+s]=="number"&&(r[3+s]/=l),o(r)}},pT={borderRadius:{...x0,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:x0,borderTopRightRadius:x0,borderBottomLeftRadius:x0,borderBottomRightRadius:x0,boxShadow:tVe};function mX(e,{layout:t,layoutId:n}){return ed.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!pT[e]||e==="opacity")}function mT(e,t,n){const i=e.style,r=t?.style,o={};if(!i)return o;for(const s in i)(tr(i[s])||r&&tr(r[s])||mX(s,e)||n?.getValue(s)?.liveStyle!==void 0)&&(o[s]=i[s]);return o}function nVe(e){return window.getComputedStyle(e)}class iVe extends nX{constructor(){super(...arguments),this.type="html",this.renderInstance=fX}readValueFromInstance(t,n){if(ed.has(n))return this.projection?.isProjecting?kE(n):SOe(t,n);{const i=nVe(t),r=(HN(n)?i.getPropertyValue(n):i[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(t,{transformPagePoint:n}){return dX(t,n)}build(t,n,i){fT(t,n,i.transformTemplate)}scrapeMotionValuesFromProps(t,n,i){return mT(t,n,i)}}const rVe={offset:"stroke-dashoffset",array:"stroke-dasharray"},oVe={offset:"strokeDashoffset",array:"strokeDasharray"};function sVe(e,t,n=1,i=0,r=!0){e.pathLength=1;const o=r?rVe:oVe;e[o.offset]=`${-i}`,e[o.array]=`${t} ${n}`}const aVe=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function gX(e,{attrX:t,attrY:n,attrScale:i,pathLength:r,pathSpacing:o=1,pathOffset:s=0,...a},c,l,u){if(fT(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 aVe)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&&sVe(h,r,o,s,!1)}const yX=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"]),bX=e=>typeof e=="string"&&e.toLowerCase()==="svg";function cVe(e,t,n,i){fX(e,t,void 0,i);for(const r in t.attrs)e.setAttribute(yX.has(r)?r:qE(r),t.attrs[r])}function _X(e,t,n){const i=mT(e,t,n);for(const r in e)if(tr(e[r])||tr(t[r])){const o=$h.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[o]=e[r]}return i}class lVe extends nX{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=yi}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(ed.has(n)){const i=Nk(n);return i&&i.default||0}return n=yX.has(n)?n:qE(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,i){return _X(t,n,i)}build(t,n,i){gX(t,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(t,n,i,r){cVe(t,n,i,r)}mount(t){this.isSVGTag=bX(t.tagName),super.mount(t)}}const uVe=cT.length;function vX(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?vX(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<uVe;n++){const i=cT[n],r=e.props[i];(w0(r)||r===!1)&&(t[i]=r)}return t}function wX(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 hVe=[...aT].reverse(),dVe=aT.length;function fVe(e){return t=>Promise.all(t.map(({animation:n,options:i})=>lGe(e,n,i)))}function pVe(e){let t=fVe(e),n=xX(),i=!0,r=!1;const o=l=>(u,h)=>{const d=td(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=vX(e.parent)||{},d=[],f=new Set;let p={},m=1/0;for(let g=0;g<dVe;g++){const v=hVe[g],S=n[v],T=u[v]!==void 0?u[v]:h[v],I=w0(T),O=v===l?S.isActive:null;O===!1&&(m=g);let G=T===h[v]&&T!==u[v]&&I;if(G&&(i||r)&&e.manuallyAnimateOnMount&&(G=!1),S.protectedKeys={...p},!S.isActive&&O===null||!T&&!S.prevProp||jb(T)||typeof T=="boolean")continue;if(v==="exit"&&S.isActive&&O!==!0){S.prevResolvedValues&&(p={...p,...S.prevResolvedValues});continue}const A=mVe(S.prevProp,T);let V=A||v===l&&S.isActive&&!G&&I||g>m&&I,N=!1;const k=Array.isArray(T)?T:[T];let P=k.reduce(o(v),{});O===!1&&(P={});const{prevResolvedValues:w={}}=S,x={...w,...P},C=Y=>{V=!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],Q=w[Y];if(p.hasOwnProperty(Y))continue;let z=!1;JE(H)&&JE(Q)?z=!wX(H,Q):z=H!==Q,z?H!=null?C(Y):f.add(Y):H!==void 0&&f.has(Y)?C(Y):S.protectedKeys[Y]=!0}S.prevProp=T,S.prevResolvedValues=P,S.isActive&&(p={...p,...P}),(i||r)&&e.blockInitialAnimation&&(V=!1);const Z=G&&A;V&&(!Z||N)&&d.push(...k.map(Y=>{const H={type:v};if(typeof Y=="string"&&(i||r)&&!Z&&e.manuallyAnimateOnMount&&e.parent){const{parent:Q}=e,z=td(Q,Y);if(Q.enteringChildren&&z){const{delayChildren:W}=z.transition||{};H.delay=Tk(Q.enteringChildren,e,W)}}return{animation:Y,options:H}}))}if(f.size){const g={};if(typeof u.initial!="boolean"){const v=td(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),T=e.getValue(v);T&&(T.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=xX(),r=!0}}}function mVe(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!wX(t,e):!1}function nu(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function xX(){return{animate:nu(!0),whileInView:nu(),whileHover:nu(),whileTap:nu(),whileDrag:nu(),whileFocus:nu(),exit:nu()}}function SX(e,t){e.min=t.min,e.max=t.max}function ps(e,t){SX(e.x,t.x),SX(e.y,t.y)}function EX(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const TX=1e-4,gVe=1-TX,yVe=1+TX,CX=.01,bVe=0-CX,_Ve=0+CX;function yr(e){return e.max-e.min}function vVe(e,t,n){return Math.abs(e-t)<=n}function RX(e,t,n,i=.5){e.origin=i,e.originPoint=kn(t.min,t.max,e.origin),e.scale=yr(n)/yr(t),e.translate=kn(n.min,n.max,e.origin)-e.originPoint,(e.scale>=gVe&&e.scale<=yVe||isNaN(e.scale))&&(e.scale=1),(e.translate>=bVe&&e.translate<=_Ve||isNaN(e.translate))&&(e.translate=0)}function S0(e,t,n,i){RX(e.x,t.x,n.x,i?i.originX:void 0),RX(e.y,t.y,n.y,i?i.originY:void 0)}function IX(e,t,n){e.min=n.min+t.min,e.max=e.min+yr(t)}function wVe(e,t,n){IX(e.x,t.x,n.x),IX(e.y,t.y,n.y)}function MX(e,t,n){e.min=t.min-n.min,e.max=e.min+yr(t)}function qb(e,t,n){MX(e.x,t.x,n.x),MX(e.y,t.y,n.y)}function LX(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 xVe(e,t=0,n=1,i=.5,r,o=e,s=e){if(na.test(t)&&(t=parseFloat(t),t=kn(s.min,s.max,t/100)-s.min),typeof t!="number")return;let a=kn(o.min,o.max,i);e===o&&(a-=t),e.min=LX(e.min,t,n,a,r),e.max=LX(e.max,t,n,a,r)}function PX(e,t,[n,i,r],o,s){xVe(e,t[n],t[i],t[r],t.scale,o,s)}const SVe=["x","scaleX","originX"],EVe=["y","scaleY","originY"];function OX(e,t,n,i){PX(e.x,t,SVe,n?n.x:void 0,i?i.x:void 0),PX(e.y,t,EVe,n?n.y:void 0,i?i.y:void 0)}function GX(e){return e.translate===0&&e.scale===1}function VX(e){return GX(e.x)&&GX(e.y)}function FX(e,t){return e.min===t.min&&e.max===t.max}function TVe(e,t){return FX(e.x,t.x)&&FX(e.y,t.y)}function AX(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function zX(e,t){return AX(e.x,t.x)&&AX(e.y,t.y)}function NX(e){return yr(e.x)/yr(e.y)}function kX(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ia(e){return[e("x"),e("y")]}function CVe(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 XX=["TopLeft","TopRight","BottomLeft","BottomRight"],RVe=XX.length,ZX=e=>typeof e=="string"?parseFloat(e):e,DX=e=>typeof e=="number"||ct.test(e);function IVe(e,t,n,i,r,o){r?(e.opacity=kn(0,n.opacity??1,MVe(i)),e.opacityExit=kn(t.opacity??1,0,LVe(i))):o&&(e.opacity=kn(t.opacity??1,n.opacity??1,i));for(let s=0;s<RVe;s++){const a=`border${XX[s]}Radius`;let c=UX(t,a),l=UX(n,a);if(c===void 0&&l===void 0)continue;c||(c=0),l||(l=0),c===0||l===0||DX(c)===DX(l)?(e[a]=Math.max(kn(ZX(c),ZX(l),i),0),(na.test(l)||na.test(c))&&(e[a]+="%")):e[a]=l}(t.rotate||n.rotate)&&(e.rotate=kn(t.rotate||0,n.rotate||0,i))}function UX(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const MVe=WX(0,.5,kN),LVe=WX(.5,.95,Go);function WX(e,t,n){return i=>i<e?0:i>t?1:n(p0(e,t,i))}function PVe(e,t,n){const i=tr(e)?e:eu(e);return i.start(jE("",i,t,n)),i.animation}function E0(e,t,n,i={passive:!0}){return e.addEventListener(t,n,i),()=>e.removeEventListener(t,n)}const OVe=(e,t)=>e.depth-t.depth;class GVe{constructor(){this.children=[],this.isDirty=!1}add(t){pE(this.children,t),this.isDirty=!0}remove(t){zb(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(OVe),this.isDirty=!1,this.children.forEach(t)}}function VVe(e,t){const n=gr.now(),i=({timestamp:r})=>{const o=r-n;o>=t&&(Wc(i),e(o-t))};return Sn.setup(i,!0),()=>Wc(i)}function $b(e){return tr(e)?e.get():e}class FVe{constructor(){this.members=[]}add(t){pE(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&&(zb(this.members,i),i.unmount())}t.scheduleRender()}remove(t){if(zb(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 e1={hasAnimatedSinceResize:!0,hasEverUpdated:!1},gT=["","X","Y","Z"],AVe=1e3;let zVe=0;function yT(e,t,n,i){const{latestValues:r}=t;r[e]&&(n[e]=r[e],t.setStaticValue(e,0),i&&(i[e]=0))}function BX(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=Ok(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Sn,!(r||o))}const{parent:i}=e;i&&!i.hasCheckedOptimisedAppear&&BX(i)}function YX({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(s={},a=t?.()){this.id=zVe++,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(XVe),this.nodes.forEach(WVe),this.nodes.forEach(BVe),this.nodes.forEach(ZVe)},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 GVe)}addEventListener(s,a){return this.eventHandlers.has(s)||this.eventHandlers.set(s,new gE),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=sT(s)&&!kGe(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;Sn.read(()=>{h=window.innerWidth}),e(s,()=>{const f=window.innerWidth;f!==h&&(h=f,this.root.updateBlockedByResize=!0,u&&u(),u=VVe(d,250),e1.hasAnimatedSinceResize&&(e1.hasAnimatedSinceResize=!1,this.nodes.forEach(KX)))})}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()||JVe,{onLayoutAnimationStart:m,onLayoutAnimationComplete:y}=l.getProps(),g=!this.targetLayout||!zX(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={...HE(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||KX(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(),Wc(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(YVe),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&&BX(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(HX);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(jX);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(UVe),this.nodes.forEach(NVe),this.nodes.forEach(kVe)):this.nodes.forEach(jX),this.clearAllSnapshots();const a=gr.now();Ni.delta=ta(0,1e3/60,a-Ni.timestamp),Ni.timestamp=a,Ni.isProcessing=!0,vE.update.process(Ni),vE.preRender.process(Ni),vE.render.process(Ni),Ni.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,iT.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(DVe),this.sharedNodes.forEach(HVe)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Sn.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Sn.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!yr(this.snapshot.measuredBox.x)&&!yr(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=yi(),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&&!VX(this.projectionDelta),c=this.getTransformTemplate(),l=c?c(this.latestValues,""):void 0,u=l!==this.prevTransformTemplateValue;s&&this.instance&&(a||tu(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)),QVe(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:s}=this.options;if(!s)return yi();const a=s.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(qVe))){const{scroll:l}=this.root;l&&(rd(a.x,l.offset.x),rd(a.y,l.offset.y))}return a}removeElementScroll(s){const a=yi();if(ps(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&&ps(a,s),rd(a.x,u.offset.x),rd(a.y,u.offset.y))}return a}applyTransform(s,a=!1){const c=yi();ps(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&&od(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),tu(u.latestValues)&&od(c,u.latestValues)}return tu(this.latestValues)&&od(c,this.latestValues),c}removeTransform(s){const a=yi();ps(a,s);for(let c=0;c<this.path.length;c++){const l=this.path[c];if(!l.instance||!tu(l.latestValues))continue;hT(l.latestValues)&&l.updateSnapshot();const u=yi(),h=l.measurePageBox();ps(u,h),OX(a,l.latestValues,l.snapshot?l.snapshot.layoutBox:void 0,u)}return tu(this.latestValues)&&OX(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!==Ni.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=Ni.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=yi(),this.targetWithTransforms=yi()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),wVe(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ps(this.target,this.layout.layoutBox),aX(this.target,this.targetDelta)):ps(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||hT(this.parent.latestValues)||rX(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=yi(),this.relativeTargetOrigin=yi(),qb(this.relativeTargetOrigin,a,c),ps(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===Ni.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;ps(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,d=this.treeScale.y;JGe(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=yi());const{target:f}=s;if(!f){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(EX(this.prevProjectionDelta.x,this.projectionDelta.x),EX(this.prevProjectionDelta.y,this.projectionDelta.y)),S0(this.projectionDelta,this.layoutCorrected,f,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==d||!kX(this.projectionDelta.x,this.prevProjectionDelta.x)||!kX(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=id(),this.projectionDelta=id(),this.projectionDeltaWithTransform=id()}setAnimationOrigin(s,a=!1){const c=this.snapshot,l=c?c.latestValues:{},u={...this.latestValues},h=id();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;const d=yi(),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(KVe));this.animationProgress=0;let S;this.mixTargetDelta=T=>{const I=T/1e3;JX(h.x,s.x,I),JX(h.y,s.y,I),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(qb(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox),jVe(this.relativeTarget,this.relativeTargetOrigin,d,I),S&&TVe(this.relativeTarget,S)&&(this.isProjectionDirty=!1),S||(S=yi()),ps(S,this.relativeTarget)),m&&(this.animationValues=u,IVe(u,l,this.latestValues,I,v,g)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=I},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(s){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Wc(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Sn.update(()=>{e1.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=eu(0)),this.motionValue.jump(0,!1),this.currentAnimation=PVe(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(AVe),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&&tZ(this.options.animationType,this.layout.layoutBox,l.layoutBox)){c=this.target||yi();const h=yr(this.layout.layoutBox.x);c.x.min=s.target.x.min,c.x.max=c.x.min+h;const d=yr(this.layout.layoutBox.y);c.y.min=s.target.y.min,c.y.max=c.y.min+d}ps(a,c),od(a,u),S0(this.projectionDeltaWithTransform,this.layoutCorrected,a,u)}}registerSharedNode(s,a){this.sharedNodes.has(s)||this.sharedNodes.set(s,new FVe),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&&yT("z",s,l,this.animationValues);for(let u=0;u<gT.length;u++)yT(`rotate${gT[u]}`,s,l,this.animationValues),yT(`skew${gT[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=$b(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=$b(a?.pointerEvents)||""),this.hasProjected&&!tu(this.latestValues)&&(s.transform=c?c({},""):"none",this.hasProjected=!1);return}s.visibility="";const u=l.animationValues||l.latestValues;this.applyTransformsToTarget();let h=CVe(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 pT){if(u[p]===void 0)continue;const{correct:m,applyTo:y,isCSSVariable:g}=pT[p],v=h==="none"?u[p]:m(u[p],l);if(y){const S=y.length;for(let T=0;T<S;T++)s[y[T]]=v}else g?this.options.visualElement.renderState.vars[p]=v:s[p]=v}this.options.layoutId&&(s.pointerEvents=l===this?$b(a?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(s=>s.currentAnimation?.stop()),this.root.nodes.forEach(HX),this.root.sharedNodes.clear()}}}function NVe(e){e.updateLayout()}function kVe(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"?ia(u=>{const h=o?t.measuredBox[u]:t.layoutBox[u],d=yr(h);h.min=n[u].min,h.max=h.min+d}):tZ(r,t.layoutBox,n)&&ia(u=>{const h=o?t.measuredBox[u]:t.layoutBox[u],d=yr(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=id();S0(s,n,t.layoutBox);const a=id();o?S0(a,e.applyTransform(i,!0),t.measuredBox):S0(a,n,t.layoutBox);const c=!VX(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=yi();qb(f,t.layoutBox,h.layoutBox);const p=yi();qb(p,n,d.layoutBox),zX(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 XVe(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 ZVe(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function DVe(e){e.clearSnapshot()}function HX(e){e.clearMeasurements()}function jX(e){e.isLayoutDirty=!1}function UVe(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function KX(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function WVe(e){e.resolveTargetDelta()}function BVe(e){e.calcProjection()}function YVe(e){e.resetSkewAndRotation()}function HVe(e){e.removeLeadSnapshot()}function JX(e,t,n){e.translate=kn(t.translate,0,n),e.scale=kn(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function QX(e,t,n,i){e.min=kn(t.min,n.min,i),e.max=kn(t.max,n.max,i)}function jVe(e,t,n,i){QX(e.x,t.x,n.x,i),QX(e.y,t.y,n.y,i)}function KVe(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const JVe={duration:.45,ease:[.4,0,.1,1]},qX=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),$X=qX("applewebkit/")&&!qX("chrome/")?Math.round:Go;function eZ(e){e.min=$X(e.min),e.max=$X(e.max)}function QVe(e){eZ(e.x),eZ(e.y)}function tZ(e,t,n){return e==="position"||e==="preserve-aspect"&&!vVe(NX(t),NX(n),.2)}function qVe(e){return e!==e.root&&e.scroll?.wasRoot}const $Ve=YX({attachResizeListener:(e,t)=>E0(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),bT={current:void 0},nZ=YX({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!bT.current){const e=new $Ve({});e.mount(window),e.setOptions({layoutScroll:!0}),bT.current=e}return bT.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),_T=R.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function e9e(e=!0){const t=R.useContext(fE);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 iZ=R.createContext({strict:!1}),rZ={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 oZ=!1;function t9e(){if(oZ)return;const e={};for(const t in rZ)e[t]={isEnabled:n=>rZ[t].some(i=>!!n[i])};tX(e),oZ=!0}function sZ(){return t9e(),YGe()}function n9e(e){const t=sZ();for(const n in e)t[n]={...t[n],...e[n]};tX(t)}const i9e=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 t1(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||i9e.has(e)}let aZ=e=>!t1(e);function r9e(e){typeof e=="function"&&(aZ=t=>t.startsWith("on")?!t1(t):e(t))}try{r9e(require("@emotion/is-prop-valid").default)}catch{}function o9e(e,t,n){const i={};for(const r in e)r==="values"&&typeof e.values=="object"||(aZ(r)||n===!0&&t1(r)||!t&&!t1(r)||e.draggable&&r.startsWith("onDrag"))&&(i[r]=e[r]);return i}const n1=R.createContext({});function s9e(e,t){if(Kb(e)){const{initial:n,animate:i}=e;return{initial:n===!1||w0(n)?n:void 0,animate:w0(i)?i:void 0}}return e.inherit!==!1?t:{}}function a9e(e){const{initial:t,animate:n}=s9e(e,R.useContext(n1));return R.useMemo(()=>({initial:t,animate:n}),[cZ(t),cZ(n)])}function cZ(e){return Array.isArray(e)?e.join(" "):e}const vT=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function lZ(e,t,n){for(const i in t)!tr(t[i])&&!mX(i,n)&&(e[i]=t[i])}function c9e({transformTemplate:e},t){return R.useMemo(()=>{const n=vT();return fT(n,t,e),Object.assign({},n.vars,n.style)},[t])}function l9e(e,t){const n=e.style||{},i={};return lZ(i,n,e),Object.assign(i,c9e(e,t)),i}function u9e(e,t){const n={},i=l9e(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 uZ=()=>({...vT(),attrs:{}});function h9e(e,t,n,i){const r=R.useMemo(()=>{const o=uZ();return gX(o,t,bX(i),e.transformTemplate,e.style),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};lZ(o,e.style,e),r.style={...o,...r.style}}return r}const d9e=["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 wT(e){return typeof e!="string"||e.includes("-")?!1:!!(d9e.indexOf(e)>-1||/[A-Z]/u.test(e))}function f9e(e,t,n,{latestValues:i},r,o=!1,s){const c=(s??wT(e)?h9e:u9e)(t,i,r,e),l=o9e(t,typeof e=="string",o),u=e!==R.Fragment?{...l,...c,ref:n}:{},{children:h}=t,d=R.useMemo(()=>tr(h)?h.get():h,[h]);return R.createElement(e,{...u,children:d})}function p9e({scrapeMotionValuesFromProps:e,createRenderState:t},n,i,r){return{latestValues:m9e(n,i,r,e),renderState:t()}}function m9e(e,t,n,i){const r={},o=i(e,{});for(const d in o)r[d]=$b(o[d]);let{initial:s,animate:a}=e;const c=Kb(e),l=qk(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"&&!jb(h)){const d=Array.isArray(h)?h:[h];for(let f=0;f<d.length;f++){const p=KE(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 T=u?S.length-1:0;S=S[T]}S!==null&&(r[v]=S)}for(const v in m)r[v]=m[v]}}}return r}const hZ=e=>(t,n)=>{const i=R.useContext(n1),r=R.useContext(fE),o=()=>p9e(e,t,i,r);return n?o():CN(o)},g9e=hZ({scrapeMotionValuesFromProps:mT,createRenderState:vT}),y9e=hZ({scrapeMotionValuesFromProps:_X,createRenderState:uZ}),b9e=Symbol.for("motionComponentSymbol");function _9e(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 dZ=R.createContext({});function sd(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function v9e(e,t,n,i,r,o){const{visualElement:s}=R.useContext(n1),a=R.useContext(iZ),c=R.useContext(fE),l=R.useContext(_T),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(dZ);p&&!p.projection&&r&&(p.type==="html"||p.type==="svg")&&w9e(d.current,n,r,m);const y=R.useRef(!1);R.useInsertionEffect(()=>{p&&y.current&&p.update(n,c)});const g=n[Pk],v=R.useRef(!!g&&typeof window<"u"&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return wPe(()=>{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 w9e(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:fZ(e.parent)),e.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!s||a&&sd(a),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,crossfade:u,layoutScroll:c,layoutRoot:l})}function fZ(e){if(e)return e.options.allowProjection!==!1?e.projection:fZ(e.parent)}function xT(e,{forwardMotionProps:t=!1,type:n}={},i,r){i&&n9e(i);const o=n?n==="svg":wT(e),s=o?y9e:g9e;function a(l,u){let h;const d={...R.useContext(_T),...l,layoutId:x9e(l)},{isStatic:f}=d,p=a9e(l),m=s(l,f);if(!f&&typeof window<"u"){S9e(d,i);const y=E9e(d);h=y.MeasureLayout,p.visualElement=v9e(e,m,d,r,y.ProjectionNode,o)}return le.jsxs(n1.Provider,{value:p,children:[h&&p.visualElement?le.jsx(h,{visualElement:p.visualElement,...d}):null,f9e(e,l,_9e(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[b9e]=e,c}function x9e({layoutId:e}){const t=R.useContext(TN).id;return t&&e!==void 0?t+"-"+e:e}function S9e(e,t){const n=R.useContext(iZ).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?Kh(!1,i,"lazy-strict-mode"):Da(!1,i,"lazy-strict-mode")}}function E9e(e){const t=sZ(),{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 T9e(e,t){if(typeof Proxy>"u")return xT;const n=new Map,i=(o,s)=>xT(o,s,e,t),r=(o,s)=>(process.env.NODE_ENV!=="production"&&yE(!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,xT(s,void 0,e,t)),n.get(s))})}const C9e=(e,t)=>t.isSVG??wT(e)?new lVe(t):new iVe(t,{allowProjection:e!==R.Fragment});class R9e extends Hc{constructor(t){super(t),t.animationState||(t.animationState=pVe(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();jb(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 I9e=0;class M9e extends Hc{constructor(){super(...arguments),this.id=I9e++}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 L9e={animation:{Feature:R9e},exit:{Feature:M9e}};function T0(e){return{point:{x:e.pageX,y:e.pageY}}}const P9e=e=>t=>rT(t)&&e(t,T0(t));function C0(e,t,n,i){return E0(e,t,P9e(n),i)}const pZ=({current:e})=>e?e.ownerDocument.defaultView:null,mZ=(e,t)=>Math.abs(e-t);function O9e(e,t){const n=mZ(e.x,t.x),i=mZ(e.y,t.y);return Math.sqrt(n**2+i**2)}const gZ=new Set(["auto","scroll"]);class yZ{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=ET(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=O9e(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!m)return;const{point:y}=f,{timestamp:g}=Ni;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=ST(p,this.transformPagePoint),Sn.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=ET(f.type==="pointercancel"?this.lastMoveEventInfo:ST(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(f,v),y&&y(f,v)},!rT(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=s,this.contextWindow=r||window;const c=T0(t),l=ST(c,this.transformPagePoint),{point:u}=l,{timestamp:h}=Ni;this.history=[{...u,timestamp:h}];const{onSessionStart:d}=n;d&&d(t,ET(l,this.history)),this.removeListeners=f0(C0(this.contextWindow,"pointermove",this.handlePointerMove),C0(this.contextWindow,"pointerup",this.handlePointerUp),C0(this.contextWindow,"pointercancel",this.handlePointerUp)),a&&this.startScrollTracking(a)}startScrollTracking(t){let n=t.parentElement;for(;n;){const i=getComputedStyle(n);(gZ.has(i.overflowX)||gZ.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),Sn.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Wc(this.updatePoint)}}function ST(e,t){return t?{point:t(e.point)}:e}function bZ(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ET({point:e},t){return{point:e,delta:bZ(e,_Z(t)),offset:bZ(e,G9e(t)),velocity:V9e(t,.1)}}function G9e(e){return e[0]}function _Z(e){return e[e.length-1]}function V9e(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,i=null;const r=_Z(e);for(;n>=0&&(i=e[n],!(r.timestamp-i.timestamp>Vo(t)));)n--;if(!i)return{x:0,y:0};i===e[0]&&e.length>2&&r.timestamp-i.timestamp>Vo(t)*2&&(i=e[1]);const o=Fo(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 F9e(e,{min:t,max:n},i){return t!==void 0&&e<t?e=i?kn(t,e,i.min):Math.max(e,t):n!==void 0&&e>n&&(e=i?kn(n,e,i.max):Math.min(e,n)),e}function vZ(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 A9e(e,{top:t,left:n,bottom:i,right:r}){return{x:vZ(e.x,n,r),y:vZ(e.y,t,i)}}function wZ(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 z9e(e,t){return{x:wZ(e.x,t.x),y:wZ(e.y,t.y)}}function N9e(e,t){let n=.5;const i=yr(e),r=yr(t);return r>i?n=p0(t.min,t.max-i,e.min):i>r&&(n=p0(e.min,e.max-r,t.min)),ta(0,1,n)}function k9e(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 TT=.35;function X9e(e=TT){return e===!1?e=0:e===!0&&(e=TT),{x:xZ(e,"left","right"),y:xZ(e,"top","bottom")}}function xZ(e,t,n){return{min:SZ(e,t),max:SZ(e,n)}}function SZ(e,t){return typeof e=="number"?e:e[t]||0}const Z9e=new WeakMap;class D9e{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=yi(),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(T0(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=xGe(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),ia(g=>{let v=this.getAxisMotionValue(g).get()||0;if(na.test(v)){const{projection:S}=this.visualElement;if(S&&S.layout){const T=S.layout.layoutBox[g];T&&(v=yr(T)*(parseFloat(v)/100))}}this.originPoint[g]=v}),m&&Sn.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=W9e(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&&Sn.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 yZ(t,{onSessionStart:o,onStart:s,onMove:a,onSessionEnd:c,resumeAnimation:l},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,distanceThreshold:i,contextWindow:pZ(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&&Sn.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||!i1(t,r,this.currentDirection))return;const o=this.getAxisMotionValue(t);let s=this.originPoint[t]+i[t];this.constraints&&this.constraints[t]&&(s=F9e(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&&sd(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&i?this.constraints=A9e(i.layoutBox,t):this.constraints=!1,this.elastic=X9e(n),r!==this.constraints&&!sd(t)&&i&&this.constraints&&!this.hasMutatedConstraints&&ia(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=k9e(i.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!sd(t))return!1;const i=t.current;Da(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=QGe(i,r.root,this.visualElement.getTransformPagePoint());let s=z9e(r.layout.layoutBox,o);if(n){const a=n(jGe(s));this.hasMutatedConstraints=!!a,a&&(s=iX(a))}return s}startAnimation(t){const{drag:n,dragMomentum:i,dragElastic:r,dragTransition:o,dragSnapToOrigin:s,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},l=ia(u=>{if(!i1(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(jE(t,i,0,n,this.visualElement,!1))}stopAnimation(){ia(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){ia(n=>{const{drag:i}=this.getProps();if(!i1(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]-kn(s,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!sd(n)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};ia(s=>{const a=this.getAxisMotionValue(s);if(a&&this.constraints!==!1){const c=a.get();r[s]=N9e({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(),ia(s=>{if(!i1(s,t,null))return;const a=this.getAxisMotionValue(s),{min:c,max:l}=this.constraints[s];a.set(kn(c,l,r[s]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Z9e.set(this.visualElement,this);const t=this.visualElement.current,n=C0(t,"pointerdown",l=>{const{drag:u,dragListener:h=!0}=this.getProps(),d=l.target,f=d!==t&&IGe(d);u&&h&&!f&&this.start(l)});let i;const r=()=>{const{dragConstraints:l}=this.getProps();sd(l)&&l.current&&(this.constraints=this.resolveRefConstraints(),i||(i=U9e(t,l.current,()=>this.scalePositionWithinConstraints())))},{projection:o}=this.visualElement,s=o.addEventListener("measure",r);o&&!o.layout&&(o.root&&o.root.updateScroll(),o.updateLayout()),Sn.read(r);const a=E0(window,"resize",()=>this.scalePositionWithinConstraints()),c=o.addEventListener("didUpdate",(({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(ia(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=TT,dragMomentum:a=!0}=t;return{...t,drag:n,dragDirectionLock:i,dragPropagation:r,dragConstraints:o,dragElastic:s,dragMomentum:a}}}function EZ(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function U9e(e,t,n){const i=Kk(e,EZ(n)),r=Kk(t,EZ(n));return()=>{i(),r()}}function i1(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function W9e(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class B9e extends Hc{constructor(t){super(t),this.removeGroupControls=Go,this.removeListeners=Go,this.controls=new D9e(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Go}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 CT=e=>(t,n)=>{e&&Sn.update(()=>e(t,n),!1,!0)};class Y9e extends Hc{constructor(){super(...arguments),this.removePointerDownListener=Go}onPointerDown(t){this.session=new yZ(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:pZ(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:CT(t),onStart:CT(n),onMove:CT(i),onEnd:(o,s)=>{delete this.session,r&&Sn.postRender(()=>r(o,s))}}}mount(){this.removePointerDownListener=C0(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 RT=!1;class H9e 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),RT&&o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),e1.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}),RT=!0,r||t.layoutDependency!==n||n===void 0||t.isPresent!==o?s.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?s.promote():s.relegate()||Sn.postRender(()=>{const a=s.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),iT.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:r}=t;RT=!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 TZ(e){const[t,n]=e9e(),i=R.useContext(TN);return le.jsx(H9e,{...e,layoutGroup:i,switchLayoutGroup:R.useContext(dZ),isPresent:t,safeToRemove:n})}const j9e={pan:{Feature:Y9e},drag:{Feature:B9e,ProjectionNode:nZ,MeasureLayout:TZ}};function CZ(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&&Sn.postRender(()=>o(t,T0(t)))}class K9e extends Hc{mount(){const{current:t}=this.node;t&&(this.unmount=EGe(t,(n,i)=>(CZ(this.node,i,"Start"),r=>CZ(this.node,r,"End"))))}unmount(){}}class J9e extends Hc{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=f0(E0(this.node.current,"focus",()=>this.onFocus()),E0(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function RZ(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&&Sn.postRender(()=>o(t,T0(t)))}class Q9e extends Hc{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:i}=this.node.props;this.unmount=LGe(t,(r,o)=>(RZ(this.node,o,"Start"),(s,{success:a})=>RZ(this.node,s,a?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:i?.tap===!1})}unmount(){}}const IT=new WeakMap,MT=new WeakMap,q9e=e=>{const t=IT.get(e.target);t&&t(e)},$9e=e=>{e.forEach(q9e)};function eFe({root:e,...t}){const n=e||document;MT.has(n)||MT.set(n,{});const i=MT.get(n),r=JSON.stringify(t);return i[r]||(i[r]=new IntersectionObserver($9e,{root:e,...t})),i[r]}function tFe(e,t,n){const i=eFe(t);return IT.set(e,n),i.observe(e),()=>{IT.delete(e),i.unobserve(e)}}const nFe={some:0,all:1};class iFe extends Hc{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:nFe[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 tFe(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(rFe(t,n))&&this.startObserver()}unmount(){}}function rFe({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const oFe={...L9e,...{inView:{Feature:iFe},tap:{Feature:Q9e},focus:{Feature:J9e},hover:{Feature:K9e}},...j9e,...{layout:{ProjectionNode:nZ,MeasureLayout:TZ}}},sFe=T9e(oFe,C9e);function IZ(e){const t=CN(()=>eu(e)),{isStatic:n}=R.useContext(_T);if(n){const[,i]=R.useState(e);R.useEffect(()=>t.on("change",i),[])}return t}function LT(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function aFe(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 cFe=typeof window<"u"?V0.useLayoutEffect:V0.useEffect,MZ=new WeakMap;function lFe(e,t){var n=aFe(null,function(i){return e.forEach(function(r){return LT(r,i)})});return cFe(function(){var i=MZ.get(n);if(i){var r=new Set(i),o=new Set(e),s=n.current;r.forEach(function(a){o.has(a)||LT(a,null)}),o.forEach(function(a){r.has(a)||LT(a,s)})}MZ.set(n,e)},[e]),n}const uFe=new is(rt.WGS84,b.ZERO),PT=R.forwardRef(({position:e,children:t,...n},i)=>{const r=ko(()=>new b);e?.clone(r);const o=IZ(""),s=IZ("none"),{toWindowPosition:a,getCamera:c,toXYZ:l,isPositionVisible:u}=oi(),h=R.useRef(null);Ol(()=>{if(h.current==null)return;let f;try{const v=a?.([r.x,r.y,r.z]);f=new pe(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(uFe.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=lFe([h,i]);return le.jsx(sFe.div,{ref:d,...n,style:{...n.style,transform:o,display:s,position:"absolute",pointerEvents:"none",left:0,top:0},children:t})});PT.displayName="ScreenSpaceElement";const hFe=({a:e,b:t,color:n})=>{const i=R.useRef([e,t]);i.current=[e,t];const r=ko(()=>new go(()=>i.current,!1)),o=R.useMemo(()=>({polyline:{positions:r,width:1.5,material:new Pl({color:n,dashLength:8})}}),[n,r]);return le.jsx(d0,{...o})},dFe=({a:e,b:t,extrudedHeight:n,color:i,showLine:r})=>{const o=ko(()=>new b);return le.jsxs(le.Fragment,{children:[le.jsx(PT,{position:b.midpoint(e,t,o),children:le.jsx(EN,{children:n<1e3?`${n.toFixed(1)} m`:`${(n/1e3).toFixed(1)} km`})}),r&&le.jsx(hFe,{a:e,b:t,color:i})]})},LZ=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 le.jsxs(le.Fragment,{children:[h&&le.jsxs(le.Fragment,{children:[le.jsx(h0,{index:-1,position:h,isEditing:r,isExtrudedControlPoint:!0,handleControlPointMouseEvent:l}),(!r||c)&&le.jsx(dFe,{a:u,b:h,extrudedHeight:n,color:r?B.fromCssColorString(u0):i,showLine:t!=="extrudedPolygon"})]}),d&&le.jsx(h0,{index:-1,position:d,isEditing:r,isExtrudedControlPoint:!0}),f&&le.jsx(h0,{index:-1,position:f,isEditing:r,isExtrudedControlPoint:!0})]})});LZ.displayName="ExtrudedControlPoints";const fFe=({id:e,hierarchy:t,extrudedHeight:n,color:i,disableShadow:r=!1,isEditing:o})=>{const s=R.useRef(t);s.current=t;const c=ko(()=>new go(()=>s.current,!1)),l=R.useRef(n);l.current=n;const h=ko(()=>new go(()=>l.current,!1)),d=R.useMemo(()=>({polygon:{hierarchy:c,heightReference:_l.RELATIVE_TO_TERRAIN,extrudedHeight:h,extrudedHeightReference:_l.RELATIVE_TO_TERRAIN,fill:!0,outline:!0,outlineWidth:1,outlineColor:o?B.fromCssColorString(u0):i?.withAlpha(1),material:new Cl(o?i?.withAlpha(.2):i),classificationType:jr.TERRAIN,shadows:r?Xf.DISABLED:Xf.ENABLED}}),[h,r,c,i,o]),{requestRender:f}=oi();return f?.(),le.jsx(d0,{id:e,...d})},pFe=({dynamic:e=!1,hierarchy:t,color:n})=>{const i=R.useRef(t);i.current=t;const r=ko(()=>new go(()=>i.current,!1)),o=e?r:t,s=R.useMemo(()=>({polygon:{hierarchy:o,fill:!0,material:n?.withAlpha(.5),classificationType:jr.TERRAIN}}),[n,o]),{requestRender:a}=oi();return a?.(),le.jsx(d0,{...s})},mFe=({dynamic:e=!1,positions:t,color:n,isEditing:i})=>{const r=R.useRef(t);r.current=t;const o=ko(()=>new go(()=>r.current,!e)),s=e?o:t,a=R.useMemo(()=>({polyline:{positions:s,width:1.5,material:i?B.fromCssColorString(u0):n,classificationType:jr.TERRAIN,clampToGround:!0}}),[n,s,i]),{requestRender:c}=oi();return c?.(),le.jsx(d0,{...a})},PZ=new b,OZ=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,PZ);r.push(a.clone())}if(e==="polygon"||e==="extrudedPolygon"){const o=b.midpoint(t[t.length-1],t[0],PZ);r.push(o.clone())}return le.jsx(le.Fragment,{children:r.map((o,s)=>le.jsx(h0,{position:o,isAddingPoint:!0,index:s,clampToGround:!0,isEditing:n,handleControlPointMouseEvent:()=>i?.([o.x,o.y,o.z],s)},s))})});OZ.displayName="SurfaceAddingPoints";const gFe=({a:e,b:t,color:n})=>{const i=R.useRef([e,t]);i.current=[e,t];const r=ko(()=>new go(()=>i.current,!1)),o=R.useMemo(()=>({polyline:{positions:r,width:1.5,material:new Pl({color:n,dashLength:8}),classificationType:jr.TERRAIN,clampToGround:!0}}),[n,r]),{requestRender:s}=oi();return s?.(),le.jsx(d0,{...o})},yFe=({a:e,b:t,color:n,showLine:i=!1})=>{const r=ko(()=>new b),{getSurfaceDistance:o}=oi(),s=o?.(e,t);return s!==void 0?le.jsxs(le.Fragment,{children:[le.jsx(PT,{position:b.midpoint(e,t,r),children:le.jsx(EN,{children:s<1e3?`${s.toFixed(1)} m`:`${(s/1e3).toFixed(1)} km`})}),i&&le.jsx(gFe,{a:e,b:t,color:n})]}):null},GZ=new b,VZ=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,GZ);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,GZ);a.push({points:[h,u],showLine:!0})}break;default:a.push({points:t.slice(-2),showLine:e==="circle"});break}return le.jsxs(le.Fragment,{children:[t.map((c,l)=>le.jsx(h0,{position:c,index:l,isSelected:o===l,clampToGround:!0,isEditing:i,handleControlPointMouseEvent:s},l)),a.map(({points:c,showLine:l},u)=>le.jsx(yFe,{a:c[0],b:c[1],color:i?B.fromCssColorString(u0):n,showLine:l},u))]})});VZ.displayName="SurfaceControlPoints";const FZ=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?gN(f):null,[f]),{positionsArray:m,hierarchyArray:y}=R.useMemo(()=>p?.type==="Point"?{}:p?.type==="LineString"?{positionsArray:lF(p)}:p!=null?{positionsArray:lF(p),hierarchyArray:uF(p)}:{},[p]),g=R.useMemo(()=>B.fromCssColorString(i??uPe),[i]);return le.jsxs(le.Fragment,{children:[m?.map((v,S)=>le.jsx(mFe,{dynamic:!0,positions:v,color:g,isEditing:r},S)),y?.map((v,S)=>le.jsx(pFe,{dynamic:!0,hierarchy:v,color:g},S)),f!=null&&(!t||r)&&le.jsx(VZ,{geometryOptions:f,color:g,isEditing:r,catchedControlPointIndex:c,selectedControlPointIndex:u,handleControlPointMouseEvent:h}),f!=null&&r&&le.jsx(OZ,{geometryOptions:f,isEditing:r,handleAddControlPoint:d}),f!=null&&t&&le.jsx(LZ,{geometryOptions:f,extrudedHeight:t,extrudedPoint:o,centroidBasePoint:s,centroidExtrudedPoint:a,catchedExtrudedPoint:l,color:g,isEditing:r,handleControlPointMouseEvent:h}),t&&y?.map((v,S)=>le.jsx(fFe,{hierarchy:v,extrudedHeight:t,disableShadow:n,color:g,isEditing:r},S))]})});FZ.displayName="SketchComponent";const bFe=({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,displayCredits:p,layersRef:m,featureFlags:y,requestingRenderMode:g,timelineManagerRef:v,cameraForceHorizontalRoll:S,onLayerSelect:T,onCameraChange:I,onLayerDrag:O,onLayerDrop:G,onLayerEdit:A,onLayerSelectWithRectStart:V,onLayerSelectWithRectMove:N,onLayerSelectWithRectEnd:k,onMount:P,onLayerVisibility:w,onLayerLoad:x,onCreditsUpdate:C},Z)=>{const{cesium:U,mouseEventHandles:Y,cesiumIonAccessToken:H,context:Q,layerSelectWithRectEventHandlers:z,sceneLight:W,sceneBackgroundColor:q,sceneMsaaSamples:$,sceneMode:se,cameraViewBoundaries:we,cameraViewOuterBoundaries:_e,cameraViewBoundariesMaterial:Fe,handleCameraChange:Ae,handleCameraMoveEnd:de,handleUpdate:Ze,handleClick:qe,handleMount:$e,handleUnmount:X,handleTilesChange:fe,handleTerrainProviderChange:he}=JLe({ref:Z,property:n,time:i,selectedLayerId:c,selectionReason:d,meta:f,layersRef:m,featureFlags:y,timelineManagerRef:v,isLayerDraggable:l,isLayerDragging:u,shouldRender:h,requestingRenderMode:g,camera:r,cameraForceHorizontalRoll:S,onLayerDrag:O,onLayerDrop:G,onLayerSelect:T,onLayerEdit:A,onLayerSelectWithRectStart:V,onLayerSelectWithRectMove:N,onLayerSelectWithRectEnd:k,onLayerVisibility:w,onLayerLoad:x,onCameraChange:I,onMount:P,onCreditsUpdate:C});return le.jsxs(mre,{ref:U,onUpdate:Ze,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:p?void 0:_Fe,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:qe,onDoubleClick:Y.doubleClick,onMouseDown:Y.mouseDown,onMouseUp:Y.mouseUp,onRightClick:Y.rightClick,onRightDown:Y.rightDown,onRightUp:Y.rightUp,onMiddleClick:Y.middleClick,onMiddleDown:Y.middleDown,onMiddleUp:Y.middleUp,onMouseMove:Y.mouseMove,onMouseEnter:Y.mouseEnter,onMouseLeave:Y.mouseLeave,onWheel:Y.wheel,automaticallyTrackDataSourceClocks:!1,children:[le.jsx(Abe,{onMount:$e,onUnmount:X}),le.jsx(Xoe,{timelineManagerRef:v}),le.jsx(Bye,{tiles:n?.tiles,cesiumIonAccessToken:H,onTilesChange:fe}),le.jsx(pF,{tileLabels:n?.tileLabels}),le.jsx(jye,{property:n,timelineManagerRef:v}),le.jsxs(NM,{useDefault:!0,children:[le.jsx(uc,{type:M.ScreenSpaceEventType.LEFT_CLICK}),le.jsx(uc,{type:M.ScreenSpaceEventType.LEFT_DOUBLE_CLICK})]}),le.jsxs(NM,{children:[le.jsx(uc,{type:M.ScreenSpaceEventType.LEFT_DOWN,action:z.start.handler}),le.jsx(uc,{type:M.ScreenSpaceEventType.LEFT_DOWN,modifier:M.KeyboardEventModifier.SHIFT,action:z.start.shift}),le.jsx(uc,{type:M.ScreenSpaceEventType.MOUSE_MOVE,action:z.move.handler}),le.jsx(uc,{type:M.ScreenSpaceEventType.MOUSE_MOVE,modifier:M.KeyboardEventModifier.SHIFT,action:z.move.shift}),le.jsx(uc,{type:M.ScreenSpaceEventType.LEFT_UP,action:z.end.handler}),le.jsx(uc,{type:M.ScreenSpaceEventType.LEFT_UP,modifier:M.KeyboardEventModifier.SHIFT,action:z.end.shift})]}),le.jsx(rre,{maximumZoomDistance:n?.camera?.limiter?.enabled?n.camera?.limiter?.targetArea?.height??Number.POSITIVE_INFINITY:Number.POSITIVE_INFINITY,enableCollisionDetection:!n?.camera?.allowEnterGround}),le.jsx(kne,{percentageChanged:.2,onChange:Ae,onMoveEnd:de}),we&&n?.camera?.limiter?.showHelper&&le.jsx(lc,{children:le.jsx(pl,{positions:we,width:1,material:M.Color.RED,arcType:M.ArcType.RHUMB})}),_e&&n?.camera?.limiter?.showHelper&&le.jsx(lc,{children:le.jsx(pl,{positions:_e,width:1,material:Fe,arcType:M.ArcType.RHUMB})}),le.jsx(nre,{backgroundColor:q,light:W,mode:se,msaaSamples:$,useDepthPicking:!0,useWebVR:!!n?.scene?.vr||void 0,debugShowFramesPerSecond:!!n?.debug?.showFramesPerSecond,verticalExaggerationRelativeHeight:n?.scene?.verticalExaggerationRelativeHeight,verticalExaggeration:n?.scene?.verticalExaggeration}),le.jsx(cre,{show:n?.sky?.skyBox?.show??!0}),le.jsx(fie,{enabled:n?.sky?.fog?.enabled??!0,density:n?.sky?.fog?.density}),le.jsx(ure,{show:n?.sky?.sun?.show??!0}),le.jsx(Nie,{show:n?.sky?.moon?.show??!0}),le.jsx(sre,{show:n?.sky?.skyAtmosphere?.show??!0,atmosphereLightIntensity:n?.sky?.skyAtmosphere?.lightIntensity,saturationShift:n?.sky?.skyAtmosphere?.saturationShift,brightnessShift:n?.sky?.skyAtmosphere?.brightnessShift}),le.jsx(_se,{property:n,cesiumIonAccessToken:H,onTerrainProviderChange:he}),le.jsx(SF.Provider,{value:Q,children:s?a:null}),le.jsx(cPe,{...lPe[n?.render?.ambientOcclusion?.quality||"low"],enabled:!!n?.render?.ambientOcclusion?.enabled,intensity:n?.render?.ambientOcclusion?.intensity??100,outputType:n?.render?.ambientOcclusion?.ambientOcclusionOnly?xN.Occlusion:null})]})},_Fe=document.createElement("div"),AZ={cesium:{component:R.forwardRef(bFe),featureComponent:O5e,clusterComponent:koe,sketchComponent:FZ,delegatedDataTypes:["czml","wms","mvt","3dtiles","osm-buildings","kml"]}};function vFe({error:e,resetErrorBoundary:t}){const i=e?.message??String(e);return le.jsxs("div",{children:[le.jsx("h1",{children:"Oops! An Error Occurred"}),le.jsx("p",{children:i}),le.jsx("p",{children:le.jsx("button",{style:{color:"#fff"},onClick:t,children:"Retry"})})]})}const wFe="0.0.7-alpha.59",xFe=({viewerProperty:e})=>{const t=R.useRef(e);t.current=e;const n=R.useMemo(()=>({get version(){return wFe},get viewerProperty(){return t.current}}),[]);R.useEffect(()=>{window.reearth_core=n},[n])},SFe=768,EFe=({wrapperRef:e})=>{const t=R.useMemo(()=>TFe(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<=SFe:void 0,query:l.query}))});return e.current&&r.observe(e.current),()=>{r.disconnect()}},[e]),n};function TFe(e){const t={};for(const[n,i]of e)t[n]=i;return t}function CFe({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=EFe({wrapperRef:d}),[p,m]=R.useState({}),[y,g]=R.useState(),[v,S]=R.useState(),T=R.useCallback(async(nt,wt,Qe,it,jt)=>{const Ii=p.layer?.layer?.type==="simple"&&p.layer?.layer?.data?.isSketchLayer;if(p.layerId===nt&&p.featureId===wt&&!Ii)return;const ci=await Qe?.(),Hn=nt&&wt?(Ii?ci?.features?.find(Qn=>Qn.id===wt):h.current?.engine.findComputedFeatureById?.(nt,wt))??jt?.feature:void 0;g(nt&&wt?h.current?.engine.findFeatureById?.(nt,wt):void 0),S(Hn),m(Qn=>Qn.layerId===nt&&Qn.featureId===wt?Qn:{layerId:nt,featureId:wt,layer:ci,reason:it}),r?.(nt,Qe,Hn,it)},[p,r]),I=R.useRef(void 0),[O,G]=zZ(e,o),[A,V]=R.useState(!1),N=R.useCallback(nt=>{V(!!nt)},[]),[k,P]=zZ(t||"default",s);R.useEffect(()=>{k==="default"&&h?.current?.engine?.setCursor("auto")},[k]);const w=A0[k??"default"],x=R.useRef(void 0),C=R.useCallback(nt=>{x.current=nt},[]),Z=R.useCallback(nt=>{x.current?.(nt)},[]),U=R.useRef(void 0),Y=R.useCallback(nt=>{U.current=nt},[]),H=R.useCallback(nt=>{U.current?.(nt)},[]),Q=R.useRef(void 0),z=R.useCallback(nt=>{Q.current=nt},[]),W=R.useCallback(nt=>{Q.current?.(nt)},[]),q=R.useRef(void 0),$=R.useCallback(nt=>{q.current=nt},[]),se=R.useCallback(nt=>{q.current?.(nt)},[]),we=R.useRef(void 0),_e=R.useCallback(nt=>{we.current=nt},[]),Fe=R.useCallback(nt=>{we.current?.(nt)},[]),Ae=R.useRef(void 0),de=R.useCallback(nt=>{Ae.current=nt},[]),Ze=R.useCallback(nt=>{Ae.current?.(nt)},[]),qe=R.useRef([]),$e=R.useCallback(nt=>{qe.current.push(nt)},[]),X=R.useCallback(nt=>{qe.current.forEach(wt=>wt(nt))},[]),fe=R.useRef([]),he=R.useCallback(nt=>{fe.current.push(nt)},[]),K=R.useCallback(nt=>{fe.current.forEach(wt=>wt(nt))},[]),j=R.useRef([]),ee=R.useCallback(nt=>{j.current.push(nt)},[]),ge=R.useCallback(nt=>{j.current.forEach(wt=>wt(nt))},[]),ae=R.useRef([]),ne=R.useCallback(nt=>{ae.current.push(nt)},[]),ye=R.useCallback((nt,wt)=>{ae.current.forEach(Qe=>Qe(nt)),l?.(nt,wt)},[l]);R.useEffect(()=>{n&&(h.current?.engine?.lookAtLayer(n),a?.(void 0))},[n,a]);const[Le,Te]=R.useState(!1),ze=R.useCallback(()=>{Te(!0)},[]),Je=R.useCallback((nt,wt,Qe)=>{Te(!1);const it=h.current?.layers.findById(nt),jt=it?.property.default.location?"default.location":it?.property.default.position?"default.position":void 0;Qe&&it&&it.propertyId&&jt&&c?.(it.propertyId,jt,Qe)},[c,h]),ut=R.useMemo(()=>({interactionMode:k,selectedLayer:p,selectedComputedFeature:v,viewport:f,handleCameraForceHorizontalRollChange:N,handleInteractionModeChange:P,onSketchPluginFeatureCreate:$e,onSketchPluginFeatureUpdate:he,onSketchPluginFeatureDelete:ee,onSketchTypeChange:ne,onLayerVisibility:Y,onLayerLoad:z,onLayerEdit:C,onLayerSelectWithRectStart:$,onLayerSelectWithRectMove:_e,onLayerSelectWithRectEnd:de}),[k,p,v,f,P,N,C,$e,he,ee,ne,Y,z,$,_e,de]),Et=R.useMemo(()=>({position:"relative",width:"100%",height:"100%",overflow:"hidden"}),[]);return xFe({viewerProperty:i}),{mapRef:h,wrapperRef:d,selectedFeature:y,camera:O,featureFlags:w,isLayerDragging:Le,timelineManagerRef:I,cameraForceHorizontalRoll:A,coreContextValue:ut,containerStyle:Et,overriddenInteractionMode:k,handleLayerSelect:T,handleLayerDrag:ze,handleLayerDrop:Je,handleLayerEdit:Z,handleCameraChange:G,handleInteractionModeChange:P,handleSketchPluginFeatureCreate:X,handleSketchPluginFeatureUpdate:K,handleSketchPluginFeatureDelete:ge,handleSketchTypeChange:ye,handleLayerVisibility:H,handleLayerLoad:W,handleLayerSelectWithRectStart:se,handleLayerSelectWithRectMove:Fe,handleLayerSelectWithRectEnd:Ze}}function zZ(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 RFe=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,displayCredits:p=!0,style:m,zoomedLayerId:y,children:g,onLayerDrop:v,onLayerSelect:S,onCameraChange:T,onZoomToLayer:I,onInteractionModeChange:O,onMount:G,onSketchTypeChangeProp:A,onSketchFeatureCreate:V,onSketchFeatureUpdate:N,onSketchFeatureDelete:k,onAPIReady:P,onCreditsUpdate:w},x)=>{const{mapRef:C,wrapperRef:Z,selectedFeature:U,camera:Y,featureFlags:H,isLayerDragging:Q,timelineManagerRef:z,cameraForceHorizontalRoll:W,coreContextValue:q,containerStyle:$,overriddenInteractionMode:se,handleLayerSelect:we,handleLayerDrag:_e,handleLayerDrop:Fe,handleLayerEdit:Ae,handleCameraChange:de,handleInteractionModeChange:Ze,handleSketchPluginFeatureCreate:qe,handleSketchPluginFeatureUpdate:$e,handleSketchPluginFeatureDelete:X,handleSketchTypeChange:fe,handleLayerVisibility:he,handleLayerLoad:K,handleLayerSelectWithRectStart:j,handleLayerSelectWithRectMove:ee,handleLayerSelectWithRectEnd:ge}=CFe({camera:l,interactionMode:h,zoomedLayerId:y,viewerProperty:i,onLayerSelect:S,onCameraChange:T,onZoomToLayer:I,onLayerDrop:v,onInteractionModeChange:O,onSketchTypeChangeProp:A},x);return le.jsx(Voe,{FallbackComponent:vFe,children:le.jsx(Noe,{mapRef:C,children:le.jsxs("div",{ref:Z,style:$,children:[le.jsx(h5,{ref:C,isBuilt:t,isEditable:n,engine:e,layers:r,engines:AZ,camera:Y,cameraForceHorizontalRoll:W,clusters:o,hiddenLayers:c,isLayerDragging:Q,isLayerDraggable:n,meta:f,displayCredits:p,style:m,featureFlags:H,shouldRender:d,property:i,time:u,small:s,ready:a,timelineManagerRef:z,interactionMode:se,selectedFeature:U,onCameraChange:de,onLayerDrag:_e,onLayerDrop:Fe,onLayerSelect:we,onLayerEdit:Ae,overrideInteractionMode:Ze,onSketchFeatureCreate:V,onSketchPluginFeatureCreate:qe,onSketchFeatureUpdate:N,onSketchPluginFeatureUpdate:$e,onSketchFeatureDelete:k,onSketchPluginFeatureDelete:X,onSketchTypeChange:fe,onMount:G,onLayerVisibility:he,onLayerLoad:K,onLayerSelectWithRectStart:j,onLayerSelectWithRectMove:ee,onLayerSelectWithRectEnd:ge,onAPIReady:P,onCreditsUpdate:w}),le.jsx(f5.Provider,{value:q,children:g})]})})})}));var ad=typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{},ra=[],Ao=[],IFe=typeof Uint8Array<"u"?Uint8Array:Array,OT=!1;function NZ(){OT=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0,n=e.length;t<n;++t)ra[t]=e[t],Ao[e.charCodeAt(t)]=t;Ao[45]=62,Ao[95]=63}function MFe(e){OT||NZ();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 IFe(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=Ao[e.charCodeAt(t)]<<18|Ao[e.charCodeAt(t+1)]<<12|Ao[e.charCodeAt(t+2)]<<6|Ao[e.charCodeAt(t+3)],s[c++]=r>>16&255,s[c++]=r>>8&255,s[c++]=r&255;return o===2?(r=Ao[e.charCodeAt(t)]<<2|Ao[e.charCodeAt(t+1)]>>4,s[c++]=r&255):o===1&&(r=Ao[e.charCodeAt(t)]<<10|Ao[e.charCodeAt(t+1)]<<4|Ao[e.charCodeAt(t+2)]>>2,s[c++]=r>>8&255,s[c++]=r&255),s}function LFe(e){return ra[e>>18&63]+ra[e>>12&63]+ra[e>>6&63]+ra[e&63]}function PFe(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(LFe(i));return r.join("")}function kZ(e){OT||NZ();for(var t,n=e.length,i=n%3,r="",o=[],s=16383,a=0,c=n-i;a<c;a+=s)o.push(PFe(e,a,a+s>c?c:a+s));return i===1?(t=e[n-1],r+=ra[t>>2],r+=ra[t<<4&63],r+="=="):i===2&&(t=(e[n-2]<<8)+e[n-1],r+=ra[t>>10],r+=ra[t>>4&63],r+=ra[t<<2&63],r+="="),o.push(r),o.join("")}function r1(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 XZ(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 OFe={}.toString,ZZ=Array.isArray||function(e){return OFe.call(e)=="[object Array]"},GFe=50;be.TYPED_ARRAY_SUPPORT=ad.TYPED_ARRAY_SUPPORT!==void 0?ad.TYPED_ARRAY_SUPPORT:!0,o1();function o1(){return be.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Wa(e,t){if(o1()<t)throw new RangeError("Invalid typed array length");return be.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t),e.__proto__=be.prototype):(e===null&&(e=new be(t)),e.length=t),e}function be(e,t,n){if(!be.TYPED_ARRAY_SUPPORT&&!(this instanceof be))return new be(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 GT(this,e)}return DZ(this,e,t,n)}be.poolSize=8192,be._augment=function(e){return e.__proto__=be.prototype,e};function DZ(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?AFe(e,t,n,i):typeof t=="string"?FFe(e,t,n):zFe(e,t)}be.from=function(e,t,n){return DZ(null,e,t,n)},be.TYPED_ARRAY_SUPPORT&&(be.prototype.__proto__=Uint8Array.prototype,be.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&be[Symbol.species]);function UZ(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 VFe(e,t,n,i){return UZ(t),t<=0?Wa(e,t):n!==void 0?typeof i=="string"?Wa(e,t).fill(n,i):Wa(e,t).fill(n):Wa(e,t)}be.alloc=function(e,t,n){return VFe(null,e,t,n)};function GT(e,t){if(UZ(t),e=Wa(e,t<0?0:FT(t)|0),!be.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}be.allocUnsafe=function(e){return GT(null,e)},be.allocUnsafeSlow=function(e){return GT(null,e)};function FFe(e,t,n){if((typeof n!="string"||n==="")&&(n="utf8"),!be.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var i=WZ(t,n)|0;e=Wa(e,i);var r=e.write(t,n);return r!==i&&(e=e.slice(0,r)),e}function VT(e,t){var n=t.length<0?0:FT(t.length)|0;e=Wa(e,n);for(var i=0;i<n;i+=1)e[i]=t[i]&255;return e}function AFe(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),be.TYPED_ARRAY_SUPPORT?(e=t,e.__proto__=be.prototype):e=VT(e,t),e}function zFe(e,t){if(oa(t)){var n=FT(t.length)|0;return e=Wa(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"||n4e(t.length)?Wa(e,0):VT(e,t);if(t.type==="Buffer"&&ZZ(t.data))return VT(e,t.data)}throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}function FT(e){if(e>=o1())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o1().toString(16)+" bytes");return e|0}be.isBuffer=Ur;function oa(e){return!!(e!=null&&e._isBuffer)}be.compare=function(t,n){if(!oa(t)||!oa(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},be.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}},be.concat=function(t,n){if(!ZZ(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return be.alloc(0);var i;if(n===void 0)for(n=0,i=0;i<t.length;++i)n+=t[i].length;var r=be.allocUnsafe(n),o=0;for(i=0;i<t.length;++i){var s=t[i];if(!oa(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(r,o),o+=s.length}return r};function WZ(e,t){if(oa(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 c1(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n*2;case"hex":return n>>>1;case"base64":return $Z(e).length;default:if(i)return c1(e).length;t=(""+t).toLowerCase(),i=!0}}be.byteLength=WZ;function NFe(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 jFe(this,t,n);case"utf8":case"utf-8":return jZ(this,t,n);case"ascii":return YFe(this,t,n);case"latin1":case"binary":return HFe(this,t,n);case"base64":return WFe(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return KFe(this,t,n);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}be.prototype._isBuffer=!0;function iu(e,t,n){var i=e[t];e[t]=e[n],e[n]=i}be.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)iu(this,n,n+1);return this},be.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)iu(this,n,n+3),iu(this,n+1,n+2);return this},be.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)iu(this,n,n+7),iu(this,n+1,n+6),iu(this,n+2,n+5),iu(this,n+3,n+4);return this},be.prototype.toString=function(){var t=this.length|0;return t===0?"":arguments.length===0?jZ(this,0,t):NFe.apply(this,arguments)},be.prototype.equals=function(t){if(!oa(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:be.compare(this,t)===0},be.prototype.inspect=function(){var t="",n=GFe;return this.length>0&&(t=this.toString("hex",0,n).match(/.{2}/g).join(" "),this.length>n&&(t+=" ... ")),"<Buffer "+t+">"},be.prototype.compare=function(t,n,i,r,o){if(!oa(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 BZ(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=be.from(t,i)),oa(t))return t.length===0?-1:YZ(e,t,n,i,r);if(typeof t=="number")return t=t&255,be.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):YZ(e,[t],n,i,r);throw new TypeError("val must be string, number or Buffer")}function YZ(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}be.prototype.includes=function(t,n,i){return this.indexOf(t,n,i)!==-1},be.prototype.indexOf=function(t,n,i){return BZ(this,t,n,i,!0)},be.prototype.lastIndexOf=function(t,n,i){return BZ(this,t,n,i,!1)};function kFe(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 XFe(e,t,n,i){return l1(c1(t,e.length-n),e,n,i)}function HZ(e,t,n,i){return l1(e4e(t),e,n,i)}function ZFe(e,t,n,i){return HZ(e,t,n,i)}function DFe(e,t,n,i){return l1($Z(t),e,n,i)}function UFe(e,t,n,i){return l1(t4e(t,e.length-n),e,n,i)}be.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 kFe(this,t,n,i);case"utf8":case"utf-8":return XFe(this,t,n,i);case"ascii":return HZ(this,t,n,i);case"latin1":case"binary":return ZFe(this,t,n,i);case"base64":return DFe(this,t,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return UFe(this,t,n,i);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},be.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function WFe(e,t,n){return t===0&&n===e.length?kZ(e):kZ(e.slice(t,n))}function jZ(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 BFe(i)}var KZ=4096;function BFe(e){var t=e.length;if(t<=KZ)return String.fromCharCode.apply(String,e);for(var n="",i=0;i<t;)n+=String.fromCharCode.apply(String,e.slice(i,i+=KZ));return n}function YFe(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 HFe(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 jFe(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+=$Fe(e[o]);return r}function KFe(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}be.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(be.TYPED_ARRAY_SUPPORT)r=this.subarray(t,n),r.__proto__=be.prototype;else{var o=n-t;r=new be(o,void 0);for(var s=0;s<o;++s)r[s]=this[s+t]}return r};function Ri(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")}be.prototype.readUIntLE=function(t,n,i){t=t|0,n=n|0,i||Ri(t,n,this.length);for(var r=this[t],o=1,s=0;++s<n&&(o*=256);)r+=this[t+s]*o;return r},be.prototype.readUIntBE=function(t,n,i){t=t|0,n=n|0,i||Ri(t,n,this.length);for(var r=this[t+--n],o=1;n>0&&(o*=256);)r+=this[t+--n]*o;return r},be.prototype.readUInt8=function(t,n){return n||Ri(t,1,this.length),this[t]},be.prototype.readUInt16LE=function(t,n){return n||Ri(t,2,this.length),this[t]|this[t+1]<<8},be.prototype.readUInt16BE=function(t,n){return n||Ri(t,2,this.length),this[t]<<8|this[t+1]},be.prototype.readUInt32LE=function(t,n){return n||Ri(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},be.prototype.readUInt32BE=function(t,n){return n||Ri(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},be.prototype.readIntLE=function(t,n,i){t=t|0,n=n|0,i||Ri(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},be.prototype.readIntBE=function(t,n,i){t=t|0,n=n|0,i||Ri(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},be.prototype.readInt8=function(t,n){return n||Ri(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},be.prototype.readInt16LE=function(t,n){n||Ri(t,2,this.length);var i=this[t]|this[t+1]<<8;return i&32768?i|4294901760:i},be.prototype.readInt16BE=function(t,n){n||Ri(t,2,this.length);var i=this[t+1]|this[t]<<8;return i&32768?i|4294901760:i},be.prototype.readInt32LE=function(t,n){return n||Ri(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},be.prototype.readInt32BE=function(t,n){return n||Ri(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},be.prototype.readFloatLE=function(t,n){return n||Ri(t,4,this.length),r1(this,t,!0,23,4)},be.prototype.readFloatBE=function(t,n){return n||Ri(t,4,this.length),r1(this,t,!1,23,4)},be.prototype.readDoubleLE=function(t,n){return n||Ri(t,8,this.length),r1(this,t,!0,52,8)},be.prototype.readDoubleBE=function(t,n){return n||Ri(t,8,this.length),r1(this,t,!1,52,8)};function Dr(e,t,n,i,r,o){if(!oa(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")}be.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;Dr(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},be.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;Dr(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},be.prototype.writeUInt8=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,1,255,0),be.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[n]=t&255,n+1};function s1(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}be.prototype.writeUInt16LE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,2,65535,0),be.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):s1(this,t,n,!0),n+2},be.prototype.writeUInt16BE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,2,65535,0),be.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):s1(this,t,n,!1),n+2};function a1(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}be.prototype.writeUInt32LE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,4,4294967295,0),be.TYPED_ARRAY_SUPPORT?(this[n+3]=t>>>24,this[n+2]=t>>>16,this[n+1]=t>>>8,this[n]=t&255):a1(this,t,n,!0),n+4},be.prototype.writeUInt32BE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,4,4294967295,0),be.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):a1(this,t,n,!1),n+4},be.prototype.writeIntLE=function(t,n,i,r){if(t=+t,n=n|0,!r){var o=Math.pow(2,8*i-1);Dr(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},be.prototype.writeIntBE=function(t,n,i,r){if(t=+t,n=n|0,!r){var o=Math.pow(2,8*i-1);Dr(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},be.prototype.writeInt8=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,1,127,-128),be.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[n]=t&255,n+1},be.prototype.writeInt16LE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,2,32767,-32768),be.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8):s1(this,t,n,!0),n+2},be.prototype.writeInt16BE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,2,32767,-32768),be.TYPED_ARRAY_SUPPORT?(this[n]=t>>>8,this[n+1]=t&255):s1(this,t,n,!1),n+2},be.prototype.writeInt32LE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,4,2147483647,-2147483648),be.TYPED_ARRAY_SUPPORT?(this[n]=t&255,this[n+1]=t>>>8,this[n+2]=t>>>16,this[n+3]=t>>>24):a1(this,t,n,!0),n+4},be.prototype.writeInt32BE=function(t,n,i){return t=+t,n=n|0,i||Dr(this,t,n,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),be.TYPED_ARRAY_SUPPORT?(this[n]=t>>>24,this[n+1]=t>>>16,this[n+2]=t>>>8,this[n+3]=t&255):a1(this,t,n,!1),n+4};function JZ(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 QZ(e,t,n,i,r){return r||JZ(e,t,n,4),XZ(e,t,n,i,23,4),n+4}be.prototype.writeFloatLE=function(t,n,i){return QZ(this,t,n,!0,i)},be.prototype.writeFloatBE=function(t,n,i){return QZ(this,t,n,!1,i)};function qZ(e,t,n,i,r){return r||JZ(e,t,n,8),XZ(e,t,n,i,52,8),n+8}be.prototype.writeDoubleLE=function(t,n,i){return qZ(this,t,n,!0,i)},be.prototype.writeDoubleBE=function(t,n,i){return qZ(this,t,n,!1,i)},be.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||!be.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},be.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"&&!be.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=oa(t)?t:c1(new be(t,r).toString()),c=a.length;for(s=0;s<i-n;++s)this[s+n]=a[s%c]}return this};var JFe=/[^+\/0-9A-Za-z-_]/g;function QFe(e){if(e=qFe(e).replace(JFe,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}function qFe(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}function $Fe(e){return e<16?"0"+e.toString(16):e.toString(16)}function c1(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 e4e(e){for(var t=[],n=0;n<e.length;++n)t.push(e.charCodeAt(n)&255);return t}function t4e(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 $Z(e){return MFe(QFe(e))}function l1(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 n4e(e){return e!==e}function Ur(e){return e!=null&&(!!e._isBuffer||eD(e)||i4e(e))}function eD(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}function i4e(e){return typeof e.readFloatLE=="function"&&typeof e.slice=="function"&&eD(e.slice(0,0))}var AT;function jc(){}jc.prototype=Object.create(null);function Ut(){Ut.init.call(this)}Ut.EventEmitter=Ut,Ut.usingDomains=!1,Ut.prototype.domain=void 0,Ut.prototype._events=void 0,Ut.prototype._maxListeners=void 0,Ut.defaultMaxListeners=10,Ut.init=function(){this.domain=null,Ut.usingDomains&&AT.active&&!(this instanceof AT.Domain)&&(this.domain=AT.active),(!this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=new jc,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Ut.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 tD(e){return e._maxListeners===void 0?Ut.defaultMaxListeners:e._maxListeners}Ut.prototype.getMaxListeners=function(){return tD(this)};function r4e(e,t,n){if(t)e.call(n);else for(var i=e.length,r=R0(e,i),o=0;o<i;++o)r[o].call(n)}function o4e(e,t,n,i){if(t)e.call(n,i);else for(var r=e.length,o=R0(e,r),s=0;s<r;++s)o[s].call(n,i)}function s4e(e,t,n,i,r){if(t)e.call(n,i,r);else for(var o=e.length,s=R0(e,o),a=0;a<o;++a)s[a].call(n,i,r)}function a4e(e,t,n,i,r,o){if(t)e.call(n,i,r,o);else for(var s=e.length,a=R0(e,s),c=0;c<s;++c)a[c].call(n,i,r,o)}function c4e(e,t,n,i){if(t)e.apply(n,i);else for(var r=e.length,o=R0(e,r),s=0;s<r;++s)o[s].apply(n,i)}Ut.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:r4e(i,h,this);break;case 2:o4e(i,h,this,arguments[1]);break;case 3:s4e(i,h,this,arguments[1],arguments[2]);break;case 4:a4e(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];c4e(i,h,this,o)}return!0};function nD(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 jc,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=tD(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,l4e(a)}return e}function l4e(e){typeof console.warn=="function"?console.warn(e):console.log(e)}Ut.prototype.addListener=function(t,n){return nD(this,t,n,!1)},Ut.prototype.on=Ut.prototype.addListener,Ut.prototype.prependListener=function(t,n){return nD(this,t,n,!0)};function iD(e,t,n){var i=!1;function r(){e.removeListener(t,r),i||(i=!0,n.apply(e,arguments))}return r.listener=n,r}Ut.prototype.once=function(t,n){if(typeof n!="function")throw new TypeError('"listener" argument must be a function');return this.on(t,iD(this,t,n)),this},Ut.prototype.prependOnceListener=function(t,n){if(typeof n!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(t,iD(this,t,n)),this},Ut.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 jc:(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 jc,this;delete r[t]}else u4e(i,o);r.removeListener&&this.emit("removeListener",t,a||n)}return this},Ut.prototype.removeAllListeners=function(t){var n,i;if(i=this._events,!i)return this;if(!i.removeListener)return arguments.length===0?(this._events=new jc,this._eventsCount=0):i[t]&&(--this._eventsCount===0?this._events=new jc: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 jc,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},Ut.prototype.listeners=function(t){var n,i,r=this._events;return r?(n=r[t],n?typeof n=="function"?i=[n.listener||n]:i=h4e(n):i=[]):i=[],i},Ut.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):rD.call(e,t)},Ut.prototype.listenerCount=rD;function rD(e){var t=this._events;if(t){var n=t[e];if(typeof n=="function")return 1;if(n)return n.length}return 0}Ut.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};function u4e(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 R0(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}function h4e(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}function oD(){throw new Error("setTimeout has not been defined")}function sD(){throw new Error("clearTimeout has not been defined")}var Kc=oD,Jc=sD;typeof ad.setTimeout=="function"&&(Kc=setTimeout),typeof ad.clearTimeout=="function"&&(Jc=clearTimeout);function aD(e){if(Kc===setTimeout)return setTimeout(e,0);if((Kc===oD||!Kc)&&setTimeout)return Kc=setTimeout,setTimeout(e,0);try{return Kc(e,0)}catch{try{return Kc.call(null,e,0)}catch{return Kc.call(this,e,0)}}}function d4e(e){if(Jc===clearTimeout)return clearTimeout(e);if((Jc===sD||!Jc)&&clearTimeout)return Jc=clearTimeout,clearTimeout(e);try{return Jc(e)}catch{try{return Jc.call(null,e)}catch{return Jc.call(this,e)}}}var Ba=[],cd=!1,ru,u1=-1;function f4e(){!cd||!ru||(cd=!1,ru.length?Ba=ru.concat(Ba):u1=-1,Ba.length&&cD())}function cD(){if(!cd){var e=aD(f4e);cd=!0;for(var t=Ba.length;t;){for(ru=Ba,Ba=[];++u1<t;)ru&&ru[u1].run();u1=-1,t=Ba.length}ru=null,cd=!1,d4e(e)}}function zo(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];Ba.push(new lD(e,t)),Ba.length===1&&!cd&&aD(cD)}function lD(e,t){this.fun=e,this.array=t}lD.prototype.run=function(){this.fun.apply(null,this.array)};var p4e={},I0=ad.performance||{};I0.now||I0.mozNow||I0.msNow||I0.oNow||I0.webkitNow;var h1={env:p4e},zT;typeof Object.create=="function"?zT=function(t,n){t.super_=n,t.prototype=Object.create(n.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:zT=function(t,n){t.super_=n;var i=function(){};i.prototype=n.prototype,t.prototype=new i,t.prototype.constructor=t};var ld=zT,m4e=/%[sdj%]/g;function g4e(e){if(!DT(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(m4e,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])ZT(s)||!M0(s)?o+=" "+s:o+=" "+Qc(s);return o}function uD(e,t){if(qc(ad.process))return function(){return uD(e,t).apply(this,arguments)};if(h1.noDeprecation===!0)return e;var n=!1;function i(){if(!n){if(h1.throwDeprecation)throw new Error(t);h1.traceDeprecation?console.trace(t):console.error(t),n=!0}return e.apply(this,arguments)}return i}var d1={},NT;function y4e(e){if(qc(NT)&&(NT=h1.env.NODE_DEBUG||""),e=e.toUpperCase(),!d1[e])if(new RegExp("\\b"+e+"\\b","i").test(NT)){var t=0;d1[e]=function(){var n=g4e.apply(null,arguments);console.error("%s %d: %s",e,t,n)}}else d1[e]=function(){};return d1[e]}function Qc(e,t){var n={seen:[],stylize:_4e};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),hD(t)?n.showHidden=t:t&&C4e(n,t),qc(n.showHidden)&&(n.showHidden=!1),qc(n.depth)&&(n.depth=2),qc(n.colors)&&(n.colors=!1),qc(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=b4e),f1(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 b4e(e,t){var n=Qc.styles[t];return n?"\x1B["+Qc.colors[n][0]+"m"+e+"\x1B["+Qc.colors[n][1]+"m":e}function _4e(e,t){return e}function v4e(e){var t={};return e.forEach(function(n,i){t[n]=!0}),t}function f1(e,t,n){if(e.customInspect&&t&&BT(t.inspect)&&t.inspect!==Qc&&!(t.constructor&&t.constructor.prototype===t)){var i=t.inspect(n,e);return DT(i)||(i=f1(e,i,n)),i}var r=w4e(e,t);if(r)return r;var o=Object.keys(t),s=v4e(o);if(e.showHidden&&(o=Object.getOwnPropertyNames(t)),WT(t)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return kT(t);if(o.length===0){if(BT(t)){var a=t.name?": "+t.name:"";return e.stylize("[Function"+a+"]","special")}if(UT(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(dD(t))return e.stylize(Date.prototype.toString.call(t),"date");if(WT(t))return kT(t)}var c="",l=!1,u=["{","}"];if(E4e(t)&&(l=!0,u=["[","]"]),BT(t)){var h=t.name?": "+t.name:"";c=" [Function"+h+"]"}if(UT(t)&&(c=" "+RegExp.prototype.toString.call(t)),dD(t)&&(c=" "+Date.prototype.toUTCString.call(t)),WT(t)&&(c=" "+kT(t)),o.length===0&&(!l||t.length==0))return u[0]+c+u[1];if(n<0)return UT(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special");e.seen.push(t);var d;return l?d=x4e(e,t,n,s,o):d=o.map(function(f){return XT(e,t,n,s,f,l)}),e.seen.pop(),S4e(d,c,u)}function w4e(e,t){if(qc(t))return e.stylize("undefined","undefined");if(DT(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(T4e(t))return e.stylize(""+t,"number");if(hD(t))return e.stylize(""+t,"boolean");if(ZT(t))return e.stylize("null","null")}function kT(e){return"["+Error.prototype.toString.call(e)+"]"}function x4e(e,t,n,i,r){for(var o=[],s=0,a=t.length;s<a;++s)fD(t,String(s))?o.push(XT(e,t,n,i,String(s),!0)):o.push("");return r.forEach(function(c){c.match(/^\d+$/)||o.push(XT(e,t,n,i,c,!0))}),o}function XT(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")),fD(i,r)||(s="["+r+"]"),a||(e.seen.indexOf(c.value)<0?(ZT(n)?a=f1(e,c.value,null):a=f1(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,6 +1,6 @@
1
1
  {
2
2
  "name": "@reearth/core",
3
- "version": "0.0.7-alpha.58",
3
+ "version": "0.0.7-alpha.59",
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.",
@@ -246,7 +246,7 @@ const Cesium: React.ForwardRefRenderFunction<EngineRef, EngineProps> = (
246
246
  light={sceneLight}
247
247
  mode={sceneMode}
248
248
  msaaSamples={sceneMsaaSamples}
249
- useDepthPicking={false}
249
+ useDepthPicking={true}
250
250
  useWebVR={!!property?.scene?.vr || undefined} // NOTE: useWebVR={false} will crash Cesium
251
251
  debugShowFramesPerSecond={!!property?.debug?.showFramesPerSecond}
252
252
  verticalExaggerationRelativeHeight={property?.scene?.verticalExaggerationRelativeHeight}