dsh-code-server-app 0.2.1 → 0.2.2

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/README.en.md CHANGED
@@ -21,10 +21,47 @@ A static profile plugin (npm package with host + client bundle) that ships the *
21
21
 
22
22
  - Detection: `ctx.inject(['sidebarRightTabs','sidebarRight'], …)` registers the tab type only when the services are ready; if they never appear (or registration fails) nothing is registered and the floating ball fallback stays in place. No version comparison, and the plugin's own activation is never blocked.
23
23
  - The sidebar tab hosts the code-server page (iframe) and follows the current session workspace; the panel can be collapsed/split/floated/fullscreened by DSH's right sidebar.
24
- - **Known trade-off**: DSH renders only the active tab's body, so switching away and back remounts the iframe (a full code-server reload; unsaved editor buffers are lost). Float the tab into its own panel or keep it active for long-running sessions.
24
+ - **Resident IDE (0.2.2, on by default)**: switching to another tab or collapsing the sidebar and coming back **no longer reloads** code-server unsaved editor buffers, terminals and debug sessions all stay put (see "Why switching tabs no longer reloads" below).
25
25
  - In sidebar mode the settings card hides "Reserve space above the composer" (floating-window geometry only). "Open in a window (new tab)" still applies to every entry point.
26
26
  - `windowedOpen` has the highest priority: when on, entry buttons always open a browser tab.
27
27
 
28
+ ## Why switching tabs no longer reloads (resident IDE)
29
+
30
+ **The old trap**: DSH's right sidebar (ui-dockkit) renders **only the active tab's body**
31
+ (`TabPanel.tsx:412` → `renderTab(active)`) — switching to another tab unmounts that body in React, which moves the
32
+ iframe out of the document and destroys its browsing context; switching back is a full VS Code reload (unsaved buffers
33
+ lost). Floating the tab into its own panel only worked around it.
34
+
35
+ **What it does now (`src/surface.js` in the client, 0.2.2)**: the plugin takes the iframe **away from React** and turns
36
+ it into a **singleton resident surface**:
37
+
38
+ | Situation | Action | Result |
39
+ |---|---|---|
40
+ | tab becomes active | `host.moveBefore(frame, null)` into the visible dock slot | state-preserving atomic move, **no reload** |
41
+ | tab deactivates / sidebar collapses | move back into a document-level park container (offscreen, keeps last docked size, `inert` + `aria-hidden`) | never destroyed, keeps running in the background |
42
+ | workspace / port changes | assign `src` explicitly | the only normal "reload" entry point |
43
+
44
+ - **Why `moveBefore`**: measured in a real browser (Edge/Chromium 151), a plain `appendChild` move resets the iframe's
45
+ internal timers (i.e. reloads it), while `Element.moveBefore()` (Chromium ≥133) preserves state (a probe counter keeps
46
+ counting 1→2).
47
+ - **Degradation is never silent**: when `moveBefore` is missing, or the host was already detached by React and it throws
48
+ `HierarchyRequestError: invalid hierarchy` (passive effect cleanup runs after DOM removal), the code falls back to
49
+ `appendChild` — one reload, but the frame is **never lost** — and reports `degraded` / `lastMoveError` so the UI can
50
+ say "residency unavailable".
51
+ - **Repaint fix (measured)**: after a long offscreen park, a moved-back cross-origin iframe had correct size, hit
52
+ testing and `visibility`, yet **stopped repainting** (a fully white panel that several tab switches did not fix).
53
+ `translateZ(0)` and `opacity` nudges did nothing; `display:none → forced reflow → restore` inside a single JS task
54
+ revives it without reloading the iframe document, without losing internal state and without a visible flash. Every
55
+ park→dock transition therefore runs one `nudgeRepaint()` (counted as `surfaceSnapshot().nudgeCount` for debugging).
56
+ - **Warm-up**: with `keepResident` (default `true`) the host builds the surface right after plugin start and leaves it
57
+ parked, so the first tab open needs no cold start; preloading never yanks a surface that is currently docked.
58
+ - **Debug handle**: `window.__dshcsSurface` (`snapshot()`, `setParkStrategy('offscreen'|'behind')`, `dock()`, `park()`,
59
+ `nudge()`, `setNudgeEnabled(false)`, `destroy()`).
60
+
61
+ **Measured** (DSH web GUI, real mouse clicks between sidebar tabs): switching away → `docked:false`, same iframe node,
62
+ in-frame probe still alive, `degraded:false`; switching back → `docked:true`, unchanged `src`, IDE pixels and editing
63
+ state preserved (no full reload). Full evidence and probe scripts: `docs/analysis-code-server-as-dsh-plugin.md`.
64
+
28
65
  ## Serving mode (`serve`)
29
66
 
30
67
  | Mode | What it does | Requires |
@@ -353,7 +390,10 @@ so users cannot remove it from the extensions panel.
353
390
  escapable by the frame itself); in `loopback` mode the iframe is cross-origin and `sandbox` stays as real protection.
354
391
  - **Single instance across sessions**: one shared IDE per host; switching cwd requires a restart (the sidebar tab /
355
392
  floating window handles it and hints).
356
- - **Sidebar tab switching reloads**: DSH's right sidebar renders only the active tab's body, so switching away and back
357
- remounts the iframe (a full VS Code reload); keep the tab active or float it for long-running sessions.
393
+ - **Sidebar tab switching** (no longer reloads since 0.2.2): DSH's right sidebar renders only the active tab's body, and
394
+ a React unmount moves the iframe away; the plugin keeps it as a singleton resident surface and shuttles it between the
395
+ dock slot and a document-level park container with `Element.moveBefore()` (a state-preserving atomic move), so
396
+ switching tabs or collapsing the sidebar and back **does not reload** it. Browsers without `moveBefore` fall back to
397
+ the old behaviour (`appendChild` → full reload), reported as `degraded`; see "Why switching tabs no longer reloads".
358
398
  - **Remote access**: with `serve: dsh` the browser only needs to reach DSH itself (one port, protected exactly like `/api`);
359
399
  `serve: loopback` stays loopback-only with `auth: none`, and 0.2.0 no longer supports `auth: password`.
package/README.md CHANGED
@@ -32,12 +32,45 @@
32
32
  - 检测方式:`ctx.inject(['sidebarRightTabs','sidebarRight'], …)`——服务就绪才注册标签类型;
33
33
  服务缺失/注册失败则整段不生效,自动回退悬浮球(不按版本号硬判,也不影响插件激活)。
34
34
  - 侧栏标签内即 code-server 页面(iframe),跟随当前会话工作区;面板可折叠/分屏/浮动/全屏(由 DSH 右侧栏提供)。
35
- - **已知取舍**:DSH 只渲染「当前激活标签」的 body,切到别的标签再切回会重挂 iframe
36
- (code-server 整页重载,未保存的编辑缓冲区会丢);需要长驻会话时请把该标签**浮动**出来或保持激活。
35
+ - **IDE 常驻(0.2.2 起,默认开)**:切到别的标签/收起侧栏再回来**不再重载** code-server——
36
+ 未保存的编辑缓冲区、终端、调试会话都留在原处(见下方「为什么切标签不再重载」)
37
37
  - 设置卡片在侧栏模式下隐藏「保留输入框上方空间」(只对浮窗有意义);
38
38
  「窗口化打开(新标签页)」仍然生效(开启后各入口改为浏览器新标签页打开)。
39
39
  - `windowedOpen` 优先级最高:开启时入口按钮一律新开浏览器标签页。
40
40
 
41
+ ## 为什么切标签不再重载(IDE 常驻)
42
+
43
+ **过去的坑**:DSH 的右侧栏(ui-dockkit)`TabPanel` **只渲染当前激活标签的 body**
44
+ (`TabPanel.tsx:412` → `renderTab(active)`)——切到别的标签 = React 卸载该 body = iframe 被移出文档 =
45
+ 浏览上下文销毁,切回来就是一次完整的 VS Code 重载(未保存的缓冲区丢失)。把标签浮动成独立面板只是绕开它,
46
+ 并没有解决。
47
+
48
+ **现在的做法(客户端 `src/surface.js`,0.2.2)**:插件把 iframe **从 React 手里接管**,做成**单例常驻面**:
49
+
50
+ | 场景 | 动作 | 结果 |
51
+ |---|---|---|
52
+ | 标签激活 | `host.moveBefore(frame, null)` 移进当前可见的停靠位 | 状态保持型原子移动,**不重载** |
53
+ | 标签失活 / 收起侧栏 | 移回文档级 park 容器(离屏、保留最后停靠尺寸、`inert` + `aria-hidden`) | 面不销毁,后台继续跑 |
54
+ | 工作区 / 端口变化 | 显式设置 `src` | 这是唯一正常的"重载"入口 |
55
+
56
+ - **为什么是 `moveBefore`**:浏览器实测(Edge/Chromium 151)普通 `appendChild` 移动 iframe 会让内部计时器**归零**
57
+ (等价重载),而 `Element.moveBefore()`(Chromium ≥133)保持状态(计时器 1→2 连续)。
58
+ - **降级不静默**:`moveBefore` 缺失、或宿主已被 React 摘除而抛 `HierarchyRequestError: invalid hierarchy`
59
+ (passive effect cleanup 晚于 DOM 卸载)时,退回 `appendChild`——会重载一次,但**绝不丢帧**;
60
+ 状态里 `degraded`/`lastMoveError` 明示,界面据此提示"常驻不可用"。
61
+ - **重绘修复(实测坑)**:跨源 iframe 离屏停放较久后被移回,元素尺寸、命中测试、`visibility` 全部正常,
62
+ 但**画面不再重绘**(面板一片白,多切几次标签也不恢复)。`translateZ(0)`、`opacity` 微调都无效;
63
+ `display:none → 强制重排 → 还原`(同一个 JS 任务内)可唤醒,且 iframe 文档不重载、内部状态不变、无可见闪烁。
64
+ 因此每次「停放 → 停靠」都补一次 `nudgeRepaint()`(`surfaceSnapshot().nudgeCount` 计数,便于排障)。
65
+ - **后台预热**:配置 `keepResident`(默认 `true`)时,宿主在插件启动后就把面建好并停在停放区,
66
+ 首次点开标签无需冷启动等待;`preload` 不会把正在使用的面拽走。
67
+ - **排障句柄**:控制台可用 `window.__dshcsSurface`(`snapshot()` / `setParkStrategy('offscreen'|'behind')` /
68
+ `dock()` / `park()` / `nudge()` / `setNudgeEnabled(false)` / `destroy()`)。
69
+
70
+ **实测记录**(DSH web GUI,sidebar 标签间真实鼠标切换):切走 → `docked:false`、iframe 仍为同一节点、内部探针存活、
71
+ `degraded:false`;切回 → `docked:true`、`src` 不变、IDE 画面与编辑状态保持(无整页重载)。
72
+ 完整证据与探针脚本见 `docs/analysis-code-server-as-dsh-plugin.md`。
73
+
41
74
  ## 服务方式(serve)
42
75
 
43
76
  | 方式 | 说明 | 需要 |
@@ -359,8 +392,10 @@ desktop profile 由 `apps/desktop-host` 把 `/api/*` 交给同一个 `createShar
359
392
  - **`serve: dsh` 的 iframe 与 DSH 同源** → 该模式不挂 `sandbox`(同源 + `allow-same-origin` 可被 frame 自行摘除);
360
393
  `loopback` 模式跨源,`sandbox` 作为真防护保留。
361
394
  - **跨会话单实例**:host 级共享一份 IDE;切换 cwd 需重启实例(右侧栏标签/浮窗自动处理并提示)。
362
- - **侧栏标签切换重载**:DSH 右侧栏只渲染当前激活标签的 body,切走再切回会重挂 iframe(VS Code 整页重载);
363
- 长驻会话请保持该标签激活或将其浮动为独立面板。
395
+ - **侧栏标签切换**(0.2.2 起不再重载):DSH 右侧栏只渲染当前激活标签的 body,React 卸载会移走 iframe;
396
+ 插件把 iframe 收成单例常驻面,用 `Element.moveBefore()`(状态保持型原子移动)在停靠位与文档级停放区之间搬,
397
+ 切标签/收起侧栏再回来**不重载**。不支持 `moveBefore` 的浏览器退回旧行为(`appendChild` → 整页重载),
398
+ 状态里以 `degraded` 明示;详见下方「为什么切标签不再重载」。
364
399
  - **远程访问**:`serve: dsh` 下浏览器只需能到达 DSH 本身(单一端口,认证与 `/api` 同级);
365
400
  `serve: loopback` 默认仅回环、`auth: none`,跨机访问请改用 `serve: dsh`
366
401
  (0.2.0 起不再支持 `auth: password`)。
package/lib/client.js CHANGED
@@ -1,4 +1,4 @@
1
1
  window.__ModuleLoader__.load({id:'dsh-code-server-app',factory:function(require){var module={exports:{}};var exports=module.exports;
2
- var wi=Object.defineProperty;var Cc=Object.getOwnPropertyDescriptor;var Pc=Object.getOwnPropertyNames;var Ec=Object.prototype.hasOwnProperty;var Mc=(e,t)=>{for(var r in t)wi(e,r,{get:t[r],enumerable:!0})},Ac=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Pc(t))!Ec.call(e,i)&&i!==r&&wi(e,i,{get:()=>t[i],enumerable:!(n=Cc(t,i))||n.enumerable});return e};var Dc=e=>Ac(wi({},"__esModule",{value:!0}),e);var Um={};Mc(Um,{apply:()=>jm,inject:()=>Gm,name:()=>Wm});module.exports=Dc(Um);var Zo=require("react"),Wr=(0,Zo.createContext)({});var Jo=require("react");function Qo(e){let t=(0,Jo.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Ur=require("react");var es=typeof window!="undefined";var ts=es?Ur.useLayoutEffect:Ur.useEffect;var rs=require("react"),wt=(0,rs.createContext)(null);function rt(e,t){e.indexOf(t)===-1&&e.push(t)}function ze(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}var $=(e,t,r)=>r>t?t:r<e?e:r;var Re=()=>{},se=()=>{};var ne={};var Yt=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var $t=e=>typeof e=="object"&&e!==null;var Xt=e=>/^0[^.\s]+$/u.test(e);function qt(e){let t;return()=>(t===void 0&&(t=e()),t)}var j=e=>e;var ve=(...e)=>e.reduce((t,r)=>n=>r(t(n)));var Te=(e,t,r)=>{let n=t-e;return n?(r-e)/n:1};var ke=class{constructor(){this.subscriptions=[]}add(t){return rt(this.subscriptions,t),()=>ze(this.subscriptions,t)}notify(t,r,n){let i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,r,n);else for(let s=0;s<i;s++){let o=this.subscriptions[s];o&&o(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};var U=e=>e*1e3,Z=e=>e/1e3;var Zt=(e,t)=>t?e*(1e3/t):0;var ns=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Rc=1e-7,kc=12;function Lc(e,t,r,n,i){let s,o,a=0;do o=t+(r-t)/2,s=ns(o,n,i)-e,s>0?r=o:t=o;while(Math.abs(s)>Rc&&++a<kc);return o}function Ge(e,t,r,n){if(e===t&&r===n)return j;let i=s=>Lc(s,0,1,e,r);return s=>s===0||s===1?s:ns(i(s),t,n)}var Hr=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var Kr=e=>t=>1-e(1-t);var _r=Ge(.33,1.53,.69,.99),Tt=Kr(_r),Jt=Hr(Tt);var Qt=e=>e>=1?1:(e*=2)<1?.5*Tt(e):.5*(2-Math.pow(2,-10*(e-1)));var er=e=>1-Math.sin(Math.acos(e)),tr=Kr(er),rr=Hr(er);var Ti=Ge(.42,0,1,1),Si=Ge(0,0,.58,1),nr=Ge(.42,0,.58,1);var Vi=e=>Array.isArray(e)&&typeof e[0]!="number";var ir=e=>Array.isArray(e)&&typeof e[0]=="number";var is={linear:j,easeIn:Ti,easeInOut:nr,easeOut:Si,circIn:er,circInOut:rr,circOut:tr,backIn:Tt,backInOut:Jt,backOut:_r,anticipate:Qt},Ic=e=>typeof e=="string",Yr=e=>{if(ir(e)){se(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,r,n,i]=e;return Ge(t,r,n,i)}else if(Ic(e))return se(is[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),is[e];return e};var or=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function os(e){let t=new Set,r=new Set,n=!1,i=!1,s=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function a(u){s.has(u)&&(c.schedule(u),e()),u(o)}let c={schedule:(u,l=!1,f=!1)=>{let d=f&&n?t:r;return l&&s.add(u),d.add(u),u},cancel:u=>{r.delete(u),s.delete(u)},process:u=>{if(o=u,n){i=!0;return}n=!0;let l=t;t=r,r=l,t.forEach(a),t.clear(),n=!1,i&&(i=!1,c.process(u))}};return c}var Oc=40;function $r(e,t){let r=!1,n=!0,i={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,o=or.reduce((w,g)=>(w[g]=os(s),w),{}),{setup:a,read:c,resolveKeyframes:u,preUpdate:l,update:f,preRender:m,render:d,postRender:p}=o,x=()=>{let w=ne.useManualTiming,g=w?i.timestamp:performance.now();r=!1,w||(i.delta=n?1e3/60:Math.max(Math.min(g-i.timestamp,Oc),1)),i.timestamp=g,i.isProcessing=!0,a.process(i),c.process(i),u.process(i),l.process(i),f.process(i),m.process(i),d.process(i),p.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(x))},y=()=>{r=!0,n=!0,i.isProcessing||e(x)};return{schedule:or.reduce((w,g)=>{let S=o[g];return w[g]=(E,A=!1,V=!1)=>(r||y(),S.schedule(E,A,V)),w},{}),cancel:w=>{for(let g=0;g<or.length;g++)o[or[g]].cancel(w)},state:i,steps:o}}var{schedule:P,cancel:ae,state:W,steps:sr}=$r(typeof requestAnimationFrame!="undefined"?requestAnimationFrame:j,!0);var Xr;function Nc(){Xr=void 0}var z={now:()=>(Xr===void 0&&z.set(W.isProcessing||ne.useManualTiming?W.timestamp:performance.now()),Xr),set:e=>{Xr=e,queueMicrotask(Nc)}};var ss=e=>t=>typeof t=="string"&&t.startsWith(e),qr=ss("--"),Bc=ss("var(--"),St=e=>Bc(e)?Fc.test(e.split("/*")[0].trim()):!1,Fc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Ci(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}var Se={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Le={...Se,transform:e=>$(0,1,e)},ar={...Se,default:1};var We=e=>Math.round(e*1e5)/1e5;var Vt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function as(e){return e==null}var ls=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var Ct=(e,t)=>r=>!!(typeof r=="string"&&ls.test(r)&&r.startsWith(e)||t&&!as(r)&&Object.prototype.hasOwnProperty.call(r,t)),Zr=(e,t,r)=>n=>{if(typeof n!="string")return n;let[i,s,o,a]=n.match(Vt);return{[e]:parseFloat(i),[t]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var jc=e=>$(0,255,e),Pi={...Se,transform:e=>Math.round(jc(e))},Ve={test:Ct("rgb","red"),parse:Zr("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+Pi.transform(e)+", "+Pi.transform(t)+", "+Pi.transform(r)+", "+We(Le.transform(n))+")"};function zc(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}var lr={test:Ct("#"),parse:zc,transform:Ve.transform};var cr=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),pe=cr("deg"),te=cr("%"),T=cr("px"),Ei=cr("vh"),Mi=cr("vw"),Jr={...te,parse:e=>te.parse(e)/100,transform:e=>te.transform(e*100)};var Ue={test:Ct("hsl","hue"),parse:Zr("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+te.transform(We(t))+", "+te.transform(We(r))+", "+We(Le.transform(n))+")"};var O={test:e=>Ve.test(e)||lr.test(e)||Ue.test(e),parse:e=>Ve.test(e)?Ve.parse(e):Ue.test(e)?Ue.parse(e):lr.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ve.transform(e):Ue.transform(e),getAnimatableNone:e=>{let t=O.parse(e);return t.alpha=0,O.transform(t)}};var cs=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Gc(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Vt))==null?void 0:t.length)||0)+(((r=e.match(cs))==null?void 0:r.length)||0)>0}var fs="number",ms="color",Wc="var",Uc="var(",us="${}",Hc=/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 He(e){let t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[],s=0,a=t.replace(Hc,c=>(O.test(c)?(n.color.push(s),i.push(ms),r.push(O.parse(c))):c.startsWith(Uc)?(n.var.push(s),i.push(Wc),r.push(c)):(n.number.push(s),i.push(fs),r.push(parseFloat(c))),++s,us)).split(us);return{values:r,split:a,indexes:n,types:i}}function Kc(e){return He(e).values}function ds({split:e,types:t}){let r=e.length;return n=>{let i="";for(let s=0;s<r;s++)if(i+=e[s],n[s]!==void 0){let o=t[s];o===fs?i+=We(n[s]):o===ms?i+=O.transform(n[s]):i+=n[s]}return i}}function _c(e){return ds(He(e))}var Yc=e=>typeof e=="number"?0:O.test(e)?O.getAnimatableNone(e):e,$c=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:Yc(e);function Xc(e){let t=He(e);return ds(t)(t.values.map((n,i)=>$c(n,t.split[i])))}var X={test:Gc,parse:Kc,createTransformer:_c,getAnimatableNone:Xc};function Ai(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function ps({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,s=0,o=0;if(!t)i=s=o=r;else{let a=r<.5?r*(1+t):r+t-r*t,c=2*r-a;i=Ai(c,a,e+1/3),s=Ai(c,a,e),o=Ai(c,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}function Pt(e,t){return r=>r>0?t:e}var M=(e,t,r)=>e+(t-e)*r;var Di=(e,t,r)=>{let n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},qc=[lr,Ve,Ue],Zc=e=>qc.find(t=>t.test(e));function hs(e){let t=Zc(e);if(Re(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let r=t.parse(e);return t===Ue&&(r=ps(r)),r}var Ri=(e,t)=>{let r=hs(e),n=hs(t);if(!r||!n)return Pt(e,t);let i={...r};return s=>(i.red=Di(r.red,n.red,s),i.green=Di(r.green,n.green,s),i.blue=Di(r.blue,n.blue,s),i.alpha=M(r.alpha,n.alpha,s),Ve.transform(i))};var Qr=new Set(["none","hidden"]);function gs(e,t){return Qr.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function Jc(e,t){return r=>M(e,t,r)}function en(e){return typeof e=="number"?Jc:typeof e=="string"?St(e)?Pt:O.test(e)?Ri:tu:Array.isArray(e)?xs:typeof e=="object"?O.test(e)?Ri:Qc:Pt}function xs(e,t){let r=[...e],n=r.length,i=e.map((s,o)=>en(s)(s,t[o]));return s=>{for(let o=0;o<n;o++)r[o]=i[o](s);return r}}function Qc(e,t){let r={...e,...t},n={};for(let i in r)e[i]!==void 0&&t[i]!==void 0&&(n[i]=en(e[i])(e[i],t[i]));return i=>{for(let s in n)r[s]=n[s](i);return r}}function eu(e,t){var i;let r=[],n={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){let o=t.types[s],a=e.indexes[o][n[o]],c=(i=e.values[a])!=null?i:0;r[s]=c,n[o]++}return r}var tu=(e,t)=>{let r=X.createTransformer(t),n=He(e),i=He(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?Qr.has(e)&&!i.values.length||Qr.has(t)&&!n.values.length?gs(e,t):ve(xs(eu(n,i),i.values),r):(Re(!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"),Pt(e,t))};function tn(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?M(e,t,r):en(e)(e,t)}var ys=e=>{let t=({timestamp:r})=>e(r);return{start:(r=!0)=>P.update(t,r),stop:()=>ae(t),now:()=>W.isProcessing?W.timestamp:z.now()}};var rn=(e,t,r=10)=>{let n="",i=Math.max(Math.round(t/r),2);for(let s=0;s<i;s++)n+=Math.round(e(s/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`};function Et(e){let t=0,r=50,n=e.next(t);for(;!n.done&&t<2e4;)t+=r,n=e.next(t);return t>=2e4?1/0:t}function vs(e,t=100,r){let n=r({...e,keyframes:[0,t]}),i=Math.min(Et(n),2e4);return{type:"keyframes",ease:s=>n.next(i*s).value/t,duration:Z(i)}}var G={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};function Ii(e,t){return e*Math.sqrt(1-t*t)}var ru=12;function nu(e,t,r){let n=r;for(let i=1;i<ru;i++)n=n-e(n)/t(n);return n}var Li=.001;function iu({duration:e=G.duration,bounce:t=G.bounce,velocity:r=G.velocity,mass:n=G.mass}){let i,s;Re(e<=U(G.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=$(G.minDamping,G.maxDamping,o),e=$(G.minDuration,G.maxDuration,Z(e)),o<1?(i=u=>{let l=u*o,f=l*e,m=l-r,d=Ii(u,o),p=Math.exp(-f);return Li-m/d*p},s=u=>{let f=u*o*e,m=f*r+r,d=Math.pow(o,2)*Math.pow(u,2)*e,p=Math.exp(-f),x=Ii(Math.pow(u,2),o);return(-i(u)+Li>0?-1:1)*((m-d)*p)/x}):(i=u=>{let l=Math.exp(-u*e),f=(u-r)*e+1;return-Li+l*f},s=u=>{let l=Math.exp(-u*e),f=(r-u)*(e*e);return l*f});let a=5/e,c=nu(i,s,a);if(e=U(e),isNaN(c))return{stiffness:G.stiffness,damping:G.damping,duration:e};{let u=Math.pow(c,2)*n;return{stiffness:u,damping:o*2*Math.sqrt(n*u),duration:e}}}var ou=["duration","bounce"],su=["stiffness","damping","mass"];function bs(e,t){return t.some(r=>e[r]!==void 0)}function au(e){let t={velocity:G.velocity,stiffness:G.stiffness,damping:G.damping,mass:G.mass,isResolvedFromDuration:!1,...e};if(!bs(e,su)&&bs(e,ou))if(t.velocity=0,e.visualDuration){let r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,s=2*$(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:G.mass,stiffness:i,damping:s}}else{let r=iu({...e,velocity:0});t={...t,...r,mass:G.mass},t.isResolvedFromDuration=!0}return t}function Mt(e=G.visualDuration,t=G.bounce){let r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:n,restDelta:i}=r,s=r.keyframes[0],o=r.keyframes[r.keyframes.length-1],a={done:!1,value:s},{stiffness:c,damping:u,mass:l,duration:f,velocity:m,isResolvedFromDuration:d}=au({...r,velocity:-Z(r.velocity||0)}),p=m||0,x=u/(2*Math.sqrt(c*l)),y=o-s,v=Z(Math.sqrt(c/l)),b=Math.abs(y)<5;n||(n=b?G.restSpeed.granular:G.restSpeed.default),i||(i=b?G.restDelta.granular:G.restDelta.default);let w,g,S,E,A,V;if(x<1)S=Ii(v,x),E=(p+x*v*y)/S,w=C=>{let I=Math.exp(-x*v*C);return o-I*(E*Math.sin(S*C)+y*Math.cos(S*C))},A=x*v*E+y*S,V=x*v*y-E*S,g=C=>Math.exp(-x*v*C)*(A*Math.sin(S*C)+V*Math.cos(S*C));else if(x===1){w=I=>o-Math.exp(-v*I)*(y+(p+v*y)*I);let C=p+v*y;g=I=>Math.exp(-v*I)*(v*C*I-p)}else{let C=v*Math.sqrt(x*x-1);w=J=>{let re=Math.exp(-x*v*J),me=Math.min(C*J,300);return o-re*((p+x*v*y)*Math.sinh(me)+C*y*Math.cosh(me))/C};let I=(p+x*v*y)/C,R=x*v*I-y*C,H=x*v*y-I*C;g=J=>{let re=Math.exp(-x*v*J),me=Math.min(C*J,300);return re*(R*Math.sinh(me)+H*Math.cosh(me))}}let L={calculatedDuration:d&&f||null,velocity:C=>U(g(C)),next:C=>{if(!d&&x<1){let R=Math.exp(-x*v*C),H=Math.sin(S*C),J=Math.cos(S*C),re=o-R*(E*H+y*J),me=U(R*(A*H+V*J));return a.done=Math.abs(me)<=n&&Math.abs(o-re)<=i,a.value=a.done?o:re,a}let I=w(C);if(d)a.done=C>=f;else{let R=U(g(C));a.done=Math.abs(R)<=n&&Math.abs(o-I)<=i}return a.value=a.done?o:I,a},toString:()=>{let C=Math.min(Et(L),2e4),I=rn(R=>L.next(C*R).value,C,30);return C+"ms "+I},toTransition:()=>{}};return L}Mt.applyToOptions=e=>{let t=vs(e,100,Mt);return e.ease=t.ease,e.duration=U(t.duration),e.type="keyframes",e};var lu=5;function nn(e,t,r){let n=Math.max(t-lu,0);return Zt(r-e(n),t-n)}function ur({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:c,restDelta:u=.5,restSpeed:l}){let f=e[0],m={done:!1,value:f},d=V=>a!==void 0&&V<a||c!==void 0&&V>c,p=V=>a===void 0?c:c===void 0||Math.abs(a-V)<Math.abs(c-V)?a:c,x=r*t,y=f+x,v=o===void 0?y:o(y);v!==y&&(x=v-f);let b=V=>-x*Math.exp(-V/n),w=V=>v+b(V),g=V=>{let L=b(V),C=w(V);m.done=Math.abs(L)<=u,m.value=m.done?v:C},S,E,A=V=>{d(m.value)&&(S=V,E=Mt({keyframes:[m.value,p(m.value)],velocity:nn(w,V,m.value),damping:i,stiffness:s,restDelta:u,restSpeed:l}))};return A(0),{calculatedDuration:null,next:V=>{let L=!1;return!E&&S===void 0&&(L=!0,g(V),A(V)),S!==void 0&&V>=S?E.next(V-S):(!L&&g(V),m)}}}function cu(e,t,r){let n=[],i=r||ne.mix||tn,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){let c=Array.isArray(t)?t[o]||j:t;a=ve(c,a)}n.push(a)}return n}function ws(e,t,{clamp:r=!0,ease:n,mixer:i}={}){let s=e.length;if(se(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());let a=cu(t,n,i),c=a.length,u=l=>{if(o&&l<e[0])return t[0];let f=0;if(c>1)for(;f<e.length-2&&!(l<e[f+1]);f++);let m=Te(e[f],e[f+1],l);return a[f](m)};return r?l=>u($(e[0],e[s-1],l)):u}function Ts(e,t){let r=e[e.length-1];for(let n=1;n<=t;n++){let i=Te(0,t,n);e.push(M(r,1,i))}}function Ss(e){let t=[0];return Ts(t,e.length-1),t}function Vs(e,t){return e.map(r=>r*t)}function uu(e,t){return e.map(()=>t||nr).splice(0,e.length-1)}function nt({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){let i=Vi(n)?n.map(Yr):Yr(n),s={done:!1,value:t[0]},o=Vs(r&&r.length===t.length?r:Ss(t),e),a=ws(o,t,{ease:Array.isArray(i)?i:uu(t,i)});return{calculatedDuration:e,next:c=>(s.value=a(c),s.done=c>=e,s)}}var fu=e=>e!==null;function Ke(e,{repeat:t,repeatType:r="loop"},n,i=1){let s=e.filter(fu),a=i<0||t&&r!=="loop"&&t%2===1?0:s.length-1;return!a||n===void 0?s[a]:n}var mu={decay:ur,inertia:ur,tween:nt,keyframes:nt,spring:Mt};function on(e){typeof e.type=="string"&&(e.type=mu[e.type])}var _e=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}};var du=e=>e/100,Ie=class extends _e{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var n,i;let{motionValue:r}=this.options;r&&r.updatedAt!==z.now()&&this.tick(z.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){let{options:t}=this;on(t);let{type:r=nt,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t,{keyframes:a}=t,c=r||nt;c!==nt&&typeof a[0]!="number"&&(this.mixKeyframes=ve(du,tn(a[0],a[1])),a=[0,100]);let u=c({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=c({...t,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Et(u));let{calculatedDuration:l}=u;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=u}updateTime(t){let r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){let{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:c}=this;if(this.startTime===null)return n.next(0);let{delay:u=0,keyframes:l,repeat:f,repeatType:m,repeatDelay:d,type:p,onUpdate:x,finalKeyframe:y}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);let v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),b=this.playbackSpeed>=0?v<0:v>i;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,g=n;if(f){let V=Math.min(this.currentTime,i)/a,L=Math.floor(V),C=V%1;!C&&V>=1&&(C=1),C===1&&L--,L=Math.min(L,f+1),!!(L%2)&&(m==="reverse"?(C=1-C,d&&(C-=d/a)):m==="mirror"&&(g=o)),w=$(0,1,C)*a}let S;b?(this.delayState.value=l[0],S=this.delayState):S=g.next(w),s&&!b&&(S.value=s(S.value));let{done:E}=S;!b&&c!==null&&(E=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);let A=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&E);return A&&p!==ur&&(S.value=Ke(l,this.options,y,this.speed)),x&&x(S.value),A&&this.finish(),S}then(t,r){return this.finished.then(t,r)}get duration(){return Z(this.calculatedDuration)}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+Z(t)}get time(){return Z(this.currentTime)}set time(t){t=U(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))}getGeneratorVelocity(){let t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);let r=this.generator.next(t).value;return nn(n=>this.generator.next(n).value,t,r)}get speed(){return this.playbackSpeed}set speed(t){let r=this.playbackSpeed!==t;r&&this.driver&&this.updateTime(z.now()),this.playbackSpeed=t,r&&this.driver&&(this.time=Z(this.currentTime))}play(){var i,s;if(this.isStopped)return;let{driver:t=ys,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);let n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r!=null?r:n),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(z.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.call(t)}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){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}};function Cs(e){var t;for(let r=1;r<e.length;r++)(t=e[r])!=null||(e[r]=e[r-1])}var it=e=>e*180/Math.PI,Oi=e=>{let t=it(Math.atan2(e[1],e[0]));return Ni(t)},pu={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Oi,rotateZ:Oi,skewX:e=>it(Math.atan(e[1])),skewY:e=>it(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Ni=e=>(e=e%360,e<0&&(e+=360),e),Ps=Oi,Es=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ms=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),hu={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Es,scaleY:Ms,scale:e=>(Es(e)+Ms(e))/2,rotateX:e=>Ni(it(Math.atan2(e[6],e[5]))),rotateY:e=>Ni(it(Math.atan2(-e[2],e[0]))),rotateZ:Ps,rotate:Ps,skewX:e=>it(Math.atan(e[4])),skewY:e=>it(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function sn(e){return e.includes("scale")?1:0}function an(e,t){if(!e||e==="none")return sn(t);let r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),n,i;if(r)n=hu,i=r;else{let a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=pu,i=a}if(!i)return sn(t);let s=n[t],o=i[1].split(",").map(gu);return typeof s=="function"?s(o):o[s]}var As=(e,t)=>{let{transform:r="none"}=getComputedStyle(e);return an(r,t)};function gu(e){return parseFloat(e.trim())}var Ce=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],he=new Set([...Ce,"pathRotation"]);var Bi=e=>e===Se||e===T,xu=new Set(["x","y","z"]),yu=Ce.filter(e=>!xu.has(e));function Ds(e){let t=[];return yu.forEach(r=>{let n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}var Oe={width:({x:e},{paddingLeft:t="0",paddingRight:r="0",boxSizing:n})=>{let i=e.max-e.min;return n==="border-box"?i:i-parseFloat(t)-parseFloat(r)},height:({y:e},{paddingTop:t="0",paddingBottom:r="0",boxSizing:n})=>{let i=e.max-e.min;return n==="border-box"?i:i-parseFloat(t)-parseFloat(r)},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})=>an(t,"x"),y:(e,{transform:t})=>an(t,"y")};Oe.translateX=Oe.x;Oe.translateY=Oe.y;var ot=new Set,Fi=!1,ji=!1,zi=!1;function Rs(){if(ji){let e=Array.from(ot).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{let i=Ds(n);i.length&&(r.set(n,i),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();let i=r.get(n);i&&i.forEach(([s,o])=>{var a;(a=n.getValue(s))==null||a.set(o)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}ji=!1,Fi=!1,ot.forEach(e=>e.complete(zi)),ot.clear()}function ks(){ot.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ji=!0)})}function Ls(){zi=!0,ks(),Rs(),zi=!1}var Ye=class{constructor(t,r,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(ot.add(this),Fi||(Fi=!0,P.read(ks),P.resolveKeyframes(Rs))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;if(t[0]===null){let s=i==null?void 0:i.get(),o=t[t.length-1];if(s!==void 0)t[0]=s;else if(n&&r){let a=n.readValue(r,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),i&&s===void 0&&i.set(t[0])}Cs(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),ot.delete(this)}cancel(){this.state==="scheduled"&&(ot.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};var Is=e=>e.startsWith("--");function ln(e,t,r){Is(t)?e.style.setProperty(t,r):e.style[t]=r}var Os={};function cn(e,t){let r=qt(e);return()=>{var n;return(n=Os[t])!=null?n:r()}}var Ns=cn(()=>window.ScrollTimeline!==void 0,"scrollTimeline");var un=cn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing");var st=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`;var Gi={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:st([0,.65,.55,1]),circOut:st([.55,0,1,.45]),backIn:st([.31,.01,.66,-.59]),backOut:st([.33,1.53,.69,.99])};function Wi(e,t){if(e)return typeof e=="function"?un()?rn(e,t):"ease-out":ir(e)?st(e):Array.isArray(e)?e.map(r=>Wi(r,t)||Gi.easeOut):Gi[e]}function Bs(e,t,r,{delay:n=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:c}={},u=void 0){let l={[t]:r};c&&(l.offset=c);let f=Wi(a,i);Array.isArray(f)&&(l.easing=f);let m={delay:n,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return u&&(m.pseudoElement=u),e.animate(l,m)}function fn(e){return typeof e=="function"&&"applyToOptions"in e}function Fs({type:e,...t}){var r,n;return fn(e)&&un()?e.applyToOptions(t):((r=t.duration)!=null||(t.duration=300),(n=t.ease)!=null||(t.ease="easeOut"),t)}var At=class extends _e{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;let{element:r,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:c}=t;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=t,se(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let u=Fs(t);this.animation=Bs(r,n,i,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){let l=Ke(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),ln(r,n,l),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var r,n,i;let t=(r=this.options)==null?void 0:r.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(n=this.animation).commitStyles)==null||i.call(n))}get duration(){var r,n;let t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return Z(Number(t))}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+Z(t)}get time(){return Z(Number(this.animation.currentTime)||0)}set time(t){let r=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=U(t),r&&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(){var t;return(t=this.manualStartTime)!=null?t:Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:r,rangeEnd:n,observe:i}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&Ns()?(this.animation.timeline=t,r&&(this.animation.rangeStart=r),n&&(this.animation.rangeEnd=n),j):i(this)}};var js={anticipate:Qt,backInOut:Jt,circInOut:rr};function vu(e){return e in js}function zs(e){typeof e.ease=="string"&&vu(e.ease)&&(e.ease=js[e.ease])}var Ui=10,mn=class extends At{constructor(t){zs(t),on(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:r,onUpdate:n,onComplete:i,element:s,...o}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}let a=new Ie({...o,autoplay:!1}),c=Math.max(Ui,z.now()-this.startTime),u=$(0,Ui,c-Ui),l=a.sample(c).value,{name:f}=this.options;s&&f&&ln(s,f,l),r.setWithVelocity(a.sample(Math.max(0,c-u)).value,l,u),a.stop()}};var Hi=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(X.test(e)||e==="0")&&!e.startsWith("url("));function bu(e){let t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function Gs(e,t,r,n){let i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;let s=e[e.length-1],o=Hi(i,t),a=Hi(s,t);return Re(o===a,`You are trying to animate ${t} from "${i}" to "${s}". "${o?s:i}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:bu(e)||(r==="spring"||fn(r))&&n}function fr(e){e.duration=0,e.type="keyframes"}var dn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);var wu=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Ws(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&wu.test(e[t]))return!0;return!1}var Tu=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Su=qt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Us(e){var f;let{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:s,type:o,keyframes:a}=e,c=(f=t==null?void 0:t.owner)==null?void 0:f.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:u,transformTemplate:l}=t.owner.getProps();return Su()&&r&&(dn.has(r)||Tu.has(r)&&Ws(a))&&(r!=="transform"||!l)&&!u&&!n&&i!=="mirror"&&s!==0&&o!=="inertia"}var Vu=40,pn=class extends _e{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:a,name:c,motionValue:u,element:l,...f}){var p;super(),this.stop=()=>{var x,y;this._animation&&(this._animation.stop(),(x=this.stopTimeline)==null||x.call(this)),(y=this.keyframeResolver)==null||y.cancel()},this.createdAt=z.now();let m={autoplay:t,delay:r,type:n,repeat:i,repeatDelay:s,repeatType:o,name:c,motionValue:u,element:l,...f},d=(l==null?void 0:l.KeyframeResolver)||Ye;this.keyframeResolver=new d(a,(x,y,v)=>this.onKeyframesResolved(x,y,m,!v),c,u,l),(p=this.keyframeResolver)==null||p.scheduleResolve()}onKeyframesResolved(t,r,n,i){var v,b;this.keyframeResolver=void 0;let{name:s,type:o,velocity:a,delay:c,isHandoff:u,onUpdate:l}=n;this.resolvedAt=z.now();let f=!0;Gs(t,s,o,a)||(f=!1,(ne.instantAnimations||!c)&&(l==null||l(Ke(t,n,r))),t[0]=t[t.length-1],fr(n),n.repeat=0);let d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Vu?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},p=f&&!u&&Us(d),x=(b=(v=d.motionValue)==null?void 0:v.owner)==null?void 0:b.current,y;if(p)try{y=new mn({...d,element:x})}catch(w){y=new Ie(d)}else y=new Ie(d);y.finished.then(()=>{this.notifyFinished()}).catch(j),this.pendingTimeline&&(this.stopTimeline=y.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=y}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Ls()),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(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}};function hn(e,t,r,n=0,i=1){let s=Array.from(e).sort((u,l)=>u.sortNodePosition(l)).indexOf(t),o=e.size,a=(o-1)*n;return typeof r=="function"?r(s,o):i===1?s*n:a-s*n}var Hs=30,Cu=e=>!isNaN(parseFloat(e)),Ks={current:void 0},Ki=class{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var s;let i=z.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(let o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=z.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=Cu(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new ke);let n=this.events[t].add(r);return t==="change"?()=>{n(),P.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.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 Ks.current&&Ks.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=z.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>Hs)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,Hs);return Zt(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),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(){var t,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function be(e,t){return new Ki(e,t)}function gn(e,t){if(e!=null&&e.inherit&&t){let{inherit:r,...n}=e;return{...t,...n}}return e}function Dt(e,t){var n,i;let r=(i=(n=e==null?void 0:e[t])!=null?n:e==null?void 0:e.default)!=null?i:e;return r!==e?gn(r,e):r}var Pu={type:"spring",stiffness:500,damping:25,restSpeed:10},Eu=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Mu={type:"keyframes",duration:.8},Au={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},_s=(e,{keyframes:t})=>t.length>2?Mu:he.has(e)?e.startsWith("scale")?Eu(t[1]):Pu:Au;var Du=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Ys(e){for(let t in e)if(!Du.has(t))return!0;return!1}var at=(e,t,r,n={},i,s)=>o=>{let a=Dt(n,e)||{},c=a.delay||n.delay||0,{elapsed:u=0}=n;u=u-U(c);let l={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-u,onUpdate:m=>{t.set(m),a.onUpdate&&a.onUpdate(m)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};Ys(a)||Object.assign(l,_s(e,l)),l.duration&&(l.duration=U(l.duration)),l.repeatDelay&&(l.repeatDelay=U(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let f=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(fr(l),l.delay===0&&(f=!0)),(ne.instantAnimations||ne.skipAnimations||i!=null&&i.shouldSkipAnimations||a.skipAnimations)&&(f=!0,fr(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){let m=Ke(l.keyframes,a);if(m!==void 0){P.update(()=>{l.onUpdate(m),l.onComplete()});return}}return a.isSync?new Ie(l):new pn(l)};var Ru=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ku(e){let t=Ru.exec(e);if(!t)return[,];let[,r,n,i]=t;return[`--${r!=null?r:n}`,i]}var Lu=4;function _i(e,t,r=1){se(r<=Lu,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[n,i]=ku(e);if(!n)return;let s=window.getComputedStyle(t).getPropertyValue(n);if(s){let o=s.trim();return Yt(o)?parseFloat(o):o}return St(i)?_i(i,t,r+1):i}function $s(e){let t=[{},{}];return e==null||e.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function lt(e,t,r,n){if(typeof t=="function"){let[i,s]=$s(n);t=t(r!==void 0?r:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[i,s]=$s(n);t=t(r!==void 0?r:e.custom,i,s)}return t}function ce(e,t,r){let n=e.getProps();return lt(n,t,r!==void 0?r:n.custom,e)}var xn=new Set(["width","height","top","left","right","bottom",...Ce]);var mr=e=>Array.isArray(e);function Iu(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,be(r))}function Ou(e){return mr(e)?e[e.length-1]||0:e}function Xs(e,t){let r=ce(e,t),{transitionEnd:n={},transition:i={},...s}=r||{};s={...s,...n};for(let o in s){let a=Ou(s[o]);Iu(e,o,a)}}var k=e=>!!(e&&e.getVelocity);function qs(e){return!!(k(e)&&e.add)}function Rt(e,t){let r=e.getValue("willChange");if(qs(r))return r.add(t);if(!r&&ne.WillChange){let n=new ne.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function kt(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var Zs="framerAppearId",dr="data-"+kt(Zs);function yn(e){return e.props[dr]}function Nu({protectedKeys:e,needsAnimating:t},r){let n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function vn(e,t,{delay:r=0,transitionOverride:n,type:i}={}){var p;let{transition:s,transitionEnd:o,...a}=t,c=e.getDefaultTransition();s=s?gn(s,c):c;let u=s==null?void 0:s.reduceMotion,l=s==null?void 0:s.skipAnimations;n&&(s=n);let f=[],m=i&&e.animationState&&e.animationState.getState()[i],d=s==null?void 0:s.path;d&&d.animateVisualElement(e,a,s,r,f);for(let x in a){let y=e.getValue(x,(p=e.latestValues[x])!=null?p:null),v=a[x];if(v===void 0||m&&Nu(m,x))continue;let b={delay:r,...Dt(s||{},x)};l&&(b.skipAnimations=!0);let w=y.get();if(w!==void 0&&!y.isAnimating()&&!Array.isArray(v)&&v===w&&!b.velocity){P.update(()=>y.set(v));continue}let g=!1;if(window.MotionHandoffAnimation){let A=yn(e);if(A){let V=window.MotionHandoffAnimation(A,x,P);V!==null&&(b.startTime=V,g=!0)}}Rt(e,x);let S=u!=null?u:e.shouldReduceMotion;y.start(at(x,y,v,S&&xn.has(x)?{type:!1}:b,e,g));let E=y.animation;E&&f.push(E)}if(o){let x=()=>P.update(()=>{o&&Xs(e,o)});f.length?Promise.all(f).then(x):x()}return f}function bn(e,t,r={}){var c;let n=ce(e,t,r.type==="exit"?(c=e.presenceContext)==null?void 0:c.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);let s=n?()=>Promise.all(vn(e,n,r)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(u=0)=>{let{delayChildren:l=0,staggerChildren:f,staggerDirection:m}=i;return Bu(e,t,u,l,f,m,r)}:()=>Promise.resolve(),{when:a}=i;if(a){let[u,l]=a==="beforeChildren"?[s,o]:[o,s];return u().then(()=>l())}else return Promise.all([s(),o(r.delay)])}function Bu(e,t,r=0,n=0,i=0,s=1,o){let a=[];for(let c of e.variantChildren)c.notify("AnimationStart",t),a.push(bn(c,t,{...o,delay:r+(typeof n=="function"?0:n)+hn(e.variantChildren,c,n,i,s)}).then(()=>c.notify("AnimationComplete",t)));return Promise.all(a)}function Js(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){let i=t.map(s=>bn(e,s,r));n=Promise.all(i)}else if(typeof t=="string")n=bn(e,t,r);else{let i=typeof t=="function"?ce(e,t,r.custom):t;n=Promise.all(vn(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}var Qs={test:e=>e==="auto",parse:e=>e};var wn=e=>t=>t.test(e);var Yi=[Se,T,te,pe,Mi,Ei,Qs],$i=e=>Yi.find(wn(e));function ea(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Xt(e):!0}var Fu=new Set(["brightness","contrast","saturate","opacity"]);function ju(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[n]=r.match(Vt)||[];if(!n)return e;let i=r.replace(n,""),s=Fu.has(t)?1:0;return n!==r&&(s*=100),t+"("+s+i+")"}var zu=/\b([a-z-]*)\(.*?\)/gu,pr={...X,getAnimatableNone:e=>{let t=e.match(zu);return t?t.map(ju).join(" "):e}};var hr={...X,getAnimatableNone:e=>{let t=X.parse(e);return X.createTransformer(e)(t.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}};var Xi={...Se,transform:Math.round};var ta={rotate:pe,pathRotation:pe,rotateX:pe,rotateY:pe,rotateZ:pe,scale:ar,scaleX:ar,scaleY:ar,scaleZ:ar,skew:pe,skewX:pe,skewY:pe,distance:T,translateX:T,translateY:T,translateZ:T,x:T,y:T,z:T,perspective:T,transformPerspective:T,opacity:Le,originX:Jr,originY:Jr,originZ:T};var ct={borderWidth:T,borderTopWidth:T,borderRightWidth:T,borderBottomWidth:T,borderLeftWidth:T,borderRadius:T,borderTopLeftRadius:T,borderTopRightRadius:T,borderBottomRightRadius:T,borderBottomLeftRadius:T,width:T,maxWidth:T,height:T,maxHeight:T,top:T,right:T,bottom:T,left:T,inset:T,insetBlock:T,insetBlockStart:T,insetBlockEnd:T,insetInline:T,insetInlineStart:T,insetInlineEnd:T,padding:T,paddingTop:T,paddingRight:T,paddingBottom:T,paddingLeft:T,paddingBlock:T,paddingBlockStart:T,paddingBlockEnd:T,paddingInline:T,paddingInlineStart:T,paddingInlineEnd:T,margin:T,marginTop:T,marginRight:T,marginBottom:T,marginLeft:T,marginBlock:T,marginBlockStart:T,marginBlockEnd:T,marginInline:T,marginInlineStart:T,marginInlineEnd:T,fontSize:T,backgroundPositionX:T,backgroundPositionY:T,...ta,zIndex:Xi,fillOpacity:Le,strokeOpacity:Le,numOctaves:Xi};var Gu={...ct,color:O,backgroundColor:O,outlineColor:O,fill:O,stroke:O,borderColor:O,borderTopColor:O,borderRightColor:O,borderBottomColor:O,borderLeftColor:O,filter:pr,WebkitFilter:pr,mask:hr,WebkitMask:hr},Tn=e=>Gu[e];var Wu=new Set([pr,hr]);function Sn(e,t){let r=Tn(e);return Wu.has(r)||(r=X),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var Uu=new Set(["auto","none","0"]);function ra(e,t,r){let n=0,i;for(;n<e.length&&!i;){let s=e[n];typeof s=="string"&&!Uu.has(s)&&He(s).values.length&&(i=e[n]),n++}if(i&&r)for(let s of t)e[s]=Sn(r,i)}var Vn=class extends Ye{constructor(t,r,n,i,s){super(t,r,n,i,s,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let f=t[l];if(typeof f=="string"&&(f=f.trim(),St(f))){let m=_i(f,r.current);m!==void 0&&(t[l]=m),l===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!xn.has(n)||t.length!==2)return;let[i,s]=t,o=$i(i),a=$i(s),c=Ci(i),u=Ci(s);if(c!==u&&Oe[n]){this.needsMeasurement=!0;return}if(o!==a)if(Bi(o)&&Bi(a))for(let l=0;l<t.length;l++){let f=t[l];typeof f=="string"&&(t[l]=parseFloat(f))}else Oe[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:r}=this,n=[];for(let i=0;i<t.length;i++)(t[i]===null||ea(t[i]))&&n.push(i);n.length&&ra(t,n,r)}measureInitialState(){let{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Oe[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;let i=r[r.length-1];i!==void 0&&t.getValue(n,i).jump(i,!1)}measureEndState(){var a;let{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;let i=t.getValue(r);i&&i.jump(this.measuredOrigin,!1);let s=n.length-1,o=n[s];n[s]=Oe[r](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([c,u])=>{t.getValue(c).set(u)}),this.resolveNoneKeyframes()}};var gr=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Cn(e,t,r){var n;if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;t&&(i=t.current);let s=(n=r==null?void 0:r[e])!=null?n:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(i=>i!=null)}var xr=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function na(e){return $t(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}var{schedule:ut,cancel:Hu}=$r(queueMicrotask,!1);var ge={x:!1,y:!1};function Pn(){return ge.x||ge.y}function qi(e){return e==="x"||e==="y"?ge[e]?null:(ge[e]=!0,()=>{ge[e]=!1}):ge.x||ge.y?null:(ge.x=ge.y=!0,()=>{ge.x=ge.y=!1})}function En(e,t){let r=Cn(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function Ku(e){return!(e.pointerType==="touch"||Pn())}function Zi(e,t,r={}){let[n,i,s]=En(e,r);return n.forEach(o=>{let a=!1,c=!1,u,l=()=>{o.removeEventListener("pointerleave",p)},f=y=>{u&&(u(y),u=void 0),l()},m=y=>{a=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),c&&(c=!1,f(y))},d=()=>{a=!0,window.addEventListener("pointerup",m,i),window.addEventListener("pointercancel",m,i)},p=y=>{if(y.pointerType!=="touch"){if(a){c=!0;return}f(y)}},x=y=>{if(!Ku(y))return;c=!1;let v=t(o,y);typeof v=="function"&&(u=v,o.addEventListener("pointerleave",p,i))};o.addEventListener("pointerenter",x,i),o.addEventListener("pointerdown",d,i)}),s}var Ji=(e,t)=>t?e===t?!0:Ji(e,t.parentElement):!1;var ft=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var _u=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Qi(e){return _u.has(e.tagName)||e.isContentEditable===!0}var Yu=new Set(["INPUT","SELECT","TEXTAREA"]);function eo(e){return Yu.has(e.tagName)||e.isContentEditable===!0}var Lt=new WeakSet;function ia(e){return t=>{t.key==="Enter"&&e(t)}}function to(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var oa=(e,t)=>{let r=e.currentTarget;if(!r)return;let n=ia(()=>{if(Lt.has(r))return;to(r,"down");let i=ia(()=>{to(r,"up")}),s=()=>to(r,"cancel");r.addEventListener("keyup",i,t),r.addEventListener("blur",s,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function sa(e){return ft(e)&&!Pn()}var aa=new WeakSet;function ro(e,t,r={}){let[n,i,s]=En(e,r),o=a=>{let c=a.currentTarget;if(!sa(a)||aa.has(a))return;Lt.add(c),r.stopPropagation&&aa.add(a);let u=t(c,a),l={...i,capture:!0},f=(p,x)=>{window.removeEventListener("pointerup",m,l),window.removeEventListener("pointercancel",d,l),Lt.has(c)&&Lt.delete(c),sa(p)&&typeof u=="function"&&u(p,{success:x})},m=p=>{f(p,c===window||c===document||r.useGlobalTarget||Ji(c,p.target))},d=p=>{f(p,!1)};window.addEventListener("pointerup",m,l),window.addEventListener("pointercancel",d,l)};return n.forEach(a=>{(r.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),na(a)&&(a.addEventListener("focus",u=>oa(u,i)),!Qi(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function It(e){return $t(e)&&"ownerSVGElement"in e}var Mn=new WeakMap,$e,la=(e,t,r)=>(n,i)=>i&&i[0]?i[0][e+"Size"]:It(n)&&"getBBox"in n?n.getBBox()[t]:n[r],$u=la("inline","width","offsetWidth"),Xu=la("block","height","offsetHeight");function qu({target:e,borderBoxSize:t}){var r;(r=Mn.get(e))==null||r.forEach(n=>{n(e,{get width(){return $u(e,t)},get height(){return Xu(e,t)}})})}function Zu(e){e.forEach(qu)}function Ju(){typeof ResizeObserver!="undefined"&&($e=new ResizeObserver(Zu))}function ca(e,t){$e||Ju();let r=Cn(e);return r.forEach(n=>{let i=Mn.get(n);i||(i=new Set,Mn.set(n,i)),i.add(t),$e==null||$e.observe(n)}),()=>{r.forEach(n=>{let i=Mn.get(n);i==null||i.delete(t),i!=null&&i.size||$e==null||$e.unobserve(n)})}}var An=new Set,Ot;function Qu(){Ot=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};An.forEach(t=>t(e))},window.addEventListener("resize",Ot)}function ua(e){return An.add(e),Ot||Qu(),()=>{An.delete(e),!An.size&&typeof Ot=="function"&&(window.removeEventListener("resize",Ot),Ot=void 0)}}function Dn(e,t){return typeof e=="function"?ua(e):ca(e,t)}var mt={value:null,addProjectionMetrics:null};function fa(e){return It(e)&&e.tagName==="svg"}var ef=[...Yi,O,X],ma=e=>ef.find(wn(e));var no=()=>({translate:0,scale:1,origin:0,originPoint:0}),Xe=()=>({x:no(),y:no()}),io=()=>({min:0,max:0}),N=()=>({x:io(),y:io()});var da=new WeakMap;function Ne(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Pe(e){return typeof e=="string"||Array.isArray(e)}var Rn=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],yr=["initial",...Rn];function qe(e){return Ne(e.animate)||yr.some(t=>Pe(e[t]))}function vr(e){return!!(qe(e)||e.variants)}function pa(e,t,r){for(let n in t){let i=t[n],s=r[n];if(k(i))e.addValue(n,i);else if(k(s))e.addValue(n,be(i,{owner:e}));else if(s!==i)if(e.hasValue(n)){let o=e.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{let o=e.getStaticValue(n);e.addValue(n,be(o!==void 0?o:i,{owner:e}))}}for(let n in r)t[n]===void 0&&e.removeValue(n);return t}var br={current:null},kn={current:!1};var tf=typeof window!="undefined";function ha(){if(kn.current=!0,!!tf)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>br.current=e.matches;e.addEventListener("change",t),t()}else br.current=!1}var ga=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Ln={};function Tr(e){Ln=e}function oo(){return Ln}var wr=class{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,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=Ye,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=()=>{let d=z.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,P.render(this.render,!1,!0))};let{latestValues:u,renderState:l}=a;this.latestValues=u,this.baseTarget={...u},this.initialValues=r.initial?{...u}:{},this.renderState=l,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=qe(r),this.isVariantNode=vr(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:f,...m}=this.scrapeMotionValuesFromProps(r,{},this);for(let d in m){let p=m[d];u[d]!==void 0&&k(p)&&p.set(u[d])}}mount(t){var r,n,i;if(this.hasBeenMounted)for(let s in this.initialValues)(r=this.values.get(s))==null||r.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,da.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((s,o)=>this.bindToMotionValue(o,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(kn.current||ha(),this.shouldReduceMotion=br.current),this.shouldSkipAnimations=(n=this.skipAnimationsConfig)!=null?n:!1,(i=this.parent)==null||i.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),ae(this.notifyUpdate),ae(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(let r in this.events)this.events[r].clear();for(let r in this.features){let n=this.features[r];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){var r;this.children.add(t),(r=this.enteringChildren)!=null||(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),r.accelerate&&dn.has(t)&&this.current instanceof HTMLElement){let{factory:o,keyframes:a,times:c,ease:u,duration:l}=r.accelerate,f=new At({element:this.current,name:t,keyframes:a,times:c,ease:u,duration:U(l)}),m=o(f);this.valueSubscriptions.set(t,()=>{m(),f.cancel()});return}let n=he.has(t);n&&this.onBindTransform&&this.onBindTransform();let i=r.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&P.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),s;typeof window!="undefined"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{i(),s&&s()})}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 Ln){let r=Ln[t];if(!r)continue;let{isEnabled:n,Feature:i}=r;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){let s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):N()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<ga.length;n++){let i=ga[n];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=pa(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){let r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){let n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);let r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=be(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){var i;let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!=null?i:this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(Yt(n)||Xt(n))?n=parseFloat(n):!ma(n)&&X.test(r)&&(n=Sn(t,r)),this.setBaseTarget(t,k(n)?n.get():n)),k(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var s;let{initial:r}=this.props,n;if(typeof r=="string"||typeof r=="object"){let o=lt(this.props,r,(s=this.presenceContext)==null?void 0:s.custom);o&&(n=o[t])}if(r&&n!==void 0)return n;let i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!k(i)?i:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new ke),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){ut.render(this.render)}};var Nt=class extends wr{constructor(){super(...arguments),this.KeyframeResolver=Vn}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){let n=t.style;return n?n[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;k(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}};var q=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};function Sr({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function so({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function ao(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function lo(e){return e===void 0||e===1}function In({scale:e,scaleX:t,scaleY:r}){return!lo(e)||!lo(t)||!lo(r)}function Be(e){return In(e)||co(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function co(e){return xa(e.x)||xa(e.y)}function xa(e){return e&&e!=="0%"}function Vr(e,t,r){let n=e-r,i=t*n;return r+i}function ya(e,t,r,n,i){return i!==void 0&&(e=Vr(e,i,n)),Vr(e,r,n)+t}function uo(e,t=0,r=1,n,i){e.min=ya(e.min,t,r,n,i),e.max=ya(e.max,t,r,n,i)}function fo(e,{x:t,y:r}){uo(e.x,t.translate,t.scale,t.originPoint),uo(e.y,r.translate,r.scale,r.originPoint)}var va=.999999999999,ba=1.0000000000001;function Sa(e,t,r,n=!1){var a;let i=r.length;if(!i)return;t.x=t.y=1;let s,o;for(let c=0;c<i;c++){s=r[c],o=s.projectionDelta;let{visualElement:u}=s.options;u&&u.props.style&&u.props.style.display==="contents"||(n&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(xe(e.x,-s.scroll.offset.x),xe(e.y,-s.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,fo(e,o)),n&&Be(s.latestValues)&&Cr(e,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}t.x<ba&&t.x>va&&(t.x=1),t.y<ba&&t.y>va&&(t.y=1)}function xe(e,t){e.min+=t,e.max+=t}function wa(e,t,r,n,i=.5){let s=M(e.min,e.max,i);uo(e,t,r,s,n)}function Ta(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Cr(e,t,r){let n=r!=null?r:e;wa(e.x,Ta(t.x,n.x),t.scaleX,t.scale,t.originX),wa(e.y,Ta(t.y,n.y),t.scaleY,t.scale,t.originY)}function On(e,t){return Sr(ao(e.getBoundingClientRect(),t))}function mo(e,t,r){let n=On(e,r),{scroll:i}=t;return i&&(xe(n.x,i.offset.x),xe(n.y,i.offset.y)),n}var rf={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},nf=Ce.length;function Va(e,t,r){let n="",i=!0;for(let o=0;o<nf;o++){let a=Ce[o],c=e[a];if(c===void 0)continue;let u=!0;if(typeof c=="number")u=c===(a.startsWith("scale")?1:0);else{let l=parseFloat(c);u=a.startsWith("scale")?l===1:l===0}if(!u||r){let l=xr(c,ct[a]);if(!u){i=!1;let f=rf[a]||a;n+=`${f}(${l}) `}r&&(t[a]=l)}}let s=e.pathRotation;return s&&(i=!1,n+=`rotate(${xr(s,ct.pathRotation)}) `),n=n.trim(),r?n=r(t,i?"":n):i&&(n="none"),n}function dt(e,t,r){let{style:n,vars:i,transformOrigin:s}=e,o=!1,a=!1;for(let c in t){let u=t[c];if(he.has(c)){o=!0;continue}else if(qr(c)){i[c]=u;continue}else{let l=xr(u,ct[c]);c.startsWith("origin")?(a=!0,s[c]=l):n[c]=l}}if(t.transform||(o||r?n.transform=Va(t,e.transform,r):n.transform&&(n.transform="none")),a){let{originX:c="50%",originY:u="50%",originZ:l=0}=s;n.transformOrigin=`${c} ${u} ${l}`}}function Nn(e,{style:t,vars:r},n,i){let s=e.style,o;for(o in t)s[o]=t[o];i==null||i.applyProjectionStyles(s,n);for(o in r)s.setProperty(o,r[o])}function Ca(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Bt={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(T.test(e))e=parseFloat(e);else return e;let r=Ca(e,t.target.x),n=Ca(e,t.target.y);return`${r}% ${n}%`}};var Pa={correct:(e,{treeScale:t,projectionDelta:r})=>{let n=e,i=X.parse(e);if(i.length>5)return n;let s=X.createTransformer(e),o=typeof i[0]!="number"?1:0,a=r.x.scale*t.x,c=r.y.scale*t.y;i[0+o]/=a,i[1+o]/=c;let u=M(a,c,.5);return typeof i[2+o]=="number"&&(i[2+o]/=u),typeof i[3+o]=="number"&&(i[3+o]/=u),s(i)}};var Pr={borderRadius:{...Bt,applyTo:[...gr]},borderTopLeftRadius:Bt,borderTopRightRadius:Bt,borderBottomLeftRadius:Bt,borderBottomRightRadius:Bt,boxShadow:Pa};function Er(e,{layout:t,layoutId:r}){return he.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Pr[e]||e==="opacity")}function pt(e,t,r){var o;let n=e.style,i=t==null?void 0:t.style,s={};if(!n)return s;for(let a in n)(k(n[a])||i&&k(i[a])||Er(a,e)||((o=r==null?void 0:r.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(s[a]=n[a]);return s}function of(e){return window.getComputedStyle(e)}var Mr=class extends Nt{constructor(){super(...arguments),this.type="html",this.renderInstance=Nn}mount(t){se(!!t.style,"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,r){var n;if(he.has(r))return(n=this.projection)!=null&&n.isProjecting?sn(r):As(t,r);{let i=of(t),s=(qr(r)?i.getPropertyValue(r):i[r])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:r}){return On(t,r)}build(t,r,n){dt(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return pt(t,r,n)}};var sf={offset:"stroke-dashoffset",array:"stroke-dasharray"},af={offset:"strokeDashoffset",array:"strokeDasharray"};function Ea(e,t,r=1,n=0,i=!0){e.pathLength=1;let s=i?sf:af;e[s.offset]=`${-n}`,e[s.array]=`${t} ${r}`}var lf=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Ar(e,{attrX:t,attrY:r,attrScale:n,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...a},c,u,l){var d,p;if(dt(e,a,u),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:m}=e;f.transform&&(m.transform=f.transform,delete f.transform),(m.transform||f.transformOrigin)&&(m.transformOrigin=(d=f.transformOrigin)!=null?d:"50% 50%",delete f.transformOrigin),m.transform&&(m.transformBox=(p=l==null?void 0:l.transformBox)!=null?p:"fill-box",delete f.transformBox);for(let x of lf)f[x]!==void 0&&(m[x]=f[x],delete f[x]);t!==void 0&&(f.x=t),r!==void 0&&(f.y=r),n!==void 0&&(f.scale=n),i!==void 0&&Ea(f,i,s,o,!1)}var Bn=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"]);var Dr=e=>typeof e=="string"&&e.toLowerCase()==="svg";function Ma(e,t,r,n){Nn(e,t,void 0,n);for(let i in t.attrs)e.setAttribute(Bn.has(i)?i:kt(i),t.attrs[i])}function Rr(e,t,r){let n=pt(e,t,r);for(let i in e)if(k(e[i])||k(t[i])){let s=Ce.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}var kr=class extends Nt{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=N}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(he.has(r)){let n=Tn(r);return n&&n.default||0}return r=Bn.has(r)?r:kt(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return Rr(t,r,n)}build(t,r,n){Ar(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,i){Ma(t,r,n,i)}mount(t){this.isSVGTag=Dr(t.tagName),super.mount(t)}};var cf=yr.length;function po(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?po(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<cf;r++){let n=yr[r],i=e.props[n];(Pe(i)||i===!1)&&(t[n]=i)}return t}function ho(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}var uf=[...Rn].reverse(),ff=Rn.length;function mf(e){return t=>Promise.all(t.map(({animation:r,options:n})=>Js(e,r,n)))}function go(e){let t=mf(e),r=Aa(),n=!0,i=!1,s=u=>(l,f)=>{var d;let m=ce(e,f,u==="exit"?(d=e.presenceContext)==null?void 0:d.custom:void 0);if(m){let{transition:p,transitionEnd:x,...y}=m;l={...l,...y,...x}}return l};function o(u){t=u(e)}function a(u){let{props:l}=e,f=po(e.parent)||{},m=[],d=new Set,p={},x=1/0;for(let v=0;v<ff;v++){let b=uf[v],w=r[b],g=l[b]!==void 0?l[b]:f[b],S=Pe(g),E=b===u?w.isActive:null;E===!1&&(x=v);let A=g===f[b]&&g!==l[b]&&S;if(A&&(n||i)&&e.manuallyAnimateOnMount&&(A=!1),w.protectedKeys={...p},!w.isActive&&E===null||!g&&!w.prevProp||Ne(g)||typeof g=="boolean")continue;if(b==="exit"&&w.isActive&&E!==!0){w.prevResolvedValues&&(p={...p,...w.prevResolvedValues});continue}let V=Da(w.prevProp,g),L=V||b===u&&w.isActive&&!A&&S||v>x&&S,C=!1,I=Array.isArray(g)?g:[g],R=I.reduce(s(b),{});E===!1&&(R={});let{prevResolvedValues:H={}}=w,J={...H,...R},re=Y=>{L=!0,d.has(Y)&&(C=!0,d.delete(Y)),w.needsAnimating[Y]=!0;let B=e.getValue(Y);B&&(B.liveStyle=!1)};for(let Y in J){let B=R[Y],we=H[Y];if(p.hasOwnProperty(Y))continue;let De=!1;mr(B)&&mr(we)?De=!ho(B,we)||V:De=B!==we,De?B!=null?re(Y):d.add(Y):B!==void 0&&d.has(Y)?re(Y):w.protectedKeys[Y]=!0}w.prevProp=g,w.prevResolvedValues=R,w.isActive&&(p={...p,...R}),(n||i)&&e.blockInitialAnimation&&(L=!1);let me=A&&V;L&&(!me||C)&&m.push(...I.map(Y=>{let B={type:b};if(typeof Y=="string"&&(n||i)&&!me&&e.manuallyAnimateOnMount&&e.parent){let{parent:we}=e,De=ce(we,Y);if(we.enteringChildren&&De){let{delayChildren:yi}=De.transition||{};B.delay=hn(we.enteringChildren,e,yi)}}return{animation:Y,options:B}}))}if(d.size){let v={};if(typeof l.initial!="boolean"){let b=ce(e,Array.isArray(l.initial)?l.initial[0]:l.initial);b&&b.transition&&(v.transition=b.transition)}d.forEach(b=>{let w=e.getBaseTarget(b),g=e.getValue(b);g&&(g.liveStyle=!0),v[b]=w!=null?w:null}),m.push({animation:v})}let y=!!m.length;return n&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(y=!1),n=!1,i=!1,y?t(m):Promise.resolve()}function c(u,l){var m;if(r[u].isActive===l)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(d=>{var p;return(p=d.animationState)==null?void 0:p.setActive(u,l)}),r[u].isActive=l;let f=a(u);for(let d in r)r[d].protectedKeys={};return f}return{animateChanges:a,setActive:c,setAnimateFunction:o,getState:()=>r,reset:()=>{r=Aa(),i=!0}}}function Da(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!ho(t,e):!1}function ht(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Aa(){return{animate:ht(!0),whileInView:ht(),whileHover:ht(),whileTap:ht(),whileDrag:ht(),whileFocus:ht(),exit:ht()}}function Fn(e,t){e.min=t.min,e.max=t.max}function ye(e,t){Fn(e.x,t.x),Fn(e.y,t.y)}function xo(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Ra=1e-4,df=1-Ra,pf=1+Ra,ka=.01,hf=0-ka,gf=0+ka;function K(e){return e.max-e.min}function wo(e,t,r){return Math.abs(e-t)<=r}function yo(e,t,r,n=.5){e.origin=n,e.originPoint=M(t.min,t.max,e.origin),e.scale=K(r)/K(t),e.translate=M(r.min,r.max,e.origin)-e.originPoint,(e.scale>=df&&e.scale<=pf||isNaN(e.scale))&&(e.scale=1),(e.translate>=hf&&e.translate<=gf||isNaN(e.translate))&&(e.translate=0)}function gt(e,t,r,n){yo(e.x,t.x,r.x,n?n.originX:void 0),yo(e.y,t.y,r.y,n?n.originY:void 0)}function vo(e,t,r,n=0){let i=n?M(r.min,r.max,n):r.min;e.min=i+t.min,e.max=e.min+K(t)}function To(e,t,r,n){vo(e.x,t.x,r.x,n==null?void 0:n.x),vo(e.y,t.y,r.y,n==null?void 0:n.y)}function bo(e,t,r,n=0){let i=n?M(r.min,r.max,n):r.min;e.min=t.min-i,e.max=e.min+K(t)}function Ft(e,t,r,n){bo(e.x,t.x,r.x,n==null?void 0:n.x),bo(e.y,t.y,r.y,n==null?void 0:n.y)}function La(e,t,r,n,i){return e-=t,e=Vr(e,1/r,n),i!==void 0&&(e=Vr(e,1/i,n)),e}function xf(e,t=0,r=1,n=.5,i,s=e,o=e){if(te.test(t)&&(t=parseFloat(t),t=M(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=M(s.min,s.max,n);e===s&&(a-=t),e.min=La(e.min,t,r,a,i),e.max=La(e.max,t,r,a,i)}function Ia(e,t,[r,n,i],s,o){xf(e,t[r],t[n],t[i],t.scale,s,o)}var yf=["x","scaleX","originX"],vf=["y","scaleY","originY"];function So(e,t,r,n){Ia(e.x,t,yf,r?r.x:void 0,n?n.x:void 0),Ia(e.y,t,vf,r?r.y:void 0,n?n.y:void 0)}function Oa(e){return e.translate===0&&e.scale===1}function Vo(e){return Oa(e.x)&&Oa(e.y)}function Na(e,t){return e.min===t.min&&e.max===t.max}function Fa(e,t){return Na(e.x,t.x)&&Na(e.y,t.y)}function Ba(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Co(e,t){return Ba(e.x,t.x)&&Ba(e.y,t.y)}function Po(e){return K(e.x)/K(e.y)}function Eo(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function ue(e){return[e("x"),e("y")]}function ja(e,t,r){let n="",i=e.x.translate/t.x,s=e.y.translate/t.y,o=(r==null?void 0:r.z)||0;if((i||s||o)&&(n=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:u,rotate:l,pathRotation:f,rotateX:m,rotateY:d,skewX:p,skewY:x}=r;u&&(n=`perspective(${u}px) ${n}`),l&&(n+=`rotate(${l}deg) `),f&&(n+=`rotate(${f}deg) `),m&&(n+=`rotateX(${m}deg) `),d&&(n+=`rotateY(${d}deg) `),p&&(n+=`skewX(${p}deg) `),x&&(n+=`skewY(${x}deg) `)}let a=e.x.scale*t.x,c=e.y.scale*t.y;return(a!==1||c!==1)&&(n+=`scale(${a}, ${c})`),n||"none"}var bf=gr.length,za=e=>typeof e=="string"?parseFloat(e):e,Ga=e=>typeof e=="number"||T.test(e);function Ua(e,t,r,n,i,s){var o,a,c,u;i?(e.opacity=M(0,(o=r.opacity)!=null?o:1,wf(n)),e.opacityExit=M((a=t.opacity)!=null?a:1,0,Tf(n))):s&&(e.opacity=M((c=t.opacity)!=null?c:1,(u=r.opacity)!=null?u:1,n));for(let l=0;l<bf;l++){let f=gr[l],m=Wa(t,f),d=Wa(r,f);if(m===void 0&&d===void 0)continue;m||(m=0),d||(d=0),m===0||d===0||Ga(m)===Ga(d)?(e[f]=Math.max(M(za(m),za(d),n),0),(te.test(d)||te.test(m))&&(e[f]+="%")):e[f]=d}(t.rotate||r.rotate)&&(e.rotate=M(t.rotate||0,r.rotate||0,n))}function Wa(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var wf=Ha(0,.5,tr),Tf=Ha(.5,.95,j);function Ha(e,t,r){return n=>n<e?0:n>t?1:r(Te(e,t,n))}function Ka(e,t,r){let n=k(e)?e:be(e);return n.start(at("",n,t,r)),n.animation}function Ee(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n)}var _a=(e,t)=>e.depth-t.depth;var jn=class{constructor(){this.children=[],this.isDirty=!1}add(t){rt(this.children,t),this.isDirty=!0}remove(t){ze(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(_a),this.isDirty=!1,this.children.forEach(t)}};function Ya(e,t){let r=z.now(),n=({timestamp:i})=>{let s=i-r;s>=t&&(ae(n),e(s-t))};return P.setup(n,!0),()=>ae(n)}function xt(e){return k(e)?e.get():e}var zn=class{constructor(){this.members=[]}add(t){rt(this.members,t);for(let r=this.members.length-1;r>=0;r--){let n=this.members[r];if(n===t||n===this.lead||n===this.prevLead)continue;let i=n.instance;(!i||i.isConnected===!1)&&!n.snapshot&&(ze(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(ze(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){var r;for(let n=this.members.indexOf(t)-1;n>=0;n--){let i=this.members[n];if(i.isPresent!==!1&&((r=i.instance)==null?void 0:r.isConnected)!==!1)return this.promote(i),!0}return!1}promote(t,r){var i;let n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();let{layoutDependency:s}=n.options,{layoutDependency:o}=t.options;(s===void 0||s!==o)&&(t.resumeFrom=n,r&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),(i=t.root)!=null&&i.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var r,n,i,s,o;(n=(r=t.options).onExitComplete)==null||n.call(r),(o=(i=t.resumingFrom)==null?void 0:(s=i.options).onExitComplete)==null||o.call(s)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}};var yt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var vt={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Mo=["","X","Y","Z"],Sf=1e3,Vf=0;function Ao(e,t,r,n){let{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function rl(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=yn(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",P,!(i||s))}let{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&rl(n)}function Gn({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Vf++,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,mt.value&&(vt.nodes=vt.calculatedTargetDeltas=vt.calculatedProjections=0),this.nodes.forEach(Ef),this.nodes.forEach(Lf),this.nodes.forEach(If),this.nodes.forEach(Mf),mt.addProjectionMetrics&&mt.addProjectionMetrics(vt)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,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 jn)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new ke),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){let c=this.eventHandlers.get(o);c&&c.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=It(o)&&!fa(o),this.instance=o;let{layoutId:a,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||a)&&(this.isLayoutDirty=!0),e){let l,f=0,m=()=>this.root.updateBlockedByResize=!1;P.read(()=>{f=window.innerWidth}),e(o,()=>{let d=window.innerWidth;d!==f&&(f=d,this.root.updateBlockedByResize=!0,l&&l(),l=Ya(m,250),yt.hasAnimatedSinceResize&&(yt.hasAnimatedSinceResize=!1,this.nodes.forEach(qa)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||c)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let p=this.options.transition||u.getDefaultTransition()||jf,{onLayoutAnimationStart:x,onLayoutAnimationComplete:y}=u.getProps(),v=!this.targetLayout||!Co(this.targetLayout,d),b=!f&&m;if(this.options.layoutRoot||this.resumeFrom||b||f&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let w={...Dt(p,"layout"),onPlay:x,onComplete:y};(u.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(l,b,w.path)}else f||qa(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ae(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(Of),this.animationId++)}getTransformTemplate(){let{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&rl(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){let f=this.path[l];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}let{layoutId:a,layout:c}=this.options;if(a===void 0&&!c)return;let u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(Df),this.nodes.forEach($a);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Xa);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Rf),this.nodes.forEach(kf),this.nodes.forEach(Cf),this.nodes.forEach(Pf)):this.nodes.forEach(Xa),this.clearAllSnapshots();let a=z.now();W.delta=$(0,1e3/60,a-W.timestamp),W.timestamp=a,W.isProcessing=!0,sr.update.process(W),sr.preRender.process(W),sr.render.process(W),W.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ut.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Af),this.sharedNodes.forEach(Nf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,P.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){P.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!K(this.snapshot.measuredBox.x)&&!K(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();let o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=N()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){let c=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!i)return;let o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Vo(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,l=u!==this.prevTransformTemplateValue;o&&this.instance&&(a||Be(this.latestValues)||l)&&(i(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){let a=this.measurePageBox(),c=this.removeElementScroll(a);return o&&(c=this.removeTransform(c)),zf(c),{animationId:this.root.animationId,measuredBox:a,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var u;let{visualElement:o}=this.options;if(!o)return N();let a=o.measureViewportBox();if(!(((u=this.scroll)==null?void 0:u.wasRoot)||this.path.some(Gf))){let{scroll:l}=this.root;l&&(xe(a.x,l.offset.x),xe(a.y,l.offset.y))}return a}removeElementScroll(o){var c;let a=N();if(ye(a,o),(c=this.scroll)!=null&&c.wasRoot)return a;for(let u=0;u<this.path.length;u++){let l=this.path[u],{scroll:f,options:m}=l;l!==this.root&&f&&m.layoutScroll&&(f.wasRoot&&ye(a,o),xe(a.x,f.offset.x),xe(a.y,f.offset.y))}return a}applyTransform(o,a=!1,c){var l,f;let u=c||N();ye(u,o);for(let m=0;m<this.path.length;m++){let d=this.path[m];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(xe(u.x,-d.scroll.offset.x),xe(u.y,-d.scroll.offset.y)),Be(d.latestValues)&&Cr(u,d.latestValues,(l=d.layout)==null?void 0:l.layoutBox)}return Be(this.latestValues)&&Cr(u,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),u}removeTransform(o){var c;let a=N();ye(a,o);for(let u=0;u<this.path.length;u++){let l=this.path[u];if(!Be(l.latestValues))continue;let f;l.instance&&(In(l.latestValues)&&l.updateSnapshot(),f=N(),ye(f,l.measurePageBox())),So(a,l.latestValues,(c=l.snapshot)==null?void 0:c.layoutBox,f)}return Be(this.latestValues)&&So(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.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!==W.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var d;let a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);let c=!!this.resumingFrom||this!==a;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:l,layoutId:f}=this.options;if(!this.layout||!(l||f))return;this.resolvedRelativeTargetAt=W.timestamp;let m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=N(),this.targetWithTransforms=N()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),To(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ye(this.target,this.layout.layoutBox),fo(this.target,this.targetDelta)):ye(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0),mt.value&&vt.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||In(this.parent.latestValues)||co(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=N(),this.relativeTargetOrigin=N(),Ft(this.relativeTargetOrigin,a,c,this.options.layoutAnchor||void 0),ye(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var p;let o=this.getLead(),a=!!this.resumingFrom||this!==o,c=!0;if((this.isProjectionDirty||(p=this.parent)!=null&&p.isProjectionDirty)&&(c=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===W.timestamp&&(c=!1),c)return;let{layout:u,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||l))return;ye(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,m=this.treeScale.y;Sa(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=N());let{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(xo(this.prevProjectionDelta.x,this.projectionDelta.x),xo(this.prevProjectionDelta.y,this.projectionDelta.y)),gt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Eo(this.projectionDelta.x,this.prevProjectionDelta.x)||!Eo(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d)),mt.value&&vt.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){let c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Xe(),this.projectionDelta=Xe(),this.projectionDeltaWithTransform=Xe()}setAnimationOrigin(o,a=!1,c){let u=this.snapshot,l=u?u.latestValues:{},f={...this.latestValues},m=Xe();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;let d=N(),p=u?u.source:void 0,x=this.layout?this.layout.source:void 0,y=p!==x,v=this.getStack(),b=!v||v.members.length<=1,w=!!(y&&!b&&this.options.crossfade===!0&&!this.path.some(Ff));this.animationProgress=0;let g,S=c==null?void 0:c.interpolateProjection(o);this.mixTargetDelta=E=>{let A=E/1e3,V=S==null?void 0:S(A);V?(m.x.translate=V.x,m.x.scale=M(o.x.scale,1,A),m.x.origin=o.x.origin,m.x.originPoint=o.x.originPoint,m.y.translate=V.y,m.y.scale=M(o.y.scale,1,A),m.y.origin=o.y.origin,m.y.originPoint=o.y.originPoint):(Za(m.x,o.x,A),Za(m.y,o.y,A)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ft(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Bf(this.relativeTarget,this.relativeTargetOrigin,d,A),g&&Fa(this.relativeTarget,g)&&(this.isProjectionDirty=!1),g||(g=N()),ye(g,this.relativeTarget)),y&&(this.animationValues=f,Ua(f,l,this.latestValues,A,w,b)),V&&V.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=V.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=A},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,c,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||u.stop(),this.pendingAnimation&&(ae(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=P.update(()=>{yt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=be(0)),this.motionValue.jump(0,!1),this.currentAnimation=Ka(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.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);let o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Sf),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let o=this.getLead(),{targetWithTransforms:a,target:c,layout:u,latestValues:l}=o;if(!(!a||!c||!u)){if(this!==o&&this.layout&&u&&nl(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||N();let f=K(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+f;let m=K(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+m}ye(a,c),Cr(a,l),gt(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new zn),this.sharedNodes.get(o).add(a);let u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){let o=this.getStack();return o?o.lead===this:!0}getLead(){var a;let{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;let{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){let{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:c}={}){let u=this.getStack();u&&u.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){let o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){let{visualElement:o}=this.options;if(!o)return;let a=!1,{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(a=!0),!a)return;let u={};c.z&&Ao("z",o,u,this.animationValues);for(let l=0;l<Mo.length;l++)Ao(`rotate${Mo[l]}`,o,u,this.animationValues),Ao(`skew${Mo[l]}`,o,u,this.animationValues);o.render();for(let l in u)o.setStaticValue(l,u[l]),this.animationValues&&(this.animationValues[l]=u[l]);o.scheduleRender()}applyProjectionStyles(o,a){var p,x;if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}let c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=xt(a==null?void 0:a.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}let u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=xt(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Be(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";let l=u.animationValues||u.latestValues;this.applyTransformsToTarget();let f=ja(this.projectionDeltaWithTransform,this.treeScale,l);c&&(f=c(l,f)),o.transform=f;let{x:m,y:d}=this.projectionDelta;o.transformOrigin=`${m.origin*100}% ${d.origin*100}% 0`,u.animationValues?o.opacity=u===this?(x=(p=l.opacity)!=null?p:this.latestValues.opacity)!=null?x:1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:o.opacity=u===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(let y in Pr){if(l[y]===void 0)continue;let{correct:v,applyTo:b,isCSSVariable:w}=Pr[y],g=f==="none"?l[y]:v(l[y],u);if(b){let S=b.length;for(let E=0;E<S;E++)o[b[E]]=g}else w?this.options.visualElement.renderState.vars[y]=g:o[y]=g}this.options.layoutId&&(o.pointerEvents=u===this?xt(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach($a),this.root.sharedNodes.clear()}}}function Cf(e){e.updateLayout()}function Pf(e){var r;let t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:n,measuredBox:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;if(s==="size")ue(f=>{let m=o?t.measuredBox[f]:t.layoutBox[f],d=K(m);m.min=n[f].min,m.max=m.min+d});else if(s==="x"||s==="y"){let f=s==="x"?"y":"x";Fn(o?t.measuredBox[f]:t.layoutBox[f],n[f])}else nl(s,t.layoutBox,n)&&ue(f=>{let m=o?t.measuredBox[f]:t.layoutBox[f],d=K(n[f]);m.max=m.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+d)});let a=Xe();gt(a,n,t.layoutBox);let c=Xe();o?gt(c,e.applyTransform(i,!0),t.measuredBox):gt(c,n,t.layoutBox);let u=!Vo(a),l=!1;if(!e.resumeFrom){let f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){let{snapshot:m,layout:d}=f;if(m&&d){let p=e.options.layoutAnchor||void 0,x=N();Ft(x,t.layoutBox,m.layoutBox,p);let y=N();Ft(y,n,d.layoutBox,p),Co(x,y)||(l=!0),f.options.layoutRoot&&(e.relativeTarget=y,e.relativeTargetOrigin=x,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:c,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function Ef(e){mt.value&&vt.nodes++,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 Mf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Af(e){e.clearSnapshot()}function $a(e){e.clearMeasurements()}function Df(e){e.isLayoutDirty=!0,e.updateLayout()}function Xa(e){e.isLayoutDirty=!1}function Rf(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function kf(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function qa(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Lf(e){e.resolveTargetDelta()}function If(e){e.calcProjection()}function Of(e){e.resetSkewAndRotation()}function Nf(e){e.removeLeadSnapshot()}function Za(e,t,r){e.translate=M(t.translate,0,r),e.scale=M(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function Ja(e,t,r,n){e.min=M(t.min,r.min,n),e.max=M(t.max,r.max,n)}function Bf(e,t,r,n){Ja(e.x,t.x,r.x,n),Ja(e.y,t.y,r.y,n)}function Ff(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var jf={duration:.45,ease:[.4,0,.1,1]},Qa=e=>typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),el=Qa("applewebkit/")&&!Qa("chrome/")?Math.round:j;function tl(e){e.min=el(e.min),e.max=el(e.max)}function zf(e){tl(e.x),tl(e.y)}function nl(e,t,r){return e==="position"||e==="preserve-aspect"&&!wo(Po(t),Po(r),.2)}function Gf(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}var il=Gn({attachResizeListener:(e,t)=>Ee(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0});var Wn={current:void 0},Lr=Gn({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Wn.current){let e=new il({});e.mount(window),e.setOptions({layoutScroll:!0}),Wn.current=e}return Wn.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var ol=require("react"),Un=(0,ol.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Ze=require("react");function sl(e=!0){let t=(0,Ze.useContext)(wt);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:n,register:i}=t,s=(0,Ze.useId)();(0,Ze.useEffect)(()=>{if(e)return i(s)},[e]);let o=(0,Ze.useCallback)(()=>e&&n&&n(s),[s,n,e]);return!r&&n?[!1,o]:[!0]}var al=require("react"),Hn=(0,al.createContext)({strict:!1});var ll={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"]},cl=!1;function Wf(){if(cl)return;let e={};for(let t in ll)e[t]={isEnabled:r=>ll[t].some(n=>!!r[n])};Tr(e),cl=!0}function Kn(){return Wf(),oo()}function ul(e){let t=Kn();for(let r in e)t[r]={...t[r],...e[r]};Tr(t)}var Uf=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 Ir(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Uf.has(e)}var fl=e=>!Ir(e);function Hf(e){typeof e=="function"&&(fl=t=>t.startsWith("on")?!Ir(t):e(t))}try{Hf(require("@emotion/is-prop-valid").default)}catch(e){}function ml(e,t,r){let n={};for(let i in e)i==="values"&&typeof e.values=="object"||k(e[i])||(fl(i)||r===!0&&Ir(i)||!t&&!Ir(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}var qn=require("react/jsx-runtime");var Wt=require("react");var dl=require("react"),Je=(0,dl.createContext)({});var _n=require("react");function pl(e,t){if(qe(e)){let{initial:r,animate:n}=e;return{initial:r===!1||Pe(r)?r:void 0,animate:Pe(n)?n:void 0}}return e.inherit!==!1?t:{}}function gl(e){let{initial:t,animate:r}=pl(e,(0,_n.useContext)(Je));return(0,_n.useMemo)(()=>({initial:t,animate:r}),[hl(t),hl(r)])}function hl(e){return Array.isArray(e)?e.join(" "):e}var Gt=require("react");var xl=require("react");var jt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Do(e,t,r){for(let n in t)!k(t[n])&&!Er(n,r)&&(e[n]=t[n])}function Kf({transformTemplate:e},t){return(0,xl.useMemo)(()=>{let r=jt();return dt(r,t,e),Object.assign({},r.vars,r.style)},[t])}function _f(e,t){let r=e.style||{},n={};return Do(n,r,e),Object.assign(n,Kf(e,t)),n}function yl(e,t){let r={},n=_f(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}var vl=require("react");var Yn=()=>({...jt(),attrs:{}});function bl(e,t,r,n){let i=(0,vl.useMemo)(()=>{let s=Yn();return Ar(s,t,Dr(n),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){let s={};Do(s,e.style,e),i.style={...s,...i.style}}return i}var wl=["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 zt(e){return typeof e!="string"||e.includes("-")?!1:!!(wl.indexOf(e)>-1||/[A-Z]/u.test(e))}function Tl(e,t,r,{latestValues:n},i,s=!1,o){let c=((o!=null?o:zt(e))?bl:yl)(t,n,i,e),u=ml(t,typeof e=="string",s),l=e!==Gt.Fragment?{...u,...c,ref:r}:{},{children:f}=t,m=(0,Gt.useMemo)(()=>k(f)?f.get():f,[f]);return(0,Gt.createElement)(e,{...l,children:m})}var Ro=require("react");function Yf({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,i){return{latestValues:$f(r,n,i,e),renderState:t()}}function $f(e,t,r,n){let i={},s=n(e,{});for(let m in s)i[m]=xt(s[m]);let{initial:o,animate:a}=e,c=qe(e),u=vr(e);t&&u&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let l=r?r.initial===!1:!1;l=l||o===!1;let f=l?a:o;if(f&&typeof f!="boolean"&&!Ne(f)){let m=Array.isArray(f)?f:[f];for(let d=0;d<m.length;d++){let p=lt(e,m[d]);if(p){let{transitionEnd:x,transition:y,...v}=p;for(let b in v){let w=v[b];if(Array.isArray(w)){let g=l?w.length-1:0;w=w[g]}w!==null&&(i[b]=w)}for(let b in x)i[b]=x[b]}}}return i}var $n=e=>(t,r)=>{let n=(0,Ro.useContext)(Je),i=(0,Ro.useContext)(wt),s=()=>Yf(e,t,n,i);return r?s():Qo(s)};var Sl=$n({scrapeMotionValuesFromProps:pt,createRenderState:jt});var Vl=$n({scrapeMotionValuesFromProps:Rr,createRenderState:Yn});var Cl=Symbol.for("motionComponentSymbol");var bt=require("react");function Pl(e,t,r){let n=(0,bt.useRef)(r);(0,bt.useInsertionEffect)(()=>{n.current=r});let i=(0,bt.useRef)(null);return(0,bt.useCallback)(s=>{var a;s&&((a=e.onMount)==null||a.call(e,s)),t&&(s?t.mount(s):t.unmount());let o=n.current;if(typeof o=="function")if(s){let c=o(s);typeof c=="function"&&(i.current=c)}else i.current?(i.current(),i.current=null):o(s);else o&&(o.current=s)},[t])}var ie=require("react");var El=require("react"),Xn=(0,El.createContext)({});function Qe(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function Ml(e,t,r,n,i,s){var w,g;let{visualElement:o}=(0,ie.useContext)(Je),a=(0,ie.useContext)(Hn),c=(0,ie.useContext)(wt),u=(0,ie.useContext)(Un),l=u.reducedMotion,f=u.skipAnimations,m=(0,ie.useRef)(null),d=(0,ie.useRef)(!1);n=n||a.renderer,!m.current&&n&&(m.current=n(e,{visualState:t,parent:o,props:r,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:l,skipAnimations:f,isSVG:s}),d.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));let p=m.current,x=(0,ie.useContext)(Xn);p&&!p.projection&&i&&(p.type==="html"||p.type==="svg")&&Xf(m.current,r,i,x);let y=(0,ie.useRef)(!1);(0,ie.useInsertionEffect)(()=>{p&&y.current&&p.update(r,c)});let v=r[dr],b=(0,ie.useRef)(!!v&&typeof window!="undefined"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,v))&&((g=window.MotionHasOptimisedAnimation)==null?void 0:g.call(window,v)));return ts(()=>{d.current=!0,p&&(y.current=!0,window.MotionIsMounted=!0,p.updateFeatures(),p.scheduleRenderMicrotask(),b.current&&p.animationState&&p.animationState.animateChanges())}),(0,ie.useEffect)(()=>{p&&(!b.current&&p.animationState&&p.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)==null||S.call(window,v)}),b.current=!1),p.enteringChildren=void 0)}),p}function Xf(e,t,r,n){let{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:c,layoutRoot:u,layoutAnchor:l,layoutCrossfade:f}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:Al(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&Qe(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,crossfade:f,layoutScroll:c,layoutRoot:u,layoutAnchor:l})}function Al(e){if(e)return e.options.allowProjection!==!1?e.projection:Al(e.parent)}function Zn(e,{forwardMotionProps:t=!1,type:r}={},n,i){var u,l;n&&ul(n);let s=r?r==="svg":zt(e),o=s?Vl:Sl;function a(f,m){let d,p={...(0,Wt.useContext)(Un),...f,layoutId:qf(f)},{isStatic:x}=p,y=gl(f),v=o(f,x);if(!x&&typeof window!="undefined"){Zf(p,n);let b=Jf(p);d=b.MeasureLayout,y.visualElement=Ml(e,v,p,i,b.ProjectionNode,s)}return(0,qn.jsxs)(Je.Provider,{value:y,children:[d&&y.visualElement?(0,qn.jsx)(d,{visualElement:y.visualElement,...p}):null,Tl(e,f,Pl(v,y.visualElement,m),v,x,t,s)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${(l=(u=e.displayName)!=null?u:e.name)!=null?l:""})`}`;let c=(0,Wt.forwardRef)(a);return c[Cl]=e,c}function qf({layoutId:e}){let t=(0,Wt.useContext)(Wr).id;return t&&e!==void 0?t+"-"+e:e}function Zf(e,t){let r=(0,Wt.useContext)(Hn).strict}function Jf(e){let t=Kn(),{drag:r,layout:n}=t;if(!r&&!n)return{};let i={...r,...n};return{MeasureLayout:r!=null&&r.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Dl(e,t){if(typeof Proxy=="undefined")return Zn;let r=new Map,n=(s,o)=>Zn(s,o,e,t),i=(s,o)=>n(s,o);return new Proxy(i,{get:(s,o)=>o==="create"?n:(r.has(o)||r.set(o,Zn(o,void 0,e,t)),r.get(o))})}var Rl=require("react");var kl=(e,t)=>{var n;return((n=t.isSVG)!=null?n:zt(e))?new kr(t):new Mr(t,{allowProjection:e!==Rl.Fragment})};var Jn=class extends q{constructor(t){super(t),t.animationState||(t.animationState=go(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();Ne(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}};var Qf=0,Qn=class extends q{constructor(){super(...arguments),this.id=Qf++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&n===!1){if(this.isExitComplete){let{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){let c=ce(this.node,o,a);if(c){let{transition:u,transitionEnd:l,...f}=c;for(let m in f)(s=this.node.getValue(m))==null||s.jump(f[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}let i=this.node.animationState.setActive("exit",!t);r&&!t&&i.then(()=>{this.isExitComplete=!0,r(this.id)})}mount(){let{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}};var Ll={animation:{Feature:Jn},exit:{Feature:Qn}};function Fe(e){return{point:{x:e.pageX,y:e.pageY}}}var Il=e=>t=>ft(t)&&e(t,Fe(t));function et(e,t,r,n){return Ee(e,t,Il(r),n)}var ei=({current:e})=>e?e.ownerDocument.defaultView:null;var Ol=(e,t)=>Math.abs(e-t);function Nl(e,t){let r=Ol(e.x,t.x),n=Ol(e.y,t.y);return Math.sqrt(r**2+n**2)}var Bl=new Set(["auto","scroll"]),Ut=class{constructor(t,r,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=p=>{this.handleScroll(p.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=ti(this.lastRawMoveEventInfo,this.transformPagePoint));let p=ko(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,y=Nl(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!x&&!y)return;let{point:v}=p,{timestamp:b}=W;this.history.push({...v,timestamp:b});let{onStart:w,onMove:g}=this.handlers;x||(w&&w(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),g&&g(this.lastMoveEvent,p)},this.handlePointerMove=(p,x)=>{this.lastMoveEvent=p,this.lastRawMoveEventInfo=x,this.lastMoveEventInfo=ti(x,this.transformPagePoint),P.update(this.updatePoint,!0)},this.handlePointerUp=(p,x)=>{this.end();let{onEnd:y,onSessionEnd:v,resumeAnimation:b}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&b&&b(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let w=ko(p.type==="pointercancel"?this.lastMoveEventInfo:ti(x,this.transformPagePoint),this.history);this.startEvent&&y&&y(p,w),v&&v(p,w)},!ft(t))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;let c=Fe(t),u=ti(c,this.transformPagePoint),{point:l}=u,{timestamp:f}=W;this.history=[{...l,timestamp:f}];let{onSessionStart:m}=r;m&&m(t,ko(u,this.history));let d={passive:!0,capture:!0};this.removeListeners=ve(et(this.contextWindow,"pointermove",this.handlePointerMove,d),et(this.contextWindow,"pointerup",this.handlePointerUp,d),et(this.contextWindow,"pointercancel",this.handlePointerUp,d)),a&&this.startScrollTracking(a)}startScrollTracking(t){let r=t.parentElement;for(;r;){let n=getComputedStyle(r);(Bl.has(n.overflowX)||Bl.has(n.overflowY))&&this.scrollPositions.set(r,{x:r.scrollLeft,y:r.scrollTop}),r=r.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){let r=this.scrollPositions.get(t);if(!r)return;let n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:i.x-r.x,y:i.y-r.y};s.x===0&&s.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,i),P.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ae(this.updatePoint)}};function ti(e,t){return t?{point:t(e.point)}:e}function Fl(e,t){return{x:e.x-t.x,y:e.y-t.y}}function ko({point:e},t){return{point:e,delta:Fl(e,jl(t)),offset:Fl(e,em(t)),velocity:tm(t,.1)}}function em(e){return e[0]}function jl(e){return e[e.length-1]}function tm(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null,i=jl(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>U(t)));)r--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&i.timestamp-n.timestamp>U(t)*2&&(n=e[1]);let s=Z(i.timestamp-n.timestamp);if(s===0)return{x:0,y:0};let o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Hl(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?M(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?M(r,e,n.max):Math.min(e,r)),e}function zl(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function Kl(e,{top:t,left:r,bottom:n,right:i}){return{x:zl(e.x,r,i),y:zl(e.y,t,n)}}function Gl(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function _l(e,t){return{x:Gl(e.x,t.x),y:Gl(e.y,t.y)}}function Yl(e,t){let r=.5,n=K(e),i=K(t);return i>n?r=Te(t.min,t.max-n,e.min):n>i&&(r=Te(e.min,e.max-i,t.min)),$(0,1,r)}function $l(e,t){let r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}var ri=.35;function Xl(e=ri){return e===!1?e=0:e===!0&&(e=ri),{x:Wl(e,"left","right"),y:Wl(e,"top","bottom")}}function Wl(e,t,r){return{min:Ul(e,t),max:Ul(e,r)}}function Ul(e,t){return typeof e=="number"?e:e[t]||0}var rm=new WeakMap,ii=class{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=N(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:n}={}){let{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;let s=f=>{r&&this.snapToCursor(Fe(f).point),this.stopAnimation()},o=(f,m)=>{let{drag:d,dragPropagation:p,onDragStart:x}=this.getProps();if(d&&!p&&(this.openDragLock&&this.openDragLock(),this.openDragLock=qi(d),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ue(v=>{let b=this.getAxisMotionValue(v).get()||0;if(te.test(b)){let{projection:w}=this.visualElement;if(w&&w.layout){let g=w.layout.layoutBox[v];g&&(b=K(g)*(parseFloat(b)/100))}}this.originPoint[v]=b}),x&&P.update(()=>x(f,m),!1,!0),Rt(this.visualElement,"transform");let{animationState:y}=this.visualElement;y&&y.setActive("whileDrag",!0)},a=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m;let{dragPropagation:d,dragDirectionLock:p,onDirectionLock:x,onDrag:y}=this.getProps();if(!d&&!this.openDragLock)return;let{offset:v}=m;if(p&&this.currentDirection===null){this.currentDirection=im(v),this.currentDirection!==null&&x&&x(this.currentDirection);return}this.updateAxis("x",m.point,v),this.updateAxis("y",m.point,v),this.visualElement.render(),y&&P.update(()=>y(f,m),!1,!0)},c=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m,this.stop(f,m),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>{let{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Ut(t,{onSessionStart:s,onStart:o,onMove:a,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:ei(this.visualElement),element:this.visualElement.current})}stop(t,r){let n=t||this.latestPointerEvent,i=r||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;let{velocity:o}=i;this.startAnimation(o);let{onDragEnd:a}=this.getProps();a&&P.postRender(()=>a(n,i))}cancel(){this.isDragging=!1;let{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,r,n){let{drag:i}=this.getProps();if(!n||!ni(t,i,this.currentDirection))return;let s=this.getAxisMotionValue(t),o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=Hl(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var s;let{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&Qe(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=Kl(n.layoutBox,t):this.constraints=!1,this.elastic=Xl(r),i!==this.constraints&&!Qe(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&ue(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=$l(n.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!Qe(t))return!1;let n=t.current;se(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());let s=mo(n,i.root,this.visualElement.getTransformPagePoint()),o=_l(i.layout.layoutBox,s);if(r){let a=r(so(o));this.hasMutatedConstraints=!!a,a&&(o=Sr(a))}return o}startAnimation(t){let{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),c=this.constraints||{},u=ue(l=>{if(!ni(l,r,this.currentDirection))return;let f=c&&c[l]||{};(o===!0||o===l)&&(f={min:0,max:0});let m=i?200:1e6,d=i?40:1e7,p={type:"inertia",velocity:n?t[l]:0,bounceStiffness:m,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(l,p)});return Promise.all(u).then(a)}startAxisValueAnimation(t,r){let n=this.getAxisMotionValue(t);return Rt(this.visualElement,t),n.start(at(t,n,0,r,this.visualElement,!1))}stopAnimation(){ue(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var s;let r=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps()[r];return i||this.visualElement.getValue(t,(s=this.visualElement.latestValues[t])!=null?s:0)}snapToCursor(t){ue(r=>{let{drag:n}=this.getProps();if(!ni(r,n,this.currentDirection))return;let{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){let{min:o,max:a}=i.layout.layoutBox[r],c=s.get()||0;s.set(t[r]-M(o,a,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!Qe(r)||!n||!this.constraints)return;this.stopAnimation();let i={x:0,y:0};ue(o=>{let a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){let c=a.get();i[o]=Yl({min:c,max:c},this.constraints[o])}});let{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),ue(o=>{if(!ni(o,t,null))return;let a=this.getAxisMotionValue(o),{min:c,max:u}=this.constraints[o];a.set(M(c,u,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;rm.set(this.visualElement,this);let t=this.visualElement.current,r=et(t,"pointerdown",u=>{let{drag:l,dragListener:f=!0}=this.getProps(),m=u.target,d=m!==t&&eo(m);l&&f&&!d&&this.start(u)}),n,i=()=>{let{dragConstraints:u}=this.getProps();Qe(u)&&u.current&&(this.constraints=this.resolveRefConstraints(),n||(n=nm(t,u.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),P.read(i);let a=Ee(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",(({delta:u,hasLayoutChanged:l})=>{this.isDragging&&l&&(ue(f=>{let m=this.getAxisMotionValue(f);m&&(this.originPoint[f]+=u[f].translate,m.set(m.get()+u[f].translate))}),this.visualElement.render())}));return()=>{a(),r(),o(),c&&c(),n&&n()}}getProps(){let t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=ri,dragMomentum:a=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}};function ql(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function nm(e,t,r){let n=Dn(e,ql(r)),i=Dn(t,ql(r));return()=>{n(),i()}}function ni(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function im(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var oi=class extends q{constructor(t){super(t),this.removeGroupControls=j,this.removeListeners=j,this.controls=new ii(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||j}update(){let{dragControls:t}=this.node.getProps(),{dragControls:r}=this.node.prevProps||{};t!==r&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};var Lo=e=>(t,r)=>{e&&P.update(()=>e(t,r),!1,!0)},si=class extends q{constructor(){super(...arguments),this.removePointerDownListener=j}onPointerDown(t){this.session=new Ut(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:ei(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Lo(t),onStart:Lo(r),onMove:Lo(n),onEnd:(s,o)=>{delete this.session,i&&P.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=et(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var Zl=require("react/jsx-runtime");var Or=require("react");var Io=!1,Oo=class extends Or.Component{componentDidMount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),Io&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),yt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,{projection:o}=n;return o&&(o.isPresent=s,t.layoutDependency!==r&&o.setOptions({...o.options,layoutDependency:r}),Io=!0,i||t.layoutDependency!==r||r===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||P.postRender(()=>{let a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:t,layoutAnchor:r}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=r,n.root.didUpdate(),ut.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=t;Io=!0,i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function ai(e){let[t,r]=sl(),n=(0,Or.useContext)(Wr);return(0,Zl.jsx)(Oo,{...e,layoutGroup:n,switchLayoutGroup:(0,Or.useContext)(Xn),isPresent:t,safeToRemove:r})}var Jl={pan:{Feature:si},drag:{Feature:oi,ProjectionNode:Lr,MeasureLayout:ai}};function Ql(e,t,r){let{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");let i="onHover"+r,s=n[i];s&&P.postRender(()=>s(t,Fe(t)))}var li=class extends q{mount(){let{current:t}=this.node;t&&(this.unmount=Zi(t,(r,n)=>(Ql(this.node,n,"Start"),i=>Ql(this.node,i,"End"))))}unmount(){}};var ci=class extends q{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(r){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=ve(Ee(this.node.current,"focus",()=>this.onFocus()),Ee(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function ec(e,t,r){let{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");let i="onTap"+(r==="End"?"":r),s=n[i];s&&P.postRender(()=>s(t,Fe(t)))}var ui=class extends q{mount(){let{current:t}=this.node;if(!t)return;let{globalTapTarget:r,propagate:n}=this.node.props;this.unmount=ro(t,(i,s)=>(ec(this.node,s,"Start"),(o,{success:a})=>ec(this.node,o,a?"End":"Cancel")),{useGlobalTarget:r,stopPropagation:(n==null?void 0:n.tap)===!1})}unmount(){}};var Bo=new WeakMap,No=new WeakMap,om=e=>{let t=Bo.get(e.target);t&&t(e)},sm=e=>{e.forEach(om)};function am({root:e,...t}){let r=e||document;No.has(r)||No.set(r,{});let n=No.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(sm,{root:e,...t})),n[i]}function tc(e,t,r){let n=am(t);return Bo.set(e,r),n.observe(e),()=>{Bo.delete(e),n.unobserve(e)}}var lm={some:0,all:1},fi=class extends q{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);let{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:s}=t,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:lm[i]},a=u=>{let{isIntersecting:l}=u;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);let{onViewportEnter:f,onViewportLeave:m}=this.node.getProps(),d=l?f:m;d&&d(u)};this.stopObserver=tc(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver=="undefined")return;let{props:t,prevProps:r}=this.node;["amount","margin","root"].some(cm(t,r))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}};function cm({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var rc={inView:{Feature:fi},tap:{Feature:ui},focus:{Feature:ci},hover:{Feature:li}};var nc={layout:{ProjectionNode:Lr,MeasureLayout:ai}};var ic={...Ll,...rc,...Jl,...nc};var Fo=Dl(ic,kl);var jo=Fo;var h=require("react"),uc=require("react-dom"),Go=new Set,Wo={open:!1,status:null,busy:!1,ballPos:null,sidebarActive:!1};function _(e){Wo=Object.assign({},Wo,e),Go.forEach(function(t){t()})}function fm(e){return Go.add(e),function(){Go.delete(e)}}function Uo(){return Wo}function Nr(){return h.useSyncExternalStore(fm,Uo)}var mm="/api",Ko="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMTQ3IDE0NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8c3R5bGU+QG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykgeyogeyBmaWxsOiB3aGl0ZTsgfX08L3N0eWxlPgogIDxwYXRoIGQ9Im00Mi40MjE0LDM5LjY1NWMtMjQuNDA1NywwIC00Mi4xNTU0LDEzLjE3MjEgLTQyLjE1NTQsMzMuODQ1YzAsMjAuNTgxNCAxOC40ODkyLDMzLjg0NSA0Mi4xNTU0LDMzLjg0NWMyMy42NjYyLDAgMzguMTgwMywtMTEuNjE3MSAzOC43MzQ5LC0yOC43MjI1bC0yMS4wNzc3LC0wLjQ1NzRjLTAuOTI0NCw5LjMzMDMgLTkuMTA1OSwxNS4xODQ1IC0xNy42NTcyLDE1LjE4NDVjLTExLjc0MDYsMCAtMjAuNDMwNiwtNy41OTIyIC0yMC40MzA2LC0xOS44NDk2YzAsLTEyLjI1NzQgOC42OSwtMTkuOTg2OCAyMC40MzA2LC0yMC4yMTU1YzguNTUxMywtMC4xODMgMTYuOTE3Nyw1Ljk0NTcgMTcuNDcyMywxNS4yNzZsMjEuMDc3NywtMC42NDAzYy0wLjQ2MjIsLTE2LjgzMTEgLTE0LjE0NDIsLTI4LjI2NTIgLTM4LjU1LC0yOC4yNjUyem00OC44NDQ2LDJsNTUuNDY4LDBsMCw2NC4wMzExbC01NS40NjgsMGwwLC02NC4wMzExeiIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+Cg==";async function fe(e,t){var r={method:t===void 0?"GET":"POST",headers:{}};t!==void 0&&(r.headers["content-type"]="application/json",r.body=JSON.stringify(t));var n=await fetch(mm+e,r),i=await n.text(),s=null;try{s=i===""?null:JSON.parse(i)}catch(o){s=null}return n.ok?s!==null?s:{ok:!1,error:"invalid JSON response"}:{ok:!1,error:"HTTP "+n.status+(s!==null&&s.error!==void 0?": "+s.error:"")}}function gi(e,t){try{var r=e(function(f){return f}),n=t===null?null:typeof t=="function"?t(function(f){return f}):null,i=r!=null?r.current:void 0;if(i!==void 0&&r!=null&&r.byId!=null){var s=r.byId[i];if(s!=null&&typeof s.cwd=="string"&&s.cwd!=="")return s.cwd}var o=n!=null&&Array.isArray(n.items)?n.items:[];if(i!==void 0)for(var a=0;a<o.length;a++){var c=o[a];if(c.sessionIds!=null&&c.sessionIds.indexOf(i)!==-1&&typeof c.path=="string"&&c.path!=="")return c.path}var u=n!=null?n.recentWorkspaceId:void 0;if(u!==void 0){for(var l=0;l<o.length;l++)if(o[l].workspaceId===u&&typeof o[l].path=="string"&&o[l].path!=="")return o[l].path}if(o.length>0&&typeof o[0].path=="string"&&o[0].path!=="")return o[0].path}catch(f){}}function fc(e,t){if(e==null||typeof e.url!="string"||e.url==="")return null;var r=typeof t=="string"&&t!==""?t:e!=null&&e.cwd!=null?e.cwd:null;if(r==null||r==="")return e.url;var n=r.replace(/\\/g,"/"),i=n;return(/^[A-Za-z]:\//.test(n)||n.charCodeAt(0)!==47)&&(i="/"+n),e.url+"?folder="+encodeURIComponent(i)}function mc(e,t,r){var n=e!=null&&e.ok===!0&&e.running===!0,i=e!=null&&e.status==="starting",s=e!=null&&e.ok===!1,o=e!=null&&e.serve==="dsh",a={key:r,className:"dshcs-frame",src:"",title:"code-server",allow:"clipboard-read; clipboard-write"};o||(a.sandbox="allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock allow-clipboard-read allow-clipboard-write");var c=function(f){return h.createElement("iframe",Object.assign({},a,{src:f}))};if(n&&t!==null)return c(t);if(i)return h.createElement(h.Fragment,null,c("about:blank"),h.createElement("div",{className:"dshcs-loading"},"\u6B63\u5728\u542F\u52A8 code-server\u2026"));var u=s&&e!=null&&e.error?e.error:"code-server \u672A\u8FD0\u884C",l=o?"\u5F53\u524D\u4EE5 DSH \u540C\u6E90\u8DEF\u5F84 "+(e!=null&&e.url||"/code-server/")+" \u63D0\u4F9B(\u65E0\u72EC\u7ACB\u7AEF\u53E3)\u3002":"\u5F53\u524D\u4EE5\u72EC\u7ACB\u56DE\u73AF\u7AEF\u53E3\u63D0\u4F9B(\u7AEF\u53E3 "+(e!=null&&e.port!=null?e.port:"8090")+" \u88AB\u5360\u7528\u65F6\u8BF7\u91CA\u653E\u6216\u4FEE\u6539 port \u914D\u7F6E)\u3002";return h.createElement("div",{className:"dshcs-empty"},h.createElement("div",{className:"dshcs-emptybox"},h.createElement("div",null,s?"code-server \u542F\u52A8\u5931\u8D25":"code-server \u672A\u8FD0\u884C"),h.createElement("pre",{className:"dshcs-error"},u),h.createElement("p",{className:"dshcs-hint"},"VS Code \u6811\u968F\u63D2\u4EF6\u5305\u5185\u7F6E\u3001\u5C31\u5730\u8FD0\u884C(\u65E0\u9700\u5168\u5C40\u5B89\u88C5\u3001\u65E0\u9700\u8054\u7F51\u5B89\u88C5\u3001\u65E0\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4);\u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757\u7531\u5305\u7BA1\u7406\u5668\u5728\u5B89\u88C5\u63D2\u4EF6\u65F6\u4E00\u5E76\u88C5\u597D(\u65E0\u9700 C++ \u5DE5\u5177\u94FE)\u3002\u82E5\u6B64\u5904\u957F\u671F\u672A\u8FD0\u884C,\u8BF7\u5230 \u8BBE\u7F6E \u2192 \u63D2\u4EF6 \u2192 Code Server \u70B9\u300C\u68C0\u6D4B\u73AF\u5883\u300D\u67E5\u770B\u539F\u56E0\u3002"+l)))}function dc(e){var t=function(n){var i=fc(n,e);i!=null&&typeof window.open=="function"&&window.open(i,"_blank","noopener")},r=Uo().status;if(r!=null&&r.running===!0){t(r);return}Uo().busy!==!0&&(_({busy:!0}),fe("/code-server/start",typeof e=="string"?{cwd:e}:{}).then(function(n){_({status:n,busy:!1}),t(n)}).catch(function(){_({busy:!1})}))}var dm=["nw","n","ne","w","e","sw","s","se"],Q=12,pm=720,hm=520,pc=360,hc=260,oc=24;function Ho(e){if(e===!1)return 0;try{if(typeof document=="undefined")return 0;var t=document.querySelectorAll("[data-composer-seat]");if(t===null||t.length===0)return 0;for(var r=Number.POSITIVE_INFINITY,n=0,i=0;i<t.length;i++){var s=t[i].getBoundingClientRect();s===null||s.width<=0||(s.top<r&&(r=s.top),s.bottom>n&&(n=s.bottom))}if(!isFinite(r)||n<=0)return 0;var o=window.innerHeight;return o-n>24?0:Math.min(Math.max(1,o-r+8),420)}catch(a){return 0}}function Me(){return{width:Math.max(1,window.innerWidth),height:Math.max(1,window.innerHeight)}}function xi(e,t){return{width:Math.max(1,e.width-Q*2),height:Math.max(1,e.height-Q*2-t)}}function tt(e,t,r){return Math.min(r,Math.max(t,e))}function Ht(e,t,r){let n=xi(t,r),i=tt(e.width,Math.min(pc,n.width),n.width),s=tt(e.height,Math.min(hc,n.height),n.height);return{x:tt(e.x,Q,Math.max(Q,t.width-Q-i)),y:tt(e.y,Q,Math.max(Q,t.height-Q-r-s)),width:i,height:s}}function gm(e,t,r){let n=xi(t,r),i=Math.min(pm,n.width),s=Math.min(hm,n.height),o=xm(),a=o>0?o-8:t.height-Q-r;return Ht({x:t.width-Q-i-e*oc,y:Math.max(Q,a-s-e*oc),width:i,height:s},t,r)}function xm(){try{if(typeof document=="undefined")return-1;var e=document.querySelectorAll("[data-composer-seat]");if(e===null||e.length===0)return-1;for(var t=Number.POSITIVE_INFINITY,r=0;r<e.length;r++){var n=e[r].getBoundingClientRect();n!==null&&n.width>0&&n.top<t&&(t=n.top)}return isFinite(t)?t:-1}catch(i){return-1}}function ym(e,t,r,n,i){return Ht({...e,x:e.x+t,y:e.y+r},n,i)}function vm(e,t,r,n,i,s){let o=Ht(e,i,s),a=xi(i,s),c=Math.min(pc,a.width),u=Math.min(hc,a.height),l=i.height-Q-s,f=o.x,m=o.x+o.width,d=o.y,p=o.y+o.height;return t.includes("w")&&(f=tt(o.x+r,Q,m-c)),t.includes("e")&&(m=tt(m+r,f+c,i.width-Q)),t.includes("n")&&(d=tt(o.y+n,Q,p-u)),t.includes("s")&&(p=tt(p+n,d+u,l)),{x:f,y:d,width:m-f,height:p-d}}function mi(e,t){let r=xi(e,t);return{x:Q,y:Q,width:r.width,height:r.height}}var bm='.dshcs-root{position:fixed;inset:0;z-index:2147483000;pointer-events:none}.dshcs-win{--dshcs-accent:#5b6cff;pointer-events:auto;position:fixed;isolation:isolate;z-index:2147483000;display:flex;flex-direction:column;min-width:1px;min-height:1px;overflow:hidden;color:var(--dsw-alias-label-primary,#172033);background:var(--dsw-alias-bg-base,#fff);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;box-shadow:0 1px 2px rgba(13,22,38,.08),0 18px 48px rgba(13,22,38,.2),0 0 0 1px rgba(255,255,255,.4) inset;transition:border-color .16s ease,box-shadow .16s ease}.dshcs-win:hover{border-color:color-mix(in srgb,var(--dshcs-accent) 28%,var(--dsw-alias-border-l2,#dfe3eb));box-shadow:0 2px 5px rgba(13,22,38,.1),0 22px 58px rgba(13,22,38,.24),0 0 0 1px rgba(255,255,255,.5) inset}.dshcs-win[data-interaction]{transition:none;user-select:none}.dshcs-win[data-interaction]::after{content:"";position:absolute;inset:0;z-index:18;background:transparent}.dshcs-win-max{border-radius:14px;z-index:2147483001;box-shadow:0 1px 2px rgba(13,22,38,.06),0 8px 24px rgba(13,22,38,.12)}.dshcs-win-max:hover{box-shadow:0 1px 2px rgba(13,22,38,.06),0 10px 28px rgba(13,22,38,.14)}.dshcs-win-snap{border-color:color-mix(in srgb,var(--dshcs-accent) 70%,var(--dsw-alias-border-l2,#dfe3eb));box-shadow:0 0 0 3px color-mix(in srgb,var(--dshcs-accent) 26%,transparent),0 22px 58px rgba(13,22,38,.24),0 0 0 1px rgba(255,255,255,.5) inset}.dshcs-snapghost{position:fixed;left:0;top:0;z-index:2147483000;pointer-events:none;display:grid;place-items:center;border:1.5px solid color-mix(in srgb,var(--dshcs-accent,#5b6cff) 85%,transparent);background:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 11%,transparent);border-radius:12px;box-shadow:0 0 0 3px color-mix(in srgb,var(--dshcs-accent,#5b6cff) 20%,transparent),0 10px 34px rgba(13,22,38,.14)}.dshcs-snapghint{position:absolute;top:12px;left:50%;transform:translateX(-50%);padding:5px 14px;border-radius:999px;background:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 92%,#172033);color:#fff;font-size:12px;font-weight:650;letter-spacing:.02em;white-space:nowrap;box-shadow:0 6px 18px rgba(13,22,38,.3)}.dshcs-drag{position:absolute;top:0;left:0;right:0;height:14px;z-index:26;cursor:grab;touch-action:none;user-select:none}.dshcs-win[data-interaction=move] .dshcs-drag{cursor:grabbing}.dshcs-win-max .dshcs-drag{cursor:default}.dshcs-drag:hover{background:color-mix(in srgb,var(--dsw-alias-label-primary,#172033) 5%,transparent)}.dshcs-artbtn{appearance:none;display:inline-grid;place-items:center;width:22px;height:22px;padding:0;border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:6px;color:var(--dsw-alias-label-secondary,#566174);background:color-mix(in srgb,var(--dsw-alias-bg-base,#fff) 60%,transparent);cursor:pointer;transition:color .12s ease,background .12s ease,border-color .12s ease;vertical-align:middle}.dshcs-artbtn:hover{color:var(--dsw-alias-label-primary,#172033);border-color:color-mix(in srgb,var(--dshcs-accent) 40%,var(--dsw-alias-border-l2,#dfe3eb));background:color-mix(in srgb,var(--dshcs-accent) 8%,transparent)}.dshcs-artbtn:active{transform:scale(.94)}.dshcs-artbtn:focus-visible{outline:2px solid color-mix(in srgb,var(--dshcs-accent) 65%,transparent);outline-offset:1px}.dshcs-artifacts{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:6px 8px;margin-top:16px;font-size:13px;line-height:22px;position:relative}.dshcs-artlabel{color:var(--dsw-alias-label-tertiary,#7d8798);grid-area:1/1}.dshcs-artrow{flex-wrap:nowrap;grid-area:1/2;align-items:center;gap:8px;min-width:0;display:flex;overflow:hidden}.dshcs-artitem{display:inline-flex;align-items:center;gap:4px;flex:none;min-width:0}.dshcs-artfile{text-overflow:ellipsis;white-space:nowrap;background:var(--dsw-alias-interactive-bg-hover);max-width:320px;color:var(--dsw-alias-label-secondary,#566174);font:inherit;cursor:pointer;border:none;border-radius:6px;margin:0;padding:0 8px;overflow:hidden}.dshcs-artfile:hover{color:var(--dsw-alias-label-primary,#172033);text-decoration:underline}.dshcs-artfile:focus-visible{box-shadow:inset 0 0 0 2px var(--dsw-alias-border-l3);outline:none}.dshcs-artmore{white-space:nowrap;color:var(--dsw-alias-label-tertiary,#7d8798);flex:none}.dshcs-body{position:relative;display:flex;flex:1;min-width:0;min-height:0;flex-direction:column;background:var(--dsw-alias-bg-base,#fff)}.dshcs-body[hidden]{display:none}.dshcs-frame{display:block;position:absolute;inset:0;z-index:1;width:100%;height:100%;border:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-loading{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-tertiary,#7d8798);font-size:13px}.dshcs-win-hidden{pointer-events:none!important}.dshcs-empty{position:relative;z-index:2;flex:1;display:flex;align-items:center;justify-content:center;padding:44px 24px 24px}.dshcs-emptybox{max-width:560px;text-align:left;background:var(--dsw-alias-bg-layer-2,#f7f8fb);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;padding:16px 18px}.dshcs-error{color:var(--dsw-alias-label-error,#d92d20);white-space:pre-wrap;word-break:break-all;font-family:ui-monospace,Consolas,monospace;font-size:12px;margin:8px 0 0}.dshcs-hint{color:var(--dsw-alias-label-tertiary,#7d8798);font-size:12px;margin:6px 0 0}.dshcs-resize{position:absolute;z-index:24;display:block;touch-action:none}.dshcs-resize-n,.dshcs-resize-s{left:16px;right:16px;height:10px;cursor:ns-resize}.dshcs-resize-n{top:0}.dshcs-resize-s{bottom:0}.dshcs-resize-w,.dshcs-resize-e{top:16px;bottom:16px;width:10px;cursor:ew-resize}.dshcs-resize-w{left:0}.dshcs-resize-e{right:0}.dshcs-resize-nw,.dshcs-resize-ne,.dshcs-resize-sw,.dshcs-resize-se{width:18px;height:18px}.dshcs-resize-nw{left:0;top:0;cursor:nwse-resize}.dshcs-resize-ne{right:0;top:0;cursor:nesw-resize}.dshcs-resize-sw{left:0;bottom:0;cursor:nesw-resize}.dshcs-resize-se{right:0;bottom:0;cursor:nwse-resize}.dshcs-resize-se::after{content:"";position:absolute;right:4px;bottom:4px;width:7px;height:7px;border-right:1.5px solid color-mix(in srgb,var(--dsw-alias-label-tertiary,#7d8798) 58%,transparent);border-bottom:1.5px solid color-mix(in srgb,var(--dsw-alias-label-tertiary,#7d8798) 58%,transparent);border-radius:0 0 2px}.dshcs-ball{position:fixed;width:38px;height:38px;padding:0;border:1px solid color-mix(in srgb,var(--dsw-alias-border-l2,#dfe3eb) 80%,transparent);border-radius:50%;display:grid;place-items:center;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;z-index:2147483002;background:color-mix(in srgb,var(--dsw-alias-bg-layer-2,#f2f4f8) 88%,transparent);backdrop-filter:blur(8px) saturate(1.2);box-shadow:0 8px 20px rgba(13,22,38,.18),0 1px 2px rgba(13,22,38,.1);transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease}.dshcs-ball img,.dshcs-ball svg{-webkit-user-drag:none;user-drag:none}.dshcs-ball[data-dragging]{cursor:grabbing;transform:scale(1.06);box-shadow:0 14px 28px rgba(13,22,38,.28),0 2px 6px rgba(13,22,38,.16)}.dshcs-ball:hover{transform:scale(1.06);box-shadow:0 10px 24px rgba(13,22,38,.22),0 1px 2px rgba(13,22,38,.1)}.dshcs-ball:active{transform:scale(.94)}.dshcs-ball:focus-visible{outline:2px solid color-mix(in srgb,var(--dshcs-accent) 65%,transparent);outline-offset:2px}.dshcs-ball-open{background:color-mix(in srgb,var(--dshcs-accent) 14%,var(--dsw-alias-bg-layer-2,#f2f4f8));border-color:color-mix(in srgb,var(--dshcs-accent) 55%,var(--dsw-alias-border-l2,#dfe3eb));box-shadow:0 0 0 3px color-mix(in srgb,var(--dshcs-accent) 22%,transparent),0 0 20px color-mix(in srgb,var(--dshcs-accent) 38%,transparent),0 8px 20px rgba(13,22,38,.16);transform:scale(1.08)}.dshcs-ball-dot{position:absolute;top:-2px;right:-2px;width:9px;height:9px;border-radius:50%;background:#20a66a;border:2px solid var(--dsw-alias-bg-base,#fff)}.dshcs-ball-dot[data-status=starting]{background:#d78b25}.dshcs-ball-dot[data-status=error]{background:#f85149}.dshcs-ball-dot[data-status=idle]{background:#7d8798}.dshcs-ball-dot[data-status=running]::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:1px solid currentColor;opacity:.3;animation:dshcs-pulse 2s ease-out infinite}.dshcs-tabroot{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;background:var(--dsw-alias-bg-base,#fff)}@keyframes dshcs-pulse{0%{transform:scale(.7);opacity:.35}70%,100%{transform:scale(1.65);opacity:0}}',sc="dsh-code-server/styles";typeof document!="undefined"&&document.querySelector("style[data-dshcs="+JSON.stringify(sc)+"]")===null&&(di=document.createElement("style"),di.setAttribute("data-dshcs",sc),di.textContent=bm,document.head.appendChild(di));var di;function wm(e){var[t,r]=h.useState(!1),n=h.useRef(e.url);return h.useEffect(function(){n.current!==e.url&&(n.current=e.url,r(!1))},[e.url]),e.url!=null&&t!==!0?h.createElement("img",{src:e.url,key:"img-"+e.url,alt:"","aria-hidden":!0,draggable:!1,onError:function(){r(!0)},style:{width:20,height:20,display:"block",objectFit:"contain",borderRadius:3,WebkitUserDrag:"none",userSelect:"none"}}):h.createElement("svg",{viewBox:"0 0 18 18","aria-hidden":!0,style:{width:17,height:17}},h.createElement("rect",{x:"3",y:"3",width:"12",height:"12",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:1.4}),h.createElement("path",{d:"M3 7h12M7 3v12",fill:"none",stroke:"currentColor",strokeWidth:1.4}))}var je=38,Ae=8,gc="dshcs-ball-pos";function pi(e){var t=Math.max(Ae,window.innerWidth-Ae-je),r=Math.max(Ae,window.innerHeight-Ae-je);return{x:Math.min(t,Math.max(Ae,e.x)),y:Math.min(r,Math.max(Ae,e.y))}}function Tm(){try{var e=window.localStorage.getItem(gc);if(e==null)return null;var t=JSON.parse(e);if(t!=null&&typeof t.x=="number"&&typeof t.y=="number"&&isFinite(t.x)&&isFinite(t.y))return pi(t)}catch(r){}return null}function Sm(e){try{window.localStorage.setItem(gc,JSON.stringify(e))}catch(t){}}function Vm(e){var t=Nr(),r=t.status,n=r!=null?r.env:null,i=r!=null&&r.running===!0,s=i?"running":r!=null&&r.status==="starting"?"starting":r!=null&&r.status==="error"?"error":"idle",o=Ho(r!=null?r.reserveComposer:!0),a=t.open===!0,c=Ko,[u,l]=h.useState(Tm),[f,m]=h.useState(!1),d=h.useRef(null),p=h.useRef(!1);if(h.useEffect(function(){var g=function(){l(function(S){return S==null?S:pi(S)})};return window.addEventListener("resize",g),function(){window.removeEventListener("resize",g)}},[]),h.useEffect(function(){var g=u!=null?u:(function(){var S=Ho(r!=null?r.reserveComposer:!0);return{x:window.innerWidth-Ae-je,y:window.innerHeight-Ae-je-(S>0?S+10:18)}})();_({ballPos:pi(g)})},[u,r]),n!=null&&n.ok!==!0||t.sidebarActive===!0)return null;var x=function(g){if(g.button===0){var S=g.currentTarget,E=S.getBoundingClientRect();d.current={pointerId:g.pointerId,dx:g.clientX-E.left,dy:g.clientY-E.top,moved:!1},p.current=!1,m(!0);try{S.setPointerCapture(g.pointerId)}catch(A){}}},y=function(g){var S=d.current;if(!(S==null||g.pointerId!==S.pointerId)){var E=g.clientX-S.dx,A=g.clientY-S.dy;(Math.abs(E-(u!=null?u.x:0))>2||Math.abs(A-(u!=null?u.y:0))>2)&&(S.moved=!0),l(pi({x:E,y:A}))}},v=function(){var g=d.current;d.current=null,m(!1),g!=null&&g.moved===!0&&(p.current=!0),g!=null&&g.moved===!0&&l(function(S){return S!=null&&Sm(S),S})},b=function(){if(p.current===!0){p.current=!1;return}if(r!=null&&r.windowedOpen===!0){dc(gi(e&&e.useSessions,e&&e.useWorkspaces));return}_({open:!a})},w=u!=null?{left:u.x,top:u.y}:{right:14,bottom:o>0?o+10:18};return uc.createPortal(h.createElement("button",{type:"button",className:"dshcs-ball"+(a?" dshcs-ball-open":""),style:w,"data-dragging":f===!0?"":void 0,title:r!=null&&r.windowedOpen===!0?"\u5728\u6D4F\u89C8\u5668\u65B0\u6807\u7B7E\u9875\u6253\u5F00 Code Server(\u53EF\u62D6\u52A8)":a?"\u6536\u8D77 Code Server(Esc)":"\u6253\u5F00 Code Server(\u53EF\u62D6\u52A8)","aria-label":a?"\u6536\u8D77 Code Server(Esc)":"\u6253\u5F00 Code Server","aria-expanded":a,onPointerDown:x,onPointerMove:y,onPointerUp:v,onPointerCancel:v,onDragStart:function(g){g&&g.preventDefault&&g.preventDefault()},onClick:b},h.createElement(wm,{url:c}),h.createElement("span",{className:"dshcs-ball-dot","data-status":s,"aria-hidden":!0})),document.body)}function Cm(e){var t=Nr(),r=t.status,n=r!=null&&r.ok===!0&&r.running===!0,i=r!=null&&r.status==="starting",s=r!=null&&r.ok===!1,o=gi(e&&e.useSessions,e&&e.useWorkspaces),a=h.useRef(void 0),[c,u]=h.useState(0),l=Ho(r!=null?r.reserveComposer:!0),[f,m]=h.useState(!1),[d,p]=h.useState(null),[x,y]=h.useState(function(){return gm(0,Me(),l)}),v=h.useRef(x),b=h.useRef(function(){});v.current=x,h.useEffect(function(){var D=function(){y(function(ee){return f?mi(Me(),l):Ht(ee,Me(),l)})};return window.addEventListener("resize",D),function(){window.removeEventListener("resize",D)}},[f,l]),h.useEffect(function(){y(function(D){return Ht(D,Me(),l)})},[l]),h.useEffect(function(){return function(){b.current()}},[]);var w=12,g=4,[S,E]=h.useState(!1),A=h.useRef(null),V=function(D,ee){if(D.button===0){D.preventDefault(),D.stopPropagation(),b.current();var oe=D.currentTarget.ownerDocument.defaultView;if(oe!==null){var de=D.pointerId,Fr=D.currentTarget,Yo=f,_t=Yo?mi(Me(),l):v.current,wc=_t.width>0?(D.clientX-_t.x)/_t.width:0,Tc=Math.min(14,Math.max(0,D.clientY-_t.y)),F={pointerId:de,origin:{x:D.clientX,y:D.clientY},start:_t,ratio:wc,grabY:Tc,wasMaximized:Yo,restored:!1,snapped:!1,moved:!1};A.current=F,p(ee);try{Fr.setPointerCapture(de)}catch(le){}var $o=function(le){if(le.pointerId===de){if(ee!=="move"){y(vm(F.start,ee,le.clientX-F.origin.x,le.clientY-F.origin.y,Me(),l));return}var qo=le.clientX-F.origin.x,zr=le.clientY-F.origin.y;if(Math.abs(qo)+Math.abs(zr)>3&&(F.moved=!0),F.wasMaximized&&!F.restored){if(zr<g)return;var vi=v.current,Gr={x:le.clientX-vi.width*Math.min(.9,Math.max(.1,F.ratio)),y:le.clientY-F.grabY,width:vi.width,height:vi.height};Gr=Ht(Gr,Me(),l),F.restored=!0,F.start=Gr,F.origin={x:le.clientX,y:le.clientY},m(!1),y(Gr);return}var Sc=F.start.y+zr,Vc=ym(F.start,qo,zr,Me(),l);y(Vc);var bi=Sc<=w;bi!==F.snapped&&(F.snapped=bi,E(bi))}},Xo=function(){oe.removeEventListener("pointermove",$o),oe.removeEventListener("pointerup",jr),oe.removeEventListener("pointercancel",jr),b.current=function(){},A.current=null;try{Fr.releasePointerCapture(de)}catch(le){}},jr=function(le){le.pointerId===de&&(Xo(),p(null),(!F.wasMaximized||F.restored===!0)&&(F.snapped===!0&&F.moved===!0&&m(!0),F.snapped===!0&&E(!1)))};b.current=Xo,oe.addEventListener("pointermove",$o),oe.addEventListener("pointerup",jr),oe.addEventListener("pointercancel",jr)}}},L=function(){m(function(D){return!D})},C=function(D){D.target.closest("[data-window-control]")===null&&V(D,"move")},I=function(D){D.target.closest("[data-window-control]")===null&&L()};if(h.useEffect(function(){if(!t.open||t.sidebarActive===!0)return;var D=!1;async function ee(){_({busy:!0});var oe=await fe("/code-server/status");if(!D){if(oe!=null&&oe.ok===!0&&oe.running===!0){_({status:oe,busy:!1});return}var de=await fe("/code-server/start",typeof o=="string"?{cwd:o}:{});D||_({status:de,busy:!1})}}return ee(),function(){D=!0}},[t.open,t.sidebarActive]),h.useEffect(function(){if(t.sidebarActive===!0||typeof o!="string"||o===""||a.current===o)return;var D=a.current!==void 0&&a.current!==o;a.current=o;var ee=!1;async function oe(){_({busy:!0});var de=await fe("/code-server/start",{cwd:o});ee||(_({status:de,busy:!1}),D&&de!=null&&de.ok===!0&&de.running===!0&&u(function(Fr){return Fr+1}))}return oe(),function(){ee=!0}},[o,t.sidebarActive]),h.useEffect(function(){t.open||(a.current=void 0)},[t.open]),h.useEffect(function(){if(t.sidebarActive!==!0){var D=window.setInterval(function(){fe("/code-server/status").then(function(ee){_({status:ee})})},3e3);return function(){window.clearInterval(D)}}},[t.sidebarActive]),h.useEffect(function(){if(!t.open)return;function D(ee){ee.key==="Escape"&&_({open:!1})}return window.addEventListener("keydown",D),function(){window.removeEventListener("keydown",D)}},[t.open]),t.sidebarActive===!0)return null;var R=r!=null&&typeof r.url=="string"?r.url:null,H=n&&r!=null&&typeof r.cwd=="string"&&r.cwd!==""?r.cwd:null,J=null;if(H!==null){var re=H.replace(/\\/g,"/");J=re,(/^[A-Za-z]:\//.test(re)||re.charCodeAt(0)!==47)&&(J="/"+re)}var me=R!==null?R+(J!==null?"?folder="+encodeURIComponent(J):""):null,_o=mc(r,me,c),Y=["dshcs-win",f?"dshcs-win-max":"",S?"dshcs-win-snap":"",t.open===!1?"dshcs-win-hidden":""].filter(Boolean).join(" "),B=f?mi(Me(),l):x,we=t.ballPos!=null?t.ballPos:{x:window.innerWidth-Ae-je,y:window.innerHeight-Ae-je-(l>0?l+10:18)},De={x:we.x+je/2,y:we.y+je/2},yi=Math.max(.05,je/Math.max(B.width,B.height)),xc=t.open===!1?{x:De.x-B.width/2,y:De.y-B.height/2,width:B.width,height:B.height,scale:yi,borderRadius:19,opacity:0}:{x:B.x,y:B.y,width:B.width,height:B.height,scale:1,borderRadius:12,opacity:1},yc=d!==null?{duration:0}:{type:"spring",stiffness:340,damping:38,mass:.9,opacity:{type:"spring",stiffness:420,damping:40,mass:.8},borderRadius:{duration:.2}},vc=h.createElement(jo.section,{className:Y,style:t.open===!1?{left:0,top:0,pointerEvents:"none"}:{left:0,top:0},animate:xc,initial:!1,transition:yc,"data-interaction":d!==null?d:void 0,role:"dialog","aria-label":"Code Server"},h.createElement("span",{className:"dshcs-drag",title:"\u62D6\u52A8\u79FB\u52A8 / \u53CC\u51FB\u6700\u5927\u5316",onPointerDown:C,onDoubleClick:I}),h.createElement("div",{className:"dshcs-body"},_o),f?null:dm.map(function(D){return h.createElement("span",{key:D,className:"dshcs-resize dshcs-resize-"+D,"data-direction":D,onPointerDown:function(ee){V(ee,D)}})})),Br=mi(Me(),l),bc=h.createElement(jo.div,{className:"dshcs-snapghost",initial:!1,animate:{opacity:S===!0?1:0,x:Br.x,y:Br.y,width:Br.width,height:Br.height},transition:S===!0?{type:"spring",stiffness:500,damping:44,mass:.9}:{duration:.14}},h.createElement("span",{className:"dshcs-snapghint"},"\u677E\u5F00\u4EE5\u6700\u5927\u5316"));return uc.createPortal(h.createElement(h.Fragment,null,vc,bc),document.body)}var zo="code-server",ac="dsh-code-server-app",Kt={openTab:null};function Pm(e){var t=e!=null&&typeof e.size=="number"?e.size:16;return h.createElement("img",{src:Ko,alt:"","aria-hidden":!0,draggable:!1,className:e!=null?e.className:void 0,style:{width:t,height:t,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function Em(e){var t=e.useTabInfo(),r=t.tab,n=Nr(),i=n.status,s=gi(e.useSessions,null),o=h.useRef(void 0),[a,c]=h.useState(0),u=r.navigation,l=u!=null&&typeof u.revision=="number"?u.revision:0;return h.useEffect(function(){if(!(typeof s!="string"||s==="")&&o.current!==s){var f=o.current!==void 0;o.current=s;var m=!1;return fe("/code-server/start",{cwd:s}).then(function(d){m||(_({status:d}),f&&d!=null&&d.ok===!0&&d.running===!0&&c(function(p){return p+1}))}).catch(function(){}),function(){m=!0}}},[s]),h.useEffect(function(){fe("/code-server/status").then(function(m){m!=null&&_({status:m})}).catch(function(){});var f=window.setInterval(function(){fe("/code-server/status").then(function(m){_({status:m})}).catch(function(){})},3e3);return function(){window.clearInterval(f)}},[]),h.useEffect(function(){var f=u!=null?u.params:null,m=f!=null&&typeof f.path=="string"?f.path:"";m!==""&&fe("/code-server/open-file",{file:m}).catch(function(){})},[l]),h.createElement("div",{className:"dshcs-tabroot","data-code-server-tab":"body"},mc(i,fc(i,s),a))}function Mm(e){var t=e.sidebarRightTabs,r=e.sidebarRight;t==null||r==null||(e.effect(function(){return t.register({id:ac,kind:zo,priority:"extension",title:function(){return"Code Server"},guide:[{order:20,title:function(){return"Code Server"},description:function(){return"\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC\u8FD0\u884C VS Code \u7F51\u9875\u7248,\u8DDF\u968F\u5F53\u524D\u4F1A\u8BDD\u5DE5\u4F5C\u533A\u3002"},icon:Pm}]})},"code-server: sidebar tab type"),e.effect(function(){return e.slots.inject("sidebar.right.pane.tab",function(){return e.slots.register({name:"sidebar.right.pane.tab",key:ac},Em)})},"code-server: sidebar tab body"),Kt.openTab=function(n){try{return r.openTab(zo,n!=null?{params:n}:void 0),!0}catch(i){return console.warn("[code-server] sidebar openTab failed:",i!=null&&i.message!=null?i.message:String(i)),!1}},e.effect(function(){return function(){Kt.openTab=null,_({sidebarActive:!1})}},"code-server: sidebar mode reset"),_({sidebarActive:!0,open:!1}),console.log("[code-server] right-sidebar tab registered (kind="+zo+")"))}var Am=".dshcs-card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.dshcs-card:hover{border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardHeader{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dshcs-cardHeader:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.dshcs-cardHeadText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dshcs-cardName{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.dshcs-cardDescription{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-size:13px;line-height:1.5}.dshcs-cardChevron{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));flex:none;transition:transform .16s;display:inline-flex}.dshcs-cardChevronOpen{transform:rotate(180deg)}.dshcs-cardBody{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.dshcs-cardReadOnly{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:12px 0 0;font-size:12px;line-height:1.5}.dshcs-pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-cardFooter{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.dshcs-cardFailed{min-width:0;color:var(--dsw-alias-label-error,var(--dsw-alias-state-error-primary));flex:1;margin:0;font-size:12px;line-height:1.5}.dshcs-cbtn{appearance:none;font:inherit;cursor:pointer;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5;border:1px solid transparent;transition:color .12s ease,background .12s ease}.dshcs-cbtn:disabled{opacity:.4;cursor:default}.dshcs-cbtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.dshcs-cbtnOutline{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.dshcs-cbtnOutline:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover,transparent)}.dshcs-cbtnPrimary{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-primary);font-weight:600}.dshcs-cbtnPrimary:hover:not(:disabled){filter:brightness(.95)}.dshcs-cbtnPrimary:active:not(:disabled){filter:brightness(.9)}.dshcs-field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.dshcs-field+.dshcs-field{border-top:1px solid var(--dsw-alias-border-l2)}.dshcs-fieldHead{align-items:center;gap:8px;display:flex}.dshcs-fieldLabel{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.dshcs-hint{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:0;font-size:12px;line-height:1.5}.dshcs-check{display:flex;align-items:center;gap:8px;cursor:pointer}.dshcs-check input{accent-color:var(--dsw-alias-brand-primary);width:15px;height:15px;margin:0;flex:none}.dshcs-check input:disabled{cursor:default}.dshcs-badges{align-items:center;gap:8px;display:inline-flex}.dshcs-badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.dshcs-reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.dshcs-reset:disabled{cursor:default}",Dm="dsh-code-server/Card.module.css";function Rm(e,t){if(typeof document!="undefined"&&document.querySelector("style[data-plugin-css="+JSON.stringify(e)+"]")===null){var r=document.createElement("style");r.dataset.plugin="dsh-code-server",r.dataset.pluginCss=e,r.textContent=t,document.head.appendChild(r)}}Rm(Dm,Am);function km(e){return h.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,className:e.className},h.createElement("path",{d:"M3.5 5.25L7 8.75L10.5 5.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))}function hi(e){return h.createElement("button",{type:"button",className:"dshcs-cbtn "+(e.variant==="primary"?"dshcs-cbtnPrimary":"dshcs-cbtnOutline"),disabled:e.disabled===!0,onClick:e.onClick},e.children)}function lc(e){return h.createElement("label",{className:"dshcs-check"},h.createElement("input",{type:"checkbox",checked:e.checked===!0,disabled:e.disabled===!0,onChange:function(t){e.onChange(t.target.checked)}}),h.createElement("span",{className:"dshcs-hint"},e.children))}function cc(e){var t=[];return e.overridden===!0&&(t.push(h.createElement("span",{className:"dshcs-badge"},e.overriddenLabel)),t.push(h.createElement("button",{type:"button",className:"dshcs-reset",disabled:e.disabled===!0,onClick:e.onReset},e.resetLabel))),t.length===0?null:h.createElement("span",{className:"dshcs-badges"},...t)}function Lm(e){var[t,r]=h.useState(!1),n=e.state;if(n==null||n.available!==!0)return null;var i=e.title,s=n.dirty!==!0||n.invalid===!0||n.saving===!0;return h.createElement("li",{className:"dshcs-card"+(t?" dshcs-cardOpen":"")},h.createElement("button",{type:"button",className:"dshcs-cardHeader","aria-expanded":t,onClick:function(){r(!t)}},h.createElement("span",{className:"dshcs-cardHeadText"},h.createElement("span",{className:"dshcs-cardName"},i),h.createElement("span",{className:"dshcs-cardDescription"},e.description)),n.dirty===!0?h.createElement("span",{className:"dshcs-pending"},e.unsavedLabel):null,h.createElement(km,{className:"dshcs-cardChevron"+(t?" dshcs-cardChevronOpen":"")})),t===!0?h.createElement("div",{className:"dshcs-cardBody"},n.writable!==!0?h.createElement("p",{className:"dshcs-cardReadOnly",role:"status"},e.readOnlyLabel):null,e.children,h.createElement("div",{className:"dshcs-cardFooter"},n.failed===!0?h.createElement("p",{className:"dshcs-cardFailed",role:"status"},e.saveFailedLabel):null,h.createElement(hi,{disabled:n.dirty!==!0||n.saving===!0,onClick:e.onDiscard},e.discardLabel),h.createElement(hi,{variant:"primary",disabled:s,onClick:e.onSave},n.saving===!0?e.savingLabel:e.saveLabel))):null)}function Im(e){try{let L=function(){fe("/code-server/status").then(function(R){R!=null&&typeof R=="object"&&_({status:R})}).catch(function(){})};var t=e.scope,[r,n]=h.useState(function(){return t!==void 0?t.getSnapshot():null}),[i,s]=h.useState(null),[o,a]=h.useState(!1),[c,u]=h.useState(!1),l=Nr();if(h.useEffect(function(){if(t===void 0||typeof t.subscribe!="function")return;function R(){try{n(t.getSnapshot())}catch(J){}}var H=t.subscribe(R);return function(){typeof H=="function"&&H()}},[t]),t===void 0)return console.error("[code-server] card scope missing"),null;if(r==null||r.status!=="ready")return r!=null&&r.status==="unavailable"&&console.warn("[code-server] settings scope unavailable:",r.status),null;var f=r.value!==void 0&&r.value!==null?r.value:{},m=r.user,d={reserveComposer:f.reserveComposer!==!1,windowedOpen:f.windowedOpen===!0},p=m!=null&&Object.prototype.hasOwnProperty.call(m,"reserveComposer"),x=m!=null&&Object.prototype.hasOwnProperty.call(m,"windowedOpen"),y=l!=null&&l.sidebarActive===!0,v=i!==null&&(i.reserveComposer!==d.reserveComposer||i.windowedOpen!==d.windowedOpen),b=!v||o,w={available:!0,writable:r.writable,dirty:v,invalid:!1,saving:o,failed:c,reserveComposer:{text:i!==null?i.reserveComposer:d.reserveComposer,overridden:p}};async function C(){if(v&&!o){a(!0),u(!1);try{var R=i!==null?i:d;await e.scope.set("reserveComposer",R.reserveComposer===!0),await e.scope.set("windowedOpen",R.windowedOpen===!0),s(null),L()}catch(H){u(!0)}a(!1)}}async function I(){if(!(o||r.writable!==!0)){a(!0),u(!1);try{typeof e.scope.unset=="function"?(await e.scope.unset("reserveComposer"),await e.scope.unset("windowedOpen")):(await e.scope.set("reserveComposer",f.reserveComposer===void 0||f.reserveComposer===null?!0:f.reserveComposer),await e.scope.set("windowedOpen",f.windowedOpen===!0)),s(null),L()}catch(R){u(!0)}a(!1)}}var[g,S]=h.useState(null),[E,A]=h.useState(!1),V=h.createElement("div",{className:"dshcs-field"},h.createElement("div",{className:"dshcs-fieldHead"},h.createElement("span",{className:"dshcs-fieldLabel"},"\u73AF\u5883\u68C0\u6D4B"),h.createElement("span",{className:"dshcs-badges"},h.createElement(hi,{variant:"primary",disabled:E,onClick:async function(){A(!0);var R=await fe("/code-server/status");S(R!=null&&R.env!=null?R.env:{error:"status \u672A\u8FD4\u56DE env"}),A(!1)}},E?"\u68C0\u6D4B\u4E2D\u2026":"\u68C0\u6D4B\u73AF\u5883"))),g!=null?h.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},g.error!=null?h.createElement("span",null,"\u68C0\u6D4B\u5931\u8D25: "+g.error):h.createElement("span",null,"\u72B6\u6001: "+(g.ok===!0?"\u2705 \u5C31\u7EEA":"\u274C \u4E0D\u901A\u8FC7")+(g.treeVersion!=null?" \xB7 VS Code \u6811: "+g.treeVersion:"")+(g.upToDate===!1&&g.vendored!=null?"(\u5185\u7F6E "+g.vendored+") ":"")+(g.productPath!=null?" \xB7 \u5BA2\u6237\u7AEF\u8DEF\u5F84: "+g.productPath:"")+(g.entry!=null?" \xB7 \u5165\u53E3: "+g.entry:" \xB7 \u5165\u53E3\u7F3A\u5931")+" \xB7 VS Code \u5185\u90E8\u4F9D\u8D56: "+(g.vscodeInner===!0?"\u2705":"\u274C")+" \xB7 \u9884\u7F16\u8BD1\u539F\u751F\u5305: "+(g.nativeRuntime!=null&&g.nativeRuntime.packages>0?"\u2705 "+g.nativeRuntime.name+"@"+(g.nativeRuntime.version!=null?g.nativeRuntime.version:"?")+"("+g.nativeRuntime.packages+" \u5305)":"\u274C \u672A\u5B89\u88C5("+(g.nativeRuntime!=null&&g.nativeRuntime.name!=null?g.nativeRuntime.name:"\u5E73\u53F0\u805A\u5408\u5305")+")"))):h.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},'\u70B9\u51FB"\u68C0\u6D4B\u73AF\u5883"\u67E5\u770B VS Code \u6811\u72B6\u6001(\u4F9D\u8D56\u7531\u5305\u7BA1\u7406\u5668\u5B89\u88C5,\u65E0\u9700\u5B89\u88C5\u6B65\u9AA4)'),h.createElement("div",{className:"dshcs-hint",style:{marginTop:10,color:"var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary))"}},"\u8FD0\u884C\u4F4D\u7F6E: "+(g!=null&&g.tree!=null?g.tree:"<\u63D2\u4EF6\u76EE\u5F55>\\vendor\\vscode")+`
3
- \u5378\u8F7D: dsh plugin --profile web remove dsh-code-server-app`));return h.createElement(Lm,{title:"Code Server",description:"\u5165\u53E3:\u53F3\u4FA7\u680F\u6807\u7B7E(DSH \u2265 0.1.5-alpha.1)/ \u60AC\u6D6E\u7403\u56DE\u9000;\u7A97\u53E3\u5316\u8BBE\u7F6E\u63A7\u5236\u65B0\u6807\u7B7E\u9875\u6253\u5F00",state:w,unsavedLabel:"\u672A\u4FDD\u5B58",readOnlyLabel:"\u672C\u90E8\u7F72\u7684\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u3002",saveFailedLabel:"\u672C\u90E8\u7F72\u6CA1\u6709\u63A5\u53D7\u8FD9\u4E9B\u503C\uFF0C\u5DF2\u4FDD\u7559\u4F9B\u4F60\u4FEE\u6539\u3002",discardLabel:"\u653E\u5F03\u4FEE\u6539",saveLabel:"\u4FDD\u5B58",savingLabel:"\u4FDD\u5B58\u4E2D\u2026",onSave:C,onDiscard:function(){s(null),u(!1)}},h.createElement("div",{className:"dshcs-field"},h.createElement("div",{className:"dshcs-fieldHead"},h.createElement("span",{className:"dshcs-fieldLabel"},"\u5165\u53E3"),h.createElement("span",{className:"dshcs-badges"},h.createElement(hi,{disabled:y!==!0,onClick:function(){Kt.openTab!==null&&Kt.openTab(null)}},"\u5728\u53F3\u4FA7\u680F\u6253\u5F00"))),h.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},y===!0?"\u5F53\u524D:\u53F3\u4FA7\u680F\u6807\u7B7E(DSH \u2265 0.1.5-alpha.1)\u3002\u4ECE\u53F3\u4FA7\u680F\u300C\u5F00\u59CB\u300D\u9875\u7684 Code Server \u5165\u53E3\u6846\u3001\u4EA7\u7269\u65C1\u6309\u94AE\u6216\u4E0A\u9762\u7684\u6309\u94AE\u6253\u5F00\u3002":"\u5F53\u524D:\u60AC\u6D6E\u7403(\u672C\u90E8\u7F72\u65E0\u53F3\u4FA7\u680F\u670D\u52A1)\u3002\u70B9\u51FB\u53F3\u4E0B\u89D2\u60AC\u6D6E\u7403\u5C55\u5F00\u6D6E\u7A97\u3002")),y===!0?null:h.createElement("div",{className:"dshcs-field"},h.createElement("div",{className:"dshcs-fieldHead"},h.createElement("span",{className:"dshcs-fieldLabel"},"\u4FDD\u7559\u8F93\u5165\u6846\u4E0A\u65B9\u7A7A\u95F4"),p===!0?h.createElement(cc,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){I()}}):null),h.createElement(lc,{checked:i!==null?i.reserveComposer:d.reserveComposer,disabled:r.writable!==!0,onChange:function(R){s(function(H){return Object.assign({},H!==null?H:d,{reserveComposer:R===!0})}),u(!1)}},"\u5F00\u542F\u65F6\u7A97\u53E3\u521D\u59CB/\u7F29\u653E/\u6700\u5927\u5316\u6B62\u4E8E\u8F93\u5165\u6846\u4E0A\u65B9;\u5173\u95ED\u540E\u5141\u8BB8\u76D6\u4F4F\u8F93\u5165\u6846(\u6700\u5927\u5316\u5230\u89C6\u53E3\u5E95)")),h.createElement("div",{className:"dshcs-field"},h.createElement("div",{className:"dshcs-fieldHead"},h.createElement("span",{className:"dshcs-fieldLabel"},"\u7A97\u53E3\u5316\u6253\u5F00(\u65B0\u6807\u7B7E\u9875)"),x===!0?h.createElement(cc,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){I()}}):null),h.createElement(lc,{checked:i!==null?i.windowedOpen:d.windowedOpen,disabled:r.writable!==!0,onChange:function(R){s(function(H){return Object.assign({},H!==null?H:d,{windowedOpen:R===!0})}),u(!1)}},"\u5F00\u542F\u540E\u5165\u53E3(\u4EA7\u7269\u6309\u94AE/\u8BBE\u7F6E\u5361/\u60AC\u6D6E\u7403)\u5728\u6D4F\u89C8\u5668\u65B0\u6807\u7B7E\u9875\u6253\u5F00 code-server(\u81EA\u52A8\u542F\u52A8\u5E76\u8DDF\u968F\u5F53\u524D\u5DE5\u4F5C\u533A);\u5173\u95ED\u5219\u4F7F\u7528\u53F3\u4FA7\u680F\u6807\u7B7E\u6216\u5185\u90E8\u6D6E\u52A8\u7A97\u53E3")),h.createElement("div",{className:"dshcs-field"},h.createElement("div",{className:"dshcs-fieldHead"},h.createElement("span",{className:"dshcs-fieldLabel"},"\u4F9D\u8D56\u5B89\u88C5"),null),h.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},"0.1.36 \u8D77 code-server \u672C\u4F53\u968F\u63D2\u4EF6\u5305\u53D1\u5E03,VS Code \u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757(\u5E73\u53F0\u805A\u5408\u5305)\u5168\u90E8\u7531\u5305\u7BA1\u7406\u5668\u5728 dsh plugin add \u65F6\u5B89\u88C5,\u4E0D\u518D\u9700\u8981\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4\u3002")),V)}catch(L){return console.error("[code-server] card render error:",L!=null&&L.message!==void 0?L.message:String(L)),null}}function Om(e){var t=[];try{var r=e.turn.data.get("deliverables"),n=e.seq!=null?e.seq:Number.POSITIVE_INFINITY;if(r!=null&&Array.isArray(r.produced))for(var i={},s=0;s<r.produced.length;s++){var o=r.produced[s];o==null||typeof o.path!="string"||o.path===""||o.seq!=null&&o.seq>n||i[o.path]!==!0&&(i[o.path]=!0,t.push(o.path))}}catch(a){}return t}function Nm(e){var t=Om(e);return t.length===0?null:t}function Bm(e){return h.createElement("img",{src:Ko,alt:"","aria-hidden":!0,draggable:!1,style:{width:15,height:15,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function Fm(e){var t=Nr();if(e==null||!Array.isArray(e.matched)||e.matched.length===0)return null;var r=e.matched;function n(s){var o=String(s).replace(/\\/g,"/"),a=o.lastIndexOf("/");return a>=0?o.slice(a+1):o}function i(s){var o=t.status;if(o!=null&&o.windowedOpen===!0){dc(gi(e.useSessions,e.useWorkspaces));return}t.sidebarActive===!0&&Kt.openTab!==null&&Kt.openTab({path:s})===!0||(_({open:!0}),fe("/code-server/open-file",{file:s}).then(function(a){(a==null||a.ok!==!0)&&window.alert(a!=null&&a.error?a.error:"\u6253\u5F00\u5931\u8D25")}).catch(function(a){window.alert("\u6253\u5F00\u5931\u8D25: "+String(a))}))}return h.createElement("div",{className:"dshcs-artifacts"},h.createElement("span",{className:"dshcs-artlabel"},"\u4EA7\u7269"),h.createElement("div",{className:"dshcs-artrow"},r.slice(0,6).map(function(s){return h.createElement("span",{key:s,className:"dshcs-artitem"},h.createElement("button",{type:"button",className:"dshcs-artfile",title:s,"aria-label":"\u6253\u5F00: "+s,onClick:function(){i(s)}},n(s)),h.createElement("button",{type:"button",className:"dshcs-artbtn",title:"\u5728 Code Server \u6253\u5F00: "+s,"aria-label":"\u5728 Code Server \u6253\u5F00: "+s,onClick:function(){i(s)}},h.createElement(Bm,null)))}),r.length>6?h.createElement("span",{className:"dshcs-artmore"},"\u2026"):null))}function jm(e){try{zm(e)}catch(t){console.error("[code-server] apply failed:",t&&t.stack?t.stack:String(t));try{document.title="CS-ERR "+(t&&t.message||String(t))}catch(r){}}}function zm(e){var t=e.get("slots");if(t===void 0){console.error("[code-server] slots service unavailable");return}var r=e.settingsScope,n=null;if(r!==void 0&&typeof r.bind=="function")n=r.bind({namespace:"code-server"});else{console.error("[code-server] settingsScope unavailable (inject missing?); settings card disabled");return}fe("/code-server/status").then(function(i){_({status:i})}).catch(function(){}),t.inject("shell.overlay",()=>t.register({name:"shell.overlay",id:"code-server",order:70,label:"Code Server"},i=>h.createElement(h.Fragment,null,h.createElement(Vm,i),h.createElement(Cm,i))));try{t.inject("conversation.chat.turnTail",function(){return t.register({name:"conversation.chat.turnTail",priority:-9,id:"dshcs-open-file",select:Nm},Fm)}),console.log("[code-server] turnTail artifacts buttons registered")}catch(i){console.warn("[code-server] turnTail register failed:",i!=null&&i.message!=null?i.message:String(i))}t.inject("settings.plugin.item",()=>t.register({name:"settings.plugin.item",key:"code-server",label:"Code Server",inject:function(){return{scope:n}}},Im));try{typeof e.inject=="function"?e.inject(["sidebarRightTabs","sidebarRight"],function(i){try{Mm(i)}catch(s){console.warn("[code-server] sidebar tab registration failed; keep floating ball:",s!=null&&s.message!=null?s.message:String(s))}}):console.warn("[code-server] ctx.inject unavailable; keep floating ball")}catch(i){console.warn("[code-server] sidebar inject failed; keep floating ball:",i!=null&&i.message!=null?i.message:String(i))}console.log("[code-server] client bundle registered (floating ball + window + settings card; right-sidebar tab pending/active)")}var Gm=["slots","settingsScope"],Wm="code-server";
2
+ var Pi=Object.defineProperty;var jc=Object.getOwnPropertyDescriptor;var zc=Object.getOwnPropertyNames;var Gc=Object.prototype.hasOwnProperty;var Wc=(e,t)=>{for(var r in t)Pi(e,r,{get:t[r],enumerable:!0})},Uc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of zc(t))!Gc.call(e,i)&&i!==r&&Pi(e,i,{get:()=>t[i],enumerable:!(n=jc(t,i))||n.enumerable});return e};var Hc=e=>Uc(Pi({},"__esModule",{value:!0}),e);var pd={};Wc(pd,{apply:()=>ud,inject:()=>md,name:()=>dd});module.exports=Hc(pd);var cs=require("react"),Yr=(0,cs.createContext)({});var us=require("react");function fs(e){let t=(0,us.useRef)(null);return t.current===null&&(t.current=e()),t.current}var $r=require("react");var ms=typeof window!="undefined";var ds=ms?$r.useLayoutEffect:$r.useEffect;var ps=require("react"),Tt=(0,ps.createContext)(null);function nt(e,t){e.indexOf(t)===-1&&e.push(t)}function Ge(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}var Z=(e,t,r)=>r>t?t:r<e?e:r;var Re=()=>{},ae=()=>{};var ie={};var Xt=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e);var qt=e=>typeof e=="object"&&e!==null;var Zt=e=>/^0[^.\s]+$/u.test(e);function Jt(e){let t;return()=>(t===void 0&&(t=e()),t)}var G=e=>e;var be=(...e)=>e.reduce((t,r)=>n=>r(t(n)));var Se=(e,t,r)=>{let n=t-e;return n?(r-e)/n:1};var Le=class{constructor(){this.subscriptions=[]}add(t){return nt(this.subscriptions,t),()=>Ge(this.subscriptions,t)}notify(t,r,n){let i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,r,n);else for(let s=0;s<i;s++){let o=this.subscriptions[s];o&&o(t,r,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}};var _=e=>e*1e3,ee=e=>e/1e3;var Qt=(e,t)=>t?e*(1e3/t):0;var hs=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e,Kc=1e-7,_c=12;function Yc(e,t,r,n,i){let s,o,a=0;do o=t+(r-t)/2,s=hs(o,n,i)-e,s>0?r=o:t=o;while(Math.abs(s)>Kc&&++a<_c);return o}function We(e,t,r,n){if(e===t&&r===n)return G;let i=s=>Yc(s,0,1,e,r);return s=>s===0||s===1?s:hs(i(s),t,n)}var Xr=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2;var qr=e=>t=>1-e(1-t);var Zr=We(.33,1.53,.69,.99),St=qr(Zr),er=Xr(St);var tr=e=>e>=1?1:(e*=2)<1?.5*St(e):.5*(2-Math.pow(2,-10*(e-1)));var rr=e=>1-Math.sin(Math.acos(e)),nr=qr(rr),ir=Xr(rr);var Ei=We(.42,0,1,1),Mi=We(0,0,.58,1),or=We(.42,0,.58,1);var Ai=e=>Array.isArray(e)&&typeof e[0]!="number";var sr=e=>Array.isArray(e)&&typeof e[0]=="number";var gs={linear:G,easeIn:Ei,easeInOut:or,easeOut:Mi,circIn:rr,circInOut:ir,circOut:nr,backIn:St,backInOut:er,backOut:Zr,anticipate:tr},$c=e=>typeof e=="string",Jr=e=>{if(sr(e)){ae(e.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");let[t,r,n,i]=e;return We(t,r,n,i)}else if($c(e))return ae(gs[e]!==void 0,`Invalid easing type '${e}'`,"invalid-easing-type"),gs[e];return e};var ar=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function xs(e){let t=new Set,r=new Set,n=!1,i=!1,s=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function a(c){s.has(c)&&(u.schedule(c),e()),c(o)}let u={schedule:(c,l=!1,f=!1)=>{let d=f&&n?t:r;return l&&s.add(c),d.add(c),c},cancel:c=>{r.delete(c),s.delete(c)},process:c=>{if(o=c,n){i=!0;return}n=!0;let l=t;t=r,r=l,t.forEach(a),t.clear(),n=!1,i&&(i=!1,u.process(c))}};return u}var Xc=40;function Qr(e,t){let r=!1,n=!0,i={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,o=ar.reduce((w,v)=>(w[v]=xs(s),w),{}),{setup:a,read:u,resolveKeyframes:c,preUpdate:l,update:f,preRender:m,render:d,postRender:h}=o,g=()=>{let w=ie.useManualTiming,v=w?i.timestamp:performance.now();r=!1,w||(i.delta=n?1e3/60:Math.max(Math.min(v-i.timestamp,Xc),1)),i.timestamp=v,i.isProcessing=!0,a.process(i),u.process(i),c.process(i),l.process(i),f.process(i),m.process(i),d.process(i),h.process(i),i.isProcessing=!1,r&&t&&(n=!1,e(g))},x=()=>{r=!0,n=!0,i.isProcessing||e(g)};return{schedule:ar.reduce((w,v)=>{let C=o[v];return w[v]=(D,V=!1,P=!1)=>(r||x(),C.schedule(D,V,P)),w},{}),cancel:w=>{for(let v=0;v<ar.length;v++)o[ar[v]].cancel(w)},state:i,steps:o}}var{schedule:M,cancel:le,state:K,steps:lr}=Qr(typeof requestAnimationFrame!="undefined"?requestAnimationFrame:G,!0);var en;function qc(){en=void 0}var W={now:()=>(en===void 0&&W.set(K.isProcessing||ie.useManualTiming?K.timestamp:performance.now()),en),set:e=>{en=e,queueMicrotask(qc)}};var ys=e=>t=>typeof t=="string"&&t.startsWith(e),tn=ys("--"),Zc=ys("var(--"),Ct=e=>Zc(e)?Jc.test(e.split("/*")[0].trim()):!1,Jc=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Di(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}var Ce={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},Ie={...Ce,transform:e=>Z(0,1,e)},cr={...Ce,default:1};var Ue=e=>Math.round(e*1e5)/1e5;var Vt=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function vs(e){return e==null}var bs=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;var Pt=(e,t)=>r=>!!(typeof r=="string"&&bs.test(r)&&r.startsWith(e)||t&&!vs(r)&&Object.prototype.hasOwnProperty.call(r,t)),rn=(e,t,r)=>n=>{if(typeof n!="string")return n;let[i,s,o,a]=n.match(Vt);return{[e]:parseFloat(i),[t]:parseFloat(s),[r]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}};var Qc=e=>Z(0,255,e),ki={...Ce,transform:e=>Math.round(Qc(e))},Ve={test:Pt("rgb","red"),parse:rn("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+ki.transform(e)+", "+ki.transform(t)+", "+ki.transform(r)+", "+Ue(Ie.transform(n))+")"};function eu(e){let t="",r="",n="",i="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),i=e.substring(4,5),t+=t,r+=r,n+=n,i+=i),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:i?parseInt(i,16)/255:1}}var ur={test:Pt("#"),parse:eu,transform:Ve.transform};var fr=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),he=fr("deg"),ne=fr("%"),S=fr("px"),Ri=fr("vh"),Li=fr("vw"),nn={...ne,parse:e=>ne.parse(e)/100,transform:e=>ne.transform(e*100)};var He={test:Pt("hsl","hue"),parse:rn("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:n=1})=>"hsla("+Math.round(e)+", "+ne.transform(Ue(t))+", "+ne.transform(Ue(r))+", "+Ue(Ie.transform(n))+")"};var B={test:e=>Ve.test(e)||ur.test(e)||He.test(e),parse:e=>Ve.test(e)?Ve.parse(e):He.test(e)?He.parse(e):ur.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ve.transform(e):He.transform(e),getAnimatableNone:e=>{let t=B.parse(e);return t.alpha=0,B.transform(t)}};var ws=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function tu(e){var t,r;return isNaN(e)&&typeof e=="string"&&(((t=e.match(Vt))==null?void 0:t.length)||0)+(((r=e.match(ws))==null?void 0:r.length)||0)>0}var Ss="number",Cs="color",ru="var",nu="var(",Ts="${}",iu=/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 Ke(e){let t=e.toString(),r=[],n={color:[],number:[],var:[]},i=[],s=0,a=t.replace(iu,u=>(B.test(u)?(n.color.push(s),i.push(Cs),r.push(B.parse(u))):u.startsWith(nu)?(n.var.push(s),i.push(ru),r.push(u)):(n.number.push(s),i.push(Ss),r.push(parseFloat(u))),++s,Ts)).split(Ts);return{values:r,split:a,indexes:n,types:i}}function ou(e){return Ke(e).values}function Vs({split:e,types:t}){let r=e.length;return n=>{let i="";for(let s=0;s<r;s++)if(i+=e[s],n[s]!==void 0){let o=t[s];o===Ss?i+=Ue(n[s]):o===Cs?i+=B.transform(n[s]):i+=n[s]}return i}}function su(e){return Vs(Ke(e))}var au=e=>typeof e=="number"?0:B.test(e)?B.getAnimatableNone(e):e,lu=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:au(e);function cu(e){let t=Ke(e);return Vs(t)(t.values.map((n,i)=>lu(n,t.split[i])))}var J={test:tu,parse:ou,createTransformer:su,getAnimatableNone:cu};function Ii(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+(t-e)*6*r:r<1/2?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function Ps({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,t/=100,r/=100;let i=0,s=0,o=0;if(!t)i=s=o=r;else{let a=r<.5?r*(1+t):r+t-r*t,u=2*r-a;i=Ii(u,a,e+1/3),s=Ii(u,a,e),o=Ii(u,a,e-1/3)}return{red:Math.round(i*255),green:Math.round(s*255),blue:Math.round(o*255),alpha:n}}function Et(e,t){return r=>r>0?t:e}var A=(e,t,r)=>e+(t-e)*r;var Ni=(e,t,r)=>{let n=e*e,i=r*(t*t-n)+n;return i<0?0:Math.sqrt(i)},uu=[ur,Ve,He],fu=e=>uu.find(t=>t.test(e));function Es(e){let t=fu(e);if(Re(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!t)return!1;let r=t.parse(e);return t===He&&(r=Ps(r)),r}var Oi=(e,t)=>{let r=Es(e),n=Es(t);if(!r||!n)return Et(e,t);let i={...r};return s=>(i.red=Ni(r.red,n.red,s),i.green=Ni(r.green,n.green,s),i.blue=Ni(r.blue,n.blue,s),i.alpha=A(r.alpha,n.alpha,s),Ve.transform(i))};var on=new Set(["none","hidden"]);function Ms(e,t){return on.has(e)?r=>r<=0?e:t:r=>r>=1?t:e}function mu(e,t){return r=>A(e,t,r)}function sn(e){return typeof e=="number"?mu:typeof e=="string"?Ct(e)?Et:B.test(e)?Oi:hu:Array.isArray(e)?As:typeof e=="object"?B.test(e)?Oi:du:Et}function As(e,t){let r=[...e],n=r.length,i=e.map((s,o)=>sn(s)(s,t[o]));return s=>{for(let o=0;o<n;o++)r[o]=i[o](s);return r}}function du(e,t){let r={...e,...t},n={};for(let i in r)e[i]!==void 0&&t[i]!==void 0&&(n[i]=sn(e[i])(e[i],t[i]));return i=>{for(let s in n)r[s]=n[s](i);return r}}function pu(e,t){var i;let r=[],n={color:0,var:0,number:0};for(let s=0;s<t.values.length;s++){let o=t.types[s],a=e.indexes[o][n[o]],u=(i=e.values[a])!=null?i:0;r[s]=u,n[o]++}return r}var hu=(e,t)=>{let r=J.createTransformer(t),n=Ke(e),i=Ke(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?on.has(e)&&!i.values.length||on.has(t)&&!n.values.length?Ms(e,t):be(As(pu(n,i),i.values),r):(Re(!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"),Et(e,t))};function an(e,t,r){return typeof e=="number"&&typeof t=="number"&&typeof r=="number"?A(e,t,r):sn(e)(e,t)}var Ds=e=>{let t=({timestamp:r})=>e(r);return{start:(r=!0)=>M.update(t,r),stop:()=>le(t),now:()=>K.isProcessing?K.timestamp:W.now()}};var ln=(e,t,r=10)=>{let n="",i=Math.max(Math.round(t/r),2);for(let s=0;s<i;s++)n+=Math.round(e(s/(i-1))*1e4)/1e4+", ";return`linear(${n.substring(0,n.length-2)})`};function Mt(e){let t=0,r=50,n=e.next(t);for(;!n.done&&t<2e4;)t+=r,n=e.next(t);return t>=2e4?1/0:t}function ks(e,t=100,r){let n=r({...e,keyframes:[0,t]}),i=Math.min(Mt(n),2e4);return{type:"keyframes",ease:s=>n.next(i*s).value/t,duration:ee(i)}}var U={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};function ji(e,t){return e*Math.sqrt(1-t*t)}var gu=12;function xu(e,t,r){let n=r;for(let i=1;i<gu;i++)n=n-e(n)/t(n);return n}var Fi=.001;function yu({duration:e=U.duration,bounce:t=U.bounce,velocity:r=U.velocity,mass:n=U.mass}){let i,s;Re(e<=_(U.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let o=1-t;o=Z(U.minDamping,U.maxDamping,o),e=Z(U.minDuration,U.maxDuration,ee(e)),o<1?(i=c=>{let l=c*o,f=l*e,m=l-r,d=ji(c,o),h=Math.exp(-f);return Fi-m/d*h},s=c=>{let f=c*o*e,m=f*r+r,d=Math.pow(o,2)*Math.pow(c,2)*e,h=Math.exp(-f),g=ji(Math.pow(c,2),o);return(-i(c)+Fi>0?-1:1)*((m-d)*h)/g}):(i=c=>{let l=Math.exp(-c*e),f=(c-r)*e+1;return-Fi+l*f},s=c=>{let l=Math.exp(-c*e),f=(r-c)*(e*e);return l*f});let a=5/e,u=xu(i,s,a);if(e=_(e),isNaN(u))return{stiffness:U.stiffness,damping:U.damping,duration:e};{let c=Math.pow(u,2)*n;return{stiffness:c,damping:o*2*Math.sqrt(n*c),duration:e}}}var vu=["duration","bounce"],bu=["stiffness","damping","mass"];function Rs(e,t){return t.some(r=>e[r]!==void 0)}function wu(e){let t={velocity:U.velocity,stiffness:U.stiffness,damping:U.damping,mass:U.mass,isResolvedFromDuration:!1,...e};if(!Rs(e,bu)&&Rs(e,vu))if(t.velocity=0,e.visualDuration){let r=e.visualDuration,n=2*Math.PI/(r*1.2),i=n*n,s=2*Z(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:U.mass,stiffness:i,damping:s}}else{let r=yu({...e,velocity:0});t={...t,...r,mass:U.mass},t.isResolvedFromDuration=!0}return t}function At(e=U.visualDuration,t=U.bounce){let r=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e,{restSpeed:n,restDelta:i}=r,s=r.keyframes[0],o=r.keyframes[r.keyframes.length-1],a={done:!1,value:s},{stiffness:u,damping:c,mass:l,duration:f,velocity:m,isResolvedFromDuration:d}=wu({...r,velocity:-ee(r.velocity||0)}),h=m||0,g=c/(2*Math.sqrt(u*l)),x=o-s,y=ee(Math.sqrt(u/l)),T=Math.abs(x)<5;n||(n=T?U.restSpeed.granular:U.restSpeed.default),i||(i=T?U.restDelta.granular:U.restDelta.default);let w,v,C,D,V,P;if(g<1)C=ji(y,g),D=(h+g*y*x)/C,w=E=>{let O=Math.exp(-g*y*E);return o-O*(D*Math.sin(C*E)+x*Math.cos(C*E))},V=g*y*D+x*C,P=g*y*x-D*C,v=E=>Math.exp(-g*y*E)*(V*Math.sin(C*E)+P*Math.cos(C*E));else if(g===1){w=O=>o-Math.exp(-y*O)*(x+(h+y*x)*O);let E=h+y*x;v=O=>Math.exp(-y*O)*(y*E*O-h)}else{let E=y*Math.sqrt(g*g-1);w=Y=>{let k=Math.exp(-g*y*Y),N=Math.min(E*Y,300);return o-k*((h+g*y*x)*Math.sinh(N)+E*x*Math.cosh(N))/E};let O=(h+g*y*x)/E,I=g*y*O-x*E,de=g*y*x-O*E;v=Y=>{let k=Math.exp(-g*y*Y),N=Math.min(E*Y,300);return k*(I*Math.sinh(N)+de*Math.cosh(N))}}let H={calculatedDuration:d&&f||null,velocity:E=>_(v(E)),next:E=>{if(!d&&g<1){let I=Math.exp(-g*y*E),de=Math.sin(C*E),Y=Math.cos(C*E),k=o-I*(D*de+x*Y),N=_(I*(V*de+P*Y));return a.done=Math.abs(N)<=n&&Math.abs(o-k)<=i,a.value=a.done?o:k,a}let O=w(E);if(d)a.done=E>=f;else{let I=_(v(E));a.done=Math.abs(I)<=n&&Math.abs(o-O)<=i}return a.value=a.done?o:O,a},toString:()=>{let E=Math.min(Mt(H),2e4),O=ln(I=>H.next(E*I).value,E,30);return E+"ms "+O},toTransition:()=>{}};return H}At.applyToOptions=e=>{let t=ks(e,100,At);return e.ease=t.ease,e.duration=_(t.duration),e.type="keyframes",e};var Tu=5;function cn(e,t,r){let n=Math.max(t-Tu,0);return Qt(r-e(n),t-n)}function mr({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:u,restDelta:c=.5,restSpeed:l}){let f=e[0],m={done:!1,value:f},d=P=>a!==void 0&&P<a||u!==void 0&&P>u,h=P=>a===void 0?u:u===void 0||Math.abs(a-P)<Math.abs(u-P)?a:u,g=r*t,x=f+g,y=o===void 0?x:o(x);y!==x&&(g=y-f);let T=P=>-g*Math.exp(-P/n),w=P=>y+T(P),v=P=>{let H=T(P),E=w(P);m.done=Math.abs(H)<=c,m.value=m.done?y:E},C,D,V=P=>{d(m.value)&&(C=P,D=At({keyframes:[m.value,h(m.value)],velocity:cn(w,P,m.value),damping:i,stiffness:s,restDelta:c,restSpeed:l}))};return V(0),{calculatedDuration:null,next:P=>{let H=!1;return!D&&C===void 0&&(H=!0,v(P),V(P)),C!==void 0&&P>=C?D.next(P-C):(!H&&v(P),m)}}}function Su(e,t,r){let n=[],i=r||ie.mix||an,s=e.length-1;for(let o=0;o<s;o++){let a=i(e[o],e[o+1]);if(t){let u=Array.isArray(t)?t[o]||G:t;a=be(u,a)}n.push(a)}return n}function Ls(e,t,{clamp:r=!0,ease:n,mixer:i}={}){let s=e.length;if(ae(s===t.length,"Both input and output ranges must be the same length","range-length"),s===1)return()=>t[0];if(s===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());let a=Su(t,n,i),u=a.length,c=l=>{if(o&&l<e[0])return t[0];let f=0;if(u>1)for(;f<e.length-2&&!(l<e[f+1]);f++);let m=Se(e[f],e[f+1],l);return a[f](m)};return r?l=>c(Z(e[0],e[s-1],l)):c}function Is(e,t){let r=e[e.length-1];for(let n=1;n<=t;n++){let i=Se(0,t,n);e.push(A(r,1,i))}}function Ns(e){let t=[0];return Is(t,e.length-1),t}function Os(e,t){return e.map(r=>r*t)}function Cu(e,t){return e.map(()=>t||or).splice(0,e.length-1)}function it({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){let i=Ai(n)?n.map(Jr):Jr(n),s={done:!1,value:t[0]},o=Os(r&&r.length===t.length?r:Ns(t),e),a=Ls(o,t,{ease:Array.isArray(i)?i:Cu(t,i)});return{calculatedDuration:e,next:u=>(s.value=a(u),s.done=u>=e,s)}}var Vu=e=>e!==null;function _e(e,{repeat:t,repeatType:r="loop"},n,i=1){let s=e.filter(Vu),a=i<0||t&&r!=="loop"&&t%2===1?0:s.length-1;return!a||n===void 0?s[a]:n}var Pu={decay:mr,inertia:mr,tween:it,keyframes:it,spring:At};function un(e){typeof e.type=="string"&&(e.type=Pu[e.type])}var Ye=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,r){return this.finished.then(t,r)}};var Eu=e=>e/100,Ne=class extends Ye{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var n,i;let{motionValue:r}=this.options;r&&r.updatedAt!==W.now()&&this.tick(W.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(i=(n=this.options).onStop)==null||i.call(n))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){let{options:t}=this;un(t);let{type:r=it,repeat:n=0,repeatDelay:i=0,repeatType:s,velocity:o=0}=t,{keyframes:a}=t,u=r||it;u!==it&&typeof a[0]!="number"&&(this.mixKeyframes=be(Eu,an(a[0],a[1])),a=[0,100]);let c=u({...t,keyframes:a});s==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...a].reverse(),velocity:-o})),c.calculatedDuration===null&&(c.calculatedDuration=Mt(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+i,this.totalDuration=this.resolvedDuration*(n+1)-i,this.generator=c}updateTime(t){let r=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=r}tick(t,r=!1){let{generator:n,totalDuration:i,mixKeyframes:s,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:u}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:f,repeatType:m,repeatDelay:d,type:h,onUpdate:g,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-i/this.speed,this.startTime)),r?this.currentTime=t:this.updateTime(t);let y=this.currentTime-c*(this.playbackSpeed>=0?1:-1),T=this.playbackSpeed>=0?y<0:y>i;this.currentTime=Math.max(y,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=i);let w=this.currentTime,v=n;if(f){let P=Math.min(this.currentTime,i)/a,H=Math.floor(P),E=P%1;!E&&P>=1&&(E=1),E===1&&H--,H=Math.min(H,f+1),!!(H%2)&&(m==="reverse"?(E=1-E,d&&(E-=d/a)):m==="mirror"&&(v=o)),w=Z(0,1,E)*a}let C;T?(this.delayState.value=l[0],C=this.delayState):C=v.next(w),s&&!T&&(C.value=s(C.value));let{done:D}=C;!T&&u!==null&&(D=this.playbackSpeed>=0?this.currentTime>=i:this.currentTime<=0);let V=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&D);return V&&h!==mr&&(C.value=_e(l,this.options,x,this.speed)),g&&g(C.value),V&&this.finish(),C}then(t,r){return this.finished.then(t,r)}get duration(){return ee(this.calculatedDuration)}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+ee(t)}get time(){return ee(this.currentTime)}set time(t){t=_(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))}getGeneratorVelocity(){let t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);let r=this.generator.next(t).value;return cn(n=>this.generator.next(n).value,t,r)}get speed(){return this.playbackSpeed}set speed(t){let r=this.playbackSpeed!==t;r&&this.driver&&this.updateTime(W.now()),this.playbackSpeed=t,r&&this.driver&&(this.time=ee(this.currentTime))}play(){var i,s;if(this.isStopped)return;let{driver:t=Ds,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),(s=(i=this.options).onPlay)==null||s.call(i);let n=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=n):this.holdTime!==null?this.startTime=n-this.holdTime:this.startTime||(this.startTime=r!=null?r:n),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(W.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,r;this.notifyFinished(),this.teardown(),this.state="finished",(r=(t=this.options).onComplete)==null||r.call(t)}cancel(){var t,r;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(r=(t=this.options).onCancel)==null||r.call(t)}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){var r;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(r=this.driver)==null||r.stop(),t.observe(this)}};function Bs(e){var t;for(let r=1;r<e.length;r++)(t=e[r])!=null||(e[r]=e[r-1])}var ot=e=>e*180/Math.PI,zi=e=>{let t=ot(Math.atan2(e[1],e[0]));return Gi(t)},Mu={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:zi,rotateZ:zi,skewX:e=>ot(Math.atan(e[1])),skewY:e=>ot(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Gi=e=>(e=e%360,e<0&&(e+=360),e),Fs=zi,js=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),zs=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Au={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:js,scaleY:zs,scale:e=>(js(e)+zs(e))/2,rotateX:e=>Gi(ot(Math.atan2(e[6],e[5]))),rotateY:e=>Gi(ot(Math.atan2(-e[2],e[0]))),rotateZ:Fs,rotate:Fs,skewX:e=>ot(Math.atan(e[4])),skewY:e=>ot(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function fn(e){return e.includes("scale")?1:0}function mn(e,t){if(!e||e==="none")return fn(t);let r=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),n,i;if(r)n=Au,i=r;else{let a=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);n=Mu,i=a}if(!i)return fn(t);let s=n[t],o=i[1].split(",").map(Du);return typeof s=="function"?s(o):o[s]}var Gs=(e,t)=>{let{transform:r="none"}=getComputedStyle(e);return mn(r,t)};function Du(e){return parseFloat(e.trim())}var Pe=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ge=new Set([...Pe,"pathRotation"]);var Wi=e=>e===Ce||e===S,ku=new Set(["x","y","z"]),Ru=Pe.filter(e=>!ku.has(e));function Ws(e){let t=[];return Ru.forEach(r=>{let n=e.getValue(r);n!==void 0&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}var Oe={width:({x:e},{paddingLeft:t="0",paddingRight:r="0",boxSizing:n})=>{let i=e.max-e.min;return n==="border-box"?i:i-parseFloat(t)-parseFloat(r)},height:({y:e},{paddingTop:t="0",paddingBottom:r="0",boxSizing:n})=>{let i=e.max-e.min;return n==="border-box"?i:i-parseFloat(t)-parseFloat(r)},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})=>mn(t,"x"),y:(e,{transform:t})=>mn(t,"y")};Oe.translateX=Oe.x;Oe.translateY=Oe.y;var st=new Set,Ui=!1,Hi=!1,Ki=!1;function Us(){if(Hi){let e=Array.from(st).filter(n=>n.needsMeasurement),t=new Set(e.map(n=>n.element)),r=new Map;t.forEach(n=>{let i=Ws(n);i.length&&(r.set(n,i),n.render())}),e.forEach(n=>n.measureInitialState()),t.forEach(n=>{n.render();let i=r.get(n);i&&i.forEach(([s,o])=>{var a;(a=n.getValue(s))==null||a.set(o)})}),e.forEach(n=>n.measureEndState()),e.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}Hi=!1,Ui=!1,st.forEach(e=>e.complete(Ki)),st.clear()}function Hs(){st.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Hi=!0)})}function Ks(){Ki=!0,Hs(),Us(),Ki=!1}var $e=class{constructor(t,r,n,i,s,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=r,this.name=n,this.motionValue=i,this.element=s,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(st.add(this),Ui||(Ui=!0,M.read(Hs),M.resolveKeyframes(Us))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:t,name:r,element:n,motionValue:i}=this;if(t[0]===null){let s=i==null?void 0:i.get(),o=t[t.length-1];if(s!==void 0)t[0]=s;else if(n&&r){let a=n.readValue(r,o);a!=null&&(t[0]=a)}t[0]===void 0&&(t[0]=o),i&&s===void 0&&i.set(t[0])}Bs(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),st.delete(this)}cancel(){this.state==="scheduled"&&(st.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}};var _s=e=>e.startsWith("--");function dn(e,t,r){_s(t)?e.style.setProperty(t,r):e.style[t]=r}var Ys={};function pn(e,t){let r=Jt(e);return()=>{var n;return(n=Ys[t])!=null?n:r()}}var $s=pn(()=>window.ScrollTimeline!==void 0,"scrollTimeline");var hn=pn(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0},"linearEasing");var at=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`;var _i={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:at([0,.65,.55,1]),circOut:at([.55,0,1,.45]),backIn:at([.31,.01,.66,-.59]),backOut:at([.33,1.53,.69,.99])};function Yi(e,t){if(e)return typeof e=="function"?hn()?ln(e,t):"ease-out":sr(e)?at(e):Array.isArray(e)?e.map(r=>Yi(r,t)||_i.easeOut):_i[e]}function Xs(e,t,r,{delay:n=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a="easeOut",times:u}={},c=void 0){let l={[t]:r};u&&(l.offset=u);let f=Yi(a,i);Array.isArray(f)&&(l.easing=f);let m={delay:n,duration:i,easing:Array.isArray(f)?"linear":f,fill:"both",iterations:s+1,direction:o==="reverse"?"alternate":"normal"};return c&&(m.pseudoElement=c),e.animate(l,m)}function gn(e){return typeof e=="function"&&"applyToOptions"in e}function qs({type:e,...t}){var r,n;return gn(e)&&hn()?e.applyToOptions(t):((r=t.duration)!=null||(t.duration=300),(n=t.ease)!=null||(t.ease="easeOut"),t)}var Dt=class extends Ye{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;let{element:r,name:n,keyframes:i,pseudoElement:s,allowFlatten:o=!1,finalKeyframe:a,onComplete:u}=t;this.isPseudoElement=!!s,this.allowFlatten=o,this.options=t,ae(typeof t.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");let c=qs(t);this.animation=Xs(r,n,i,c,s),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){let l=_e(i,this.options,a,this.speed);this.updateMotionValue&&this.updateMotionValue(l),dn(r,n,l),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,r;(r=(t=this.animation).finish)==null||r.call(t)}cancel(){try{this.animation.cancel()}catch(t){}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var r,n,i;let t=(r=this.options)==null?void 0:r.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((i=(n=this.animation).commitStyles)==null||i.call(n))}get duration(){var r,n;let t=((n=(r=this.animation.effect)==null?void 0:r.getComputedTiming)==null?void 0:n.call(r).duration)||0;return ee(Number(t))}get iterationDuration(){let{delay:t=0}=this.options||{};return this.duration+ee(t)}get time(){return ee(Number(this.animation.currentTime)||0)}set time(t){let r=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=_(t),r&&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(){var t;return(t=this.manualStartTime)!=null?t:Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:r,rangeEnd:n,observe:i}){var s;return this.allowFlatten&&((s=this.animation.effect)==null||s.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&$s()?(this.animation.timeline=t,r&&(this.animation.rangeStart=r),n&&(this.animation.rangeEnd=n),G):i(this)}};var Zs={anticipate:tr,backInOut:er,circInOut:ir};function Lu(e){return e in Zs}function Js(e){typeof e.ease=="string"&&Lu(e.ease)&&(e.ease=Zs[e.ease])}var $i=10,xn=class extends Dt{constructor(t){Js(t),un(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){let{motionValue:r,onUpdate:n,onComplete:i,element:s,...o}=this.options;if(!r)return;if(t!==void 0){r.set(t);return}let a=new Ne({...o,autoplay:!1}),u=Math.max($i,W.now()-this.startTime),c=Z(0,$i,u-$i),l=a.sample(u).value,{name:f}=this.options;s&&f&&dn(s,f,l),r.setWithVelocity(a.sample(Math.max(0,u-c)).value,l,c),a.stop()}};var Xi=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(J.test(e)||e==="0")&&!e.startsWith("url("));function Iu(e){let t=e[0];if(e.length===1)return!0;for(let r=0;r<e.length;r++)if(e[r]!==t)return!0}function Qs(e,t,r,n){let i=e[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;let s=e[e.length-1],o=Xi(i,t),a=Xi(s,t);return Re(o===a,`You are trying to animate ${t} from "${i}" to "${s}". "${o?s:i}" is not an animatable value.`,"value-not-animatable"),!o||!a?!1:Iu(e)||(r==="spring"||gn(r))&&n}function dr(e){e.duration=0,e.type="keyframes"}var yn=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);var Nu=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ea(e){for(let t=0;t<e.length;t++)if(typeof e[t]=="string"&&Nu.test(e[t]))return!0;return!1}var Ou=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Bu=Jt(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function ta(e){var f;let{motionValue:t,name:r,repeatDelay:n,repeatType:i,damping:s,type:o,keyframes:a}=e,u=(f=t==null?void 0:t.owner)==null?void 0:f.current;if(!(u instanceof HTMLElement)&&!(u instanceof SVGElement))return!1;let{onUpdate:c,transformTemplate:l}=t.owner.getProps();return Bu()&&r&&(yn.has(r)||Ou.has(r)&&ea(a))&&(r!=="transform"||!l)&&!c&&!n&&i!=="mirror"&&s!==0&&o!=="inertia"}var Fu=40,vn=class extends Ye{constructor({autoplay:t=!0,delay:r=0,type:n="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:o="loop",keyframes:a,name:u,motionValue:c,element:l,...f}){var h;super(),this.stop=()=>{var g,x;this._animation&&(this._animation.stop(),(g=this.stopTimeline)==null||g.call(this)),(x=this.keyframeResolver)==null||x.cancel()},this.createdAt=W.now();let m={autoplay:t,delay:r,type:n,repeat:i,repeatDelay:s,repeatType:o,name:u,motionValue:c,element:l,...f},d=(l==null?void 0:l.KeyframeResolver)||$e;this.keyframeResolver=new d(a,(g,x,y)=>this.onKeyframesResolved(g,x,m,!y),u,c,l),(h=this.keyframeResolver)==null||h.scheduleResolve()}onKeyframesResolved(t,r,n,i){var y,T;this.keyframeResolver=void 0;let{name:s,type:o,velocity:a,delay:u,isHandoff:c,onUpdate:l}=n;this.resolvedAt=W.now();let f=!0;Qs(t,s,o,a)||(f=!1,(ie.instantAnimations||!u)&&(l==null||l(_e(t,n,r))),t[0]=t[t.length-1],dr(n),n.repeat=0);let d={startTime:i?this.resolvedAt?this.resolvedAt-this.createdAt>Fu?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:r,...n,keyframes:t},h=f&&!c&&ta(d),g=(T=(y=d.motionValue)==null?void 0:y.owner)==null?void 0:T.current,x;if(h)try{x=new xn({...d,element:g})}catch(w){x=new Ne(d)}else x=new Ne(d);x.finished.then(()=>{this.notifyFinished()}).catch(G),this.pendingTimeline&&(this.stopTimeline=x.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=x}get finished(){return this._animation?this.animation.finished:this._finished}then(t,r){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),Ks()),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(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}};function bn(e,t,r,n=0,i=1){let s=Array.from(e).sort((c,l)=>c.sortNodePosition(l)).indexOf(t),o=e.size,a=(o-1)*n;return typeof r=="function"?r(s,o):i===1?s*n:a-s*n}var ra=30,ju=e=>!isNaN(parseFloat(e)),na={current:void 0},qi=class{constructor(t,r={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=n=>{var s;let i=W.now();if(this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&((s=this.events.change)==null||s.notify(this.current),this.dependents))for(let o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=r.owner}setCurrent(t){this.current=t,this.updatedAt=W.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ju(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,r){this.events[t]||(this.events[t]=new Le);let n=this.events[t].add(r);return t==="change"?()=>{n(),M.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let t in this.events)this.events[t].clear()}attach(t,r){this.passiveEffect=t,this.stopPassiveEffect=r}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,r,n){this.set(r),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-n}jump(t,r=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,r&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.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 na.current&&na.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let t=W.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>ra)return 0;let r=Math.min(this.updatedAt-this.prevUpdatedAt,ra);return Qt(parseFloat(this.current)-parseFloat(this.prevFrameValue),r)}start(t){return this.stop(),new Promise(r=>{this.hasAnimated=!0,this.animation=t(r),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(){var t,r;(t=this.dependents)==null||t.clear(),(r=this.events.destroy)==null||r.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function we(e,t){return new qi(e,t)}function wn(e,t){if(e!=null&&e.inherit&&t){let{inherit:r,...n}=e;return{...t,...n}}return e}function kt(e,t){var n,i;let r=(i=(n=e==null?void 0:e[t])!=null?n:e==null?void 0:e.default)!=null?i:e;return r!==e?wn(r,e):r}var zu={type:"spring",stiffness:500,damping:25,restSpeed:10},Gu=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Wu={type:"keyframes",duration:.8},Uu={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ia=(e,{keyframes:t})=>t.length>2?Wu:ge.has(e)?e.startsWith("scale")?Gu(t[1]):zu:Uu;var Hu=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function oa(e){for(let t in e)if(!Hu.has(t))return!0;return!1}var lt=(e,t,r,n={},i,s)=>o=>{let a=kt(n,e)||{},u=a.delay||n.delay||0,{elapsed:c=0}=n;c=c-_(u);let l={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:m=>{t.set(m),a.onUpdate&&a.onUpdate(m)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:e,motionValue:t,element:s?void 0:i};oa(a)||Object.assign(l,ia(e,l)),l.duration&&(l.duration=_(l.duration)),l.repeatDelay&&(l.repeatDelay=_(l.repeatDelay)),l.from!==void 0&&(l.keyframes[0]=l.from);let f=!1;if((l.type===!1||l.duration===0&&!l.repeatDelay)&&(dr(l),l.delay===0&&(f=!0)),(ie.instantAnimations||ie.skipAnimations||i!=null&&i.shouldSkipAnimations||a.skipAnimations)&&(f=!0,dr(l),l.delay=0),l.allowFlatten=!a.type&&!a.ease,f&&!s&&t.get()!==void 0){let m=_e(l.keyframes,a);if(m!==void 0){M.update(()=>{l.onUpdate(m),l.onComplete()});return}}return a.isSync?new Ne(l):new vn(l)};var Ku=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function _u(e){let t=Ku.exec(e);if(!t)return[,];let[,r,n,i]=t;return[`--${r!=null?r:n}`,i]}var Yu=4;function Zi(e,t,r=1){ae(r<=Yu,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`,"max-css-var-depth");let[n,i]=_u(e);if(!n)return;let s=window.getComputedStyle(t).getPropertyValue(n);if(s){let o=s.trim();return Xt(o)?parseFloat(o):o}return Ct(i)?Zi(i,t,r+1):i}function sa(e){let t=[{},{}];return e==null||e.values.forEach((r,n)=>{t[0][n]=r.get(),t[1][n]=r.getVelocity()}),t}function ct(e,t,r,n){if(typeof t=="function"){let[i,s]=sa(n);t=t(r!==void 0?r:e.custom,i,s)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){let[i,s]=sa(n);t=t(r!==void 0?r:e.custom,i,s)}return t}function ue(e,t,r){let n=e.getProps();return ct(n,t,r!==void 0?r:n.custom,e)}var Tn=new Set(["width","height","top","left","right","bottom",...Pe]);var pr=e=>Array.isArray(e);function $u(e,t,r){e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,we(r))}function Xu(e){return pr(e)?e[e.length-1]||0:e}function aa(e,t){let r=ue(e,t),{transitionEnd:n={},transition:i={},...s}=r||{};s={...s,...n};for(let o in s){let a=Xu(s[o]);$u(e,o,a)}}var L=e=>!!(e&&e.getVelocity);function la(e){return!!(L(e)&&e.add)}function Rt(e,t){let r=e.getValue("willChange");if(la(r))return r.add(t);if(!r&&ie.WillChange){let n=new ie.WillChange("auto");e.addValue("willChange",n),n.add(t)}}function Lt(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}var ca="framerAppearId",hr="data-"+Lt(ca);function Sn(e){return e.props[hr]}function qu({protectedKeys:e,needsAnimating:t},r){let n=e.hasOwnProperty(r)&&t[r]!==!0;return t[r]=!1,n}function Cn(e,t,{delay:r=0,transitionOverride:n,type:i}={}){var h;let{transition:s,transitionEnd:o,...a}=t,u=e.getDefaultTransition();s=s?wn(s,u):u;let c=s==null?void 0:s.reduceMotion,l=s==null?void 0:s.skipAnimations;n&&(s=n);let f=[],m=i&&e.animationState&&e.animationState.getState()[i],d=s==null?void 0:s.path;d&&d.animateVisualElement(e,a,s,r,f);for(let g in a){let x=e.getValue(g,(h=e.latestValues[g])!=null?h:null),y=a[g];if(y===void 0||m&&qu(m,g))continue;let T={delay:r,...kt(s||{},g)};l&&(T.skipAnimations=!0);let w=x.get();if(w!==void 0&&!x.isAnimating()&&!Array.isArray(y)&&y===w&&!T.velocity){M.update(()=>x.set(y));continue}let v=!1;if(window.MotionHandoffAnimation){let V=Sn(e);if(V){let P=window.MotionHandoffAnimation(V,g,M);P!==null&&(T.startTime=P,v=!0)}}Rt(e,g);let C=c!=null?c:e.shouldReduceMotion;x.start(lt(g,x,y,C&&Tn.has(g)?{type:!1}:T,e,v));let D=x.animation;D&&f.push(D)}if(o){let g=()=>M.update(()=>{o&&aa(e,o)});f.length?Promise.all(f).then(g):g()}return f}function Vn(e,t,r={}){var u;let n=ue(e,t,r.type==="exit"?(u=e.presenceContext)==null?void 0:u.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=n||{};r.transitionOverride&&(i=r.transitionOverride);let s=n?()=>Promise.all(Cn(e,n,r)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(c=0)=>{let{delayChildren:l=0,staggerChildren:f,staggerDirection:m}=i;return Zu(e,t,c,l,f,m,r)}:()=>Promise.resolve(),{when:a}=i;if(a){let[c,l]=a==="beforeChildren"?[s,o]:[o,s];return c().then(()=>l())}else return Promise.all([s(),o(r.delay)])}function Zu(e,t,r=0,n=0,i=0,s=1,o){let a=[];for(let u of e.variantChildren)u.notify("AnimationStart",t),a.push(Vn(u,t,{...o,delay:r+(typeof n=="function"?0:n)+bn(e.variantChildren,u,n,i,s)}).then(()=>u.notify("AnimationComplete",t)));return Promise.all(a)}function ua(e,t,r={}){e.notify("AnimationStart",t);let n;if(Array.isArray(t)){let i=t.map(s=>Vn(e,s,r));n=Promise.all(i)}else if(typeof t=="string")n=Vn(e,t,r);else{let i=typeof t=="function"?ue(e,t,r.custom):t;n=Promise.all(Cn(e,i,r))}return n.then(()=>{e.notify("AnimationComplete",t)})}var fa={test:e=>e==="auto",parse:e=>e};var Pn=e=>t=>t.test(e);var Ji=[Ce,S,ne,he,Li,Ri,fa],Qi=e=>Ji.find(Pn(e));function ma(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||Zt(e):!0}var Ju=new Set(["brightness","contrast","saturate","opacity"]);function Qu(e){let[t,r]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;let[n]=r.match(Vt)||[];if(!n)return e;let i=r.replace(n,""),s=Ju.has(t)?1:0;return n!==r&&(s*=100),t+"("+s+i+")"}var ef=/\b([a-z-]*)\(.*?\)/gu,gr={...J,getAnimatableNone:e=>{let t=e.match(ef);return t?t.map(Qu).join(" "):e}};var xr={...J,getAnimatableNone:e=>{let t=J.parse(e);return J.createTransformer(e)(t.map(n=>typeof n=="number"?0:typeof n=="object"?{...n,alpha:1}:n))}};var eo={...Ce,transform:Math.round};var da={rotate:he,pathRotation:he,rotateX:he,rotateY:he,rotateZ:he,scale:cr,scaleX:cr,scaleY:cr,scaleZ:cr,skew:he,skewX:he,skewY:he,distance:S,translateX:S,translateY:S,translateZ:S,x:S,y:S,z:S,perspective:S,transformPerspective:S,opacity:Ie,originX:nn,originY:nn,originZ:S};var ut={borderWidth:S,borderTopWidth:S,borderRightWidth:S,borderBottomWidth:S,borderLeftWidth:S,borderRadius:S,borderTopLeftRadius:S,borderTopRightRadius:S,borderBottomRightRadius:S,borderBottomLeftRadius:S,width:S,maxWidth:S,height:S,maxHeight:S,top:S,right:S,bottom:S,left:S,inset:S,insetBlock:S,insetBlockStart:S,insetBlockEnd:S,insetInline:S,insetInlineStart:S,insetInlineEnd:S,padding:S,paddingTop:S,paddingRight:S,paddingBottom:S,paddingLeft:S,paddingBlock:S,paddingBlockStart:S,paddingBlockEnd:S,paddingInline:S,paddingInlineStart:S,paddingInlineEnd:S,margin:S,marginTop:S,marginRight:S,marginBottom:S,marginLeft:S,marginBlock:S,marginBlockStart:S,marginBlockEnd:S,marginInline:S,marginInlineStart:S,marginInlineEnd:S,fontSize:S,backgroundPositionX:S,backgroundPositionY:S,...da,zIndex:eo,fillOpacity:Ie,strokeOpacity:Ie,numOctaves:eo};var tf={...ut,color:B,backgroundColor:B,outlineColor:B,fill:B,stroke:B,borderColor:B,borderTopColor:B,borderRightColor:B,borderBottomColor:B,borderLeftColor:B,filter:gr,WebkitFilter:gr,mask:xr,WebkitMask:xr},En=e=>tf[e];var rf=new Set([gr,xr]);function Mn(e,t){let r=En(e);return rf.has(r)||(r=J),r.getAnimatableNone?r.getAnimatableNone(t):void 0}var nf=new Set(["auto","none","0"]);function pa(e,t,r){let n=0,i;for(;n<e.length&&!i;){let s=e[n];typeof s=="string"&&!nf.has(s)&&Ke(s).values.length&&(i=e[n]),n++}if(i&&r)for(let s of t)e[s]=Mn(r,i)}var An=class extends $e{constructor(t,r,n,i,s){super(t,r,n,i,s,!0)}readKeyframes(){let{unresolvedKeyframes:t,element:r,name:n}=this;if(!r||!r.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let f=t[l];if(typeof f=="string"&&(f=f.trim(),Ct(f))){let m=Zi(f,r.current);m!==void 0&&(t[l]=m),l===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Tn.has(n)||t.length!==2)return;let[i,s]=t,o=Qi(i),a=Qi(s),u=Di(i),c=Di(s);if(u!==c&&Oe[n]){this.needsMeasurement=!0;return}if(o!==a)if(Wi(o)&&Wi(a))for(let l=0;l<t.length;l++){let f=t[l];typeof f=="string"&&(t[l]=parseFloat(f))}else Oe[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:t,name:r}=this,n=[];for(let i=0;i<t.length;i++)(t[i]===null||ma(t[i]))&&n.push(i);n.length&&pa(t,n,r)}measureInitialState(){let{element:t,unresolvedKeyframes:r,name:n}=this;if(!t||!t.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Oe[n](t.measureViewportBox(),window.getComputedStyle(t.current)),r[0]=this.measuredOrigin;let i=r[r.length-1];i!==void 0&&t.getValue(n,i).jump(i,!1)}measureEndState(){var a;let{element:t,name:r,unresolvedKeyframes:n}=this;if(!t||!t.current)return;let i=t.getValue(r);i&&i.jump(this.measuredOrigin,!1);let s=n.length-1,o=n[s];n[s]=Oe[r](t.measureViewportBox(),window.getComputedStyle(t.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(a=this.removedTransforms)!=null&&a.length&&this.removedTransforms.forEach(([u,c])=>{t.getValue(u).set(c)}),this.resolveNoneKeyframes()}};var yr=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function Dn(e,t,r){var n;if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){let i=document;t&&(i=t.current);let s=(n=r==null?void 0:r[e])!=null?n:i.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(i=>i!=null)}var vr=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function ha(e){return qt(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}var{schedule:ft,cancel:of}=Qr(queueMicrotask,!1);var xe={x:!1,y:!1};function kn(){return xe.x||xe.y}function to(e){return e==="x"||e==="y"?xe[e]?null:(xe[e]=!0,()=>{xe[e]=!1}):xe.x||xe.y?null:(xe.x=xe.y=!0,()=>{xe.x=xe.y=!1})}function Rn(e,t){let r=Dn(e),n=new AbortController,i={passive:!0,...t,signal:n.signal};return[r,i,()=>n.abort()]}function sf(e){return!(e.pointerType==="touch"||kn())}function ro(e,t,r={}){let[n,i,s]=Rn(e,r);return n.forEach(o=>{let a=!1,u=!1,c,l=()=>{o.removeEventListener("pointerleave",h)},f=x=>{c&&(c(x),c=void 0),l()},m=x=>{a=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),u&&(u=!1,f(x))},d=()=>{a=!0,window.addEventListener("pointerup",m,i),window.addEventListener("pointercancel",m,i)},h=x=>{if(x.pointerType!=="touch"){if(a){u=!0;return}f(x)}},g=x=>{if(!sf(x))return;u=!1;let y=t(o,x);typeof y=="function"&&(c=y,o.addEventListener("pointerleave",h,i))};o.addEventListener("pointerenter",g,i),o.addEventListener("pointerdown",d,i)}),s}var no=(e,t)=>t?e===t?!0:no(e,t.parentElement):!1;var mt=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1;var af=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function io(e){return af.has(e.tagName)||e.isContentEditable===!0}var lf=new Set(["INPUT","SELECT","TEXTAREA"]);function oo(e){return lf.has(e.tagName)||e.isContentEditable===!0}var It=new WeakSet;function ga(e){return t=>{t.key==="Enter"&&e(t)}}function so(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}var xa=(e,t)=>{let r=e.currentTarget;if(!r)return;let n=ga(()=>{if(It.has(r))return;so(r,"down");let i=ga(()=>{so(r,"up")}),s=()=>so(r,"cancel");r.addEventListener("keyup",i,t),r.addEventListener("blur",s,t)});r.addEventListener("keydown",n,t),r.addEventListener("blur",()=>r.removeEventListener("keydown",n),t)};function ya(e){return mt(e)&&!kn()}var va=new WeakSet;function ao(e,t,r={}){let[n,i,s]=Rn(e,r),o=a=>{let u=a.currentTarget;if(!ya(a)||va.has(a))return;It.add(u),r.stopPropagation&&va.add(a);let c=t(u,a),l={...i,capture:!0},f=(h,g)=>{window.removeEventListener("pointerup",m,l),window.removeEventListener("pointercancel",d,l),It.has(u)&&It.delete(u),ya(h)&&typeof c=="function"&&c(h,{success:g})},m=h=>{f(h,u===window||u===document||r.useGlobalTarget||no(u,h.target))},d=h=>{f(h,!1)};window.addEventListener("pointerup",m,l),window.addEventListener("pointercancel",d,l)};return n.forEach(a=>{(r.useGlobalTarget?window:a).addEventListener("pointerdown",o,i),ha(a)&&(a.addEventListener("focus",c=>xa(c,i)),!io(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),s}function Nt(e){return qt(e)&&"ownerSVGElement"in e}var Ln=new WeakMap,Xe,ba=(e,t,r)=>(n,i)=>i&&i[0]?i[0][e+"Size"]:Nt(n)&&"getBBox"in n?n.getBBox()[t]:n[r],cf=ba("inline","width","offsetWidth"),uf=ba("block","height","offsetHeight");function ff({target:e,borderBoxSize:t}){var r;(r=Ln.get(e))==null||r.forEach(n=>{n(e,{get width(){return cf(e,t)},get height(){return uf(e,t)}})})}function mf(e){e.forEach(ff)}function df(){typeof ResizeObserver!="undefined"&&(Xe=new ResizeObserver(mf))}function wa(e,t){Xe||df();let r=Dn(e);return r.forEach(n=>{let i=Ln.get(n);i||(i=new Set,Ln.set(n,i)),i.add(t),Xe==null||Xe.observe(n)}),()=>{r.forEach(n=>{let i=Ln.get(n);i==null||i.delete(t),i!=null&&i.size||Xe==null||Xe.unobserve(n)})}}var In=new Set,Ot;function pf(){Ot=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};In.forEach(t=>t(e))},window.addEventListener("resize",Ot)}function Ta(e){return In.add(e),Ot||pf(),()=>{In.delete(e),!In.size&&typeof Ot=="function"&&(window.removeEventListener("resize",Ot),Ot=void 0)}}function Nn(e,t){return typeof e=="function"?Ta(e):wa(e,t)}var dt={value:null,addProjectionMetrics:null};function Sa(e){return Nt(e)&&e.tagName==="svg"}var hf=[...Ji,B,J],Ca=e=>hf.find(Pn(e));var lo=()=>({translate:0,scale:1,origin:0,originPoint:0}),qe=()=>({x:lo(),y:lo()}),co=()=>({min:0,max:0}),F=()=>({x:co(),y:co()});var Va=new WeakMap;function Be(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ee(e){return typeof e=="string"||Array.isArray(e)}var On=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],br=["initial",...On];function Ze(e){return Be(e.animate)||br.some(t=>Ee(e[t]))}function wr(e){return!!(Ze(e)||e.variants)}function Pa(e,t,r){for(let n in t){let i=t[n],s=r[n];if(L(i))e.addValue(n,i);else if(L(s))e.addValue(n,we(i,{owner:e}));else if(s!==i)if(e.hasValue(n)){let o=e.getValue(n);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{let o=e.getStaticValue(n);e.addValue(n,we(o!==void 0?o:i,{owner:e}))}}for(let n in r)t[n]===void 0&&e.removeValue(n);return t}var Tr={current:null},Bn={current:!1};var gf=typeof window!="undefined";function Ea(){if(Bn.current=!0,!!gf)if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Tr.current=e.matches;e.addEventListener("change",t),t()}else Tr.current=!1}var Ma=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],Fn={};function Cr(e){Fn=e}function uo(){return Fn}var Sr=class{scrapeMotionValuesFromProps(t,r,n){return{}}constructor({parent:t,props:r,presenceContext:n,reducedMotionConfig:i,skipAnimations:s,blockInitialAnimation:o,visualState:a},u={}){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=$e,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=()=>{let d=W.now();this.renderScheduledAt<d&&(this.renderScheduledAt=d,M.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=a;this.latestValues=c,this.baseTarget={...c},this.initialValues=r.initial?{...c}:{},this.renderState=l,this.parent=t,this.props=r,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.skipAnimationsConfig=s,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=Ze(r),this.isVariantNode=wr(r),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);let{willChange:f,...m}=this.scrapeMotionValuesFromProps(r,{},this);for(let d in m){let h=m[d];c[d]!==void 0&&L(h)&&h.set(c[d])}}mount(t){var r,n,i;if(this.hasBeenMounted)for(let s in this.initialValues)(r=this.values.get(s))==null||r.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=t,Va.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((s,o)=>this.bindToMotionValue(o,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(Bn.current||Ea(),this.shouldReduceMotion=Tr.current),this.shouldSkipAnimations=(n=this.skipAnimationsConfig)!=null?n:!1,(i=this.parent)==null||i.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),le(this.notifyUpdate),le(this.render),this.valueSubscriptions.forEach(r=>r()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(let r in this.events)this.events[r].clear();for(let r in this.features){let n=this.features[r];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(t){var r;this.children.add(t),(r=this.enteringChildren)!=null||(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,r){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),r.accelerate&&yn.has(t)&&this.current instanceof HTMLElement){let{factory:o,keyframes:a,times:u,ease:c,duration:l}=r.accelerate,f=new Dt({element:this.current,name:t,keyframes:a,times:u,ease:c,duration:_(l)}),m=o(f);this.valueSubscriptions.set(t,()=>{m(),f.cancel()});return}let n=ge.has(t);n&&this.onBindTransform&&this.onBindTransform();let i=r.on("change",o=>{this.latestValues[t]=o,this.props.onUpdate&&M.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),s;typeof window!="undefined"&&window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,t,r)),this.valueSubscriptions.set(t,()=>{i(),s&&s()})}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 Fn){let r=Fn[t];if(!r)continue;let{isEnabled:n,Feature:i}=r;if(!this.features[t]&&i&&n(this.props)&&(this.features[t]=new i(this)),this.features[t]){let s=this.features[t];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):F()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,r){this.latestValues[t]=r}update(t,r){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=r;for(let n=0;n<Ma.length;n++){let i=Ma[n];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);let s="on"+i,o=t[s];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=Pa(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){let r=this.getClosestVariantNode();if(r)return r.variantChildren&&r.variantChildren.add(t),()=>r.variantChildren.delete(t)}addValue(t,r){let n=this.values.get(t);r!==n&&(n&&this.removeValue(t),this.bindToMotionValue(t,r),this.values.set(t,r),this.latestValues[t]=r.get())}removeValue(t){this.values.delete(t);let r=this.valueSubscriptions.get(t);r&&(r(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,r){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return n===void 0&&r!==void 0&&(n=we(r===null?void 0:r,{owner:this}),this.addValue(t,n)),n}readValue(t,r){var i;let n=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(i=this.getBaseTargetFromProps(this.props,t))!=null?i:this.readValueFromInstance(this.current,t,this.options);return n!=null&&(typeof n=="string"&&(Xt(n)||Zt(n))?n=parseFloat(n):!Ca(n)&&J.test(r)&&(n=Mn(t,r)),this.setBaseTarget(t,L(n)?n.get():n)),L(n)?n.get():n}setBaseTarget(t,r){this.baseTarget[t]=r}getBaseTarget(t){var s;let{initial:r}=this.props,n;if(typeof r=="string"||typeof r=="object"){let o=ct(this.props,r,(s=this.presenceContext)==null?void 0:s.custom);o&&(n=o[t])}if(r&&n!==void 0)return n;let i=this.getBaseTargetFromProps(this.props,t);return i!==void 0&&!L(i)?i:this.initialValues[t]!==void 0&&n===void 0?void 0:this.baseTarget[t]}on(t,r){return this.events[t]||(this.events[t]=new Le),this.events[t].add(r)}notify(t,...r){this.events[t]&&this.events[t].notify(...r)}scheduleRenderMicrotask(){ft.render(this.render)}};var Bt=class extends Sr{constructor(){super(...arguments),this.KeyframeResolver=An}sortInstanceNodePosition(t,r){return t.compareDocumentPosition(r)&2?1:-1}getBaseTargetFromProps(t,r){let n=t.style;return n?n[r]:void 0}removeValueFromRenderState(t,{vars:r,style:n}){delete r[t],delete n[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:t}=this.props;L(t)&&(this.childSubscription=t.on("change",r=>{this.current&&(this.current.textContent=`${r}`)}))}};var Q=class{constructor(t){this.isMounted=!1,this.node=t}update(){}};function Vr({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function fo({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function mo(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}function po(e){return e===void 0||e===1}function jn({scale:e,scaleX:t,scaleY:r}){return!po(e)||!po(t)||!po(r)}function Fe(e){return jn(e)||ho(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ho(e){return Aa(e.x)||Aa(e.y)}function Aa(e){return e&&e!=="0%"}function Pr(e,t,r){let n=e-r,i=t*n;return r+i}function Da(e,t,r,n,i){return i!==void 0&&(e=Pr(e,i,n)),Pr(e,r,n)+t}function go(e,t=0,r=1,n,i){e.min=Da(e.min,t,r,n,i),e.max=Da(e.max,t,r,n,i)}function xo(e,{x:t,y:r}){go(e.x,t.translate,t.scale,t.originPoint),go(e.y,r.translate,r.scale,r.originPoint)}var ka=.999999999999,Ra=1.0000000000001;function Na(e,t,r,n=!1){var a;let i=r.length;if(!i)return;t.x=t.y=1;let s,o;for(let u=0;u<i;u++){s=r[u],o=s.projectionDelta;let{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(n&&s.options.layoutScroll&&s.scroll&&s!==s.root&&(ye(e.x,-s.scroll.offset.x),ye(e.y,-s.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,xo(e,o)),n&&Fe(s.latestValues)&&Er(e,s.latestValues,(a=s.layout)==null?void 0:a.layoutBox))}t.x<Ra&&t.x>ka&&(t.x=1),t.y<Ra&&t.y>ka&&(t.y=1)}function ye(e,t){e.min+=t,e.max+=t}function La(e,t,r,n,i=.5){let s=A(e.min,e.max,i);go(e,t,r,s,n)}function Ia(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function Er(e,t,r){let n=r!=null?r:e;La(e.x,Ia(t.x,n.x),t.scaleX,t.scale,t.originX),La(e.y,Ia(t.y,n.y),t.scaleY,t.scale,t.originY)}function zn(e,t){return Vr(mo(e.getBoundingClientRect(),t))}function yo(e,t,r){let n=zn(e,r),{scroll:i}=t;return i&&(ye(n.x,i.offset.x),ye(n.y,i.offset.y)),n}var xf={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},yf=Pe.length;function Oa(e,t,r){let n="",i=!0;for(let o=0;o<yf;o++){let a=Pe[o],u=e[a];if(u===void 0)continue;let c=!0;if(typeof u=="number")c=u===(a.startsWith("scale")?1:0);else{let l=parseFloat(u);c=a.startsWith("scale")?l===1:l===0}if(!c||r){let l=vr(u,ut[a]);if(!c){i=!1;let f=xf[a]||a;n+=`${f}(${l}) `}r&&(t[a]=l)}}let s=e.pathRotation;return s&&(i=!1,n+=`rotate(${vr(s,ut.pathRotation)}) `),n=n.trim(),r?n=r(t,i?"":n):i&&(n="none"),n}function pt(e,t,r){let{style:n,vars:i,transformOrigin:s}=e,o=!1,a=!1;for(let u in t){let c=t[u];if(ge.has(u)){o=!0;continue}else if(tn(u)){i[u]=c;continue}else{let l=vr(c,ut[u]);u.startsWith("origin")?(a=!0,s[u]=l):n[u]=l}}if(t.transform||(o||r?n.transform=Oa(t,e.transform,r):n.transform&&(n.transform="none")),a){let{originX:u="50%",originY:c="50%",originZ:l=0}=s;n.transformOrigin=`${u} ${c} ${l}`}}function Gn(e,{style:t,vars:r},n,i){let s=e.style,o;for(o in t)s[o]=t[o];i==null||i.applyProjectionStyles(s,n);for(o in r)s.setProperty(o,r[o])}function Ba(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ft={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(S.test(e))e=parseFloat(e);else return e;let r=Ba(e,t.target.x),n=Ba(e,t.target.y);return`${r}% ${n}%`}};var Fa={correct:(e,{treeScale:t,projectionDelta:r})=>{let n=e,i=J.parse(e);if(i.length>5)return n;let s=J.createTransformer(e),o=typeof i[0]!="number"?1:0,a=r.x.scale*t.x,u=r.y.scale*t.y;i[0+o]/=a,i[1+o]/=u;let c=A(a,u,.5);return typeof i[2+o]=="number"&&(i[2+o]/=c),typeof i[3+o]=="number"&&(i[3+o]/=c),s(i)}};var Mr={borderRadius:{...Ft,applyTo:[...yr]},borderTopLeftRadius:Ft,borderTopRightRadius:Ft,borderBottomLeftRadius:Ft,borderBottomRightRadius:Ft,boxShadow:Fa};function Ar(e,{layout:t,layoutId:r}){return ge.has(e)||e.startsWith("origin")||(t||r!==void 0)&&(!!Mr[e]||e==="opacity")}function ht(e,t,r){var o;let n=e.style,i=t==null?void 0:t.style,s={};if(!n)return s;for(let a in n)(L(n[a])||i&&L(i[a])||Ar(a,e)||((o=r==null?void 0:r.getValue(a))==null?void 0:o.liveStyle)!==void 0)&&(s[a]=n[a]);return s}function vf(e){return window.getComputedStyle(e)}var Dr=class extends Bt{constructor(){super(...arguments),this.type="html",this.renderInstance=Gn}mount(t){ae(!!t.style,"motion.create() components must forward their ref to a HTML or SVG element","custom-component-ref"),super.mount(t)}readValueFromInstance(t,r){var n;if(ge.has(r))return(n=this.projection)!=null&&n.isProjecting?fn(r):Gs(t,r);{let i=vf(t),s=(tn(r)?i.getPropertyValue(r):i[r])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:r}){return zn(t,r)}build(t,r,n){pt(t,r,n.transformTemplate)}scrapeMotionValuesFromProps(t,r,n){return ht(t,r,n)}};var bf={offset:"stroke-dashoffset",array:"stroke-dasharray"},wf={offset:"strokeDashoffset",array:"strokeDasharray"};function ja(e,t,r=1,n=0,i=!0){e.pathLength=1;let s=i?bf:wf;e[s.offset]=`${-n}`,e[s.array]=`${t} ${r}`}var Tf=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function kr(e,{attrX:t,attrY:r,attrScale:n,pathLength:i,pathSpacing:s=1,pathOffset:o=0,...a},u,c,l){var d,h;if(pt(e,a,c),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:m}=e;f.transform&&(m.transform=f.transform,delete f.transform),(m.transform||f.transformOrigin)&&(m.transformOrigin=(d=f.transformOrigin)!=null?d:"50% 50%",delete f.transformOrigin),m.transform&&(m.transformBox=(h=l==null?void 0:l.transformBox)!=null?h:"fill-box",delete f.transformBox);for(let g of Tf)f[g]!==void 0&&(m[g]=f[g],delete f[g]);t!==void 0&&(f.x=t),r!==void 0&&(f.y=r),n!==void 0&&(f.scale=n),i!==void 0&&ja(f,i,s,o,!1)}var Wn=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"]);var Rr=e=>typeof e=="string"&&e.toLowerCase()==="svg";function za(e,t,r,n){Gn(e,t,void 0,n);for(let i in t.attrs)e.setAttribute(Wn.has(i)?i:Lt(i),t.attrs[i])}function Lr(e,t,r){let n=ht(e,t,r);for(let i in e)if(L(e[i])||L(t[i])){let s=Pe.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;n[s]=e[i]}return n}var Ir=class extends Bt{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=F}getBaseTargetFromProps(t,r){return t[r]}readValueFromInstance(t,r){if(ge.has(r)){let n=En(r);return n&&n.default||0}return r=Wn.has(r)?r:Lt(r),t.getAttribute(r)}scrapeMotionValuesFromProps(t,r,n){return Lr(t,r,n)}build(t,r,n){kr(t,r,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(t,r,n,i){za(t,r,n,i)}mount(t){this.isSVGTag=Rr(t.tagName),super.mount(t)}};var Sf=br.length;function vo(e){if(!e)return;if(!e.isControllingVariants){let r=e.parent?vo(e.parent)||{}:{};return e.props.initial!==void 0&&(r.initial=e.props.initial),r}let t={};for(let r=0;r<Sf;r++){let n=br[r],i=e.props[n];(Ee(i)||i===!1)&&(t[n]=i)}return t}function bo(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}var Cf=[...On].reverse(),Vf=On.length;function Pf(e){return t=>Promise.all(t.map(({animation:r,options:n})=>ua(e,r,n)))}function wo(e){let t=Pf(e),r=Ga(),n=!0,i=!1,s=c=>(l,f)=>{var d;let m=ue(e,f,c==="exit"?(d=e.presenceContext)==null?void 0:d.custom:void 0);if(m){let{transition:h,transitionEnd:g,...x}=m;l={...l,...x,...g}}return l};function o(c){t=c(e)}function a(c){let{props:l}=e,f=vo(e.parent)||{},m=[],d=new Set,h={},g=1/0;for(let y=0;y<Vf;y++){let T=Cf[y],w=r[T],v=l[T]!==void 0?l[T]:f[T],C=Ee(v),D=T===c?w.isActive:null;D===!1&&(g=y);let V=v===f[T]&&v!==l[T]&&C;if(V&&(n||i)&&e.manuallyAnimateOnMount&&(V=!1),w.protectedKeys={...h},!w.isActive&&D===null||!v&&!w.prevProp||Be(v)||typeof v=="boolean")continue;if(T==="exit"&&w.isActive&&D!==!0){w.prevResolvedValues&&(h={...h,...w.prevResolvedValues});continue}let P=Wa(w.prevProp,v),H=P||T===c&&w.isActive&&!V&&C||y>g&&C,E=!1,O=Array.isArray(v)?v:[v],I=O.reduce(s(T),{});D===!1&&(I={});let{prevResolvedValues:de={}}=w,Y={...de,...I},k=q=>{H=!0,d.has(q)&&(E=!0,d.delete(q)),w.needsAnimating[q]=!0;let j=e.getValue(q);j&&(j.liveStyle=!1)};for(let q in Y){let j=I[q],Te=de[q];if(h.hasOwnProperty(q))continue;let ke=!1;pr(j)&&pr(Te)?ke=!bo(j,Te)||P:ke=j!==Te,ke?j!=null?k(q):d.add(q):j!==void 0&&d.has(q)?k(q):w.protectedKeys[q]=!0}w.prevProp=v,w.prevResolvedValues=I,w.isActive&&(h={...h,...I}),(n||i)&&e.blockInitialAnimation&&(H=!1);let N=V&&P;H&&(!N||E)&&m.push(...O.map(q=>{let j={type:T};if(typeof q=="string"&&(n||i)&&!N&&e.manuallyAnimateOnMount&&e.parent){let{parent:Te}=e,ke=ue(Te,q);if(Te.enteringChildren&&ke){let{delayChildren:Si}=ke.transition||{};j.delay=bn(Te.enteringChildren,e,Si)}}return{animation:q,options:j}}))}if(d.size){let y={};if(typeof l.initial!="boolean"){let T=ue(e,Array.isArray(l.initial)?l.initial[0]:l.initial);T&&T.transition&&(y.transition=T.transition)}d.forEach(T=>{let w=e.getBaseTarget(T),v=e.getValue(T);v&&(v.liveStyle=!0),y[T]=w!=null?w:null}),m.push({animation:y})}let x=!!m.length;return n&&(l.initial===!1||l.initial===l.animate)&&!e.manuallyAnimateOnMount&&(x=!1),n=!1,i=!1,x?t(m):Promise.resolve()}function u(c,l){var m;if(r[c].isActive===l)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(d=>{var h;return(h=d.animationState)==null?void 0:h.setActive(c,l)}),r[c].isActive=l;let f=a(c);for(let d in r)r[d].protectedKeys={};return f}return{animateChanges:a,setActive:u,setAnimateFunction:o,getState:()=>r,reset:()=>{r=Ga(),i=!0}}}function Wa(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!bo(t,e):!1}function gt(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Ga(){return{animate:gt(!0),whileInView:gt(),whileHover:gt(),whileTap:gt(),whileDrag:gt(),whileFocus:gt(),exit:gt()}}function Un(e,t){e.min=t.min,e.max=t.max}function ve(e,t){Un(e.x,t.x),Un(e.y,t.y)}function To(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Ua=1e-4,Ef=1-Ua,Mf=1+Ua,Ha=.01,Af=0-Ha,Df=0+Ha;function $(e){return e.max-e.min}function Po(e,t,r){return Math.abs(e-t)<=r}function So(e,t,r,n=.5){e.origin=n,e.originPoint=A(t.min,t.max,e.origin),e.scale=$(r)/$(t),e.translate=A(r.min,r.max,e.origin)-e.originPoint,(e.scale>=Ef&&e.scale<=Mf||isNaN(e.scale))&&(e.scale=1),(e.translate>=Af&&e.translate<=Df||isNaN(e.translate))&&(e.translate=0)}function xt(e,t,r,n){So(e.x,t.x,r.x,n?n.originX:void 0),So(e.y,t.y,r.y,n?n.originY:void 0)}function Co(e,t,r,n=0){let i=n?A(r.min,r.max,n):r.min;e.min=i+t.min,e.max=e.min+$(t)}function Eo(e,t,r,n){Co(e.x,t.x,r.x,n==null?void 0:n.x),Co(e.y,t.y,r.y,n==null?void 0:n.y)}function Vo(e,t,r,n=0){let i=n?A(r.min,r.max,n):r.min;e.min=t.min-i,e.max=e.min+$(t)}function jt(e,t,r,n){Vo(e.x,t.x,r.x,n==null?void 0:n.x),Vo(e.y,t.y,r.y,n==null?void 0:n.y)}function Ka(e,t,r,n,i){return e-=t,e=Pr(e,1/r,n),i!==void 0&&(e=Pr(e,1/i,n)),e}function kf(e,t=0,r=1,n=.5,i,s=e,o=e){if(ne.test(t)&&(t=parseFloat(t),t=A(o.min,o.max,t/100)-o.min),typeof t!="number")return;let a=A(s.min,s.max,n);e===s&&(a-=t),e.min=Ka(e.min,t,r,a,i),e.max=Ka(e.max,t,r,a,i)}function _a(e,t,[r,n,i],s,o){kf(e,t[r],t[n],t[i],t.scale,s,o)}var Rf=["x","scaleX","originX"],Lf=["y","scaleY","originY"];function Mo(e,t,r,n){_a(e.x,t,Rf,r?r.x:void 0,n?n.x:void 0),_a(e.y,t,Lf,r?r.y:void 0,n?n.y:void 0)}function Ya(e){return e.translate===0&&e.scale===1}function Ao(e){return Ya(e.x)&&Ya(e.y)}function $a(e,t){return e.min===t.min&&e.max===t.max}function qa(e,t){return $a(e.x,t.x)&&$a(e.y,t.y)}function Xa(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Do(e,t){return Xa(e.x,t.x)&&Xa(e.y,t.y)}function ko(e){return $(e.x)/$(e.y)}function Ro(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function fe(e){return[e("x"),e("y")]}function Za(e,t,r){let n="",i=e.x.translate/t.x,s=e.y.translate/t.y,o=(r==null?void 0:r.z)||0;if((i||s||o)&&(n=`translate3d(${i}px, ${s}px, ${o}px) `),(t.x!==1||t.y!==1)&&(n+=`scale(${1/t.x}, ${1/t.y}) `),r){let{transformPerspective:c,rotate:l,pathRotation:f,rotateX:m,rotateY:d,skewX:h,skewY:g}=r;c&&(n=`perspective(${c}px) ${n}`),l&&(n+=`rotate(${l}deg) `),f&&(n+=`rotate(${f}deg) `),m&&(n+=`rotateX(${m}deg) `),d&&(n+=`rotateY(${d}deg) `),h&&(n+=`skewX(${h}deg) `),g&&(n+=`skewY(${g}deg) `)}let a=e.x.scale*t.x,u=e.y.scale*t.y;return(a!==1||u!==1)&&(n+=`scale(${a}, ${u})`),n||"none"}var If=yr.length,Ja=e=>typeof e=="string"?parseFloat(e):e,Qa=e=>typeof e=="number"||S.test(e);function tl(e,t,r,n,i,s){var o,a,u,c;i?(e.opacity=A(0,(o=r.opacity)!=null?o:1,Nf(n)),e.opacityExit=A((a=t.opacity)!=null?a:1,0,Of(n))):s&&(e.opacity=A((u=t.opacity)!=null?u:1,(c=r.opacity)!=null?c:1,n));for(let l=0;l<If;l++){let f=yr[l],m=el(t,f),d=el(r,f);if(m===void 0&&d===void 0)continue;m||(m=0),d||(d=0),m===0||d===0||Qa(m)===Qa(d)?(e[f]=Math.max(A(Ja(m),Ja(d),n),0),(ne.test(d)||ne.test(m))&&(e[f]+="%")):e[f]=d}(t.rotate||r.rotate)&&(e.rotate=A(t.rotate||0,r.rotate||0,n))}function el(e,t){return e[t]!==void 0?e[t]:e.borderRadius}var Nf=rl(0,.5,nr),Of=rl(.5,.95,G);function rl(e,t,r){return n=>n<e?0:n>t?1:r(Se(e,t,n))}function nl(e,t,r){let n=L(e)?e:we(e);return n.start(lt("",n,t,r)),n.animation}function Me(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r,n)}var il=(e,t)=>e.depth-t.depth;var Hn=class{constructor(){this.children=[],this.isDirty=!1}add(t){nt(this.children,t),this.isDirty=!0}remove(t){Ge(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(il),this.isDirty=!1,this.children.forEach(t)}};function ol(e,t){let r=W.now(),n=({timestamp:i})=>{let s=i-r;s>=t&&(le(n),e(s-t))};return M.setup(n,!0),()=>le(n)}function yt(e){return L(e)?e.get():e}var Kn=class{constructor(){this.members=[]}add(t){nt(this.members,t);for(let r=this.members.length-1;r>=0;r--){let n=this.members[r];if(n===t||n===this.lead||n===this.prevLead)continue;let i=n.instance;(!i||i.isConnected===!1)&&!n.snapshot&&(Ge(this.members,n),n.unmount())}t.scheduleRender()}remove(t){if(Ge(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){let r=this.members[this.members.length-1];r&&this.promote(r)}}relegate(t){var r;for(let n=this.members.indexOf(t)-1;n>=0;n--){let i=this.members[n];if(i.isPresent!==!1&&((r=i.instance)==null?void 0:r.isConnected)!==!1)return this.promote(i),!0}return!1}promote(t,r){var i;let n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.updateSnapshot(),t.scheduleRender();let{layoutDependency:s}=n.options,{layoutDependency:o}=t.options;(s===void 0||s!==o)&&(t.resumeFrom=n,r&&(n.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),(i=t.root)!=null&&i.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var r,n,i,s,o;(n=(r=t.options).onExitComplete)==null||n.call(r),(o=(i=t.resumingFrom)==null?void 0:(s=i.options).onExitComplete)==null||o.call(s)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}};var vt={hasAnimatedSinceResize:!0,hasEverUpdated:!1};var bt={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Lo=["","X","Y","Z"],Bf=1e3,Ff=0;function Io(e,t,r,n){let{latestValues:i}=t;i[e]&&(r[e]=i[e],t.setStaticValue(e,0),n&&(n[e]=0))}function pl(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let r=Sn(t);if(window.MotionHasOptimisedAnimation(r,"transform")){let{layout:i,layoutId:s}=e.options;window.MotionCancelOptimisedAnimation(r,"transform",M,!(i||s))}let{parent:n}=e;n&&!n.hasCheckedOptimisedAppear&&pl(n)}function _n({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:i}){return class{constructor(o={},a=t==null?void 0:t()){this.id=Ff++,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,dt.value&&(bt.nodes=bt.calculatedTargetDeltas=bt.calculatedProjections=0),this.nodes.forEach(Gf),this.nodes.forEach(Yf),this.nodes.forEach($f),this.nodes.forEach(Wf),dt.addProjectionMetrics&&dt.addProjectionMetrics(bt)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,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 u=0;u<this.path.length;u++)this.path[u].shouldResetTransform=!0;this.root===this&&(this.nodes=new Hn)}addEventListener(o,a){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Le),this.eventHandlers.get(o).add(a)}notifyListeners(o,...a){let u=this.eventHandlers.get(o);u&&u.notify(...a)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=Nt(o)&&!Sa(o),this.instance=o;let{layoutId:a,layout:u,visualElement:c}=this.options;if(c&&!c.current&&c.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(u||a)&&(this.isLayoutDirty=!0),e){let l,f=0,m=()=>this.root.updateBlockedByResize=!1;M.read(()=>{f=window.innerWidth}),e(o,()=>{let d=window.innerWidth;d!==f&&(f=d,this.root.updateBlockedByResize=!0,l&&l(),l=ol(m,250),vt.hasAnimatedSinceResize&&(vt.hasAnimatedSinceResize=!1,this.nodes.forEach(ll)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&c&&(a||u)&&this.addEventListener("didUpdate",({delta:l,hasLayoutChanged:f,hasRelativeLayoutChanged:m,layout:d})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let h=this.options.transition||c.getDefaultTransition()||Qf,{onLayoutAnimationStart:g,onLayoutAnimationComplete:x}=c.getProps(),y=!this.targetLayout||!Do(this.targetLayout,d),T=!f&&m;if(this.options.layoutRoot||this.resumeFrom||T||f&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let w={...kt(h,"layout"),onPlay:g,onComplete:x};(c.shouldReduceMotion||this.options.layoutRoot)&&(w.delay=0,w.type=!1),this.startAnimation(w),this.setAnimationOrigin(l,T,w.path)}else f||ll(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=d})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),le(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(Xf),this.animationId++)}getTransformTemplate(){let{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&pl(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let l=0;l<this.path.length;l++){let f=this.path[l];f.shouldResetTransform=!0,(typeof f.latestValues.x=="string"||typeof f.latestValues.y=="string")&&(f.isLayoutDirty=!0),f.updateScroll("snapshot"),f.options.layoutRoot&&f.willUpdate(!1)}let{layoutId:a,layout:u}=this.options;if(a===void 0&&!u)return;let c=this.getTransformTemplate();this.prevTransformTemplateValue=c?c(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let u=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),u&&this.nodes.forEach(Hf),this.nodes.forEach(sl);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(al);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Kf),this.nodes.forEach(_f),this.nodes.forEach(jf),this.nodes.forEach(zf)):this.nodes.forEach(al),this.clearAllSnapshots();let a=W.now();K.delta=Z(0,1e3/60,a-K.timestamp),K.timestamp=a,K.isProcessing=!0,lr.update.process(K),lr.preRender.process(K),lr.render.process(K),K.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,ft.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Uf),this.sharedNodes.forEach(qf)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,M.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){M.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!$(this.snapshot.measuredBox.x)&&!$(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 u=0;u<this.path.length;u++)this.path[u].updateScroll();let o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=F()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);let{visualElement:a}=this.options;a&&a.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let a=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(a=!1),a&&this.instance){let u=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:u,offset:r(this.instance),wasRoot:this.scroll?this.scroll.isRoot:u}}}resetTransform(){if(!i)return;let o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,a=this.projectionDelta&&!Ao(this.projectionDelta),u=this.getTransformTemplate(),c=u?u(this.latestValues,""):void 0,l=c!==this.prevTransformTemplateValue;o&&this.instance&&(a||Fe(this.latestValues)||l)&&(i(this.instance,c),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){let a=this.measurePageBox(),u=this.removeElementScroll(a);return o&&(u=this.removeTransform(u)),em(u),{animationId:this.root.animationId,measuredBox:a,layoutBox:u,latestValues:{},source:this.id}}measurePageBox(){var c;let{visualElement:o}=this.options;if(!o)return F();let a=o.measureViewportBox();if(!(((c=this.scroll)==null?void 0:c.wasRoot)||this.path.some(tm))){let{scroll:l}=this.root;l&&(ye(a.x,l.offset.x),ye(a.y,l.offset.y))}return a}removeElementScroll(o){var u;let a=F();if(ve(a,o),(u=this.scroll)!=null&&u.wasRoot)return a;for(let c=0;c<this.path.length;c++){let l=this.path[c],{scroll:f,options:m}=l;l!==this.root&&f&&m.layoutScroll&&(f.wasRoot&&ve(a,o),ye(a.x,f.offset.x),ye(a.y,f.offset.y))}return a}applyTransform(o,a=!1,u){var l,f;let c=u||F();ve(c,o);for(let m=0;m<this.path.length;m++){let d=this.path[m];!a&&d.options.layoutScroll&&d.scroll&&d!==d.root&&(ye(c.x,-d.scroll.offset.x),ye(c.y,-d.scroll.offset.y)),Fe(d.latestValues)&&Er(c,d.latestValues,(l=d.layout)==null?void 0:l.layoutBox)}return Fe(this.latestValues)&&Er(c,this.latestValues,(f=this.layout)==null?void 0:f.layoutBox),c}removeTransform(o){var u;let a=F();ve(a,o);for(let c=0;c<this.path.length;c++){let l=this.path[c];if(!Fe(l.latestValues))continue;let f;l.instance&&(jn(l.latestValues)&&l.updateSnapshot(),f=F(),ve(f,l.measurePageBox())),Mo(a,l.latestValues,(u=l.snapshot)==null?void 0:u.layoutBox,f)}return Fe(this.latestValues)&&Mo(a,this.latestValues),a}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.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!==K.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var d;let a=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=a.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=a.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=a.isSharedProjectionDirty);let u=!!this.resumingFrom||this!==a;if(!(o||u&&this.isSharedProjectionDirty||this.isProjectionDirty||(d=this.parent)!=null&&d.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:l,layoutId:f}=this.options;if(!this.layout||!(l||f))return;this.resolvedRelativeTargetAt=K.timestamp;let m=this.getClosestProjectingParent();m&&this.linkedParentVersion!==m.layoutVersion&&!m.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&m&&m.layout?this.createRelativeTarget(m,this.layout.layoutBox,m.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=F(),this.targetWithTransforms=F()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),Eo(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):ve(this.target,this.layout.layoutBox),xo(this.target,this.targetDelta)):ve(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&m&&!!m.resumingFrom==!!this.resumingFrom&&!m.options.layoutScroll&&m.target&&this.animationProgress!==1?this.createRelativeTarget(m,this.target,m.target):this.relativeParent=this.relativeTarget=void 0),dt.value&&bt.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||jn(this.parent.latestValues)||ho(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,a,u){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=F(),this.relativeTargetOrigin=F(),jt(this.relativeTargetOrigin,a,u,this.options.layoutAnchor||void 0),ve(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var h;let o=this.getLead(),a=!!this.resumingFrom||this!==o,u=!0;if((this.isProjectionDirty||(h=this.parent)!=null&&h.isProjectionDirty)&&(u=!1),a&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(u=!1),this.resolvedRelativeTargetAt===K.timestamp&&(u=!1),u)return;let{layout:c,layoutId:l}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(c||l))return;ve(this.layoutCorrected,this.layout.layoutBox);let f=this.treeScale.x,m=this.treeScale.y;Na(this.layoutCorrected,this.treeScale,this.path,a),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=F());let{target:d}=o;if(!d){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(To(this.prevProjectionDelta.x,this.projectionDelta.x),To(this.prevProjectionDelta.y,this.projectionDelta.y)),xt(this.projectionDelta,this.layoutCorrected,d,this.latestValues),(this.treeScale.x!==f||this.treeScale.y!==m||!Ro(this.projectionDelta.x,this.prevProjectionDelta.x)||!Ro(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",d)),dt.value&&bt.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var a;if((a=this.options.visualElement)==null||a.scheduleRender(),o){let u=this.getStack();u&&u.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=qe(),this.projectionDelta=qe(),this.projectionDeltaWithTransform=qe()}setAnimationOrigin(o,a=!1,u){let c=this.snapshot,l=c?c.latestValues:{},f={...this.latestValues},m=qe();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!a;let d=F(),h=c?c.source:void 0,g=this.layout?this.layout.source:void 0,x=h!==g,y=this.getStack(),T=!y||y.members.length<=1,w=!!(x&&!T&&this.options.crossfade===!0&&!this.path.some(Jf));this.animationProgress=0;let v,C=u==null?void 0:u.interpolateProjection(o);this.mixTargetDelta=D=>{let V=D/1e3,P=C==null?void 0:C(V);P?(m.x.translate=P.x,m.x.scale=A(o.x.scale,1,V),m.x.origin=o.x.origin,m.x.originPoint=o.x.originPoint,m.y.translate=P.y,m.y.scale=A(o.y.scale,1,V),m.y.origin=o.y.origin,m.y.originPoint=o.y.originPoint):(cl(m.x,o.x,V),cl(m.y,o.y,V)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(jt(d,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Zf(this.relativeTarget,this.relativeTargetOrigin,d,V),v&&qa(this.relativeTarget,v)&&(this.isProjectionDirty=!1),v||(v=F()),ve(v,this.relativeTarget)),x&&(this.animationValues=f,tl(f,l,this.latestValues,V,w,T)),P&&P.rotate!==void 0&&(this.animationValues||(this.animationValues=f),this.animationValues.pathRotation=P.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=V},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,u,c;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(c=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||c.stop(),this.pendingAnimation&&(le(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=M.update(()=>{vt.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=we(0)),this.motionValue.jump(0,!1),this.currentAnimation=nl(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.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);let o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Bf),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let o=this.getLead(),{targetWithTransforms:a,target:u,layout:c,latestValues:l}=o;if(!(!a||!u||!c)){if(this!==o&&this.layout&&c&&hl(this.options.animationType,this.layout.layoutBox,c.layoutBox)){u=this.target||F();let f=$(this.layout.layoutBox.x);u.x.min=o.target.x.min,u.x.max=u.x.min+f;let m=$(this.layout.layoutBox.y);u.y.min=o.target.y.min,u.y.max=u.y.min+m}ve(a,u),Er(a,l),xt(this.projectionDeltaWithTransform,this.layoutCorrected,a,l)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Kn),this.sharedNodes.get(o).add(a);let c=a.options.initialPromotionConfig;a.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(a):void 0})}isLead(){let o=this.getStack();return o?o.lead===this:!0}getLead(){var a;let{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;let{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){let{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:u}={}){let c=this.getStack();c&&c.promote(this,u),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){let o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){let{visualElement:o}=this.options;if(!o)return;let a=!1,{latestValues:u}=o;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(a=!0),!a)return;let c={};u.z&&Io("z",o,c,this.animationValues);for(let l=0;l<Lo.length;l++)Io(`rotate${Lo[l]}`,o,c,this.animationValues),Io(`skew${Lo[l]}`,o,c,this.animationValues);o.render();for(let l in c)o.setStaticValue(l,c[l]),this.animationValues&&(this.animationValues[l]=c[l]);o.scheduleRender()}applyProjectionStyles(o,a){var h,g;if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}let u=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=yt(a==null?void 0:a.pointerEvents)||"",o.transform=u?u(this.latestValues,""):"none";return}let c=this.getLead();if(!this.projectionDelta||!this.layout||!c.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=yt(a==null?void 0:a.pointerEvents)||""),this.hasProjected&&!Fe(this.latestValues)&&(o.transform=u?u({},""):"none",this.hasProjected=!1);return}o.visibility="";let l=c.animationValues||c.latestValues;this.applyTransformsToTarget();let f=Za(this.projectionDeltaWithTransform,this.treeScale,l);u&&(f=u(l,f)),o.transform=f;let{x:m,y:d}=this.projectionDelta;o.transformOrigin=`${m.origin*100}% ${d.origin*100}% 0`,c.animationValues?o.opacity=c===this?(g=(h=l.opacity)!=null?h:this.latestValues.opacity)!=null?g:1:this.preserveOpacity?this.latestValues.opacity:l.opacityExit:o.opacity=c===this?l.opacity!==void 0?l.opacity:"":l.opacityExit!==void 0?l.opacityExit:0;for(let x in Mr){if(l[x]===void 0)continue;let{correct:y,applyTo:T,isCSSVariable:w}=Mr[x],v=f==="none"?l[x]:y(l[x],c);if(T){let C=T.length;for(let D=0;D<C;D++)o[T[D]]=v}else w?this.options.visualElement.renderState.vars[x]=v:o[x]=v}this.options.layoutId&&(o.pointerEvents=c===this?yt(a==null?void 0:a.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(sl),this.root.sharedNodes.clear()}}}function jf(e){e.updateLayout()}function zf(e){var r;let t=((r=e.resumeFrom)==null?void 0:r.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){let{layoutBox:n,measuredBox:i}=e.layout,{animationType:s}=e.options,o=t.source!==e.layout.source;if(s==="size")fe(f=>{let m=o?t.measuredBox[f]:t.layoutBox[f],d=$(m);m.min=n[f].min,m.max=m.min+d});else if(s==="x"||s==="y"){let f=s==="x"?"y":"x";Un(o?t.measuredBox[f]:t.layoutBox[f],n[f])}else hl(s,t.layoutBox,n)&&fe(f=>{let m=o?t.measuredBox[f]:t.layoutBox[f],d=$(n[f]);m.max=m.min+d,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[f].max=e.relativeTarget[f].min+d)});let a=qe();xt(a,n,t.layoutBox);let u=qe();o?xt(u,e.applyTransform(i,!0),t.measuredBox):xt(u,n,t.layoutBox);let c=!Ao(a),l=!1;if(!e.resumeFrom){let f=e.getClosestProjectingParent();if(f&&!f.resumeFrom){let{snapshot:m,layout:d}=f;if(m&&d){let h=e.options.layoutAnchor||void 0,g=F();jt(g,t.layoutBox,m.layoutBox,h);let x=F();jt(x,n,d.layoutBox,h),Do(g,x)||(l=!0),f.options.layoutRoot&&(e.relativeTarget=x,e.relativeTargetOrigin=g,e.relativeParent=f)}}}e.notifyListeners("didUpdate",{layout:n,snapshot:t,delta:u,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:n}=e.options;n&&n()}e.options.transition=void 0}function Gf(e){dt.value&&bt.nodes++,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 Wf(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Uf(e){e.clearSnapshot()}function sl(e){e.clearMeasurements()}function Hf(e){e.isLayoutDirty=!0,e.updateLayout()}function al(e){e.isLayoutDirty=!1}function Kf(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function _f(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function ll(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Yf(e){e.resolveTargetDelta()}function $f(e){e.calcProjection()}function Xf(e){e.resetSkewAndRotation()}function qf(e){e.removeLeadSnapshot()}function cl(e,t,r){e.translate=A(t.translate,0,r),e.scale=A(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function ul(e,t,r,n){e.min=A(t.min,r.min,n),e.max=A(t.max,r.max,n)}function Zf(e,t,r,n){ul(e.x,t.x,r.x,n),ul(e.y,t.y,r.y,n)}function Jf(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Qf={duration:.45,ease:[.4,0,.1,1]},fl=e=>typeof navigator!="undefined"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),ml=fl("applewebkit/")&&!fl("chrome/")?Math.round:G;function dl(e){e.min=ml(e.min),e.max=ml(e.max)}function em(e){dl(e.x),dl(e.y)}function hl(e,t,r){return e==="position"||e==="preserve-aspect"&&!Po(ko(t),ko(r),.2)}function tm(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}var gl=_n({attachResizeListener:(e,t)=>Me(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0});var Yn={current:void 0},Nr=_n({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Yn.current){let e=new gl({});e.mount(window),e.setOptions({layoutScroll:!0}),Yn.current=e}return Yn.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"});var xl=require("react"),$n=(0,xl.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});var Je=require("react");function yl(e=!0){let t=(0,Je.useContext)(Tt);if(t===null)return[!0,null];let{isPresent:r,onExitComplete:n,register:i}=t,s=(0,Je.useId)();(0,Je.useEffect)(()=>{if(e)return i(s)},[e]);let o=(0,Je.useCallback)(()=>e&&n&&n(s),[s,n,e]);return!r&&n?[!1,o]:[!0]}var vl=require("react"),Xn=(0,vl.createContext)({strict:!1});var bl={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"]},wl=!1;function rm(){if(wl)return;let e={};for(let t in bl)e[t]={isEnabled:r=>bl[t].some(n=>!!r[n])};Cr(e),wl=!0}function qn(){return rm(),uo()}function Tl(e){let t=qn();for(let r in e)t[r]={...t[r],...e[r]};Cr(t)}var nm=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 Or(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||nm.has(e)}var Sl=e=>!Or(e);function im(e){typeof e=="function"&&(Sl=t=>t.startsWith("on")?!Or(t):e(t))}try{im(require("@emotion/is-prop-valid").default)}catch(e){}function Cl(e,t,r){let n={};for(let i in e)i==="values"&&typeof e.values=="object"||L(e[i])||(Sl(i)||r===!0&&Or(i)||!t&&!Or(i)||e.draggable&&i.startsWith("onDrag"))&&(n[i]=e[i]);return n}var ti=require("react/jsx-runtime");var Ut=require("react");var Vl=require("react"),Qe=(0,Vl.createContext)({});var Zn=require("react");function Pl(e,t){if(Ze(e)){let{initial:r,animate:n}=e;return{initial:r===!1||Ee(r)?r:void 0,animate:Ee(n)?n:void 0}}return e.inherit!==!1?t:{}}function Ml(e){let{initial:t,animate:r}=Pl(e,(0,Zn.useContext)(Qe));return(0,Zn.useMemo)(()=>({initial:t,animate:r}),[El(t),El(r)])}function El(e){return Array.isArray(e)?e.join(" "):e}var Wt=require("react");var Al=require("react");var zt=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function No(e,t,r){for(let n in t)!L(t[n])&&!Ar(n,r)&&(e[n]=t[n])}function om({transformTemplate:e},t){return(0,Al.useMemo)(()=>{let r=zt();return pt(r,t,e),Object.assign({},r.vars,r.style)},[t])}function sm(e,t){let r=e.style||{},n={};return No(n,r,e),Object.assign(n,om(e,t)),n}function Dl(e,t){let r={},n=sm(e,t);return e.drag&&e.dragListener!==!1&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r}var kl=require("react");var Jn=()=>({...zt(),attrs:{}});function Rl(e,t,r,n){let i=(0,kl.useMemo)(()=>{let s=Jn();return kr(s,t,Rr(n),e.transformTemplate,e.style),{...s.attrs,style:{...s.style}}},[t]);if(e.style){let s={};No(s,e.style,e),i.style={...s,...i.style}}return i}var Ll=["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 Gt(e){return typeof e!="string"||e.includes("-")?!1:!!(Ll.indexOf(e)>-1||/[A-Z]/u.test(e))}function Il(e,t,r,{latestValues:n},i,s=!1,o){let u=((o!=null?o:Gt(e))?Rl:Dl)(t,n,i,e),c=Cl(t,typeof e=="string",s),l=e!==Wt.Fragment?{...c,...u,ref:r}:{},{children:f}=t,m=(0,Wt.useMemo)(()=>L(f)?f.get():f,[f]);return(0,Wt.createElement)(e,{...l,children:m})}var Oo=require("react");function am({scrapeMotionValuesFromProps:e,createRenderState:t},r,n,i){return{latestValues:lm(r,n,i,e),renderState:t()}}function lm(e,t,r,n){let i={},s=n(e,{});for(let m in s)i[m]=yt(s[m]);let{initial:o,animate:a}=e,u=Ze(e),c=wr(e);t&&c&&!u&&e.inherit!==!1&&(o===void 0&&(o=t.initial),a===void 0&&(a=t.animate));let l=r?r.initial===!1:!1;l=l||o===!1;let f=l?a:o;if(f&&typeof f!="boolean"&&!Be(f)){let m=Array.isArray(f)?f:[f];for(let d=0;d<m.length;d++){let h=ct(e,m[d]);if(h){let{transitionEnd:g,transition:x,...y}=h;for(let T in y){let w=y[T];if(Array.isArray(w)){let v=l?w.length-1:0;w=w[v]}w!==null&&(i[T]=w)}for(let T in g)i[T]=g[T]}}}return i}var Qn=e=>(t,r)=>{let n=(0,Oo.useContext)(Qe),i=(0,Oo.useContext)(Tt),s=()=>am(e,t,n,i);return r?s():fs(s)};var Nl=Qn({scrapeMotionValuesFromProps:ht,createRenderState:zt});var Ol=Qn({scrapeMotionValuesFromProps:Lr,createRenderState:Jn});var Bl=Symbol.for("motionComponentSymbol");var wt=require("react");function Fl(e,t,r){let n=(0,wt.useRef)(r);(0,wt.useInsertionEffect)(()=>{n.current=r});let i=(0,wt.useRef)(null);return(0,wt.useCallback)(s=>{var a;s&&((a=e.onMount)==null||a.call(e,s)),t&&(s?t.mount(s):t.unmount());let o=n.current;if(typeof o=="function")if(s){let u=o(s);typeof u=="function"&&(i.current=u)}else i.current?(i.current(),i.current=null):o(s);else o&&(o.current=s)},[t])}var oe=require("react");var jl=require("react"),ei=(0,jl.createContext)({});function et(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function zl(e,t,r,n,i,s){var w,v;let{visualElement:o}=(0,oe.useContext)(Qe),a=(0,oe.useContext)(Xn),u=(0,oe.useContext)(Tt),c=(0,oe.useContext)($n),l=c.reducedMotion,f=c.skipAnimations,m=(0,oe.useRef)(null),d=(0,oe.useRef)(!1);n=n||a.renderer,!m.current&&n&&(m.current=n(e,{visualState:t,parent:o,props:r,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:l,skipAnimations:f,isSVG:s}),d.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));let h=m.current,g=(0,oe.useContext)(ei);h&&!h.projection&&i&&(h.type==="html"||h.type==="svg")&&cm(m.current,r,i,g);let x=(0,oe.useRef)(!1);(0,oe.useInsertionEffect)(()=>{h&&x.current&&h.update(r,u)});let y=r[hr],T=(0,oe.useRef)(!!y&&typeof window!="undefined"&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,y))&&((v=window.MotionHasOptimisedAnimation)==null?void 0:v.call(window,y)));return ds(()=>{d.current=!0,h&&(x.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),T.current&&h.animationState&&h.animationState.animateChanges())}),(0,oe.useEffect)(()=>{h&&(!T.current&&h.animationState&&h.animationState.animateChanges(),T.current&&(queueMicrotask(()=>{var C;(C=window.MotionHandoffMarkAsComplete)==null||C.call(window,y)}),T.current=!1),h.enteringChildren=void 0)}),h}function cm(e,t,r,n){let{layoutId:i,layout:s,drag:o,dragConstraints:a,layoutScroll:u,layoutRoot:c,layoutAnchor:l,layoutCrossfade:f}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:Gl(e.parent)),e.projection.setOptions({layoutId:i,layout:s,alwaysMeasureLayout:!!o||a&&et(a),visualElement:e,animationType:typeof s=="string"?s:"both",initialPromotionConfig:n,crossfade:f,layoutScroll:u,layoutRoot:c,layoutAnchor:l})}function Gl(e){if(e)return e.options.allowProjection!==!1?e.projection:Gl(e.parent)}function ri(e,{forwardMotionProps:t=!1,type:r}={},n,i){var c,l;n&&Tl(n);let s=r?r==="svg":Gt(e),o=s?Ol:Nl;function a(f,m){let d,h={...(0,Ut.useContext)($n),...f,layoutId:um(f)},{isStatic:g}=h,x=Ml(f),y=o(f,g);if(!g&&typeof window!="undefined"){fm(h,n);let T=mm(h);d=T.MeasureLayout,x.visualElement=zl(e,y,h,i,T.ProjectionNode,s)}return(0,ti.jsxs)(Qe.Provider,{value:x,children:[d&&x.visualElement?(0,ti.jsx)(d,{visualElement:x.visualElement,...h}):null,Il(e,f,Fl(y,x.visualElement,m),y,g,t,s)]})}a.displayName=`motion.${typeof e=="string"?e:`create(${(l=(c=e.displayName)!=null?c:e.name)!=null?l:""})`}`;let u=(0,Ut.forwardRef)(a);return u[Bl]=e,u}function um({layoutId:e}){let t=(0,Ut.useContext)(Yr).id;return t&&e!==void 0?t+"-"+e:e}function fm(e,t){let r=(0,Ut.useContext)(Xn).strict}function mm(e){let t=qn(),{drag:r,layout:n}=t;if(!r&&!n)return{};let i={...r,...n};return{MeasureLayout:r!=null&&r.isEnabled(e)||n!=null&&n.isEnabled(e)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function Wl(e,t){if(typeof Proxy=="undefined")return ri;let r=new Map,n=(s,o)=>ri(s,o,e,t),i=(s,o)=>n(s,o);return new Proxy(i,{get:(s,o)=>o==="create"?n:(r.has(o)||r.set(o,ri(o,void 0,e,t)),r.get(o))})}var Ul=require("react");var Hl=(e,t)=>{var n;return((n=t.isSVG)!=null?n:Gt(e))?new Ir(t):new Dr(t,{allowProjection:e!==Ul.Fragment})};var ni=class extends Q{constructor(t){super(t),t.animationState||(t.animationState=wo(t))}updateAnimationControlsSubscription(){let{animate:t}=this.node.getProps();Be(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:t}=this.node.getProps(),{animate:r}=this.node.prevProps||{};t!==r&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}};var dm=0,ii=class extends Q{constructor(){super(...arguments),this.id=dm++,this.isExitComplete=!1}update(){var s;if(!this.node.presenceContext)return;let{isPresent:t,onExitComplete:r}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===n)return;if(t&&n===!1){if(this.isExitComplete){let{initial:o,custom:a}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){let u=ue(this.node,o,a);if(u){let{transition:c,transitionEnd:l,...f}=u;for(let m in f)(s=this.node.getValue(m))==null||s.jump(f[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}let i=this.node.animationState.setActive("exit",!t);r&&!t&&i.then(()=>{this.isExitComplete=!0,r(this.id)})}mount(){let{register:t,onExitComplete:r}=this.node.presenceContext||{};r&&r(this.id),t&&(this.unmount=t(this.id))}unmount(){}};var Kl={animation:{Feature:ni},exit:{Feature:ii}};function je(e){return{point:{x:e.pageX,y:e.pageY}}}var _l=e=>t=>mt(t)&&e(t,je(t));function tt(e,t,r,n){return Me(e,t,_l(r),n)}var oi=({current:e})=>e?e.ownerDocument.defaultView:null;var Yl=(e,t)=>Math.abs(e-t);function $l(e,t){let r=Yl(e.x,t.x),n=Yl(e.y,t.y);return Math.sqrt(r**2+n**2)}var Xl=new Set(["auto","scroll"]),Ht=class{constructor(t,r,{transformPagePoint:n,contextWindow:i=window,dragSnapToOrigin:s=!1,distanceThreshold:o=3,element:a}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=h=>{this.handleScroll(h.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=si(this.lastRawMoveEventInfo,this.transformPagePoint));let h=Bo(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,x=$l(h.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!x)return;let{point:y}=h,{timestamp:T}=K;this.history.push({...y,timestamp:T});let{onStart:w,onMove:v}=this.handlers;g||(w&&w(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),v&&v(this.lastMoveEvent,h)},this.handlePointerMove=(h,g)=>{this.lastMoveEvent=h,this.lastRawMoveEventInfo=g,this.lastMoveEventInfo=si(g,this.transformPagePoint),M.update(this.updatePoint,!0)},this.handlePointerUp=(h,g)=>{this.end();let{onEnd:x,onSessionEnd:y,resumeAnimation:T}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&T&&T(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let w=Bo(h.type==="pointercancel"?this.lastMoveEventInfo:si(g,this.transformPagePoint),this.history);this.startEvent&&x&&x(h,w),y&&y(h,w)},!mt(t))return;this.dragSnapToOrigin=s,this.handlers=r,this.transformPagePoint=n,this.distanceThreshold=o,this.contextWindow=i||window;let u=je(t),c=si(u,this.transformPagePoint),{point:l}=c,{timestamp:f}=K;this.history=[{...l,timestamp:f}];let{onSessionStart:m}=r;m&&m(t,Bo(c,this.history));let d={passive:!0,capture:!0};this.removeListeners=be(tt(this.contextWindow,"pointermove",this.handlePointerMove,d),tt(this.contextWindow,"pointerup",this.handlePointerUp,d),tt(this.contextWindow,"pointercancel",this.handlePointerUp,d)),a&&this.startScrollTracking(a)}startScrollTracking(t){let r=t.parentElement;for(;r;){let n=getComputedStyle(r);(Xl.has(n.overflowX)||Xl.has(n.overflowY))&&this.scrollPositions.set(r,{x:r.scrollLeft,y:r.scrollTop}),r=r.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){let r=this.scrollPositions.get(t);if(!r)return;let n=t===window,i=n?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},s={x:i.x-r.x,y:i.y-r.y};s.x===0&&s.y===0||(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=s.x,this.lastMoveEventInfo.point.y+=s.y):this.history.length>0&&(this.history[0].x-=s.x,this.history[0].y-=s.y),this.scrollPositions.set(t,i),M.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),le(this.updatePoint)}};function si(e,t){return t?{point:t(e.point)}:e}function ql(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Bo({point:e},t){return{point:e,delta:ql(e,Zl(t)),offset:ql(e,pm(t)),velocity:hm(t,.1)}}function pm(e){return e[0]}function Zl(e){return e[e.length-1]}function hm(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null,i=Zl(e);for(;r>=0&&(n=e[r],!(i.timestamp-n.timestamp>_(t)));)r--;if(!n)return{x:0,y:0};n===e[0]&&e.length>2&&i.timestamp-n.timestamp>_(t)*2&&(n=e[1]);let s=ee(i.timestamp-n.timestamp);if(s===0)return{x:0,y:0};let o={x:(i.x-n.x)/s,y:(i.y-n.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function rc(e,{min:t,max:r},n){return t!==void 0&&e<t?e=n?A(t,e,n.min):Math.max(e,t):r!==void 0&&e>r&&(e=n?A(r,e,n.max):Math.min(e,r)),e}function Jl(e,t,r){return{min:t!==void 0?e.min+t:void 0,max:r!==void 0?e.max+r-(e.max-e.min):void 0}}function nc(e,{top:t,left:r,bottom:n,right:i}){return{x:Jl(e.x,r,i),y:Jl(e.y,t,n)}}function Ql(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min<e.max-e.min&&([r,n]=[n,r]),{min:r,max:n}}function ic(e,t){return{x:Ql(e.x,t.x),y:Ql(e.y,t.y)}}function oc(e,t){let r=.5,n=$(e),i=$(t);return i>n?r=Se(t.min,t.max-n,e.min):n>i&&(r=Se(e.min,e.max-i,t.min)),Z(0,1,r)}function sc(e,t){let r={};return t.min!==void 0&&(r.min=t.min-e.min),t.max!==void 0&&(r.max=t.max-e.min),r}var ai=.35;function ac(e=ai){return e===!1?e=0:e===!0&&(e=ai),{x:ec(e,"left","right"),y:ec(e,"top","bottom")}}function ec(e,t,r){return{min:tc(e,t),max:tc(e,r)}}function tc(e,t){return typeof e=="number"?e:e[t]||0}var gm=new WeakMap,ci=class{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=F(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:r=!1,distanceThreshold:n}={}){let{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;let s=f=>{r&&this.snapToCursor(je(f).point),this.stopAnimation()},o=(f,m)=>{let{drag:d,dragPropagation:h,onDragStart:g}=this.getProps();if(d&&!h&&(this.openDragLock&&this.openDragLock(),this.openDragLock=to(d),!this.openDragLock))return;this.latestPointerEvent=f,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),fe(y=>{let T=this.getAxisMotionValue(y).get()||0;if(ne.test(T)){let{projection:w}=this.visualElement;if(w&&w.layout){let v=w.layout.layoutBox[y];v&&(T=$(v)*(parseFloat(T)/100))}}this.originPoint[y]=T}),g&&M.update(()=>g(f,m),!1,!0),Rt(this.visualElement,"transform");let{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},a=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m;let{dragPropagation:d,dragDirectionLock:h,onDirectionLock:g,onDrag:x}=this.getProps();if(!d&&!this.openDragLock)return;let{offset:y}=m;if(h&&this.currentDirection===null){this.currentDirection=ym(y),this.currentDirection!==null&&g&&g(this.currentDirection);return}this.updateAxis("x",m.point,y),this.updateAxis("y",m.point,y),this.visualElement.render(),x&&M.update(()=>x(f,m),!1,!0)},u=(f,m)=>{this.latestPointerEvent=f,this.latestPanInfo=m,this.stop(f,m),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:f}=this.getProps();(f||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Ht(t,{onSessionStart:s,onStart:o,onMove:a,onSessionEnd:u,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:oi(this.visualElement),element:this.visualElement.current})}stop(t,r){let n=t||this.latestPointerEvent,i=r||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!i||!n)return;let{velocity:o}=i;this.startAnimation(o);let{onDragEnd:a}=this.getProps();a&&M.postRender(()=>a(n,i))}cancel(){this.isDragging=!1;let{projection:t,animationState:r}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),r&&r.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,r,n){let{drag:i}=this.getProps();if(!n||!li(t,i,this.currentDirection))return;let s=this.getAxisMotionValue(t),o=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(o=rc(o,this.constraints[t],this.elastic[t])),s.set(o)}resolveConstraints(){var s;let{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(s=this.visualElement.projection)==null?void 0:s.layout,i=this.constraints;t&&et(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=nc(n.layoutBox,t):this.constraints=!1,this.elastic=ac(r),i!==this.constraints&&!et(t)&&n&&this.constraints&&!this.hasMutatedConstraints&&fe(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=sc(n.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!et(t))return!1;let n=t.current;ae(n!==null,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.","drag-constraints-ref");let{projection:i}=this.visualElement;if(!i||!i.layout)return!1;i.root&&(i.root.scroll=void 0,i.root.updateScroll());let s=yo(n,i.root,this.visualElement.getTransformPagePoint()),o=ic(i.layout.layoutBox,s);if(r){let a=r(fo(o));this.hasMutatedConstraints=!!a,a&&(o=Vr(a))}return o}startAnimation(t){let{drag:r,dragMomentum:n,dragElastic:i,dragTransition:s,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),u=this.constraints||{},c=fe(l=>{if(!li(l,r,this.currentDirection))return;let f=u&&u[l]||{};(o===!0||o===l)&&(f={min:0,max:0});let m=i?200:1e6,d=i?40:1e7,h={type:"inertia",velocity:n?t[l]:0,bounceStiffness:m,bounceDamping:d,timeConstant:750,restDelta:1,restSpeed:10,...s,...f};return this.startAxisValueAnimation(l,h)});return Promise.all(c).then(a)}startAxisValueAnimation(t,r){let n=this.getAxisMotionValue(t);return Rt(this.visualElement,t),n.start(lt(t,n,0,r,this.visualElement,!1))}stopAnimation(){fe(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){var s;let r=`_drag${t.toUpperCase()}`,i=this.visualElement.getProps()[r];return i||this.visualElement.getValue(t,(s=this.visualElement.latestValues[t])!=null?s:0)}snapToCursor(t){fe(r=>{let{drag:n}=this.getProps();if(!li(r,n,this.currentDirection))return;let{projection:i}=this.visualElement,s=this.getAxisMotionValue(r);if(i&&i.layout){let{min:o,max:a}=i.layout.layoutBox[r],u=s.get()||0;s.set(t[r]-A(o,a,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:t,dragConstraints:r}=this.getProps(),{projection:n}=this.visualElement;if(!et(r)||!n||!this.constraints)return;this.stopAnimation();let i={x:0,y:0};fe(o=>{let a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){let u=a.get();i[o]=oc({min:u,max:u},this.constraints[o])}});let{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),fe(o=>{if(!li(o,t,null))return;let a=this.getAxisMotionValue(o),{min:u,max:c}=this.constraints[o];a.set(A(u,c,i[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;gm.set(this.visualElement,this);let t=this.visualElement.current,r=tt(t,"pointerdown",c=>{let{drag:l,dragListener:f=!0}=this.getProps(),m=c.target,d=m!==t&&oo(m);l&&f&&!d&&this.start(c)}),n,i=()=>{let{dragConstraints:c}=this.getProps();et(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),n||(n=xm(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:s}=this.visualElement,o=s.addEventListener("measure",i);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),M.read(i);let a=Me(window,"resize",()=>this.scalePositionWithinConstraints()),u=s.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:l})=>{this.isDragging&&l&&(fe(f=>{let m=this.getAxisMotionValue(f);m&&(this.originPoint[f]+=c[f].translate,m.set(m.get()+c[f].translate))}),this.visualElement.render())}));return()=>{a(),r(),o(),u&&u(),n&&n()}}getProps(){let t=this.visualElement.getProps(),{drag:r=!1,dragDirectionLock:n=!1,dragPropagation:i=!1,dragConstraints:s=!1,dragElastic:o=ai,dragMomentum:a=!0}=t;return{...t,drag:r,dragDirectionLock:n,dragPropagation:i,dragConstraints:s,dragElastic:o,dragMomentum:a}}};function lc(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function xm(e,t,r){let n=Nn(e,lc(r)),i=Nn(t,lc(r));return()=>{n(),i()}}function li(e,t,r){return(t===!0||t===e)&&(r===null||r===e)}function ym(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}var ui=class extends Q{constructor(t){super(t),this.removeGroupControls=G,this.removeListeners=G,this.controls=new ci(t)}mount(){let{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||G}update(){let{dragControls:t}=this.node.getProps(),{dragControls:r}=this.node.prevProps||{};t!==r&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}};var Fo=e=>(t,r)=>{e&&M.update(()=>e(t,r),!1,!0)},fi=class extends Q{constructor(){super(...arguments),this.removePointerDownListener=G}onPointerDown(t){this.session=new Ht(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:oi(this.node)})}createPanHandlers(){let{onPanSessionStart:t,onPanStart:r,onPan:n,onPanEnd:i}=this.node.getProps();return{onSessionStart:Fo(t),onStart:Fo(r),onMove:Fo(n),onEnd:(s,o)=>{delete this.session,i&&M.postRender(()=>i(s,o))}}}mount(){this.removePointerDownListener=tt(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}};var cc=require("react/jsx-runtime");var Br=require("react");var jo=!1,zo=class extends Br.Component{componentDidMount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:n,layoutId:i}=this.props,{projection:s}=t;s&&(r.group&&r.group.add(s),n&&n.register&&i&&n.register(s),jo&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),vt.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){let{layoutDependency:r,visualElement:n,drag:i,isPresent:s}=this.props,{projection:o}=n;return o&&(o.isPresent=s,t.layoutDependency!==r&&o.setOptions({...o.options,layoutDependency:r}),jo=!0,i||t.layoutDependency!==r||r===void 0||t.isPresent!==s?o.willUpdate():this.safeToRemove(),t.isPresent!==s&&(s?o.promote():o.relegate()||M.postRender(()=>{let a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){let{visualElement:t,layoutAnchor:r}=this.props,{projection:n}=t;n&&(n.options.layoutAnchor=r,n.root.didUpdate(),ft.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:t,layoutGroup:r,switchLayoutGroup:n}=this.props,{projection:i}=t;jo=!0,i&&(i.scheduleCheckAfterUnmount(),r&&r.group&&r.group.remove(i),n&&n.deregister&&n.deregister(i))}safeToRemove(){let{safeToRemove:t}=this.props;t&&t()}render(){return null}};function mi(e){let[t,r]=yl(),n=(0,Br.useContext)(Yr);return(0,cc.jsx)(zo,{...e,layoutGroup:n,switchLayoutGroup:(0,Br.useContext)(ei),isPresent:t,safeToRemove:r})}var uc={pan:{Feature:fi},drag:{Feature:ui,ProjectionNode:Nr,MeasureLayout:mi}};function fc(e,t,r){let{props:n}=e;e.animationState&&n.whileHover&&e.animationState.setActive("whileHover",r==="Start");let i="onHover"+r,s=n[i];s&&M.postRender(()=>s(t,je(t)))}var di=class extends Q{mount(){let{current:t}=this.node;t&&(this.unmount=ro(t,(r,n)=>(fc(this.node,n,"Start"),i=>fc(this.node,i,"End"))))}unmount(){}};var pi=class extends Q{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(r){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=be(Me(this.node.current,"focus",()=>this.onFocus()),Me(this.node.current,"blur",()=>this.onBlur()))}unmount(){}};function mc(e,t,r){let{props:n}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&n.whileTap&&e.animationState.setActive("whileTap",r==="Start");let i="onTap"+(r==="End"?"":r),s=n[i];s&&M.postRender(()=>s(t,je(t)))}var hi=class extends Q{mount(){let{current:t}=this.node;if(!t)return;let{globalTapTarget:r,propagate:n}=this.node.props;this.unmount=ao(t,(i,s)=>(mc(this.node,s,"Start"),(o,{success:a})=>mc(this.node,o,a?"End":"Cancel")),{useGlobalTarget:r,stopPropagation:(n==null?void 0:n.tap)===!1})}unmount(){}};var Wo=new WeakMap,Go=new WeakMap,vm=e=>{let t=Wo.get(e.target);t&&t(e)},bm=e=>{e.forEach(vm)};function wm({root:e,...t}){let r=e||document;Go.has(r)||Go.set(r,{});let n=Go.get(r),i=JSON.stringify(t);return n[i]||(n[i]=new IntersectionObserver(bm,{root:e,...t})),n[i]}function dc(e,t,r){let n=wm(t);return Wo.set(e,r),n.observe(e),()=>{Wo.delete(e),n.unobserve(e)}}var Tm={some:0,all:1},gi=class extends Q{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);let{viewport:t={}}=this.node.getProps(),{root:r,margin:n,amount:i="some",once:s}=t,o={root:r?r.current:void 0,rootMargin:n,threshold:typeof i=="number"?i:Tm[i]},a=c=>{let{isIntersecting:l}=c;if(this.isInView===l||(this.isInView=l,s&&!l&&this.hasEnteredView))return;l&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",l);let{onViewportEnter:f,onViewportLeave:m}=this.node.getProps(),d=l?f:m;d&&d(c)};this.stopObserver=dc(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver=="undefined")return;let{props:t,prevProps:r}=this.node;["amount","margin","root"].some(Sm(t,r))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}};function Sm({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}var pc={inView:{Feature:gi},tap:{Feature:hi},focus:{Feature:pi},hover:{Feature:di}};var hc={layout:{ProjectionNode:Nr,MeasureLayout:mi}};var gc={...Kl,...pc,...uc,...hc};var Uo=Wl(gc,Hl);var Ho=Uo;var Fr=typeof Element!="undefined"&&typeof Element.prototype.moveBefore=="function",Vm=-2e4,b={park:null,frame:null,currentSrc:null,sameOrigin:null,owner:null,lastRect:null,parkStrategy:"offscreen",degraded:!1,preloaded:!1,nudgeCount:0,nudgeEnabled:!0,lastNudgeAt:0,listeners:new Set};function Ko(){return{ready:b.frame!==null,docked:b.owner!==null,owner:b.owner,src:b.currentSrc,sameOrigin:b.sameOrigin,parkStrategy:b.parkStrategy,degraded:b.degraded,preloaded:b.preloaded,supportsMoveBefore:Fr,nudgeCount:b.nudgeCount,lastNudgeAt:b.lastNudgeAt}}function jr(){var e=Ko();b.listeners.forEach(function(t){try{t(e)}catch(r){}})}function xc(e){return b.listeners.add(e),function(){b.listeners.delete(e)}}function yc(){return Ko()}function Pm(e){e!=="offscreen"&&e!=="behind"||b.parkStrategy!==e&&(b.parkStrategy=e,b.frame!==null&&b.owner===null&&_o(),jr())}function Em(){return b.parkStrategy}function Mm(){var e=b.lastRect;e!==null&&(b.park.style.width=Math.max(1,Math.round(e.width))+"px",b.park.style.height=Math.max(1,Math.round(e.height))+"px")}function _o(){if(b.park!==null){if(Mm(),b.parkStrategy==="behind"&&b.lastRect!==null){b.park.style.left=Math.round(b.lastRect.left)+"px",b.park.style.top=Math.round(b.lastRect.top)+"px",b.park.style.visibility="visible",b.park.style.zIndex="0";return}b.park.style.left=Vm+"px",b.park.style.top="0px",b.park.style.visibility="hidden",b.park.style.zIndex="0"}}function vc(){b.frame!==null&&(b.frame.setAttribute("inert",""),b.frame.setAttribute("aria-hidden","true"))}function Am(){b.frame!==null&&(b.frame.removeAttribute("inert"),b.frame.removeAttribute("aria-hidden"))}function Dm(){var e=document.createElement("div");e.className="dshcs-park",e.setAttribute("data-dshcs-park",""),e.setAttribute("aria-hidden","true");var t=document.createElement("iframe");return t.className="dshcs-frame",t.setAttribute("title","code-server"),t.setAttribute("allow","clipboard-read; clipboard-write"),t.setAttribute("data-dshcs-resident",""),t.src="about:blank",e.appendChild(t),document.body.appendChild(e),b.park=e,b.frame=t,b.currentSrc="about:blank",b.owner=null,_o(),vc(),t}function km(e){var t=b.frame;if(t!==null){var r=b.sameOrigin!==e;!r&&t.hasAttribute("data-dshcs-attrs")||(e===!0?t.removeAttribute("sandbox"):e===!1&&t.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms allow-modals allow-popups allow-pointer-lock allow-clipboard-read allow-clipboard-write"),t.setAttribute("data-dshcs-attrs",e===!0?"same-origin":"cross-origin"),b.sameOrigin=e)}}function Yo(e){var t=e||{};return b.frame===null&&Dm(),typeof t.sameOrigin=="boolean"&&km(t.sameOrigin),typeof t.src=="string"&&t.src!==""&&t.src!==b.currentSrc&&Rm(t.src),b.frame}function Rm(e){b.frame===null||typeof e!="string"||e===""||e===b.currentSrc||(b.currentSrc=e,b.frame.src=e,jr())}function bc(){var e=b.frame;if(b.nudgeEnabled!==!0||e===null||e.isConnected!==!0)return!1;var t=e.style.display;return e.style.display="none",e.offsetHeight,e.style.display=t,b.nudgeCount+=1,b.lastNudgeAt=Date.now(),!0}function Lm(e){return b.nudgeEnabled=e!==!1,b.nudgeEnabled}function wc(e){if(b.frame!==null){if(Fr)try{e.moveBefore(b.frame,null);return}catch(t){b.degraded=!0,b.lastMoveError=(t&&t.name?t.name+": ":"")+(t&&t.message?t.message:String(t))}else b.degraded=!0;e.appendChild(b.frame)}}function $o(e,t){if(!(b.frame===null||e==null)){var r=b.owner===null,n=e.getBoundingClientRect();n.width>=1&&n.height>=1&&(b.lastRect={left:n.left,top:n.top,width:n.width,height:n.height}),b.owner=t===void 0?null:t,Am(),b.park.setAttribute("aria-hidden","true"),wc(e),r&&bc(),jr()}}function zr(e){b.frame!==null&&(e!==void 0&&b.owner!==e||(b.owner=null,_o(),vc(),b.park.setAttribute("aria-hidden","true"),wc(b.park),jr()))}function Xo(e){var t=e||{};return Yo(t),b.owner===null&&(typeof t.src=="string"&&t.src!==""&&(b.preloaded=!0),zr()),b.frame}function Im(){b.park!==null&&b.park.parentNode!==null&&b.park.parentNode.removeChild(b.park),b.park=null,b.frame=null,b.currentSrc=null,b.sameOrigin=null,b.owner=null,b.lastRect=null,b.degraded=!1,b.preloaded=!1,b.nudgeCount=0,b.lastNudgeAt=0,jr()}typeof window!="undefined"&&(window.__dshcsSurface={snapshot:Ko,setParkStrategy:Pm,getParkStrategy:Em,preload:Xo,dock:$o,park:zr,nudge:bc,setNudgeEnabled:Lm,destroy:Im});var p=require("react"),Vc=require("react-dom"),Qo=new Set,es={open:!1,status:null,busy:!1,ballPos:null,sidebarActive:!1};function X(e){es=Object.assign({},es,e),Qo.forEach(function(t){t()})}function Nm(e){return Qo.add(e),function(){Qo.delete(e)}}function ts(){return es}function Yt(){return p.useSyncExternalStore(Nm,ts)}var Om="/api",ns="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwJSIgaGVpZ2h0PSIxMDAlIiB2aWV3Qm94PSIwIDAgMTQ3IDE0NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8c3R5bGU+QG1lZGlhIChwcmVmZXJzLWNvbG9yLXNjaGVtZTogZGFyaykgeyogeyBmaWxsOiB3aGl0ZTsgfX08L3N0eWxlPgogIDxwYXRoIGQ9Im00Mi40MjE0LDM5LjY1NWMtMjQuNDA1NywwIC00Mi4xNTU0LDEzLjE3MjEgLTQyLjE1NTQsMzMuODQ1YzAsMjAuNTgxNCAxOC40ODkyLDMzLjg0NSA0Mi4xNTU0LDMzLjg0NWMyMy42NjYyLDAgMzguMTgwMywtMTEuNjE3MSAzOC43MzQ5LC0yOC43MjI1bC0yMS4wNzc3LC0wLjQ1NzRjLTAuOTI0NCw5LjMzMDMgLTkuMTA1OSwxNS4xODQ1IC0xNy42NTcyLDE1LjE4NDVjLTExLjc0MDYsMCAtMjAuNDMwNiwtNy41OTIyIC0yMC40MzA2LC0xOS44NDk2YzAsLTEyLjI1NzQgOC42OSwtMTkuOTg2OCAyMC40MzA2LC0yMC4yMTU1YzguNTUxMywtMC4xODMgMTYuOTE3Nyw1Ljk0NTcgMTcuNDcyMywxNS4yNzZsMjEuMDc3NywtMC42NDAzYy0wLjQ2MjIsLTE2LjgzMTEgLTE0LjE0NDIsLTI4LjI2NTIgLTM4LjU1LC0yOC4yNjUyem00OC44NDQ2LDJsNTUuNDY4LDBsMCw2NC4wMzExbC01NS40NjgsMGwwLC02NC4wMzExeiIgY2xpcC1ydWxlPSJldmVub2RkIiBmaWxsLXJ1bGU9ImV2ZW5vZGQiLz4KPC9zdmc+Cg==";async function me(e,t){var r={method:t===void 0?"GET":"POST",headers:{}};t!==void 0&&(r.headers["content-type"]="application/json",r.body=JSON.stringify(t));var n=await fetch(Om+e,r),i=await n.text(),s=null;try{s=i===""?null:JSON.parse(i)}catch(o){s=null}return n.ok?s!==null?s:{ok:!1,error:"invalid JSON response"}:{ok:!1,error:"HTTP "+n.status+(s!==null&&s.error!==void 0?": "+s.error:"")}}function Gr(e,t){try{var r=e(function(f){return f}),n=t===null?null:typeof t=="function"?t(function(f){return f}):null,i=r!=null?r.current:void 0;if(i!==void 0&&r!=null&&r.byId!=null){var s=r.byId[i];if(s!=null&&typeof s.cwd=="string"&&s.cwd!=="")return s.cwd}var o=n!=null&&Array.isArray(n.items)?n.items:[];if(i!==void 0)for(var a=0;a<o.length;a++){var u=o[a];if(u.sessionIds!=null&&u.sessionIds.indexOf(i)!==-1&&typeof u.path=="string"&&u.path!=="")return u.path}var c=n!=null?n.recentWorkspaceId:void 0;if(c!==void 0){for(var l=0;l<o.length;l++)if(o[l].workspaceId===c&&typeof o[l].path=="string"&&o[l].path!=="")return o[l].path}if(o.length>0&&typeof o[0].path=="string"&&o[0].path!=="")return o[0].path}catch(f){}}function is(e,t){if(e==null||typeof e.url!="string"||e.url==="")return null;var r=typeof t=="string"&&t!==""?t:e!=null&&e.cwd!=null?e.cwd:null;if(r==null||r==="")return e.url;var n=r.replace(/\\/g,"/"),i=n;return(/^[A-Za-z]:\//.test(n)||n.charCodeAt(0)!==47)&&(i="/"+n),e.url+"?folder="+encodeURIComponent(i)}function Pc(e){var t=e.status,r=e.pageUrl,n=e.reloadTick,i=e.owner,s=p.useRef(null),o=t!=null&&t.ok===!0&&t.running===!0,a=t!=null&&t.status==="starting",u=t!=null&&t.ok===!1,c=t!=null&&t.serve==="dsh";if(p.useLayoutEffect(function(){if(!o||r===null){zr(i);return}Yo({src:r,sameOrigin:c}),s.current!==null&&$o(s.current,i)},[o,r,c,n,i]),p.useLayoutEffect(function(){return function(){zr(i)}},[i]),o&&r!==null)return p.createElement("div",{ref:s,className:"dshcs-slot","data-code-server-slot":i!=null?i:"code-server"});if(a)return p.createElement("div",{className:"dshcs-loading"},"\u6B63\u5728\u542F\u52A8 code-server\u2026");var l=u&&t!=null&&t.error?t.error:"code-server \u672A\u8FD0\u884C",f=c?"\u5F53\u524D\u4EE5 DSH \u540C\u6E90\u8DEF\u5F84 "+(t!=null&&t.url||"/code-server/")+" \u63D0\u4F9B(\u65E0\u72EC\u7ACB\u7AEF\u53E3)\u3002":"\u5F53\u524D\u4EE5\u72EC\u7ACB\u56DE\u73AF\u7AEF\u53E3\u63D0\u4F9B(\u7AEF\u53E3 "+(t!=null&&t.port!=null?t.port:"8090")+" \u88AB\u5360\u7528\u65F6\u8BF7\u91CA\u653E\u6216\u4FEE\u6539 port \u914D\u7F6E)\u3002",m=Fr?"\u5E38\u9A7B\u9762:\u53EF\u7528(\u5207\u6807\u7B7E/\u6536\u8D77\u4FA7\u680F\u4E0D\u91CD\u8F7D)\u3002":"\u5E38\u9A7B\u9762:\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore \u2014\u2014 \u5207\u6807\u7B7E\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u53EF\u7528)\u3002";return p.createElement("div",{className:"dshcs-empty"},p.createElement("div",{className:"dshcs-emptybox"},p.createElement("div",null,u?"code-server \u542F\u52A8\u5931\u8D25":"code-server \u672A\u8FD0\u884C"),p.createElement("pre",{className:"dshcs-error"},l),p.createElement("p",{className:"dshcs-hint"},"VS Code \u6811\u968F\u63D2\u4EF6\u5305\u5185\u7F6E\u3001\u5C31\u5730\u8FD0\u884C(\u65E0\u9700\u5168\u5C40\u5B89\u88C5\u3001\u65E0\u9700\u8054\u7F51\u5B89\u88C5\u3001\u65E0\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4);\u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757\u7531\u5305\u7BA1\u7406\u5668\u5728\u5B89\u88C5\u63D2\u4EF6\u65F6\u4E00\u5E76\u88C5\u597D(\u65E0\u9700 C++ \u5DE5\u5177\u94FE)\u3002\u82E5\u6B64\u5904\u957F\u671F\u672A\u8FD0\u884C,\u8BF7\u5230 \u8BBE\u7F6E \u2192 \u63D2\u4EF6 \u2192 Code Server \u70B9\u300C\u68C0\u6D4B\u73AF\u5883\u300D\u67E5\u770B\u539F\u56E0\u3002"+f+m)))}function Bm(e){var t=Yt(),r=t.status,n=r!=null&&r.ok===!0&&r.running===!0,i=r!=null&&r.keepResident===!0,s=Gr(e&&e.useSessions,e&&e.useWorkspaces),o=n?is(r,s):null;return p.useEffect(function(){!i||!n||o===null||Xo({src:o,sameOrigin:r!=null&&r.serve==="dsh"})},[i,n,o,r!=null?r.serve:null]),null}function Ec(e){var t=function(n){var i=is(n,e);i!=null&&typeof window.open=="function"&&window.open(i,"_blank","noopener")},r=ts().status;if(r!=null&&r.running===!0){t(r);return}ts().busy!==!0&&(X({busy:!0}),me("/code-server/start",typeof e=="string"?{cwd:e}:{}).then(function(n){X({status:n,busy:!1}),t(n)}).catch(function(){X({busy:!1})}))}var Fm=["nw","n","ne","w","e","sw","s","se"],te=12,jm=720,zm=520,Mc=360,Ac=260,Tc=24;function rs(e){if(e===!1)return 0;try{if(typeof document=="undefined")return 0;var t=document.querySelectorAll("[data-composer-seat]");if(t===null||t.length===0)return 0;for(var r=Number.POSITIVE_INFINITY,n=0,i=0;i<t.length;i++){var s=t[i].getBoundingClientRect();s===null||s.width<=0||(s.top<r&&(r=s.top),s.bottom>n&&(n=s.bottom))}if(!isFinite(r)||n<=0)return 0;var o=window.innerHeight;return o-n>24?0:Math.min(Math.max(1,o-r+8),420)}catch(a){return 0}}function Ae(){return{width:Math.max(1,window.innerWidth),height:Math.max(1,window.innerHeight)}}function wi(e,t){return{width:Math.max(1,e.width-te*2),height:Math.max(1,e.height-te*2-t)}}function rt(e,t,r){return Math.min(r,Math.max(t,e))}function Kt(e,t,r){let n=wi(t,r),i=rt(e.width,Math.min(Mc,n.width),n.width),s=rt(e.height,Math.min(Ac,n.height),n.height);return{x:rt(e.x,te,Math.max(te,t.width-te-i)),y:rt(e.y,te,Math.max(te,t.height-te-r-s)),width:i,height:s}}function Gm(e,t,r){let n=wi(t,r),i=Math.min(jm,n.width),s=Math.min(zm,n.height),o=Wm(),a=o>0?o-8:t.height-te-r;return Kt({x:t.width-te-i-e*Tc,y:Math.max(te,a-s-e*Tc),width:i,height:s},t,r)}function Wm(){try{if(typeof document=="undefined")return-1;var e=document.querySelectorAll("[data-composer-seat]");if(e===null||e.length===0)return-1;for(var t=Number.POSITIVE_INFINITY,r=0;r<e.length;r++){var n=e[r].getBoundingClientRect();n!==null&&n.width>0&&n.top<t&&(t=n.top)}return isFinite(t)?t:-1}catch(i){return-1}}function Um(e,t,r,n,i){return Kt({...e,x:e.x+t,y:e.y+r},n,i)}function Hm(e,t,r,n,i,s){let o=Kt(e,i,s),a=wi(i,s),u=Math.min(Mc,a.width),c=Math.min(Ac,a.height),l=i.height-te-s,f=o.x,m=o.x+o.width,d=o.y,h=o.y+o.height;return t.includes("w")&&(f=rt(o.x+r,te,m-u)),t.includes("e")&&(m=rt(m+r,f+u,i.width-te)),t.includes("n")&&(d=rt(o.y+n,te,h-c)),t.includes("s")&&(h=rt(h+n,d+c,l)),{x:f,y:d,width:m-f,height:h-d}}function xi(e,t){let r=wi(e,t);return{x:te,y:te,width:r.width,height:r.height}}var Km='.dshcs-root{position:fixed;inset:0;z-index:2147483000;pointer-events:none}.dshcs-win{--dshcs-accent:#5b6cff;pointer-events:auto;position:fixed;isolation:isolate;z-index:2147483000;display:flex;flex-direction:column;min-width:1px;min-height:1px;overflow:hidden;color:var(--dsw-alias-label-primary,#172033);background:var(--dsw-alias-bg-base,#fff);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;box-shadow:0 1px 2px rgba(13,22,38,.08),0 18px 48px rgba(13,22,38,.2),0 0 0 1px rgba(255,255,255,.4) inset;transition:border-color .16s ease,box-shadow .16s ease}.dshcs-win:hover{border-color:color-mix(in srgb,var(--dshcs-accent) 28%,var(--dsw-alias-border-l2,#dfe3eb));box-shadow:0 2px 5px rgba(13,22,38,.1),0 22px 58px rgba(13,22,38,.24),0 0 0 1px rgba(255,255,255,.5) inset}.dshcs-win[data-interaction]{transition:none;user-select:none}.dshcs-win[data-interaction]::after{content:"";position:absolute;inset:0;z-index:18;background:transparent}.dshcs-win-max{border-radius:14px;z-index:2147483001;box-shadow:0 1px 2px rgba(13,22,38,.06),0 8px 24px rgba(13,22,38,.12)}.dshcs-win-max:hover{box-shadow:0 1px 2px rgba(13,22,38,.06),0 10px 28px rgba(13,22,38,.14)}.dshcs-win-snap{border-color:color-mix(in srgb,var(--dshcs-accent) 70%,var(--dsw-alias-border-l2,#dfe3eb));box-shadow:0 0 0 3px color-mix(in srgb,var(--dshcs-accent) 26%,transparent),0 22px 58px rgba(13,22,38,.24),0 0 0 1px rgba(255,255,255,.5) inset}.dshcs-snapghost{position:fixed;left:0;top:0;z-index:2147483000;pointer-events:none;display:grid;place-items:center;border:1.5px solid color-mix(in srgb,var(--dshcs-accent,#5b6cff) 85%,transparent);background:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 11%,transparent);border-radius:12px;box-shadow:0 0 0 3px color-mix(in srgb,var(--dshcs-accent,#5b6cff) 20%,transparent),0 10px 34px rgba(13,22,38,.14)}.dshcs-snapghint{position:absolute;top:12px;left:50%;transform:translateX(-50%);padding:5px 14px;border-radius:999px;background:color-mix(in srgb,var(--dshcs-accent,#5b6cff) 92%,#172033);color:#fff;font-size:12px;font-weight:650;letter-spacing:.02em;white-space:nowrap;box-shadow:0 6px 18px rgba(13,22,38,.3)}.dshcs-drag{position:absolute;top:0;left:0;right:0;height:14px;z-index:26;cursor:grab;touch-action:none;user-select:none}.dshcs-win[data-interaction=move] .dshcs-drag{cursor:grabbing}.dshcs-win-max .dshcs-drag{cursor:default}.dshcs-drag:hover{background:color-mix(in srgb,var(--dsw-alias-label-primary,#172033) 5%,transparent)}.dshcs-artbtn{appearance:none;display:inline-grid;place-items:center;width:22px;height:22px;padding:0;border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:6px;color:var(--dsw-alias-label-secondary,#566174);background:color-mix(in srgb,var(--dsw-alias-bg-base,#fff) 60%,transparent);cursor:pointer;transition:color .12s ease,background .12s ease,border-color .12s ease;vertical-align:middle}.dshcs-artbtn:hover{color:var(--dsw-alias-label-primary,#172033);border-color:color-mix(in srgb,var(--dshcs-accent) 40%,var(--dsw-alias-border-l2,#dfe3eb));background:color-mix(in srgb,var(--dshcs-accent) 8%,transparent)}.dshcs-artbtn:active{transform:scale(.94)}.dshcs-artbtn:focus-visible{outline:2px solid color-mix(in srgb,var(--dshcs-accent) 65%,transparent);outline-offset:1px}.dshcs-artifacts{display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:6px 8px;margin-top:16px;font-size:13px;line-height:22px;position:relative}.dshcs-artlabel{color:var(--dsw-alias-label-tertiary,#7d8798);grid-area:1/1}.dshcs-artrow{flex-wrap:nowrap;grid-area:1/2;align-items:center;gap:8px;min-width:0;display:flex;overflow:hidden}.dshcs-artitem{display:inline-flex;align-items:center;gap:4px;flex:none;min-width:0}.dshcs-artfile{text-overflow:ellipsis;white-space:nowrap;background:var(--dsw-alias-interactive-bg-hover);max-width:320px;color:var(--dsw-alias-label-secondary,#566174);font:inherit;cursor:pointer;border:none;border-radius:6px;margin:0;padding:0 8px;overflow:hidden}.dshcs-artfile:hover{color:var(--dsw-alias-label-primary,#172033);text-decoration:underline}.dshcs-artfile:focus-visible{box-shadow:inset 0 0 0 2px var(--dsw-alias-border-l3);outline:none}.dshcs-artmore{white-space:nowrap;color:var(--dsw-alias-label-tertiary,#7d8798);flex:none}.dshcs-body{position:relative;display:flex;flex:1;min-width:0;min-height:0;flex-direction:column;background:var(--dsw-alias-bg-base,#fff)}.dshcs-body[hidden]{display:none}.dshcs-frame{display:block;position:absolute;inset:0;z-index:1;width:100%;height:100%;border:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-loading{position:absolute;inset:0;z-index:2;display:grid;place-items:center;background:var(--dsw-alias-bg-base,#fff);color:var(--dsw-alias-label-tertiary,#7d8798);font-size:13px}.dshcs-win-hidden{pointer-events:none!important}.dshcs-empty{position:relative;z-index:2;flex:1;display:flex;align-items:center;justify-content:center;padding:44px 24px 24px}.dshcs-emptybox{max-width:560px;text-align:left;background:var(--dsw-alias-bg-layer-2,#f7f8fb);border:1px solid var(--dsw-alias-border-l2,#dfe3eb);border-radius:12px;padding:16px 18px}.dshcs-error{color:var(--dsw-alias-label-error,#d92d20);white-space:pre-wrap;word-break:break-all;font-family:ui-monospace,Consolas,monospace;font-size:12px;margin:8px 0 0}.dshcs-hint{color:var(--dsw-alias-label-tertiary,#7d8798);font-size:12px;margin:6px 0 0}.dshcs-resize{position:absolute;z-index:24;display:block;touch-action:none}.dshcs-resize-n,.dshcs-resize-s{left:16px;right:16px;height:10px;cursor:ns-resize}.dshcs-resize-n{top:0}.dshcs-resize-s{bottom:0}.dshcs-resize-w,.dshcs-resize-e{top:16px;bottom:16px;width:10px;cursor:ew-resize}.dshcs-resize-w{left:0}.dshcs-resize-e{right:0}.dshcs-resize-nw,.dshcs-resize-ne,.dshcs-resize-sw,.dshcs-resize-se{width:18px;height:18px}.dshcs-resize-nw{left:0;top:0;cursor:nwse-resize}.dshcs-resize-ne{right:0;top:0;cursor:nesw-resize}.dshcs-resize-sw{left:0;bottom:0;cursor:nesw-resize}.dshcs-resize-se{right:0;bottom:0;cursor:nwse-resize}.dshcs-resize-se::after{content:"";position:absolute;right:4px;bottom:4px;width:7px;height:7px;border-right:1.5px solid color-mix(in srgb,var(--dsw-alias-label-tertiary,#7d8798) 58%,transparent);border-bottom:1.5px solid color-mix(in srgb,var(--dsw-alias-label-tertiary,#7d8798) 58%,transparent);border-radius:0 0 2px}.dshcs-ball{position:fixed;width:38px;height:38px;padding:0;border:1px solid color-mix(in srgb,var(--dsw-alias-border-l2,#dfe3eb) 80%,transparent);border-radius:50%;display:grid;place-items:center;cursor:grab;touch-action:none;user-select:none;-webkit-user-select:none;z-index:2147483002;background:color-mix(in srgb,var(--dsw-alias-bg-layer-2,#f2f4f8) 88%,transparent);backdrop-filter:blur(8px) saturate(1.2);box-shadow:0 8px 20px rgba(13,22,38,.18),0 1px 2px rgba(13,22,38,.1);transition:transform .16s ease,box-shadow .16s ease,background .16s ease,border-color .16s ease}.dshcs-ball img,.dshcs-ball svg{-webkit-user-drag:none;user-drag:none}.dshcs-ball[data-dragging]{cursor:grabbing;transform:scale(1.06);box-shadow:0 14px 28px rgba(13,22,38,.28),0 2px 6px rgba(13,22,38,.16)}.dshcs-ball:hover{transform:scale(1.06);box-shadow:0 10px 24px rgba(13,22,38,.22),0 1px 2px rgba(13,22,38,.1)}.dshcs-ball:active{transform:scale(.94)}.dshcs-ball:focus-visible{outline:2px solid color-mix(in srgb,var(--dshcs-accent) 65%,transparent);outline-offset:2px}.dshcs-ball-open{background:color-mix(in srgb,var(--dshcs-accent) 14%,var(--dsw-alias-bg-layer-2,#f2f4f8));border-color:color-mix(in srgb,var(--dshcs-accent) 55%,var(--dsw-alias-border-l2,#dfe3eb));box-shadow:0 0 0 3px color-mix(in srgb,var(--dshcs-accent) 22%,transparent),0 0 20px color-mix(in srgb,var(--dshcs-accent) 38%,transparent),0 8px 20px rgba(13,22,38,.16);transform:scale(1.08)}.dshcs-ball-dot{position:absolute;top:-2px;right:-2px;width:9px;height:9px;border-radius:50%;background:#20a66a;border:2px solid var(--dsw-alias-bg-base,#fff)}.dshcs-ball-dot[data-status=starting]{background:#d78b25}.dshcs-ball-dot[data-status=error]{background:#f85149}.dshcs-ball-dot[data-status=idle]{background:#7d8798}.dshcs-ball-dot[data-status=running]::after{content:"";position:absolute;inset:-4px;border-radius:50%;border:1px solid currentColor;opacity:.3;animation:dshcs-pulse 2s ease-out infinite}.dshcs-tabroot{position:relative;display:flex;flex-direction:column;width:100%;height:100%;min-width:0;min-height:0;background:var(--dsw-alias-bg-base,#fff)}.dshcs-slot{position:relative;display:block;width:100%;height:100%;min-width:0;min-height:0;overflow:hidden;background:var(--dsw-alias-bg-base,#fff)}.dshcs-park{position:fixed;left:-20000px;top:0;width:320px;height:200px;overflow:hidden;pointer-events:none;z-index:0;visibility:hidden;contain:strict}@keyframes dshcs-pulse{0%{transform:scale(.7);opacity:.35}70%,100%{transform:scale(1.65);opacity:0}}',Sc="dsh-code-server/styles";typeof document!="undefined"&&document.querySelector("style[data-dshcs="+JSON.stringify(Sc)+"]")===null&&(yi=document.createElement("style"),yi.setAttribute("data-dshcs",Sc),yi.textContent=Km,document.head.appendChild(yi));var yi;function _m(e){var[t,r]=p.useState(!1),n=p.useRef(e.url);return p.useEffect(function(){n.current!==e.url&&(n.current=e.url,r(!1))},[e.url]),e.url!=null&&t!==!0?p.createElement("img",{src:e.url,key:"img-"+e.url,alt:"","aria-hidden":!0,draggable:!1,onError:function(){r(!0)},style:{width:20,height:20,display:"block",objectFit:"contain",borderRadius:3,WebkitUserDrag:"none",userSelect:"none"}}):p.createElement("svg",{viewBox:"0 0 18 18","aria-hidden":!0,style:{width:17,height:17}},p.createElement("rect",{x:"3",y:"3",width:"12",height:"12",rx:"2",fill:"none",stroke:"currentColor",strokeWidth:1.4}),p.createElement("path",{d:"M3 7h12M7 3v12",fill:"none",stroke:"currentColor",strokeWidth:1.4}))}var ze=38,De=8,Dc="dshcs-ball-pos";function vi(e){var t=Math.max(De,window.innerWidth-De-ze),r=Math.max(De,window.innerHeight-De-ze);return{x:Math.min(t,Math.max(De,e.x)),y:Math.min(r,Math.max(De,e.y))}}function Ym(){try{var e=window.localStorage.getItem(Dc);if(e==null)return null;var t=JSON.parse(e);if(t!=null&&typeof t.x=="number"&&typeof t.y=="number"&&isFinite(t.x)&&isFinite(t.y))return vi(t)}catch(r){}return null}function $m(e){try{window.localStorage.setItem(Dc,JSON.stringify(e))}catch(t){}}function Xm(e){var t=Yt(),r=t.status,n=r!=null?r.env:null,i=r!=null&&r.running===!0,s=i?"running":r!=null&&r.status==="starting"?"starting":r!=null&&r.status==="error"?"error":"idle",o=rs(r!=null?r.reserveComposer:!0),a=t.open===!0,u=ns,[c,l]=p.useState(Ym),[f,m]=p.useState(!1),d=p.useRef(null),h=p.useRef(!1);if(p.useEffect(function(){var v=function(){l(function(C){return C==null?C:vi(C)})};return window.addEventListener("resize",v),function(){window.removeEventListener("resize",v)}},[]),p.useEffect(function(){var v=c!=null?c:(function(){var C=rs(r!=null?r.reserveComposer:!0);return{x:window.innerWidth-De-ze,y:window.innerHeight-De-ze-(C>0?C+10:18)}})();X({ballPos:vi(v)})},[c,r]),n!=null&&n.ok!==!0||t.sidebarActive===!0)return null;var g=function(v){if(v.button===0){var C=v.currentTarget,D=C.getBoundingClientRect();d.current={pointerId:v.pointerId,dx:v.clientX-D.left,dy:v.clientY-D.top,moved:!1},h.current=!1,m(!0);try{C.setPointerCapture(v.pointerId)}catch(V){}}},x=function(v){var C=d.current;if(!(C==null||v.pointerId!==C.pointerId)){var D=v.clientX-C.dx,V=v.clientY-C.dy;(Math.abs(D-(c!=null?c.x:0))>2||Math.abs(V-(c!=null?c.y:0))>2)&&(C.moved=!0),l(vi({x:D,y:V}))}},y=function(){var v=d.current;d.current=null,m(!1),v!=null&&v.moved===!0&&(h.current=!0),v!=null&&v.moved===!0&&l(function(C){return C!=null&&$m(C),C})},T=function(){if(h.current===!0){h.current=!1;return}if(r!=null&&r.windowedOpen===!0){Ec(Gr(e&&e.useSessions,e&&e.useWorkspaces));return}X({open:!a})},w=c!=null?{left:c.x,top:c.y}:{right:14,bottom:o>0?o+10:18};return Vc.createPortal(p.createElement("button",{type:"button",className:"dshcs-ball"+(a?" dshcs-ball-open":""),style:w,"data-dragging":f===!0?"":void 0,title:r!=null&&r.windowedOpen===!0?"\u5728\u6D4F\u89C8\u5668\u65B0\u6807\u7B7E\u9875\u6253\u5F00 Code Server(\u53EF\u62D6\u52A8)":a?"\u6536\u8D77 Code Server(Esc)":"\u6253\u5F00 Code Server(\u53EF\u62D6\u52A8)","aria-label":a?"\u6536\u8D77 Code Server(Esc)":"\u6253\u5F00 Code Server","aria-expanded":a,onPointerDown:g,onPointerMove:x,onPointerUp:y,onPointerCancel:y,onDragStart:function(v){v&&v.preventDefault&&v.preventDefault()},onClick:T},p.createElement(_m,{url:u}),p.createElement("span",{className:"dshcs-ball-dot","data-status":s,"aria-hidden":!0})),document.body)}function qm(e){var t=Yt(),r=t.status,n=r!=null&&r.ok===!0&&r.running===!0,i=r!=null&&r.status==="starting",s=r!=null&&r.ok===!1,o=Gr(e&&e.useSessions,e&&e.useWorkspaces),a=p.useRef(void 0),[u,c]=p.useState(0),l=rs(r!=null?r.reserveComposer:!0),[f,m]=p.useState(!1),[d,h]=p.useState(null),[g,x]=p.useState(function(){return Gm(0,Ae(),l)}),y=p.useRef(g),T=p.useRef(function(){});y.current=g,p.useEffect(function(){var R=function(){x(function(re){return f?xi(Ae(),l):Kt(re,Ae(),l)})};return window.addEventListener("resize",R),function(){window.removeEventListener("resize",R)}},[f,l]),p.useEffect(function(){x(function(R){return Kt(R,Ae(),l)})},[l]),p.useEffect(function(){return function(){T.current()}},[]);var w=12,v=4,[C,D]=p.useState(!1),V=p.useRef(null),P=function(R,re){if(R.button===0){R.preventDefault(),R.stopPropagation(),T.current();var se=R.currentTarget.ownerDocument.defaultView;if(se!==null){var pe=R.pointerId,Ur=R.currentTarget,os=f,$t=os?xi(Ae(),l):y.current,Nc=$t.width>0?(R.clientX-$t.x)/$t.width:0,Oc=Math.min(14,Math.max(0,R.clientY-$t.y)),z={pointerId:pe,origin:{x:R.clientX,y:R.clientY},start:$t,ratio:Nc,grabY:Oc,wasMaximized:os,restored:!1,snapped:!1,moved:!1};V.current=z,h(re);try{Ur.setPointerCapture(pe)}catch(ce){}var ss=function(ce){if(ce.pointerId===pe){if(re!=="move"){x(Hm(z.start,re,ce.clientX-z.origin.x,ce.clientY-z.origin.y,Ae(),l));return}var ls=ce.clientX-z.origin.x,Kr=ce.clientY-z.origin.y;if(Math.abs(ls)+Math.abs(Kr)>3&&(z.moved=!0),z.wasMaximized&&!z.restored){if(Kr<v)return;var Ci=y.current,_r={x:ce.clientX-Ci.width*Math.min(.9,Math.max(.1,z.ratio)),y:ce.clientY-z.grabY,width:Ci.width,height:Ci.height};_r=Kt(_r,Ae(),l),z.restored=!0,z.start=_r,z.origin={x:ce.clientX,y:ce.clientY},m(!1),x(_r);return}var Bc=z.start.y+Kr,Fc=Um(z.start,ls,Kr,Ae(),l);x(Fc);var Vi=Bc<=w;Vi!==z.snapped&&(z.snapped=Vi,D(Vi))}},as=function(){se.removeEventListener("pointermove",ss),se.removeEventListener("pointerup",Hr),se.removeEventListener("pointercancel",Hr),T.current=function(){},V.current=null;try{Ur.releasePointerCapture(pe)}catch(ce){}},Hr=function(ce){ce.pointerId===pe&&(as(),h(null),(!z.wasMaximized||z.restored===!0)&&(z.snapped===!0&&z.moved===!0&&m(!0),z.snapped===!0&&D(!1)))};T.current=as,se.addEventListener("pointermove",ss),se.addEventListener("pointerup",Hr),se.addEventListener("pointercancel",Hr)}}},H=function(){m(function(R){return!R})},E=function(R){R.target.closest("[data-window-control]")===null&&P(R,"move")},O=function(R){R.target.closest("[data-window-control]")===null&&H()};if(p.useEffect(function(){if(!t.open||t.sidebarActive===!0)return;var R=!1;async function re(){X({busy:!0});var se=await me("/code-server/status");if(!R){if(se!=null&&se.ok===!0&&se.running===!0){X({status:se,busy:!1});return}var pe=await me("/code-server/start",typeof o=="string"?{cwd:o}:{});R||X({status:pe,busy:!1})}}return re(),function(){R=!0}},[t.open,t.sidebarActive]),p.useEffect(function(){if(t.sidebarActive===!0||typeof o!="string"||o===""||a.current===o)return;var R=a.current!==void 0&&a.current!==o;a.current=o;var re=!1;async function se(){X({busy:!0});var pe=await me("/code-server/start",{cwd:o});re||(X({status:pe,busy:!1}),R&&pe!=null&&pe.ok===!0&&pe.running===!0&&c(function(Ur){return Ur+1}))}return se(),function(){re=!0}},[o,t.sidebarActive]),p.useEffect(function(){t.open||(a.current=void 0)},[t.open]),p.useEffect(function(){if(t.sidebarActive!==!0){var R=window.setInterval(function(){me("/code-server/status").then(function(re){X({status:re})})},3e3);return function(){window.clearInterval(R)}}},[t.sidebarActive]),p.useEffect(function(){if(!t.open)return;function R(re){re.key==="Escape"&&X({open:!1})}return window.addEventListener("keydown",R),function(){window.removeEventListener("keydown",R)}},[t.open]),t.sidebarActive===!0)return null;var I=r!=null&&typeof r.url=="string"?r.url:null,de=n&&r!=null&&typeof r.cwd=="string"&&r.cwd!==""?r.cwd:null,Y=null;if(de!==null){var k=de.replace(/\\/g,"/");Y=k,(/^[A-Za-z]:\//.test(k)||k.charCodeAt(0)!==47)&&(Y="/"+k)}var N=I!==null?I+(Y!==null?"?folder="+encodeURIComponent(Y):""):null,Ti=p.createElement(Pc,{status:r,pageUrl:N,reloadTick:u,owner:"window"}),q=["dshcs-win",f?"dshcs-win-max":"",C?"dshcs-win-snap":"",t.open===!1?"dshcs-win-hidden":""].filter(Boolean).join(" "),j=f?xi(Ae(),l):g,Te=t.ballPos!=null?t.ballPos:{x:window.innerWidth-De-ze,y:window.innerHeight-De-ze-(l>0?l+10:18)},ke={x:Te.x+ze/2,y:Te.y+ze/2},Si=Math.max(.05,ze/Math.max(j.width,j.height)),kc=t.open===!1?{x:ke.x-j.width/2,y:ke.y-j.height/2,width:j.width,height:j.height,scale:Si,borderRadius:19,opacity:0}:{x:j.x,y:j.y,width:j.width,height:j.height,scale:1,borderRadius:12,opacity:1},Rc=d!==null?{duration:0}:{type:"spring",stiffness:340,damping:38,mass:.9,opacity:{type:"spring",stiffness:420,damping:40,mass:.8},borderRadius:{duration:.2}},Lc=p.createElement(Ho.section,{className:q,style:t.open===!1?{left:0,top:0,pointerEvents:"none"}:{left:0,top:0},animate:kc,initial:!1,transition:Rc,"data-interaction":d!==null?d:void 0,role:"dialog","aria-label":"Code Server"},p.createElement("span",{className:"dshcs-drag",title:"\u62D6\u52A8\u79FB\u52A8 / \u53CC\u51FB\u6700\u5927\u5316",onPointerDown:E,onDoubleClick:O}),p.createElement("div",{className:"dshcs-body"},Ti),f?null:Fm.map(function(R){return p.createElement("span",{key:R,className:"dshcs-resize dshcs-resize-"+R,"data-direction":R,onPointerDown:function(re){P(re,R)}})})),Wr=xi(Ae(),l),Ic=p.createElement(Ho.div,{className:"dshcs-snapghost",initial:!1,animate:{opacity:C===!0?1:0,x:Wr.x,y:Wr.y,width:Wr.width,height:Wr.height},transition:C===!0?{type:"spring",stiffness:500,damping:44,mass:.9}:{duration:.14}},p.createElement("span",{className:"dshcs-snapghint"},"\u677E\u5F00\u4EE5\u6700\u5927\u5316"));return Vc.createPortal(p.createElement(p.Fragment,null,Lc,Ic),document.body)}var qo="code-server",Cc="dsh-code-server-app",_t={openTab:null};function Zm(e){var t=e!=null&&typeof e.size=="number"?e.size:16;return p.createElement("img",{src:ns,alt:"","aria-hidden":!0,draggable:!1,className:e!=null?e.className:void 0,style:{width:t,height:t,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function Jm(e){var t=e.useTabInfo(),r=t.tab,n=Yt(),i=n.status,s=Gr(e.useSessions,null),o=p.useRef(void 0),[a,u]=p.useState(0),c=r.navigation,l=c!=null&&typeof c.revision=="number"?c.revision:0;return p.useEffect(function(){if(!(typeof s!="string"||s==="")&&o.current!==s){var f=o.current!==void 0;o.current=s;var m=!1;return me("/code-server/start",{cwd:s}).then(function(d){m||(X({status:d}),f&&d!=null&&d.ok===!0&&d.running===!0&&u(function(h){return h+1}))}).catch(function(){}),function(){m=!0}}},[s]),p.useEffect(function(){me("/code-server/status").then(function(m){m!=null&&X({status:m})}).catch(function(){});var f=window.setInterval(function(){me("/code-server/status").then(function(m){X({status:m})}).catch(function(){})},3e3);return function(){window.clearInterval(f)}},[]),p.useEffect(function(){var f=c!=null?c.params:null,m=f!=null&&typeof f.path=="string"?f.path:"";m!==""&&me("/code-server/open-file",{file:m}).catch(function(){})},[l]),p.createElement("div",{className:"dshcs-tabroot","data-code-server-tab":"body"},p.createElement(Pc,{status:i,pageUrl:is(i,s),reloadTick:a,owner:"tab:"+r.id}))}function Qm(e){var t=e.sidebarRightTabs,r=e.sidebarRight;t==null||r==null||(e.effect(function(){return t.register({id:Cc,kind:qo,priority:"extension",title:function(){return"Code Server"},guide:[{order:20,title:function(){return"Code Server"},description:function(){return"\u5728\u53F3\u4FA7\u680F\u6807\u7B7E\u91CC\u8FD0\u884C VS Code \u7F51\u9875\u7248,\u8DDF\u968F\u5F53\u524D\u4F1A\u8BDD\u5DE5\u4F5C\u533A\u3002"},icon:Zm}]})},"code-server: sidebar tab type"),e.effect(function(){return e.slots.inject("sidebar.right.pane.tab",function(){return e.slots.register({name:"sidebar.right.pane.tab",key:Cc},Jm)})},"code-server: sidebar tab body"),_t.openTab=function(n){try{return r.openTab(qo,n!=null?{params:n}:void 0),!0}catch(i){return console.warn("[code-server] sidebar openTab failed:",i!=null&&i.message!=null?i.message:String(i)),!1}},e.effect(function(){return function(){_t.openTab=null,X({sidebarActive:!1})}},"code-server: sidebar mode reset"),X({sidebarActive:!0,open:!1}),console.log("[code-server] right-sidebar tab registered (kind="+qo+")"))}var ed=".dshcs-card{border:1px solid var(--dsw-alias-border-l2);background:var(--dsw-alias-bg-layer-3);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.dshcs-card:hover{border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardOpen{background:var(--dsw-alias-bg-layer-2);border-color:var(--dsw-alias-label-dimmed,var(--dsw-alias-border-l2))}.dshcs-cardHeader{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dshcs-cardHeader:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:-2px}.dshcs-cardHeadText{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dshcs-cardName{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:600;line-height:1.4}.dshcs-cardDescription{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));font-size:13px;line-height:1.5}.dshcs-cardChevron{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));flex:none;transition:transform .16s;display:inline-flex}.dshcs-cardChevronOpen{transform:rotate(180deg)}.dshcs-cardBody{border-top:1px solid var(--dsw-alias-border-l2);margin:0 16px;padding-bottom:8px}.dshcs-cardReadOnly{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:12px 0 0;font-size:12px;line-height:1.5}.dshcs-pending{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-cardFooter{border-top:1px solid var(--dsw-alias-border-l2);justify-content:flex-end;align-items:center;gap:8px;padding:12px 0 4px;display:flex}.dshcs-cardFailed{min-width:0;color:var(--dsw-alias-label-error,var(--dsw-alias-state-error-primary));flex:1;margin:0;font-size:12px;line-height:1.5}.dshcs-cbtn{appearance:none;font:inherit;cursor:pointer;border-radius:8px;padding:5px 14px;font-size:13px;line-height:1.5;border:1px solid transparent;transition:color .12s ease,background .12s ease}.dshcs-cbtn:disabled{opacity:.4;cursor:default}.dshcs-cbtn:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.dshcs-cbtnOutline{border-color:var(--dsw-alias-border-l2);color:var(--dsw-alias-label-secondary);background:0 0}.dshcs-cbtnOutline:hover:not(:disabled){color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover,transparent)}.dshcs-cbtnPrimary{background:var(--dsw-alias-label-primary);color:var(--dsw-alias-bg-layer-3);border-color:var(--dsw-alias-label-primary);font-weight:600}.dshcs-cbtnPrimary:hover:not(:disabled){filter:brightness(.95)}.dshcs-cbtnPrimary:active:not(:disabled){filter:brightness(.9)}.dshcs-field{flex-direction:column;gap:6px;padding:12px 0;display:flex}.dshcs-field+.dshcs-field{border-top:1px solid var(--dsw-alias-border-l2)}.dshcs-fieldHead{align-items:center;gap:8px;display:flex}.dshcs-fieldLabel{min-width:0;color:var(--dsw-alias-label-primary);flex:1;font-size:13px;font-weight:500;line-height:1.5}.dshcs-hint{color:var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary));margin:0;font-size:12px;line-height:1.5}.dshcs-check{display:flex;align-items:center;gap:8px;cursor:pointer}.dshcs-check input{accent-color:var(--dsw-alias-brand-primary);width:15px;height:15px;margin:0;flex:none}.dshcs-check input:disabled{cursor:default}.dshcs-badges{align-items:center;gap:8px;display:inline-flex}.dshcs-badge{white-space:nowrap;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-2));color:var(--dsw-alias-label-secondary);border-radius:999px;padding:1px 8px;font-size:11px;font-weight:500;line-height:17px}.dshcs-reset{font:inherit;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;padding:0;font-size:12px;line-height:1.5}.dshcs-reset:hover:not(:disabled){color:var(--dsw-alias-label-primary)}.dshcs-reset:disabled{cursor:default}",td="dsh-code-server/Card.module.css";function rd(e,t){if(typeof document!="undefined"&&document.querySelector("style[data-plugin-css="+JSON.stringify(e)+"]")===null){var r=document.createElement("style");r.dataset.plugin="dsh-code-server",r.dataset.pluginCss=e,r.textContent=t,document.head.appendChild(r)}}rd(td,ed);function nd(e){return p.createElement("svg",{width:14,height:14,viewBox:"0 0 14 14",fill:"none","aria-hidden":!0,className:e.className},p.createElement("path",{d:"M3.5 5.25L7 8.75L10.5 5.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}))}function bi(e){return p.createElement("button",{type:"button",className:"dshcs-cbtn "+(e.variant==="primary"?"dshcs-cbtnPrimary":"dshcs-cbtnOutline"),disabled:e.disabled===!0,onClick:e.onClick},e.children)}function Zo(e){return p.createElement("label",{className:"dshcs-check"},p.createElement("input",{type:"checkbox",checked:e.checked===!0,disabled:e.disabled===!0,onChange:function(t){e.onChange(t.target.checked)}}),p.createElement("span",{className:"dshcs-hint"},e.children))}function Jo(e){var t=[];return e.overridden===!0&&(t.push(p.createElement("span",{className:"dshcs-badge"},e.overriddenLabel)),t.push(p.createElement("button",{type:"button",className:"dshcs-reset",disabled:e.disabled===!0,onClick:e.onReset},e.resetLabel))),t.length===0?null:p.createElement("span",{className:"dshcs-badges"},...t)}function id(e){var[t,r]=p.useState(!1),n=e.state;if(n==null||n.available!==!0)return null;var i=e.title,s=n.dirty!==!0||n.invalid===!0||n.saving===!0;return p.createElement("li",{className:"dshcs-card"+(t?" dshcs-cardOpen":"")},p.createElement("button",{type:"button",className:"dshcs-cardHeader","aria-expanded":t,onClick:function(){r(!t)}},p.createElement("span",{className:"dshcs-cardHeadText"},p.createElement("span",{className:"dshcs-cardName"},i),p.createElement("span",{className:"dshcs-cardDescription"},e.description)),n.dirty===!0?p.createElement("span",{className:"dshcs-pending"},e.unsavedLabel):null,p.createElement(nd,{className:"dshcs-cardChevron"+(t?" dshcs-cardChevronOpen":"")})),t===!0?p.createElement("div",{className:"dshcs-cardBody"},n.writable!==!0?p.createElement("p",{className:"dshcs-cardReadOnly",role:"status"},e.readOnlyLabel):null,e.children,p.createElement("div",{className:"dshcs-cardFooter"},n.failed===!0?p.createElement("p",{className:"dshcs-cardFailed",role:"status"},e.saveFailedLabel):null,p.createElement(bi,{disabled:n.dirty!==!0||n.saving===!0,onClick:e.onDiscard},e.discardLabel),p.createElement(bi,{variant:"primary",disabled:s,onClick:e.onSave},n.saving===!0?e.savingLabel:e.saveLabel))):null)}function od(e){try{let I=function(){me("/code-server/status").then(function(k){k!=null&&typeof k=="object"&&X({status:k})}).catch(function(){})};var t=e.scope,[r,n]=p.useState(function(){return t!==void 0?t.getSnapshot():null}),[i,s]=p.useState(null),[o,a]=p.useState(!1),[u,c]=p.useState(!1),l=Yt(),[f,m]=p.useState(yc());if(p.useEffect(function(){return xc(function(k){m(k)})},[]),p.useEffect(function(){if(t===void 0||typeof t.subscribe!="function")return;function k(){try{n(t.getSnapshot())}catch(Ti){}}var N=t.subscribe(k);return function(){typeof N=="function"&&N()}},[t]),t===void 0)return console.error("[code-server] card scope missing"),null;if(r==null||r.status!=="ready")return r!=null&&r.status==="unavailable"&&console.warn("[code-server] settings scope unavailable:",r.status),null;var d=r.value!==void 0&&r.value!==null?r.value:{},h=r.user,g={reserveComposer:d.reserveComposer!==!1,windowedOpen:d.windowedOpen===!0,keepResident:d.keepResident!==!1},x=h!=null&&Object.prototype.hasOwnProperty.call(h,"reserveComposer"),y=h!=null&&Object.prototype.hasOwnProperty.call(h,"windowedOpen"),T=h!=null&&Object.prototype.hasOwnProperty.call(h,"keepResident"),w=l!=null&&l.sidebarActive===!0,v=i!==null&&(i.reserveComposer!==g.reserveComposer||i.windowedOpen!==g.windowedOpen||i.keepResident!==g.keepResident),C=!v||o,D={available:!0,writable:r.writable,dirty:v,invalid:!1,saving:o,failed:u,reserveComposer:{text:i!==null?i.reserveComposer:g.reserveComposer,overridden:x}};async function de(){if(v&&!o){a(!0),c(!1);try{var k=i!==null?i:g;await e.scope.set("reserveComposer",k.reserveComposer===!0),await e.scope.set("windowedOpen",k.windowedOpen===!0),await e.scope.set("keepResident",k.keepResident===!0),s(null),I()}catch(N){c(!0)}a(!1)}}async function Y(){if(!(o||r.writable!==!0)){a(!0),c(!1);try{typeof e.scope.unset=="function"?(await e.scope.unset("reserveComposer"),await e.scope.unset("windowedOpen"),await e.scope.unset("keepResident")):(await e.scope.set("reserveComposer",d.reserveComposer===void 0||d.reserveComposer===null?!0:d.reserveComposer),await e.scope.set("windowedOpen",d.windowedOpen===!0),await e.scope.set("keepResident",d.keepResident===void 0||d.keepResident===null?!0:d.keepResident)),s(null),I()}catch(k){c(!0)}a(!1)}}var[V,P]=p.useState(null),[H,E]=p.useState(!1),O=p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u73AF\u5883\u68C0\u6D4B"),p.createElement("span",{className:"dshcs-badges"},p.createElement(bi,{variant:"primary",disabled:H,onClick:async function(){E(!0);var k=await me("/code-server/status");P(k!=null&&k.env!=null?k.env:{error:"status \u672A\u8FD4\u56DE env"}),E(!1)}},H?"\u68C0\u6D4B\u4E2D\u2026":"\u68C0\u6D4B\u73AF\u5883"))),V!=null?p.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},V.error!=null?p.createElement("span",null,"\u68C0\u6D4B\u5931\u8D25: "+V.error):p.createElement("span",null,"\u72B6\u6001: "+(V.ok===!0?"\u2705 \u5C31\u7EEA":"\u274C \u4E0D\u901A\u8FC7")+(V.treeVersion!=null?" \xB7 VS Code \u6811: "+V.treeVersion:"")+(V.upToDate===!1&&V.vendored!=null?"(\u5185\u7F6E "+V.vendored+") ":"")+(V.productPath!=null?" \xB7 \u5BA2\u6237\u7AEF\u8DEF\u5F84: "+V.productPath:"")+(V.entry!=null?" \xB7 \u5165\u53E3: "+V.entry:" \xB7 \u5165\u53E3\u7F3A\u5931")+" \xB7 VS Code \u5185\u90E8\u4F9D\u8D56: "+(V.vscodeInner===!0?"\u2705":"\u274C")+" \xB7 \u9884\u7F16\u8BD1\u539F\u751F\u5305: "+(V.nativeRuntime!=null&&V.nativeRuntime.packages>0?"\u2705 "+V.nativeRuntime.name+"@"+(V.nativeRuntime.version!=null?V.nativeRuntime.version:"?")+"("+V.nativeRuntime.packages+" \u5305)":"\u274C \u672A\u5B89\u88C5("+(V.nativeRuntime!=null&&V.nativeRuntime.name!=null?V.nativeRuntime.name:"\u5E73\u53F0\u805A\u5408\u5305")+")"))):p.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},'\u70B9\u51FB"\u68C0\u6D4B\u73AF\u5883"\u67E5\u770B VS Code \u6811\u72B6\u6001(\u4F9D\u8D56\u7531\u5305\u7BA1\u7406\u5668\u5B89\u88C5,\u65E0\u9700\u5B89\u88C5\u6B65\u9AA4)'),p.createElement("div",{className:"dshcs-hint",style:{marginTop:10,color:"var(--dsw-alias-label-tertiary,var(--dsw-alias-label-secondary))"}},"\u8FD0\u884C\u4F4D\u7F6E: "+(V!=null&&V.tree!=null?V.tree:"<\u63D2\u4EF6\u76EE\u5F55>\\vendor\\vscode")+`
3
+ \u5378\u8F7D: dsh plugin --profile web remove dsh-code-server-app`));return p.createElement(id,{title:"Code Server",description:"\u5165\u53E3:\u53F3\u4FA7\u680F\u6807\u7B7E(DSH \u2265 0.1.5-alpha.1)/ \u60AC\u6D6E\u7403\u56DE\u9000;\u7A97\u53E3\u5316\u8BBE\u7F6E\u63A7\u5236\u65B0\u6807\u7B7E\u9875\u6253\u5F00",state:D,unsavedLabel:"\u672A\u4FDD\u5B58",readOnlyLabel:"\u672C\u90E8\u7F72\u7684\u8BBE\u7F6E\u4E3A\u53EA\u8BFB\u3002",saveFailedLabel:"\u672C\u90E8\u7F72\u6CA1\u6709\u63A5\u53D7\u8FD9\u4E9B\u503C\uFF0C\u5DF2\u4FDD\u7559\u4F9B\u4F60\u4FEE\u6539\u3002",discardLabel:"\u653E\u5F03\u4FEE\u6539",saveLabel:"\u4FDD\u5B58",savingLabel:"\u4FDD\u5B58\u4E2D\u2026",onSave:de,onDiscard:function(){s(null),c(!1)}},p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u5165\u53E3"),p.createElement("span",{className:"dshcs-badges"},p.createElement(bi,{disabled:w!==!0,onClick:function(){_t.openTab!==null&&_t.openTab(null)}},"\u5728\u53F3\u4FA7\u680F\u6253\u5F00"))),p.createElement("div",{className:"dshcs-hint",style:{marginTop:6}},w===!0?"\u5F53\u524D:\u53F3\u4FA7\u680F\u6807\u7B7E(DSH \u2265 0.1.5-alpha.1)\u3002\u4ECE\u53F3\u4FA7\u680F\u300C\u5F00\u59CB\u300D\u9875\u7684 Code Server \u5165\u53E3\u6846\u3001\u4EA7\u7269\u65C1\u6309\u94AE\u6216\u4E0A\u9762\u7684\u6309\u94AE\u6253\u5F00\u3002":"\u5F53\u524D:\u60AC\u6D6E\u7403(\u672C\u90E8\u7F72\u65E0\u53F3\u4FA7\u680F\u670D\u52A1)\u3002\u70B9\u51FB\u53F3\u4E0B\u89D2\u60AC\u6D6E\u7403\u5C55\u5F00\u6D6E\u7A97\u3002")),w===!0?null:p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u4FDD\u7559\u8F93\u5165\u6846\u4E0A\u65B9\u7A7A\u95F4"),x===!0?p.createElement(Jo,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){Y()}}):null),p.createElement(Zo,{checked:i!==null?i.reserveComposer:g.reserveComposer,disabled:r.writable!==!0,onChange:function(k){s(function(N){return Object.assign({},N!==null?N:g,{reserveComposer:k===!0})}),c(!1)}},"\u5F00\u542F\u65F6\u7A97\u53E3\u521D\u59CB/\u7F29\u653E/\u6700\u5927\u5316\u6B62\u4E8E\u8F93\u5165\u6846\u4E0A\u65B9;\u5173\u95ED\u540E\u5141\u8BB8\u76D6\u4F4F\u8F93\u5165\u6846(\u6700\u5927\u5316\u5230\u89C6\u53E3\u5E95)")),p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u7A97\u53E3\u5316\u6253\u5F00(\u65B0\u6807\u7B7E\u9875)"),y===!0?p.createElement(Jo,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){Y()}}):null),p.createElement(Zo,{checked:i!==null?i.windowedOpen:g.windowedOpen,disabled:r.writable!==!0,onChange:function(k){s(function(N){return Object.assign({},N!==null?N:g,{windowedOpen:k===!0})}),c(!1)}},"\u5F00\u542F\u540E\u5165\u53E3(\u4EA7\u7269\u6309\u94AE/\u8BBE\u7F6E\u5361/\u60AC\u6D6E\u7403)\u5728\u6D4F\u89C8\u5668\u65B0\u6807\u7B7E\u9875\u6253\u5F00 code-server(\u81EA\u52A8\u542F\u52A8\u5E76\u8DDF\u968F\u5F53\u524D\u5DE5\u4F5C\u533A);\u5173\u95ED\u5219\u4F7F\u7528\u53F3\u4FA7\u680F\u6807\u7B7E\u6216\u5185\u90E8\u6D6E\u52A8\u7A97\u53E3")),p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u540E\u53F0\u5E38\u9A7B(\u5207\u6807\u7B7E\u4E0D\u91CD\u8F7D)"),T===!0?p.createElement(Jo,{overridden:!0,disabled:r.writable!==!0,overriddenLabel:"\u5DF2\u8986\u76D6",resetLabel:"\u6062\u590D\u9ED8\u8BA4",onReset:function(){Y()}}):null),p.createElement(Zo,{checked:i!==null?i.keepResident:g.keepResident,disabled:r.writable!==!0,onChange:function(k){s(function(N){return Object.assign({},N!==null?N:g,{keepResident:k===!0})}),c(!1)}},'\u5F00\u542F\u540E\u5BBF\u4E3B\u542F\u52A8\u5373\u628A IDE \u52A0\u8F7D\u5230\u540E\u53F0"\u505C\u653E\u533A":\u5207\u6362\u53F3\u4FA7\u680F\u6807\u7B7E\u3001\u6536\u8D77/\u5C55\u5F00\u4FA7\u680F\u3001\u62D6\u6210\u6D6E\u52A8\u7A97\u53E3\u90FD\u4E0D\u518D\u91CD\u8F7D,\u9996\u6B21\u6253\u5F00\u514D\u7B49\u5F85;\u5173\u95ED\u5219\u53EA\u5728\u6253\u5F00\u9762\u677F\u65F6\u52A0\u8F7D(\u7701\u5185\u5B58)'),p.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},Fr?"\u5E38\u9A7B\u9762:"+(f.docked?"\u5DF2\u505C\u9760":f.ready?"\u5DF2\u505C\u653E(\u540E\u53F0\u8FD0\u884C\u4E2D)":"\u672A\u542F\u52A8")+(f.degraded?" \xB7 \u672C\u6B21\u53D1\u751F\u8FC7\u964D\u7EA7\u91CD\u8F7D":""):"\u5F53\u524D\u6D4F\u89C8\u5668\u4E0D\u652F\u6301 Element.moveBefore(Chromium <133)\u2192 \u5E38\u9A7B\u4E0D\u53EF\u7528,\u5207\u6807\u7B7E\u4ECD\u4F1A\u6574\u9875\u91CD\u8F7D(\u5347\u7EA7\u6D4F\u89C8\u5668\u540E\u81EA\u52A8\u751F\u6548)")),p.createElement("div",{className:"dshcs-field"},p.createElement("div",{className:"dshcs-fieldHead"},p.createElement("span",{className:"dshcs-fieldLabel"},"\u4F9D\u8D56\u5B89\u88C5"),null),p.createElement("div",{className:"dshcs-hint",style:{marginTop:4}},"0.1.36 \u8D77 code-server \u672C\u4F53\u968F\u63D2\u4EF6\u5305\u53D1\u5E03,VS Code \u5185\u90E8\u4F9D\u8D56\u4E0E\u9884\u7F16\u8BD1\u539F\u751F\u6A21\u5757(\u5E73\u53F0\u805A\u5408\u5305)\u5168\u90E8\u7531\u5305\u7BA1\u7406\u5668\u5728 dsh plugin add \u65F6\u5B89\u88C5,\u4E0D\u518D\u9700\u8981\u300C\u5B89\u88C5\u73AF\u5883\u300D\u6B65\u9AA4\u3002")),O)}catch(I){return console.error("[code-server] card render error:",I!=null&&I.message!==void 0?I.message:String(I)),null}}function sd(e){var t=[];try{var r=e.turn.data.get("deliverables"),n=e.seq!=null?e.seq:Number.POSITIVE_INFINITY;if(r!=null&&Array.isArray(r.produced))for(var i={},s=0;s<r.produced.length;s++){var o=r.produced[s];o==null||typeof o.path!="string"||o.path===""||o.seq!=null&&o.seq>n||i[o.path]!==!0&&(i[o.path]=!0,t.push(o.path))}}catch(a){}return t}function ad(e){var t=sd(e);return t.length===0?null:t}function ld(e){return p.createElement("img",{src:ns,alt:"","aria-hidden":!0,draggable:!1,style:{width:15,height:15,display:"block",objectFit:"contain",WebkitUserDrag:"none",userSelect:"none"}})}function cd(e){var t=Yt();if(e==null||!Array.isArray(e.matched)||e.matched.length===0)return null;var r=e.matched;function n(s){var o=String(s).replace(/\\/g,"/"),a=o.lastIndexOf("/");return a>=0?o.slice(a+1):o}function i(s){var o=t.status;if(o!=null&&o.windowedOpen===!0){Ec(Gr(e.useSessions,e.useWorkspaces));return}t.sidebarActive===!0&&_t.openTab!==null&&_t.openTab({path:s})===!0||(X({open:!0}),me("/code-server/open-file",{file:s}).then(function(a){(a==null||a.ok!==!0)&&window.alert(a!=null&&a.error?a.error:"\u6253\u5F00\u5931\u8D25")}).catch(function(a){window.alert("\u6253\u5F00\u5931\u8D25: "+String(a))}))}return p.createElement("div",{className:"dshcs-artifacts"},p.createElement("span",{className:"dshcs-artlabel"},"\u4EA7\u7269"),p.createElement("div",{className:"dshcs-artrow"},r.slice(0,6).map(function(s){return p.createElement("span",{key:s,className:"dshcs-artitem"},p.createElement("button",{type:"button",className:"dshcs-artfile",title:s,"aria-label":"\u6253\u5F00: "+s,onClick:function(){i(s)}},n(s)),p.createElement("button",{type:"button",className:"dshcs-artbtn",title:"\u5728 Code Server \u6253\u5F00: "+s,"aria-label":"\u5728 Code Server \u6253\u5F00: "+s,onClick:function(){i(s)}},p.createElement(ld,null)))}),r.length>6?p.createElement("span",{className:"dshcs-artmore"},"\u2026"):null))}function ud(e){try{fd(e)}catch(t){console.error("[code-server] apply failed:",t&&t.stack?t.stack:String(t));try{document.title="CS-ERR "+(t&&t.message||String(t))}catch(r){}}}function fd(e){var t=e.get("slots");if(t===void 0){console.error("[code-server] slots service unavailable");return}var r=e.settingsScope,n=null;if(r!==void 0&&typeof r.bind=="function")n=r.bind({namespace:"code-server"});else{console.error("[code-server] settingsScope unavailable (inject missing?); settings card disabled");return}me("/code-server/status").then(function(i){X({status:i})}).catch(function(){}),t.inject("shell.overlay",()=>t.register({name:"shell.overlay",id:"code-server",order:70,label:"Code Server"},i=>p.createElement(p.Fragment,null,p.createElement(Xm,i),p.createElement(qm,i),p.createElement(Bm,i))));try{t.inject("conversation.chat.turnTail",function(){return t.register({name:"conversation.chat.turnTail",priority:-9,id:"dshcs-open-file",select:ad},cd)}),console.log("[code-server] turnTail artifacts buttons registered")}catch(i){console.warn("[code-server] turnTail register failed:",i!=null&&i.message!=null?i.message:String(i))}t.inject("settings.plugin.item",()=>t.register({name:"settings.plugin.item",key:"code-server",label:"Code Server",inject:function(){return{scope:n}}},od));try{typeof e.inject=="function"?e.inject(["sidebarRightTabs","sidebarRight"],function(i){try{Qm(i)}catch(s){console.warn("[code-server] sidebar tab registration failed; keep floating ball:",s!=null&&s.message!=null?s.message:String(s))}}):console.warn("[code-server] ctx.inject unavailable; keep floating ball")}catch(i){console.warn("[code-server] sidebar inject failed; keep floating ball:",i!=null&&i.message!=null?i.message:String(i))}console.log("[code-server] client bundle registered (floating ball + window + settings card; right-sidebar tab pending/active)")}var md=["slots","settingsScope"],dd="code-server";
4
4
  return module.exports;}});
package/lib/index.js CHANGED
@@ -99,6 +99,9 @@ export const Config = z.object({
99
99
  * (同源、无额外端口、复用 DSH 的 Host/Origin + cookie 防护;需要 DSH 提供 webServer 服务,
100
100
  * 缺失或注册失败时自动回退 loopback)。 */
101
101
  serve: z.union([z.const('loopback'), z.const('dsh')]).default('loopback'),
102
+ /** keepResident=true(默认)客户端在宿主 running 后把 IDE 预先加载到"停放区",
103
+ * 切标签/收起侧栏不再重载;false 则只在打开面板时才加载(省内存)。 */
104
+ keepResident: z.boolean().default(true),
102
105
  });
103
106
 
104
107
  const DEFAULT_CONFIG = {
@@ -384,6 +387,7 @@ export async function apply(ctx, config) {
384
387
  let reserveComposer = true;
385
388
  let windowedOpen = false;
386
389
  let serveSetting = 'loopback';
390
+ let keepResident = true; // 客户端常驻预热(0.2.2)
387
391
  if (settingsSvc !== undefined && typeof settingsSvc.register === 'function') {
388
392
  try {
389
393
  const scope = settingsSvc.register(SETTINGS_NS, Config);
@@ -393,6 +397,7 @@ export async function apply(ctx, config) {
393
397
  reserveComposer = resolved && typeof resolved.reserveComposer === 'boolean' ? resolved.reserveComposer : true;
394
398
  windowedOpen = resolved && typeof resolved.windowedOpen === 'boolean' ? resolved.windowedOpen : false;
395
399
  serveSetting = resolved && resolved.serve === 'dsh' ? 'dsh' : 'loopback';
400
+ keepResident = resolved && typeof resolved.keepResident === 'boolean' ? resolved.keepResident : true;
396
401
  }
397
402
  scope.watch((next) => {
398
403
  if (next != null && typeof next.reserveComposer === 'boolean') {
@@ -409,6 +414,10 @@ export async function apply(ctx, config) {
409
414
  console.log(`[code-server] serve updated: ${serveSetting}(下次启动生效)`);
410
415
  }
411
416
  }
417
+ if (next != null && typeof next.keepResident === 'boolean') {
418
+ keepResident = next.keepResident;
419
+ console.log(`[code-server] keepResident updated: ${keepResident}`);
420
+ }
412
421
  });
413
422
  } catch (error) {
414
423
  console.error(`[code-server] settings unavailable; using defaults (reserveComposer=true, windowedOpen=false): ${error.message}`);
@@ -502,6 +511,7 @@ export async function apply(ctx, config) {
502
511
  adopted: state.adopted,
503
512
  reserveComposer,
504
513
  windowedOpen,
514
+ keepResident,
505
515
  env: state.env,
506
516
  setup: {
507
517
  running: state.setup.running,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-code-server-app",
3
- "version": "0.2.1",
4
- "description": "VS Code (from a code-server release) inside DSH Web and Desktop: right-sidebar tab with a floating-ball fallback, driven by the plugin's own launcher over the in-process VS Code server (lib/launcher.mjs). Two serving modes: loopback port (default) or same-origin mount on DSH's own webServer (/code-server, protected by ctx.connection.requestRejection). No code-server Node layer, no argon2, no C++ toolchain.",
3
+ "version": "0.2.2",
4
+ "description": "VS Code (from a code-server release) inside DSH Web and Desktop: right-sidebar tab with a floating-ball fallback, driven by the plugin's own launcher over the in-process VS Code server (lib/launcher.mjs). The IDE is a resident surface moved with Element.moveBefore instead of being remounted, so switching sidebar tabs no longer reloads the workbench. Two serving modes: loopback port (default) or same-origin mount on DSH's own webServer (/code-server, protected by ctx.connection.requestRejection). No code-server Node layer, no argon2, no C++ toolchain.",
5
5
  "homepage": "https://github.com/jinsiyu/dsh-code-server-app",
6
6
  "repository": {
7
7
  "type": "git",
@@ -3,7 +3,7 @@
3
3
  "vscodeVersion": "1.136.1",
4
4
  "productPath": "stable-8d5f383f301ca20681f5b6606b8207d9dc87bdd8",
5
5
  "layout": "vscode-only",
6
- "preparedAt": "2026-09-10T09:02:13.757Z",
6
+ "preparedAt": "2026-09-10T13:43:43.880Z",
7
7
  "source": "registry",
8
8
  "node": "v24.13.1",
9
9
  "platform": "win32",