okengine 0.14.1 → 0.15.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/package.json +3 -4
- package/site/content/docs/elements/ai.mdx +2 -1
- package/site/content/docs/elements/channel.mdx +1 -0
- package/site/content/docs/elements/clock.mdx +3 -0
- package/site/content/docs/elements/flow.mdx +3 -0
- package/site/content/docs/elements/gate.mdx +25 -22
- package/site/content/docs/elements/signal.mdx +4 -4
- package/site/content/docs/elements/store.mdx +86 -27
- package/site/content/docs/elements/vault.mdx +1 -0
- package/site/content/docs/get-started/basic-usage.mdx +22 -13
- package/site/content/docs/get-started/index.mdx +5 -0
- package/site/content/docs/get-started/introduction.mdx +11 -3
- package/site/content/docs/get-started/meta.json +1 -1
- package/site/content/docs/get-started/project-structure.mdx +932 -0
- package/site/content/docs/reference/cli.md +13 -10
- package/site/content/docs/reference/client.mdx +25 -21
- package/site/content/docs/reference/security.md +1 -1
- package/src/auth/bindings.ts +14 -5
- package/src/auth/cross-plane.ts +10 -3
- package/src/cli/ai-setup/ai-setup.test.ts +62 -0
- package/src/cli/ai-setup/apply.ts +32 -1
- package/src/cli/attach-host-console.test.ts +3 -2
- package/src/cli/attach-host-console.ts +3 -0
- package/src/cli/build.test.ts +4 -2
- package/src/cli/db-seed.ts +48 -15
- package/src/cli/db.test.ts +104 -0
- package/src/cli/db.ts +122 -10
- package/src/cli/dev-controls.test.ts +20 -0
- package/src/cli/dev-controls.ts +13 -0
- package/src/cli/dev.test.ts +15 -4
- package/src/cli/dev.ts +102 -29
- package/src/cli/ensure-drizzle-config.ts +2 -1
- package/src/cli/tui/DevLive.tsx +12 -2
- package/src/cli/tui/keys.test.ts +2 -1
- package/src/cli/tui/keys.ts +3 -2
- package/src/compiler/aot.test.ts +1 -1
- package/src/compiler/extract.test.ts +409 -33
- package/src/compiler/extract.ts +318 -67
- package/src/compiler/flow-path.test.ts +96 -0
- package/src/compiler/flow-path.ts +173 -0
- package/src/compiler/generate-adopt.test.ts +112 -3
- package/src/compiler/generate-adopt.ts +280 -26
- package/src/compiler/schema-from-ast.ts +609 -0
- package/src/console/server/bind.ts +2 -2
- package/src/console/server/console.test.ts +3 -0
- package/src/console/server/flows.ts +120 -40
- package/src/console/server/invoke-user-flow.test.ts +3 -1
- package/src/console/server/invoke-user-flow.ts +17 -2
- package/src/console/server/iso-at.test.ts +9 -0
- package/src/console/server/iso-at.ts +11 -0
- package/src/console/server/security-headers.ts +6 -3
- package/src/console/server/spa-proxy.test.ts +1 -0
- package/src/console/server/sql-catalog.ts +147 -7
- package/src/console/server/sql-rls.test.ts +16 -0
- package/src/console/server/state.ts +8 -0
- package/src/console/server/store.test.ts +7 -4
- package/src/console/server/store.ts +142 -58
- package/src/console/ui-next/dist/assets/agent-disclosure-C0X1fbWF.js +1 -0
- package/src/console/ui-next/dist/assets/{cache-glyph-BanhLsEY.js → cache-glyph-F1FI122b.js} +1 -1
- package/src/console/ui-next/dist/assets/{call-pii-button-bqkxMrJH.js → call-pii-button-DEDCl_j3.js} +1 -1
- package/src/console/ui-next/dist/assets/collapsible-LPqGvfoz.js +1 -0
- package/src/console/ui-next/dist/assets/{confirm-sheet-DDCRmG62.js → confirm-sheet-3ptDzXbz.js} +1 -1
- package/src/console/ui-next/dist/assets/{duration-tone-oiRxPVsZ.js → duration-tone-sC3lGABz.js} +1 -1
- package/src/console/ui-next/dist/assets/{explorer-empty-HjTnVQoR.js → explorer-empty-BvYrygyO.js} +1 -1
- package/src/console/ui-next/dist/assets/flows-page-Dluo1Bd7.js +1 -0
- package/src/console/ui-next/dist/assets/{highlighted-json-CvDPvveV.js → highlighted-json-CS_O8L-r.js} +1 -1
- package/src/console/ui-next/dist/assets/http-method--sWDdXSB.js +1 -0
- package/src/console/ui-next/dist/assets/index-Ca3HZMVq.js +66 -0
- package/src/console/ui-next/dist/assets/index-UtTDRQpS.css +2 -0
- package/src/console/ui-next/dist/assets/{link-DF7SZ9Ek.js → link-COeyggt-.js} +1 -1
- package/src/console/ui-next/dist/assets/{observability-page-BEZDzyYh.js → observability-page-HK9-BO8z.js} +2 -2
- package/src/console/ui-next/dist/assets/react-D8E3mtu1.js +1 -0
- package/src/console/ui-next/dist/assets/replica-lag-DBIFFf7d.js +18 -0
- package/src/console/ui-next/dist/assets/sheet-form-Dnwa5oOR.js +1 -0
- package/src/console/ui-next/dist/assets/shortcut-keys-CoqwEIi0.js +1 -0
- package/src/console/ui-next/dist/assets/skeleton-BHcfDYcb.js +1 -0
- package/src/console/ui-next/dist/assets/store-page-BSohH3wM.js +41 -0
- package/src/console/ui-next/dist/assets/trace-detail-sheet-CFIGRnnA.js +2 -0
- package/src/console/ui-next/dist/assets/tree-expand-toggle-BgLl34w7.js +54 -0
- package/src/console/ui-next/dist/assets/units-page-B0cFE76A.js +1 -0
- package/src/console/ui-next/dist/assets/{use-vault-list-Cl79j_ku.js → use-vault-list-BLbZhzyF.js} +1 -1
- package/src/console/ui-next/dist/assets/vault-page-B1SbYe10.js +2 -0
- package/src/console/ui-next/dist/index.html +6 -6
- package/src/console/ui-next/src/client.ts +35 -7
- package/src/console/ui-next/src/components/motion/table/index.tsx +16 -0
- package/src/console/ui-next/src/components/motion/table/types.ts +4 -0
- package/src/console/ui-next/src/components/ui/kbd.tsx +2 -2
- package/src/console/ui-next/src/features/flows/traces/http-method.ts +19 -0
- package/src/console/ui-next/src/features/flows/traces/trace-detail.test.ts +19 -1
- package/src/console/ui-next/src/features/flows/traces/traces-pane.tsx +10 -3
- package/src/console/ui-next/src/features/store/detail/browse-section.tsx +45 -1
- package/src/console/ui-next/src/features/store/detail/resource-panel.tsx +78 -16
- package/src/console/ui-next/src/features/store/detail/store-row-detail-sheet.tsx +155 -14
- package/src/console/ui-next/src/features/store/explorer/store-tree.tsx +33 -133
- package/src/console/ui-next/src/features/store/files/file-preview.tsx +4 -1
- package/src/console/ui-next/src/features/store/grid/rls-policy-sheet.tsx +326 -165
- package/src/console/ui-next/src/features/store/grid/sql-insert-sheet.tsx +6 -0
- package/src/console/ui-next/src/features/store/grid/store-data-grid.tsx +50 -3
- package/src/console/ui-next/src/features/store/lib/files-meta.test.ts +3 -0
- package/src/console/ui-next/src/features/store/lib/files-meta.ts +12 -0
- package/src/console/ui-next/src/features/store/lib/query-defaults.test.ts +25 -0
- package/src/console/ui-next/src/features/store/lib/query-defaults.ts +85 -3
- package/src/console/ui-next/src/features/store/lib/query-gate.ts +30 -4
- package/src/console/ui-next/src/features/store/lib/rls-policy.test.ts +139 -0
- package/src/console/ui-next/src/features/store/lib/rls-policy.ts +223 -21
- package/src/console/ui-next/src/features/store/lib/schema-graph.ts +4 -0
- package/src/console/ui-next/src/features/store/lib/sql-catalog.test.ts +24 -0
- package/src/console/ui-next/src/features/store/lib/sql-catalog.ts +19 -0
- package/src/console/ui-next/src/features/store/lib/store-tree.test.ts +6 -0
- package/src/console/ui-next/src/features/store/lib/store-tree.ts +13 -0
- package/src/console/ui-next/src/features/store/query/query-console.tsx +48 -14
- package/src/console/ui-next/src/features/store/query/query-gate-menu.tsx +19 -20
- package/src/console/ui-next/src/features/store/query/query-gate-parts.tsx +2 -1
- package/src/console/ui-next/src/features/store/query/query-results.tsx +110 -83
- package/src/console/ui-next/src/features/store/schema/schema-table-node.tsx +17 -0
- package/src/console/ui-next/src/features/units/call/call-api-panel.tsx +112 -72
- package/src/console/ui-next/src/features/units/lib/contract-input.test.ts +206 -1
- package/src/console/ui-next/src/features/units/lib/contract-input.ts +55 -0
- package/src/console/ui-next/src/features/vault/lib/types.ts +1 -1
- package/src/docker/compose-health.test.ts +27 -0
- package/src/docker/compose-health.ts +19 -3
- package/src/docker/docker.test.ts +3 -0
- package/src/docker/recipes/pgdog.ts +2 -0
- package/src/drivers/clock-postgres.ts +13 -9
- package/src/drivers/instances-postgres.ts +4 -6
- package/src/drivers/journal-postgres.ts +13 -9
- package/src/drivers/pg-rls.test.ts +87 -0
- package/src/drivers/pg-rls.ts +233 -7
- package/src/drivers/pglite.ts +26 -3
- package/src/drivers/postgres.test.ts +23 -0
- package/src/drivers/postgres.ts +133 -9
- package/src/drivers/types.ts +10 -0
- package/src/elements/clock/declare.ts +26 -1
- package/src/elements/gate/boot.ts +5 -5
- package/src/elements/gate/declare.ts +36 -4
- package/src/elements/gate/flatten.ts +1 -1
- package/src/elements/gate/runtime.ts +1 -1
- package/src/elements/store/declare.ts +9 -6
- package/src/elements/store/emit-drizzle.ts +44 -8
- package/src/elements/store/resource.test.ts +1 -1
- package/src/elements/store/rls-identity.test.ts +95 -0
- package/src/elements/store/rls-identity.ts +116 -0
- package/src/elements/store/runtime.ts +4 -0
- package/src/elements/store/schema-decl.test.ts +37 -0
- package/src/elements/store/schema-decl.ts +161 -0
- package/src/elements/store/seed.ts +1 -1
- package/src/elements/store/sql-condition.test.ts +12 -0
- package/src/elements/store/sql-condition.ts +26 -2
- package/src/elements/store/sql-rls-isolation.test.ts +165 -0
- package/src/elements/store/sql-rls-stamp.test.ts +117 -0
- package/src/elements/store/sql-session.ts +81 -3
- package/src/elements/store/upsert-app.test.ts +1 -1
- package/src/elements/store.ts +14 -0
- package/src/http.ts +20 -3
- package/src/index.ts +10 -1
- package/src/kernel/adopt-barrel-fresh.test.ts +1 -1
- package/src/kernel/adopt-routes.ts +30 -2
- package/src/kernel/app.ts +131 -14
- package/src/kernel/auto-cache.test.ts +8 -8
- package/src/kernel/auto-registry.test.ts +49 -9
- package/src/kernel/boot.test.ts +4 -4
- package/src/kernel/boot.ts +2 -2
- package/src/kernel/effects-stamping.test.ts +3 -3
- package/src/kernel/element-registries.ts +12 -5
- package/src/kernel/errors.ts +24 -0
- package/src/kernel/flow-units.ts +64 -0
- package/src/kernel/flow.ts +29 -17
- package/src/kernel/fx.ts +23 -0
- package/src/kernel/horizontal-child.ts +4 -4
- package/src/kernel/http-path-pending.ts +20 -0
- package/src/kernel/http-resource.ts +4 -0
- package/src/kernel/http-stream.test.ts +4 -4
- package/src/kernel/pipeline.test.ts +2 -2
- package/src/kernel/plugin-elements.test.ts +1 -1
- package/src/kernel/plugin-needs.test.ts +1 -1
- package/src/kernel/ready.test.ts +2 -2
- package/src/kernel/resource-mount.test.ts +14 -0
- package/src/kernel/run-duration.test.ts +2 -2
- package/src/kernel/stamp-http.test.ts +79 -0
- package/src/kernel/stamp-http.ts +75 -0
- package/src/kernel/triggers.ts +52 -27
- package/src/manifest/types.ts +13 -0
- package/src/release/measure.ts +2 -2
- package/src/runtime/json-code-block.test.ts +2 -2
- package/src/runtime/serve.test.ts +4 -4
- package/src/term.test.ts +52 -4
- package/src/term.ts +125 -17
- package/src/test/reset-element-registries.ts +8 -3
- package/src/cli/ask-seed.test.ts +0 -96
- package/src/cli/ask-seed.ts +0 -82
- package/src/console/ui-next/dist/assets/collapsible-DYb0xU8C.js +0 -1
- package/src/console/ui-next/dist/assets/flows-page-DxDsOd4f.js +0 -1
- package/src/console/ui-next/dist/assets/http-method-CJCBYL2j.js +0 -1
- package/src/console/ui-next/dist/assets/index-Ce6WKWKM.js +0 -66
- package/src/console/ui-next/dist/assets/index-D4Ldtj79.css +0 -2
- package/src/console/ui-next/dist/assets/query-gate-parts-1m8m1iNp.js +0 -2
- package/src/console/ui-next/dist/assets/react-B1ML8gxg.js +0 -1
- package/src/console/ui-next/dist/assets/replica-lag-C8_BRt2x.js +0 -18
- package/src/console/ui-next/dist/assets/sheet-form-D-ata7jy.js +0 -1
- package/src/console/ui-next/dist/assets/shortcut-keys-DO4IsVqv.js +0 -1
- package/src/console/ui-next/dist/assets/skeleton-CL_X0GCj.js +0 -1
- package/src/console/ui-next/dist/assets/store-page-v3LXdYpr.js +0 -45
- package/src/console/ui-next/dist/assets/trace-detail-sheet-DFLFfUUX.js +0 -2
- package/src/console/ui-next/dist/assets/units-page-C0gW6Kdo.js +0 -1
- package/src/console/ui-next/dist/assets/vault-page-DuKzqwzW.js +0 -2
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{r as t}from"./react-dom-Bph1y7z7.js";import{A as n}from"./xyflow-D7n4g6go.js";var r=n(),i=e(t(),1),a=(0,i.createContext)({});function o(e){let t=(0,i.useRef)(null);return t.current===null&&(t.current=e()),t.current}var s=typeof window<`u`?i.useLayoutEffect:i.useEffect,c=(0,i.createContext)(null);function l(e,t){e.indexOf(t)===-1&&e.push(t)}function u(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var d=(e,t,n)=>n>t?t:n<e?e:n,f=()=>{},p=()=>{},m={},h=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),g=e=>typeof e==`object`&&!!e,_=e=>/^0[^.\s]+$/u.test(e);function v(e){let t;return()=>(t===void 0&&(t=e()),t)}var y=e=>e,b=(...e)=>e.reduce((e,t)=>n=>t(e(n))),x=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},S=class{constructor(){this.subscriptions=[]}add(e){return l(this.subscriptions,e),()=>u(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},C=e=>e*1e3,w=e=>e/1e3,ee=(e,t)=>t?1e3/t*e:0,T=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,te=1e-7,ne=12;function re(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=T(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>te&&++s<ne);return o}function ie(e,t,n,r){if(e===t&&n===r)return y;let i=t=>re(t,0,1,e,n);return e=>e===0||e===1?e:T(i(e),t,r)}var ae=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,oe=e=>t=>1-e(1-t),se=ie(.33,1.53,.69,.99),ce=oe(se),le=ae(ce),ue=e=>e>=1?1:(e*=2)<1?.5*ce(e):.5*(2-2**(-10*(e-1))),de=e=>1-Math.sin(Math.acos(e)),fe=oe(de),pe=ae(de),me=ie(.42,0,1,1),he=ie(0,0,.58,1),ge=ie(.42,0,.58,1),_e=e=>Array.isArray(e)&&typeof e[0]!=`number`,ve=e=>Array.isArray(e)&&typeof e[0]==`number`,ye={linear:y,easeIn:me,easeInOut:ge,easeOut:he,circIn:de,circInOut:pe,circOut:fe,backIn:ce,backInOut:le,backOut:se,anticipate:ue},be=e=>typeof e==`string`,xe=e=>{if(ve(e)){e.length;let[t,n,r,i]=e;return ie(t,n,r,i)}return be(e)?(ye[e],`${e}`,ye[e]):e},Se=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Ce(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var we=40;function Te(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=Se.reduce((e,t)=>(e[t]=Ce(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:h}=o,g=()=>{let a=m.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,we),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),h.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(g))},_=()=>{n=!0,r=!0,i.isProcessing||e(g)};return{schedule:Se.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||_(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<Se.length;t++)o[Se[t]].cancel(e)},state:i,steps:o}}var{schedule:E,cancel:D,state:O,steps:Ee}=Te(typeof requestAnimationFrame<`u`?requestAnimationFrame:y,!0),De;function Oe(){De=void 0}var k={now:()=>(De===void 0&&k.set(O.isProcessing||m.useManualTiming?O.timestamp:performance.now()),De),set:e=>{De=e,queueMicrotask(Oe)}},ke=e=>t=>typeof t==`string`&&t.startsWith(e),Ae=ke(`--`),je=ke(`var(--`),Me=e=>je(e)?Ne.test(e.split(`/*`)[0].trim()):!1,Ne=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Pe(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var Fe={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Ie={...Fe,transform:e=>d(0,1,e)},Le={...Fe,default:1},Re=e=>Math.round(e*1e5)/1e5,ze=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Be(e){return e==null}var Ve=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,He=(e,t)=>n=>!!(typeof n==`string`&&Ve.test(n)&&n.startsWith(e)||t&&!Be(n)&&Object.prototype.hasOwnProperty.call(n,t)),Ue=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(ze);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},We=e=>d(0,255,e),Ge={...Fe,transform:e=>Math.round(We(e))},A={test:He(`rgb`,`red`),parse:Ue(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+Ge.transform(e)+`, `+Ge.transform(t)+`, `+Ge.transform(n)+`, `+Re(Ie.transform(r))+`)`};function Ke(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var qe={test:He(`#`),parse:Ke,transform:A.transform},Je=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),j=Je(`deg`),M=Je(`%`),N=Je(`px`),Ye=Je(`vh`),Xe=Je(`vw`),Ze={...M,parse:e=>M.parse(e)/100,transform:e=>M.transform(e*100)},Qe={test:He(`hsl`,`hue`),parse:Ue(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+M.transform(Re(t))+`, `+M.transform(Re(n))+`, `+Re(Ie.transform(r))+`)`},P={test:e=>A.test(e)||qe.test(e)||Qe.test(e),parse:e=>A.test(e)?A.parse(e):Qe.test(e)?Qe.parse(e):qe.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?A.transform(e):Qe.transform(e),getAnimatableNone:e=>{let t=P.parse(e);return t.alpha=0,P.transform(t)}},$e=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function et(e){return isNaN(e)&&typeof e==`string`&&(e.match(ze)?.length||0)+(e.match($e)?.length||0)>0}var tt=`number`,nt=`color`,rt=`var`,it=`var(`,at="${}",ot=/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 st(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(ot,e=>(P.test(e)?(r.color.push(a),i.push(nt),n.push(P.parse(e))):e.startsWith(it)?(r.var.push(a),i.push(rt),n.push(e)):(r.number.push(a),i.push(tt),n.push(parseFloat(e))),++a,at)).split(at),indexes:r,types:i}}function ct(e){return st(e).values}function lt({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===tt?Re(r[a]):e===nt?P.transform(r[a]):r[a]}return i}}function ut(e){return lt(st(e))}var dt=e=>typeof e==`number`?0:P.test(e)?P.getAnimatableNone(e):e,ft=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:dt(e);function pt(e){let t=st(e);return lt(t)(t.values.map((e,n)=>ft(e,t.split[n])))}var F={test:et,parse:ct,createTransformer:ut,getAnimatableNone:pt};function mt(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function ht({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=mt(s,r,e+1/3),a=mt(s,r,e),o=mt(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function gt(e,t){return n=>n>0?t:e}var I=(e,t,n)=>e+(t-e)*n,_t=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},vt=[qe,A,Qe],yt=e=>vt.find(t=>t.test(e));function bt(e){let t=yt(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===Qe&&(n=ht(n)),n}var xt=(e,t)=>{let n=bt(e),r=bt(t);if(!n||!r)return gt(e,t);let i={...n};return e=>(i.red=_t(n.red,r.red,e),i.green=_t(n.green,r.green,e),i.blue=_t(n.blue,r.blue,e),i.alpha=I(n.alpha,r.alpha,e),A.transform(i))},St=new Set([`none`,`hidden`]);function Ct(e,t){return St.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function wt(e,t){return n=>I(e,t,n)}function Tt(e){return typeof e==`number`?wt:typeof e==`string`?Me(e)?gt:P.test(e)?xt:kt:Array.isArray(e)?Et:typeof e==`object`?P.test(e)?xt:Dt:gt}function Et(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Tt(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Dt(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Tt(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function Ot(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var kt=(e,t)=>{let n=F.createTransformer(t),r=st(e),i=st(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?St.has(e)&&!i.values.length||St.has(t)&&!r.values.length?Ct(e,t):b(Et(Ot(r,i),i.values),n):(`${e}${t}`,gt(e,t))};function At(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?I(e,t,n):Tt(e)(e,t)}var jt=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>E.update(t,e),stop:()=>D(t),now:()=>O.isProcessing?O.timestamp:k.now()}},Mt=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Nt=2e4;function Pt(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function Ft(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min(Pt(r),Nt);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:w(i)}}var L={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 It(e,t){return e*Math.sqrt(1-t*t)}var Lt=12;function Rt(e,t,n){let r=n;for(let n=1;n<Lt;n++)r-=e(r)/t(r);return r}var zt=.001;function Bt({duration:e=L.duration,bounce:t=L.bounce,velocity:n=L.velocity,mass:r=L.mass}){let i,a;L.maxDuration;let o=1-t;o=d(L.minDamping,L.maxDamping,o),e=d(L.minDuration,L.maxDuration,w(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=It(t,o),c=Math.exp(-i);return zt-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=It(t**2,o);return(-i(t)+zt>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=Rt(i,a,s);if(e=C(e),isNaN(c))return{stiffness:L.stiffness,damping:L.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var Vt=[`duration`,`bounce`],Ht=[`stiffness`,`damping`,`mass`];function Ut(e,t){return t.some(t=>e[t]!==void 0)}function Wt(e){let t={velocity:L.velocity,stiffness:L.stiffness,damping:L.damping,mass:L.mass,isResolvedFromDuration:!1,...e};if(!Ut(e,Ht)&&Ut(e,Vt))if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*d(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:L.mass,stiffness:i,damping:a}}else{let n=Bt({...e,velocity:0});t={...t,...n,mass:L.mass},t.isResolvedFromDuration=!0}return t}function Gt(e=L.visualDuration,t=L.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=Wt({...n,velocity:-w(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=w(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?L.restSpeed.granular:L.restSpeed.default,i||=v?L.restDelta.granular:L.restDelta.default;let y,b,x,S,ee,T;if(h<1)x=It(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},ee=h*_*S+g*x,T=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(ee*Math.sin(x*e)+T*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let te={calculatedDuration:p&&d||null,velocity:e=>C(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=C(t*(ee*n+T*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=C(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min(Pt(te),Nt),t=Mt(t=>te.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return te}Gt.applyToOptions=e=>{let t=Ft(e,100,Gt);return e.ease=t.ease,e.duration=C(t.duration),e.type=`keyframes`,e};var Kt=5;function qt(e,t,n){let r=Math.max(t-Kt,0);return ee(n-e(r),t-r)}function Jt({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=Gt({keyframes:[f.value,m(f.value)],velocity:qt(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function Yt(e,t,n){let r=[],i=n||m.mix||At,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=b(Array.isArray(t)?t[n]||y:t,a)),r.push(a)}return r}function Xt(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=Yt(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=x(e[r],e[r+1],n);return s[r](i)};return n?t=>l(d(e[0],e[a-1],t)):l}function Zt(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=x(0,t,r);e.push(I(n,1,i))}}function Qt(e){let t=[0];return Zt(t,e.length-1),t}function $t(e,t){return e.map(e=>e*t)}function en(e,t){return e.map(()=>t||ge).splice(0,e.length-1)}function tn({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=_e(r)?r.map(xe):xe(r),a={done:!1,value:t[0]},o=Xt($t(n&&n.length===t.length?n:Qt(t),e),t,{ease:Array.isArray(i)?i:en(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var nn=e=>e!==null;function rn(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(nn),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var an={decay:Jt,inertia:Jt,tween:tn,keyframes:tn,spring:Gt};function on(e){typeof e.type==`string`&&(e.type=an[e.type])}var sn=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},cn=e=>e/100,ln=class extends sn{constructor(e){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=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==k.now()&&this.tick(k.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;on(e);let{type:t=tn,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||tn;s!==tn&&typeof o[0]!=`number`&&(this.mixKeyframes=b(cn,At(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=Pt(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:f,repeatDelay:p,type:m,onUpdate:h,finalKeyframe:g}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let _=this.currentTime-c*(this.playbackSpeed>=0?1:-1),v=this.playbackSpeed>=0?_<0:_>r;this.currentTime=Math.max(_,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let y=this.currentTime,b=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(f===`reverse`?(n=1-n,p&&(n-=p/o)):f===`mirror`&&(b=a)),y=d(0,1,n)*o}let x;v?(this.delayState.value=l[0],x=this.delayState):x=b.next(y),i&&!v&&(x.value=i(x.value));let{done:S}=x;!v&&s!==null&&(S=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let C=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&S);return C&&m!==Jt&&(x.value=rn(l,this.options,g,this.speed)),h&&h(x.value),C&&this.finish(),x}then(e,t){return this.finished.then(e,t)}get duration(){return w(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+w(e)}get time(){return w(this.currentTime)}set time(e){e=C(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return qt(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(k.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=w(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=jt,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,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(k.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function un(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var R=e=>e*180/Math.PI,dn=e=>pn(R(Math.atan2(e[1],e[0]))),fn={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:dn,rotateZ:dn,skewX:e=>R(Math.atan(e[1])),skewY:e=>R(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},pn=e=>(e%=360,e<0&&(e+=360),e),mn=dn,hn=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),gn=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),_n={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:hn,scaleY:gn,scale:e=>(hn(e)+gn(e))/2,rotateX:e=>pn(R(Math.atan2(e[6],e[5]))),rotateY:e=>pn(R(Math.atan2(-e[2],e[0]))),rotateZ:mn,rotate:mn,skewX:e=>R(Math.atan(e[4])),skewY:e=>R(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function vn(e){return+!!e.includes(`scale`)}function yn(e,t){if(!e||e===`none`)return vn(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=_n,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=fn,i=t}if(!i)return vn(t);let a=r[t],o=i[1].split(`,`).map(xn);return typeof a==`function`?a(o):o[a]}var bn=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return yn(n,t)};function xn(e){return parseFloat(e.trim())}var Sn=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Cn=new Set([...Sn,`pathRotation`]),wn=e=>e===Fe||e===N,Tn=new Set([`x`,`y`,`z`]),En=Sn.filter(e=>!Tn.has(e));function Dn(e){let t=[];return En.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var z={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>yn(t,`x`),y:(e,{transform:t})=>yn(t,`y`)};z.translateX=z.x,z.translateY=z.y;var B=new Set,On=!1,kn=!1,An=!1;function jn(){if(kn){let e=Array.from(B).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=Dn(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}kn=!1,On=!1,B.forEach(e=>e.complete(An)),B.clear()}function Mn(){B.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(kn=!0)})}function Nn(){An=!0,Mn(),jn(),An=!1}var Pn=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(B.add(this),On||(On=!0,E.read(Mn),E.resolveKeyframes(jn))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}un(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),B.delete(this)}cancel(){this.state===`scheduled`&&(B.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},Fn=e=>e.startsWith(`--`);function In(e,t,n){Fn(t)?e.style.setProperty(t,n):e.style[t]=n}var Ln={};function Rn(e,t){let n=v(e);return()=>Ln[t]??n()}var zn=Rn(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),Bn=Rn(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),Vn=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Hn={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:Vn([0,.65,.55,1]),circOut:Vn([.55,0,1,.45]),backIn:Vn([.31,.01,.66,-.59]),backOut:Vn([.33,1.53,.69,.99])};function Un(e,t){if(e)return typeof e==`function`?Bn()?Mt(e,t):`ease-out`:ve(e)?Vn(e):Array.isArray(e)?e.map(e=>Un(e,t)||Hn.easeOut):Hn[e]}function Wn(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=Un(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function Gn(e){return typeof e==`function`&&`applyToOptions`in e}function Kn({type:e,...t}){return Gn(e)&&Bn()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var qn=class extends sn{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=Kn(e);this.animation=Wn(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=rn(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),In(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return w(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+w(e)}get time(){return w(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=C(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&zn()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),y):r(this)}},Jn={anticipate:ue,backInOut:le,circInOut:pe};function Yn(e){return e in Jn}function Xn(e){typeof e.ease==`string`&&Yn(e.ease)&&(e.ease=Jn[e.ease])}var Zn=10,Qn=class extends qn{constructor(e){Xn(e),on(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new ln({...a,autoplay:!1}),s=Math.max(Zn,k.now()-this.startTime),c=d(0,Zn,s-Zn),l=o.sample(s).value,{name:u}=this.options;i&&u&&In(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},$n=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(F.test(e)||e===`0`)&&!e.startsWith(`url(`));function er(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function tr(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=$n(i,t),s=$n(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:er(e)||(n===`spring`||Gn(n))&&r}function nr(e){e.duration=0,e.type=`keyframes`}var rr=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),ir=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function ar(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&ir.test(e[t]))return!0;return!1}var or=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),sr=v(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function cr(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return sr()&&n&&(rr.has(n)||or.has(n)&&ar(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var lr=40,ur=class extends sn{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=k.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||Pn;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=k.now();let u=!0;tr(e,i,a,o)||(u=!1,(m.instantAnimations||!s)&&l?.(rn(e,n,t)),e[0]=e[e.length-1],nr(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>lr?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&cr(d),p=d.motionValue?.owner?.current,h;if(f)try{h=new Qn({...d,element:p})}catch{h=new ln(d)}else h=new ln(d);h.finished.then(()=>{this.notifyFinished()}).catch(y),this.pendingTimeline&&=(this.stopTimeline=h.attachTimeline(this.pendingTimeline),void 0),this._animation=h}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),Nn()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function dr(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var fr=30,pr=e=>!isNaN(parseFloat(e)),mr={current:void 0},hr=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=k.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=k.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=pr(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new S);let n=this.events[e].add(t);return e===`change`?()=>{n(),E.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return mr.current&&mr.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=k.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>fr)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,fr);return ee(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function V(e,t){return new hr(e,t)}function gr(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function _r(e,t){let n=e?.[t]??e?.default??e;return n===e?n:gr(n,e)}var vr={type:`spring`,stiffness:500,damping:25,restSpeed:10},yr=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),br={type:`keyframes`,duration:.8},xr={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Sr=(e,{keyframes:t})=>t.length>2?br:Cn.has(e)?e.startsWith(`scale`)?yr(t[1]):vr:xr,Cr=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function wr(e){for(let t in e)if(!Cr.has(t))return!0;return!1}var Tr=(e,t,n,r={},i,a)=>o=>{let s=_r(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=C(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};wr(s)||Object.assign(u,Sr(e,u)),u.duration&&=C(u.duration),u.repeatDelay&&=C(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(nr(u),u.delay===0&&(d=!0)),(m.instantAnimations||m.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,nr(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=rn(u.keyframes,s);if(e!==void 0){E.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new ln(u):new ur(u)},Er=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Dr(e){let t=Er.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Or(e,t,n=1){`${e}`;let[r,i]=Dr(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return h(e)?parseFloat(e):e}return Me(i)?Or(i,t,n+1):i}function kr(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function Ar(e,t,n,r){if(typeof t==`function`){let[i,a]=kr(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=kr(r);t=t(n===void 0?e.custom:n,i,a)}return t}function H(e,t,n){let r=e.getProps();return Ar(r,t,n===void 0?r.custom:n,e)}var jr=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Sn]),Mr=e=>Array.isArray(e);function Nr(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,V(n))}function Pr(e){return Mr(e)?e[e.length-1]||0:e}function Fr(e,t){let{transitionEnd:n={},transition:r={},...i}=H(e,t)||{};i={...i,...n};for(let t in i)Nr(e,t,Pr(i[t]))}var U=e=>!!(e&&e.getVelocity);function Ir(e){return!!(U(e)&&e.add)}function Lr(e,t){let n=e.getValue(`willChange`);if(Ir(n))return n.add(t);if(!n&&m.WillChange){let n=new m.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function Rr(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var zr=`data-`+Rr(`framerAppearId`);function Br(e){return e.props[zr]}function Vr({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Hr(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?gr(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&Vr(f,t))continue;let o={delay:n,..._r(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){E.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=Br(e);if(n){let e=window.MotionHandoffAnimation(n,t,E);e!==null&&(o.startTime=e,p=!0)}}Lr(e,t);let m=l??e.shouldReduceMotion;r.start(Tr(t,r,i,m&&jr.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>E.update(()=>{o&&Fr(e,o)});d.length?Promise.all(d).then(t):t()}return d}function Ur(e,t,n={}){let r=H(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(Hr(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return Wr(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function Wr(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(Ur(c,t,{...o,delay:n+(typeof r==`function`?0:r)+dr(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function Gr(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>Ur(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=Ur(e,t,n);else{let i=typeof t==`function`?H(e,t,n.custom):t;r=Promise.all(Hr(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var Kr={test:e=>e===`auto`,parse:e=>e},qr=e=>t=>t.test(e),Jr=[Fe,N,M,j,Xe,Ye,Kr],Yr=e=>Jr.find(qr(e));function Xr(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||_(e)}var Zr=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function Qr(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(ze)||[];if(!r)return e;let i=n.replace(r,``),a=+!!Zr.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var $r=/\b([a-z-]*)\(.*?\)/gu,ei={...F,getAnimatableNone:e=>{let t=e.match($r);return t?t.map(Qr).join(` `):e}},ti={...F,getAnimatableNone:e=>{let t=F.parse(e);return F.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},ni={...Fe,transform:Math.round},ri={borderWidth:N,borderTopWidth:N,borderRightWidth:N,borderBottomWidth:N,borderLeftWidth:N,borderRadius:N,borderTopLeftRadius:N,borderTopRightRadius:N,borderBottomRightRadius:N,borderBottomLeftRadius:N,width:N,maxWidth:N,height:N,maxHeight:N,top:N,right:N,bottom:N,left:N,inset:N,insetBlock:N,insetBlockStart:N,insetBlockEnd:N,insetInline:N,insetInlineStart:N,insetInlineEnd:N,padding:N,paddingTop:N,paddingRight:N,paddingBottom:N,paddingLeft:N,paddingBlock:N,paddingBlockStart:N,paddingBlockEnd:N,paddingInline:N,paddingInlineStart:N,paddingInlineEnd:N,margin:N,marginTop:N,marginRight:N,marginBottom:N,marginLeft:N,marginBlock:N,marginBlockStart:N,marginBlockEnd:N,marginInline:N,marginInlineStart:N,marginInlineEnd:N,fontSize:N,backgroundPositionX:N,backgroundPositionY:N,rotate:j,pathRotation:j,rotateX:j,rotateY:j,rotateZ:j,scale:Le,scaleX:Le,scaleY:Le,scaleZ:Le,skew:j,skewX:j,skewY:j,distance:N,translateX:N,translateY:N,translateZ:N,x:N,y:N,z:N,perspective:N,transformPerspective:N,opacity:Ie,originX:Ze,originY:Ze,originZ:N,zIndex:ni,fillOpacity:Ie,strokeOpacity:Ie,numOctaves:ni},ii={...ri,color:P,backgroundColor:P,outlineColor:P,fill:P,stroke:P,borderColor:P,borderTopColor:P,borderRightColor:P,borderBottomColor:P,borderLeftColor:P,filter:ei,WebkitFilter:ei,mask:ti,WebkitMask:ti},ai=e=>ii[e],oi=new Set([ei,ti]);function si(e,t){let n=ai(e);return oi.has(n)||(n=F),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var ci=new Set([`auto`,`none`,`0`]);function li(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!ci.has(t)&&st(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=si(n,i)}var ui=class extends Pn{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Me(r))){let i=Or(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!jr.has(n)||e.length!==2)return;let[r,i]=e,a=Yr(r),o=Yr(i);if(Pe(r)!==Pe(i)&&z[n]){this.needsMeasurement=!0;return}if(a!==o)if(wn(a)&&wn(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else z[n]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||Xr(e[t]))&&n.push(t);n.length&&li(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=z[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=z[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},di=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function fi(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var pi=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function mi(e){return g(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:hi,cancel:gi}=Te(queueMicrotask,!1),W={x:!1,y:!1};function _i(){return W.x||W.y}function vi(e){return e===`x`||e===`y`?W[e]?null:(W[e]=!0,()=>{W[e]=!1}):W.x||W.y?null:(W.x=W.y=!0,()=>{W.x=W.y=!1})}function yi(e,t){let n=fi(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function bi(e){return!(e.pointerType===`touch`||_i())}function xi(e,t,n={}){let[r,i,a]=yi(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!bi(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var Si=(e,t)=>t?e===t||Si(e,t.parentElement):!1,Ci=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,wi=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Ti(e){return wi.has(e.tagName)||e.isContentEditable===!0}var Ei=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function Di(e){return Ei.has(e.tagName)||e.isContentEditable===!0}var Oi=new WeakSet;function ki(e){return t=>{t.key===`Enter`&&e(t)}}function Ai(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var ji=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=ki(()=>{if(Oi.has(n))return;Ai(n,`down`);let e=ki(()=>{Ai(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>Ai(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function Mi(e){return Ci(e)&&!_i()}var Ni=new WeakSet;function Pi(e,t,n={}){let[r,i,a]=yi(e,n),o=e=>{let r=e.currentTarget;if(!Mi(e)||Ni.has(e))return;Oi.add(r),n.stopPropagation&&Ni.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),Oi.has(r)&&Oi.delete(r),Mi(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||Si(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),mi(e)&&(e.addEventListener(`focus`,e=>ji(e,i)),!Ti(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function Fi(e){return g(e)&&`ownerSVGElement`in e}var Ii=new WeakMap,Li,Ri=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:Fi(r)&&`getBBox`in r?r.getBBox()[t]:r[n],zi=Ri(`inline`,`width`,`offsetWidth`),Bi=Ri(`block`,`height`,`offsetHeight`);function Vi({target:e,borderBoxSize:t}){Ii.get(e)?.forEach(n=>{n(e,{get width(){return zi(e,t)},get height(){return Bi(e,t)}})})}function Hi(e){e.forEach(Vi)}function Ui(){typeof ResizeObserver>`u`||(Li=new ResizeObserver(Hi))}function Wi(e,t){Li||Ui();let n=fi(e);return n.forEach(e=>{let n=Ii.get(e);n||(n=new Set,Ii.set(e,n)),n.add(t),Li?.observe(e)}),()=>{n.forEach(e=>{let n=Ii.get(e);n?.delete(t),n?.size||Li?.unobserve(e)})}}var Gi=new Set,Ki;function qi(){Ki=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};Gi.forEach(t=>t(e))},window.addEventListener(`resize`,Ki)}function Ji(e){return Gi.add(e),Ki||qi(),()=>{Gi.delete(e),!Gi.size&&typeof Ki==`function`&&(window.removeEventListener(`resize`,Ki),Ki=void 0)}}function Yi(e,t){return typeof e==`function`?Ji(e):Wi(e,t)}var Xi={value:null,addProjectionMetrics:null};function Zi(e){return Fi(e)&&e.tagName===`svg`}var Qi=[...Jr,P,F],$i=e=>Qi.find(qr(e)),ea=()=>({translate:0,scale:1,origin:0,originPoint:0}),ta=()=>({x:ea(),y:ea()}),na=()=>({min:0,max:0}),G=()=>({x:na(),y:na()}),ra=new WeakMap;function ia(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function aa(e){return typeof e==`string`||Array.isArray(e)}var oa=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],sa=[`initial`,...oa];function ca(e){return ia(e.animate)||sa.some(t=>aa(e[t]))}function la(e){return!!(ca(e)||e.variants)}function ua(e,t,n){for(let r in t){let i=t[r],a=n[r];if(U(i))e.addValue(r,i);else if(U(a))e.addValue(r,V(i,{owner:e}));else if(a!==i)if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,V(t===void 0?i:t,{owner:e}))}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var da={current:null},fa={current:!1},pa=typeof window<`u`;function ma(){if(fa.current=!0,pa)if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>da.current=e.matches;e.addEventListener(`change`,t),t()}else da.current=!1}var ha=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],ga={};function _a(e){ga=e}function va(){return ga}var ya=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){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=Pn,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 e=k.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,E.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=ca(t),this.isVariantNode=la(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&U(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,ra.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(fa.current||ma(),this.shouldReduceMotion=da.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),D(this.notifyUpdate),D(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&rr.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new qn({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:C(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Cn.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&E.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in ga){let t=ga[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):G()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<ha.length;t++){let n=ha[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=ua(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=V(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(h(n)||_(n))?n=parseFloat(n):!$i(n)&&F.test(t)&&(n=si(e,t)),this.setBaseTarget(e,U(n)?n.get():n)),U(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=Ar(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!U(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new S),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){hi.render(this.render)}},ba=class extends ya{constructor(){super(...arguments),this.KeyframeResolver=ui}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;U(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},K=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function xa({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Sa({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Ca(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function wa(e){return e===void 0||e===1}function Ta({scale:e,scaleX:t,scaleY:n}){return!wa(e)||!wa(t)||!wa(n)}function q(e){return Ta(e)||Ea(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Ea(e){return Da(e.x)||Da(e.y)}function Da(e){return e&&e!==`0%`}function Oa(e,t,n){return n+t*(e-n)}function ka(e,t,n,r,i){return i!==void 0&&(e=Oa(e,i,r)),Oa(e,n,r)+t}function Aa(e,t=0,n=1,r,i){e.min=ka(e.min,t,n,r,i),e.max=ka(e.max,t,n,r,i)}function ja(e,{x:t,y:n}){Aa(e.x,t.translate,t.scale,t.originPoint),Aa(e.y,n.translate,n.scale,n.originPoint)}var Ma=.999999999999,Na=1.0000000000001;function Pa(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(J(e.x,-a.scroll.offset.x),J(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,ja(e,o)),r&&q(a.latestValues)&&La(e,a.latestValues,a.layout?.layoutBox))}t.x<Na&&t.x>Ma&&(t.x=1),t.y<Na&&t.y>Ma&&(t.y=1)}function J(e,t){e.min+=t,e.max+=t}function Fa(e,t,n,r,i=.5){Aa(e,t,n,I(e.min,e.max,i),r)}function Ia(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function La(e,t,n){let r=n??e;Fa(e.x,Ia(t.x,r.x),t.scaleX,t.scale,t.originX),Fa(e.y,Ia(t.y,r.y),t.scaleY,t.scale,t.originY)}function Ra(e,t){return xa(Ca(e.getBoundingClientRect(),t))}function za(e,t,n){let r=Ra(e,n),{scroll:i}=t;return i&&(J(r.x,i.offset.x),J(r.y,i.offset.y)),r}var Ba={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},Va=Sn.length;function Ha(e,t,n){let r=``,i=!0;for(let a=0;a<Va;a++){let o=Sn[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=pi(s,ri[o]);if(!c){i=!1;let t=Ba[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${pi(a,ri.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function Ua(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Cn.has(e)){o=!0;continue}if(Ae(e)){i[e]=n;continue}{let t=pi(n,ri[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=Ha(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function Wa(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function Ga(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Ka={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`)if(N.test(e))e=parseFloat(e);else return e;return`${Ga(e,t.target.x)}% ${Ga(e,t.target.y)}%`}},qa={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=F.parse(e);if(i.length>5)return r;let a=F.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=I(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},Ja={borderRadius:{...Ka,applyTo:[...di]},borderTopLeftRadius:Ka,borderTopRightRadius:Ka,borderBottomLeftRadius:Ka,borderBottomRightRadius:Ka,boxShadow:qa};function Ya(e,{layout:t,layoutId:n}){return Cn.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!Ja[e]||e===`opacity`)}function Xa(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(U(r[t])||i&&U(i[t])||Ya(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Za(e){return window.getComputedStyle(e)}var Qa=class extends ba{constructor(){super(...arguments),this.type=`html`,this.renderInstance=Wa}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Cn.has(t))return this.projection?.isProjecting?vn(t):bn(e,t);{let n=Za(e),r=(Ae(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return Ra(e,t)}build(e,t,n){Ua(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Xa(e,t,n)}},$a={offset:`stroke-dashoffset`,array:`stroke-dasharray`},eo={offset:`strokeDashoffset`,array:`strokeDasharray`};function to(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?$a:eo;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var no=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function ro(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(Ua(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of no)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&to(d,i,a,o,!1)}var io=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`]),ao=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function oo(e,t,n,r){Wa(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(io.has(n)?n:Rr(n),t.attrs[n])}function so(e,t,n){let r=Xa(e,t,n);for(let n in e)if(U(e[n])||U(t[n])){let t=Sn.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var co=class extends ba{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=G}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Cn.has(t)){let e=ai(t);return e&&e.default||0}if(no.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=io.has(t)?t:Rr(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return so(e,t,n)}build(e,t,n){ro(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){oo(e,t,n,r)}mount(e){this.isSVGTag=ao(e.tagName),super.mount(e)}},lo=sa.length;function uo(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&uo(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<lo;n++){let r=sa[n],i=e.props[r];(aa(i)||i===!1)&&(t[r]=i)}return t}function fo(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var po=[...oa].reverse(),mo=oa.length;function ho(e){return t=>Promise.all(t.map(({animation:t,options:n})=>Gr(e,t,n)))}function go(e){let t=ho(e),n=vo(),r=!0,i=!1,a=t=>(n,r)=>{let i=H(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=uo(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<mo;t++){let p=po[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=aa(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||ia(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=_o(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,ee={...w,...C},T=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in ee){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=Mr(t)&&Mr(n)?!fo(t,n)||y:t!==n,r?t==null?u.add(e):T(e):t!==void 0&&u.has(e)?T(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let te=v&&y;b&&(!te||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!te&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=H(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=dr(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=H(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=vo(),i=!0}}}function _o(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!fo(t,e):!1}function Y(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function vo(){return{animate:Y(!0),whileInView:Y(),whileHover:Y(),whileTap:Y(),whileDrag:Y(),whileFocus:Y(),exit:Y()}}function yo(e,t){e.min=t.min,e.max=t.max}function X(e,t){yo(e.x,t.x),yo(e.y,t.y)}function bo(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var xo=.9999,So=1.0001,Co=-.01,wo=.01;function Z(e){return e.max-e.min}function To(e,t,n){return Math.abs(e-t)<=n}function Eo(e,t,n,r=.5){e.origin=r,e.originPoint=I(t.min,t.max,e.origin),e.scale=Z(n)/Z(t),e.translate=I(n.min,n.max,e.origin)-e.originPoint,(e.scale>=xo&&e.scale<=So||isNaN(e.scale))&&(e.scale=1),(e.translate>=Co&&e.translate<=wo||isNaN(e.translate))&&(e.translate=0)}function Do(e,t,n,r){Eo(e.x,t.x,n.x,r?r.originX:void 0),Eo(e.y,t.y,n.y,r?r.originY:void 0)}function Oo(e,t,n,r=0){e.min=(r?I(n.min,n.max,r):n.min)+t.min,e.max=e.min+Z(t)}function ko(e,t,n,r){Oo(e.x,t.x,n.x,r?.x),Oo(e.y,t.y,n.y,r?.y)}function Ao(e,t,n,r=0){let i=r?I(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+Z(t)}function jo(e,t,n,r){Ao(e.x,t.x,n.x,r?.x),Ao(e.y,t.y,n.y,r?.y)}function Mo(e,t,n,r,i){return e-=t,e=Oa(e,1/n,r),i!==void 0&&(e=Oa(e,1/i,r)),e}function No(e,t=0,n=1,r=.5,i,a=e,o=e){if(M.test(t)&&(t=parseFloat(t),t=I(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=I(a.min,a.max,r);e===a&&(s-=t),e.min=Mo(e.min,t,n,s,i),e.max=Mo(e.max,t,n,s,i)}function Po(e,t,[n,r,i],a,o){No(e,t[n],t[r],t[i],t.scale,a,o)}var Fo=[`x`,`scaleX`,`originX`],Io=[`y`,`scaleY`,`originY`];function Lo(e,t,n,r){Po(e.x,t,Fo,n?n.x:void 0,r?r.x:void 0),Po(e.y,t,Io,n?n.y:void 0,r?r.y:void 0)}function Ro(e){return e.translate===0&&e.scale===1}function zo(e){return Ro(e.x)&&Ro(e.y)}function Bo(e,t){return e.min===t.min&&e.max===t.max}function Vo(e,t){return Bo(e.x,t.x)&&Bo(e.y,t.y)}function Ho(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Uo(e,t){return Ho(e.x,t.x)&&Ho(e.y,t.y)}function Wo(e){return Z(e.x)/Z(e.y)}function Go(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Q(e){return[e(`x`),e(`y`)]}function Ko(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var qo=di.length,Jo=e=>typeof e==`string`?parseFloat(e):e,Yo=e=>typeof e==`number`||N.test(e);function Xo(e,t,n,r,i,a){i?(e.opacity=I(0,n.opacity??1,Qo(r)),e.opacityExit=I(t.opacity??1,0,$o(r))):a&&(e.opacity=I(t.opacity??1,n.opacity??1,r));for(let i=0;i<qo;i++){let a=di[i],o=Zo(t,a),s=Zo(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Yo(o)===Yo(s)?(e[a]=Math.max(I(Jo(o),Jo(s),r),0),(M.test(s)||M.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=I(t.rotate||0,n.rotate||0,r))}function Zo(e,t){return e[t]===void 0?e.borderRadius:e[t]}var Qo=es(0,.5,fe),$o=es(.5,.95,y);function es(e,t,n){return r=>r<e?0:r>t?1:n(x(e,t,r))}function ts(e,t,n){let r=U(e)?e:V(e);return r.start(Tr(``,r,t,n)),r.animation}function ns(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var rs=(e,t)=>e.depth-t.depth,is=class{constructor(){this.children=[],this.isDirty=!1}add(e){l(this.children,e),this.isDirty=!0}remove(e){u(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(rs),this.isDirty=!1,this.children.forEach(e)}};function as(e,t){let n=k.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(D(r),e(a-t))};return E.setup(r,!0),()=>D(r)}function os(e){return U(e)?e.get():e}var ss=class{constructor(){this.members=[]}add(e){l(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(u(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(u(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},cs={hasAnimatedSinceResize:!0,hasEverUpdated:!1},$={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},ls=[``,`X`,`Y`,`Z`],us=1e3,ds=0;function fs(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function ps(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=Br(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,E,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&ps(r)}function ms({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=ds++,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,Xi.value&&($.nodes=$.calculatedTargetDeltas=$.calculatedProjections=0),this.nodes.forEach(_s),this.nodes.forEach(Es),this.nodes.forEach(Ds),this.nodes.forEach(vs),Xi.addProjectionMetrics&&Xi.addProjectionMetrics($)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new is)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new S),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=Fi(t)&&!Zi(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;E.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=as(i,250),cs.hasAnimatedSinceResize&&(cs.hasAnimatedSinceResize=!1,this.nodes.forEach(Ts)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||Ps,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!Uo(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={..._r(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||Ts(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),D(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(Os),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&ps(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(xs),this.nodes.forEach(bs);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(Ss);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Cs),this.nodes.forEach(ws),this.nodes.forEach(hs),this.nodes.forEach(gs)):this.nodes.forEach(Ss),this.clearAllSnapshots();let e=k.now();O.delta=d(0,1e3/60,e-O.timestamp),O.timestamp=e,O.isProcessing=!0,Ee.update.process(O),Ee.preRender.process(O),Ee.render.process(O),O.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,hi.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(ys),this.sharedNodes.forEach(ks)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,E.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){E.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!Z(this.snapshot.measuredBox.x)&&!Z(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 e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=G(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!zo(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||q(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),Rs(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return G();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(Bs))){let{scroll:e}=this.root;e&&(J(t.x,e.offset.x),J(t.y,e.offset.y))}return t}removeElementScroll(e){let t=G();if(X(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&X(t,e),J(t.x,i.offset.x),J(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||G();X(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(J(r.x,-n.scroll.offset.x),J(r.y,-n.scroll.offset.y)),q(n.latestValues)&&La(r,n.latestValues,n.layout?.layoutBox)}return q(this.latestValues)&&La(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=G();X(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!q(n.latestValues))continue;let r;n.instance&&(Ta(n.latestValues)&&n.updateSnapshot(),r=G(),X(r,n.measurePageBox())),Lo(t,n.latestValues,n.snapshot?.layoutBox,r)}return q(this.latestValues)&&Lo(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.crossfade}}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!==O.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=O.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=G(),this.targetWithTransforms=G()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),ko(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):X(this.target,this.layout.layoutBox),ja(this.target,this.targetDelta)):X(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Xi.value&&$.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||Ta(this.parent.latestValues)||Ea(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=G(),this.relativeTargetOrigin=G(),jo(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),X(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===O.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;X(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;Pa(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=G());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(bo(this.prevProjectionDelta.x,this.projectionDelta.x),bo(this.prevProjectionDelta.y,this.projectionDelta.y)),Do(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Go(this.projectionDelta.x,this.prevProjectionDelta.x)||!Go(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Xi.value&&$.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=ta(),this.projectionDelta=ta(),this.projectionDeltaWithTransform=ta()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=ta();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=G(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(Ns));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=I(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=I(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(As(o.x,e.x,n),As(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(jo(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Ms(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&Vo(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=G(),X(f,this.relativeTarget)),c&&(this.animationValues=a,Xo(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(D(this.pendingAnimation),void 0),this.pendingAnimation=E.update(()=>{cs.hasAnimatedSinceResize=!0,this.motionValue||=V(0),this.motionValue.jump(0,!1),this.currentAnimation=ts(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.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 e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(us),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&zs(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||G();let t=Z(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=Z(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}X(t,n),La(t,i),Do(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new ss),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&fs(`z`,e,r,this.animationValues);for(let t=0;t<ls.length;t++)fs(`rotate${ls[t]}`,e,r,this.animationValues),fs(`skew${ls[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=os(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=os(t?.pointerEvents)||``),this.hasProjected&&!q(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Ko(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in Ja){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=Ja[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?os(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(bs),this.root.sharedNodes.clear()}}}function hs(e){e.updateLayout()}function gs(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)Q(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=Z(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;yo(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else zs(i,t.layoutBox,n)&&Q(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=Z(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=ta();Do(o,n,t.layoutBox);let s=ta();a?Do(s,e.applyTransform(r,!0),t.measuredBox):Do(s,n,t.layoutBox);let c=!zo(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=G();jo(s,t.layoutBox,i.layoutBox,o);let c=G();jo(c,n,a.layoutBox,o),Uo(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function _s(e){Xi.value&&$.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function vs(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function ys(e){e.clearSnapshot()}function bs(e){e.clearMeasurements()}function xs(e){e.isLayoutDirty=!0,e.updateLayout()}function Ss(e){e.isLayoutDirty=!1}function Cs(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function ws(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function Ts(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function Es(e){e.resolveTargetDelta()}function Ds(e){e.calcProjection()}function Os(e){e.resetSkewAndRotation()}function ks(e){e.removeLeadSnapshot()}function As(e,t,n){e.translate=I(t.translate,0,n),e.scale=I(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function js(e,t,n,r){e.min=I(t.min,n.min,r),e.max=I(t.max,n.max,r)}function Ms(e,t,n,r){js(e.x,t.x,n.x,r),js(e.y,t.y,n.y,r)}function Ns(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var Ps={duration:.45,ease:[.4,0,.1,1]},Fs=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Is=Fs(`applewebkit/`)&&!Fs(`chrome/`)?Math.round:y;function Ls(e){e.min=Is(e.min),e.max=Is(e.max)}function Rs(e){Ls(e.x),Ls(e.y)}function zs(e,t,n){return e===`position`||e===`preserve-aspect`&&!To(Wo(t),Wo(n),.2)}function Bs(e){return e!==e.root&&e.scroll?.wasRoot}var Vs=ms({attachResizeListener:(e,t)=>ns(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Hs={current:void 0},Us=ms({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Hs.current){let e=new Vs({});e.mount(window),e.setOptions({layoutScroll:!0}),Hs.current=e}return Hs.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),Ws=(0,i.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Gs(e=!0){let t=(0,i.useContext)(c);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:a}=t,o=(0,i.useId)();(0,i.useEffect)(()=>{if(e)return a(o)},[e]);let s=(0,i.useCallback)(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,s]:[!0]}var Ks=(0,i.createContext)({strict:!1}),qs={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`]},Js=!1;function Ys(){if(Js)return;let e={};for(let t in qs)e[t]={isEnabled:e=>qs[t].some(t=>!!e[t])};_a(e),Js=!0}function Xs(){return Ys(),va()}function Zs(e){let t=Xs();for(let n in e)t[n]={...t[n],...e[n]};_a(t)}var Qs=(0,i.createContext)({});function $s(e,t){if(ca(e)){let{initial:t,animate:n}=e;return{initial:t===!1||aa(t)?t:void 0,animate:aa(n)?n:void 0}}return e.inherit===!1?{}:t}function ec(e){let{initial:t,animate:n}=$s(e,(0,i.useContext)(Qs));return(0,i.useMemo)(()=>({initial:t,animate:n}),[tc(t),tc(n)])}function tc(e){return Array.isArray(e)?e.join(` `):e}var nc=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function rc(e,t,n){for(let r in t)!U(t[r])&&!Ya(r,n)&&(e[r]=t[r])}function ic({transformTemplate:e},t){return(0,i.useMemo)(()=>{let n=nc();return Ua(n,t,e),Object.assign({},n.vars,n.style)},[t])}function ac(e,t){let n=e.style||{},r={};return rc(r,n,e),Object.assign(r,ic(e,t)),r}function oc(e,t){let n={},r=ac(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var sc=()=>({...nc(),attrs:{}});function cc(e,t,n,r){let a=(0,i.useMemo)(()=>{let n=sc();return ro(n,t,ao(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};rc(t,e.style,e),a.style={...t,...a.style}}return a}var lc=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`.split(`.`));function uc(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||lc.has(e)}function dc(e,t){return e.startsWith(`on`)?!uc(e):t?.(e)??!uc(e)}function fc(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(U(e[a])||(dc(a,r)||n===!0&&uc(a)||!t&&!uc(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var pc=[`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 mc(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(pc.indexOf(e)>-1||/[A-Z]/u.test(e))}function hc(e,t,n,{latestValues:r},a,o=!1,s,c){let l=(s??mc(e)?cc:oc)(t,r,a,e),u=fc(t,typeof e==`string`,o,c),d=e===i.Fragment?{}:{...u,...l,ref:n},{children:f}=t,p=(0,i.useMemo)(()=>U(f)?f.get():f,[f]);return(0,i.createElement)(e,{...d,children:p})}function gc({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:_c(n,r,i,e),renderState:t()}}function _c(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=os(a[e]);let{initial:o,animate:s}=e,c=ca(e),l=la(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!ia(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=Ar(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var vc=e=>(t,n)=>{let r=(0,i.useContext)(Qs),a=(0,i.useContext)(c),s=()=>gc(e,t,r,a);return n?s():o(s)},yc=vc({scrapeMotionValuesFromProps:Xa,createRenderState:nc}),bc=vc({scrapeMotionValuesFromProps:so,createRenderState:sc}),xc=Symbol.for(`motionComponentSymbol`);function Sc(e,t,n){let r=(0,i.useRef)(n);(0,i.useInsertionEffect)(()=>{r.current=n});let a=(0,i.useRef)(null);return(0,i.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let i=r.current;if(typeof i==`function`)if(n){let e=i(n);typeof e==`function`&&(a.current=e)}else a.current?(a.current(),a.current=null):i(n);else i&&(i.current=n)},[t])}var Cc=(0,i.createContext)({});function wc(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function Tc(e,t,n,r,a,o){let{visualElement:l}=(0,i.useContext)(Qs),u=(0,i.useContext)(Ks),d=(0,i.useContext)(c),f=(0,i.useContext)(Ws),p=f.reducedMotion,m=f.skipAnimations,h=(0,i.useRef)(null),g=(0,i.useRef)(!1);r||=u.renderer,!h.current&&r&&(h.current=r(e,{visualState:t,parent:l,props:n,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:p,skipAnimations:m,isSVG:o}),g.current&&h.current&&(h.current.manuallyAnimateOnMount=!0));let _=h.current,v=(0,i.useContext)(Cc);_&&!_.projection&&a&&(_.type===`html`||_.type===`svg`)&&Ec(h.current,n,a,v);let y=(0,i.useRef)(!1);(0,i.useInsertionEffect)(()=>{_&&y.current&&_.update(n,d)});let b=n[zr],x=(0,i.useRef)(!!b&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(b)&&window.MotionHasOptimisedAnimation?.(b));return s(()=>{g.current=!0,_&&(y.current=!0,window.MotionIsMounted=!0,_.updateFeatures(),_.scheduleRenderMicrotask(),x.current&&_.animationState&&_.animationState.animateChanges())}),(0,i.useEffect)(()=>{_&&(!x.current&&_.animationState&&_.animationState.animateChanges(),x.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(b)}),!1),_.enteringChildren=void 0)}),_}function Ec(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:Dc(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&wc(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function Dc(e){if(e)return e.options.allowProjection===!1?Dc(e.parent):e.projection}function Oc(e,{forwardMotionProps:t=!1,type:n}={},a,o){a&&Zs(a);let s=n?n===`svg`:mc(e),c=s?bc:yc;function l(n,l){let u,d={...(0,i.useContext)(Ws),...n,layoutId:kc(n)},{isStatic:f,isValidProp:p}=d,m=ec(n),h=c(n,f);if(!f&&typeof window<`u`){Ac(d,a);let t=jc(d);u=t.MeasureLayout,m.visualElement=Tc(e,h,d,o,t.ProjectionNode,s)}return(0,r.jsxs)(Qs.Provider,{value:m,children:[u&&m.visualElement?(0,r.jsx)(u,{visualElement:m.visualElement,...d}):null,hc(e,n,Sc(h,m.visualElement,l),h,f,t,s,p)]})}l.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let u=(0,i.forwardRef)(l);return u[xc]=e,u}function kc({layoutId:e}){let t=(0,i.useContext)(a).id;return t&&e!==void 0?t+`-`+e:e}function Ac(e,t){(0,i.useContext)(Ks).strict}function jc(e){let{drag:t,layout:n}=Xs();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function Mc(e,t){if(typeof Proxy>`u`)return Oc;let n=new Map,r=(n,r)=>Oc(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,Oc(a,void 0,e,t)),n.get(a))})}var Nc=(e,t)=>t.isSVG??mc(e)?new co(t):new Qa(t,{allowProjection:e!==i.Fragment}),Pc=class extends K{constructor(e){super(e),e.animationState||=go(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();ia(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},Fc=0,Ic={animation:{Feature:Pc},exit:{Feature:class extends K{constructor(){super(...arguments),this.id=Fc++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=H(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function Lc(e){return{point:{x:e.pageX,y:e.pageY}}}var Rc=e=>t=>Ci(t)&&e(t,Lc(t));function zc(e,t,n,r){return ns(e,t,Rc(n),r)}var Bc=({current:e})=>e?e.ownerDocument.defaultView:null,Vc=(e,t)=>Math.abs(e-t);function Hc(e,t){let n=Vc(e.x,t.x),r=Vc(e.y,t.y);return Math.sqrt(n**2+r**2)}var Uc=new Set([`auto`,`scroll`]),Wc=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){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=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Gc(this.lastRawMoveEventInfo,this.transformPagePoint));let e=qc(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=Hc(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=O;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=Gc(t,this.transformPagePoint),E.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=qc(e.type===`pointercancel`?this.lastMoveEventInfo:Gc(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Ci(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=Gc(Lc(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=O;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,qc(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=b(zc(this.contextWindow,`pointermove`,this.handlePointerMove,d),zc(this.contextWindow,`pointerup`,this.handlePointerUp,d),zc(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(Uc.has(e.overflowX)||Uc.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.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(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),E.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),D(this.updatePoint)}};function Gc(e,t){return t?{point:t(e.point)}:e}function Kc(e,t){return{x:e.x-t.x,y:e.y-t.y}}function qc({point:e},t){return{point:e,delta:Kc(e,Yc(t)),offset:Kc(e,Jc(t)),velocity:Xc(t,.1)}}function Jc(e){return e[0]}function Yc(e){return e[e.length-1]}function Xc(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=Yc(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>C(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>C(t)*2&&(r=e[1]);let a=w(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Zc(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?I(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?I(n,e,r.max):Math.min(e,n)),e}function Qc(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function $c(e,{top:t,left:n,bottom:r,right:i}){return{x:Qc(e.x,n,i),y:Qc(e.y,t,r)}}function el(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function tl(e,t){return{x:el(e.x,t.x),y:el(e.y,t.y)}}function nl(e,t){let n=.5,r=Z(e),i=Z(t);return i>r?n=x(t.min,t.max-r,e.min):r>i&&(n=x(e.min,e.max-i,t.min)),d(0,1,n)}function rl(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var il=.35;function al(e=il){return e===!1?e=0:e===!0&&(e=il),{x:ol(e,`left`,`right`),y:ol(e,`top`,`bottom`)}}function ol(e,t,n){return{min:sl(e,t),max:sl(e,n)}}function sl(e,t){return typeof e==`number`?e:e[t]||0}var cl=new WeakMap,ll=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=G(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(Lc(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=vi(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Q(e=>{let t=this.getAxisMotionValue(e).get()||0;if(M.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=Z(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&E.update(()=>i(e,t),!1,!0),Lr(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=pl(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&E.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new Wc(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:Bc(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&E.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!fl(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=Zc(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&wc(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?$c(n.layoutBox,e):!1,this.elastic=al(t),r!==this.constraints&&!wc(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&Q(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=rl(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!wc(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=za(n,r.root,this.visualElement.getTransformPagePoint()),a=tl(r.layout.layoutBox,i);if(t){let e=t(Sa(a));this.hasMutatedConstraints=!!e,e&&(a=xa(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=Q(o=>{if(!fl(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return Lr(this.visualElement,e),n.start(Tr(e,n,0,t,this.visualElement,!1))}stopAnimation(){Q(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){Q(t=>{let{drag:n}=this.getProps();if(!fl(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-I(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!wc(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};Q(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=nl({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),Q(t=>{if(!fl(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(I(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;cl.set(this.visualElement,this);let e=this.visualElement.current,t=zc(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&Di(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();wc(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=dl(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),E.read(r);let o=ns(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Q(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=il,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function ul(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function dl(e,t,n){let r=Yi(e,ul(n)),i=Yi(t,ul(n));return()=>{r(),i()}}function fl(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function pl(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var ml=class extends K{constructor(e){super(e),this.removeGroupControls=y,this.removeListeners=y,this.controls=new ll(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||y}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},hl=e=>(t,n)=>{e&&E.update(()=>e(t,n),!1,!0)},gl=class extends K{constructor(){super(...arguments),this.removePointerDownListener=y}onPointerDown(e){this.session=new Wc(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Bc(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:hl(e),onStart:hl(t),onMove:hl(n),onEnd:(e,t)=>{delete this.session,r&&E.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=zc(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},_l=!1,vl=class extends i.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),_l&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),cs.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),_l=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||E.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),hi.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;_l=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function yl(e){let[t,n]=Gs(),o=(0,i.useContext)(a);return(0,r.jsx)(vl,{...e,layoutGroup:o,switchLayoutGroup:(0,i.useContext)(Cc),isPresent:t,safeToRemove:n})}var bl={pan:{Feature:gl},drag:{Feature:ml,ProjectionNode:Us,MeasureLayout:yl}};function xl(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&E.postRender(()=>i(t,Lc(t)))}var Sl=class extends K{mount(){let{current:e}=this.node;e&&(this.unmount=xi(e,(e,t)=>(xl(this.node,t,`Start`),e=>xl(this.node,e,`End`))))}unmount(){}},Cl=class extends K{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!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=b(ns(this.node.current,`focus`,()=>this.onFocus()),ns(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function wl(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&E.postRender(()=>i(t,Lc(t)))}var Tl=class extends K{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=Pi(e,(e,t)=>(wl(this.node,t,`Start`),(e,{success:t})=>wl(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},El=new WeakMap,Dl=new WeakMap,Ol=e=>{let t=El.get(e.target);t&&t(e)},kl=e=>{e.forEach(Ol)};function Al({root:e,...t}){let n=e||document;Dl.has(n)||Dl.set(n,{});let r=Dl.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(kl,{root:e,...t})),r[i]}function jl(e,t,n){let r=Al(t);return El.set(e,n),r.observe(e),()=>{El.delete(e),r.unobserve(e)}}var Ml={some:0,all:1},Nl=class extends K{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:Ml[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=jl(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(Pl(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function Pl({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var Fl={inView:{Feature:Nl},tap:{Feature:Tl},focus:{Feature:Cl},hover:{Feature:Sl}},Il={layout:{ProjectionNode:Us,MeasureLayout:yl}},Ll=Mc({...Ic,...Fl,...bl,...Il},Nc);function Rl(){!fa.current&&ma();let[e]=(0,i.useState)(da.current);return e}var zl=Ll;export{_e as A,a as B,Zt as C,I as D,Ft as E,f as F,u as I,c as L,C as M,x as N,D as O,p as P,s as R,Qt as S,Gt as T,gr as _,ts as a,Gn as b,ya as c,Zi as d,Fi as f,U as g,Hr as h,Ws as i,oe as j,E as k,ra as l,fi as m,Rl as n,co as o,mi as p,Gs as r,Qa as s,zl as t,G as u,mr as v,Xt as w,ln as x,V as y,o as z};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{Cr as t,Ha as n,Jr as r,Li as i,Lr as a,Mr as o,S as s,Si as c,To as l,Xi as u,_r as d,ea as f,gr as p,hr as m,i as h,ii as g,l as _,o as v,qr as y,ri as b,s as x,t as S,u as C,vr as w,wr as T}from"./shortcut-keys-DO4IsVqv.js";import{r as E}from"./react-dom-Bph1y7z7.js";import{A as D}from"./xyflow-D7n4g6go.js";import{i as O}from"./shortcut-Cgzuv4k1.js";import{_ as k,a as A,c as ee,l as te,o as j,s as M}from"./collapsible-DYb0xU8C.js";import{t as N}from"./highlighted-json-CvDPvveV.js";import{i as P,o as F}from"./call-pii-button-bqkxMrJH.js";var I=[`console.store.list`];function ne(){return l({queryKey:I,queryFn:async()=>{let e=await n();if(e.error)throw Error(e.error.code);if(!e.data)throw Error(`Empty store list`);return e.data}})}var L=e(E(),1),R=/\b(?:SELECT|FROM|WHERE|LEFT\s+JOIN|RIGHT\s+JOIN|INNER\s+JOIN|FULL\s+JOIN|CROSS\s+JOIN|JOIN|GROUP\s+BY|ORDER\s+BY|HAVING|LIMIT|OFFSET|UNION(?:\s+ALL)?|EXCEPT|INTERSECT|RETURNING)\b/gi,z=/\b(?:AND|OR|ON)\b/gi;function re(e){let t=e.trim();if(t.length===0)return``;let n=B(t),r=[];for(let e of n){if(e.quoted){r.push(e.text);continue}let t=e.text.replace(/\s+/g,` `);t.length!==0&&r.push(t.replace(R,(e,t,n)=>t===0||n[t-1]===`
|
|
2
|
-
`?e.toUpperCase():`\n${e.toUpperCase()}`).replace(z,(e,t,n)=>t===0||n[t-1]===`
|
|
3
|
-
`?e.toUpperCase():`\n ${e.toUpperCase()}`))}return r.join(``).replace(/\n{3,}/g,`
|
|
4
|
-
|
|
5
|
-
`).replace(/[ \t]+\n/g,`
|
|
6
|
-
`).trim()}function B(e){let t=[],n=0,r=null;for(let i=0;i<e.length;i+=1){let a=e[i];if(r){if(a===r){if(e[i+1]===r){i+=1;continue}t.push({quoted:!0,text:e.slice(n,i+1)}),n=i+1,r=null}continue}(a===`'`||a===`"`||a==="`")&&(i>n&&t.push({quoted:!1,text:e.slice(n,i)}),r=a,n=i)}return n<e.length&&t.push({quoted:r!==null,text:e.slice(n)}),t}function V(e){let t=B(e),n=[],r=0,i=0;for(let a of t){if(!a.quoted)for(let t=0;t<a.text.length;t+=1){if(a.text[t]!==`;`)continue;let o=i+t+1;ue(n,e,r,o),r=o}i+=a.text.length}return ue(n,e,r,e.length),n}function H(e,t){let n=V(e);if(n.length===0)return null;let r=Math.max(0,Math.min(t,e.length));for(let e of n)if(r>=e.start&&r<=e.end)return e;return n[n.length-1]??null}function ie(e,t,n,r){if(r===`all`)return V(e).map(e=>e.text);let i=Math.min(t,n),a=Math.max(t,n);if(a>i){let t=V(e.slice(i,a)).map(e=>e.text);if(t.length>0)return t}let o=H(e,i)?.text??e.trim();return o.length>0?[o]:[]}function ae(e,t){let n=e.trim().replace(/;+\s*$/,``);return n.length===0||/^EXPLAIN\b/i.test(n)?n:t?`EXPLAIN ANALYZE ${n}`:`EXPLAIN ${n}`}var oe=new Set([`INSERT`,`UPDATE`,`DELETE`,`DROP`,`ALTER`,`CREATE`,`TRUNCATE`,`REPLACE`,`GRANT`,`REVOKE`,`VACUUM`,`COMMENT`,`COPY`,`CALL`,`REFRESH`,`MERGE`]);function se(e){let t=e.trim().replace(/;+\s*$/,``),n=fe(t);return n===`EXPLAIN`?/\bANALYZE\b/i.test(t):n===`ANALYZE`||oe.has(n)}function ce(e){let t=e.trim().replace(/;+\s*$/,``);if(t.length===0)return!1;let n=fe(t);if(n!==`SELECT`&&n!==`WITH`)return!1;for(let e of B(t))if(!e.quoted&&/\bLIMIT\b/i.test(e.text))return!1;return!0}function le(e,t){let n=Math.max(0,Math.min(t,e.length)),r=1;for(let t=0;t<n;t+=1)e[t]===`
|
|
7
|
-
`&&(r+=1);return r}function ue(e,t,n,r){let i=t.slice(n,r);if(i.replace(/[;\s]/g,``).length===0)return;let a=n+(i.match(/^\s*/)?.[0]?.length??0);e.push({text:i.trim(),start:n,end:r,startLine:le(t,a)})}function de(e){let t=fe(e.trim().replace(/;+\s*$/,``));return t.length>0?t:`SQL`}function fe(e){return/^([A-Za-z]+)/.exec(e)?.[1]?.toUpperCase()??``}var pe=`SELECT.FROM.WHERE.JOIN.LEFT JOIN.INNER JOIN.RIGHT JOIN.FULL JOIN.ON.AND.OR.ORDER BY.GROUP BY.HAVING.LIMIT.OFFSET.UNION.INSERT INTO.VALUES.UPDATE.SET.DELETE FROM.CREATE TABLE.CREATE INDEX.ALTER TABLE.DROP TABLE.TRUNCATE.EXPLAIN.EXPLAIN ANALYZE.BEGIN.COMMIT.ROLLBACK.GRANT.AS.DISTINCT.COUNT.LIKE.ILIKE.IN.IS NULL.IS NOT NULL.NOT.ASC.DESC.WITH.RETURNING.CASE.WHEN.THEN.ELSE.END`.split(`.`),me=new Set([`FROM`,`JOIN`,`INTO`,`UPDATE`,`TABLE`]),he=new Set([`SELECT`,`WHERE`,`SET`,`ON`,`BY`,`HAVING`,`AND`,`OR`,`RETURNING`]),ge=/[A-Za-z0-9_]/;function _e(e,t,n,r=`sql`){let i=Math.max(0,Math.min(t,e.length));return r===`kv`?ye(e,i,n):Oe(e,i)?null:ve(e,i,n)}function ve(e,t,n){let r=Se(e,t),i=r.prefix.toLowerCase(),a=r.qualifier,o=Ce(e,r.from),s=H(e,t),c=s?we(s.text,n):[],l=[];if(a!==null){let e=Te(n,a);if(!e)return null;for(let t of e.columns)W(t.name,i)&&l.push(xe(t,e.name));return U(r.from,t,l)}let u=o!==null&&me.has(o),d=o!==null&&he.has(o);if(u||!d&&i.length>0)for(let e of n)W(e.name,i)&&l.push({kind:`table`,label:e.name,insert:Ee(e.name),detail:`table`});if(d||!u&&i.length>0){let e=c.length>0?c:n.map(e=>e.name),t=new Set;for(let r of e){let e=Te(n,r);if(e)for(let n of e.columns){let r=`${e.name}.${n.name}`;t.has(r)||!W(n.name,i)||(t.add(r),l.push(xe(n,e.name)))}}if(c.length>0&&i.length>0){for(let r of n)if(!e.includes(r.name))for(let e of r.columns){let n=`${r.name}.${e.name}`;t.has(n)||!W(e.name,i)||(t.add(n),l.push(xe(e,r.name)))}}}if(i.length>0)for(let e of pe)W(e,i)&&l.push({kind:`keyword`,label:e,insert:e,detail:`keyword`});return U(r.from,t,l)}function ye(e,t,n){let r=e.lastIndexOf(`
|
|
8
|
-
`,t-1)+1,i=e.slice(r,t);if(/^\s*(\/\/|#|--)/.test(i))return null;let a=Se(e,t),o=a.prefix.toLowerCase(),s=e.slice(r,a.from).trim().toLowerCase(),c=[];if(s===`list`||s===`get`||s===`set`||s===`delete`||s===`ttl`||s===`set(`||s===`get(`||s===`list(`||s===`delete(`||s===`ttl(`){for(let e of n)W(e.name,o)&&c.push({kind:`namespace`,label:e.name,insert:`${e.name}:`,detail:`namespace`});return U(a.from,t,c)}if(s.length===0){for(let e of[`list`,`get`,`set`,`delete`,`ttl`])W(e,o)&&c.push({kind:`command`,label:e,insert:e===`set`?`set(`:`${e} `,detail:`command`});for(let e of n)W(e.name,o)&&c.push({kind:`namespace`,label:e.name,insert:e.name,detail:`namespace`})}return U(a.from,t,c)}function U(e,t,n){return n.length===0?null:(n.sort((e,t)=>{let n=be(e.kind)-be(t.kind);return n===0?e.label.localeCompare(t.label):n}),{from:e,to:t,items:n.slice(0,12)})}function be(e){return e===`table`||e===`namespace`?0:e===`column`||e===`command`?1:2}function xe(e,t){return{kind:`column`,label:e.name,insert:Ee(e.name),detail:e.type===`unknown`?t:`${t} · ${e.type}`,...e.pii===!0?{pii:!0}:{},...e.primaryKey===!0?{primaryKey:!0}:{},...e.references?{foreignKey:!0}:{}}}function Se(e,t){let n=t;for(;n>0;){let t=e[n-1];if(t&&(ge.test(t)||t===`"`)){--n;continue}break}let r=e.slice(n,t),i=null;if(n>0&&e[n-1]===`.`){let t=n-1,r=t;for(;r>0;){let t=e[r-1];if(t&&(ge.test(t)||t===`"`)){--r;continue}break}i=De(e.slice(r,t))}return r.startsWith(`"`)&&(r=r.slice(1)),r.endsWith(`"`)&&(r=r.slice(0,-1)),{from:n,prefix:r,qualifier:i}}function Ce(e,t){let n=e.slice(0,t),r=null;for(let e of B(n)){if(e.quoted)continue;let t=e.text.toUpperCase().match(/[A-Z]+/g);t&&(r=t[t.length-1]??r)}return r}function we(e,t){let n=new Set(t.map(e=>e.name.toLowerCase())),r=[];for(let t of B(e)){if(!t.quoted)continue;let e=De(t.text);n.has(e.toLowerCase())&&!r.includes(e)&&r.push(e)}let i=/\b(?:FROM|JOIN|INTO|UPDATE)\s+("?[A-Za-z_][A-Za-z0-9_]*"?)/gi,a;for(;a=i.exec(e);){let e=De(a[1]??``);n.has(e.toLowerCase())&&!r.includes(e)&&r.push(e)}return r}function Te(e,t){let n=t.toLowerCase();return e.find(e=>e.name.toLowerCase()===n)}function W(e,t){return t.length===0||e.toLowerCase().startsWith(t)}function Ee(e){return`"${e.replaceAll(`"`,`""`)}"`}function De(e){let t=e.trim();return t.startsWith(`"`)&&t.endsWith(`"`)||t.startsWith("`")&&t.endsWith("`")?t.slice(1,-1):t}function Oe(e,t){let n=0;for(let r of B(e)){let e=n+r.text.length;if(t>n&&t<=e&&r.quoted&&r.text.startsWith(`'`))return!0;n=e}return!1}var G=D();function ke({items:e,active:n,top:r,left:i,onHover:a,onPick:o}){return(0,G.jsx)(`ul`,{id:`store-query-complete`,role:`listbox`,"data-slot":`store-query-complete`,className:`cn-menu-translucent absolute z-20 max-h-56 min-w-52 overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10`,style:{top:r,left:i},children:e.map((e,r)=>(0,G.jsx)(`li`,{children:(0,G.jsxs)(`button`,{type:`button`,role:`option`,id:`store-query-complete-${r}`,"aria-selected":r===n,"data-slot":`store-query-complete-item`,onMouseEnter:()=>a(r),onMouseDown:e=>{e.preventDefault(),o(r)},className:t(`flex w-full items-center gap-2 rounded-md px-1.5 py-1 text-left`,r===n?`bg-accent text-accent-foreground`:`text-foreground hover:bg-muted/70`),children:[(0,G.jsx)(F,{primaryKey:e.primaryKey,foreignKey:e.foreignKey}),(0,G.jsx)(`span`,{className:`min-w-0 flex-1 truncate font-mono text-[11px]`,children:e.label}),e.pii?(0,G.jsx)(`span`,{className:`shrink-0 rounded border border-sky-500/30 px-1 font-mono text-[8px] text-sky-700 dark:text-sky-400`,children:`PII`}):null,(0,G.jsx)(`span`,{className:`shrink-0 font-mono text-[9px] tracking-wide text-muted-foreground/70 uppercase`,children:e.kind===`column`?e.detail??`col`:e.kind})]})},`${e.kind}:${e.label}:${e.detail??``}`))})}function Ae(e,t){let n=getComputedStyle(e),r=document.createElement(`div`),i=[`boxSizing`,`width`,`fontFamily`,`fontSize`,`fontWeight`,`fontStyle`,`letterSpacing`,`textTransform`,`wordSpacing`,`textIndent`,`whiteSpace`,`wordWrap`,`lineHeight`,`paddingTop`,`paddingRight`,`paddingBottom`,`paddingLeft`,`borderTopWidth`,`borderRightWidth`,`borderBottomWidth`,`borderLeftWidth`];r.style.position=`absolute`,r.style.visibility=`hidden`,r.style.overflow=`hidden`,r.style.whiteSpace=`pre-wrap`,r.style.wordWrap=`break-word`;for(let e of i)r.style[e]=n[e];r.style.width=`${e.clientWidth}px`,r.textContent=e.value.slice(0,t);let a=document.createElement(`span`);a.textContent=e.value.slice(t)||`.`,r.appendChild(a),document.body.appendChild(r);let o=a.offsetTop-e.scrollTop,s=a.offsetLeft-e.scrollLeft;return document.body.removeChild(r),{top:o,left:s}}var je=new Set(`ABORT.ADD.ALL.ALTER.ANALYZE.AND.ANY.AS.ASC.BETWEEN.BEGIN.BY.CASCADE.CASE.CAST.CHECK.COALESCE.COLUMN.COMMIT.CONFLICT.CONSTRAINT.CREATE.CROSS.CURRENT.DEFAULT.DELETE.DESC.DISTINCT.DO.DROP.ELSE.END.EXCEPT.EXISTS.EXPLAIN.FALSE.FOREIGN.FROM.FULL.GRANT.GROUP.HAVING.IF.ILIKE.IN.INDEX.INNER.INSERT.INTERSECT.INTO.IS.JOIN.KEY.LATERAL.LEFT.LIKE.LIMIT.MATERIALIZED.NATURAL.NOT.NULL.NULLIF.OFFSET.ON.ONLY.OR.ORDER.OUTER.OVER.PARTITION.PRIMARY.RECURSIVE.REFERENCES.RETURNING.RIGHT.ROLLBACK.SELECT.SET.TABLE.THEN.TRUE.TRUNCATE.UNION.UNIQUE.UPDATE.USING.VALUES.VIEW.WHEN.WHERE.WITH`.split(`.`)),Me=new Set([`TRUE`,`FALSE`,`NULL`]),Ne=new Set([`list`,`get`,`set`,`delete`,`ttl`]),Pe=new Set([`true`,`false`,`null`,`value`]),K=/[A-Za-z_\u0080-\uFFFF]/,Fe=/[A-Za-z0-9_\u0080-\uFFFF]/;function Ie(e,t){return t===`kv`?Re(e):Le(e)}function Le(e){let t=[],n=0;for(;n<e.length;){let r=e[n]??``,i=e[n+1]??``;if(r===`-`&&i===`-`){n=q(e,n,t);continue}if(r===`/`&&i===`*`){n=ze(e,n,t);continue}if(r===`'`||r===`"`||r==="`"){n=Be(e,n,r,t,r===`'`?`string`:`ident`);continue}if(J(r)||r===`.`&&J(i)){n=Ve(e,n,t);continue}if(K.test(r)){let r=n;for(n+=1;n<e.length&&Fe.test(e[n]??``);)n+=1;let i=e.slice(r,n),a=i.toUpperCase();Me.has(a)?t.push({kind:`atom`,text:i}):je.has(a)?t.push({kind:`keyword`,text:i}):t.push({kind:`text`,text:i});continue}if(Ge(r)){let r=n;for(n+=1;n<e.length&&Ge(e[n]??``);)n+=1;t.push({kind:`operator`,text:e.slice(r,n)});continue}if(Y(r)){t.push({kind:`punct`,text:r}),n+=1;continue}n=Ue(e,n,t,(t,n)=>!Ke(t,e,n))}return We(t)}function Re(e){let t=[],n=0;for(;n<e.length;){let r=e[n]??``,i=e[n+1]??``;if(r===`/`&&i===`/`){n=q(e,n,t);continue}if(r===`#`){n=q(e,n,t);continue}if(r===`-`&&i===`-`){n=q(e,n,t);continue}if(r===`'`||r===`"`){n=Be(e,n,r,t,`string`);continue}if(J(r)){n=He(e,n,t);continue}if(K.test(r)){let r=n;for(n+=1;n<e.length&&Fe.test(e[n]??``);)n+=1;let i=e.slice(r,n),a=i.toLowerCase();Ne.has(a)?t.push({kind:`command`,text:i}):Pe.has(a)?t.push({kind:`atom`,text:i}):t.push({kind:`ident`,text:i});continue}if(r===`:`){t.push({kind:`punct`,text:r}),n+=1;continue}if(Y(r)||r===`{`||r===`}`||r===`[`||r===`]`){t.push({kind:`punct`,text:r}),n+=1;continue}n=Ue(e,n,t,(t,n)=>!(t===`/`||t===`#`||t===`'`||t===`"`||t===`-`&&e[n+1]===`-`||J(t)||K.test(t)||Y(t)||t===`{`||t===`}`||t===`[`||t===`]`||t===`:`))}return We(t)}function q(e,t,n){let r=t;for(;r<e.length&&e[r]!==`
|
|
9
|
-
`;)r+=1;return n.push({kind:`comment`,text:e.slice(t,r)}),r}function ze(e,t,n){let r=t+2;for(;r<e.length&&(e[r]!==`*`||e[r+1]!==`/`);)r+=1;return r<e.length&&(r+=2),n.push({kind:`comment`,text:e.slice(t,r)}),r}function Be(e,t,n,r,i){let a=t+1;for(;a<e.length;){if(e[a]===n){if(e[a+1]===n){a+=2;continue}a+=1;break}if(e[a]===`\\`&&n===`'`){a+=2;continue}a+=1}return r.push({kind:i,text:e.slice(t,a)}),a}function Ve(e,t,n){let r=t;for(e[r]===`.`&&(r+=1);r<e.length&&J(e[r]??``);)r+=1;if(e[r]===`.`&&J(e[r+1]??``))for(r+=1;r<e.length&&J(e[r]??``);)r+=1;let i=e[r];if(i===`e`||i===`E`){let t=r+1;if((e[t]===`+`||e[t]===`-`)&&(t+=1),J(e[t]??``))for(r=t+1;r<e.length&&J(e[r]??``);)r+=1}return n.push({kind:`number`,text:e.slice(t,r)}),r}function He(e,t,n){let r=Ve(e,t,n),i=n[n.length-1];if(!i)return r;let a=e[r];return a&&/[smhd]/i.test(a)&&!Fe.test(e[r+1]??``)?(n[n.length-1]={kind:`number`,text:`${i.text}${a}`},r+1):r}function Ue(e,t,n,r){let i=t;for(;i<e.length&&r(e[i]??``,i);)i+=1;return i===t?(n.push({kind:`text`,text:e[t]??``}),t+1):(n.push({kind:`text`,text:e.slice(t,i)}),i)}function We(e){let t=[];for(let n of e){let e=t[t.length-1];e&&e.kind===n.kind?t[t.length-1]={kind:e.kind,text:`${e.text}${n.text}`}:t.push(n)}return t}function J(e){return e>=`0`&&e<=`9`}function Ge(e){return`+-*/%=<>!&|^~`.includes(e)}function Y(e){return`(),;.`.includes(e)}function Ke(e,t,n){return!!(e===`'`||e===`"`||e==="`"||e===`-`&&t[n+1]===`-`||e===`/`&&t[n+1]===`*`||J(e)||e===`.`&&J(t[n+1]??``)||K.test(e)||Ge(e)||Y(e))}var qe={text:`text-foreground/90`,comment:`italic text-muted-foreground/55`,keyword:`text-rose-600 dark:text-rose-400`,command:`text-amber-600 dark:text-amber-400`,string:`text-sky-700 dark:text-sky-300`,ident:`text-teal-700 dark:text-teal-300`,number:`text-violet-600 dark:text-violet-400`,punct:`text-muted-foreground/80`,operator:`text-fuchsia-600 dark:text-fuchsia-400`,atom:`text-amber-700 dark:text-amber-300`};function Je({code:e,language:n,className:r}){let i=Ie(e,n);return(0,G.jsx)(`pre`,{"aria-hidden":!0,"data-slot":`store-query-highlight`,"data-language":n,className:t(`m-0 overflow-visible whitespace-pre font-mono text-xs leading-5 text-foreground/90`,r),children:i.map((e,t)=>(0,G.jsx)(`span`,{className:qe[e.kind],children:e.text},`${t}-${e.kind}`))})}function Ye({value:e,onChange:n,language:r,onRun:a,onRunAll:o,label:s,className:c,runLines:l=[],onRunLine:u,onCursorChange:d,editorRef:f,tables:p=[],facet:m=`sql`}){let h=(0,L.useRef)(null),g=(0,L.useRef)(null),_=(0,L.useRef)(null),[v,y]=(0,L.useState)(null),b=Math.max(e.split(`
|
|
10
|
-
`).length,1),x=e.endsWith(`
|
|
11
|
-
`)?e:`${e}\n`,S=new Set(l);(0,L.useImperativeHandle)(f,()=>({insert(t){let r=h.current;if(y(null),!r){n(`${e}${t}`);return}let i=r.selectionStart,a=r.selectionEnd;n(`${e.slice(0,i)}${t}${e.slice(a)}`),requestAnimationFrame(()=>{let e=i+t.length;r.focus(),r.selectionStart=r.selectionEnd=e,d?.(e,e)})},focus(){h.current?.focus()}}));let C=()=>{let e=h.current;e&&(g.current&&(g.current.scrollTop=e.scrollTop),_.current&&(_.current.scrollTop=e.scrollTop,_.current.scrollLeft=e.scrollLeft))},w=()=>{let e=h.current;e&&d?.(e.selectionStart,e.selectionEnd)},E=(e,t)=>{requestAnimationFrame(()=>{e.focus(),e.selectionStart=e.selectionEnd=t,d?.(t,t)})},D=(e,t)=>{if(p.length===0){y(null);return}let n=e.selectionStart,r=_e(t,n,p,m);if(!r){y(null);return}let i=Ae(e,n);y({result:r,active:0,top:Math.min(i.top+20,Math.max(8,e.clientHeight-48)),left:Math.min(Math.max(8,i.left),Math.max(8,e.clientWidth-220))})},O=t=>{let r=h.current;if(!r||!v)return;let i=v.result.items[t];if(!i)return;let a=`${e.slice(0,v.result.from)}${i.insert}${e.slice(v.result.to)}`,o=v.result.from+i.insert.length;n(a),y(null),E(r,o)};return(0,G.jsxs)(`div`,{className:t(`flex min-h-0 flex-1 overflow-hidden bg-background`,c),"data-slot":`store-query-editor`,children:[(0,G.jsx)(`div`,{ref:g,"aria-hidden":!0,className:`shrink-0 overflow-hidden border-r border-border/50 bg-muted/15 py-3 pr-1.5 pl-1.5 font-mono text-xs leading-5 text-muted-foreground/70`,children:Array.from({length:b},(e,t)=>{let n=t+1,r=S.has(n);return(0,G.jsxs)(`div`,{className:`group/line flex h-5 items-center justify-end gap-0.5`,children:[r&&u?(0,G.jsx)(`button`,{type:`button`,tabIndex:-1,"aria-label":`Run statement on line ${n}`,"data-slot":`store-query-gutter-run`,onClick:()=>u(n),className:`flex size-4 items-center justify-center rounded-sm text-emerald-600 opacity-70 hover:bg-emerald-500/15 hover:opacity-100 dark:text-emerald-400`,children:(0,G.jsx)(T,{icon:i,className:`size-2.5`})}):(0,G.jsx)(`span`,{className:`size-4`}),(0,G.jsx)(`span`,{className:`min-w-4 text-right`,children:n})]},n)})}),(0,G.jsxs)(`div`,{className:`relative min-h-0 min-w-0 flex-1`,children:[(0,G.jsx)(`div`,{ref:_,className:`pointer-events-none absolute inset-0 overflow-hidden`,children:(0,G.jsx)(Je,{code:x,language:r,className:`px-3 py-3 text-xs leading-5`})}),(0,G.jsx)(`textarea`,{ref:h,value:e,onChange:e=>{n(e.target.value),d?.(e.target.selectionStart,e.target.selectionEnd),D(e.target,e.target.value)},onScroll:C,onKeyDown:t=>{if((t.metaKey||t.ctrlKey)&&t.key===`Enter`){t.preventDefault(),y(null),t.shiftKey&&o?o():a();return}if(v){if(t.key===`ArrowDown`){t.preventDefault(),y(e=>e&&{...e,active:(e.active+1)%e.result.items.length});return}if(t.key===`ArrowUp`){t.preventDefault(),y(e=>e&&{...e,active:(e.active-1+e.result.items.length)%e.result.items.length});return}if(t.key===`Enter`||t.key===`Tab`){t.preventDefault(),O(v.active);return}if(t.key===`Escape`){t.preventDefault(),y(null);return}(t.key===`ArrowLeft`||t.key===`ArrowRight`)&&y(null)}if(t.key===`Tab`){t.preventDefault();let r=t.currentTarget,i=r.selectionStart,a=r.selectionEnd;n(`${e.slice(0,i)} ${e.slice(a)}`),E(r,i+2);return}t.key===`Escape`&&y(null)},onKeyUp:w,onClick:()=>{y(null),w()},onSelect:w,onBlur:()=>y(null),spellCheck:!1,autoCorrect:`off`,autoCapitalize:`off`,"aria-label":s,"aria-autocomplete":`list`,"aria-expanded":v!==null,"aria-controls":v?`store-query-complete`:void 0,"aria-activedescendant":v?`store-query-complete-${v.active}`:void 0,"data-slot":`store-query-input`,className:`absolute inset-0 h-full w-full resize-none overflow-auto bg-transparent px-3 py-3 font-mono text-xs leading-5 text-transparent caret-foreground outline-none`}),v?(0,G.jsx)(ke,{items:v.result.items,active:v.active,top:v.top,left:v.left,onHover:e=>y(t=>t&&{...t,active:e}),onPick:O}):null]})]})}function Xe({value:e,label:n,onChange:r,onFocus:i,onIdle:a,dirty:o=!1,autoFocus:s=!1,placeholder:c=`Empty`,className:l}){let[u,d]=(0,L.useState)(e),f=(0,L.useRef)(null);(0,L.useEffect)(()=>{d(e)},[e]),(0,L.useEffect)(()=>{if(!s)return;let e=f.current;e&&(e.focus(),e.select())},[s]);let p=()=>{u!==e&&r(u)},m=()=>{p(),a?.()};return(0,G.jsx)(`input`,{ref:f,value:u,"aria-label":n,size:1,"data-dirty":o?`true`:void 0,onFocus:i,onChange:e=>d(e.target.value),onBlur:m,onKeyDown:t=>{if(t.key===`Enter`&&(t.metaKey||t.ctrlKey)){m();return}t.key===`Enter`?(t.preventDefault(),t.currentTarget.blur()):t.key===`Escape`&&(t.preventDefault(),d(e),a?.(),t.currentTarget.blur())},placeholder:c,className:t(`h-full w-full min-w-0 appearance-none rounded-none border-0 bg-transparent p-0`,`shadow-none outline-none ring-0`,`focus:bg-transparent focus:shadow-none focus:ring-0 focus:outline-none`,`focus-visible:shadow-none focus-visible:ring-0 focus-visible:outline-none`,`placeholder:text-muted-foreground/40`,o?`text-[#9a5b12] dark:text-[#e8c48a]`:`text-foreground`,l)})}function Ze(e){try{return new TextEncoder().encode(JSON.stringify(e??null)).length}catch{return 0}}function Qe(e){if(typeof e==`string`){let t=e.trim();return t===``?`—`:t}return typeof e!=`number`||!Number.isFinite(e)?`—`:e<=0?`0s`:e<6e4?`${Math.max(1,Math.round(e/1e3))}s`:e<36e5?`${Math.round(e/6e4)}m`:e<864e5?`${Math.round(e/36e5)}h`:`${Math.round(e/864e5)}d`}function $e(e){let t=e.trim();if(t===``||t===`—`||t===`none`)return null;if(/^(\d+)(ms|s|m|h|d)$/.test(t))return t}function et(e){if(typeof e!=`number`||!Number.isFinite(e)||e<0)return`—`;if(e<1024)return`${Math.round(e)} B`;if(e<1048576){let t=e/1024;return t<10?`${t.toFixed(1)} KB`:`${Math.round(t)} KB`}let t=e/1048576;return t<10?`${t.toFixed(1)} MB`:`${Math.round(t)} MB`}function tt(e){let{facet:t,data:n,piiColumns:r=[],columnTypes:i={},columnDescriptions:a={},primaryKeyColumns:o=[]}=e,s=P(r),c=new Set(o);if(t===`sql`){let e=n.rows??[];return{columns:(e.length>0?Object.keys(e[0]??{}):Object.keys(i)).map(e=>({key:e,type:i[e]===`integer`?`integer`:`string`,editable:e!==`id`,pii:s.has(e),...c.has(e)?{primaryKey:!0}:{},...a[e]===void 0?{}:{description:a[e]}})),rows:e.map(e=>({id:it(e),cells:e})),deleteKind:`ids`,editable:!0}}if(t===`kv`)return{columns:[{key:`key`,type:`string`,editable:!1,pii:!1},{key:`value`,type:`json`,editable:!0,pii:!1},{key:`ttl`,type:`number`,editable:!0,pii:!1,format:`ttl`},{key:`size`,type:`number`,editable:!1,pii:!1,format:`bytes`}],rows:(n.keys??[]).map(e=>({id:e.key,cells:{key:e.key,value:e.value,ttl:e.ttlMs??null,size:e.sizeBytes??Ze(e.value)}})),deleteKind:`keys`,editable:!0};if(t===`files`)return{columns:[{key:`key`,type:`string`,editable:!1,pii:!1},{key:`size`,type:`number`,editable:!1,pii:!1,format:`bytes`},{key:`warnings`,type:`string`,editable:!1,pii:!1}],rows:(n.keys??[]).map(e=>({id:e.key,cells:{key:e.key,size:e.sizeBytes??0,warnings:e.warnings?.map(e=>e.message).join(`; `)??``}})),deleteKind:`keys`,editable:!1};let l=n.hits??[],u=rt(l);return{columns:[{key:`id`,type:`string`,editable:!1,pii:!1},...u.map(e=>({key:e,type:`string`,editable:!1,pii:!1})),{key:`score`,type:`number`,editable:!1,pii:!1},...u.length===0?[{key:`meta`,type:`json`,editable:!1,pii:!1}]:[]],rows:l.map(e=>({id:e.id,cells:{id:e.id,score:e.score,...u.length===0?{meta:e.meta}:{},...Object.fromEntries(u.map(t=>[t,e.meta?.[t]]))}})),deleteKind:`ids`,editable:!1}}var nt=[`identifier`,`title`,`description`];function rt(e){let t=new Set;for(let n of e)for(let[e,r]of Object.entries(n.meta??{}))e===`id`||/^\d+$/.test(e)||typeof r==`object`&&r||t.add(e);let n=[...t].filter(e=>!nt.includes(e)).sort();return[...nt.filter(e=>t.has(e)),...n]}function it(e){let t=e.id??e.Id??e.name;return typeof t==`string`||typeof t==`number`||typeof t==`boolean`?String(t):``}function X(e){if(e==null)return`—`;if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);try{return JSON.stringify(e)}catch{return`[unserializable]`}}function at(e,t){return e.format===`ttl`?Qe(t):e.format===`bytes`?et(t):X(t)}function Z(e){if(e==null)return null;if(typeof e==`object`)return e;if(typeof e!=`string`)return null;let t=e.trim();if(!(t.startsWith(`{`)||t.startsWith(`[`)))return null;try{let e=JSON.parse(t);if(typeof e==`object`&&e)return e}catch{return null}return null}function ot(e){let t=Z(e);if(t!==null)return{ok:!0,value:t};let n=e.trim();if(n===``)return{ok:!1,error:`JSON is empty`};try{return JSON.parse(n),{ok:!1,error:`JSON must be an object or array`}}catch{return{ok:!1,error:`Invalid JSON`}}}function st(e){let t=Z(e);return t===null?[]:gt(t,``)}function ct(e,t){if(t===`object`)return`{}`;if(t===`array`)return`[]`;if(e==null)return``;if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`||typeof e==`bigint`)return String(e);try{return JSON.stringify(e)??``}catch{return``}}function lt(e,t){if(e===`string`)return t;let n=t.trim();if(e===`number`){if(n===``)return null;let e=Number(n);return Number.isFinite(e)?e:t}if(e===`boolean`)return n===`true`?!0:n===`false`?!1:n===``?null:t;if(e===`null`){if(n===``||n===`null`)return null;if(n===`true`)return!0;if(n===`false`)return!1;let e=Number(n);return Number.isFinite(e)&&n!==``?e:t}if(e===`object`||e===`array`){if(n===``)return e===`array`?[]:{};try{return JSON.parse(n)}catch{return t}}return t}function ut(e,t,n){let r=ft(t);if(r.length===0)return n;let i=structuredClone(e),a=i;for(let e=0;e<r.length-1;e++){let t=r[e];if(!t)return i;a=pt(a,t)}let o=r[r.length-1];return o&&mt(a,o,n),i}function dt(e,t){if(Object.is(e,t))return!0;try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function ft(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(r===`.`){n+=1;continue}if(r===`[`){let r=e.indexOf(`]`,n);if(r<0)break;t.push({type:`index`,index:Number(e.slice(n+1,r))}),n=r+1;continue}let i=n;for(;i<e.length&&e[i]!==`.`&&e[i]!==`[`;)i+=1;t.push({type:`key`,key:e.slice(n,i)}),n=i}return t}function pt(e,t){if(!(typeof e!=`object`||!e))return t.type===`key`?e[t.key]:e[t.index]}function mt(e,t,n){if(!(typeof e!=`object`||!e)){if(t.type===`key`){e[t.key]=n;return}e[t.index]=n}}function ht(e){let t=Z(e);if(t!==null)try{return JSON.stringify(t,null,2)}catch{return`[unserializable]`}if(typeof e==`string`)return e;try{return JSON.stringify(e,null,2)}catch{return`[unserializable]`}}function gt(e,t){if(typeof e==`object`&&e&&!Array.isArray(e)){let n=Object.entries(e);return n.length===0?t?[{path:t,value:e,kind:`object`}]:[]:n.flatMap(([e,n])=>gt(n,t?`${t}.${e}`:e))}return Array.isArray(e)?e.length===0?t?[{path:t,value:e,kind:`array`}]:[]:e.flatMap((e,n)=>gt(e,t?`${t}[${n}]`:`[${n}]`)):[{path:t||`(root)`,value:e,kind:_t(e)}]}function _t(e){return e===null?`null`:typeof e==`boolean`?`boolean`:typeof e==`number`?`number`:Array.isArray(e)?`array`:typeof e==`object`?`object`:`string`}var vt=/[-ۿݐ-ݿࢠ-ࣿﭐ-﷿ﹰ-]/;function yt(e){return typeof e==`string`&&vt.test(e)}function bt({open:e,onOpenChange:n,rowId:r,column:i,storeRef:a,value:o,originalValue:c,editable:l=!1,onChange:u}){let[d,p]=(0,L.useState)(`table`),[m,g]=(0,L.useState)(!1),[b,w]=(0,L.useState)(``),[E,D]=(0,L.useState)(null),k=(0,L.useRef)(!1),A=l&&u!==void 0;(0,L.useEffect)(()=>{e&&(p(`table`),g(!1),D(null),k.current=!1)},[e,r,i]);let ee=(0,L.useMemo)(()=>st(o),[o]),te=(0,L.useMemo)(()=>{let e=new Map;for(let t of st(c??o))e.set(t.path,t.value);return e},[c,o]),j=(0,L.useMemo)(()=>ht(o),[o]),M=Z(o),N=ee.length,P=Array.isArray(M),F=b!==j;(0,L.useEffect)(()=>{k.current||(w(j),D(null))},[j]);let I=(e,t)=>{!u||M===null||u(ut(M,e.path,lt(e.kind,t)))};return(0,G.jsx)(h,{open:e,onOpenChange:n,children:(0,G.jsxs)(v,{side:`right`,showOverlay:!1,className:`gap-0 p-0 data-[side=right]:sm:max-w-xl`,"data-slot":`json-value-sheet`,children:[(0,G.jsxs)(_,{className:`gap-2 border-b border-border/50`,children:[(0,G.jsxs)(`div`,{className:`flex flex-col gap-0.5 pr-8`,children:[(0,G.jsx)(C,{className:`text-sm`,children:(0,G.jsx)(`span`,{className:`font-mono`,children:r})}),(0,G.jsxs)(x,{className:`font-mono text-[11px]`,children:[a,(0,G.jsx)(`span`,{className:`text-border`,children:` · `}),i,N>0?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`span`,{className:`text-border`,children:` · `}),N,` `,N===1?`field`:`fields`]}):null]})]}),(0,G.jsxs)(`div`,{className:`flex items-center gap-4`,role:`tablist`,"aria-label":`JSON value tabs`,children:[(0,G.jsx)(Tt,{active:d===`table`,onClick:()=>p(`table`),id:`table`,children:`Table`}),(0,G.jsx)(Tt,{active:d===`json`,onClick:()=>p(`json`),id:`json`,children:`JSON`})]})]}),(0,G.jsx)(`div`,{className:t(`flex min-h-0 flex-1 flex-col px-4 pb-2`,d===`json`?`overflow-hidden pt-3`:`overflow-y-auto`),children:d===`table`?N===0?(0,G.jsx)(`p`,{className:`px-1 py-8 text-center text-sm text-muted-foreground`,"data-slot":`json-value-empty`,children:P?`Empty array.`:`No fields.`}):(0,G.jsxs)(`table`,{className:`w-full table-fixed border-collapse`,"data-slot":`json-value-table`,children:[(0,G.jsxs)(`colgroup`,{children:[(0,G.jsx)(`col`,{className:`w-[30%]`}),(0,G.jsx)(`col`,{className:`w-12`}),(0,G.jsx)(`col`,{})]}),(0,G.jsx)(`thead`,{children:(0,G.jsxs)(`tr`,{className:`border-b border-border/60 text-left`,children:[(0,G.jsx)(`th`,{className:`sticky top-0 bg-popover py-2 pr-3 font-mono text-[10px] font-semibold tracking-[0.08em] text-muted-foreground uppercase`,children:`Field`}),(0,G.jsx)(`th`,{className:`sticky top-0 bg-popover py-2 pr-3 font-mono text-[10px] font-semibold tracking-[0.08em] text-muted-foreground uppercase`,children:`Type`}),(0,G.jsx)(`th`,{className:`sticky top-0 bg-popover py-2 font-mono text-[10px] font-semibold tracking-[0.08em] text-muted-foreground uppercase`,children:`Value`})]})}),(0,G.jsx)(`tbody`,{className:`divide-y divide-border/60`,children:ee.map(e=>(0,G.jsxs)(`tr`,{children:[(0,G.jsx)(`td`,{className:`align-top py-1.5 pr-3`,children:(0,G.jsx)(`span`,{className:`block truncate font-mono text-[11px] font-medium text-muted-foreground`,title:e.path,children:e.path})}),(0,G.jsx)(`td`,{className:`align-top py-1.5 pr-3`,children:(0,G.jsx)(`span`,{className:`font-mono text-[9px] text-muted-foreground/60`,children:Ct(e.kind)})}),(0,G.jsx)(`td`,{className:t(`min-w-0 align-top py-1 font-mono text-[11px] break-words`,e.kind===`null`&&!A&&`text-muted-foreground/40`,e.kind===`number`&&`tabular-nums`,(e.kind===`object`||e.kind===`array`)&&!A&&`text-muted-foreground`),dir:yt(e.value)?`rtl`:`ltr`,children:A?(0,G.jsx)(Xe,{value:ct(e.value,e.kind),label:`Edit ${e.path}`,dirty:!dt(te.get(e.path),e.value),onChange:t=>I(e,t),className:`min-h-7 w-full px-0 font-mono text-[11px]`}):wt(e.value,e.kind)})]},e.path))})]}):(0,G.jsx)(xt,{pretty:j,draft:b,error:E,dirty:F,editable:A,onDraftChange:e=>{w(e),E&&D(null)},onFocusChange:e=>{k.current=e},onCommit:()=>{if(!u)return;let e=ot(b);if(!e.ok){D(e.error);return}D(null),u(e.value)},onRevert:()=>{w(j),D(null)}})}),(0,G.jsxs)(`div`,{className:`mt-auto flex items-center justify-between gap-2 border-t border-border/50 px-4 py-2.5`,children:[A?(0,G.jsx)(`span`,{className:`inline-flex items-center gap-1.5 font-mono text-[10px] text-muted-foreground`,children:d===`json`?(0,G.jsxs)(G.Fragment,{children:[`Edit JSON · blur or`,(0,G.jsx)(S,{keys:O(`↵`)}),`to apply`]}):`Click a value to edit · Changes to review`}):(0,G.jsx)(`span`,{}),(0,G.jsxs)(s,{type:`button`,variant:`outline`,size:`sm`,onClick:()=>{if(!navigator.clipboard)return;let e=d===`json`?b:j;navigator.clipboard.writeText(e).then(()=>{g(!0),window.setTimeout(()=>g(!1),1200)})},"data-slot":`json-value-copy`,children:[(0,G.jsx)(T,{icon:m?f:y,className:`size-3.5`,"aria-hidden":!0}),m?`Copied`:`Copy JSON`]})]})]})})}function xt({pretty:e,draft:n,error:r,dirty:i,editable:a,onDraftChange:o,onFocusChange:s,onCommit:c,onRevert:l}){let u=(0,L.useRef)(null),d=(0,L.useRef)(null),f=(0,L.useRef)(null),p=(a?n:e).split(`
|
|
12
|
-
`);return(0,L.useEffect)(()=>{let e=d.current,t=f.current;!e||t===null||(e.selectionStart=e.selectionEnd=t,f.current=null)},[n]),(0,G.jsxs)(`div`,{className:`flex min-h-0 flex-1 flex-col gap-1.5`,"data-slot":`json-value-source`,children:[(0,G.jsx)(`div`,{className:t(`flex min-h-0 flex-1 overflow-hidden rounded-md border`,r?`border-destructive/50`:i?`border-amber-500/30`:`border-border/60`),children:a?(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(`div`,{ref:u,className:`shrink-0 overflow-hidden border-r border-border/40 bg-muted/30 px-1.5 py-2 text-right font-mono text-[10px] leading-5 text-muted-foreground/80`,"aria-hidden":!0,children:p.map((e,t)=>(0,G.jsx)(`div`,{children:t+1},t))}),(0,G.jsx)(`textarea`,{ref:d,value:n,spellCheck:!1,"aria-label":`JSON source`,"aria-invalid":r!==null,"data-slot":`json-value-editor`,onFocus:()=>s(!0),onBlur:()=>{s(!1),c()},onScroll:()=>{u.current&&d.current&&(u.current.scrollTop=d.current.scrollTop)},onChange:e=>o(e.target.value),onKeyDown:e=>{if(e.key===`Tab`){e.preventDefault();let t=e.currentTarget.selectionStart,r=e.currentTarget.selectionEnd;f.current=t+2,o(`${n.slice(0,t)} ${n.slice(r)}`);return}if(e.key===`Enter`&&(e.metaKey||e.ctrlKey)){e.preventDefault(),St(e.currentTarget);return}e.key===`Escape`&&(e.preventDefault(),l(),St(e.currentTarget))},className:t(`min-h-0 min-w-0 flex-1 resize-none bg-transparent px-2 py-2 font-mono text-[11px] leading-5`,`shadow-none outline-none ring-0 focus-visible:outline-none`,i?`text-[#9a5b12] dark:text-[#e8c48a]`:`text-foreground`)})]}):(0,G.jsx)(N,{json:e,dataSlot:`json-value-highlight`,className:`flex min-h-0 flex-1 overflow-auto`})}),r?(0,G.jsx)(`p`,{className:`text-[11px] text-destructive`,role:`alert`,"data-slot":`json-value-error`,children:r}):null]})}function St(e){e.blur()}function Ct(e){switch(e){case`number`:return`123`;case`boolean`:return`0/1`;case`null`:return`∅`;case`object`:case`array`:return`{ }`;default:return`abc`}}function wt(e,t){return t===`object`?`{}`:t===`array`?`[]`:X(e)}function Tt({active:e,onClick:n,id:r,children:i}){return(0,G.jsx)(`button`,{type:`button`,role:`tab`,id:`json-tab-${r}`,"aria-selected":e,onClick:n,className:t(`px-2 py-1.5 text-[10px] font-semibold tracking-[0.08em] uppercase transition-colors hover:bg-muted/50`,e?`text-foreground`:`text-muted-foreground hover:text-foreground`),"data-slot":`json-tab-${r}`,children:i})}var Et=`[redacted]`;function Dt(e){let t={};for(let[n,r]of Object.entries(e))r!==`[redacted]`&&(t[n]=r);return t}function Ot(e){return e===Et}function kt(e,t){if(e===`boolean`){let e=t.trim().toLowerCase();return e===`true`||e===`1`||e===`yes`||e===`on`?!0:e===`false`||e===`0`||e===`no`||e===`off`||e===``?!1:t}if(e===`integer`){let e=Number(t);return Number.isFinite(e)?Math.trunc(e):t}if(e===`number`){let e=Number(t);return Number.isFinite(e)?e:t}if(e===`json`)try{return JSON.parse(t)}catch{return t}return t}function At(e){let t={};for(let n of e)t[n.key]=n.key===`id`?crypto.randomUUID():``;return`id`in t||(t.id=crypto.randomUUID()),t}function jt(e){return e.some(e=>e.key===`id`)?[...e]:[{key:`id`,type:`string`},...e]}function Mt(e,t){let n={},r=new Set;for(let i of e){r.add(i.key);let e=t[i.key]??``;e.trim()!==``&&(n[i.key]=kt(i.type,e))}if(!r.has(`id`)){let e=t.id??``;e.trim()!==``&&(n.id=e.trim())}let i=Dt(n),a=i.id;return(typeof a!=`string`||a.length===0)&&typeof a!=`number`?{ok:!1,error:`id is required`}:{ok:!0,patch:i}}function Q(e){return{minRow:Math.min(e.anchor.row,e.head.row),maxRow:Math.max(e.anchor.row,e.head.row),minCol:Math.min(e.anchor.col,e.head.col),maxCol:Math.max(e.anchor.col,e.head.col)}}function Nt(e,t,n){let r=Q(e);return t>=r.minRow&&t<=r.maxRow&&n>=r.minCol&&n<=r.maxCol}function Pt(e){let t=Q(e);return(t.maxRow-t.minRow+1)*(t.maxCol-t.minCol+1)}function Ft(e){let t=Q(e),n=[];for(let e=t.minRow;e<=t.maxRow;e++)for(let r=t.minCol;r<=t.maxCol;r++)n.push({row:e,col:r});return n}function It(e){if(!e)return[];let t=e.replace(/\r\n/g,`
|
|
13
|
-
`).replace(/\r/g,`
|
|
14
|
-
`).split(`
|
|
15
|
-
`);return t.length>1&&t[t.length-1]===``&&t.pop(),t.map(e=>e.split(` `))}function Lt(e){return e.map(e=>e.map(e=>e.replace(/[\t\r\n]+/g,` `)).join(` `)).join(`
|
|
16
|
-
`)}var Rt=[`id`,`key`];function zt(e){if(e==null)return``;if(typeof e==`string`)return e;if(typeof e==`number`||typeof e==`boolean`)return String(e);try{return JSON.stringify(e)}catch{return``}}function Bt(e){return/[",\r\n]/.test(e)?`"${e.replaceAll(`"`,`""`)}"`:e}function Vt(e,t){let n=[e.map(Bt).join(`,`)];for(let r of t)n.push(e.map((e,t)=>Bt(r[t]??``)).join(`,`));return n.join(`
|
|
17
|
-
`)}function Ht(e){let t=e.replace(/^\uFEFF/,``),n=[],r=[],i=``,a=!1;for(let e=0;e<t.length;e++){let o=t[e];if(a){if(o===`"`){if(t[e+1]===`"`){i+=`"`,e+=1;continue}a=!1;continue}i+=o;continue}if(o===`"`){a=!0;continue}if(o===`,`){r.push(i),i=``;continue}if(o===`
|
|
18
|
-
`){r.push(i),i=``,n.push(r),r=[];continue}o!==`\r`&&(i+=o)}if(a)throw Error(`Unclosed CSV quote`);return(i.length>0||r.length>0)&&(r.push(i),n.push(r)),n}function Ut(e){let t=e[0];if(!t||t.length===0)return[];let n=[];for(let r of e.slice(1)){let e={},i=!1;for(let n=0;n<t.length;n++){let a=t[n]?.trim();a&&(e[a]=r[n]??``,i=!0)}i&&n.push(e)}return n}function Wt(e){let t=JSON.parse(e);if(!Array.isArray(t))throw Error(`JSON import must be an array of objects`);return t.map(e=>{if(typeof e!=`object`||!e||Array.isArray(e))throw Error(`JSON import must be an array of objects`);let t={};for(let[n,r]of Object.entries(e))t[n]=zt(r);return t})}function Gt(e){let t=e.trim();if(t.length===0)return[];if(t.startsWith(`[`)||t.startsWith(`{`))return Wt(t);let n=t.split(/\r?\n/,1)[0]??``;return n.includes(` `)&&!n.includes(`,`)?Ut(It(e)):Ut(Ht(e))}function Kt(e){let t=0,n=[];for(let r of e.records){let i=qt(r,e.rowIds);if(i===null){t+=1;continue}for(let[t,a]of Object.entries(r))Rt.includes(t)||a!==`[redacted]`&&e.writable(i,t)&&n.push({rowId:i,key:t,text:a})}return{hits:n,unmatched:t}}function qt(e,t){for(let n of Rt){let r=e[n]?.trim();if(r&&t.has(r))return r}return null}function Jt({rows:e,error:n,pending:s,meta:l,executed:h,executedLanguage:_=`sql`,storeRef:v=`sql:query`,collapsed:x=!1,onToggleCollapse:S,sets:C=[],activeSet:E=0,onSelectSet:D}){let[O,k]=(0,L.useState)(`table`),[P,F]=(0,L.useState)(null),[I,ne]=(0,L.useState)(null),R=(0,L.useMemo)(()=>Yt(e??[]),[e]),z=(0,L.useMemo)(()=>JSON.stringify(e??[],null,2),[e]),re=(0,L.useMemo)(()=>!e||e.length===0?``:Vt(R,e.map(e=>R.map(t=>zt(e[t])))),[e,R]),B=e=>{let t=e===`csv`?re:z;!navigator.clipboard||t.length===0||navigator.clipboard.writeText(t).then(()=>{F(e),window.setTimeout(()=>F(null),1200)})},V=e=>{let t=e===`csv`?re:z;if(t.length===0)return;let n=new Blob([t],{type:e===`csv`?`text/csv`:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=e===`csv`?`query-results.csv`:`query-results.json`,i.click(),URL.revokeObjectURL(r)},H=e!==null&&e.length>0;return(0,G.jsxs)(`div`,{className:t(`flex min-h-0 flex-col overflow-hidden`,x?`shrink-0`:`h-full`),"data-slot":`store-query-results`,children:[(0,G.jsxs)(`div`,{className:t(m,x&&`border-t border-b-0`),children:[C.length>1?C.map((e,n)=>(0,G.jsxs)(`button`,{type:`button`,"aria-pressed":n===E,onClick:()=>D?.(n),className:t(d,`font-mono`,n===E?p:w),children:[n+1,` `,e.label]},`${e.label}-${n}`)):null,(0,G.jsx)($,{label:`Table`,icon:c,active:O===`table`,onClick:()=>k(`table`)}),(0,G.jsx)($,{label:`JSON`,icon:u,active:O===`json`,onClick:()=>k(`json`)}),(0,G.jsx)($,{label:`Executed statement`,icon:g,active:O===`raw`,onClick:()=>k(`raw`)}),(0,G.jsx)(`span`,{className:`flex min-w-0 flex-1 items-center truncate px-2 text-[11px] text-muted-foreground`,children:n||(s?`Running…`:l??`No results yet. Run a query to see results here.`)}),(0,G.jsx)($,{label:P===`json`?`Copied`:`Copy JSON`,icon:P===`json`?f:y,disabled:!H,onClick:()=>B(`json`)}),(0,G.jsx)($,{label:`Download JSON`,icon:b,disabled:!H,onClick:()=>V(`json`)}),(0,G.jsx)($,{label:P===`csv`?`Copied`:`Copy CSV`,icon:P===`csv`?f:r,disabled:!H,onClick:()=>B(`csv`)}),S?(0,G.jsx)($,{label:x?`Expand results`:`Collapse results`,icon:x?a:o,expanded:!x,slot:`store-query-results-collapse`,onClick:S}):null]}),x?null:(0,G.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:n?(0,G.jsx)(`p`,{className:`px-3 py-4 font-mono text-xs leading-relaxed text-destructive`,role:`alert`,children:n}):s?(0,G.jsx)(`p`,{className:`px-3 py-8 text-center text-sm text-muted-foreground`,children:`Running…`}):e===null&&O!==`raw`?(0,G.jsx)(A,{className:`h-full min-h-40 border-0`,children:(0,G.jsxs)(M,{children:[(0,G.jsx)(ee,{variant:`icon`,children:(0,G.jsx)(T,{icon:i,className:`size-4`})}),(0,G.jsx)(te,{children:`No results yet`}),(0,G.jsx)(j,{children:`Run a query to see results here.`})]})}):O===`raw`?h?(0,G.jsx)(`div`,{className:`p-3`,"data-slot":`store-query-raw`,children:(0,G.jsx)(Je,{code:h,language:_,className:`text-xs leading-5`})}):(0,G.jsx)(`p`,{className:`px-3 py-8 text-center text-sm text-muted-foreground`,children:`Nothing executed yet.`}):O===`json`?(0,G.jsx)(N,{json:z,dataSlot:`store-query-json`,className:`min-h-full p-3`}):e&&e.length===0?(0,G.jsx)(`p`,{className:`px-3 py-8 text-center text-sm text-muted-foreground`,children:`Query returned 0 rows.`}):(0,G.jsxs)(`table`,{className:`w-full min-w-max border-collapse text-left text-[12px]`,children:[(0,G.jsx)(`thead`,{className:`sticky top-0 z-10 bg-background`,children:(0,G.jsx)(`tr`,{children:R.map(e=>(0,G.jsx)(`th`,{scope:`col`,className:`border-b border-border/60 px-3 py-1.5 font-mono text-[10px] font-semibold tracking-[0.08em] text-muted-foreground uppercase`,children:e},e))})}),(0,G.jsx)(`tbody`,{children:(e??[]).map((e,t)=>(0,G.jsx)(`tr`,{className:`border-b border-border/60 hover:bg-muted/50`,children:R.map(n=>{let r=e[n],i=Z(r)!==null;return(0,G.jsx)(`td`,{className:`max-w-xs truncate px-3 py-1.5 font-mono text-foreground/90`,children:i?(0,G.jsx)(`button`,{type:`button`,className:`max-w-full truncate text-left underline decoration-border/70 underline-offset-2 hover:text-foreground`,onClick:()=>ne({rowId:String(t),column:n,value:r}),children:X(r)}):X(r)},n)})},t))})]})}),(0,G.jsx)(bt,{open:I!==null,onOpenChange:e=>{e||ne(null)},rowId:I?.rowId??``,column:I?.column??``,storeRef:v,value:I?.value,editable:!1})]})}function Yt(e){let t=[],n=new Set;for(let r of e)for(let e of Object.keys(r))n.has(e)||(n.add(e),t.push(e));return t}function $({label:e,icon:n,active:r=!1,disabled:i=!1,expanded:a,slot:o,onClick:s}){return(0,G.jsx)(k,{label:e,className:`flex self-stretch`,children:(0,G.jsx)(`button`,{type:`button`,"aria-label":e,"aria-pressed":r||void 0,"aria-expanded":a,disabled:i,"data-slot":o,onClick:s,className:t(d,r?p:w,i&&`pointer-events-none opacity-40`),children:(0,G.jsx)(T,{icon:n,className:`size-3.5`})})})}function Xt(e,t){let n=-1/0,r=null;for(let i of e)i.replicaLagMs!=null&&i.effects.some(e=>t.has(e.resource))&&i.startedAt>=n&&(n=i.startedAt,r=i.replicaLagMs);return r}export{$e as A,re as B,ot as C,et as D,at as E,ce as F,ne as H,V as I,ie as L,Ye as M,Je as N,Qe as O,se as P,de as R,dt as S,X as T,I as V,kt as _,Gt as a,yt as b,Pt as c,Ft as d,It as f,Ot as g,jt as h,Kt as i,Xe as j,Ze as k,Q as l,At as m,Jt as n,Vt as o,Mt as p,zt as r,Lt as s,Xt as t,Nt as u,Dt as v,tt as w,Z as x,bt as y,ae as z};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-hePW80VL.js";import{$ as t,An as n,At as r,B as i,Bt as a,C as o,Cn as s,Cr as c,Ct as l,Dn as u,Dt as d,En as f,Et as p,Fn as m,G as h,Gn as g,Gt as _,H as v,Hn as y,Ht as b,In as x,It as S,J as C,Jn as w,K as T,Kn as E,Kt as D,Ln as ee,Lt as te,Mn as O,Mt as k,Nn as ne,Nt as A,O as j,On as M,Ot as re,Pn as N,Pt as ie,Qt as P,R as ae,Rn as F,Rt as I,S as oe,Sn as L,Sr as R,St as z,Tn as B,Tt as V,U as H,Un as U,Ut as se,V as W,Vn as G,Vt as K,W as q,Wn as J,Wt as ce,X as le,Xn as ue,Y as de,Yn as fe,Yt as pe,Z as me,_n as he,an as Y,at as ge,bn as _e,cn as ve,ct as ye,dn as be,dt as xe,ea as Se,en as Ce,et as we,g as Te,gt as Ee,ht as De,it as Oe,jn as ke,jt as Ae,kn as je,kt as Me,ln as Ne,lt as Pe,m as Fe,mn as Ie,mt as Le,nn as Re,nt as ze,on as Be,or as Ve,ot as He,pt as Ue,qn as We,qt as Ge,rn as Ke,rt as qe,st as Je,tn as X,tt as Ye,un as Xe,ut as Ze,v as Qe,w as $e,wn as et,wr as tt,wt as nt,xn as rt,yn as it,yt as Z,z as at,zn as ot,zt as st}from"./shortcut-keys-DO4IsVqv.js";import{n as ct,r as lt}from"./react-dom-Bph1y7z7.js";import{A as ut}from"./xyflow-D7n4g6go.js";var Q=e(lt(),1);function dt(e,t={}){let{enabled:n=!0,event:r=`click`,toggle:i=!0,ignoreMouse:a=!1,stickIfOpen:o=!0,touchOpenDelay:c=0,reason:l=he}=t,u=`rootStore`in e?e.rootStore:e,d=u.context.dataRef,p=Q.useRef(void 0),h=Ce(),g=U(),_=Q.useMemo(()=>{function e(e,t,n,r){let i=Y(l,t,n);e&&r===`touch`&&c>0?g.start(c,()=>{u.setOpen(!0,i)}):u.setOpen(e,i)}function t(e,t,n){let r=d.current.openEvent,a=u.select(`domReferenceElement`)!==t;return e&&a||!e||!i?!0:r&&o?!n(r.type):!1}return{onPointerDown(e){p.current=e.pointerType},onMouseDown(n){let i=p.current,o=n.nativeEvent,c=u.select(`open`);if(n.button!==0||r===`click`||m(i,!0)&&a)return;let l=t(c,n.currentTarget,e=>e===`click`||e===`mousedown`),d=f(o);if(s(d)){e(l,o,d,i);return}let g=n.currentTarget;h.request(()=>{e(l,o,g,i)})},onClick(n){if(r===`mousedown-only`)return;let i=p.current;if(r===`mousedown`&&i){p.current=void 0;return}m(i,!0)&&a||e(t(u.select(`open`),n.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),n.nativeEvent,n.currentTarget,i)},onKeyDown(){p.current=void 0}}},[d,r,a,l,u,o,i,h,g,c]);return Q.useMemo(()=>n?{reference:_}:_e,[n,_])}var ft=`Escape`;function pt(e,t,n){switch(e){case`vertical`:return t;case`horizontal`:return n;default:return t||n}}function mt(e,t){return pt(t,e===`ArrowUp`||e===`ArrowDown`,e===`ArrowLeft`||e===`ArrowRight`)}function ht(e,t,n){return pt(t,e===`ArrowDown`,n?e===`ArrowLeft`:e===`ArrowRight`)||e===`Enter`||e===` `||e===``}function gt(e,t,n){return pt(t,n?e===M:e===je,e===u)}function _t(e,t,r,i){return t===`both`||t===`horizontal`&&i?e===ft:pt(t,r?e===je:e===M,e===n)}function vt(e,t){let{listRef:n,activeIndex:r,onNavigate:i=()=>{},enabled:a=!0,selectedIndex:o=null,allowEscape:s=!1,loopFocus:c=!1,nested:l=!1,rtl:u=!1,virtual:p=!1,focusItemOnOpen:m=`auto`,focusItemOnHover:h=!0,openOnArrowKeyDown:_=!0,disabledIndices:v=void 0,orientation:y=`vertical`,parentOrientation:S,id:C,resetOnPointerLeave:w=!0,externalTree:T,grid:E}=t,O=E!=null,k=`rootStore`in e?e.rootStore:e,A=k.useState(`open`),j=k.useState(`floatingElement`),M=k.useState(`domReferenceElement`),N=k.context.dataRef,ie=rt(j),ae=L(M),I=Re(ie),oe=d(),R=re(T),z=Q.useRef(m),V=Q.useRef(o??-1),H=Q.useRef(null),U=Q.useRef(!0),W=X(e=>{i(V.current===-1?null:V.current,e)}),G=Q.useRef(!!j),K=Q.useRef(A),q=Q.useRef(!1),J=Q.useRef(!1),le=Q.useRef(null),ue=Re(v),de=Re(A),fe=Re(o),pe=Re(w),me=Ce(),he=Ce(),ge=X(()=>{function e(e){p?R?.events.emit(`virtualfocus`,e):le.current=te(e,{sync:q.current,preventScroll:!0})}let t=n.current[V.current],r=J.current;t&&e(t),(q.current?e=>e():e=>me.request(e))(()=>{let i=n.current[V.current]||t;i&&(t||e(i),Te&&(r||!U.current)&&i.scrollIntoView?.({block:`nearest`,inline:`nearest`}))})});g(()=>{N.current.orientation=y},[N,y]),g(()=>{a&&(A&&j?(V.current=o??-1,z.current&&o!=null&&(J.current=!0,W())):G.current&&(V.current=-1,W()))},[a,A,j,o,W]),g(()=>{if(a){if(!A){q.current=!1;return}if(j)if(r==null){if(q.current=!1,fe.current!=null)return;if(G.current&&(V.current=-1,ge()),(!K.current||!G.current)&&z.current&&(H.current!=null||z.current===!0&&H.current==null)){let e=0,t=()=>{n.current[0]==null?(e<2&&(e?e=>he.request(e):queueMicrotask)(t),e+=1):(V.current=H.current==null||ht(H.current,y,u)||l?ce(n):se(n),H.current=null,W())};t()}}else D(n.current,r)||(V.current=r,ge(),J.current=!1)}},[a,A,j,r,fe,l,n,y,u,W,ge,he]),g(()=>{if(!a||j||!R||p||!G.current)return;let e=R.nodesRef.current,t=e.find(e=>e.id===oe)?.context?.elements.floating,n=et(P(M??t??null)),r=e.some(e=>e.context&&B(e.context.elements.floating,n));t&&!r&&U.current&&t.focus({preventScroll:!0})},[a,j,M,R,oe,p]),g(()=>{K.current=A,G.current=!!j}),g(()=>{A||(H.current=null,z.current=m)},[A,m]);let _e=r!=null,ye=X(e=>{if(!de.current)return;let t=n.current.indexOf(e.currentTarget);t!==-1&&(V.current!==t||r!==t)&&(V.current=t,W(e))}),xe=X(()=>S??R?.nodesRef.current.find(e=>e.id===oe)?.context?.dataRef?.current.orientation),Se=X(()=>ce(n,ue.current)),we=X(e=>{if(U.current=!1,q.current=!0,e.which===229||!de.current&&e.currentTarget===I.current)return;if(l&&_t(e.key,y,u,O)){mt(e.key,xe())||F(e),k.setOpen(!1,Y(be,e.nativeEvent)),ne(M)&&(p?R?.events.emit(`virtualfocus`,M):M.focus());return}let t=V.current,r=ce(n,v),i=se(n,v);if(ae||(e.key===`Home`&&(F(e),V.current=r,W(e)),e.key===`End`&&(F(e),V.current=i,W(e))),E!=null){let t=E(e,V.current,n,y,c,u,v,r,i);if(t!=null&&(V.current=t,W(e)),y===`both`)return}if(mt(e.key,y)){if(F(e),A&&!p&&et(e.currentTarget.ownerDocument)===e.currentTarget){V.current=ht(e.key,y,u)?r:i,W(e);return}ht(e.key,y,u)?c?t>=i?s&&t!==n.current.length?V.current=-1:(q.current=!1,V.current=r):V.current=b(n.current,{startingIndex:t,disabledIndices:v}):V.current=Math.min(i,b(n.current,{startingIndex:t,disabledIndices:v})):c?t<=r?s&&t!==-1?V.current=n.current.length:(q.current=!1,V.current=i):V.current=b(n.current,{startingIndex:t,decrement:!0,disabledIndices:v}):V.current=Math.max(r,b(n.current,{startingIndex:t,decrement:!0,disabledIndices:v})),D(n.current,V.current)&&(V.current=-1),W(e)}}),Te=Q.useMemo(()=>({onFocus(e){q.current=!0,ye(e)},onClick:({currentTarget:e})=>e.focus({preventScroll:!0}),onMouseMove(e){q.current=!0,J.current=!1,h&&ye(e)},onPointerLeave(e){if(!de.current||!U.current||e.pointerType===`touch`)return;q.current=!0;let t=e.relatedTarget;if(!(!h||n.current.includes(t))&&pe.current&&(le.current?.(),le.current=null,V.current=-1,W(e),!p)){let e=I.current,t=et(P(e));e&&B(e,t)&&e.focus({preventScroll:!0})}}}),[ye,de,I,h,n,W,pe,p]),Ee=Q.useMemo(()=>p&&A&&_e&&{"aria-activedescendant":`${C}-${r}`},[p,A,_e,C,r]),De=Q.useMemo(()=>({"aria-orientation":y===`both`?void 0:y,...ae?{}:Ee,onKeyDown(e){if(e.key===`Tab`&&e.shiftKey&&A&&!p){let t=f(e.nativeEvent);if(t&&!B(I.current,t))return;F(e),k.setOpen(!1,Y(ve,e.nativeEvent)),ne(M)&&M.focus();return}we(e)},onPointerMove(){U.current=!0}}),[Ee,we,I,y,ae,k,A,p,M]),Oe=Q.useMemo(()=>{function e(e){k.setOpen(!0,Y(be,e.nativeEvent,e.currentTarget))}function t(e){m===`auto`&&x(e.nativeEvent)&&(z.current=!p)}function n(e){z.current=m,m===`auto`&&ee(e.nativeEvent)&&(z.current=!0)}return{onKeyDown(t){let n=k.select(`open`);U.current=!1;let r=t.key.startsWith(`Arrow`),i=gt(t.key,xe(),u),a=mt(t.key,y),o=(l?i:a)||t.key===`Enter`||t.key.trim()===``;if(p&&n)return we(t);if(!(!n&&!_&&r)){if(o){let e=mt(t.key,xe());H.current=l&&e?null:t.key}if(l){i&&(F(t),n?(V.current=Se(),W(t)):e(t));return}a&&(fe.current!=null&&(V.current=fe.current),F(t),!n&&_?e(t):we(t),n&&W(t))}},onFocus(e){k.select(`open`)&&!p&&(V.current=-1,W(e))},onPointerDown:n,onPointerEnter:n,onMouseDown:t,onClick:t}},[we,m,Se,l,W,k,_,y,xe,u,fe,p]),ke=Q.useMemo(()=>({...Ee,...Oe}),[Ee,Oe]);return Q.useMemo(()=>a?{reference:ke,floating:De,item:Te,trigger:Oe}:{},[a,ke,De,Oe,Te])}function yt(e,t){let{listRef:n,elementsRef:r,activeIndex:i,onMatch:a,disabledIndices:o,onTyping:s,enabled:c=!0,resetMs:l=750,selectedIndex:u=null}=t,d=`rootStore`in e?e.rootStore:e,f=d.useState(`open`),p=U(),m=Q.useRef(``),h=Q.useRef(u??i??-1),v=Q.useRef(null),y=X(e=>{function t(e){let t=r?.current[e];return!t||_(t)}function c(e){return t(e)?o==null||!Ge(it,e,o):!1}function d(e,t,n=0){if(e.length===0)return-1;let r=(n%e.length+e.length)%e.length,i=t.toLowerCase();for(let t=0;t<e.length;t+=1){let n=(r+t)%e.length;if(!(!e[n]?.toLowerCase().startsWith(i)||!c(n)))return n}return-1}let g=n.current;if(m.current.length>0&&e.key===` `&&(F(e),s?.(!0)),m.current.length>0&&m.current[0]!==` `&&d(g,m.current)===-1&&e.key!==` `&&s?.(!1),g==null||e.key.length!==1||e.ctrlKey||e.metaKey||e.altKey)return;f&&e.key!==` `&&(F(e),s?.(!0));let y=m.current===``;y&&(h.current=u??i??-1),g.every((e,t)=>e&&c(t)?e[0]?.toLowerCase()!==e[1]?.toLowerCase():!0)&&m.current===e.key&&(m.current=``,h.current=v.current),m.current+=e.key,p.start(l,()=>{m.current=``,h.current=v.current,s?.(!1)});let b=((y?u??i??-1:h.current)??0)+1,x=d(g,m.current,b);x===-1?e.key!==` `&&(m.current=``,s?.(!1)):(a?.(x),v.current=x)}),b=X(e=>{let t=e.relatedTarget,n=d.select(`domReferenceElement`),r=d.select(`floatingElement`);B(n,t)||B(r,t)||(p.clear(),m.current=``,h.current=v.current,s?.(!1))});g(()=>{!f&&u!==null||(p.clear(),v.current=null,m.current!==``&&(m.current=``))},[f,u,p]),g(()=>{f&&m.current===``&&(h.current=u??i??-1)},[f,u,i]);let x=Q.useMemo(()=>({onKeyDown:y,onBlur:b}),[y,b]);return Q.useMemo(()=>c?{reference:x,floating:x}:{},[c,x])}var bt=Q.forwardRef(function(e,t){let{className:n,render:r,orientation:i=`horizontal`,style:a,...o}=e;return A(`div`,e,{state:{orientation:i},ref:t,props:[{role:`separator`,"aria-orientation":i},o]})}),$=ut();function xt(e){let t=Q.useRef(``),n=Q.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:Q.useCallback(n=>{if(n.detail===0){e(n,`keyboard`);return}`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``},[e]),onPointerDown:n}}function St(e,t){let n=Q.useRef(e),r=X(t);g(()=>{n.current!==e&&r(n.current)},[e,r]),g(()=>{n.current=e},[e])}function Ct(e,t){let{onClick:n,onPointerDown:r}=xt(X((n,r)=>{(typeof e==`function`?e():e)||t(r||(G?`touch`:``))}));return Q.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function wt(e){let[t,n]=Q.useState(null),r=Ct(e,n);return St(e,t=>{t&&!e&&n(null)}),Q.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}function Tt({icon:e,wellClassName:t,wellStyle:n,title:r,badge:i,subtitle:a,leading:o,actions:s,sticky:l=!1,className:u,dataSlot:d=`detail-header`}){return(0,$.jsxs)(`header`,{className:c(fe,l&&`sticky top-0 z-10`,u),"data-slot":d,children:[o?(0,$.jsxs)(`div`,{className:`-ml-2 flex h-full shrink-0 items-stretch`,children:[o,(0,$.jsx)(`span`,{className:`w-px shrink-0 self-stretch bg-border/60`,"aria-hidden":!0})]}):null,(0,$.jsxs)(`div`,{className:`flex min-w-0 flex-1 items-center gap-2`,children:[(0,$.jsx)(`span`,{className:c(Ve,`flex shrink-0 items-center justify-center`,R(t??`text-muted-foreground`)),style:n?.color?{color:n.color}:void 0,"aria-hidden":!0,children:e}),(0,$.jsx)(`h2`,{className:c(ue,`leading-none`),children:r}),i?(0,$.jsx)(`div`,{className:`flex min-w-0 shrink-0 items-center gap-2 leading-none`,children:i}):null,a?(0,$.jsx)(`div`,{className:`flex min-w-0 items-center gap-1.5 leading-none`,children:a}):null]}),s?(0,$.jsx)(`div`,{className:`flex h-full shrink-0 items-stretch`,children:s}):null]})}var Et=Q.createContext(void 0);function Dt(e){let t=Q.useContext(Et);if(t===void 0&&!e)throw Error(J(33));return t}var Ot=Q.createContext(void 0);function kt(e){let t=Q.useContext(Ot);if(t===void 0&&!e)throw Error(J(36));return t}var At=Q.createContext(void 0);function jt(e=!0){let t=Q.useContext(At);if(t===void 0&&!e)throw Error(J(25));return t}var Mt=Q.createContext(void 0);function Nt(){let e=Q.useContext(Mt);if(e===void 0)throw Error(J(30));return e}function Pt(e){let{closeOnClick:t,highlighted:n,id:r,nodeId:i,store:a,typingRef:o,itemRef:s,itemMetadata:c}=e,{events:l}=a.useState(`floatingTreeRoot`),u=a.useState(`open`),d=jt(!0),f=d!==void 0;return Q.useMemo(()=>({id:r,role:`menuitem`,tabIndex:u&&n?0:-1,onKeyDown(e){e.key===` `&&o?.current&&e.preventDefault()},onMouseMove(e){i&&l.emit(`itemhover`,{nodeId:i,target:e.currentTarget})},onClick(e){t&&l.emit(`close`,{domEvent:e,reason:Xe})},onMouseUp(e){if(d){let t=d.initialCursorPointRef.current;if(d.initialCursorPointRef.current=null,f&&t&&Math.abs(e.clientX-t.x)<=1&&Math.abs(e.clientY-t.y)<=1||f&&!y&&e.button===2)return}s.current&&a.context.allowMouseUpTriggerRef.current&&(!f||e.button===2)&&(!c||c.type===`regular-item`)&&s.current.click()}}),[t,n,r,l,i,u,a,o,s,d,f,c])}var Ft={type:`regular-item`};function It(e){let{closeOnClick:t,disabled:n=!1,highlighted:r,id:i,store:a,typingRef:s=a.context.typingRef,nativeButton:c,itemMetadata:l,nodeId:u}=e,d=a.useState(`disabled`),f=n||d,p=Q.useRef(null),{getButtonProps:m,buttonRef:h}=o({disabled:f,focusableWhenDisabled:!0,native:c,composite:!0}),g=Pt({closeOnClick:t,highlighted:r,id:i,nodeId:u,store:a,typingRef:s,itemRef:p,itemMetadata:l}),_=Q.useCallback(e=>ie(g,{onMouseEnter(){l.type===`submenu-trigger`&&l.setActive()}},e,m),[g,m,l]),v=Ke(p,h);return Q.useMemo(()=>({getItemProps:_,itemRef:v}),[_,v])}var Lt=Q.createContext({register:()=>{},unregister:()=>{},subscribeMapChange:()=>()=>{},elementsRef:{current:[]},nextIndexRef:{current:0}});function Rt(){return Q.useContext(Lt)}var zt=function(e){return e[e.None=0]=`None`,e[e.GuessFromOrder=1]=`GuessFromOrder`,e}({});function Bt(e={}){let{label:t,metadata:n,textRef:r,indexGuessBehavior:i,index:a}=e,{register:o,unregister:s,subscribeMapChange:c,elementsRef:l,labelsRef:u,nextIndexRef:d}=Rt(),f=Q.useRef(-1),[p,m]=Q.useState(a??(i===zt.GuessFromOrder?()=>{if(f.current===-1){let e=d.current;d.current+=1,f.current=e}return f.current}:-1)),h=Q.useRef(null),_=Q.useCallback(e=>{if(h.current=e,p!==-1&&e!==null&&(l.current[p]=e,u)){let n=t!==void 0;u.current[p]=n?t:r?.current?.textContent??e.textContent}},[p,l,u,t,r]);return g(()=>{if(a!=null)return;let e=h.current;if(e)return o(e,n),()=>{s(e)}},[a,o,s,n]),g(()=>{if(a==null)return c(e=>{let t=h.current?e.get(h.current)?.index:null;t!=null&&m(t)})},[a,c,m]),{ref:_,index:p}}var Vt=function(e){return e.checked=`data-checked`,e.unchecked=`data-unchecked`,e.disabled=`data-disabled`,e.highlighted=`data-highlighted`,e}({}),Ht={checked(e){return e?{[Vt.checked]:``}:{[Vt.unchecked]:``}},...Ue},Ut=Q.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,checked:l,defaultChecked:u,onCheckedChange:d,style:f,...p}=e,m=Bt({label:a}),h=Dt(!0),g=q(i),{store:_}=kt(),v=_.useState(`isActive`,m.index),y=_.useState(`itemProps`),[b,x]=j({controlled:l,default:u??!1,name:`MenuCheckboxItem`,state:`checked`}),{getItemProps:S,itemRef:C}=It({closeOnClick:c,disabled:s,highlighted:v,id:g,store:_,nativeButton:o,nodeId:h?.context.nodeId,itemMetadata:Ft}),w=Q.useMemo(()=>({disabled:s,highlighted:v,checked:b}),[s,v,b]);function T(e){let t=Y(Xe,e.nativeEvent,void 0,{preventUnmountOnClose(){}});d?.(!b,t),!t.isCanceled&&x(e=>!e)}let E=A(`div`,e,{state:w,stateAttributesMapping:Ht,props:[y,{role:`menuitemcheckbox`,"aria-checked":b,onClick:T},p,S],ref:[C,t,m.ref]});return(0,$.jsx)(Mt.Provider,{value:w,children:E})}),Wt=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=Nt(),c=Q.useRef(null),{transitionStatus:l,setMounted:u}=Le(s.checked);Ze({open:s.checked,ref:c,onComplete(){s.checked||u(!1)}});let d={checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l};return A(`span`,e,{state:d,ref:[t,c],stateAttributesMapping:Ht,props:{"aria-hidden":!0,...o},enabled:a||s.checked})}),Gt=Q.createContext(void 0);function Kt(){let e=Q.useContext(Gt);if(e===void 0)throw Error(J(31));return e}var qt=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,...a}=e,[o,s]=Q.useState(void 0),c=A(`div`,e,{ref:t,props:{role:`group`,"aria-labelledby":o,...a}});return(0,$.jsx)(Gt.Provider,{value:s,children:c})}),Jt=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,id:a,...o}=e,s=q(a),c=Kt();return g(()=>(c(s),()=>{c(void 0)}),[c,s]),A(`div`,e,{ref:t,props:{id:s,role:`presentation`,...o}})}),Yt=Q.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!0,style:l,...u}=e,d=Bt({label:a}),f=Dt(!0),p=q(i),{store:m}=kt(),h=m.useState(`isActive`,d.index),g=m.useState(`itemProps`),{getItemProps:_,itemRef:v}=It({closeOnClick:c,disabled:s,highlighted:h,id:p,store:m,nativeButton:o,nodeId:f?.context.nodeId,itemMetadata:Ft});return A(`div`,e,{state:{disabled:s,highlighted:h},props:[g,u,_],ref:[v,t,d.ref]})}),Xt=Q.createContext(void 0);function Zt(e){let t=Q.useContext(Xt);if(t===void 0&&!e)throw Error(J(69));return t}var Qt={...h,...Ue},$t=Q.forwardRef(function(e,t){let{render:n,className:r,style:a,finalFocus:o,...s}=e,{store:c}=kt(),{side:u,align:d}=Dt(),f=Zt(!0)!=null,p=c.useState(`open`),m=c.useState(`transitionStatus`),h=c.useState(`popupProps`),g=c.useState(`mounted`),_=c.useState(`instantType`),v=c.useState(`activeTriggerElement`),y=c.useState(`parent`),b=c.useState(`lastOpenChangeReason`),x=c.useState(`rootId`),S=c.useState(`floatingRootContext`),C=c.useState(`floatingTreeRoot`),w=c.useState(`closeDelay`),T=c.useState(`activeTriggerElement`),E=c.useState(`hoverEnabled`),D=c.useState(`disabled`),ee=c.useState(`openMethod`),te=y.type===`context-menu`;Ze({open:p,ref:c.context.popupRef,onComplete(){p&&c.context.onOpenChangeComplete?.(!0)}}),Q.useEffect(()=>{function e(e){c.setOpen(!1,Y(e.reason,e.domEvent))}return C.events.on(`close`,e),()=>{C.events.off(`close`,e)}},[C.events,c]),le(S,{enabled:E&&!D&&!te&&y.type!==`menubar`,closeDelay:w});let O=Q.useCallback(e=>{c.set(`popupElement`,e)},[c]),k={transitionStatus:m,side:u,align:d,open:p,nested:y.type===`menu`,instant:_},ne=A(`div`,e,{state:k,ref:[t,c.context.popupRef,O],stateAttributesMapping:Qt,props:[h,{onKeyDown(e){f&&Qe.has(e.key)&&e.stopPropagation()}},i(m),s,{"data-rootownerid":x}]}),j=y.type===void 0||te;return(v||y.type===`menubar`&&b!==`outside-press`)&&(j=!0),(0,$.jsx)(l,{context:S,openInteractionType:ee,modal:te,disabled:!g,returnFocus:o===void 0?j:o,initialFocus:y.type!==`menu`,restoreFocus:!0,externalTree:y.type===`menubar`?void 0:C,previousFocusableElement:T,nextFocusableElement:y.type===void 0?c.context.triggerFocusTargetRef:void 0,beforeContentFocusGuardRef:y.type===void 0?c.context.beforeContentFocusGuardRef:void 0,children:ne})}),en=Q.createContext(void 0);function tn(){let e=Q.useContext(en);if(e===void 0)throw Error(J(32));return e}var nn=Q.forwardRef(function(e,t){let{keepMounted:n=!1,...i}=e,{store:a}=kt();return a.useState(`mounted`)||n?(0,$.jsx)(en.Provider,{value:n,children:(0,$.jsx)(r,{ref:t,...i})}):null});function rn(e){let{children:t,elementsRef:n,labelsRef:r,onMapChange:i}=e,a=X(i),o=Q.useRef(0),s=w(on).current,c=w(an).current,[l,u]=Q.useState(0),d=Q.useRef(l),f=X((e,t)=>{c.set(e,t??null),d.current+=1,u(d.current)}),p=X(e=>{c.delete(e),d.current+=1,u(d.current)}),m=Q.useMemo(()=>{let e=new Map;return Array.from(c.keys()).filter(e=>e.isConnected).sort(sn).forEach((t,n)=>{let r=c.get(t)??{};e.set(t,{...r,index:n})}),e},[c,l]);g(()=>{if(typeof MutationObserver!=`function`||m.size===0)return;let e=new MutationObserver(e=>{let t=new Set,n=e=>t.has(e)?t.delete(e):t.add(e);e.forEach(e=>{e.removedNodes.forEach(n),e.addedNodes.forEach(n)}),t.size===0&&(d.current+=1,u(d.current))});return m.forEach((t,n)=>{n.parentElement&&e.observe(n.parentElement,{childList:!0})}),()=>{e.disconnect()}},[m]),g(()=>{d.current===l&&(n.current.length!==m.size&&(n.current.length=m.size),r&&r.current.length!==m.size&&(r.current.length=m.size),o.current=m.size),a(m)},[a,m,n,r,l]),g(()=>()=>{n.current=[]},[n]),g(()=>()=>{r&&(r.current=[])},[r]);let h=X(e=>(s.add(e),()=>{s.delete(e)}));g(()=>{s.forEach(e=>e(m))},[s,m]);let _=Q.useMemo(()=>({register:f,unregister:p,subscribeMapChange:h,elementsRef:n,labelsRef:r,nextIndexRef:o}),[f,p,h,n,r,o]);return(0,$.jsx)(Lt.Provider,{value:_,children:t})}function an(){return new Map}function on(){return new Set}function sn(e,t){let n=e.compareDocumentPosition(t);return n&Node.DOCUMENT_POSITION_FOLLOWING||n&Node.DOCUMENT_POSITION_CONTAINED_BY?-1:n&Node.DOCUMENT_POSITION_PRECEDING||n&Node.DOCUMENT_POSITION_CONTAINS?1:0}var cn=20;function ln(e,t,n,r){let[i,a]=Q.useState(!1);g(()=>{if(!e||!t||n==null){a(!1);return}let r=P(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-cn)},[e,t,n]),Fe(e&&(!t||i),r)}var un=Q.forwardRef(function(e,t){let{anchor:n,positionMethod:r=`absolute`,className:i,render:a,side:o,align:s,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=Ae,style:_,...y}=e,{store:b}=kt(),x=tn(),S=jt(!0),C=b.useState(`parent`),w=b.useState(`floatingRootContext`),T=b.useState(`floatingTreeRoot`),E=b.useState(`mounted`),D=b.useState(`open`),ee=b.useState(`modal`),te=b.useState(`openMethod`),O=b.useState(`activeTriggerElement`),ne=b.useState(`transitionStatus`),A=b.useState(`positionerElement`),j=b.useState(`instantType`),M=b.useState(`hasViewport`),re=b.useState(`lastOpenChangeReason`),N=b.useState(`floatingNodeId`),ie=b.useState(`floatingParentNodeId`),P=w.useState(`domReferenceElement`),F=Q.useRef(null),I=xe(A,!1,!1),oe=n,L=c,R=l,z=s,B=h;C.type===`context-menu`&&(oe=n??C.context?.anchor,z??=`start`,!o&&z!==`center`&&(R=e.alignOffset??2,L=e.sideOffset??-5));let V=o,H=z;C.type===`menu`?(V??=`inline-end`,H??=`start`,B=e.collisionAvoidance??k):C.type===`menubar`&&(V??=C.context.orientation===`vertical`?`inline-end`:`bottom`,H??=`start`);let se=C.type===`context-menu`,G=W({anchor:oe,floatingRootContext:w,positionMethod:S?`fixed`:r,mounted:E,side:V,sideOffset:L,align:H,alignOffset:R,arrowPadding:se?0:f,collisionBoundary:u,collisionPadding:d,sticky:p,nodeId:N,keepMounted:x,disableAnchorTracking:m,collisionAvoidance:B,shiftCrossAxis:se&&!(`side`in B&&B.side===`flip`),externalTree:T,adaptiveOrigin:M?v:void 0});Q.useEffect(()=>{function e(e){e.open&&(e.parentNodeId===N&&b.set(`hoverEnabled`,!1),e.nodeId!==N&&e.parentNodeId===b.select(`floatingParentNodeId`)&&b.setOpen(!1,Y(Ie)))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[b,T.events,N]),Q.useEffect(()=>{if(b.select(`floatingParentNodeId`)==null)return;function e(e){if(e.open||e.nodeId!==b.select(`floatingParentNodeId`))return;let t=e.reason??`sibling-open`;b.setOpen(!1,Y(t))}return T.events.on(`menuopenchange`,e),()=>{T.events.off(`menuopenchange`,e)}},[T.events,b]);let K=U();Q.useEffect(()=>{D||K.clear()},[D,K]),Q.useEffect(()=>{function e(e){if(!(!D||e.nodeId!==b.select(`floatingParentNodeId`)))if(e.target&&O&&O!==e.target){let e=b.select(`closeDelay`);e>0?K.isStarted()||K.start(e,()=>{b.setOpen(!1,Y(Ie))}):b.setOpen(!1,Y(Ie))}else K.clear()}return T.events.on(`itemhover`,e),()=>{T.events.off(`itemhover`,e)}},[T.events,D,O,b,K]),Q.useEffect(()=>{let e={open:D,nodeId:N,parentNodeId:ie,reason:b.select(`lastOpenChangeReason`)};T.events.emit(`menuopenchange`,e)},[T.events,D,b,N,ie]),g(()=>{let e=P,t=F.current;if(e&&(F.current=e),t&&e&&e!==t){b.set(`instantType`,void 0);let e=new AbortController;return I(()=>{b.set(`instantType`,`trigger-change`)},e.signal),()=>{e.abort()}}},[P,I,b]);let q={open:D,side:G.side,align:G.align,anchorHidden:G.anchorHidden,nested:C.type===`menu`,instant:j},J=C.type===`menubar`&&C.context.modal;ln(D&&(J||ee&&re!==`trigger-hover`),te===`touch`,A,O);let ce=at(e,q,{styles:G.positionerStyles,transitionStatus:ne,props:y,refs:[t,b.useStateSetter(`positionerElement`)],hidden:!E,inert:!D}),le=E&&C.type!==`menu`&&(C.type!==`menubar`&&ee&&re!==`trigger-hover`||C.type===`menubar`&&C.context.modal),ue=null;return C.type===`menubar`?ue=C.context.contentElement:C.type===void 0&&(ue=O),(0,$.jsxs)(Et.Provider,{value:G,children:[le&&(0,$.jsx)(Te,{ref:C.type===`context-menu`||C.type===`nested-context-menu`?C.context.internalBackdropRef:null,inert:ae(!D),cutout:ue}),(0,$.jsx)(nt,{id:N,children:(0,$.jsx)(rn,{elementsRef:b.context.itemDomElements,labelsRef:b.context.itemLabels,children:ce})})]})}),dn=Q.createContext(void 0);function fn(){let e=Q.useContext(dn);if(e===void 0)throw Error(J(34));return e}var pn=Q.memo(Q.forwardRef(function(e,t){let{render:n,className:r,value:i,defaultValue:a,onValueChange:o,disabled:s=!1,style:c,"aria-labelledby":l,...u}=e,[d,f]=Q.useState(void 0),[p,m]=j({controlled:i,default:a,name:`MenuRadioGroup`}),h=X((e,t)=>{o?.(e,t),!t.isCanceled&&m(e)}),g=A(`div`,e,{state:{disabled:s},ref:t,props:{role:`group`,"aria-labelledby":l??d,"aria-disabled":s||void 0,...u}}),_=Q.useMemo(()=>({value:p,setValue:h,disabled:s}),[p,h,s]);return(0,$.jsx)(Gt.Provider,{value:f,children:(0,$.jsx)(dn.Provider,{value:_,children:g})})})),mn=Q.createContext(void 0);function hn(){let e=Q.useContext(mn);if(e===void 0)throw Error(J(35));return e}var gn=Q.forwardRef(function(e,t){let{render:n,className:r,id:i,label:a,nativeButton:o=!1,disabled:s=!1,closeOnClick:c=!1,value:l,style:u,...d}=e,f=Bt({label:a}),p=Dt(!0),m=q(i),{store:h}=kt(),g=h.useState(`isActive`,f.index),_=h.useState(`itemProps`),{value:v,setValue:y,disabled:b}=fn(),x=b||s,S=v===l,{getItemProps:C,itemRef:w}=It({closeOnClick:c,disabled:x,highlighted:g,id:m,store:h,nativeButton:o,nodeId:p?.context.nodeId,itemMetadata:Ft}),T=Q.useMemo(()=>({disabled:x,highlighted:g,checked:S}),[x,g,S]);function E(e){let t=Y(Xe,e.nativeEvent,void 0,{preventUnmountOnClose(){}});y(l,t)}let D=A(`div`,e,{state:T,stateAttributesMapping:Ht,props:[_,{role:`menuitemradio`,"aria-checked":S,onClick:E},d,C],ref:[w,t,f.ref]});return(0,$.jsx)(mn.Provider,{value:T,children:D})}),_n=Q.forwardRef(function(e,t){let{render:n,className:r,style:i,keepMounted:a=!1,...o}=e,s=hn(),c=Q.useRef(null),{transitionStatus:l,setMounted:u}=Le(s.checked);Ze({open:s.checked,ref:c,onComplete(){s.checked||u(!1)}});let d={checked:s.checked,disabled:s.disabled,highlighted:s.highlighted,transitionStatus:l};return A(`span`,e,{state:d,stateAttributesMapping:Ht,ref:[t,c],props:{"aria-hidden":!0,...o},enabled:a||s.checked})}),vn=Q.createContext(null);function yn(e){let t=Q.useContext(vn);if(t===null&&!e)throw Error(J(5));return t}var bn={...we,disabled:Z(e=>e.parent.type===`menubar`&&e.parent.context.disabled||e.disabled),modal:Z(e=>(e.parent.type===void 0||e.parent.type===`context-menu`)&&(e.modal??!0)),openMethod:Z(e=>e.openMethod),allowMouseEnter:Z(e=>e.allowMouseEnter),highlightItemOnHover:Z(e=>e.highlightItemOnHover),stickIfOpen:Z(e=>e.stickIfOpen),parent:Z(e=>e.parent),rootId:Z(e=>e.parent.type===`menu`?e.parent.store.select(`rootId`):e.parent.type===void 0?e.rootId:e.parent.context.rootId),activeIndex:Z(e=>e.activeIndex),isActive:Z((e,t)=>e.activeIndex===t),hoverEnabled:Z(e=>e.hoverEnabled),instantType:Z(e=>e.instantType),lastOpenChangeReason:Z(e=>e.openChangeReason),floatingTreeRoot:Z(e=>e.parent.type===`menu`?e.parent.store.select(`floatingTreeRoot`):e.floatingTreeRoot),floatingNodeId:Z(e=>e.floatingNodeId),floatingParentNodeId:Z(e=>e.floatingParentNodeId),itemProps:Z(e=>e.itemProps),closeDelay:Z(e=>e.closeDelay),hasViewport:Z(e=>e.hasViewport),keyboardEventRelay:Z(e=>{if(e.keyboardEventRelay)return e.keyboardEventRelay;if(e.parent.type===`menu`)return e.parent.store.select(`keyboardEventRelay`)})},xn=class e extends Ee{constructor(e){super({...Sn(),...e},{positionerRef:Q.createRef(),popupRef:Q.createRef(),typingRef:{current:!1},itemDomElements:{current:[]},itemLabels:{current:[]},allowMouseUpTriggerRef:{current:!1},triggerFocusTargetRef:Q.createRef(),beforeContentFocusGuardRef:Q.createRef(),onOpenChangeComplete:void 0,triggerElements:new Ye},bn),this.unsubscribeParentListener=this.observe(`parent`,e=>{if(this.unsubscribeParentListener?.(),e.type===`menu`){let t=e.store.select(`rootId`),n=e.store.select(`floatingTreeRoot`),r=e.store.select(`keyboardEventRelay`);this.unsubscribeParentListener=e.store.subscribe(()=>{let i=e.store.select(`rootId`),a=e.store.select(`floatingTreeRoot`),o=e.store.select(`keyboardEventRelay`);(t!==i||n!==a||r!==o)&&(t=i,n=a,r=o,this.notifyAll())}),this.context.allowMouseUpTriggerRef=e.store.context.allowMouseUpTriggerRef;return}e.type!==void 0&&(this.context.allowMouseUpTriggerRef=e.context.allowMouseUpTriggerRef),this.unsubscribeParentListener=null})}setOpen(e,t){this.state.floatingRootContext.context.events.emit(`setOpen`,{open:e,eventDetails:t})}static useStore(t,n){let r=w(()=>new e(n)).current;return t??r}unsubscribeParentListener=null};function Sn(){return{...t(),disabled:!1,modal:!0,openMethod:null,allowMouseEnter:!1,highlightItemOnHover:!0,stickIfOpen:!0,parent:{type:void 0},rootId:void 0,activeIndex:null,hoverEnabled:!0,instantType:void 0,openChangeReason:null,floatingTreeRoot:new Me,floatingNodeId:void 0,floatingParentNodeId:null,itemProps:_e,keyboardEventRelay:void 0,closeDelay:0,hasViewport:!1}}var Cn=Q.createContext(void 0);function wn(){return Q.useContext(Cn)}var Tn=E(function(e){let{children:t,open:n,onOpenChange:r,onOpenChangeComplete:i,defaultOpen:a=!1,disabled:o=!1,modal:s,loopFocus:c=!0,orientation:l=`vertical`,actionsRef:u,closeParentOnEsc:f=!1,handle:m,triggerId:h,defaultTriggerId:_=null,highlightItemOnHover:v=!0}=e,y=jt(!0),b=kt(!0),x=yn(!0),C=wn(),w=Q.useMemo(()=>C&&b?{type:`menu`,store:b.store}:x?{type:`menubar`,context:x}:y&&!b?{type:`context-menu`,context:y}:{type:void 0},[y,b,x,C]),T=xn.useStore(m?.store,{open:a,openProp:n,activeTriggerId:_,triggerIdProp:h,parent:w});He(T,n,a,_),T.useControlledProp(`openProp`,n),T.useControlledProp(`triggerIdProp`,h),T.useContextCallback(`onOpenChangeComplete`,i);let E=S(),D=S(),ee=T.useState(`floatingTreeRoot`),te=p(ee),O=d(),k=T.useState(`open`),ne=T.useState(`activeTriggerElement`),A=T.useState(`positionerElement`),j=T.useState(`hoverEnabled`),M=T.useState(`disabled`),re=T.useState(`lastOpenChangeReason`),N=T.useState(`parent`),P=T.useState(`activeIndex`),ae=T.useState(`payload`),F=T.useState(`floatingParentNodeId`),I=Q.useRef(null),oe=Q.useRef(N.type!==`context-menu`),L=U(),R=Q.useRef(!0),B=U(),se=F!=null,{openMethod:W,triggerProps:G}=wt(k);T.useSyncedValues({disabled:o,highlightItemOnHover:v,modal:N.type===void 0?s:void 0,openMethod:W,rootId:E}),ge(T);let{forceUnmount:K}=Je(k,T,()=>{T.update({allowMouseEnter:!1,stickIfOpen:!0})});g(()=>{y&&!b?T.update({parent:{type:`context-menu`,context:y},floatingNodeId:te,floatingParentNodeId:O}):b&&T.update({floatingNodeId:te,floatingParentNodeId:O})},[y,b,te,O,T]),Q.useEffect(()=>{if(k||(I.current=null),N.type===`context-menu`){if(!k){L.clear(),oe.current=!1;return}L.start(500,()=>{oe.current=!0})}},[L,k,N.type]),g(()=>{!k&&!j&&T.set(`hoverEnabled`,!0)},[k,j,T]);let q=X((e,t)=>{let n=t.reason;if(k===e&&t.trigger===ne&&re===n)return;let i=qe(t);if(!e&&t.trigger==null&&(t.trigger=ne??void 0),r?.(e,t),t.isCanceled)return;T.state.floatingRootContext.dispatchOpenChange(e,t);let a=t.event;if(e===!1&&a?.type===`click`&&a.pointerType===`touch`&&!R.current)return;e&&n===`trigger-focus`?(R.current=!1,B.start(300,()=>{R.current=!0})):(R.current=!0,B.clear());let o=(n===`trigger-press`||n===`item-press`)&&a.detail===0&&a?.isTrusted,s=!e&&(n===`escape-key`||n==null),c={open:e,openChangeReason:n};I.current=t.event??null,Oe(c,e,t.trigger,i()),T.update(c),N.type===`menubar`&&(n===`trigger-focus`||n===`focus-out`||n===`trigger-hover`||n===`list-navigation`||n===`sibling-open`)?T.set(`instantType`,`group`):o||s?T.set(`instantType`,o?`click`:`dismiss`):T.set(`instantType`,void 0)}),J=De({popupStore:T,floatingId:D,nested:O!=null,onOpenChange:q}),ce=J.context.events;Q.useEffect(()=>{let e=({open:e,eventDetails:t})=>q(e,t);return ce.on(`setOpen`,e),()=>{ce?.off(`setOpen`,e)}},[ce,q]);let le=Q.useCallback(()=>{T.setOpen(!1,Y(Ne))},[T]);Q.useImperativeHandle(u,()=>({unmount:K,close:le}),[K,le]);let ue;N.type===`context-menu`&&(ue=N.context),Q.useImperativeHandle(ue?.positionerRef,()=>A,[A]),Q.useImperativeHandle(ue?.actionsRef,()=>({setOpen:q}),[q]);let de=z(J,{enabled:!M,bubbles:{escapeKey:f&&N.type===`menu`},outsidePress(){return N.type!==`context-menu`||I.current?.type===`contextmenu`||oe.current},externalTree:se?ee:void 0}),fe=H(),pe=Q.useCallback(e=>{T.select(`activeIndex`)!==e&&T.set(`activeIndex`,e)},[T]),me=vt(J,{enabled:!M,listRef:T.context.itemDomElements,activeIndex:P,nested:N.type!==void 0,loopFocus:c,orientation:l,parentOrientation:N.type===`menubar`?N.context.orientation:void 0,rtl:fe===`rtl`,disabledIndices:it,onNavigate:pe,openOnArrowKeyDown:N.type!==`context-menu`,externalTree:se?ee:void 0,focusItemOnHover:v}),he=Q.useCallback(e=>{T.context.typingRef.current=e},[T]),ve=yt(J,{enabled:!M,listRef:T.context.itemLabels,elementsRef:T.context.itemDomElements,activeIndex:P,resetMs:500,onMatch:e=>{k&&e!==P&&T.set(`activeIndex`,e)},onTyping:he}),be=Q.useMemo(()=>{let e=ie(ve.reference,me.reference,de.reference,{onMouseMove(){T.set(`allowMouseEnter`,!0)}},G);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=k,e},[T,ve.reference,me.reference,de.reference,G,k]),xe=Q.useMemo(()=>{let e=ie(me.trigger,de.trigger,G);return e[`aria-haspopup`]=`menu`,e[`aria-expanded`]=!1,e},[me.trigger,de.trigger,G]),Se=Q.useMemo(()=>ie(ze,{id:D,role:`menu`,"aria-labelledby":ne?.id,onMouseMove(){T.set(`allowMouseEnter`,!0),N.type===`menu`&&T.set(`hoverEnabled`,!1)},onClick(){T.select(`hoverEnabled`)&&T.set(`hoverEnabled`,!1)},onKeyDown(e){let t=T.select(`keyboardEventRelay`);t&&!e.isPropagationStopped()&&t(e)}},ve.floating,me.floating,de.floating),[ne,D,N.type,T,ve.floating,me.floating,de.floating]),Ce=me.item??_e;ye(T,{floatingRootContext:J,activeTriggerProps:be,inactiveTriggerProps:xe,popupProps:Se,itemProps:Ce});let we=Q.useMemo(()=>({store:T,parent:w}),[T,w]),Te=(0,$.jsx)(Ot.Provider,{value:we,children:typeof t==`function`?t({payload:ae}):t});return N.type===void 0||N.type===`context-menu`?(0,$.jsx)(V,{externalTree:ee,children:Te}):Te});function En(e){let t=e.getBoundingClientRect(),n=O(e);if(ot)return t;let r=n.getComputedStyle(e,`::before`),i=n.getComputedStyle(e,`::after`);if(r.content===`none`&&i.content===`none`)return t;let a=parseFloat(r.width)||0,o=parseFloat(r.height)||0,s=parseFloat(i.width)||0,c=parseFloat(i.height)||0,l=Math.max(t.width,a,s),u=Math.max(t.height,o,c),d=l-t.width,f=u-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}function Dn(e={}){let{highlightItemOnHover:t,highlightedIndex:n,onHighlightedIndexChange:r}=$e(),{ref:i,index:a}=Bt(e),o=n===a,s=Q.useRef(null),c=Ke(i,s);return{compositeProps:{tabIndex:o?0:-1,onFocus(){r(a)},onMouseMove(){let e=s.current;if(!t||!e)return;let n=e.hasAttribute(`disabled`)||e.ariaDisabled===`true`;!o&&!n&&e.focus()}},compositeRef:c,index:a}}function On(e){let{render:t,className:n,style:r,state:i=_e,props:a=it,refs:o=it,metadata:s,stateAttributesMapping:c,tag:l=`div`,...u}=e,{compositeProps:d,compositeRef:f}=Dn({metadata:s});return A(l,e,{state:i,ref:[...o,f],props:[d,...a,u],stateAttributesMapping:c})}function kn(e){if(ne(e)&&e.hasAttribute(`data-rootownerid`))return e.getAttribute(`data-rootownerid`)??void 0;if(!N(e))return kn(ke(e))}var An=e(ct(),1);function jn(e,t){let n=Q.useRef(null);function r(t){An.flushSync(()=>{e.setOpen(!1,Y(ve,t.nativeEvent,t.currentTarget))}),a(n.current)?.focus()}function i(n){let r=e.select(`positionerElement`);if(r&&K(n,r))e.context.beforeContentFocusGuardRef.current?.focus();else{An.flushSync(()=>{e.setOpen(!1,Y(ve,n.nativeEvent,n.currentTarget))});let i=st(e.context.triggerFocusTargetRef.current||t.current);for(;i!==null&&B(r,i);){let e=i;if(i=I(i),i===e)break}i?.focus()}}return{preFocusGuardRef:n,handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function Mn(e){let{enabled:t=!0,mouseDownAction:n,open:r}=e,i=Q.useRef(!1);return Q.useMemo(()=>t?{onMouseDown:e=>{(n===`open`&&!r||n===`close`&&r)&&(i.current=!0,P(e.currentTarget).addEventListener(`click`,()=>{i.current=!1},{once:!0}))},onClick:e=>{i.current&&(i.current=!1,e.preventBaseUIHandler())}}:_e,[t,n,r])}var Nn=2,Pn=We(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:s=!0,id:c,openOnHover:l,delay:u=100,closeDelay:f=0,handle:m,payload:h,...g}=e,_=kt(!0),v=m?.store??_?.store;if(!v)throw Error(J(85));let y=q(c),b=v.useState(`isTriggerActive`,y),x=v.useState(`floatingRootContext`),S=v.useState(`isOpenedByTrigger`,y),w=v.useState(`triggerPopupId`,y),E=Q.useRef(null),D=In(),ee=$e(!0),te=re(),O=Q.useMemo(()=>te??new Me,[te]),k=p(O),ne=d(),{registerTrigger:j,isMountedByThisTrigger:M}=Pe(y,E,v,{payload:h,closeDelay:f,parent:D,floatingTreeRoot:O,floatingNodeId:k,floatingParentNodeId:ne,keyboardEventRelay:ee?.relayKeyboardEvent}),N=D.type===`menubar`,ae=v.useState(`disabled`),F=a||ae||N&&D.context.disabled,{getButtonProps:I,buttonRef:oe}=o({disabled:F,native:s});Q.useEffect(()=>{!S&&D.type===void 0&&(v.context.allowMouseUpTriggerRef.current=!1)},[v,S,D.type]);let L=Q.useRef(null),R=U(),z=X(e=>{if(!L.current)return;R.clear(),v.context.allowMouseUpTriggerRef.current=!1;let t=e.target;if(B(L.current,t)||B(v.select(`positionerElement`),t)||t===L.current||t!=null&&kn(t)===v.select(`rootId`))return;let n=En(L.current);e.clientX>=n.left-Nn&&e.clientX<=n.right+Nn&&e.clientY>=n.top-Nn&&e.clientY<=n.bottom+Nn||O.events.emit(`close`,{domEvent:e,reason:Be})});Q.useEffect(()=>{S&&v.select(`lastOpenChangeReason`)===`trigger-hover`&&P(L.current).addEventListener(`mouseup`,z,{once:!0})},[S,z,v]);let V=N&&D.context.hasSubmenuOpen,H=de(x,{enabled:(l??V)&&!F&&D.type!==`context-menu`&&(!N||V&&!M),handleClose:C({blockPointerEvents:!N}),mouseOnly:!0,move:!1,restMs:D.type===void 0?u:void 0,delay:{close:f},triggerElementRef:E,externalTree:O,isActiveTrigger:b,isClosing:()=>v.select(`transitionStatus`)===`ending`}),se=Fn(S,v.select(`lastOpenChangeReason`)),W=dt(x,{enabled:!F&&D.type!==`context-menu`,event:S&&N?`click`:`mousedown`,toggle:!0,ignoreMouse:!1,stickIfOpen:D.type===void 0&&se}),G=me(x,{enabled:!F&&V}),K=Mn({open:S,enabled:N,mouseDownAction:`open`}),ce=Q.useMemo(()=>ie(G.reference,W.reference),[G.reference,W.reference]),le=v.useState(`triggerProps`,M),{preFocusGuardRef:ue,handlePreFocusGuardFocus:fe,handleFocusTargetFocus:he}=jn(v,E),Y={disabled:F,open:S},ge=[L,t,oe,j,E],ve=[ce,H??_e,le,{"aria-haspopup":`menu`,"aria-controls":w,id:y,onMouseDown:e=>{v.select(`open`)||(R.start(200,()=>{v.context.allowMouseUpTriggerRef.current=!0}),P(e.currentTarget).addEventListener(`mouseup`,z,{once:!0}))}},N?{role:`menuitem`}:{},K,g,I],ye=A(`button`,e,{enabled:!N,stateAttributesMapping:T,state:Y,ref:ge,props:ve});return N?(0,$.jsx)(On,{tag:`button`,render:n,className:r,style:i,state:Y,refs:ge,props:ve,stateAttributesMapping:T}):S?(0,$.jsxs)(Q.Fragment,{children:[(0,$.jsx)(pe,{ref:ue,onFocus:fe},`${y}-pre-focus-guard`),(0,$.jsx)(Q.Fragment,{children:ye},y),(0,$.jsx)(pe,{ref:v.context.triggerFocusTargetRef,onFocus:he},`${y}-post-focus-guard`)]}):(0,$.jsx)(Q.Fragment,{children:ye},y)});function Fn(e,t){let n=U(),[r,i]=Q.useState(!1);return g(()=>{e&&t===`trigger-hover`?(i(!0),n.start(500,()=>{i(!1)})):e||(n.clear(),i(!1))},[e,t,n]),r}function In(){let e=jt(!0),t=kt(!0),n=yn(!0);return Q.useMemo(()=>n?{type:`menubar`,context:n}:e&&!t?{type:`context-menu`,context:e}:{type:void 0},[e,t,n])}function Ln({...e}){return(0,$.jsx)(Tn,{"data-slot":`dropdown-menu`,...e})}function Rn({...e}){return(0,$.jsx)(Pn,{"data-slot":`dropdown-menu-trigger`,...e})}function zn({align:e=`start`,alignOffset:t=0,side:n=`bottom`,sideOffset:r=4,className:i,...a}){return(0,$.jsx)(nn,{children:(0,$.jsx)(un,{className:`isolate z-50 outline-none`,align:e,alignOffset:t,side:n,sideOffset:r,children:(0,$.jsx)($t,{"data-slot":`dropdown-menu-content`,className:c(`cn-menu-target cn-menu-translucent z-50 max-h-(--available-height) w-(--anchor-width) min-w-32 origin-(--transform-origin) overflow-x-hidden overflow-y-auto rounded-lg bg-popover p-1 text-popover-foreground shadow-md ring-1 ring-foreground/10 duration-100 outline-none data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:overflow-hidden data-closed:fade-out-0 data-closed:zoom-out-95`,i),...a})})})}function Bn({...e}){return(0,$.jsx)(qt,{"data-slot":`dropdown-menu-group`,...e})}function Vn({className:e,inset:t,...n}){return(0,$.jsx)(Jt,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:c(`px-1.5 py-1 text-xs font-medium text-muted-foreground data-inset:pl-7`,e),...n})}function Hn({className:e,inset:t,variant:n=`default`,...r}){return(0,$.jsx)(Yt,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:c(`group/dropdown-menu-item relative flex cursor-default items-center gap-1.5 rounded-md px-1.5 py-1 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground data-inset:pl-7 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 data-[variant=destructive]:*:[svg]:text-destructive`,e),...r})}function Un({className:e,children:t,checked:n,inset:r,...i}){return(0,$.jsxs)(Ut,{"data-slot":`dropdown-menu-checkbox-item`,"data-inset":r,className:c(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...i,children:[(0,$.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-checkbox-item-indicator`,children:(0,$.jsx)(Wt,{children:(0,$.jsx)(tt,{icon:Se,size:16,color:`currentColor`,strokeWidth:1.5})})}),t]})}function Wn({...e}){return(0,$.jsx)(pn,{"data-slot":`dropdown-menu-radio-group`,...e})}function Gn({className:e,children:t,inset:n,...r}){return(0,$.jsxs)(gn,{"data-slot":`dropdown-menu-radio-item`,"data-inset":n,className:c(`relative flex cursor-default items-center gap-1.5 rounded-md py-1 pr-8 pl-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground data-inset:pl-7 data-disabled:pointer-events-none data-disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...r,children:[(0,$.jsx)(`span`,{className:`pointer-events-none absolute right-2 flex items-center justify-center`,"data-slot":`dropdown-menu-radio-item-indicator`,children:(0,$.jsx)(_n,{children:(0,$.jsx)(tt,{icon:Se,size:16,color:`currentColor`,strokeWidth:1.5})})}),t]})}function Kn({className:e,...t}){return(0,$.jsx)(bt,{"data-slot":`dropdown-menu-separator`,className:c(`-mx-1 my-1 h-px bg-border`,e),...t})}function qn({className:e,...t}){return(0,$.jsx)(`span`,{"data-slot":`dropdown-menu-shortcut`,className:c(`ml-auto text-xs tracking-widest text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground`,e),...t})}var Jn=`h-8 rounded-none border-0 bg-transparent px-4 text-[12px] shadow-none focus-visible:border-0 focus-visible:ring-0 dark:bg-transparent`,Yn=`h-8 rounded-none border-0 bg-transparent pr-4 pl-9 text-[12px] shadow-none focus-visible:border-0 focus-visible:ring-0 dark:bg-transparent`,Xn=`h-11 flex-1 rounded-none border-0 shadow-none focus-visible:ring-0`;function Zn({label:e,hint:t,className:n,split:r,dense:i=!1,children:a}){return(0,$.jsxs)(`label`,{className:c(`block min-w-0 border-b border-border/50`,r===`start`&&`border-r border-b-0`,r===`end`&&`border-b-0`,n),children:[i?(0,$.jsxs)(`span`,{className:`flex items-baseline justify-between gap-2 px-2 pt-1`,children:[(0,$.jsx)(`span`,{className:`min-w-0 truncate text-[10px] font-semibold tracking-[0.12em] text-muted-foreground uppercase`,children:e}),t?(0,$.jsx)(`span`,{className:`min-w-0 truncate font-mono text-[9px] text-muted-foreground/70`,children:t}):null]}):(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(`span`,{className:`block truncate px-3 pt-1.5 text-[10px] font-semibold tracking-[0.12em] text-muted-foreground uppercase`,children:e}),t?(0,$.jsx)(`span`,{className:`block truncate px-3 font-mono text-[10px] text-muted-foreground/70`,children:t}):null]}),a]})}function Qn({label:e,className:t,children:n}){return(0,$.jsxs)(`label`,{className:c(`flex items-center justify-between gap-3 border-b border-border/50 px-4 py-3`,t),children:[(0,$.jsx)(`span`,{className:`text-[12px] text-foreground`,children:e}),n]})}function $n({active:e,extraCount:t=0,className:n,children:r,type:i=`button`,...a}){return(0,$.jsxs)(`button`,{type:i,className:c(`inline-flex items-center gap-1 rounded-none border-0 bg-transparent px-2 py-1 text-[10px] font-semibold tracking-[0.08em] uppercase shadow-none transition-colors hover:bg-muted/50`,e?`text-foreground`:`text-muted-foreground hover:text-foreground`,n),...a,children:[r,t>0?(0,$.jsx)(`span`,{className:`flex h-3.5 min-w-3.5 items-center justify-center rounded-full bg-foreground/10 px-1 text-[9px] font-semibold tabular-nums`,children:t}):null]})}function er({label:e,hint:t,className:n,children:r}){return(0,$.jsxs)(`div`,{className:c(`border-b border-border/50`,n),children:[(0,$.jsxs)(`div`,{className:`flex items-center gap-3 px-4`,children:[(0,$.jsx)(`p`,{className:`shrink-0 text-[10px] font-semibold tracking-[0.12em] text-muted-foreground uppercase`,children:e}),(0,$.jsx)(`div`,{className:`flex min-w-0 flex-1 items-stretch`,role:`group`,"aria-label":e,children:r})]}),t?(0,$.jsx)(`p`,{className:`px-4 pb-2 text-[10px] text-muted-foreground`,children:t}):null]})}function tr({active:e,onClick:t,children:n}){return(0,$.jsx)(`button`,{type:`button`,"aria-pressed":e,onClick:t,className:c(`inline-flex h-8 min-w-0 flex-1 items-center justify-center px-2 font-mono text-[10px] font-semibold outline-none select-none`,`focus-visible:ring-2 focus-visible:ring-ring/50 focus-visible:ring-inset`,e?`bg-muted text-foreground`:`text-muted-foreground hover:text-foreground`),children:n})}function nr({split:e=!1,className:t,variant:n=`ghost`,...r}){return(0,$.jsx)(oe,{variant:n,className:c(Xn,e&&`border-r border-border/50`,t),...r})}function rr({children:e,slot:t}){return(0,$.jsx)(`p`,{className:`border-b border-border/50 px-4 py-3 text-[11px] text-destructive`,role:`alert`,"data-slot":t,children:e})}function ir({label:e,hint:t,children:n}){return(0,$.jsxs)(`div`,{className:`flex items-center justify-between gap-3 border-b border-border/50 bg-muted/25 px-4 py-1.5`,children:[(0,$.jsxs)(`div`,{className:`flex min-w-0 items-baseline gap-3`,children:[(0,$.jsx)(`p`,{className:`text-[10px] font-semibold tracking-[0.12em] text-foreground uppercase`,children:e}),t?(0,$.jsx)(`p`,{className:`truncate text-[10px] text-muted-foreground`,children:t}):null]}),n]})}function ar({children:e}){return(0,$.jsx)(`div`,{className:`grid grid-cols-2 border-b border-border/50`,children:e})}function or({columns:e=4,children:t}){let n=Q.Children.count(t),r=Math.min(e,n);return(0,$.jsx)(`div`,{className:`@container w-full min-w-0 max-w-full`,children:(0,$.jsx)(`div`,{className:c(`grid w-full min-w-0 grid-cols-1`,r>=2&&`@min-[18rem]:grid-cols-2`,r>=3&&`@min-[26rem]:grid-cols-3`,r>=4&&`@min-[34rem]:grid-cols-4`,`[&>*]:min-w-0 [&>*]:border-r [&>*]:border-border/50`,r>=2&&`@min-[18rem]:[&>*:nth-child(2n)]:border-r-0`,r>=3&&`@min-[26rem]:[&>*:nth-child(2n)]:border-r @min-[26rem]:[&>*:nth-child(3n)]:border-r-0`,r>=4&&`@min-[34rem]:[&>*:nth-child(2n)]:border-r @min-[34rem]:[&>*:nth-child(3n)]:border-r @min-[34rem]:[&>*:nth-child(4n)]:border-r-0`,r<2&&`[&>*]:border-r-0`,`[&>*:last-child]:border-r-0`),children:t})})}export{Tt as A,Rn as C,Zt as D,rn as E,vt as F,dt as I,St as M,bt as N,zt as O,yt as P,qn as S,ln as T,Hn as _,er as a,Gn as b,nr as c,Qn as d,$n as f,Bn as g,zn as h,tr as i,wt as j,Bt as k,or as l,Un as m,Yn as n,rr as o,Ln as p,ir as r,Zn as s,Jn as t,ar as u,Vn as v,En as w,Kn as x,Wn as y};
|