studiograph 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent/orchestrator.d.ts +10 -0
- package/dist/agent/orchestrator.js +26 -7
- package/dist/agent/orchestrator.js.map +1 -1
- package/dist/agent/skills/sync-configuration.md +4 -29
- package/dist/agent/skills/sync-setup.md +2 -4
- package/dist/agent/tools/graph-tools.d.ts +5 -1
- package/dist/agent/tools/graph-tools.js +161 -9
- package/dist/agent/tools/graph-tools.js.map +1 -1
- package/dist/agent/tools/ops-tools.js +15 -126
- package/dist/agent/tools/ops-tools.js.map +1 -1
- package/dist/agent/tools/permission-tools.d.ts +15 -14
- package/dist/agent/tools/permission-tools.js +65 -128
- package/dist/agent/tools/permission-tools.js.map +1 -1
- package/dist/agent/tools/sync-tools.d.ts +7 -6
- package/dist/agent/tools/sync-tools.js +205 -178
- package/dist/agent/tools/sync-tools.js.map +1 -1
- package/dist/cli/commands/about.d.ts +13 -0
- package/dist/cli/commands/about.js +97 -0
- package/dist/cli/commands/about.js.map +1 -0
- package/dist/cli/commands/clone.d.ts +5 -2
- package/dist/cli/commands/clone.js +131 -62
- package/dist/cli/commands/clone.js.map +1 -1
- package/dist/cli/commands/connector.d.ts +2 -16
- package/dist/cli/commands/connector.js +32 -109
- package/dist/cli/commands/connector.js.map +1 -1
- package/dist/cli/commands/deploy.d.ts +0 -1
- package/dist/cli/commands/deploy.js +13 -103
- package/dist/cli/commands/deploy.js.map +1 -1
- package/dist/cli/commands/init.js +6 -93
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/join.d.ts +3 -2
- package/dist/cli/commands/join.js +142 -97
- package/dist/cli/commands/join.js.map +1 -1
- package/dist/cli/commands/redeploy.js +1 -2
- package/dist/cli/commands/redeploy.js.map +1 -1
- package/dist/cli/commands/serve.d.ts +1 -3
- package/dist/cli/commands/serve.js +29 -109
- package/dist/cli/commands/serve.js.map +1 -1
- package/dist/cli/commands/start.js +1 -1
- package/dist/cli/commands/start.js.map +1 -1
- package/dist/cli/commands/sync-collection.d.ts +14 -0
- package/dist/cli/commands/sync-collection.js +366 -0
- package/dist/cli/commands/sync-collection.js.map +1 -0
- package/dist/cli/commands/sync.d.ts +4 -2
- package/dist/cli/commands/sync.js +529 -94
- package/dist/cli/commands/sync.js.map +1 -1
- package/dist/cli/index.js +15 -30
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/setup-wizard.d.ts +0 -13
- package/dist/cli/setup-wizard.js +6 -81
- package/dist/cli/setup-wizard.js.map +1 -1
- package/dist/core/graph.d.ts +8 -2
- package/dist/core/graph.js +11 -7
- package/dist/core/graph.js.map +1 -1
- package/dist/core/types.d.ts +149 -21
- package/dist/core/types.js +16 -4
- package/dist/core/types.js.map +1 -1
- package/dist/core/workspace-manager.js +1 -5
- package/dist/core/workspace-manager.js.map +1 -1
- package/dist/core/workspace.d.ts +11 -4
- package/dist/core/workspace.js +61 -26
- package/dist/core/workspace.js.map +1 -1
- package/dist/integrations/asana.d.ts +26 -0
- package/dist/integrations/asana.js +77 -0
- package/dist/integrations/asana.js.map +1 -0
- package/dist/integrations/figma-local.d.ts +16 -0
- package/dist/integrations/figma-local.js +10 -0
- package/dist/integrations/figma-local.js.map +1 -0
- package/dist/integrations/figma.d.ts +17 -0
- package/dist/integrations/figma.js +16 -0
- package/dist/integrations/figma.js.map +1 -0
- package/dist/integrations/granola.d.ts +24 -0
- package/dist/integrations/granola.js +59 -0
- package/dist/integrations/granola.js.map +1 -0
- package/dist/integrations/linear.d.ts +14 -0
- package/dist/integrations/linear.js +70 -0
- package/dist/integrations/linear.js.map +1 -0
- package/dist/integrations/paper-local.d.ts +14 -0
- package/dist/integrations/paper-local.js +10 -0
- package/dist/integrations/paper-local.js.map +1 -0
- package/dist/integrations/paper.d.ts +2 -0
- package/dist/integrations/paper.js +10 -0
- package/dist/integrations/paper.js.map +1 -0
- package/dist/integrations/pipedrive.d.ts +26 -0
- package/dist/integrations/pipedrive.js +97 -0
- package/dist/integrations/pipedrive.js.map +1 -0
- package/dist/integrations/registry.d.ts +15 -0
- package/dist/integrations/registry.js +27 -0
- package/dist/integrations/registry.js.map +1 -0
- package/dist/integrations/types.d.ts +34 -0
- package/dist/integrations/types.js +9 -0
- package/dist/integrations/types.js.map +1 -0
- package/dist/mcp/connector-manager.d.ts +45 -31
- package/dist/mcp/connector-manager.js +164 -116
- package/dist/mcp/connector-manager.js.map +1 -1
- package/dist/mcp/server-oauth-provider.d.ts +56 -0
- package/dist/mcp/server-oauth-provider.js +138 -0
- package/dist/mcp/server-oauth-provider.js.map +1 -0
- package/dist/server/chrome/chrome.css +142 -28
- package/dist/server/chrome/chrome.js +46 -220
- package/dist/server/collab-authority.d.ts +70 -0
- package/dist/server/collab-authority.js +218 -0
- package/dist/server/collab-authority.js.map +1 -0
- package/dist/server/collab.d.ts +29 -0
- package/dist/server/collab.js +195 -0
- package/dist/server/collab.js.map +1 -0
- package/dist/server/commit-scheduler.d.ts +39 -0
- package/dist/server/commit-scheduler.js +113 -0
- package/dist/server/commit-scheduler.js.map +1 -0
- package/dist/server/index.d.ts +0 -2
- package/dist/server/index.js +166 -55
- package/dist/server/index.js.map +1 -1
- package/dist/server/routes/auth-api.d.ts +6 -0
- package/dist/server/routes/auth-api.js +78 -0
- package/dist/server/routes/auth-api.js.map +1 -1
- package/dist/server/routes/chat.js +4 -0
- package/dist/server/routes/chat.js.map +1 -1
- package/dist/server/routes/collab.d.ts +6 -0
- package/dist/server/routes/collab.js +10 -0
- package/dist/server/routes/collab.js.map +1 -0
- package/dist/server/routes/git-http.d.ts +23 -0
- package/dist/server/routes/git-http.js +251 -0
- package/dist/server/routes/git-http.js.map +1 -0
- package/dist/server/routes/graph-api.d.ts +6 -2
- package/dist/server/routes/graph-api.js +266 -82
- package/dist/server/routes/graph-api.js.map +1 -1
- package/dist/server/routes/mcp.d.ts +12 -0
- package/dist/server/routes/mcp.js +35 -0
- package/dist/server/routes/mcp.js.map +1 -0
- package/dist/server/routes/permissions-api.d.ts +6 -4
- package/dist/server/routes/permissions-api.js +53 -167
- package/dist/server/routes/permissions-api.js.map +1 -1
- package/dist/server/routes/sync-api.d.ts +26 -0
- package/dist/server/routes/sync-api.js +757 -0
- package/dist/server/routes/sync-api.js.map +1 -0
- package/dist/server/routes/ws.d.ts +9 -0
- package/dist/server/routes/ws.js +131 -0
- package/dist/server/routes/ws.js.map +1 -0
- package/dist/server/session-manager.d.ts +40 -0
- package/dist/server/session-manager.js +132 -0
- package/dist/server/session-manager.js.map +1 -0
- package/dist/server/ws-hub.d.ts +130 -0
- package/dist/server/ws-hub.js +250 -0
- package/dist/server/ws-hub.js.map +1 -0
- package/dist/server/yjs-manager.d.ts +59 -0
- package/dist/server/yjs-manager.js +194 -0
- package/dist/server/yjs-manager.js.map +1 -0
- package/dist/services/auth-service.d.ts +74 -0
- package/dist/services/auth-service.js +286 -6
- package/dist/services/auth-service.js.map +1 -1
- package/dist/services/git.d.ts +6 -0
- package/dist/services/git.js +32 -2
- package/dist/services/git.js.map +1 -1
- package/dist/services/sync/collection-sync.d.ts +73 -0
- package/dist/services/sync/collection-sync.js +726 -0
- package/dist/services/sync/collection-sync.js.map +1 -0
- package/dist/services/sync/commit.js +5 -20
- package/dist/services/sync/commit.js.map +1 -1
- package/dist/services/sync/data-fetcher.d.ts +31 -0
- package/dist/services/sync/data-fetcher.js +12 -0
- package/dist/services/sync/data-fetcher.js.map +1 -0
- package/dist/services/sync/entity-refresh.d.ts +30 -0
- package/dist/services/sync/entity-refresh.js +275 -0
- package/dist/services/sync/entity-refresh.js.map +1 -0
- package/dist/services/sync/frontmatter-extractor.d.ts +2 -2
- package/dist/services/sync/frontmatter-extractor.js +1 -2
- package/dist/services/sync/frontmatter-extractor.js.map +1 -1
- package/dist/services/sync/graph-match.js +1 -1
- package/dist/services/sync/graph-match.js.map +1 -1
- package/dist/services/sync/mcp-client.d.ts +16 -4
- package/dist/services/sync/mcp-client.js +34 -20
- package/dist/services/sync/mcp-client.js.map +1 -1
- package/dist/services/sync/prompts.js +1 -1
- package/dist/services/sync/reconciler.js +1 -2
- package/dist/services/sync/reconciler.js.map +1 -1
- package/dist/services/sync/rest-client.d.ts +40 -0
- package/dist/services/sync/rest-client.js +100 -0
- package/dist/services/sync/rest-client.js.map +1 -0
- package/dist/services/sync/source-config.d.ts +23 -1
- package/dist/services/sync/source-config.js +112 -16
- package/dist/services/sync/source-config.js.map +1 -1
- package/dist/services/sync/source-definitions/asana.d.ts +3 -4
- package/dist/services/sync/source-definitions/asana.js +7 -13
- package/dist/services/sync/source-definitions/asana.js.map +1 -1
- package/dist/services/sync/source-definitions/definitions.d.ts +5 -18
- package/dist/services/sync/source-definitions/definitions.js +4 -22
- package/dist/services/sync/source-definitions/definitions.js.map +1 -1
- package/dist/services/sync/source-definitions/granola.d.ts +1 -1
- package/dist/services/sync/source-definitions/granola.js +11 -18
- package/dist/services/sync/source-definitions/granola.js.map +1 -1
- package/dist/services/sync/source-definitions/linear.d.ts +1 -1
- package/dist/services/sync/source-definitions/linear.js +17 -15
- package/dist/services/sync/source-definitions/linear.js.map +1 -1
- package/dist/services/sync/source-definitions/pipedrive.d.ts +1 -1
- package/dist/services/sync/source-definitions/pipedrive.js +6 -15
- package/dist/services/sync/source-definitions/pipedrive.js.map +1 -1
- package/dist/services/sync/staging.js +1 -2
- package/dist/services/sync/staging.js.map +1 -1
- package/dist/services/sync/structured-extractor.d.ts +8 -2
- package/dist/services/sync/structured-extractor.js +243 -35
- package/dist/services/sync/structured-extractor.js.map +1 -1
- package/dist/services/sync/types.d.ts +192 -23
- package/dist/services/sync/unstructured-extractor.d.ts +1 -3
- package/dist/services/sync/unstructured-extractor.js +2 -14
- package/dist/services/sync/unstructured-extractor.js.map +1 -1
- package/dist/utils/git.d.ts +33 -20
- package/dist/utils/git.js +119 -62
- package/dist/utils/git.js.map +1 -1
- package/dist/utils/preflight.d.ts +1 -15
- package/dist/utils/preflight.js +1 -35
- package/dist/utils/preflight.js.map +1 -1
- package/dist/web/_app/immutable/assets/0.CupILLQs.css +1 -0
- package/dist/web/_app/immutable/assets/3.CtJi4Cy9.css +1 -0
- package/dist/web/_app/immutable/assets/5.CydFyZSu.css +1 -0
- package/dist/web/_app/immutable/assets/6.kqeOo0OW.css +1 -0
- package/dist/web/_app/immutable/assets/7.CseIx7qQ.css +1 -0
- package/dist/web/_app/immutable/assets/8.BYpFDZHK.css +1 -0
- package/dist/web/_app/immutable/assets/AppShell.Ch_ef9hJ.css +1 -0
- package/dist/web/_app/immutable/assets/ChatPanel.CP-_8txt.css +1 -0
- package/dist/web/_app/immutable/chunks/0oxpWEgM.js +1 -0
- package/dist/web/_app/immutable/chunks/B1y7Wy5O.js +18 -0
- package/dist/web/_app/immutable/chunks/B7eduG_j.js +64 -0
- package/dist/web/_app/immutable/chunks/BBLgaWN8.js +1 -0
- package/dist/web/_app/immutable/chunks/BCB5cYCz.js +2 -0
- package/dist/web/_app/immutable/chunks/{aosHekRC.js → BPUy9_sS.js} +1 -1
- package/dist/web/_app/immutable/chunks/BVBRzmeQ.js +7 -0
- package/dist/web/_app/immutable/chunks/{CUzqHQY_.js → BXuvR8Ks.js} +2 -1
- package/dist/web/_app/immutable/chunks/BeBar3OL.js +1 -0
- package/dist/web/_app/immutable/chunks/BuOTIbJu.js +1 -0
- package/dist/web/_app/immutable/chunks/CLFba8FK.js +5 -0
- package/dist/web/_app/immutable/chunks/CQCkXCml.js +1 -0
- package/dist/web/_app/immutable/chunks/CXuhHL4d.js +1 -0
- package/dist/web/_app/immutable/chunks/Cg9NOuOl.js +27 -0
- package/dist/web/_app/immutable/chunks/Cs5oz2oJ.js +5 -0
- package/dist/web/_app/immutable/chunks/Cs_ROD7H.js +2 -0
- package/dist/web/_app/immutable/chunks/D2aTbzFm.js +3 -0
- package/dist/web/_app/immutable/chunks/D4FXhiC2.js +1 -0
- package/dist/web/_app/immutable/chunks/D4VHRYeB.js +1 -0
- package/dist/web/_app/immutable/chunks/DCGSm8Hl.js +1 -0
- package/dist/web/_app/immutable/chunks/DP09rP34.js +2 -0
- package/dist/web/_app/immutable/chunks/DiP47fAp.js +1 -0
- package/dist/web/_app/immutable/chunks/DptGlK8O.js +1 -0
- package/dist/web/_app/immutable/chunks/O0fx2ss6.js +1 -0
- package/dist/web/_app/immutable/chunks/xBRYfpah.js +1 -0
- package/dist/web/_app/immutable/entry/app.FgnywZP_.js +2 -0
- package/dist/web/_app/immutable/entry/start.Bsa-zlPf.js +1 -0
- package/dist/web/_app/immutable/nodes/0.D3SW-LMc.js +10 -0
- package/dist/web/_app/immutable/nodes/1.y0c5TQTP.js +1 -0
- package/dist/web/_app/immutable/nodes/2.BQfSep9-.js +1 -0
- package/dist/web/_app/immutable/nodes/3.CC4Y-xMM.js +11 -0
- package/dist/web/_app/immutable/nodes/{5.BBpmYkAu.js → 4.Dp0Z-oPW.js} +2 -2
- package/dist/web/_app/immutable/nodes/5.gjZ03DON.js +2 -0
- package/dist/web/_app/immutable/nodes/6.dRNIwcJQ.js +1 -0
- package/dist/web/_app/immutable/nodes/7.I4Gjes3o.js +2 -0
- package/dist/web/_app/immutable/nodes/8.Dj14D7uH.js +1 -0
- package/dist/web/_app/version.json +1 -1
- package/dist/web/index.html +10 -12
- package/package.json +12 -2
- package/dist/web/_app/immutable/assets/0.CDbX4Cwz.css +0 -1
- package/dist/web/_app/immutable/assets/3.BJy7pVXi.css +0 -1
- package/dist/web/_app/immutable/assets/4.Ad16uh9o.css +0 -1
- package/dist/web/_app/immutable/assets/6.Bm2i7O0j.css +0 -1
- package/dist/web/_app/immutable/assets/AppShell.D0rmbdqF.css +0 -1
- package/dist/web/_app/immutable/assets/ChatPanel.RFD5GGYI.css +0 -1
- package/dist/web/_app/immutable/assets/editor.CPAf2SRV.css +0 -1
- package/dist/web/_app/immutable/chunks/479TgXB4.js +0 -1
- package/dist/web/_app/immutable/chunks/4QY4j-jX.js +0 -1
- package/dist/web/_app/immutable/chunks/BFb0g4TQ.js +0 -64
- package/dist/web/_app/immutable/chunks/Bopa-Ask.js +0 -1
- package/dist/web/_app/immutable/chunks/COwytaCP.js +0 -1
- package/dist/web/_app/immutable/chunks/DEJSHbC3.js +0 -1
- package/dist/web/_app/immutable/chunks/DNywhIex.js +0 -23
- package/dist/web/_app/immutable/chunks/DTUXhwEY.js +0 -1
- package/dist/web/_app/immutable/chunks/DThXpa0U.js +0 -6
- package/dist/web/_app/immutable/chunks/Dh_H7Owr.js +0 -18
- package/dist/web/_app/immutable/chunks/Dml-u95b.js +0 -2
- package/dist/web/_app/immutable/chunks/DnlgZ_Tk.js +0 -5
- package/dist/web/_app/immutable/chunks/DtVH--hH.js +0 -6
- package/dist/web/_app/immutable/chunks/DvKVaE7M.js +0 -1
- package/dist/web/_app/immutable/chunks/MbiSz-iW.js +0 -2
- package/dist/web/_app/immutable/chunks/bSAC733J.js +0 -1
- package/dist/web/_app/immutable/entry/app.BvodXQQ0.js +0 -2
- package/dist/web/_app/immutable/entry/start.Bkui3Kyw.js +0 -1
- package/dist/web/_app/immutable/nodes/0.DfbCOBhn.js +0 -2
- package/dist/web/_app/immutable/nodes/1.vtxUGpe6.js +0 -1
- package/dist/web/_app/immutable/nodes/2.Cq29oW4h.js +0 -1
- package/dist/web/_app/immutable/nodes/3.SquslPZy.js +0 -1
- package/dist/web/_app/immutable/nodes/4.COV8FR8b.js +0 -16
- package/dist/web/_app/immutable/nodes/6.BBbh6z9I.js +0 -2
- /package/dist/web/_app/immutable/assets/{5.BhKgiXd2.css → 4.BhKgiXd2.css} +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
let re=[],Ee=[];(()=>{let l="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<l.length;e++)(e%2?Ee:re).push(t=t+l[e])})();function Ge(l){if(l<768)return!1;for(let e=0,t=re.length;;){let n=e+t>>1;if(l<re[n])t=n;else if(l>=Ee[n])e=n+1;else return!0;if(e==t)return!1}}function ke(l){return l>=127462&&l<=127487}const ye=8205;function je(l,e,t=!0,n=!0){return(t?Oe:Ze)(l,e,n)}function Oe(l,e,t){if(e==l.length)return e;e&&Me(l.charCodeAt(e))&&Re(l.charCodeAt(e-1))&&e--;let n=ie(l,e);for(e+=Se(n);e<l.length;){let i=ie(l,e);if(n==ye||i==ye||t&&Ge(i))e+=Se(i),n=i;else if(ke(i)){let s=0,r=e-2;for(;r>=0&&ke(ie(l,r));)s++,r-=2;if(s%2==0)break;e+=2}else break}return e}function Ze(l,e,t){for(;e>0;){let n=Oe(l,e-2,t);if(n<e)return n;e--}return 0}function ie(l,e){let t=l.charCodeAt(e);if(!Re(t)||e+1==l.length)return t;let n=l.charCodeAt(e+1);return Me(n)?(t-55296<<10)+(n-56320)+65536:t}function Me(l){return l>=56320&&l<57344}function Re(l){return l>=55296&&l<56320}function Se(l){return l<65536?1:2}class x{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=J(this,e,t);let i=[];return this.decompose(0,e,i,2),n.length&&n.decompose(0,n.length,i,3),this.decompose(t,this.length,i,1),C.from(i,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=J(this,e,t);let n=[];return this.decompose(e,t,n,0),C.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),i=new N(this),s=new N(e);for(let r=t,h=t;;){if(i.next(r),s.next(r),r=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(h+=i.value.length,i.done||h>=n)return!0}}iter(e=1){return new N(this,e)}iterRange(e,t=this.length){return new Te(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;n=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Be(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?x.empty:e.length<=32?new m(e):C.from(m.split(e,[]))}}class m extends x{constructor(e,t=Ke(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,i){for(let s=0;;s++){let r=this.text[s],h=i+r.length;if((t?n:h)>=e)return new Qe(i,h,n,r);i=h+1,n++}}decompose(e,t,n,i){let s=e<=0&&t>=this.length?this:new m(Ie(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let r=n.pop(),h=Z(s.text,r.text.slice(),0,s.length);if(h.length<=32)n.push(new m(h,r.length+s.length));else{let o=h.length>>1;n.push(new m(h.slice(0,o)),new m(h.slice(o)))}}else n.push(s)}replace(e,t,n){if(!(n instanceof m))return super.replace(e,t,n);[e,t]=J(this,e,t);let i=Z(this.text,Z(n.text,Ie(this.text,0,e)),t),s=this.length+n.length-(t-e);return i.length<=32?new m(i,s):C.from(m.split(i,[]),s)}sliceString(e,t=this.length,n=`
|
|
2
|
+
`){[e,t]=J(this,e,t);let i="";for(let s=0,r=0;s<=t&&r<this.text.length;r++){let h=this.text[r],o=s+h.length;s>e&&r&&(i+=n),e<o&&t>s&&(i+=h.slice(Math.max(0,e-s),t-s)),s=o+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],i=-1;for(let s of e)n.push(s),i+=s.length+1,n.length==32&&(t.push(new m(n,i)),n=[],i=-1);return i>-1&&t.push(new m(n,i)),t}}class C extends x{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,i){for(let s=0;;s++){let r=this.children[s],h=i+r.length,o=n+r.lines-1;if((t?o:h)>=e)return r.lineInner(e,t,n,i);i=h+1,n=o+1}}decompose(e,t,n,i){for(let s=0,r=0;r<=t&&s<this.children.length;s++){let h=this.children[s],o=r+h.length;if(e<=o&&t>=r){let a=i&((r<=e?1:0)|(o>=t?2:0));r>=e&&o<=t&&!a?n.push(h):h.decompose(e-r,t-r,n,a)}r=o+1}}replace(e,t,n){if([e,t]=J(this,e,t),n.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let r=this.children[i],h=s+r.length;if(e>=s&&t<=h){let o=r.replace(e-s,t-s,n),a=this.lines-r.lines+o.lines;if(o.lines<a>>4&&o.lines>a>>6){let u=this.children.slice();return u[i]=o,new C(u,this.length-(t-e)+n.length)}return super.replace(s,h,o)}s=h+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=`
|
|
3
|
+
`){[e,t]=J(this,e,t);let i="";for(let s=0,r=0;s<this.children.length&&r<=t;s++){let h=this.children[s],o=r+h.length;r>e&&s&&(i+=n),e<o&&t>r&&(i+=h.sliceString(e-r,t-r,n)),r=o+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof C))return 0;let n=0,[i,s,r,h]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,s+=t){if(i==r||s==h)return n;let o=this.children[i],a=e.children[s];if(o!=a)return n+o.scanIdentical(a,t);n+=o.length+1}}static from(e,t=e.reduce((n,i)=>n+i.length+1,-1)){let n=0;for(let c of e)n+=c.lines;if(n<32){let c=[];for(let g of e)g.flatten(c);return new m(c,t)}let i=Math.max(32,n>>5),s=i<<1,r=i>>1,h=[],o=0,a=-1,u=[];function f(c){let g;if(c.lines>s&&c instanceof C)for(let b of c.children)f(b);else c.lines>r&&(o>r||!o)?(d(),h.push(c)):c instanceof m&&o&&(g=u[u.length-1])instanceof m&&c.lines+g.lines<=32?(o+=c.lines,a+=c.length+1,u[u.length-1]=new m(g.text.concat(c.text),g.length+1+c.length)):(o+c.lines>i&&d(),o+=c.lines,a+=c.length+1,u.push(c))}function d(){o!=0&&(h.push(u.length==1?u[0]:C.from(u,a)),a=-1,o=u.length=0)}for(let c of e)f(c);return d(),h.length==1?h[0]:new C(h,t)}}x.empty=new m([""],0);function Ke(l){let e=-1;for(let t of l)e+=t.length+1;return e}function Z(l,e,t=0,n=1e9){for(let i=0,s=0,r=!0;s<l.length&&i<=n;s++){let h=l[s],o=i+h.length;o>=t&&(o>n&&(h=h.slice(0,n-i)),i<t&&(h=h.slice(t-i)),r?(e[e.length-1]+=h,r=!1):e.push(h)),i=o+1}return e}function Ie(l,e,t){return Z(l,[""],e,t)}class N{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof m?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,i=this.nodes[n],s=this.offsets[n],r=s>>1,h=i instanceof m?i.text.length:i.children.length;if(r==(t>0?h:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
4
|
+
`,this;e--}else if(i instanceof m){let o=i.text[r+(t<0?-1:0)];if(this.offsets[n]+=t,o.length>Math.max(0,e))return this.value=e==0?o:t>0?o.slice(e):o.slice(0,o.length-e),this;e-=o.length}else{let o=i.children[r+(t<0?-1:0)];e>o.length?(e-=o.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(o),this.offsets.push(t>0?1:(o instanceof m?o.text.length:o.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Te{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new N(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=n?i:t<0?i.slice(i.length-n):i.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Be{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(x.prototype[Symbol.iterator]=function(){return this.iter()},N.prototype[Symbol.iterator]=Te.prototype[Symbol.iterator]=Be.prototype[Symbol.iterator]=function(){return this});class Qe{constructor(e,t,n,i){this.from=e,this.to=t,this.number=n,this.text=i}get length(){return this.to-this.from}}function J(l,e,t){return e=Math.max(0,Math.min(l.length,e)),[e,Math.max(e,Math.min(l.length,t))]}function Q(l,e,t=!0,n=!0){return je(l,e,t,n)}function Xe(l){return l>=56320&&l<57344}function Ye(l){return l>=55296&&l<56320}function ft(l,e){let t=l.charCodeAt(e);if(!Ye(t)||e+1==l.length)return t;let n=l.charCodeAt(e+1);return Xe(n)?(t-55296<<10)+(n-56320)+65536:t}function ct(l){return l<=65535?String.fromCharCode(l):(l-=65536,String.fromCharCode((l>>10)+55296,(l&1023)+56320))}function dt(l){return l<65536?1:2}const le=/\r\n?|\n/;var O=(function(l){return l[l.Simple=0]="Simple",l[l.TrackDel=1]="TrackDel",l[l.TrackBefore=2]="TrackBefore",l[l.TrackAfter=3]="TrackAfter",l})(O||(O={}));class E{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t+1];e+=n<0?this.sections[t]:n}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,n=0,i=0;t<this.sections.length;){let s=this.sections[t++],r=this.sections[t++];r<0?(e(n,i,s),i+=s):i+=r,n+=s}}iterChangedRanges(e,t=!1){he(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];i<0?e.push(n,i):e.push(i,n)}return new E(e)}composeDesc(e){return this.empty?e:e.empty?this:Fe(this,e)}mapDesc(e,t=!1){return e.empty?this:oe(this,e,t)}mapPos(e,t=-1,n=O.Simple){let i=0,s=0;for(let r=0;r<this.sections.length;){let h=this.sections[r++],o=this.sections[r++],a=i+h;if(o<0){if(a>e)return s+(e-i);s+=h}else{if(n!=O.Simple&&a>=e&&(n==O.TrackDel&&i<e&&a>e||n==O.TrackBefore&&i<e||n==O.TrackAfter&&a>e))return null;if(a>e||a==e&&t<0&&!h)return e==i||t<0?s:s+o;s+=o}i=a}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,t=e){for(let n=0,i=0;n<this.sections.length&&i<=t;){let s=this.sections[n++],r=this.sections[n++],h=i+s;if(r>=0&&i<=t&&h>=e)return i<e&&h>t?"cover":!0;i=h}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let n=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+n+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new E(e)}static create(e){return new E(e)}}class k extends E{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return he(this,(t,n,i,s,r)=>e=e.replace(i,i+(n-t),r),!1),e}mapDesc(e,t=!1){return oe(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let i=0,s=0;i<t.length;i+=2){let r=t[i],h=t[i+1];if(h>=0){t[i]=h,t[i+1]=r;let o=i>>1;for(;n.length<o;)n.push(x.empty);n.push(r?e.slice(s,s+r):x.empty)}s+=r}return new k(t,n)}compose(e){return this.empty?e:e.empty?this:Fe(this,e,!0)}map(e,t=!1){return e.empty?this:oe(this,e,t,!0)}iterChanges(e,t=!1){he(this,e,t)}get desc(){return E.create(this.sections)}filter(e){let t=[],n=[],i=[],s=new q(this);e:for(let r=0,h=0;;){let o=r==e.length?1e9:e[r++];for(;h<o||h==o&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,o-h);y(i,u,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;y(t,u,f),f>0&&M(n,t,s.text),s.forward(u),h+=u}let a=e[r++];for(;h<a;){if(s.done)break e;let u=Math.min(s.len,a-h);y(t,u,-1),y(i,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),h+=u}}return{changes:new k(t,n),filtered:E.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let n=this.sections[t],i=this.sections[t+1];i<0?e.push(n):i==0?e.push([n]):e.push([n].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,n){let i=[],s=[],r=0,h=null;function o(u=!1){if(!u&&!i.length)return;r<t&&y(i,t-r,-1);let f=new k(i,s);h=h?h.compose(f.map(h)):f,i=[],s=[],r=0}function a(u){if(Array.isArray(u))for(let f of u)a(f);else if(u instanceof k){if(u.length!=t)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${t})`);o(),h=h?h.compose(u.map(h)):u}else{let{from:f,to:d=f,insert:c}=u;if(f>d||f<0||d>t)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${t})`);let g=c?typeof c=="string"?x.of(c.split(n||le)):c:x.empty,b=g.length;if(f==d&&b==0)return;f<r&&o(),f>r&&y(i,f-r,-1),y(i,d-f,b),M(s,i,g),r=d}}return a(e),o(!h),h}static empty(e){return new k(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((r,h)=>h&&typeof r!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;n.length<i;)n.push(x.empty);n[i]=x.of(s.slice(1)),t.push(s[0],n[i].length)}}}return new k(t,n)}static createSet(e,t){return new k(e,t)}}function y(l,e,t,n=!1){if(e==0&&t<=0)return;let i=l.length-2;i>=0&&t<=0&&t==l[i+1]?l[i]+=e:i>=0&&e==0&&l[i]==0?l[i+1]+=t:n?(l[i]+=e,l[i+1]+=t):l.push(e,t)}function M(l,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n<l.length)l[l.length-1]=l[l.length-1].append(t);else{for(;l.length<n;)l.push(x.empty);l.push(t)}}function he(l,e,t){let n=l.inserted;for(let i=0,s=0,r=0;r<l.sections.length;){let h=l.sections[r++],o=l.sections[r++];if(o<0)i+=h,s+=h;else{let a=i,u=s,f=x.empty;for(;a+=h,u+=o,o&&n&&(f=f.append(n[r-2>>1])),!(t||r==l.sections.length||l.sections[r+1]<0);)h=l.sections[r++],o=l.sections[r++];e(i,a,s,u,f),i=a,s=u}}}function oe(l,e,t,n=!1){let i=[],s=n?[]:null,r=new q(l),h=new q(e);for(let o=-1;;){if(r.done&&h.len||h.done&&r.len)throw new Error("Mismatched change set lengths");if(r.ins==-1&&h.ins==-1){let a=Math.min(r.len,h.len);y(i,a,-1),r.forward(a),h.forward(a)}else if(h.ins>=0&&(r.ins<0||o==r.i||r.off==0&&(h.len<r.len||h.len==r.len&&!t))){let a=h.len;for(y(i,h.ins,-1);a;){let u=Math.min(r.len,a);r.ins>=0&&o<r.i&&r.len<=u&&(y(i,0,r.ins),s&&M(s,i,r.text),o=r.i),r.forward(u),a-=u}h.next()}else if(r.ins>=0){let a=0,u=r.len;for(;u;)if(h.ins==-1){let f=Math.min(u,h.len);a+=f,u-=f,h.forward(f)}else if(h.ins==0&&h.len<u)u-=h.len,h.next();else break;y(i,a,o<r.i?r.ins:0),s&&o<r.i&&M(s,i,r.text),o=r.i,r.forward(r.len-u)}else{if(r.done&&h.done)return s?k.createSet(i,s):E.create(i);throw new Error("Mismatched change set lengths")}}}function Fe(l,e,t=!1){let n=[],i=t?[]:null,s=new q(l),r=new q(e);for(let h=!1;;){if(s.done&&r.done)return i?k.createSet(n,i):E.create(n);if(s.ins==0)y(n,s.len,0,h),s.next();else if(r.len==0&&!r.done)y(n,0,r.ins,h),i&&M(i,n,r.text),r.next();else{if(s.done||r.done)throw new Error("Mismatched change set lengths");{let o=Math.min(s.len2,r.len),a=n.length;if(s.ins==-1){let u=r.ins==-1?-1:r.off?0:r.ins;y(n,o,u,h),i&&u&&M(i,n,r.text)}else r.ins==-1?(y(n,s.off?0:s.len,o,h),i&&M(i,n,s.textBit(o))):(y(n,s.off?0:s.len,r.off?0:r.ins,h),i&&!r.off&&M(i,n,r.text));h=(s.ins>o||r.ins>=0&&r.len>o)&&(h||n.length>a),s.forward2(o),r.forward(o)}}}}class q{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?x.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?x.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class B{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,i;return this.empty?n=i=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),n==this.from&&i==this.to?this:new B(n,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return p.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return p.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return p.range(e.anchor,e.head)}static create(e,t,n){return new B(e,t,n)}}class p{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:p.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;n<this.ranges.length;n++)if(!this.ranges[n].eq(e.ranges[n],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new p([this.main],0)}addRange(e,t=!0){return p.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let n=this.ranges.slice();return n[t]=e,p.create(n,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new p(e.ranges.map(t=>B.fromJSON(t)),e.main)}static single(e,t=e){return new p([p.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=n:s.from<n)return p.normalized(e.slice(),t);n=s.to}return new p(e,t)}static cursor(e,t=0,n,i){return B.create(e,e,(t==0?0:t<0?8:16)|(n==null?7:Math.min(6,n))|(i??16777215)<<6)}static range(e,t,n,i){let s=(n??16777215)<<6|(i==null?7:Math.min(6,i));return t<e?B.create(t,e,48|s):B.create(e,t,(t>e?8:0)|s)}static normalized(e,t=0){let n=e[t];e.sort((i,s)=>i.from-s.from),t=e.indexOf(n);for(let i=1;i<e.length;i++){let s=e[i],r=e[i-1];if(s.empty?s.from<=r.to:s.from<r.to){let h=r.from,o=Math.max(s.to,r.to);i<=t&&t--,e.splice(--i,2,s.anchor>s.head?p.range(o,h):p.range(h,o))}}return new p(e,t)}}function Je(l,e){for(let t of l.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let me=0;class A{constructor(e,t,n,i,s){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=i,this.id=me++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new A(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:we),!!e.static,e.enables)}of(e){return new K([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new K(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new K(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}}function we(l,e){return l==e||l.length==e.length&&l.every((t,n)=>t===e[n])}class K{constructor(e,t,n,i){this.dependencies=e,this.facet=t,this.type=n,this.value=i,this.id=me++}dynamicSlot(e){var t;let n=this.value,i=this.facet.compareInput,s=this.id,r=e[s]>>1,h=this.type==2,o=!1,a=!1,u=[];for(let f of this.dependencies)f=="doc"?o=!0:f=="selection"?a=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&u.push(e[f.id]);return{create(f){return f.values[r]=n(f),1},update(f,d){if(o&&d.docChanged||a&&(d.docChanged||d.selection)||ae(f,u)){let c=n(f);if(h?!Pe(c,f.values[r],i):!i(c,f.values[r]))return f.values[r]=c,1}return 0},reconfigure:(f,d)=>{let c,g=d.config.address[s];if(g!=null){let b=Y(d,g);if(this.dependencies.every(v=>v instanceof A?d.facet(v)===f.facet(v):v instanceof L?d.field(v,!1)==f.field(v,!1):!0)||(h?Pe(c=n(f),b,i):i(c=n(f),b)))return f.values[r]=b,0}else c=n(f);return f.values[r]=c,1}}}}function Pe(l,e,t){if(l.length!=e.length)return!1;for(let n=0;n<l.length;n++)if(!t(l[n],e[n]))return!1;return!0}function ae(l,e){let t=!1;for(let n of e)$(l,n)&1&&(t=!0);return t}function _e(l,e,t){let n=t.map(o=>l[o.id]),i=t.map(o=>o.type),s=n.filter(o=>!(o&1)),r=l[e.id]>>1;function h(o){let a=[];for(let u=0;u<n.length;u++){let f=Y(o,n[u]);if(i[u]==2)for(let d of f)a.push(d);else a.push(f)}return e.combine(a)}return{create(o){for(let a of n)$(o,a);return o.values[r]=h(o),1},update(o,a){if(!ae(o,s))return 0;let u=h(o);return e.compare(u,o.values[r])?0:(o.values[r]=u,1)},reconfigure(o,a){let u=ae(o,n),f=a.config.facets[e.id],d=a.facet(e);if(f&&!u&&we(t,f))return o.values[r]=d,0;let c=h(o);return e.compare(c,d)?(o.values[r]=d,0):(o.values[r]=c,1)}}}const U=A.define({static:!0});class L{constructor(e,t,n,i,s){this.id=e,this.createF=t,this.updateF=n,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let t=new L(me++,e.create,e.update,e.compare||((n,i)=>n===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(U).find(n=>n.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,i)=>{let s=n.values[t],r=this.updateF(s,i);return this.compareF(s,r)?0:(n.values[t]=r,1)},reconfigure:(n,i)=>{let s=n.facet(U),r=i.facet(U),h;return(h=s.find(o=>o.field==this))&&h!=r.find(o=>o.field==this)?(n.values[t]=h.create(n),1):i.config.address[this.id]!=null?(n.values[t]=i.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,U.of({field:this,create:e})]}get extension(){return this}}const T={lowest:4,low:3,default:2,high:1,highest:0};function D(l){return e=>new Le(e,l)}const gt={highest:D(T.highest),high:D(T.high),default:D(T.default),low:D(T.low),lowest:D(T.lowest)};class Le{constructor(e,t){this.inner=e,this.prec=t}}class te{of(e){return new ue(this,e)}reconfigure(e){return te.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class ue{constructor(e,t){this.compartment=e,this.inner=t}}class X{constructor(e,t,n,i,s,r){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=i,this.staticValues=s,this.facets=r,this.statusTemplate=[];this.statusTemplate.length<n.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,n){let i=[],s=Object.create(null),r=new Map;for(let d of et(e,t,r))d instanceof L?i.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let h=Object.create(null),o=[],a=[];for(let d of i)h[d.id]=a.length<<1,a.push(c=>d.slot(c));let u=n?.config.facets;for(let d in s){let c=s[d],g=c[0].facet,b=u&&u[d]||[];if(c.every(v=>v.type==0))if(h[g.id]=o.length<<1|1,we(b,c))o.push(n.facet(g));else{let v=g.combine(c.map(ne=>ne.value));o.push(n&&g.compare(v,n.facet(g))?n.facet(g):v)}else{for(let v of c)v.type==0?(h[v.id]=o.length<<1|1,o.push(v.value)):(h[v.id]=a.length<<1,a.push(ne=>v.dynamicSlot(ne)));h[g.id]=a.length<<1,a.push(v=>_e(v,g,c))}}let f=a.map(d=>d(h));return new X(e,r,f,h,o,s)}}function et(l,e,t){let n=[[],[],[],[],[]],i=new Map;function s(r,h){let o=i.get(r);if(o!=null){if(o<=h)return;let a=n[o].indexOf(r);a>-1&&n[o].splice(a,1),r instanceof ue&&t.delete(r.compartment)}if(i.set(r,h),Array.isArray(r))for(let a of r)s(a,h);else if(r instanceof ue){if(t.has(r.compartment))throw new RangeError("Duplicate use of compartment in extensions");let a=e.get(r.compartment)||r.inner;t.set(r.compartment,a),s(a,h)}else if(r instanceof Le)s(r.inner,r.prec);else if(r instanceof L)n[h].push(r),r.provides&&s(r.provides,h);else if(r instanceof K)n[h].push(r),r.facet.extensions&&s(r.facet.extensions,T.default);else{let a=r.extension;if(!a)throw new Error(`Unrecognized extension value in extension set (${r}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(a,h)}}return s(l,T.default),n.reduce((r,h)=>r.concat(h))}function $(l,e){if(e&1)return 2;let t=e>>1,n=l.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;l.status[t]=4;let i=l.computeSlot(l,l.config.dynamicSlots[t]);return l.status[t]=2|i}function Y(l,e){return e&1?l.config.staticValues[e>>1]:l.values[e>>1]}const De=A.define(),fe=A.define({combine:l=>l.some(e=>e),static:!0}),Ve=A.define({combine:l=>l.length?l[0]:void 0,static:!0}),Ne=A.define(),$e=A.define(),qe=A.define(),ze=A.define({combine:l=>l.length?l[0]:!1});class H{constructor(e,t){this.type=e,this.value=t}static define(){return new tt}}class tt{of(e){return new H(this,e)}}class nt{constructor(e){this.map=e}of(e){return new I(this,e)}}class I{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new I(this.type,t)}is(e){return this.type==e}static define(e={}){return new nt(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let i of e){let s=i.map(t);s&&n.push(s)}return n}}I.reconfigure=I.define();I.appendConfig=I.define();class P{constructor(e,t,n,i,s,r){this.startState=e,this.changes=t,this.selection=n,this.effects=i,this.annotations=s,this.scrollIntoView=r,this._doc=null,this._state=null,n&&Je(n,t.newLength),s.some(h=>h.type==P.time)||(this.annotations=s.concat(P.time.of(Date.now())))}static create(e,t,n,i,s,r){return new P(e,t,n,i,s,r)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(P.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}P.time=H.define();P.userEvent=H.define();P.addToHistory=H.define();P.remote=H.define();function it(l,e){let t=[];for(let n=0,i=0;;){let s,r;if(n<l.length&&(i==e.length||e[i]>=l[n]))s=l[n++],r=l[n++];else if(i<e.length)s=e[i++],r=e[i++];else return t;!t.length||t[t.length-1]<s?t.push(s,r):t[t.length-1]<r&&(t[t.length-1]=r)}}function We(l,e,t){var n;let i,s,r;return t?(i=e.changes,s=k.empty(e.changes.length),r=l.changes.compose(e.changes)):(i=e.changes.map(l.changes),s=l.changes.mapDesc(e.changes,!0),r=l.changes.compose(i)),{changes:r,selection:e.selection?e.selection.map(s):(n=l.selection)===null||n===void 0?void 0:n.map(i),effects:I.mapEffects(l.effects,i).concat(I.mapEffects(e.effects,s)),annotations:l.annotations.length?l.annotations.concat(e.annotations):e.annotations,scrollIntoView:l.scrollIntoView||e.scrollIntoView}}function ce(l,e,t){let n=e.selection,i=F(e.annotations);return e.userEvent&&(i=i.concat(P.userEvent.of(e.userEvent))),{changes:e.changes instanceof k?e.changes:k.of(e.changes||[],t,l.facet(Ve)),selection:n&&(n instanceof p?n:p.single(n.anchor,n.head)),effects:F(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function He(l,e,t){let n=ce(l,e.length?e[0]:{},l.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let r=!!e[s].sequential;n=We(n,ce(l,e[s],r?n.changes.newLength:l.doc.length),r)}let i=P.create(l,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return rt(t?st(i):i)}function st(l){let e=l.startState,t=!0;for(let i of e.facet(Ne)){let s=i(l);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:it(t,s))}if(t!==!0){let i,s;if(t===!1)s=l.changes.invertedDesc,i=k.empty(e.doc.length);else{let r=l.changes.filter(t);i=r.changes,s=r.filtered.mapDesc(r.changes).invertedDesc}l=P.create(e,i,l.selection&&l.selection.map(s),I.mapEffects(l.effects,s),l.annotations,l.scrollIntoView)}let n=e.facet($e);for(let i=n.length-1;i>=0;i--){let s=n[i](l);s instanceof P?l=s:Array.isArray(s)&&s.length==1&&s[0]instanceof P?l=s[0]:l=He(e,F(s),!1)}return l}function rt(l){let e=l.startState,t=e.facet(qe),n=l;for(let i=t.length-1;i>=0;i--){let s=t[i](l);s&&Object.keys(s).length&&(n=We(n,ce(e,s,l.changes.newLength),!0))}return n==l?l:P.create(e,l.changes,l.selection,n.effects,n.annotations,n.scrollIntoView)}const lt=[];function F(l){return l==null?lt:Array.isArray(l)?l:[l]}var R=(function(l){return l[l.Word=0]="Word",l[l.Space=1]="Space",l[l.Other=2]="Other",l})(R||(R={}));const ht=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let de;try{de=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function ot(l){if(de)return de.test(l);for(let e=0;e<l.length;e++){let t=l[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||ht.test(t)))return!0}return!1}function at(l){return e=>{if(!/\S/.test(e))return R.Space;if(ot(e))return R.Word;for(let t=0;t<l.length;t++)if(e.indexOf(l[t])>-1)return R.Word;return R.Other}}class w{constructor(e,t,n,i,s,r){this.config=e,this.doc=t,this.selection=n,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,r&&(r._state=this);for(let h=0;h<this.config.dynamicSlots.length;h++)$(this,h<<1);this.computeSlot=null}field(e,t=!0){let n=this.config.address[e.id];if(n==null){if(t)throw new RangeError("Field is not present in this state");return}return $(this,n),Y(this,n)}update(...e){return He(this,e,!0)}applyTransaction(e){let t=this.config,{base:n,compartments:i}=t;for(let h of e.effects)h.is(te.reconfigure)?(t&&(i=new Map,t.compartments.forEach((o,a)=>i.set(a,o)),t=null),i.set(h.value.compartment,h.value.extension)):h.is(I.reconfigure)?(t=null,n=h.value):h.is(I.appendConfig)&&(t=null,n=F(n).concat(h.value));let s;t?s=e.startState.values.slice():(t=X.resolve(n,i,this),s=new w(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(o,a)=>a.reconfigure(o,this),null).values);let r=e.startState.facet(fe)?e.newSelection:e.newSelection.asSingle();new w(t,e.newDoc,r,s,(h,o)=>o.update(h,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:p.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),i=this.changes(n.changes),s=[n.range],r=F(n.effects);for(let h=1;h<t.ranges.length;h++){let o=e(t.ranges[h]),a=this.changes(o.changes),u=a.map(i);for(let d=0;d<h;d++)s[d]=s[d].map(u);let f=i.mapDesc(a,!0);s.push(o.range.map(f)),i=i.compose(u),r=I.mapEffects(r,u).concat(I.mapEffects(F(o.effects),f))}return{changes:i,selection:p.create(s,t.mainIndex),effects:r}}changes(e=[]){return e instanceof k?e:k.of(e,this.doc.length,this.facet(w.lineSeparator))}toText(e){return x.of(e.split(this.facet(w.lineSeparator)||le))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:($(this,t),Y(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let n in e){let i=e[n];i instanceof L&&this.config.address[i.id]!=null&&(t[n]=i.spec.toJSON(this.field(e[n]),this))}return t}static fromJSON(e,t={},n){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(n){for(let s in n)if(Object.prototype.hasOwnProperty.call(e,s)){let r=n[s],h=e[s];i.push(r.init(o=>r.spec.fromJSON(h,o)))}}return w.create({doc:e.doc,selection:p.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=X.resolve(e.extensions||[],new Map),n=e.doc instanceof x?e.doc:x.of((e.doc||"").split(t.staticFacet(w.lineSeparator)||le)),i=e.selection?e.selection instanceof p?e.selection:p.single(e.selection.anchor,e.selection.head):p.single(0);return Je(i,n.length),t.staticFacet(fe)||(i=i.asSingle()),new w(t,n,i,t.dynamicSlots.map(()=>null),(s,r)=>r.create(s),null)}get tabSize(){return this.facet(w.tabSize)}get lineBreak(){return this.facet(w.lineSeparator)||`
|
|
5
|
+
`}get readOnly(){return this.facet(ze)}phrase(e,...t){for(let n of this.facet(w.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>t.length?n:t[s-1]})),e}languageDataAt(e,t,n=-1){let i=[];for(let s of this.facet(De))for(let r of s(this,t,n))Object.prototype.hasOwnProperty.call(r,e)&&i.push(r[e]);return i}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return at(t.length?t[0]:"")}wordAt(e){let{text:t,from:n,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),r=e-n,h=e-n;for(;r>0;){let o=Q(t,r,!1);if(s(t.slice(o,r))!=R.Word)break;r=o}for(;h<i;){let o=Q(t,h);if(s(t.slice(h,o))!=R.Word)break;h=o}return r==h?null:p.range(r+n,h+n)}}w.allowMultipleSelections=fe;w.tabSize=A.define({combine:l=>l.length?l[0]:4});w.lineSeparator=Ve;w.readOnly=ze;w.phrases=A.define({compare(l,e){let t=Object.keys(l),n=Object.keys(e);return t.length==n.length&&t.every(i=>l[i]==e[i])}});w.languageData=De;w.changeFilter=Ne;w.transactionFilter=$e;w.transactionExtender=qe;te.reconfigure=I.define();function pt(l,e,t={}){let n={};for(let i of l)for(let s of Object.keys(i)){let r=i[s],h=n[s];if(h===void 0)n[s]=r;else if(!(h===r||r===void 0))if(Object.hasOwnProperty.call(t,s))n[s]=t[s](h,r);else throw new Error("Config merge conflict for field "+s)}for(let i in e)n[i]===void 0&&(n[i]=e[i]);return n}class _{eq(e){return this==e}range(e,t=e){return z.create(e,t,this)}}_.prototype.startSide=_.prototype.endSide=0;_.prototype.point=!1;_.prototype.mapMode=O.TrackDel;function ve(l,e){return l==e||l.constructor==e.constructor&&l.eq(e)}class z{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new z(e,t,n)}}function ge(l,e){return l.from-e.from||l.value.startSide-e.value.startSide}class xe{constructor(e,t,n,i){this.from=e,this.to=t,this.value=n,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,i=0){let s=n?this.to:this.from;for(let r=i,h=s.length;;){if(r==h)return r;let o=r+h>>1,a=s[o]-e||(n?this.value[o].endSide:this.value[o].startSide)-t;if(o==r)return a>=0?r:h;a>=0?h=o:r=o+1}}between(e,t,n,i){for(let s=this.findIndex(t,-1e9,!0),r=this.findIndex(n,1e9,!1,s);s<r;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let n=[],i=[],s=[],r=-1,h=-1;for(let o=0;o<this.value.length;o++){let a=this.value[o],u=this.from[o]+e,f=this.to[o]+e,d,c;if(u==f){let g=t.mapPos(u,a.startSide,a.mapMode);if(g==null||(d=c=g,a.startSide!=a.endSide&&(c=t.mapPos(u,a.endSide),c<d)))continue}else if(d=t.mapPos(u,a.startSide),c=t.mapPos(f,a.endSide),d>c||d==c&&a.startSide>0&&a.endSide<=0)continue;(c-d||a.endSide-a.startSide)<0||(r<0&&(r=d),a.point&&(h=Math.max(h,c-d)),n.push(a),i.push(d-r),s.push(c-r))}return{mapped:n.length?new xe(i,s,n,h):null,pos:r}}}class S{constructor(e,t,n,i){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=i}static create(e,t,n,i){return new S(e,t,n,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:i=0,filterTo:s=this.length}=e,r=e.filter;if(t.length==0&&!r)return this;if(n&&(t=t.slice().sort(ge)),this.isEmpty)return t.length?S.of(t):this;let h=new Ue(this,null,-1).goto(0),o=0,a=[],u=new ee;for(;h.value||o<t.length;)if(o<t.length&&(h.from-t[o].from||h.startSide-t[o].value.startSide)>=0){let f=t[o++];u.addInner(f.from,f.to,f.value)||a.push(f)}else h.rangeIndex==1&&h.chunkIndex<this.chunk.length&&(o==t.length||this.chunkEnd(h.chunkIndex)<t[o].from)&&(!r||i>this.chunkEnd(h.chunkIndex)||s<this.chunkPos[h.chunkIndex])&&u.addChunk(this.chunkPos[h.chunkIndex],this.chunk[h.chunkIndex])?h.nextChunk():((!r||i>h.to||s<h.from||r(h.from,h.to,h.value))&&(u.addInner(h.from,h.to,h.value)||a.push(z.create(h.from,h.to,h.value))),h.next());return u.finishInner(this.nextLayer.isEmpty&&!a.length?S.empty:this.nextLayer.update({add:a,filter:r,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],n=[],i=-1;for(let r=0;r<this.chunk.length;r++){let h=this.chunkPos[r],o=this.chunk[r],a=e.touchesRange(h,h+o.length);if(a===!1)i=Math.max(i,o.maxPoint),t.push(o),n.push(e.mapPos(h));else if(a===!0){let{mapped:u,pos:f}=o.map(h,e);u&&(i=Math.max(i,u.maxPoint),t.push(u),n.push(f))}}let s=this.nextLayer.map(e);return t.length==0?s:new S(n,t,s||S.empty,i)}between(e,t,n){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],r=this.chunk[i];if(t>=s&&e<=s+r.length&&r.between(s,e-s,t-s,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return W.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return W.from(e).goto(t)}static compare(e,t,n,i,s=-1){let r=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),h=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),o=Ae(r,h,n),a=new V(r,o,s),u=new V(h,o,s);n.iterGaps((f,d,c)=>be(a,f,u,d,c,i)),n.empty&&n.length==0&&be(a,0,u,0,0,i)}static eq(e,t,n=0,i){i==null&&(i=999999999);let s=e.filter(u=>!u.isEmpty&&t.indexOf(u)<0),r=t.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=r.length)return!1;if(!s.length)return!0;let h=Ae(s,r),o=new V(s,h,0).goto(n),a=new V(r,h,0).goto(n);for(;;){if(o.to!=a.to||!pe(o.active,a.active)||o.point&&(!a.point||!ve(o.point,a.point)))return!1;if(o.to>i)return!0;o.next(),a.next()}}static spans(e,t,n,i,s=-1){let r=new V(e,null,s).goto(t),h=t,o=r.openStart;for(;;){let a=Math.min(r.to,n);if(r.point){let u=r.activeForPoint(r.to),f=r.pointFrom<t?u.length+1:r.point.startSide<0?u.length:Math.min(u.length,o);i.point(h,a,r.point,u,f,r.pointRank),o=Math.min(r.openEnd(a),u.length)}else a>h&&(i.span(h,a,r.active,o),o=r.openEnd(a));if(r.to>n)return o+(r.point&&r.to>n?1:0);h=r.to,r.next()}}static of(e,t=!1){let n=new ee;for(let i of e instanceof z?[e]:t?ut(e):e)n.add(i.from,i.to,i.value);return n.finish()}static join(e){if(!e.length)return S.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let i=e[n];i!=S.empty;i=i.nextLayer)t=new S(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}S.empty=new S([],[],null,-1);function ut(l){if(l.length>1)for(let e=l[0],t=1;t<l.length;t++){let n=l[t];if(ge(e,n)>0)return l.slice().sort(ge);e=n}return l}S.empty.nextLayer=S.empty;class ee{finishChunk(e){this.chunks.push(new xe(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new ee)).add(e,t,n)}addInner(e,t,n){let i=e-this.lastTo||n.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(S.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=S.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function Ae(l,e,t){let n=new Map;for(let s of l)for(let r=0;r<s.chunk.length;r++)s.chunk[r].maxPoint<=0&&n.set(s.chunk[r],s.chunkPos[r]);let i=new Set;for(let s of e)for(let r=0;r<s.chunk.length;r++){let h=n.get(s.chunk[r]);h!=null&&(t?t.mapPos(h):h)==s.chunkPos[r]&&!t?.touchesRange(h,h+s.chunk[r].length)&&i.add(s.chunk[r])}return i}class Ue{constructor(e,t,n,i=0){this.layer=e,this.skip=t,this.minPoint=n,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,n){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,n=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!n||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],n=e+t.from[this.rangeIndex];if(this.from=n,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class W{constructor(e){this.heap=e}static from(e,t=null,n=-1){let i=[];for(let s=0;s<e.length;s++)for(let r=e[s];!r.isEmpty;r=r.nextLayer)r.maxPoint>=n&&i.push(new Ue(r,t,n,s));return i.length==1?i[0]:new W(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)se(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)se(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),se(this.heap,0)}}}function se(l,e){for(let t=l[e];;){let n=(e<<1)+1;if(n>=l.length)break;let i=l[n];if(n+1<l.length&&i.compare(l[n+1])>=0&&(i=l[n+1],n++),t.compare(i)<0)break;l[n]=t,l[e]=i,e=n}}class V{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=W.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){G(this.active,e),G(this.activeTo,e),G(this.activeRank,e),this.minActive=Ce(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:i,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||i-this.activeTo[t])>0;)t++;j(this.active,t,n),j(this.activeTo,t,i),j(this.activeRank,t,s),e&&j(e,t,this.cursor.from),this.minActive=Ce(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),n&&G(n,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(n){this.openStart=0;for(let i=n.length-1;i>=0&&n[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let n=this.active.length-1;n>=0&&!(this.activeRank[n]<this.pointRank);n--)(this.activeTo[n]>e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function be(l,e,t,n,i,s){l.goto(e),t.goto(n);let r=n+i,h=n,o=n-e,a=!!s.boundChange;for(let u=!1;;){let f=l.to+o-t.to,d=f||l.endSide-t.endSide,c=d<0?l.to+o:t.to,g=Math.min(c,r);if(l.point||t.point?(l.point&&t.point&&ve(l.point,t.point)&&pe(l.activeForPoint(l.to),t.activeForPoint(t.to))||s.comparePoint(h,g,l.point,t.point),u=!1):(u&&s.boundChange(h),g>h&&!pe(l.active,t.active)&&s.compareRange(h,g,l.active,t.active),a&&g<r&&(f||l.openEnd(c)!=t.openEnd(c))&&(u=!0)),c>r)break;h=c,d<=0&&l.next(),d>=0&&t.next()}}function pe(l,e){if(l.length!=e.length)return!1;for(let t=0;t<l.length;t++)if(l[t]!=e[t]&&!ve(l[t],e[t]))return!1;return!0}function G(l,e){for(let t=e,n=l.length-1;t<n;t++)l[t]=l[t+1];l.pop()}function j(l,e,t){for(let n=l.length-1;n>=e;n--)l[n+1]=l[n];l[e]=t}function Ce(l,e){let t=-1,n=1e9;for(let i=0;i<e.length;i++)(e[i]-n||l[i].endSide-l[t].endSide)<0&&(t=i,n=e[i]);return t}function mt(l,e,t=l.length){let n=0;for(let i=0;i<t&&i<l.length;)l.charCodeAt(i)==9?(n+=e-n%e,i++):(n++,i=Q(l,i));return n}function wt(l,e,t,n){for(let i=0,s=0;;){if(s>=e)return i;if(i==l.length)break;s+=l.charCodeAt(i)==9?t-s%t:1,i=Q(l,i)}return n===!0?-1:l.length}export{H as Annotation,tt as AnnotationType,E as ChangeDesc,k as ChangeSet,R as CharCategory,te as Compartment,p as EditorSelection,w as EditorState,A as Facet,Qe as Line,O as MapMode,gt as Prec,z as Range,S as RangeSet,ee as RangeSetBuilder,_ as RangeValue,B as SelectionRange,I as StateEffect,nt as StateEffectType,L as StateField,x as Text,P as Transaction,ft as codePointAt,dt as codePointSize,pt as combineConfig,mt as countColumn,Q as findClusterBreak,wt as findColumn,ct as fromCodePoint};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{aG as ie,m as K,a1 as oe,ai as Q,k as le,aH as q,a2 as N,e as l,h as _,a9 as m,aI as U,b as ue,a as $,a0 as fe,aJ as X,X as y,q as A,aK as I,W as C,Z as ce,aL as z,aM as de,aN as G,aO as he,aP as _e,ak as M,aQ as O,aR as J,aS as pe,aT as ee,g as te,al as ve,V as P,c as R,F as ge,s as me,aU as k,E as ye,v as be,aV as Ee,aW as Te,aX as we,P as Ne,aC as Ae,aA as Re,x as S,aY as Se,aZ as ke,a_ as De,a$ as Le,b0 as Me,b1 as Oe,C as B,b2 as F,H as xe,w as Ie,b3 as V,d as D,b4 as Ce,aw as Pe,b5 as Fe,ar as Ve,y as We,as as He,b6 as Ye,A as $e}from"./BeBar3OL.js";function Be(t){let e=0,r=Q(0),s;return()=>{ie()&&(K(r),oe(()=>(e===0&&(s=le(()=>t(()=>q(r)))),e+=1,()=>{N(()=>{e-=1,e===0&&(s?.(),s=void 0,q(r))})})))}}var je=ye|be;function qe(t,e,r,s){new Ue(t,e,r,s)}class Ue{parent;is_pending=!1;transform_error;#t;#v=_?l:null;#s;#u;#e;#a=null;#r=null;#n=null;#i=null;#f=0;#l=0;#c=!1;#d=new Set;#h=new Set;#o=null;#y=Be(()=>(this.#o=Q(this.#f),()=>{this.#o=null}));constructor(e,r,s,a){this.#t=e,this.#s=r,this.#u=n=>{var i=m;i.b=this,i.f|=U,s(n)},this.parent=m.b,this.transform_error=a??this.parent?.transform_error??(n=>n),this.#e=ue(()=>{if(_){const n=this.#v;$();const i=n.data===fe;if(n.data.startsWith(X)){const o=JSON.parse(n.data.slice(X.length));this.#E(o)}else i?this.#T():this.#b()}else this.#g()},je),_&&(this.#t=l)}#b(){try{this.#a=y(()=>this.#u(this.#t))}catch(e){this.error(e)}}#E(e){const r=this.#s.failed;r&&(this.#n=y(()=>{r(this.#t,()=>e,()=>()=>{})}))}#T(){const e=this.#s.pending;e&&(this.is_pending=!0,this.#r=y(()=>e(this.#t)),N(()=>{var r=this.#i=document.createDocumentFragment(),s=A();r.append(s),this.#a=this.#p(()=>(I.ensure(),y(()=>this.#u(s)))),this.#l===0&&(this.#t.before(r),this.#i=null,C(this.#r,()=>{this.#r=null}),this.#_())}))}#g(){try{if(this.is_pending=this.has_pending_snippet(),this.#l=0,this.#f=0,this.#a=y(()=>{this.#u(this.#t)}),this.#l>0){var e=this.#i=document.createDocumentFragment();ce(this.#a,e);const r=this.#s.pending;this.#r=y(()=>r(this.#t))}else this.#_()}catch(r){this.error(r)}}#_(){this.is_pending=!1;for(const e of this.#d)z(e,de),G(e);for(const e of this.#h)z(e,he),G(e);this.#d.clear(),this.#h.clear()}defer_effect(e){_e(e,this.#d,this.#h)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#s.pending}#p(e){var r=m,s=ee,a=te;M(this.#e),O(this.#e),J(this.#e.ctx);try{return e()}catch(n){return pe(n),null}finally{M(r),O(s),J(a)}}#m(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#m(e);return}this.#l+=e,this.#l===0&&(this.#_(),this.#r&&C(this.#r,()=>{this.#r=null}),this.#i&&(this.#t.before(this.#i),this.#i=null))}update_pending_count(e){this.#m(e),this.#f+=e,!(!this.#o||this.#c)&&(this.#c=!0,N(()=>{this.#c=!1,this.#o&&ve(this.#o,this.#f)}))}get_effect_pending(){return this.#y(),K(this.#o)}error(e){var r=this.#s.onerror;let s=this.#s.failed;if(!r&&!s)throw e;this.#a&&(P(this.#a),this.#a=null),this.#r&&(P(this.#r),this.#r=null),this.#n&&(P(this.#n),this.#n=null),_&&(R(this.#v),ge(),R(me()));var a=!1,n=!1;const i=()=>{if(a){Te();return}a=!0,n&&Ee(),this.#n!==null&&C(this.#n,()=>{this.#n=null}),this.#p(()=>{I.ensure(),this.#g()})},f=o=>{try{n=!0,r?.(o,i),n=!1}catch(u){k(u,this.#e&&this.#e.parent)}s&&(this.#n=this.#p(()=>{I.ensure();try{return y(()=>{var u=m;u.b=this,u.f|=U,s(this.#t,()=>o,()=>i)})}catch(u){return k(u,this.#e.parent),null}}))};N(()=>{var o;try{o=this.transform_error(e)}catch(u){k(u,this.#e&&this.#e.parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(f,u=>k(u,this.#e&&this.#e.parent)):f(o)})}}function st(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const Xe=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function at(t){return Xe.includes(t)}const ze={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function it(t){return t=t.toLowerCase(),ze[t]??t}const Ge=["touchstart","touchmove"];function Je(t){return Ge.includes(t)}const Ze=["textarea","script","style","title"];function ot(t){return Ze.includes(t)}const w=Symbol("events"),re=new Set,W=new Set;function ne(t,e,r,s={}){function a(n){if(s.capture||H.call(e,n),!n.cancelBubble)return we(()=>r?.call(this,n))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?N(()=>{e.addEventListener(t,a,s)}):e.addEventListener(t,a,s),a}function lt(t,e,r,s={}){var a=ne(e,t,r,s);return()=>{t.removeEventListener(e,a,s)}}function ut(t,e,r,s,a){var n={capture:s,passive:a},i=ne(t,e,r,n);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Ae(()=>{e.removeEventListener(t,i,n)})}function ft(t,e,r){(e[w]??={})[t]=r}function ct(t){for(var e=0;e<t.length;e++)re.add(t[e]);for(var r of W)r(t)}let Z=null;function H(t){var e=this,r=e.ownerDocument,s=t.type,a=t.composedPath?.()||[],n=a[0]||t.target;Z=t;var i=0,f=Z===t&&t[w];if(f){var o=a.indexOf(f);if(o!==-1&&(e===document||e===window)){t[w]=e;return}var u=a.indexOf(e);if(u===-1)return;o<=u&&(i=o)}if(n=a[i]||t.target,n!==e){Ne(t,"currentTarget",{configurable:!0,get(){return n||r}});var b=ee,T=m;O(null),M(null);try{for(var g,d=[];n!==null;){var c=n.assignedSlot||n.parentNode||n.host||null;try{var h=n[w]?.[s];h!=null&&(!n.disabled||t.target===n)&&h.call(n,t)}catch(p){g?d.push(p):g=p}if(t.cancelBubble||c===e||c===null)break;n=c}if(g){for(let p of d)queueMicrotask(()=>{throw p});throw g}}finally{t[w]=e,delete t.currentTarget,O(b),M(T)}}}const Ke=globalThis?.window?.trustedTypes&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Qe(t){return Ke?.createHTML(t)??t}function se(t){var e=Re("template");return e.innerHTML=Qe(t.replaceAll("<!>","<!---->")),e.content}function v(t,e){var r=m;r.nodes===null&&(r.nodes={start:t,end:e,a:null,t:null})}function dt(t,e){var r=(e&ke)!==0,s=(e&De)!==0,a,n=!t.startsWith("<!>");return()=>{if(_)return v(l,null),l;a===void 0&&(a=se(n?t:"<!>"+t),r||(a=S(a)));var i=s||Se?document.importNode(a,!0):a.cloneNode(!0);if(r){var f=S(i),o=i.lastChild;v(f,o)}else v(i,i);return i}}function et(t,e,r="svg"){var s=!t.startsWith("<!>"),a=`<${r}>${s?t:"<!>"+t}</${r}>`,n;return()=>{if(_)return v(l,null),l;if(!n){var i=se(a),f=S(i);n=S(f)}var o=n.cloneNode(!0);return v(o,o),o}}function ht(t,e){return et(t,e,"svg")}function _t(t=""){if(!_){var e=A(t+"");return v(e,e),e}var r=l;return r.nodeType!==Le?(r.before(r=A()),R(r)):Me(r),v(r,r),r}function pt(){if(_)return v(l,null),l;var t=document.createDocumentFragment(),e=document.createComment(""),r=A();return t.append(e,r),v(e,r),t}function vt(t,e){if(_){var r=m;((r.f&Oe)===0||r.nodes.end===null)&&(r.nodes.end=l),$();return}t!==null&&t.before(e)}function gt(){if(_&&l&&l.nodeType===B&&l.textContent?.startsWith("$")){const t=l.textContent.substring(1);return $(),t}return(window.__svelte??={}).uid??=1,`c${window.__svelte.uid++}`}function mt(t,e){var r=e==null?"":typeof e=="object"?`${e}`:e;r!==(t.__t??=t.nodeValue)&&(t.__t=r,t.nodeValue=`${r}`)}function tt(t,e){return ae(t,e)}function yt(t,e){F(),e.intro=e.intro??!1;const r=e.target,s=_,a=l;try{for(var n=S(r);n&&(n.nodeType!==B||n.data!==xe);)n=Ie(n);if(!n)throw V;D(!0),R(n);const i=ae(t,{...e,anchor:n});return D(!1),i}catch(i){if(i instanceof Error&&i.message.split(`
|
|
2
|
+
`).some(f=>f.startsWith("https://svelte.dev/e/")))throw i;return i!==V&&console.warn("Failed to hydrate: ",i),e.recover===!1&&Ce(),F(),Pe(r),D(!1),tt(t,e)}finally{D(s),R(a)}}const L=new Map;function ae(t,{target:e,anchor:r,props:s={},events:a,context:n,intro:i=!0,transformError:f}){F();var o=void 0,u=Fe(()=>{var b=r??e.appendChild(A());qe(b,{pending:()=>{}},d=>{We({});var c=te;if(n&&(c.c=n),a&&(s.$$events=a),_&&v(d,null),o=t(d,s)||{},_&&(m.nodes.end=l,l===null||l.nodeType!==B||l.data!==He))throw Ye(),V;$e()},f);var T=new Set,g=d=>{for(var c=0;c<d.length;c++){var h=d[c];if(!T.has(h)){T.add(h);var p=Je(h);for(const x of[e,document]){var E=L.get(x);E===void 0&&(E=new Map,L.set(x,E));var j=E.get(h);j===void 0?(x.addEventListener(h,H,{passive:p}),E.set(h,1)):E.set(h,j+1)}}}};return g(Ve(re)),W.add(g),()=>{for(var d of T)for(const p of[e,document]){var c=L.get(p),h=c.get(d);--h==0?(p.removeEventListener(d,H),c.delete(d),c.size===0&&L.delete(p)):c.set(d,h)}W.delete(g),b!==r&&b.parentNode?.removeChild(b)}});return Y.set(o,u),o}let Y=new WeakMap;function bt(t,e){const r=Y.get(t);return r?(Y.delete(t),r(e)):Promise.resolve()}const rt="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(rt);export{vt as a,v as b,pt as c,st as d,ut as e,dt as f,ft as g,yt as h,ot as i,ct as j,ne as k,at as l,tt as m,it as n,Be as o,lt as p,ht as q,gt as r,mt as s,_t as t,bt as u};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{b as y,t as ee,T as g,c as W,P as Tt,d as u,I as ft,a as j,N as ne,s as re,h as se}from"./BXuvR8Ks.js";import{countColumn as ie,EditorState as O,Facet as v,StateEffect as z,RangeSetBuilder as nt,RangeSet as xt,StateField as St,Prec as Pt,combineConfig as Ct}from"./Cs5oz2oJ.js";import{V as R,g as oe,D as p,E as b,S as ut,a as H,G as le,W as At,l as ae}from"./BVBRzmeQ.js";var J;const S=new y;function It(n){return v.define({combine:n?t=>t.concat(n):void 0})}const he=new y;class d{constructor(t,e,r=[],s=""){this.data=t,this.name=s,O.prototype.hasOwnProperty("tree")||Object.defineProperty(O.prototype,"tree",{get(){return m(this)}}),this.parser=e,this.extension=[T.of(this),O.languageData.of((i,o,a)=>{let l=ct(i,o,a),h=l.type.prop(S);if(!h)return[];let f=i.facet(h),c=l.type.prop(he);if(c){let w=l.resolve(o-l.from,a);for(let k of c)if(k.test(w,i)){let P=i.facet(k.facet);return k.type=="replace"?P:P.concat(f)}}return f})].concat(r)}isActiveAt(t,e,r=-1){return ct(t,e,r).type.prop(S)==this.data}findRegions(t){let e=t.facet(T);if(e?.data==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let r=[],s=(i,o)=>{if(i.prop(S)==this.data){r.push({from:o,to:o+i.length});return}let a=i.prop(y.mounted);if(a){if(a.tree.prop(S)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+o,to:l.to+o});else r.push({from:o,to:o+i.length});return}else if(a.overlay){let l=r.length;if(s(a.tree,a.overlay[0].from+o),r.length>l)return}}for(let l=0;l<i.children.length;l++){let h=i.children[l];h instanceof g&&s(h,i.positions[l]+o)}};return s(m(t),0),r}get allowsNesting(){return!0}}d.setState=z.define();function ct(n,t,e){let r=n.facet(T),s=m(n).topNode;if(!r||r.allowsNesting)for(let i=s;i;i=i.enter(t,e,ft.ExcludeBuffers|ft.EnterBracketed))i.type.isTop&&(s=i);return s}class X extends d{constructor(t,e,r){super(t,e,[],r),this.parser=e}static define(t){let e=It(t.languageData);return new X(e,t.parser.configure({props:[S.add(r=>r.isTop?e:void 0)]}),t.name)}configure(t,e){return new X(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function m(n){let t=n.field(d.state,!1);return t?t.tree:g.empty}function fe(n,t,e=50){var r;let s=(r=n.field(d.state,!1))===null||r===void 0?void 0:r.context;if(!s)return null;let i=s.viewport;s.updateViewport({from:0,to:t});let o=s.isDone(t)||s.work(e,t)?s.tree:null;return s.updateViewport(i),o}function on(n,t=n.doc.length){var e;return((e=n.field(d.state,!1))===null||e===void 0?void 0:e.context.isDone(t))||!1}function ln(n,t=n.viewport.to,e=100){let r=fe(n.state,t,e);return r!=m(n.state)&&n.dispatch({}),!!r}function an(n){var t;return((t=n.plugin(Mt))===null||t===void 0?void 0:t.isWorking())||!1}class ue{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let r=this.cursorPos-this.string.length;return t<r||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-r,e-r)}}let M=null;class A{constructor(t,e,r=[],s,i,o,a,l){this.parser=t,this.state=e,this.fragments=r,this.tree=s,this.treeLen=i,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(t,e,r){return new A(t,e,[],g.empty,0,r,[],null)}startParse(){return this.parser.startParse(new ue(this.state.doc),this.fragments)}work(t,e){return e!=null&&e>=this.state.doc.length&&(e=void 0),this.tree!=g.empty&&this.isDone(e??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof t=="number"){let s=Date.now()+t;t=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),e!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let s=this.parse.advance();if(s)if(this.fragments=this.withoutTempSkipped(W.addTree(s,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=s,this.parse=null,this.treeLen<(e??this.state.doc.length))this.parse=this.startParse();else return!0;if(t())return!1}})}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(W.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=M;M=this;try{return t()}finally{M=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=dt(t,e.from,e.to);return t}changes(t,e){let{fragments:r,tree:s,treeLen:i,viewport:o,skipped:a}=this;if(this.takeTree(),!t.empty){let l=[];if(t.iterChangedRanges((h,f,c,w)=>l.push({fromA:h,toA:f,fromB:c,toB:w})),r=W.applyChanges(r,l),s=g.empty,i=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){a=[];for(let h of this.skipped){let f=t.mapPos(h.from,1),c=t.mapPos(h.to,-1);f<c&&a.push({from:f,to:c})}}}return new A(this.parser,e,r,s,i,o,a,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:s,to:i}=this.skipped[r];s<t.to&&i>t.from&&(this.fragments=dt(this.fragments,s,i),this.skipped.splice(r--,1))}return this.skipped.length>=e?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends Tt{createParse(e,r,s){let i=s[0].from,o=s[s.length-1].to;return{parsedPos:i,advance(){let l=M;if(l){for(let h of s)l.tempSkipped.push(h);t&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,t]):t)}return this.parsedPos=o,new g(j.none,[],[],o-i)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&e[0].from==0&&e[0].to>=t}static get(){return M}}function dt(n,t,e){return W.applyChanges(n,[{fromA:t,toA:e,fromB:t,toB:e}])}class I{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),r=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,r)||e.takeTree(),new I(e)}static init(t){let e=Math.min(3e3,t.doc.length),r=A.create(t.facet(T).parser,t,{from:0,to:e});return r.work(20,e)||r.takeTree(),new I(r)}}d.state=St.define({create:I.init,update(n,t){for(let e of t.effects)if(e.is(d.setState))return e.value;return t.startState.facet(T)!=t.state.facet(T)?I.init(t.state):n.apply(t)}});let Dt=n=>{let t=setTimeout(()=>n(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(Dt=n=>{let t=-1,e=setTimeout(()=>{t=requestIdleCallback(n,{timeout:400})},100);return()=>t<0?clearTimeout(e):cancelIdleCallback(t)});const _=typeof navigator<"u"&&(!((J=navigator.scheduling)===null||J===void 0)&&J.isInputPending)?()=>navigator.scheduling.isInputPending():null,Mt=R.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(d.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(d.state);(e.tree!=e.context.tree||!e.context.isDone(t.doc.length))&&(this.working=Dt(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:s}}=this.view,i=r.field(d.state);if(i.tree==i.context.tree&&i.context.isDone(s+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,t&&!_?Math.max(25,t.timeRemaining()-5):1e9),a=i.context.treeLen<s&&r.doc.length>s+1e3,l=i.context.work(()=>_&&_()||Date.now()>o,s+(a?0:1e5));this.chunkBudget-=Date.now()-e,(l||this.chunkBudget<=0)&&(i.context.takeTree(),this.view.dispatch({effects:d.setState.of(new I(i.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(i.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(e=>ae(this.view.state,e)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),T=v.define({combine(n){return n.length?n[0]:null},enables:n=>[d.state,Mt,b.contentAttributes.compute([n],t=>{let e=t.facet(n);return e&&e.name?{"data-language":e.name}:{}})]});class fn{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class Ot{constructor(t,e,r,s,i,o=void 0){this.name=t,this.alias=e,this.extensions=r,this.filename=s,this.loadFunc=i,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){let{load:e,support:r}=t;if(!e){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");e=()=>Promise.resolve(r)}return new Ot(t.name,(t.alias||[]).concat(t.name).map(s=>s.toLowerCase()),t.extensions||[],t.filename,e,r)}static matchFilename(t,e){for(let s of t)if(s.filename&&s.filename.test(e))return s;let r=/\.([^.]+)$/.exec(e);if(r){for(let s of t)if(s.extensions.indexOf(r[1])>-1)return s}return null}static matchLanguageName(t,e,r=!0){e=e.toLowerCase();for(let s of t)if(s.alias.some(i=>i==e))return s;if(r)for(let s of t)for(let i of s.alias){let o=e.indexOf(i);if(o>-1&&(i.length>2||!/\w/.test(e[o-1])&&!/\w/.test(e[o+i.length])))return s}return null}}const ce=v.define(),Bt=v.define({combine:n=>{if(!n.length)return" ";let t=n[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return t}});function V(n){let t=n.facet(Bt);return t.charCodeAt(0)==9?n.tabSize*t.length:t.length}function Lt(n,t){let e="",r=n.tabSize,s=n.facet(Bt)[0];if(s==" "){for(;t>=r;)e+=" ",t-=r;s=" "}for(let i=0;i<t;i++)e+=s;return e}function Nt(n,t){n instanceof O&&(n=new rt(n));for(let r of n.state.facet(ce)){let s=r(n,t);if(s!==void 0)return s}let e=m(n.state);return e.length>=t?de(n,e,t):null}function un(n,t,e){let r=Object.create(null),s=new rt(n,{overrideIndentation:o=>{var a;return(a=r[o])!==null&&a!==void 0?a:-1}}),i=[];for(let o=t;o<=e;){let a=n.doc.lineAt(o);o=a.to+1;let l=Nt(s,a.from);if(l==null)continue;/\S/.test(a.text)||(l=0);let h=/^\s*/.exec(a.text)[0],f=Lt(n,l);h!=f&&(r[a.from]=l,i.push({from:a.from,to:a.from+h.length,insert:f}))}return n.changes(i)}class rt{constructor(t,e={}){this.state=t,this.options=e,this.unit=V(t)}lineAt(t,e=1){let r=this.state.doc.lineAt(t),{simulateBreak:s,simulateDoubleBreak:i}=this.options;return s!=null&&s>=r.from&&s<=r.to?i&&s==t?{text:"",from:t}:(e<0?s<t:s<=t)?{text:r.text.slice(s-r.from),from:s}:{text:r.text.slice(0,s-r.from),from:r.from}:r}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:r,from:s}=this.lineAt(t,e);return r.slice(t-s,Math.min(r.length,t+100-s))}column(t,e=1){let{text:r,from:s}=this.lineAt(t,e),i=this.countColumn(r,t-s),o=this.options.overrideIndentation?this.options.overrideIndentation(s):-1;return o>-1&&(i+=o-this.countColumn(r,r.search(/\S|$/))),i}countColumn(t,e=t.length){return ie(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:r,from:s}=this.lineAt(t,e),i=this.options.overrideIndentation;if(i){let o=i(s);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Rt=new y;function de(n,t,e){let r=t.resolveStack(e),s=t.resolveInner(e,-1).resolve(e,0).enterUnfinishedNodesBefore(e);if(s!=r.node){let i=[];for(let o=s;o&&!(o.from<r.node.from||o.to>r.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)i.push(o);for(let o=i.length-1;o>=0;o--)r={node:i[o],next:r}}return Et(r,n,e)}function Et(n,t,e){for(let r=n;r;r=r.next){let s=ge(r.node);if(s)return s(st.create(t,e,r))}return 0}function pe(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function ge(n){let t=n.type.prop(Rt);if(t)return t;let e=n.firstChild,r;if(e&&(r=e.type.prop(y.closedBy))){let s=n.lastChild,i=s&&r.indexOf(s.name)>-1;return o=>Ft(o,!0,1,void 0,i&&!pe(o)?s.from:void 0)}return n.parent==null?me:null}function me(){return 0}class st extends rt{constructor(t,e,r){super(t.state,t.options),this.base=t,this.pos=e,this.context=r}get node(){return this.context.node}static create(t,e,r){return new st(t,e,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let r=t.resolve(e.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if(ke(r,t))break;e=this.state.doc.lineAt(r.from)}return this.lineIndent(e.from)}continue(){return Et(this.context.next,this.base,this.pos)}}function ke(n,t){for(let e=t;e;e=e.parent)if(n==e)return!0;return!1}function be(n){let t=n.node,e=t.childAfter(t.from),r=t.lastChild;if(!e)return null;let s=n.options.simulateBreak,i=n.state.doc.lineAt(e.from),o=s==null||s<=i.from?i.to:Math.min(i.to,s);for(let a=e.to;;){let l=t.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let h=/^ */.exec(i.text.slice(e.to-i.from))[0].length;return{from:e.from,to:e.to+h}}a=l.to}}function cn({closing:n,align:t=!0,units:e=1}){return r=>Ft(r,t,e,n)}function Ft(n,t,e,r,s){let i=n.textAfter,o=i.match(/^\s*/)[0].length,a=r&&i.slice(o,o+r.length)==r||s==n.pos+o,l=t?be(n):null;return l?a?n.column(l.from):n.column(l.to):n.baseIndent+(a?0:n.unit*e)}const dn=n=>n.baseIndent;function pn({except:n,units:t=1}={}){return e=>{let r=n&&n.test(e.textAfter);return e.baseIndent+(r?0:t*e.unit)}}const we=200;function gn(){return O.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let t=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!t.length)return n;let e=n.newDoc,{head:r}=n.newSelection.main,s=e.lineAt(r);if(r>s.from+we)return n;let i=e.sliceString(s.from,r);if(!t.some(h=>h.test(i)))return n;let{state:o}=n,a=-1,l=[];for(let{head:h}of o.selection.ranges){let f=o.doc.lineAt(h);if(f.from==a)continue;a=f.from;let c=Nt(o,f.from);if(c==null)continue;let w=/^\s*/.exec(f.text)[0],k=Lt(o,c);w!=k&&l.push({from:f.from,to:f.from+w.length,insert:k})}return l.length?[n,{changes:l,sequential:!0}]:n})}const ye=v.define(),ve=new y;function mn(n){let t=n.firstChild,e=n.lastChild;return t&&t.to<e.from?{from:t.to,to:e.type.isError?n.to:e.from}:null}function Te(n,t,e){let r=m(n);if(r.length<e)return null;let s=r.resolveStack(e,1),i=null;for(let o=s;o;o=o.next){let a=o.node;if(a.to<=e||a.from>e)continue;if(i&&a.from<t)break;let l=a.type.prop(ve);if(l&&(a.to<r.length-50||r.length==n.doc.length||!xe(a))){let h=l(a,n);h&&h.from<=e&&h.from>=t&&h.to>e&&(i=h)}}return i}function xe(n){let t=n.lastChild;return t&&t.to==n.to&&t.type.isError}function B(n,t,e){for(let r of n.facet(ye)){let s=r(n,t,e);if(s)return s}return Te(n,t,e)}function Wt(n,t){let e=t.mapPos(n.from,1),r=t.mapPos(n.to,-1);return e>=r?void 0:{from:e,to:r}}const E=z.define({map:Wt}),D=z.define({map:Wt});function it(n){let t=[];for(let{head:e}of n.state.selection.ranges)t.some(r=>r.from<=e&&r.to>=e)||t.push(n.lineBlockAt(e));return t}const x=St.define({create(){return p.none},update(n,t){t.isUserEvent("delete")&&t.changes.iterChangedRanges((e,r)=>n=pt(n,e,r)),n=n.map(t.changes);for(let e of t.effects)if(e.is(E)&&!Se(n,e.value.from,e.value.to)){let{preparePlaceholder:r}=t.state.facet(lt),s=r?p.replace({widget:new Oe(r(t.state,e.value))}):gt;n=n.update({add:[s.range(e.value.from,e.value.to)]})}else e.is(D)&&(n=n.update({filter:(r,s)=>e.value.from!=r||e.value.to!=s,filterFrom:e.value.from,filterTo:e.value.to}));return t.selection&&(n=pt(n,t.selection.main.head)),n},provide:n=>b.decorations.from(n),toJSON(n,t){let e=[];return n.between(0,t.doc.length,(r,s)=>{e.push(r,s)}),e},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let e=0;e<n.length;){let r=n[e++],s=n[e++];if(typeof r!="number"||typeof s!="number")throw new RangeError("Invalid JSON for fold state");t.push(gt.range(r,s))}return p.set(t,!0)}});function pt(n,t,e=t){let r=!1;return n.between(t,e,(s,i)=>{s<e&&i>t&&(r=!0)}),r?n.update({filterFrom:t,filterTo:e,filter:(s,i)=>s>=e||i<=t}):n}function kn(n){return n.field(x,!1)||xt.empty}function L(n,t,e){var r;let s=null;return(r=n.field(x,!1))===null||r===void 0||r.between(t,e,(i,o)=>{(!s||s.from>i)&&(s={from:i,to:o})}),s}function Se(n,t,e){let r=!1;return n.between(t,t,(s,i)=>{s==t&&i==e&&(r=!0)}),r}function ot(n,t){return n.field(x,!1)?t:t.concat(z.appendConfig.of(Ut()))}const Pe=n=>{for(let t of it(n)){let e=B(n.state,t.from,t.to);if(e)return n.dispatch({effects:ot(n.state,[E.of(e),$(n,e)])}),!0}return!1},Ce=n=>{if(!n.state.field(x,!1))return!1;let t=[];for(let e of it(n)){let r=L(n.state,e.from,e.to);r&&t.push(D.of(r),$(n,r,!1))}return t.length&&n.dispatch({effects:t}),t.length>0};function $(n,t,e=!0){let r=n.state.doc.lineAt(t.from).number,s=n.state.doc.lineAt(t.to).number;return b.announce.of(`${n.state.phrase(e?"Folded lines":"Unfolded lines")} ${r} ${n.state.phrase("to")} ${s}.`)}const Ae=n=>{let{state:t}=n,e=[];for(let r=0;r<t.doc.length;){let s=n.lineBlockAt(r),i=B(t,s.from,s.to);i&&e.push(E.of(i)),r=(i?n.lineBlockAt(i.to):s).to+1}return e.length&&n.dispatch({effects:ot(n.state,e)}),!!e.length},Ie=n=>{let t=n.state.field(x,!1);if(!t||!t.size)return!1;let e=[];return t.between(0,n.state.doc.length,(r,s)=>{e.push(D.of({from:r,to:s}))}),n.dispatch({effects:e}),!0};function De(n,t){for(let e=t;;){let r=B(n.state,e.from,e.to);if(r&&r.to>t.from)return r;if(!e.from)return null;e=n.lineBlockAt(e.from-1)}}const bn=n=>{let t=[];for(let e of it(n)){let r=L(n.state,e.from,e.to);if(r)t.push(D.of(r),$(n,r,!1));else{let s=De(n,e);s&&t.push(E.of(s),$(n,s))}}return t.length>0&&n.dispatch({effects:ot(n.state,t)}),!!t.length},wn=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Pe},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Ce},{key:"Ctrl-Alt-[",run:Ae},{key:"Ctrl-Alt-]",run:Ie}],Me={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},lt=v.define({combine(n){return Ct(n,Me)}});function Ut(n){let t=[x,Le];return n&&t.push(lt.of(n)),t}function Ht(n,t){let{state:e}=n,r=e.facet(lt),s=o=>{let a=n.lineBlockAt(n.posAtDOM(o.target)),l=L(n.state,a.from,a.to);l&&n.dispatch({effects:D.of(l)}),o.preventDefault()};if(r.placeholderDOM)return r.placeholderDOM(n,s,t);let i=document.createElement("span");return i.textContent=r.placeholderText,i.setAttribute("aria-label",e.phrase("folded code")),i.title=e.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=s,i}const gt=p.replace({widget:new class extends At{toDOM(n){return Ht(n,null)}}});class Oe extends At{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return Ht(t,this.value)}}const Be={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class K extends le{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}function yn(n={}){let t={...Be,...n},e=new K(t,!0),r=new K(t,!1),s=R.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(T)!=o.state.facet(T)||o.startState.field(x,!1)!=o.state.field(x,!1)||m(o.startState)!=m(o.state)||t.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let a=new nt;for(let l of o.viewportLineBlocks){let h=L(o.state,l.from,l.to)?r:B(o.state,l.from,l.to)?e:null;h&&a.add(l.from,l.from,h)}return a.finish()}}),{domEventHandlers:i}=t;return[s,oe({class:"cm-foldGutter",markers(o){var a;return((a=o.plugin(s))===null||a===void 0?void 0:a.markers)||xt.empty},initialSpacer(){return new K(t,!1)},domEventHandlers:{...i,click:(o,a,l)=>{if(i.click&&i.click(o,a,l))return!0;let h=L(o.state,a.from,a.to);if(h)return o.dispatch({effects:D.of(h)}),!0;let f=B(o.state,a.from,a.to);return f?(o.dispatch({effects:E.of(f)}),!0):!1}}}),Ut()]}const Le=b.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class G{constructor(t,e){this.specs=t;let r;function s(a){let l=ut.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const i=typeof e.all=="string"?e.all:e.all?s(e.all):void 0,o=e.scope;this.scope=o instanceof d?a=>a.prop(S)==o.data:o?a=>a==o:void 0,this.style=ee(t.map(a=>({tag:a.tag,class:a.class||s(Object.assign({},a,{tag:null}))})),{all:i}).style,this.module=r?new ut(r):null,this.themeType=e.themeType}static define(t,e){return new G(t,e||{})}}const Y=v.define(),Vt=v.define({combine(n){return n.length?[n[0]]:null}});function U(n){let t=n.facet(Y);return t.length?t:n.facet(Vt)}function vn(n,t){let e=[Re],r;return n instanceof G&&(n.module&&e.push(b.styleModule.of(n.module)),r=n.themeType),t?.fallback?e.push(Vt.of(n)):r?e.push(Y.computeN([b.darkTheme],s=>s.facet(b.darkTheme)==(r=="dark")?[n]:[])):e.push(Y.of(n)),e}function Tn(n,t,e){let r=U(n),s=null;if(r){for(let i of r)if(!i.scope||e&&i.scope(e)){let o=i.style(t);o&&(s=s?s+" "+o:o)}}return s}class Ne{constructor(t){this.markCache=Object.create(null),this.tree=m(t.state),this.decorations=this.buildDeco(t,U(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=m(t.state),r=U(t.state),s=r!=U(t.startState),{viewport:i}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length<i.to&&!s&&e.type==this.tree.type&&o>=i.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||s)&&(this.tree=e,this.decorations=this.buildDeco(t.view,r),this.decoratedTo=i.to)}buildDeco(t,e){if(!e||!this.tree.length)return p.none;let r=new nt;for(let{from:s,to:i}of t.visibleRanges)se(this.tree,e,(o,a,l)=>{r.add(o,a,this.markCache[l]||(this.markCache[l]=p.mark({class:l})))},s,i);return r.finish()}}const Re=Pt.high(R.fromClass(Ne,{decorations:n=>n.decorations})),xn=G.define([{tag:u.meta,color:"#404740"},{tag:u.link,textDecoration:"underline"},{tag:u.heading,textDecoration:"underline",fontWeight:"bold"},{tag:u.emphasis,fontStyle:"italic"},{tag:u.strong,fontWeight:"bold"},{tag:u.strikethrough,textDecoration:"line-through"},{tag:u.keyword,color:"#708"},{tag:[u.atom,u.bool,u.url,u.contentSeparator,u.labelName],color:"#219"},{tag:[u.literal,u.inserted],color:"#164"},{tag:[u.string,u.deleted],color:"#a11"},{tag:[u.regexp,u.escape,u.special(u.string)],color:"#e40"},{tag:u.definition(u.variableName),color:"#00f"},{tag:u.local(u.variableName),color:"#30a"},{tag:[u.typeName,u.namespace],color:"#085"},{tag:u.className,color:"#167"},{tag:[u.special(u.variableName),u.macroName],color:"#256"},{tag:u.definition(u.propertyName),color:"#00c"},{tag:u.comment,color:"#940"},{tag:u.invalid,color:"#f00"}]),Ee=b.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),$t=1e4,jt="()[]{}",zt=v.define({combine(n){return Ct(n,{afterCursor:!0,brackets:jt,maxScanDistance:$t,renderMatch:Ue})}}),Fe=p.mark({class:"cm-matchingBracket"}),We=p.mark({class:"cm-nonmatchingBracket"});function Ue(n){let t=[],e=n.matched?Fe:We;return t.push(e.range(n.start.from,n.start.to)),n.end&&t.push(e.range(n.end.from,n.end.to)),t}function mt(n){let t=[],e=n.facet(zt);for(let r of n.selection.ranges){if(!r.empty)continue;let s=F(n,r.head,-1,e)||r.head>0&&F(n,r.head-1,1,e)||e.afterCursor&&(F(n,r.head,1,e)||r.head<n.doc.length&&F(n,r.head+1,-1,e));s&&(t=t.concat(e.renderMatch(s,n)))}return p.set(t,!0)}const He=R.fromClass(class{constructor(n){this.paused=!1,this.decorations=mt(n.state)}update(n){(n.docChanged||n.selectionSet||this.paused)&&(n.view.composing?(this.decorations=this.decorations.map(n.changes),this.paused=!0):(this.decorations=mt(n.state),this.paused=!1))}},{decorations:n=>n.decorations}),Ve=[He,Ee];function Sn(n={}){return[zt.of(n),Ve]}const $e=new y;function Z(n,t,e){let r=n.prop(t<0?y.openedBy:y.closedBy);if(r)return r;if(n.name.length==1){let s=e.indexOf(n.name);if(s>-1&&s%2==(t<0?1:0))return[e[s+t]]}return null}function tt(n){let t=n.type.prop($e);return t?t(n.node):n}function F(n,t,e,r={}){let s=r.maxScanDistance||$t,i=r.brackets||jt,o=m(n),a=o.resolveInner(t,e);for(let l=a;l;l=l.parent){let h=Z(l.type,e,i);if(h&&l.from<l.to){let f=tt(l);if(f&&(e>0?t>=f.from&&t<f.to:t>f.from&&t<=f.to))return je(n,t,e,l,f,h,i)}}return ze(n,t,e,o,a.type,s,i)}function je(n,t,e,r,s,i,o){let a=r.parent,l={from:s.from,to:s.to},h=0,f=a?.cursor();if(f&&(e<0?f.childBefore(r.from):f.childAfter(r.to)))do if(e<0?f.to<=r.from:f.from>=r.to){if(h==0&&i.indexOf(f.type.name)>-1&&f.from<f.to){let c=tt(f);return{start:l,end:c?{from:c.from,to:c.to}:void 0,matched:!0}}else if(Z(f.type,e,o))h++;else if(Z(f.type,-e,o)){if(h==0){let c=tt(f);return{start:l,end:c&&c.from<c.to?{from:c.from,to:c.to}:void 0,matched:!1}}h--}}while(e<0?f.prevSibling():f.nextSibling());return{start:l,matched:!1}}function ze(n,t,e,r,s,i,o){let a=e<0?n.sliceDoc(t-1,t):n.sliceDoc(t,t+1),l=o.indexOf(a);if(l<0||l%2==0!=e>0)return null;let h={from:e<0?t-1:t,to:e>0?t+1:t},f=n.doc.iterRange(t,e>0?n.doc.length:0),c=0;for(let w=0;!f.next().done&&w<=i;){let k=f.value;e<0&&(w+=k.length);let P=t+w*e;for(let C=e>0?0:k.length-1,te=e>0?k.length:-1;C!=te;C+=e){let q=o.indexOf(k[C]);if(!(q<0||r.resolveInner(P+C,1).type!=s))if(q%2==0==e>0)c++;else{if(c==1)return{start:h,end:{from:P+C,to:P+C+1},matched:q>>1==l>>1};c--}}e>0&&(w+=k.length)}return f.done?{start:h,matched:!1}:null}function kt(n,t,e,r=0,s=0){t==null&&(t=n.search(/[^\s\u00a0]/),t==-1&&(t=n.length));let i=s;for(let o=r;o<t;o++)n.charCodeAt(o)==9?i+=e-i%e:i++;return i}class Gt{constructor(t,e,r,s){this.string=t,this.tabSize=e,this.indentUnit=r,this.overrideIndent=s,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(t){let e=this.string.charAt(this.pos),r;if(typeof t=="string"?r=e==t:r=e&&(t instanceof RegExp?t.test(e):t(e)),r)return++this.pos,e}eatWhile(t){let e=this.pos;for(;this.eat(t););return this.pos>e}eatSpace(){let t=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>t}skipToEnd(){this.pos=this.string.length}skipTo(t){let e=this.string.indexOf(t,this.pos);if(e>-1)return this.pos=e,!0}backUp(t){this.pos-=t}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=kt(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var t;return(t=this.overrideIndent)!==null&&t!==void 0?t:kt(this.string,null,this.tabSize)}match(t,e,r){if(typeof t=="string"){let s=o=>r?o.toLowerCase():o,i=this.string.substr(this.pos,t.length);return s(i)==s(t)?(e!==!1&&(this.pos+=t.length),!0):null}else{let s=this.string.slice(this.pos).match(t);return s&&s.index>0?null:(s&&e!==!1&&(this.pos+=s[0].length),s)}}current(){return this.string.slice(this.start,this.pos)}}function Ge(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||qe,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||ht,mergeTokens:n.mergeTokens!==!1}}function qe(n){if(typeof n!="object")return n;let t={};for(let e in n){let r=n[e];t[e]=r instanceof Array?r.slice():r}return t}const bt=new WeakMap;class qt extends d{constructor(t){let e=It(t.languageData),r=Ge(t),s,i=new class extends Tt{createParse(o,a,l){return new _e(s,o,a,l)}};super(e,i,[],t.name),this.topNode=Xe(e,this),s=this,this.streamParser=r,this.stateAfter=new y({perNode:!0}),this.tokenTable=t.tokenTable?new Qt(r.tokenTable):Qe}static define(t){return new qt(t)}getIndent(t){let e,{overrideIndentation:r}=t.options;r&&(e=bt.get(t.state),e!=null&&e<t.pos-1e4&&(e=void 0));let s=at(this,t.node.tree,t.node.from,t.node.from,e??t.pos),i,o;if(s?(o=s.state,i=s.pos+1):(o=this.streamParser.startState(t.unit),i=t.node.from),t.pos-i>1e4)return null;for(;i<t.pos;){let l=t.state.doc.lineAt(i),h=Math.min(t.pos,l.to);if(l.length){let f=r?r(l.from):-1,c=new Gt(l.text,t.state.tabSize,t.unit,f<0?void 0:f);for(;c.pos<h-l.from;)_t(this.streamParser.token,c,o)}else this.streamParser.blankLine(o,t.unit);if(h==t.pos)break;i=l.to+1}let a=t.lineAt(t.pos);return r&&e==null&&bt.set(t.state,a.from),this.streamParser.indent(o,/^\s*(.*)/.exec(a.text)[1],t)}get allowsNesting(){return!1}}function at(n,t,e,r,s){let i=e>=r&&e+t.length<=s&&t.prop(n.stateAfter);if(i)return{state:n.streamParser.copyState(i),pos:e+t.length};for(let o=t.children.length-1;o>=0;o--){let a=t.children[o],l=e+t.positions[o],h=a instanceof g&&l<s&&at(n,a,l,r,s);if(h)return h}return null}function Jt(n,t,e,r,s){if(s&&e<=0&&r>=t.length)return t;!s&&e==0&&t.type==n.topNode&&(s=!0);for(let i=t.children.length-1;i>=0;i--){let o=t.positions[i],a=t.children[i],l;if(o<r&&a instanceof g){if(!(l=Jt(n,a,e-o,r-o,s)))break;return s?new g(t.type,t.children.slice(0,i).concat(l),t.positions.slice(0,i+1),o+l.length):l}}return null}function Je(n,t,e,r,s){for(let i of t){let o=i.from+(i.openStart?25:0),a=i.to-(i.openEnd?25:0),l=o<=e&&a>e&&at(n,i.tree,0-i.offset,e,a),h;if(l&&l.pos<=r&&(h=Jt(n,i.tree,e+i.offset,l.pos+i.offset,!1)))return{state:l.state,tree:h}}return{state:n.streamParser.startState(s?V(s):4),tree:g.empty}}class _e{constructor(t,e,r,s){this.lang=t,this.input=e,this.fragments=r,this.ranges=s,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=s[s.length-1].to;let i=A.get(),o=s[0].from,{state:a,tree:l}=Je(t,r,o,this.to,i?.state);this.state=a,this.parsedPos=this.chunkStart=o+l.length;for(let h=0;h<l.children.length;h++)this.chunks.push(l.children[h]),this.chunkPos.push(l.positions[h]);i&&this.parsedPos<i.viewport.from-1e5&&s.some(h=>h.from<=i.viewport.from&&h.to>=i.viewport.from)&&(this.state=this.lang.streamParser.startState(V(i.state)),i.skipUntilInView(this.parsedPos,i.viewport.from),this.parsedPos=i.viewport.from),this.moveRangeIndex()}advance(){let t=A.get(),e=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(e,this.chunkStart+512);for(t&&(r=Math.min(r,t.viewport.to));this.parsedPos<r;)this.parseLine(t);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=e?this.finish():t&&this.parsedPos>=t.viewport.to?(t.skipUntilInView(this.parsedPos,e),this.finish()):null}stopAt(t){this.stoppedAt=t}lineAfter(t){let e=this.input.chunk(t);if(this.input.lineChunks)e==`
|
|
2
|
+
`&&(e="");else{let r=e.indexOf(`
|
|
3
|
+
`);r>-1&&(e=e.slice(0,r))}return t+e.length<=this.to?e:e.slice(0,this.to-t)}nextLine(){let t=this.parsedPos,e=this.lineAfter(t),r=t+e.length;for(let s=this.rangeIndex;;){let i=this.ranges[s].to;if(i>=r||(e=e.slice(0,i-(r-e.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,a=this.lineAfter(o);e+=a,r=o+a.length}return{line:e,end:r}}skipGapsTo(t,e,r){for(;;){let s=this.ranges[this.rangeIndex].to,i=t+e;if(r>0?s>i:s>=i)break;let o=this.ranges[++this.rangeIndex].from;e+=o-s}return e}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(t,e,r,s){let i=4;if(this.ranges.length>1){s=this.skipGapsTo(e,s,1),e+=s;let a=this.chunk.length;s=this.skipGapsTo(r,s,-1),r+=s,i+=this.chunk.length-a}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&i==4&&o>=0&&this.chunk[o]==t&&this.chunk[o+2]==e?this.chunk[o+2]=r:this.chunk.push(t,e,r,i),s}parseLine(t){let{line:e,end:r}=this.nextLine(),s=0,{streamParser:i}=this.lang,o=new Gt(e,t?t.state.tabSize:4,t?V(t.state):2);if(o.eol())i.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=_t(i.token,o,this.state);if(a&&(s=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,s)),o.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let t=g.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Ke,topID:0,maxBufferLength:512,reused:this.chunkReused});t=new g(t.type,t.children,t.positions,t.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(t),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new g(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function _t(n,t,e){t.start=t.pos;for(let r=0;r<10;r++){let s=n(t,e);if(t.pos>t.start)return s}throw new Error("Stream parser failed to advance stream.")}const ht=Object.create(null),N=[j.none],Ke=new ne(N),wt=[],yt=Object.create(null),Kt=Object.create(null);for(let[n,t]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Kt[n]=Xt(ht,t);class Qt{constructor(t){this.extra=t,this.table=Object.assign(Object.create(null),Kt)}resolve(t){return t?this.table[t]||(this.table[t]=Xt(this.extra,t)):0}}const Qe=new Qt(ht);function Q(n,t){wt.indexOf(n)>-1||(wt.push(n),console.warn(t))}function Xt(n,t){let e=[];for(let a of t.split(" ")){let l=[];for(let h of a.split(".")){let f=n[h]||u[h];f?typeof f=="function"?l.length?l=l.map(f):Q(h,`Modifier ${h} used at start of tag`):l.length?Q(h,`Tag ${h} used as modifier`):l=Array.isArray(f)?f:[f]:Q(h,`Unknown highlighting tag ${h}`)}for(let h of l)e.push(h)}if(!e.length)return 0;let r=t.replace(/ /g,"_"),s=r+" "+e.map(a=>a.id),i=yt[s];if(i)return i.id;let o=yt[s]=j.define({id:N.length,name:r,props:[re({[r]:e})]});return N.push(o),o.id}function Xe(n,t){let e=j.define({id:N.length,name:"Document",props:[S.add(()=>n),Rt.add(()=>r=>t.getIndent(r))],top:!0});return N.push(e),e}function Yt(n){return n.length<=4096&&/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/.test(n)}function Zt(n){for(let t=n.iter();!t.next().done;)if(Yt(t.value))return!0;return!1}function Ye(n){let t=!1;return n.iterChanges((e,r,s,i,o)=>{!t&&Zt(o)&&(t=!0)}),t}const et=v.define({combine:n=>n.some(t=>t)});function Pn(n={}){let t=[Ze];return n.alwaysIsolate&&t.push(et.of(!0)),t}const Ze=R.fromClass(class{constructor(n){this.always=n.state.facet(et)||n.textDirection!=H.LTR||n.state.facet(b.perLineTextDirection),this.hasRTL=!this.always&&Zt(n.state.doc),this.tree=m(n.state),this.decorations=this.always||this.hasRTL?vt(n,this.tree,this.always):p.none}update(n){let t=n.state.facet(et)||n.view.textDirection!=H.LTR||n.state.facet(b.perLineTextDirection);if(!t&&!this.hasRTL&&Ye(n.changes)&&(this.hasRTL=!0),!t&&!this.hasRTL)return;let e=m(n.state);(t!=this.always||e!=this.tree||n.docChanged||n.viewportChanged)&&(this.tree=e,this.always=t,this.decorations=vt(n.view,e,t))}},{provide:n=>{function t(e){var r,s;return(s=(r=e.plugin(n))===null||r===void 0?void 0:r.decorations)!==null&&s!==void 0?s:p.none}return[b.outerDecorations.of(t),Pt.lowest(b.bidiIsolatedRanges.of(t))]}});function vt(n,t,e){let r=new nt,s=n.visibleRanges;e||(s=tn(s,n.state.doc));for(let{from:i,to:o}of s)t.iterate({enter:a=>{let l=a.type.prop(y.isolate);l&&r.add(a.from,a.to,en[l])},from:i,to:o});return r.finish()}function tn(n,t){let e=t.iter(),r=0,s=[],i=null;for(let{from:o,to:a}of n)if(!(i&&i.to>o&&(o=i.to,o>=a)))for(r+e.value.length<o&&(e.next(o-(r+e.value.length)),r=o);;){let l=r,h=r+e.value.length;if(!e.lineBreak&&Yt(e.value)&&(i&&i.to>l-10?i.to=Math.min(a,h):s.push(i={from:l,to:Math.min(a,h)})),h>=a)break;r=h,e.next()}return s}const en={rtl:p.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:H.RTL}),ltr:p.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:H.LTR}),auto:p.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};export{ue as DocInput,G as HighlightStyle,rt as IndentContext,X as LRLanguage,d as Language,Ot as LanguageDescription,fn as LanguageSupport,A as ParseContext,qt as StreamLanguage,Gt as StringStream,st as TreeIndentContext,Pn as bidiIsolates,Sn as bracketMatching,$e as bracketMatchingHandle,Ut as codeFolding,pn as continuedIndent,xn as defaultHighlightStyle,It as defineLanguageFacet,cn as delimitedIndent,fe as ensureSyntaxTree,dn as flatIndent,Ae as foldAll,Pe as foldCode,E as foldEffect,yn as foldGutter,mn as foldInside,wn as foldKeymap,ve as foldNodeProp,ye as foldService,x as foldState,B as foldable,kn as foldedRanges,ln as forceParsing,V as getIndentUnit,Nt as getIndentation,Tn as highlightingFor,Rt as indentNodeProp,gn as indentOnInput,un as indentRange,ce as indentService,Lt as indentString,Bt as indentUnit,T as language,S as languageDataProp,F as matchBrackets,he as sublanguageProp,vn as syntaxHighlighting,an as syntaxParserRunning,m as syntaxTree,on as syntaxTreeAvailable,bn as toggleFold,Ie as unfoldAll,Ce as unfoldCode,D as unfoldEffect};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aF as _e,bx as yt,R as ze,L as A,m as U,K as P,S as re,by as bt}from"./BeBar3OL.js";const V=[];function Ue(e,t=_e){let n=null;const r=new Set;function a(o){if(yt(e,o)&&(e=o,n)){const l=!V.length;for(const c of r)c[1](),V.push(c,e);if(l){for(let c=0;c<V.length;c+=2)V[c][0](V[c+1]);V.length=0}}}function i(o){a(o(e))}function s(o,l=_e){const c=[o,l];return r.add(c),r.size===1&&(n=t(a,i)||_e),o(e),()=>{r.delete(c),r.size===0&&n&&(n(),n=null)}}return{set:a,update:i,subscribe:s}}class Pe{constructor(t,n){this.status=t,typeof n=="string"?this.body={message:n}:n?this.body=n:this.body={message:`Error: ${t}`}}toString(){return JSON.stringify(this.body)}}class Te{constructor(t,n){this.status=t,this.location=n}}class Ie extends Error{constructor(t,n,r){super(r),this.status=t,this.text=n}}new URL("sveltekit-internal://");function kt(e,t){return e==="/"||t==="ignore"?e:t==="never"?e.endsWith("/")?e.slice(0,-1):e:t==="always"&&!e.endsWith("/")?e+"/":e}function St(e){return e.split("%25").map(decodeURI).join("%25")}function Et(e){for(const t in e)e[t]=decodeURIComponent(e[t]);return e}function we({href:e}){return e.split("#")[0]}function Rt(e,t,n,r=!1){const a=new URL(e);Object.defineProperty(a,"searchParams",{value:new Proxy(a.searchParams,{get(s,o){if(o==="get"||o==="getAll"||o==="has")return(c,...d)=>(n(c),s[o](c,...d));t();const l=Reflect.get(s,o);return typeof l=="function"?l.bind(s):l}}),enumerable:!0,configurable:!0});const i=["href","pathname","search","toString","toJSON"];r&&i.push("hash");for(const s of i)Object.defineProperty(a,s,{get(){return t(),e[s]},enumerable:!0,configurable:!0});return a}function xt(...e){let t=5381;for(const n of e)if(typeof n=="string"){let r=n.length;for(;r;)t=t*33^n.charCodeAt(--r)}else if(ArrayBuffer.isView(n)){const r=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);let a=r.length;for(;a;)t=t*33^r[--a]}else throw new TypeError("value must be a string or TypedArray");return(t>>>0).toString(36)}new TextEncoder;new TextDecoder;function Lt(e){const t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}const At=window.fetch;window.fetch=(e,t)=>((e instanceof Request?e.method:t?.method||"GET")!=="GET"&&M.delete(Oe(e)),At(e,t));const M=new Map;function Ut(e,t){const n=Oe(e,t),r=document.querySelector(n);if(r?.textContent){r.remove();let{body:a,...i}=JSON.parse(r.textContent);const s=r.getAttribute("data-ttl");return s&&M.set(n,{body:a,init:i,ttl:1e3*Number(s)}),r.getAttribute("data-b64")!==null&&(a=Lt(a)),Promise.resolve(new Response(a,i))}return window.fetch(e,t)}function Pt(e,t,n){if(M.size>0){const r=Oe(e,n),a=M.get(r);if(a){if(performance.now()<a.ttl&&["default","force-cache","only-if-cached",void 0].includes(n?.cache))return new Response(a.body,a.init);M.delete(r)}}return window.fetch(t,n)}function Oe(e,t){let r=`script[data-sveltekit-fetched][data-url=${JSON.stringify(e instanceof Request?e.url:e)}]`;if(t?.headers||t?.body){const a=[];t.headers&&a.push([...new Headers(t.headers)].join(",")),t.body&&(typeof t.body=="string"||ArrayBuffer.isView(t.body))&&a.push(t.body),r+=`[data-hash="${xt(...a)}"]`}return r}const Tt=/^(\[)?(\.\.\.)?(\w+)(?:=(\w+))?(\])?$/;function It(e){const t=[];return{pattern:e==="/"?/^\/$/:new RegExp(`^${$t(e).map(r=>{const a=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(r);if(a)return t.push({name:a[1],matcher:a[2],optional:!1,rest:!0,chained:!0}),"(?:/([^]*))?";const i=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(r);if(i)return t.push({name:i[1],matcher:i[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!r)return;const s=r.split(/\[(.+?)\](?!\])/);return"/"+s.map((l,c)=>{if(c%2){if(l.startsWith("x+"))return ve(String.fromCharCode(parseInt(l.slice(2),16)));if(l.startsWith("u+"))return ve(String.fromCharCode(...l.slice(2).split("-").map(w=>parseInt(w,16))));const d=Tt.exec(l),[,p,f,u,h]=d;return t.push({name:u,matcher:h,optional:!!p,rest:!!f,chained:f?c===1&&s[0]==="":!1}),f?"([^]*?)":p?"([^/]*)?":"([^/]+?)"}return ve(l)}).join("")}).join("")}/?$`),params:t}}function Ot(e){return e!==""&&!/^\([^)]+\)$/.test(e)}function $t(e){return e.slice(1).split("/").filter(Ot)}function Ct(e,t,n){const r={},a=e.slice(1),i=a.filter(o=>o!==void 0);let s=0;for(let o=0;o<t.length;o+=1){const l=t[o];let c=a[o-s];if(l.chained&&l.rest&&s&&(c=a.slice(o-s,o+1).filter(d=>d).join("/"),s=0),c===void 0)if(l.rest)c="";else continue;if(!l.matcher||n[l.matcher](c)){r[l.name]=c;const d=t[o+1],p=a[o+1];d&&!d.rest&&d.optional&&p&&l.chained&&(s=0),!d&&!p&&Object.keys(r).length===i.length&&(s=0);continue}if(l.optional&&l.chained){s++;continue}return}if(!s)return r}function ve(e){return e.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function jt({nodes:e,server_loads:t,dictionary:n,matchers:r}){const a=new Set(t);return Object.entries(n).map(([o,[l,c,d]])=>{const{pattern:p,params:f}=It(o),u={id:o,exec:h=>{const w=p.exec(h);if(w)return Ct(w,f,r)},errors:[1,...d||[]].map(h=>e[h]),layouts:[0,...c||[]].map(s),leaf:i(l)};return u.errors.length=u.layouts.length=Math.max(u.errors.length,u.layouts.length),u});function i(o){const l=o<0;return l&&(o=~o),[l,e[o]]}function s(o){return o===void 0?o:[a.has(o),e[o]]}}function Ze(e,t=JSON.parse){try{return t(sessionStorage[e])}catch{}}function He(e,t,n=JSON.stringify){const r=n(t);try{sessionStorage[e]=r}catch{}}const x=globalThis.__sveltekit_9bi1w7?.base??"",Nt=globalThis.__sveltekit_9bi1w7?.assets??x??"",qt="1774242417908",et="sveltekit:snapshot",tt="sveltekit:scroll",nt="sveltekit:states",Dt="sveltekit:pageurl",B="sveltekit:history",H="sveltekit:navigation",N={tap:1,hover:2,viewport:3,eager:4,off:-1,false:-1},pe=location.origin;function $e(e){if(e instanceof URL)return e;let t=document.baseURI;if(!t){const n=document.getElementsByTagName("base");t=n.length?n[0].href:document.URL}return new URL(e,t)}function q(){return{x:pageXOffset,y:pageYOffset}}function K(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const We={...N,"":N.hover};function rt(e){let t=e.assignedSlot??e.parentNode;return t?.nodeType===11&&(t=t.host),t}function at(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=rt(e)}}function Se(e,t,n){let r;try{if(r=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI),n&&r.hash.match(/^#[^/]/)){const o=location.hash.split("#")[1]||"/";r.hash=`#${o}${r.hash}`}}catch{}const a=e instanceof SVGAElement?e.target.baseVal:e.target,i=!r||!!a||ge(r,t,n)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),s=r?.origin===pe&&e.hasAttribute("download");return{url:r,external:i,target:a,download:s}}function ae(e){let t=null,n=null,r=null,a=null,i=null,s=null,o=e;for(;o&&o!==document.documentElement;)r===null&&(r=K(o,"preload-code")),a===null&&(a=K(o,"preload-data")),t===null&&(t=K(o,"keepfocus")),n===null&&(n=K(o,"noscroll")),i===null&&(i=K(o,"reload")),s===null&&(s=K(o,"replacestate")),o=rt(o);function l(c){switch(c){case"":case"true":return!0;case"off":case"false":return!1;default:return}}return{preload_code:We[r??"off"],preload_data:We[a??"off"],keepfocus:l(t),noscroll:l(n),reload:l(i),replace_state:l(s)}}function Je(e){const t=Ue(e);let n=!0;function r(){n=!0,t.update(s=>s)}function a(s){n=!1,t.set(s)}function i(s){let o;return t.subscribe(l=>{(o===void 0||n&&l!==o)&&s(o=l)})}return{notify:r,set:a,subscribe:i}}const ot={v:()=>{}};function Vt(){const{set:e,subscribe:t}=Ue(!1);let n;async function r(){clearTimeout(n);try{const a=await fetch(`${Nt}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!a.ok)return!1;const s=(await a.json()).version!==qt;return s&&(e(!0),ot.v(),clearTimeout(n)),s}catch{return!1}}return{subscribe:t,check:r}}function ge(e,t,n){return e.origin!==pe||!e.pathname.startsWith(t)?!0:n?e.pathname!==location.pathname:!1}function dn(e){}const st=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...st];const Kt=new Set([...st]);[...Kt];function Bt(e){return e.filter(t=>t!=null)}function Ce(e){return e instanceof Pe||e instanceof Ie?e.status:500}function Ft(e){return e instanceof Ie?e.text:"Internal Error"}let b,W,ye;const Gt=ze.toString().includes("$$")||/function \w+\(\) \{\}/.test(ze.toString());Gt?(b={data:{},form:null,error:null,params:{},route:{id:null},state:{},status:-1,url:new URL("https://example.com")},W={current:null},ye={current:!1}):(b=new class{#e=A({});get data(){return U(this.#e)}set data(t){P(this.#e,t)}#t=A(null);get form(){return U(this.#t)}set form(t){P(this.#t,t)}#n=A(null);get error(){return U(this.#n)}set error(t){P(this.#n,t)}#r=A({});get params(){return U(this.#r)}set params(t){P(this.#r,t)}#a=A({id:null});get route(){return U(this.#a)}set route(t){P(this.#a,t)}#o=A({});get state(){return U(this.#o)}set state(t){P(this.#o,t)}#s=A(-1);get status(){return U(this.#s)}set status(t){P(this.#s,t)}#i=A(new URL("https://example.com"));get url(){return U(this.#i)}set url(t){P(this.#i,t)}},W=new class{#e=A(null);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},ye=new class{#e=A(!1);get current(){return U(this.#e)}set current(t){P(this.#e,t)}},ot.v=()=>ye.current=!0);function it(e){Object.assign(b,e)}const Ye={spanContext(){return Mt},setAttribute(){return this},setAttributes(){return this},addEvent(){return this},setStatus(){return this},updateName(){return this},end(){return this},isRecording(){return!1},recordException(){return this},addLink(){return this},addLinks(){return this}},Mt={traceId:"",spanId:"",traceFlags:0},zt=new Set(["icon","shortcut icon","apple-touch-icon"]),j=Ze(tt)??{},J=Ze(et)??{},C={url:Je({}),page:Je({}),navigating:Ue(null),updated:Vt()};function je(e){j[e]=q()}function Ht(e,t){let n=e+1;for(;j[n];)delete j[n],n+=1;for(n=t+1;J[n];)delete J[n],n+=1}function Y(e,t=!1){return t?location.replace(e.href):location.href=e.href,new Promise(()=>{})}async function lt(){if("serviceWorker"in navigator){const e=await navigator.serviceWorker.getRegistration(x||"/");e&&await e.update()}}function Ee(){}let Ne,Re,oe,T,xe,v;const se=[],ie=[];let L=null;function le(){L?.fork?.then(e=>e?.discard()),L=null}const ne=new Map,ct=new Set,Wt=new Set,z=new Set;let _={branch:[],error:null,url:null},ut=!1,ce=!1,Xe=!0,X=!1,G=!1,ft=!1,Z=!1,qe,y,R,I;const ue=new Set;let be;const fe=new Map;async function mn(e,t,n){globalThis.__sveltekit_9bi1w7?.data&&globalThis.__sveltekit_9bi1w7.data,document.URL!==location.href&&(location.href=location.href),v=e,await e.hooks.init?.(),Ne=jt(e),T=document.documentElement,xe=t,Re=e.nodes[0],oe=e.nodes[1],Re(),oe(),y=history.state?.[B],R=history.state?.[H],y||(y=R=Date.now(),history.replaceState({...history.state,[B]:y,[H]:R},""));const r=j[y];function a(){r&&(history.scrollRestoration="manual",scrollTo(r.x,r.y))}n?(a(),await sn(xe,n)):(await F({type:"enter",url:$e(v.hash?un(new URL(location.href)):location.href),replace_state:!0}),a()),on()}async function Jt(e=!0,t=!0){if(await(be||=Promise.resolve()),!be)return;be=null;const n=I={},r=await ee(_.url,!0);if(le(),Z&&fe.forEach(({resource:a})=>{a.refresh?.()}),e){const a=b.state,i=r&&await Be(r);if(!i||n!==I)return;if(i.type==="redirect")return De(new URL(i.location,_.url).href,{replaceState:!0},1,n);t||(i.props.page.state=a),it(i.props.page),_=i.state,Le(),qe.$set(i.props)}else Le();await Promise.all([...fe.values()].map(({resource:a})=>a)).catch(Ee)}function Le(){se.length=0,Z=!1}function dt(e){ie.some(t=>t?.snapshot)&&(J[e]=ie.map(t=>t?.snapshot?.capture()))}function ht(e){J[e]?.forEach((t,n)=>{ie[n]?.snapshot?.restore(t)})}function Qe(){je(y),He(tt,j),dt(R),He(et,J)}async function De(e,t,n,r){let a;t.invalidateAll&&le(),await F({type:"goto",url:$e(e),keepfocus:t.keepFocus,noscroll:t.noScroll,replace_state:t.replaceState,state:t.state,redirect_count:n,nav_token:r,accept:()=>{t.invalidateAll&&(Z=!0,a=[...fe.keys()]),t.invalidate&&t.invalidate.forEach(an)}}),t.invalidateAll&&re().then(re).then(()=>{fe.forEach(({resource:i},s)=>{a?.includes(s)&&i.refresh?.()})})}async function Yt(e){if(e.id!==L?.id){le();const t={};ue.add(t),L={id:e.id,token:t,promise:Be({...e,preload:t}).then(n=>(ue.delete(t),n.type==="loaded"&&n.state.error&&le(),n)),fork:null}}return L.promise}async function ke(e){const t=(await ee(e,!1))?.route;t&&await Promise.all([...t.layouts,t.leaf].filter(Boolean).map(n=>n[1]()))}async function pt(e,t,n){_=e.state;const r=document.querySelector("style[data-sveltekit]");if(r&&r.remove(),Object.assign(b,e.props.page),qe=new v.root({target:t,props:{...e.props,stores:C,components:ie},hydrate:n,sync:!1}),await Promise.resolve(),ht(R),n){const a={from:null,to:{params:_.params,route:{id:_.route?.id??null},url:new URL(location.href),scroll:j[y]??q()},willUnload:!1,type:"enter",complete:Promise.resolve()};z.forEach(i=>i(a))}ce=!0}function de({url:e,params:t,branch:n,status:r,error:a,route:i,form:s}){let o="never";if(x&&(e.pathname===x||e.pathname===x+"/"))o="always";else for(const u of n)u?.slash!==void 0&&(o=u.slash);e.pathname=kt(e.pathname,o),e.search=e.search;const l={type:"loaded",state:{url:e,params:t,branch:n,error:a,route:i},props:{constructors:Bt(n).map(u=>u.node.component),page:Me(b)}};s!==void 0&&(l.props.form=s);let c={},d=!b,p=0;for(let u=0;u<Math.max(n.length,_.branch.length);u+=1){const h=n[u],w=_.branch[u];h?.data!==w?.data&&(d=!0),h&&(c={...c,...h.data},d&&(l.props[`data_${p}`]=c),p+=1)}return(!_.url||e.href!==_.url.href||_.error!==a||s!==void 0&&s!==b.form||d)&&(l.props.page={error:a,params:t,route:{id:i?.id??null},state:{},status:r,url:new URL(e),form:s??null,data:d?c:b.data}),l}async function Ve({loader:e,parent:t,url:n,params:r,route:a,server_data_node:i}){let s=null,o=!0;const l={dependencies:new Set,params:new Set,parent:!1,route:!1,url:!1,search_params:new Set},c=await e();if(c.universal?.load){let d=function(...f){for(const u of f){const{href:h}=new URL(u,n);l.dependencies.add(h)}};const p={tracing:{enabled:!1,root:Ye,current:Ye},route:new Proxy(a,{get:(f,u)=>(o&&(l.route=!0),f[u])}),params:new Proxy(r,{get:(f,u)=>(o&&l.params.add(u),f[u])}),data:i?.data??null,url:Rt(n,()=>{o&&(l.url=!0)},f=>{o&&l.search_params.add(f)},v.hash),async fetch(f,u){f instanceof Request&&(u={body:f.method==="GET"||f.method==="HEAD"?void 0:await f.blob(),cache:f.cache,credentials:f.credentials,headers:[...f.headers].length>0?f?.headers:void 0,integrity:f.integrity,keepalive:f.keepalive,method:f.method,mode:f.mode,redirect:f.redirect,referrer:f.referrer,referrerPolicy:f.referrerPolicy,signal:f.signal,...u});const{resolved:h,promise:w}=gt(f,u,n);return o&&d(h.href),w},setHeaders:()=>{},depends:d,parent(){return o&&(l.parent=!0),t()},untrack(f){o=!1;try{return f()}finally{o=!0}}};s=await c.universal.load.call(null,p)??null}return{node:c,loader:e,server:i,universal:c.universal?.load?{type:"data",data:s,uses:l}:null,data:s??i?.data??null,slash:c.universal?.trailingSlash??i?.slash}}function gt(e,t,n){let r=e instanceof Request?e.url:e;const a=new URL(r,n);a.origin===n.origin&&(r=a.href.slice(n.origin.length));const i=ce?Pt(r,a.href,t):Ut(r,t);return{resolved:a,promise:i}}function Xt(e,t,n,r,a,i){if(Z)return!0;if(!a)return!1;if(a.parent&&e||a.route&&t||a.url&&n)return!0;for(const s of a.search_params)if(r.has(s))return!0;for(const s of a.params)if(i[s]!==_.params[s])return!0;for(const s of a.dependencies)if(se.some(o=>o(new URL(s))))return!0;return!1}function Ke(e,t){return e?.type==="data"?e:e?.type==="skip"?t??null:null}function Qt(e,t){if(!e)return new Set(t.searchParams.keys());const n=new Set([...e.searchParams.keys(),...t.searchParams.keys()]);for(const r of n){const a=e.searchParams.getAll(r),i=t.searchParams.getAll(r);a.every(s=>i.includes(s))&&i.every(s=>a.includes(s))&&n.delete(r)}return n}function Zt({error:e,url:t,route:n,params:r}){return{type:"loaded",state:{error:e,url:t,route:n,params:r,branch:[]},props:{page:Me(b),constructors:[]}}}async function Be({id:e,invalidating:t,url:n,params:r,route:a,preload:i}){if(L?.id===e)return ue.delete(L.token),L.promise;const{errors:s,layouts:o,leaf:l}=a,c=[...o,l];s.forEach(m=>m?.().catch(()=>{})),c.forEach(m=>m?.[1]().catch(()=>{}));const d=_.url?e!==he(_.url):!1,p=_.route?a.id!==_.route.id:!1,f=Qt(_.url,n);let u=!1;const h=c.map(async(m,g)=>{if(!m)return;const S=_.branch[g];return m[1]===S?.loader&&!Xt(u,p,d,f,S.universal?.uses,r)?S:(u=!0,Ve({loader:m[1],url:n,params:r,route:a,parent:async()=>{const O={};for(let $=0;$<g;$+=1)Object.assign(O,(await h[$])?.data);return O},server_data_node:Ke(m[0]?{type:"skip"}:null,m[0]?S?.server:void 0)}))});for(const m of h)m.catch(()=>{});const w=[];for(let m=0;m<c.length;m+=1)if(c[m])try{w.push(await h[m])}catch(g){if(g instanceof Te)return{type:"redirect",location:g.location};if(ue.has(i))return Zt({error:await Q(g,{params:r,url:n,route:{id:a.id}}),url:n,params:r,route:a});let S=Ce(g),E;if(g instanceof Pe)E=g.body;else{if(await C.updated.check())return await lt(),await Y(n);E=await Q(g,{params:r,url:n,route:{id:a.id}})}const O=await en(m,w,s);return O?de({url:n,params:r,branch:w.slice(0,O.idx).concat(O.node),status:S,error:E,route:a}):await _t(n,{id:a.id},E,S)}else w.push(void 0);return de({url:n,params:r,branch:w,status:200,error:null,route:a,form:t?void 0:null})}async function en(e,t,n){for(;e--;)if(n[e]){let r=e;for(;!t[r];)r-=1;try{return{idx:r+1,node:{node:await n[e](),loader:n[e],data:{},server:null,universal:null}}}catch{continue}}}async function Fe({status:e,error:t,url:n,route:r}){const a={};let i=null;try{const s=await Ve({loader:Re,url:n,params:a,route:r,parent:()=>Promise.resolve({}),server_data_node:Ke(i)}),o={node:await oe(),loader:oe,universal:null,server:null,data:null};return de({url:n,params:a,branch:[s,o],status:e,error:t,route:null})}catch(s){if(s instanceof Te)return De(new URL(s.location,location.href),{},0);throw s}}async function tn(e){const t=e.href;if(ne.has(t))return ne.get(t);let n;try{const r=(async()=>{let a=await v.hooks.reroute({url:new URL(e),fetch:async(i,s)=>gt(i,s,e).promise})??e;if(typeof a=="string"){const i=new URL(e);v.hash?i.hash=a:i.pathname=a,a=i}return a})();ne.set(t,r),n=await r}catch{ne.delete(t);return}return n}async function ee(e,t){if(e&&!ge(e,x,v.hash)){const n=await tn(e);if(!n)return;const r=nn(n);for(const a of Ne){const i=a.exec(r);if(i)return{id:he(e),invalidating:t,route:a,params:Et(i),url:e}}}}function nn(e){return St(v.hash?e.hash.replace(/^#/,"").replace(/[?#].+/,""):e.pathname.slice(x.length))||"/"}function he(e){return(v.hash?e.hash.replace(/^#/,""):e.pathname)+e.search}function mt({url:e,type:t,intent:n,delta:r,event:a,scroll:i}){let s=!1;const o=Ge(_,n,e,t,i??null);r!==void 0&&(o.navigation.delta=r),a!==void 0&&(o.navigation.event=a);const l={...o.navigation,cancel:()=>{s=!0,o.reject(new Error("navigation cancelled"))}};return X||ct.forEach(c=>c(l)),s?null:o}async function F({type:e,url:t,popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s={},redirect_count:o=0,nav_token:l={},accept:c=Ee,block:d=Ee,event:p}){const f=I;I=l;const u=await ee(t,!1),h=e==="enter"?Ge(_,u,t,e):mt({url:t,type:e,delta:n?.delta,intent:u,scroll:n?.scroll,event:p});if(!h){d(),I===l&&(I=f);return}const w=y,m=R;c(),X=!0,ce&&h.navigation.type!=="enter"&&C.navigating.set(W.current=h.navigation);let g=u&&await Be(u);if(!g){if(ge(t,x,v.hash))return await Y(t,i);g=await _t(t,{id:null},await Q(new Ie(404,"Not Found",`Not found: ${t.pathname}`),{url:t,params:{},route:{id:null}}),404,i)}if(t=u?.url||t,I!==l)return h.reject(new Error("navigation aborted")),!1;if(g.type==="redirect"){if(o<20){await F({type:e,url:new URL(g.location,t),popped:n,keepfocus:r,noscroll:a,replace_state:i,state:s,redirect_count:o+1,nav_token:l}),h.fulfil(void 0);return}g=await Fe({status:500,error:await Q(new Error("Redirect loop"),{url:t,params:{},route:{id:null}}),url:t,route:{id:null}})}else g.props.page.status>=400&&await C.updated.check()&&(await lt(),await Y(t,i));if(Le(),je(w),dt(m),g.props.page.url.pathname!==t.pathname&&(t.pathname=g.props.page.url.pathname),s=n?n.state:s,!n){const k=i?0:1,te={[B]:y+=k,[H]:R+=k,[nt]:s};(i?history.replaceState:history.pushState).call(history,te,"",t),i||Ht(y,R)}const S=u&&L?.id===u.id?L.fork:null;L=null,g.props.page.state=s;let E;if(ce){const k=(await Promise.all(Array.from(Wt,D=>D(h.navigation)))).filter(D=>typeof D=="function");if(k.length>0){let D=function(){k.forEach(me=>{z.delete(me)})};k.push(D),k.forEach(me=>{z.add(me)})}_=g.state,g.props.page&&(g.props.page.url=t);const te=S&&await S;te?E=te.commit():(qe.$set(g.props),it(g.props.page),E=bt?.()),ft=!0}else await pt(g,xe,!1);const{activeElement:O}=document;await E,await re(),await re();let $=null;if(Xe){const k=n?n.scroll:a?q():null;k?scrollTo(k.x,k.y):($=t.hash&&document.getElementById(wt(t)))?$.scrollIntoView():scrollTo(0,0)}const vt=document.activeElement!==O&&document.activeElement!==document.body;!r&&!vt&&cn(t,!$),Xe=!0,g.props.page&&Object.assign(b,g.props.page),X=!1,e==="popstate"&&ht(R),h.fulfil(void 0),h.navigation.to&&(h.navigation.to.scroll=q()),z.forEach(k=>k(h.navigation)),C.navigating.set(W.current=null)}async function _t(e,t,n,r,a){return e.origin===pe&&e.pathname===location.pathname&&!ut?await Fe({status:r,error:n,url:e,route:t}):await Y(e,a)}function rn(){let e,t={element:void 0,href:void 0},n;T.addEventListener("mousemove",o=>{const l=o.target;clearTimeout(e),e=setTimeout(()=>{i(l,N.hover)},20)});function r(o){o.defaultPrevented||i(o.composedPath()[0],N.tap)}T.addEventListener("mousedown",r),T.addEventListener("touchstart",r,{passive:!0});const a=new IntersectionObserver(o=>{for(const l of o)l.isIntersecting&&(ke(new URL(l.target.href)),a.unobserve(l.target))},{threshold:0});async function i(o,l){const c=at(o,T),d=c===t.element&&c?.href===t.href&&l>=n;if(!c||d)return;const{url:p,external:f,download:u}=Se(c,x,v.hash);if(f||u)return;const h=ae(c),w=p&&he(_.url)===he(p);if(!(h.reload||w))if(l<=h.preload_data){t={element:c,href:c.href},n=N.tap;const m=await ee(p,!1);if(!m)return;Yt(m)}else l<=h.preload_code&&(t={element:c,href:c.href},n=l,ke(p))}function s(){a.disconnect();for(const o of T.querySelectorAll("a")){const{url:l,external:c,download:d}=Se(o,x,v.hash);if(c||d)continue;const p=ae(o);p.reload||(p.preload_code===N.viewport&&a.observe(o),p.preload_code===N.eager&&ke(l))}}z.add(s),s()}function Q(e,t){if(e instanceof Pe)return e.body;const n=Ce(e),r=Ft(e);return v.hooks.handleError({error:e,event:t,status:n,message:r})??{message:r}}function _n(e,t={}){return e=new URL($e(e)),e.origin!==pe?Promise.reject(new Error("goto: invalid URL")):De(e,t,0)}function an(e){if(typeof e=="function")se.push(e);else{const{href:t}=new URL(e,location.href);se.push(n=>n.href===t)}}function wn(){return Z=!0,Jt()}function on(){history.scrollRestoration="manual",addEventListener("beforeunload",t=>{let n=!1;if(Qe(),!X){const r=Ge(_,void 0,null,"leave"),a={...r.navigation,cancel:()=>{n=!0,r.reject(new Error("navigation cancelled"))}};ct.forEach(i=>i(a))}n?(t.preventDefault(),t.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Qe()}),navigator.connection?.saveData||rn(),T.addEventListener("click",async t=>{if(t.button||t.which!==1||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.defaultPrevented)return;const n=at(t.composedPath()[0],T);if(!n)return;const{url:r,external:a,target:i,download:s}=Se(n,x,v.hash);if(!r)return;if(i==="_parent"||i==="_top"){if(window.parent!==window)return}else if(i&&i!=="_self")return;const o=ae(n);if(!(n instanceof SVGAElement)&&r.protocol!==location.protocol&&!(r.protocol==="https:"||r.protocol==="http:")||s)return;const[c,d]=(v.hash?r.hash.replace(/^#/,""):r.href).split("#"),p=c===we(location);if(a||o.reload&&(!p||!d)){mt({url:r,type:"link",event:t})?X=!0:t.preventDefault();return}if(d!==void 0&&p){const[,f]=_.url.href.split("#");if(f===d){if(t.preventDefault(),d===""||d==="top"&&n.ownerDocument.getElementById("top")===null)scrollTo({top:0});else{const u=n.ownerDocument.getElementById(decodeURIComponent(d));u&&(u.scrollIntoView(),u.focus())}return}if(G=!0,je(y),e(r),!o.replace_state)return;G=!1}t.preventDefault(),await new Promise(f=>{requestAnimationFrame(()=>{setTimeout(f,0)}),setTimeout(f,100)}),await F({type:"link",url:r,keepfocus:o.keepfocus,noscroll:o.noscroll,replace_state:o.replace_state??r.href===location.href,event:t})}),T.addEventListener("submit",t=>{if(t.defaultPrevented)return;const n=HTMLFormElement.prototype.cloneNode.call(t.target),r=t.submitter;if((r?.formTarget||n.target)==="_blank"||(r?.formMethod||n.method)!=="get")return;const s=new URL(r?.hasAttribute("formaction")&&r?.formAction||n.action);if(ge(s,x,!1))return;const o=t.target,l=ae(o);if(l.reload)return;t.preventDefault(),t.stopPropagation();const c=new FormData(o,r);s.search=new URLSearchParams(c).toString(),F({type:"form",url:s,keepfocus:l.keepfocus,noscroll:l.noscroll,replace_state:l.replace_state??s.href===location.href,event:t})}),addEventListener("popstate",async t=>{if(!Ae){if(t.state?.[B]){const n=t.state[B];if(I={},n===y)return;const r=j[n],a=t.state[nt]??{},i=new URL(t.state[Dt]??location.href),s=t.state[H],o=_.url?we(location)===we(_.url):!1;if(s===R&&(ft||o)){a!==b.state&&(b.state=a),e(i),j[y]=q(),r&&scrollTo(r.x,r.y),y=n;return}const c=n-y;await F({type:"popstate",url:i,popped:{state:a,scroll:r,delta:c},accept:()=>{y=n,R=s},block:()=>{history.go(-c)},nav_token:I,event:t})}else if(!G){const n=new URL(location.href);e(n),v.hash&&location.reload()}}}),addEventListener("hashchange",()=>{G&&(G=!1,history.replaceState({...history.state,[B]:++y,[H]:R},"",location.href))});for(const t of document.querySelectorAll("link"))zt.has(t.rel)&&(t.href=t.href);addEventListener("pageshow",t=>{t.persisted&&C.navigating.set(W.current=null)});function e(t){_.url=b.url=t,C.page.set(Me(b)),C.page.notify()}}async function sn(e,{status:t=200,error:n,node_ids:r,params:a,route:i,server_route:s,data:o,form:l}){ut=!0;const c=new URL(location.href);let d;({params:a={},route:i={id:null}}=await ee(c,!1)||{}),d=Ne.find(({id:u})=>u===i.id);let p,f=!0;try{const u=r.map(async(w,m)=>{const g=o[m];return g?.uses&&(g.uses=ln(g.uses)),Ve({loader:v.nodes[w],url:c,params:a,route:i,parent:async()=>{const S={};for(let E=0;E<m;E+=1)Object.assign(S,(await u[E]).data);return S},server_data_node:Ke(g)})}),h=await Promise.all(u);if(d){const w=d.layouts;for(let m=0;m<w.length;m++)w[m]||h.splice(m,0,void 0)}p=de({url:c,params:a,branch:h,status:t,error:n,form:l,route:d??null})}catch(u){if(u instanceof Te){await Y(new URL(u.location,location.href));return}p=await Fe({status:Ce(u),error:await Q(u,{url:c,params:a,route:i}),url:c,route:i}),e.textContent="",f=!1}p.props.page&&(p.props.page.state={}),await pt(p,e,f)}function ln(e){return{dependencies:new Set(e?.dependencies??[]),params:new Set(e?.params??[]),parent:!!e?.parent,route:!!e?.route,url:!!e?.url,search_params:new Set(e?.search_params??[])}}let Ae=!1;function cn(e,t=!0){const n=document.querySelector("[autofocus]");if(n)n.focus();else{const r=wt(e);if(r&&document.getElementById(r)){const{x:i,y:s}=q();setTimeout(()=>{const o=history.state;Ae=!0,location.replace(new URL(`#${r}`,location.href)),history.replaceState(o,"",e),t&&scrollTo(i,s),Ae=!1})}else{const i=document.body,s=i.getAttribute("tabindex");i.tabIndex=-1,i.focus({preventScroll:!0,focusVisible:!1}),s!==null?i.setAttribute("tabindex",s):i.removeAttribute("tabindex")}const a=getSelection();if(a&&a.type!=="None"){const i=[];for(let s=0;s<a.rangeCount;s+=1)i.push(a.getRangeAt(s));setTimeout(()=>{if(a.rangeCount===i.length){for(let s=0;s<a.rangeCount;s+=1){const o=i[s],l=a.getRangeAt(s);if(o.commonAncestorContainer!==l.commonAncestorContainer||o.startContainer!==l.startContainer||o.endContainer!==l.endContainer||o.startOffset!==l.startOffset||o.endOffset!==l.endOffset)return}a.removeAllRanges()}})}}}function Ge(e,t,n,r,a=null){let i,s;const o=new Promise((c,d)=>{i=c,s=d});return o.catch(()=>{}),{navigation:{from:{params:e.params,route:{id:e.route?.id??null},url:e.url,scroll:q()},to:n&&{params:t?.params??null,route:{id:t?.route?.id??null},url:n,scroll:a},willUnload:!t,type:r,complete:o},fulfil:i,reject:s}}function Me(e){return{data:e.data,error:e.error,form:e.form,params:e.params,route:e.route,state:e.state,status:e.status,url:e.url}}function un(e){const t=new URL(e);return t.hash=decodeURIComponent(e.hash),t}function wt(e){let t;if(v.hash){const[,,n]=e.hash.split("#",3);t=n??""}else t=e.hash.slice(1);return decodeURIComponent(t)}export{mn as a,_n as g,wn as i,dn as l,b as p,C as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c,a as p}from"./Cs_ROD7H.js";import"./CQCkXCml.js";import{f as i}from"./BeBar3OL.js";import{I as l,s as m}from"./Cg9NOuOl.js";import{l as d,s as f}from"./xBRYfpah.js";function k(t,o){const e=d(o,["children","$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 6 9 17l-5-5"}]];l(t,f({name:"check"},()=>e,{get iconNode(){return r},children:(a,$)=>{var s=c(),n=i(s);m(n,o,"default",{}),p(a,s)},$$slots:{default:!0}}))}export{k as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as v,h as o,a as y,E as f,r as l,s as m,c as p,d as i,H as T,e as A}from"./BeBar3OL.js";import{B as E}from"./xBRYfpah.js";function g(d,_,e){var s;o&&(s=A,y());var r=new E(d);v(()=>{var a=_()??null;if(o){var h=l(s),c=h===T,u=a!==null;if(c!==u){var t=m();p(t),r.anchor=t,i(!1),r.ensure(a,a&&(n=>e(n,a))),i(!0);return}}r.ensure(a,a&&(n=>e(n,a)))},f)}export{g as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{b as me,E as _e,b7 as ue,V as x,X as le,M as fe,h as U,aq as Le,b8 as Oe,b9 as Ie,aC as ke,ba as Re,bb as Pe,bc as $e,m as s,bd as Ue,be as Ne,bf as H,d as re,bg as Me,bh as je,a2 as Fe,bi as Je,bj as Ge,L as m,a7 as j,K as f,T as We}from"./BeBar3OL.js";import{B as He}from"./xBRYfpah.js";import{d as Ve,g as Be,j as De,k as Ke,n as qe,l as Qe}from"./Cs_ROD7H.js";function Rt(e,t,...n){var r=new He(e);me(()=>{const i=t()??null;r.ensure(i,i&&(c=>i(c,...n)))},_e)}function Ye(e,t){var n=void 0,r;ue(()=>{n!==(n=t())&&(r&&(x(r),r=null),n&&(r=le(()=>{fe(()=>n(e))})))})}function ce(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=ce(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function ze(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=ce(e))&&(r&&(r+=" "),r+=t);return r}function Xe(e){return typeof e=="object"?ze(e):e??""}const ne=[...`
|
|
2
|
+
\r\f \v\uFEFF`];function Ze(e,t,n){var r=e==null?"":""+e;if(t&&(r=r?r+" "+t:t),n){for(var i of Object.keys(n))if(n[i])r=r?r+" "+i:i;else if(r.length)for(var c=i.length,g=0;(g=r.indexOf(i,g))>=0;){var E=g+c;(g===0||ne.includes(r[g-1]))&&(E===r.length||ne.includes(r[E]))?r=(g===0?"":r.substring(0,g))+r.substring(E+1):g=E}}return r===""?null:r}function ae(e,t=!1){var n=t?" !important;":";",r="";for(var i of Object.keys(e)){var c=e[i];c!=null&&c!==""&&(r+=" "+i+": "+c+n)}return r}function X(e){return e[0]!=="-"||e[1]!=="-"?e.toLowerCase():e}function xe(e,t){if(t){var n="",r,i;if(Array.isArray(t)?(r=t[0],i=t[1]):r=t,e){e=String(e).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var c=!1,g=0,E=!1,v=[];r&&v.push(...Object.keys(r).map(X)),i&&v.push(...Object.keys(i).map(X));var C=0,_=-1;const k=e.length;for(var w=0;w<k;w++){var d=e[w];if(E?d==="/"&&e[w-1]==="*"&&(E=!1):c?c===d&&(c=!1):d==="/"&&e[w+1]==="*"?E=!0:d==='"'||d==="'"?c=d:d==="("?g++:d===")"&&g--,!E&&c===!1&&g===0){if(d===":"&&_===-1)_=w;else if(d===";"||w===k-1){if(_!==-1){var P=X(e.substring(C,_).trim());if(!v.includes(P)){d!==";"&&w++;var A=e.substring(C,w).trim();n+=" "+A+";"}}C=w+1,_=-1}}}}return r&&(n+=ae(r)),i&&(n+=ae(i,!0)),n=n.trim(),n===""?null:n}return e==null?null:String(e)}function et(e,t,n,r,i,c){var g=e.__className;if(U||g!==n||g===void 0){var E=Ze(n,r,c);(!U||E!==e.getAttribute("class"))&&(E==null?e.removeAttribute("class"):t?e.className=E:e.setAttribute("class",E)),e.__className=n}else if(c&&i!==c)for(var v in c){var C=!!c[v];(i==null||C!==!!i[v])&&e.classList.toggle(v,C)}return c}function Z(e,t={},n,r){for(var i in n){var c=n[i];t[i]!==c&&(n[i]==null?e.style.removeProperty(i):e.style.setProperty(i,c,r))}}function tt(e,t,n,r){var i=e.__style;if(U||i!==t){var c=xe(t,r);(!U||c!==e.getAttribute("style"))&&(c==null?e.removeAttribute("style"):e.style.cssText=c),e.__style=t}else r&&(Array.isArray(r)?(Z(e,n?.[0],r[0]),Z(e,n?.[1],r[1],"important")):Z(e,n,r));return r}function ee(e,t,n=!1){if(e.multiple){if(t==null)return;if(!Le(t))return Oe();for(var r of e.options)r.selected=t.includes(ie(r));return}for(r of e.options){var i=ie(r);if(Ie(i,t)){r.selected=!0;return}}(!n||t!==void 0)&&(e.selectedIndex=-1)}function rt(e){var t=new MutationObserver(()=>{ee(e,e.__value)});t.observe(e,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),ke(()=>{t.disconnect()})}function ie(e){return"__value"in e?e.__value:e.value}const G=Symbol("class"),W=Symbol("style"),de=Symbol("is custom element"),pe=Symbol("is html"),nt=H?"link":"LINK",at=H?"input":"INPUT",it=H?"option":"OPTION",st=H?"select":"SELECT",ot=H?"progress":"PROGRESS";function ut(e){if(U){var t=!1,n=()=>{if(!t){if(t=!0,e.hasAttribute("value")){var r=e.value;Q(e,"value",null),e.value=r}if(e.hasAttribute("checked")){var i=e.checked;Q(e,"checked",null),e.checked=i}}};e.__on_r=n,Fe(n),Je()}}function Pt(e,t){var n=te(e);n.value===(n.value=t??void 0)||e.value===t&&(t!==0||e.nodeName!==ot)||(e.value=t??"")}function lt(e,t){t?e.hasAttribute("selected")||e.setAttribute("selected",""):e.removeAttribute("selected")}function Q(e,t,n,r){var i=te(e);U&&(i[t]=e.getAttribute(t),t==="src"||t==="srcset"||t==="href"&&e.nodeName===nt)||i[t]!==(i[t]=n)&&(t==="loading"&&(e[Ge]=n),n==null?e.removeAttribute(t):typeof n!="string"&&he(e).includes(t)?e[t]=n:e.setAttribute(t,n))}function ft(e,t,n,r,i=!1,c=!1){if(U&&i&&e.nodeName===at){var g=e,E=g.type==="checkbox"?"defaultChecked":"defaultValue";E in n||ut(g)}var v=te(e),C=v[de],_=!v[pe];let w=U&&C;w&&re(!1);var d=t||{},P=e.nodeName===it;for(var A in t)A in n||(n[A]=null);n.class?n.class=Xe(n.class):(r||n[G])&&(n.class=null),n[W]&&(n.style??=null);var k=he(e);for(const b in n){let p=n[b];if(P&&b==="value"&&p==null){e.value=e.__value="",d[b]=p;continue}if(b==="class"){var R=e.namespaceURI==="http://www.w3.org/1999/xhtml";et(e,R,p,r,t?.[G],n[G]),d[b]=p,d[G]=n[G];continue}if(b==="style"){tt(e,p,t?.[W],n[W]),d[b]=p,d[W]=n[W];continue}var S=d[b];if(!(p===S&&!(p===void 0&&e.hasAttribute(b)))){d[b]=p;var J=b[0]+b[1];if(J!=="$$")if(J==="on"){const O={},$="$$"+b;let T=b.slice(2);var V=Qe(T);if(Ve(T)&&(T=T.slice(0,-7),O.capture=!0),!V&&S){if(p!=null)continue;e.removeEventListener(T,d[$],O),d[$]=null}if(V)Be(T,e,p),De([T]);else if(p!=null){let Y=function(z){d[b].call(this,z)};d[$]=Ke(T,e,Y,O)}}else if(b==="style")Q(e,b,p);else if(b==="autofocus")Me(e,!!p);else if(!C&&(b==="__value"||b==="value"&&p!=null))e.value=e.__value=p;else if(b==="selected"&&P)lt(e,p);else{var L=b;_||(L=qe(L));var B=L==="defaultValue"||L==="defaultChecked";if(p==null&&!C&&!B)if(v[b]=null,L==="value"||L==="checked"){let O=e;const $=t===void 0;if(L==="value"){let T=O.defaultValue;O.removeAttribute(L),O.defaultValue=T,O.value=O.__value=$?T:null}else{let T=O.defaultChecked;O.removeAttribute(L),O.defaultChecked=T,O.checked=$?T:!1}}else e.removeAttribute(b);else B||k.includes(L)&&(C||typeof p!="string")?(e[L]=p,L in v&&(v[L]=je)):typeof p!="function"&&Q(e,L,p)}}}return w&&re(!0),d}function $t(e,t,n=[],r=[],i=[],c,g=!1,E=!1){Re(i,n,r,v=>{var C=void 0,_={},w=e.nodeName===st,d=!1;if(ue(()=>{var A=t(...v.map(s)),k=ft(e,C,A,c,g,E);d&&w&&"value"in A&&ee(e,A.value);for(let S of Object.getOwnPropertySymbols(_))A[S]||x(_[S]);for(let S of Object.getOwnPropertySymbols(A)){var R=A[S];S.description===Ue&&(!C||R!==C[S])&&(_[S]&&x(_[S]),_[S]=le(()=>Ye(e,()=>R))),k[S]=R}C=k}),w){var P=e;fe(()=>{ee(P,C.value,!0),rt(P)})}d=!0})}function te(e){return e.__attributes??={[de]:e.nodeName.includes("-"),[pe]:e.namespaceURI===Pe}}var se=new Map;function he(e){var t=e.getAttribute("is")||e.nodeName,n=se.get(t);if(n)return n;se.set(t,n=[]);for(var r,i=e,c=Element.prototype;c!==i;){r=Ne(i);for(var g in r)r[g].set&&n.push(g);i=$e(i)}return n}const ct="";class dt extends Error{constructor(t,n){super(n),this.status=t,this.name="ApiError"}}async function y(e,t){const n={...t?.headers};t?.body&&(n["Content-Type"]=n["Content-Type"]??"application/json");const r=await fetch(`${ct}${e}`,{...t,headers:n});if(!r.ok){const i=await r.json().catch(()=>({error:r.statusText}));throw r.status===401&&typeof window<"u"&&!e.startsWith("/api/auth/")&&window.location.pathname!=="/login"&&(window.location.href="/login"),new dt(r.status,i.error??r.statusText)}return r.json()}function pt(){return y("/api/workspace")}function ht(e){return y("/api/workspace",{method:"PUT",body:JSON.stringify(e)})}function Ut(){return y("/api/workspace/mcp-config")}function oe(){return y("/api/repos")}function gt(e,t,n){return y("/api/repos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:e,description:t,...n?{private:!0}:{}})})}function vt(e,t){return y(`/api/repos/${encodeURIComponent(e)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t})})}function bt(e){return y(`/api/repos/${encodeURIComponent(e)}`,{method:"DELETE"})}function yt(){return y("/api/apps")}function Et(e){return y(`/api/repos/${encodeURIComponent(e)}/entities?summary=true`)}function Nt(e,t,n){return y(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(t)}/${encodeURIComponent(n)}`)}function Mt(e,t,n,r,i){return y(`/api/repos/${encodeURIComponent(e)}/entities`,{method:"POST",body:JSON.stringify({entityType:t,entityId:n,data:r,content:i})})}function jt(e,t,n){return y(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,{method:"DELETE"})}function Ft(e,t,n,r){return y(`/api/repos/${encodeURIComponent(e)}/entities/${encodeURIComponent(t)}/${encodeURIComponent(n)}`,{method:"PUT",body:JSON.stringify(r)})}function Jt(e){return y(`/api/repos/${encodeURIComponent(e)}/commit`,{method:"POST"})}function Ct(e){return e.replace(/-/g," ").replace(/\b\w/g,t=>t.toUpperCase())}function wt(){let e=m(""),t=m(null),n=m(!1),r=m(j([]));const i={};let c=m(j([])),g=m(!1),E=m(null),v=m(j({})),C=j({}),_=j({}),w=j({}),d=m(0),P=m(null),A=m(""),k=null,R=m(0),S=m(0),J=m("alpha");async function V(){f(g,!0),f(E,null),f(R,0),f(S,0);try{const[a,o,u]=await Promise.all([oe(),yt().catch(()=>[]),pt().catch(()=>({name:""}))]);f(c,o,!0),f(e,u.name,!0),f(t,u.about??null,!0),f(n,!0),f(r,a.map(l=>({name:l.name,type:l.type,private:l.private,sync:l.sync,count:null,entities:[],loading:!1,loaded:!1})),!0),await Promise.all(s(r).map(l=>p(l.name)))}catch(a){f(E,a.message,!0)}finally{f(g,!1)}}function L(a,o,u){const l=s(r).find(h=>h.name===a);l&&(l.entities=l.entities.filter(h=>!(h.id===u&&h.entityType===o)),l.count=l.entities.length)}async function B(a){s(r).find(u=>u.name===a)&&await p(a,!0)}async function b(){f(R,0),f(S,0),await Promise.all(s(r).map(a=>p(a.name,!0)))}async function p(a,o=!1){const u=s(r).find(h=>h.name===a);if(!u||u.loading||!o&&u.loaded)return;const l=(i[a]??0)+1;i[a]=l,o||(u.loading=!0);try{const h=await Et(a);if(i[a]!==l)return;let N=0,D=0;for(const I of h)N+=I.document?.wikilinks?.length??0,D+=I.subContentCount??0;f(R,s(R)+N),f(S,s(S)+D),u.entities=h.filter(I=>!I.id.toLowerCase().startsWith("readme")).map(I=>({id:I.id,title:I.data?.name??Ct(I.id),entityType:I.entityType,repo:a,hasSubContent:!!I.hasSubContent,wikilinks:I.document?.wikilinks??[],createdAt:I.data?.created_at??null,updatedAt:I.data?.updated_at??null})).sort((I,Te)=>I.title.localeCompare(Te.title)),u.count=u.entities.length,u.loaded=!0}catch(h){console.error(`Failed to load entities for ${a}:`,h)}finally{u.loading=!1}}function O(a){s(v)[a]=!s(v)[a]}function $(a){return s(v)[a]??!1}function T(a,o,u){return`${a}/${o}/${u}`}function Y(a,o,u){const l=T(a,o,u),h=C[l]??!1;C[l]=!h,!h&&!_[l]?.loaded&&ve(a,o,u)}function z(a,o,u){return C[T(a,o,u)]??!1}function ge(a,o,u){return _[T(a,o,u)]??{entries:[],loading:!1,loaded:!1}}async function ve(a,o,u){const l=T(a,o,u);_[l]={entries:[],loading:!1,loaded:!0}}function be(a){const o=s(A).trim().toLowerCase();if(!o)return a;const u=[];for(const l of a){const h=l.entities.filter(N=>N.title.toLowerCase().includes(o)||N.id.toLowerCase().includes(o));h.length>0&&u.push({...l,entities:h,count:h.length})}return u}function ye(a){if(a&&!s(A)?k={...s(v)}:!a&&s(A)&&k&&(f(v,k,!0),k=null),f(A,a,!0),a){const o=a.trim().toLowerCase();for(const u of s(r)){const l=u.entities.some(h=>h.title.toLowerCase().includes(o)||h.id.toLowerCase().includes(o));s(v)[u.name]=l}}}function Ee(a){const o=a.startsWith("type:");w[a]=!(w[a]??o)}function Ce(a){return w[a]??!1}function we(a){return w[a]===!1}const Ae=We(()=>s(r).reduce((a,o)=>a+(o.count??0),0));function Se(a){return s(c).find(o=>o.entityTypes.includes(a))}return{get name(){return s(e)},get about(){return s(t)},get nameLoaded(){return s(n)},async updateWorkspace(a){await ht(a),a.name?.trim()&&f(e,a.name.trim(),!0),typeof a.about=="string"&&f(t,a.about,!0)},get repos(){return s(r)},get apps(){return s(c)},get loading(){return s(g)},get error(){return s(E)},get totalEntities(){return s(Ae)},get totalLinks(){return s(R)},get totalFiles(){return s(S)},get sortedRepos(){const a=[...s(r)].sort((o,u)=>o.name.localeCompare(u.name));return be(a)},get filteredIds(){const a=s(A).trim().toLowerCase();if(!a)return null;const o=new Set;for(const u of s(r))for(const l of u.entities)(l.title.toLowerCase().includes(a)||l.id.toLowerCase().includes(a))&&o.add(l.id);return o},get filterQuery(){return s(A)},setFilterQuery:ye,get sortMode(){return s(J)},set sortMode(a){f(J,a,!0)},get recentEntities(){const a=s(A).trim().toLowerCase();let o=[];for(const u of s(r))for(const l of u.entities)a&&!l.title.toLowerCase().includes(a)&&!l.id.toLowerCase().includes(a)||o.push(l);return o.sort((u,l)=>{const h=u.updatedAt??"";return(l.updatedAt??"").localeCompare(h)})},get sidebarScrollTop(){return s(d)},set sidebarScrollTop(a){f(d,a,!0)},get lastAutoExpandedFor(){return s(P)},set lastAutoExpandedFor(a){f(P,a,!0)},load:V,loadEntities:p,removeEntity:L,refreshEntities:B,refreshAll:b,toggleRepo:O,isExpanded:$,toggleEntity:Y,isEntityExpanded:z,getEntityContents:ge,toggleFolder:Ee,isFolderExpanded:Ce,isFolderCollapsed:we,getAppForEntityType:Se,async renameCollectionTo(a,o){await vt(a,o);const u=s(r).find(l=>l.name===a);u&&(u.name=o,s(v)[a]&&(s(v)[o]=!0,delete s(v)[a]))},async removeCollection(a){await bt(a),f(r,s(r).filter(o=>o.name!==a),!0),delete s(v)[a]},async addCollection(a,o,u){await gt(a,o,u);const l=await oe();f(r,l.map(h=>s(r).find(D=>D.name===h.name)??{name:h.name,type:h.type,private:h.private,count:null,entities:[],loading:!1,loaded:!1}),!0),s(v)[a]=!0,await p(a)}}}const Gt=wt();function At(){return y("/api/auth/status")}function St(){return y("/api/auth/me")}function Tt(e,t){return y("/api/auth/login",{method:"POST",body:JSON.stringify({email:e,password:t})})}function mt(){return y("/api/auth/logout",{method:"POST"})}function _t(e,t,n){return y("/api/auth/setup",{method:"POST",body:JSON.stringify({email:e,password:t,displayName:n})})}function Wt(){return y("/api/auth/users")}function Ht(e,t,n,r){return y("/api/auth/users",{method:"POST",body:JSON.stringify({email:e,password:t,displayName:n,role:r})})}function Vt(e){return y(`/api/auth/users/${e}`,{method:"DELETE"})}function Bt(e,t){return y(`/api/auth/users/${e}/password`,{method:"PATCH",body:JSON.stringify({password:t})})}let F=m(null),K=m(!1),q=m(!1),M=m(!0);const Lt={get user(){return s(F)},get authEnabled(){return s(K)},get needsSetup(){return s(q)},get loading(){return s(M)},async checkAuth(){f(M,!0);try{const e=await At();if(f(K,e.authEnabled,!0),f(q,e.userCount===0),s(q))return f(M,!1),{authenticated:!1,authEnabled:!1,needsSetup:!0};if(!e.authEnabled)return f(M,!1),{authenticated:!0,authEnabled:!1,needsSetup:!1};try{const{user:t}=await St();return f(F,t,!0),f(M,!1),{authenticated:!0,authEnabled:!0,needsSetup:!1}}catch{return f(F,null),f(M,!1),{authenticated:!1,authEnabled:!0,needsSetup:!1}}}catch{return f(M,!1),{authenticated:!0,authEnabled:!1,needsSetup:!1}}},async login(e,t){const{user:n}=await Tt(e,t);return f(F,n,!0),f(K,!0),n},async setup(e,t,n){const{user:r}=await _t(e,t,n);return f(F,r,!0),f(K,!0),f(q,!1),r},async logout(){await mt(),f(F,null)}},Dt=Object.freeze(Object.defineProperty({__proto__:null,auth:Lt},Symbol.toStringTag,{value:"Module"}));export{W as S,Lt as a,Jt as b,ze as c,$t as d,Rt as e,Nt as f,Q as g,Pt as h,tt as i,Xe as j,y as k,Wt as l,Ut as m,Vt as n,Bt as o,Ht as p,jt as q,ut as r,et as s,Mt as t,Ft as u,Dt as v,Gt as w};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as d,u as g,i as c,j as l,k as m,l as b,m as p,n as k,o as v}from"./BeBar3OL.js";function x(n=!1){const s=d,e=s.l.u;if(!e)return;let r=()=>k(s.s);if(n){let o=0,t={};const _=v(()=>{let i=!1;const a=s.s;for(const f in a)a[f]!==t[f]&&(t[f]=a[f],i=!0);return i&&o++,o});r=()=>p(_)}e.b.length&&g(()=>{u(s,r),c(e.b)}),l(()=>{const o=m(()=>e.m.map(b));return()=>{for(const t of o)typeof t=="function"&&t()}}),e.a.length&&l(()=>{u(s,r),c(e.a)})}function u(n,s){if(n.l.s)for(const e of n.l.s)p(e);s()}export{x as i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{O as B,f as F,g as A,e as V,w as S,a as J,t as v,c as D,r as L,b as _,d as N,h as E,i as P,j as G,k as O,l as q,D as R,m as z}from"./CLFba8FK.js";import{r as M}from"./CXuhHL4d.js";const b=3e4;class K extends B{constructor(n){super(),this.doc=n,this.clientID=n.clientID,this.states=new Map,this.meta=new Map,this._checkInterval=setInterval(()=>{const e=A();this.getLocalState()!==null&&b/2<=e-this.meta.get(this.clientID).lastUpdated&&this.setLocalState(this.getLocalState());const s=[];this.meta.forEach((a,c)=>{c!==this.clientID&&b<=e-a.lastUpdated&&this.states.has(c)&&s.push(c)}),s.length>0&&x(this,s,"timeout")},F(b/10)),n.on("destroy",()=>{this.destroy()}),this.setLocalState({})}destroy(){this.emit("destroy",[this]),this.setLocalState(null),super.destroy(),clearInterval(this._checkInterval)}getLocalState(){return this.states.get(this.clientID)||null}setLocalState(n){const e=this.clientID,s=this.meta.get(e),a=s===void 0?0:s.clock+1,c=this.states.get(e);n===null?this.states.delete(e):this.states.set(e,n),this.meta.set(e,{clock:a,lastUpdated:A()});const l=[],u=[],r=[],p=[];n===null?p.push(e):c==null?n!=null&&l.push(e):(u.push(e),V(c,n)||r.push(e)),(l.length>0||r.length>0||p.length>0)&&this.emit("change",[{added:l,updated:r,removed:p},"local"]),this.emit("update",[{added:l,updated:u,removed:p},"local"])}setLocalStateField(n,e){const s=this.getLocalState();s!==null&&this.setLocalState({...s,[n]:e})}getStates(){return this.states}}const x=(t,n,e)=>{const s=[];for(let a=0;a<n.length;a++){const c=n[a];if(t.states.has(c)){if(t.states.delete(c),c===t.clientID){const l=t.meta.get(c);t.meta.set(c,{clock:l.clock+1,lastUpdated:A()})}s.push(c)}}s.length>0&&(t.emit("change",[{added:[],updated:[],removed:s},e]),t.emit("update",[{added:[],updated:[],removed:s},e]))},Q=(t,n,e=t.states)=>{const s=n.length,a=D();S(a,s);for(let c=0;c<s;c++){const l=n[c],u=e.get(l)||null,r=t.meta.get(l).clock;S(a,l),S(a,r),J(a,JSON.stringify(u))}return v(a)},X=(t,n,e)=>{const s=N(n),a=A(),c=[],l=[],u=[],r=[],p=L(s);for(let m=0;m<p;m++){const d=L(s);let g=L(s);const h=JSON.parse(_(s)),y=t.meta.get(d),k=t.states.get(d),o=y===void 0?0:y.clock;(o<g||o===g&&h===null&&t.states.has(d))&&(h===null?d===t.clientID&&t.getLocalState()!=null?g++:t.states.delete(d):t.states.set(d,h),t.meta.set(d,{clock:g,lastUpdated:a}),y===void 0&&h!==null?c.push(d):y!==void 0&&h===null?r.push(d):h!==null&&(V(h,k)||u.push(d),l.push(d)))}(c.length>0||u.length>0||r.length>0)&&t.emit("change",[{added:c,updated:u,removed:r},e]),(c.length>0||l.length>0||r.length>0)&&t.emit("update",[{added:c,updated:l,removed:r},e])},W=0,j=1,C=2,Z=(t,n)=>{S(t,W);const e=P(n);E(t,e)},$=(t,n,e)=>{S(t,j),E(t,q(n,e))},H=(t,n,e)=>$(n,e,O(t)),Y=(t,n,e,s)=>{try{G(n,O(t),e)}catch(a){s?.(a),console.error("Caught error while handling a Yjs update",a)}},tt=(t,n)=>{S(t,C),E(t,n)},et=Y,nt=(t,n,e,s,a)=>{const c=L(t);switch(c){case W:H(t,n,e);break;case j:Y(t,e,s,a);break;case C:et(t,e,s,a);break;default:throw new Error("Unknown message type")}return c},U=0,T=1;function st(t,n,e){const s=new TextEncoder().encode(t),a=new ArrayBuffer(2+s.length+1+e.length);return new DataView(a).setUint16(0,s.length),new Uint8Array(a,2,s.length).set(s),new Uint8Array(a)[2+s.length]=n,new Uint8Array(a,2+s.length+1).set(e),a}function at(t){if(t.byteLength<3)return null;const e=new DataView(t).getUint16(0);if(t.byteLength<2+e+1)return null;const s=new TextDecoder().decode(new Uint8Array(t,2,e)),a=new Uint8Array(t)[2+e],c=new Uint8Array(t,2+e+1);return{docName:s,msgType:a,payload:c}}function lt(t,n){const e=new R,s=e.getText("content"),a=new K(e);a.setLocalStateField("user",{name:n.name,color:n.color,colorLight:n.colorLight??n.color+"33"});let c=null,l=!1;function u(){return M.ws??null}function r(o,f){const i=u();!i||i.readyState!==WebSocket.OPEN||i.send(st(t,o,f))}function p(){const o=D();Z(o,e),r(U,v(o))}function m(o){const f=o??[e.clientID],i=Q(a,f);r(T,i)}function d(o){if(l||typeof o.data=="string")return;const f=o.data instanceof ArrayBuffer?o.data:null;if(!f)return;const i=at(f);if(!(!i||i.docName!==t))if(i.msgType===U){const I=N(i.payload),w=D();nt(I,w,e,"ws-server"),z(w)>0&&r(U,v(w))}else i.msgType===T&&X(a,i.payload,"ws-server")}function g(o,f){if(l||f==="ws-server")return;const i=D();tt(i,o),r(U,v(i))}function h({added:o,updated:f,removed:i},I){if(l||I==="ws-server")return;const w=o.concat(f,i);m(w)}function y(){if(l)return;const o=u();!o||o.readyState!==WebSocket.OPEN||(o.send(JSON.stringify({type:"collab:join",docName:t})),c&&o.removeEventListener("message",c),c=d,o.addEventListener("message",c),p(),m())}e.on("update",g),a.on("update",h),y(),M.addConnectHandler(y);function k(){if(l)return;l=!0,x(a,[e.clientID],"local"),m([e.clientID]);const o=u();o&&o.readyState===WebSocket.OPEN&&o.send(JSON.stringify({type:"collab:leave",docName:t})),c&&o&&(o.removeEventListener("message",c),c=null),e.off("update",g),a.off("update",h),a.destroy(),e.destroy()}return{ydoc:e,ytext:s,awareness:a,destroy:k}}export{lt as createCollabSession};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{q as y,b as u,t as _,v as o,h as t,C as g,w as i,d as l,c as d,e as p,x as v}from"./BeBar3OL.js";function C(n,r){let s=null,E=t;var a;if(t){s=p;for(var e=v(document.head);e!==null&&(e.nodeType!==g||e.data!==n);)e=i(e);if(e===null)l(!1);else{var f=i(e);e.remove(),d(f)}}t||(a=document.head.appendChild(y()));try{u(()=>r(a),_|o)}finally{E&&(l(!0),d(s))}}export{C as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{U,V as x,W as q,q as E,X as I,Y as C,h as g,e as Y,Z as H,_ as Z,b as $,a as z,E as G,r as V,H as W,a0 as X,s as J,c as Q,d as D,M as k,a1 as ee,k as y,a2 as re,a3 as m,a4 as R,a5 as se,a6 as B,m as w,a7 as te,K as ie,a8 as ne,a9 as A,aa as ae,ab as fe,ac as ue,ad as ce,ae as oe,o as le,af as de,ag as _,N as K,ah as pe,ai as he,aj as M,ak as N}from"./BeBar3OL.js";class _e{anchor;#r=new Map;#s=new Map;#e=new Map;#t=new Set;#i=!0;constructor(e,t=!0){this.anchor=e,this.#i=t}#n=e=>{if(this.#r.has(e)){var t=this.#r.get(e),s=this.#s.get(t);if(s)U(s),this.#t.delete(t);else{var i=this.#e.get(t);i&&(this.#s.set(t,i.effect),this.#e.delete(t),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),s=i.effect)}for(const[n,f]of this.#r){if(this.#r.delete(n),n===e)break;const a=this.#e.get(f);a&&(x(a.effect),this.#e.delete(f))}for(const[n,f]of this.#s){if(n===t||this.#t.has(n))continue;const a=()=>{if(Array.from(this.#r.values()).includes(n)){var o=document.createDocumentFragment();H(f,o),o.append(E()),this.#e.set(n,{effect:f,fragment:o})}else x(f);this.#t.delete(n),this.#s.delete(n)};this.#i||!s?(this.#t.add(n),q(f,a,!1)):a()}}};#a=e=>{this.#r.delete(e);const t=Array.from(this.#r.values());for(const[s,i]of this.#e)t.includes(s)||(x(i.effect),this.#e.delete(s))};ensure(e,t){var s=C,i=Z();if(t&&!this.#s.has(e)&&!this.#e.has(e))if(i){var n=document.createDocumentFragment(),f=E();n.append(f),this.#e.set(e,{effect:I(()=>t(f)),fragment:n})}else this.#s.set(e,I(()=>t(this.anchor)));if(this.#r.set(s,e),i){for(const[a,u]of this.#s)a===e?s.unskip_effect(u):s.skip_effect(u);for(const[a,u]of this.#e)a===e?s.unskip_effect(u.effect):s.skip_effect(u.effect);s.oncommit(this.#n),s.ondiscard(this.#a)}else g&&(this.anchor=Y),this.#n(s)}}function ge(r,e,t=!1){var s;g&&(s=Y,z());var i=new _e(r),n=t?G:0;function f(a,u){if(g){var o=V(s),l;if(o===W?l=0:o===X?l=!1:l=parseInt(o.substring(1)),a!==l){var v=J();Q(v),i.anchor=v,D(!1),i.ensure(a,u),D(!0);return}}i.ensure(a,u)}$(()=>{var a=!1;e((u,o=0)=>{a=!0,f(o,u)}),a||f(!1,null)},n)}function L(r,e){return r===e||r?.[m]===e}function Re(r={},e,t,s){return k(()=>{var i,n;return ee(()=>{i=n,n=[],y(()=>{r!==t(...n)&&(e(r,...n),i&&L(t(...i),r)&&e(null,...i))})}),()=>{re(()=>{n&&L(t(...n),r)&&e(null,...n)})}}),r}let P=!1;function ve(r){var e=P;try{return P=!1,[r(),P]}finally{P=e}}const be={get(r,e){if(!r.exclude.includes(e))return r.props[e]},set(r,e){return!1},getOwnPropertyDescriptor(r,e){if(!r.exclude.includes(e)&&e in r.props)return{enumerable:!0,configurable:!0,value:r.props[e]}},has(r,e){return r.exclude.includes(e)?!1:e in r.props},ownKeys(r){return Reflect.ownKeys(r.props).filter(e=>!r.exclude.includes(e))}};function me(r,e,t){return new Proxy({props:r,exclude:e},be)}const Pe={get(r,e){if(!r.exclude.includes(e))return w(r.version),e in r.special?r.special[e]():r.props[e]},set(r,e,t){if(!(e in r.special)){var s=A;try{N(r.parent_effect),r.special[e]=Se({get[e](){return r.props[e]}},e,B)}finally{N(s)}}return r.special[e](t),M(r.version),!0},getOwnPropertyDescriptor(r,e){if(!r.exclude.includes(e)&&e in r.props)return{enumerable:!0,configurable:!0,value:r.props[e]}},deleteProperty(r,e){return r.exclude.includes(e)||(r.exclude.push(e),M(r.version)),!0},has(r,e){return r.exclude.includes(e)?!1:e in r.props},ownKeys(r){return Reflect.ownKeys(r.props).filter(e=>!r.exclude.includes(e))}};function Ae(r,e){return new Proxy({props:r,exclude:e,special:{},version:he(0),parent_effect:A},Pe)}const we={get(r,e){let t=r.props.length;for(;t--;){let s=r.props[t];if(_(s)&&(s=s()),typeof s=="object"&&s!==null&&e in s)return s[e]}},set(r,e,t){let s=r.props.length;for(;s--;){let i=r.props[s];_(i)&&(i=i());const n=R(i,e);if(n&&n.set)return n.set(t),!0}return!1},getOwnPropertyDescriptor(r,e){let t=r.props.length;for(;t--;){let s=r.props[t];if(_(s)&&(s=s()),typeof s=="object"&&s!==null&&e in s){const i=R(s,e);return i&&!i.configurable&&(i.configurable=!0),i}}},has(r,e){if(e===m||e===K)return!1;for(let t of r.props)if(_(t)&&(t=t()),t!=null&&e in t)return!0;return!1},ownKeys(r){const e=[];for(let t of r.props)if(_(t)&&(t=t()),!!t){for(const s in t)e.includes(s)||e.push(s);for(const s of Object.getOwnPropertySymbols(t))e.includes(s)||e.push(s)}return e}};function Oe(...r){return new Proxy({props:r},we)}function Se(r,e,t,s){var i=!ue||(t&ce)!==0,n=(t&fe)!==0,f=(t&pe)!==0,a=s,u=!0,o=()=>(u&&(u=!1,a=f?y(s):s),a),l;if(n){var v=m in r||K in r;l=R(r,e)?.set??(v&&e in r?c=>r[e]=c:void 0)}var p,O=!1;n?[p,O]=ve(()=>r[e]):p=r[e],p===void 0&&s!==void 0&&(p=o(),l&&(i&&se(),l(p)));var d;if(i?d=()=>{var c=r[e];return c===void 0?o():(u=!0,c)}:d=()=>{var c=r[e];return c!==void 0&&(a=void 0),c===void 0?a:c},i&&(t&B)===0)return d;if(l){var j=r.$$legacy;return(function(c,b){return arguments.length>0?((!i||!b||j||O)&&l(b?d():c),c):d()})}var S=!1,h=((t&oe)!==0?le:de)(()=>(S=!1,d()));n&&w(h);var F=A;return(function(c,b){if(arguments.length>0){const T=b?w(h):i&&n?te(c):c;return ie(h,T),S=!0,a!==void 0&&(a=T),c}return ne&&S||(F.f&ae)!==0?h.v:w(h)})}export{_e as B,Re as b,ge as i,Ae as l,Se as p,me as r,Oe as s};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../nodes/0.D3SW-LMc.js","../chunks/PPVm8Dsz.js","../chunks/Cs_ROD7H.js","../chunks/BeBar3OL.js","../chunks/DP09rP34.js","../chunks/xBRYfpah.js","../chunks/O0fx2ss6.js","../chunks/D4FXhiC2.js","../chunks/CXuhHL4d.js","../chunks/DCGSm8Hl.js","../chunks/CQCkXCml.js","../assets/0.CupILLQs.css","../nodes/1.y0c5TQTP.js","../chunks/DiP47fAp.js","../nodes/2.BQfSep9-.js","../chunks/Cg9NOuOl.js","../chunks/BuOTIbJu.js","../assets/AppShell.Ch_ef9hJ.css","../chunks/B7eduG_j.js","../assets/ChatPanel.CP-_8txt.css","../assets/2.DRHi7ABa.css","../nodes/3.CC4Y-xMM.js","../chunks/D4VHRYeB.js","../chunks/CqkleIqs.js","../assets/3.CtJi4Cy9.css","../nodes/4.Dp0Z-oPW.js","../assets/4.BhKgiXd2.css","../nodes/5.gjZ03DON.js","../assets/5.CydFyZSu.css","../nodes/6.dRNIwcJQ.js","../assets/6.kqeOo0OW.css","../nodes/7.I4Gjes3o.js","../assets/7.CseIx7qQ.css","../nodes/8.Dj14D7uH.js","../assets/8.BYpFDZHK.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as m}from"../chunks/PPVm8Dsz.js";import{K as y,N,m as u,O as Q,P as Y,Q as q,y as z,u as F,j as H,R as J,S as U,f as E,D as W,A as X,L as p,B as Z,G as $,T as b,I as tt}from"../chunks/BeBar3OL.js";import{h as et,m as rt,u as st,a as h,c as P,f as T,t as at,s as ot}from"../chunks/Cs_ROD7H.js";import{p as O,i as R,b as A}from"../chunks/xBRYfpah.js";import{c as L}from"../chunks/DCGSm8Hl.js";function nt(a){return class extends it{constructor(t){super({component:a,...t})}}}class it{#e;#t;constructor(t){var s=new Map,n=(e,r)=>{var c=q(r,!1,!1);return s.set(e,c),c};const i=new Proxy({...t.props||{},$$events:{}},{get(e,r){return u(s.get(r)??n(r,Reflect.get(e,r)))},has(e,r){return r===N?!0:(u(s.get(r)??n(r,Reflect.get(e,r))),Reflect.has(e,r))},set(e,r,c){return y(s.get(r)??n(r,c),c),Reflect.set(e,r,c)}});this.#t=(t.hydrate?et:rt)(t.component,{target:t.target,anchor:t.anchor,props:i,context:t.context,intro:t.intro??!1,recover:t.recover,transformError:t.transformError}),(!t?.props?.$$host||t.sync===!1)&&Q(),this.#e=i.$$events;for(const e of Object.keys(this.#t))e==="$set"||e==="$destroy"||e==="$on"||Y(this,e,{get(){return this.#t[e]},set(r){this.#t[e]=r},enumerable:!0});this.#t.$set=e=>{Object.assign(i,e)},this.#t.$destroy=()=>{st(this.#t)}}$set(t){this.#t.$set(t)}$on(t,s){this.#e[t]=this.#e[t]||[];const n=(...i)=>s.call(this,...i);return this.#e[t].push(n),()=>{this.#e[t]=this.#e[t].filter(i=>i!==n)}}$destroy(){this.#t.$destroy()}}const Et={};var ct=T('<div id="svelte-announcer" aria-live="assertive" aria-atomic="true" style="position: absolute; left: 0; top: 0; clip: rect(0 0 0 0); clip-path: inset(50%); overflow: hidden; white-space: nowrap; width: 1px; height: 1px"><!></div>'),mt=T("<!> <!>",1);function ut(a,t){z(t,!0);let s=O(t,"components",23,()=>[]),n=O(t,"data_0",3,null),i=O(t,"data_1",3,null);F(()=>t.stores.page.set(t.page)),H(()=>{t.stores,t.page,t.constructors,s(),t.form,n(),i(),t.stores.page.notify()});let e=p(!1),r=p(!1),c=p(null);J(()=>{const o=t.stores.page.subscribe(()=>{u(e)&&(y(r,!0),U().then(()=>{y(c,document.title||"untitled page",!0)}))});return y(e,!0),o});const j=b(()=>t.constructors[1]);var x=mt(),D=E(x);{var w=o=>{const _=b(()=>t.constructors[0]);var d=P(),v=E(d);L(v,()=>u(_),(l,f)=>{A(f(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params},children:(g,dt)=>{var I=P(),G=E(I);L(G,()=>u(j),(M,B)=>{A(B(M,{get data(){return i()},get form(){return t.form},get params(){return t.page.params}}),K=>s()[1]=K,()=>s()?.[1])}),h(g,I)},$$slots:{default:!0}}),g=>s()[0]=g,()=>s()?.[0])}),h(o,d)},k=o=>{const _=b(()=>t.constructors[0]);var d=P(),v=E(d);L(v,()=>u(_),(l,f)=>{A(f(l,{get data(){return n()},get form(){return t.form},get params(){return t.page.params}}),g=>s()[0]=g,()=>s()?.[0])}),h(o,d)};R(D,o=>{t.constructors[1]?o(w):o(k,!1)})}var C=W(D,2);{var S=o=>{var _=ct(),d=Z(_);{var v=l=>{var f=at();tt(()=>ot(f,u(c))),h(l,f)};R(d,l=>{u(r)&&l(v)})}$(_),h(o,_)};R(C,o=>{u(e)&&o(S)})}h(a,x),X()}const yt=nt(ut),pt=[()=>m(()=>import("../nodes/0.D3SW-LMc.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11]),import.meta.url),()=>m(()=>import("../nodes/1.y0c5TQTP.js"),__vite__mapDeps([12,2,3,10,13,7]),import.meta.url),()=>m(()=>import("../nodes/2.BQfSep9-.js"),__vite__mapDeps([14,2,3,10,5,13,15,4,8,7,9,16,17,18,19,20]),import.meta.url),()=>m(()=>import("../nodes/3.CC4Y-xMM.js"),__vite__mapDeps([21,4,3,5,2,1,8,7,9,15,16,10,13,17,18,19,22,23,24]),import.meta.url),()=>m(()=>import("../nodes/4.Dp0Z-oPW.js"),__vite__mapDeps([25,4,3,5,2,15,8,7,9,16,10,13,17,26]),import.meta.url),()=>m(()=>import("../nodes/5.gjZ03DON.js"),__vite__mapDeps([27,2,3,5,15,4,8,7,9,16,10,13,17,18,19,1,28]),import.meta.url),()=>m(()=>import("../nodes/6.dRNIwcJQ.js"),__vite__mapDeps([29,2,3,5,6,7,4,16,30]),import.meta.url),()=>m(()=>import("../nodes/7.I4Gjes3o.js"),__vite__mapDeps([31,2,3,10,13,15,5,4,8,7,9,16,17,22,1,32]),import.meta.url),()=>m(()=>import("../nodes/8.Dj14D7uH.js"),__vite__mapDeps([33,2,3,5,6,7,4,16,34]),import.meta.url)],bt=[],Pt={"/":[2],"/graph":[5],"/login":[6],"/settings":[7],"/setup":[8],"/[repo]/[type]/[id]":[3],"/[repo]/[type]/[id]/edit":[4]},V={handleError:(({error:a})=>{console.error(a)}),reroute:(()=>{}),transport:{}},_t=Object.fromEntries(Object.entries(V.transport).map(([a,t])=>[a,t.decode])),Ot=Object.fromEntries(Object.entries(V.transport).map(([a,t])=>[a,t.encode])),Rt=!1,At=(a,t)=>_t[a](t);export{At as decode,_t as decoders,Pt as dictionary,Ot as encoders,Rt as hash,V as hooks,Et as matchers,pt as nodes,yt as root,bt as server_loads};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as o,a as r}from"../chunks/D4FXhiC2.js";export{o as load_css,r as start};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["../chunks/BB_5th5W.js","../chunks/PPVm8Dsz.js","../chunks/CqkleIqs.js","../chunks/BVBRzmeQ.js","../chunks/Cs5oz2oJ.js","../chunks/B1y7Wy5O.js","../chunks/D2aTbzFm.js","../chunks/BXuvR8Ks.js","../chunks/0oxpWEgM.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as jt}from"../chunks/PPVm8Dsz.js";import{a as s,f as rt,o as Jt,p as xt,g as qt,e as an,c as y,j as sn,t as Re,s as ie,q as Ut}from"../chunks/Cs_ROD7H.js";import{y as ht,B as it,G as $,I as nt,A as mt,bq as cn,z as He,br as Pe,L as B,a7 as Rt,j as ct,K as c,m as e,k as Gt,R as Ce,D as Mt,T as m,aF as Q,f as g,u as Xe,bs as De,bp as ln,J as un,$ as dn}from"../chunks/BeBar3OL.js";import{j as _t,s as bt,g as A,i as Se,e as U,d as Me,S as fn,a as re,w as We}from"../chunks/DP09rP34.js";import{h as hn}from"../chunks/O0fx2ss6.js";import{g as Ee}from"../chunks/D4FXhiC2.js";import{e as le,t as Z,c as yt,S as mn,b as gn,i as vn,n as wn,r as Fe}from"../chunks/CXuhHL4d.js";import{p as k,i as L,b as Je,s as kt,r as Ct}from"../chunks/xBRYfpah.js";import{c as Nt}from"../chunks/DCGSm8Hl.js";import"../chunks/CQCkXCml.js";const yn=Array(12).fill(0);var _n=rt('<div class="sonner-loading-bar"></div>'),bn=rt('<div><div class="sonner-spinner"></div></div>');function xn(n,t){ht(t,!0);var o=bn(),i=it(o);le(i,23,()=>yn,(r,u)=>`spinner-bar-${u}`,(r,u)=>{var a=_n();s(r,a)}),$(i),$(o),nt(r=>{bt(o,1,r),A(o,"data-visible",t.visible)},[()=>_t(["sonner-loading-wrapper",t.class].filter(Boolean).join(" "))]),s(n,o),mt()}const In=typeof window<"u"?window:void 0;function Tn(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}class Sn{#e;#t;constructor(t,o){this.#e=t,this.#t=Jt(o)}get current(){return this.#t(),this.#e()}}const En=/\(.+\)/,An=new Set(["all","print","screen","and","or","not","only"]);class kn extends Sn{constructor(t,o){let i=En.test(t)||t.split(/[\s,]+/).some(u=>An.has(u.trim()))?t:`(${t})`;const r=window.matchMedia(i);super(()=>r.matches,u=>xt(r,"change",u))}}let Bn=class{#e;#t;constructor(t={}){const{window:o=In,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Jt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?Tn(this.#e):null}};new Bn;class Pn{#e;#t;constructor(t){this.#e=t,this.#t=Symbol(t)}get key(){return this.#t}exists(){return cn(this.#t)}get(){const t=He(this.#t);if(t===void 0)throw new Error(`Context "${this.#e}" not found`);return t}getOr(t){const o=He(this.#t);return o===void 0?t:o}set(t){return Pe(this.#t,t)}}const Mn=new Pn("<Toaster/>");function ae(n){return n.label!==void 0}function Cn(){let n=B(Rt(typeof document<"u"?document.hidden:!1));return ct(()=>xt(document,"visibilitychange",()=>{c(n,document.hidden,!0)})),{get current(){return e(n)}}}const Ve=4e3,Dn=14,Ln=45,On=200,zn=.05,Nn={toast:"",title:"",description:"",loader:"",closeButton:"",cancelButton:"",actionButton:"",action:"",warning:"",error:"",success:"",default:"",info:"",loading:""};function Rn(n){const[t,o]=n.split("-"),i=[];return t&&i.push(t),o&&i.push(o),i}function je(n){return 1/(1.5+Math.abs(n)/20)}var Hn=rt("<div><!></div>"),Wn=rt('<button data-close-button=""><!></button>'),Fn=rt('<div data-icon=""><!> <!></div>'),Vn=rt('<div data-description=""><!></div>'),jn=rt('<button data-button="" data-cancel=""> </button>'),qn=rt('<button data-button=""> </button>'),Un=rt('<!> <div data-content=""><div data-title=""><!></div> <!></div> <!> <!>',1),Kn=rt('<li aria-atomic="true" data-sonner-toast=""><!> <!></li>');function Yn(n,t){ht(t,!0);const o=h=>{var w=y(),T=g(w);{var M=E=>{var K=Hn(),zt=it(K);U(zt,()=>t.loadingIcon),$(K),nt(Yt=>{bt(K,1,Yt),A(K,"data-visible",e(z)==="loading")},[()=>_t(yt(e(ot)?.loader,t.toast?.classes?.loader,"sonner-loader"))]),s(E,K)},C=E=>{{let K=m(()=>yt(e(ot)?.loader,t.toast.classes?.loader)),zt=m(()=>e(z)==="loading");xn(E,{get class(){return e(K)},get visible(){return e(zt)}})}};L(T,E=>{t.loadingIcon?E(M):E(C,!1)})}s(h,w)};let i=k(t,"cancelButtonStyle",3,""),r=k(t,"actionButtonStyle",3,""),u=k(t,"descriptionClass",3,""),a=k(t,"unstyled",3,!1),_=k(t,"defaultRichColors",3,!1);const v={...Nn};let P=B(!1),O=B(!1),at=B(!1),j=B(!1),st=B(!1),R=B(0),tt=B(0),lt=t.toast.duration||t.duration||Ve,G=B(void 0),q=B(null),Ht=B(null);const de=m(()=>t.index===0),fe=m(()=>t.index+1<=t.visibleToasts),z=m(()=>t.toast.type),et=m(()=>t.toast.dismissible!==void 0?t.toast.dismissible!==!1:t.toast.dismissable!==!1),Wt=m(()=>t.toast.class||""),Dt=m(()=>t.toast.descriptionClass||""),It=m(()=>Z.heights.findIndex(h=>h.toastId===t.toast.id)||0),Tt=m(()=>t.toast.closeButton??t.closeButton),Lt=m(()=>t.toast.duration??t.duration??Ve);let Bt=null;const pt=m(()=>t.position.split("-")),he=m(()=>Z.heights.reduce((h,w,T)=>T>=e(It)?h:h+w.height,0)),me=Cn(),ge=m(()=>t.toast.invert||t.invert),Kt=m(()=>e(z)==="loading"),ot=m(()=>({...v,...t.classes})),ve=m(()=>t.toast.title),we=m(()=>t.toast.description);let St=B(0),$t=B(0);const Ft=m(()=>Math.round(e(It)*Dn+e(he)));ct(()=>{e(ve),e(we);let h;t.expanded||t.expandByDefault?h=1:h=1-t.index*zn;const w=Gt(()=>e(G));if(w===void 0)return;w.style.setProperty("height","auto");const T=w.offsetHeight,M=w.getBoundingClientRect().height,C=Math.round(M/h+Number.EPSILON&100)/100;w.style.removeProperty("height");let E;Math.abs(C-T)<1?E=C:E=T,c(tt,E,!0),Z.setHeight({toastId:t.toast.id,height:E})});function l(){c(O,!0),c(R,e(Ft),!0),Z.removeHeight(t.toast.id),setTimeout(()=>{Z.remove(t.toast.id)},On)}let H;const gt=m(()=>t.toast.promise&&e(z)==="loading"||t.toast.duration===Number.POSITIVE_INFINITY);function vt(){c(St,new Date().getTime(),!0),H=setTimeout(()=>{t.toast.onAutoClose?.(t.toast),l()},lt)}function Ot(){if(e($t)<e(St)){const h=new Date().getTime()-e(St);lt=lt-h}c($t,new Date().getTime(),!0)}ct(()=>{t.toast.updated&&(clearTimeout(H),lt=e(Lt),vt())}),ct(()=>(e(gt)||(t.expanded||t.interacting||t.pauseWhenPageIsHidden&&me.current?Ot():vt()),()=>clearTimeout(H))),Ce(()=>{c(P,!0);const h=e(G)?.getBoundingClientRect().height;return c(tt,h,!0),Z.setHeight({toastId:t.toast.id,height:h}),()=>{Z.removeHeight(t.toast.id)}}),ct(()=>{t.toast.delete&&Gt(()=>{l(),t.toast.onDismiss?.(t.toast)})});const ye=h=>{if(e(Kt))return;c(R,e(Ft),!0);const w=h.target;w.setPointerCapture(h.pointerId),w.tagName!=="BUTTON"&&(c(at,!0),Bt={x:h.clientX,y:h.clientY})},ze=()=>{if(e(j)||!e(et))return;Bt=null;const h=Number(e(G)?.style.getPropertyValue("--swipe-amount-x").replace("px","")||0),w=Number(e(G)?.style.getPropertyValue("--swipe-amount-y").replace("px","")||0),T=new Date().getTime()-0,M=e(q)==="x"?h:w,C=Math.abs(M)/T;if(Math.abs(M)>=Ln||C>.11){c(R,e(Ft),!0),t.toast.onDismiss?.(t.toast),e(q)==="x"?c(Ht,h>0?"right":"left",!0):c(Ht,w>0?"down":"up",!0),l(),c(j,!0);return}else e(G)?.style.setProperty("--swipe-amount-x","0px"),e(G)?.style.setProperty("--swipe-amount-y","0px");c(st,!1),c(at,!1),c(q,null)},te=h=>{if(!Bt||!e(et)||(window.getSelection()?.toString().length??-1)>0)return;const T=h.clientY-Bt.y,M=h.clientX-Bt.x,C=t.swipeDirections??Rn(t.position);!e(q)&&(Math.abs(M)>1||Math.abs(T)>1)&&c(q,Math.abs(M)>Math.abs(T)?"x":"y",!0);let E={x:0,y:0};if(e(q)==="y"){if(C.includes("top")||C.includes("bottom"))if(C.includes("top")&&T<0||C.includes("bottom")&&T>0)E.y=T;else{const K=T*je(T);E.y=Math.abs(K)<Math.abs(T)?K:T}}else if(e(q)==="x"&&(C.includes("left")||C.includes("right")))if(C.includes("left")&&M<0||C.includes("right")&&M>0)E.x=M;else{const K=M*je(M);E.x=Math.abs(K)<Math.abs(M)?K:M}(Math.abs(E.x)>0||Math.abs(E.y)>0)&&c(st,!0),e(G)?.style.setProperty("--swipe-amount-x",`${E.x}px`),e(G)?.style.setProperty("--swipe-amount-y",`${E.y}px`)},wt=()=>{c(at,!1),c(q,null),Bt=null},Et=m(()=>t.toast.icon?t.toast.icon:e(z)==="success"?t.successIcon:e(z)==="error"?t.errorIcon:e(z)==="warning"?t.warningIcon:e(z)==="info"?t.infoIcon:e(z)==="loading"?t.loadingIcon:null);var f=Kn();A(f,"tabindex",0);let Vt;var ee=it(f);{var Ne=h=>{var w=Wn(),T=it(w);U(T,()=>t.closeIcon??Q),$(w),nt(M=>{A(w,"aria-label",t.closeButtonAriaLabel),A(w,"data-disabled",e(Kt)),bt(w,1,M)},[()=>_t(yt(e(ot)?.closeButton,t.toast?.classes?.closeButton))]),qt("click",w,()=>{e(Kt)||!e(et)||(l(),t.toast.onDismiss?.(t.toast))}),s(h,w)};L(ee,h=>{e(Tt)&&!t.toast.component&&e(z)!=="loading"&&t.closeIcon!==null&&h(Ne)})}var _e=Mt(ee,2);{var be=h=>{const w=m(()=>t.toast.component);var T=y(),M=g(T);Nt(M,()=>e(w),(C,E)=>{E(C,kt(()=>t.toast.componentProps,{closeToast:l}))}),s(h,T)},xe=h=>{var w=Un(),T=g(w);{var M=x=>{var S=Fn(),d=it(S);{var D=b=>{var I=y(),p=g(I);{var W=Pt=>{var oe=y(),Te=g(oe);Nt(Te,()=>t.toast.icon,(Y,J)=>{J(Y,{})}),s(Pt,oe)},ft=Pt=>{o(Pt)};L(p,Pt=>{t.toast.icon?Pt(W):Pt(ft,!1)})}s(b,I)};L(d,b=>{(t.toast.promise||e(z)==="loading")&&b(D)})}var V=Mt(d,2);{var N=b=>{var I=y(),p=g(I);{var W=Y=>{var J=y(),At=g(J);Nt(At,()=>t.toast.icon,(on,rn)=>{rn(on,{})}),s(Y,J)},ft=Y=>{var J=y(),At=g(J);U(At,()=>t.successIcon??Q),s(Y,J)},Pt=Y=>{var J=y(),At=g(J);U(At,()=>t.errorIcon??Q),s(Y,J)},oe=Y=>{var J=y(),At=g(J);U(At,()=>t.warningIcon??Q),s(Y,J)},Te=Y=>{var J=y(),At=g(J);U(At,()=>t.infoIcon??Q),s(Y,J)};L(p,Y=>{t.toast.icon?Y(W):e(z)==="success"?Y(ft,1):e(z)==="error"?Y(Pt,2):e(z)==="warning"?Y(oe,3):e(z)==="info"&&Y(Te,4)})}s(b,I)};L(V,b=>{t.toast.type!=="loading"&&b(N)})}$(S),nt(b=>bt(S,1,b),[()=>_t(yt(e(ot)?.icon,t.toast?.classes?.icon))]),s(x,S)};L(T,x=>{(e(z)||t.toast.icon||t.toast.promise)&&t.toast.icon!==null&&(e(Et)!==null||t.toast.icon)&&x(M)})}var C=Mt(T,2),E=it(C),K=it(E);{var zt=x=>{var S=y(),d=g(S);{var D=N=>{const b=m(()=>t.toast.title);var I=y(),p=g(I);Nt(p,()=>e(b),(W,ft)=>{ft(W,kt(()=>t.toast.componentProps))}),s(N,I)},V=N=>{var b=Re();nt(()=>ie(b,t.toast.title)),s(N,b)};L(d,N=>{typeof t.toast.title!="string"?N(D):N(V,!1)})}s(x,S)};L(K,x=>{t.toast.title&&x(zt)})}$(E);var Yt=Mt(E,2);{var Ie=x=>{var S=Vn(),d=it(S);{var D=N=>{const b=m(()=>t.toast.description);var I=y(),p=g(I);Nt(p,()=>e(b),(W,ft)=>{ft(W,kt(()=>t.toast.componentProps))}),s(N,I)},V=N=>{var b=Re();nt(()=>ie(b,t.toast.description)),s(N,b)};L(d,N=>{typeof t.toast.description!="string"?N(D):N(V,!1)})}$(S),nt(N=>bt(S,1,N),[()=>_t(yt(u(),e(Dt),e(ot)?.description,t.toast.classes?.description))]),s(x,S)};L(Yt,x=>{t.toast.description&&x(Ie)})}$(C);var ne=Mt(C,2);{var ut=x=>{var S=y(),d=g(S);{var D=b=>{var I=y(),p=g(I);Nt(p,()=>t.toast.cancel,(W,ft)=>{ft(W,{})}),s(b,I)},V=b=>{var I=jn(),p=it(I,!0);$(I),nt(W=>{Se(I,t.toast.cancelButtonStyle??i()),bt(I,1,W),ie(p,t.toast.cancel.label)},[()=>_t(yt(e(ot)?.cancelButton,t.toast?.classes?.cancelButton))]),qt("click",I,W=>{ae(t.toast.cancel)&&e(et)&&(t.toast.cancel?.onClick?.(W),l())}),s(b,I)},N=m(()=>ae(t.toast.cancel));L(d,b=>{typeof t.toast.cancel=="function"?b(D):e(N)&&b(V,1)})}s(x,S)};L(ne,x=>{t.toast.cancel&&x(ut)})}var X=Mt(ne,2);{var dt=x=>{var S=y(),d=g(S);{var D=b=>{var I=y(),p=g(I);Nt(p,()=>t.toast.action,(W,ft)=>{ft(W,{})}),s(b,I)},V=b=>{var I=qn(),p=it(I,!0);$(I),nt(W=>{Se(I,t.toast.actionButtonStyle??r()),bt(I,1,W),ie(p,t.toast.action.label)},[()=>_t(yt(e(ot)?.actionButton,t.toast?.classes?.actionButton))]),qt("click",I,W=>{ae(t.toast.action)&&(t.toast.action?.onClick(W),!W.defaultPrevented&&l())}),s(b,I)},N=m(()=>ae(t.toast.action));L(d,b=>{typeof t.toast.action=="function"?b(D):e(N)&&b(V,1)})}s(x,S)};L(X,x=>{t.toast.action&&x(dt)})}nt((x,S)=>{bt(C,1,x),bt(E,1,S)},[()=>_t(yt(e(ot)?.content,t.toast?.classes?.content)),()=>_t(yt(e(ot)?.title,t.toast?.classes?.title))]),s(h,w)};L(_e,h=>{t.toast.component?h(be):h(xe,!1)})}$(f),Je(f,h=>c(G,h),()=>e(G)),nt((h,w,T)=>{bt(f,1,h),A(f,"aria-live",t.toast.important?"assertive":"polite"),A(f,"data-rich-colors",t.toast.richColors??_()),A(f,"data-styled",!(t.toast.component||t.toast.unstyled||a())),A(f,"data-mounted",e(P)),A(f,"data-promise",w),A(f,"data-swiped",e(st)),A(f,"data-removed",e(O)),A(f,"data-visible",e(fe)),A(f,"data-y-position",e(pt)[0]),A(f,"data-x-position",e(pt)[1]),A(f,"data-index",t.index),A(f,"data-front",e(de)),A(f,"data-swiping",e(at)),A(f,"data-dismissible",e(et)),A(f,"data-type",e(z)),A(f,"data-invert",e(ge)),A(f,"data-swipe-out",e(j)),A(f,"data-swipe-direction",e(Ht)),A(f,"data-expanded",T),Vt=Se(f,`${t.style} ${t.toast.style}`,Vt,{"--index":t.index,"--toasts-before":t.index,"--z-index":Z.toasts.length-t.index,"--offset":`${e(O)?e(R):e(Ft)}px`,"--initial-height":t.expandByDefault?"auto":`${e(tt)}px`})},[()=>_t(yt(t.class,e(Wt),e(ot)?.toast,t.toast?.classes?.toast,e(ot)?.[e(z)],t.toast?.classes?.[e(z)])),()=>!!t.toast.promise,()=>!!(t.expanded||t.expandByDefault&&e(P))]),qt("pointermove",f,te),qt("pointerup",f,ze),qt("pointerdown",f,ye),an("dragend",f,wt),s(n,f),mt()}sn(["pointermove","pointerup","pointerdown","click"]);var Zn=Ut('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-success-icon=""><path fill-rule="evenodd" d="M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z" clip-rule="evenodd"></path></svg>');function Gn(n){var t=Zn();s(n,t)}var Xn=Ut('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-error-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"></path></svg>');function Jn(n){var t=Xn();s(n,t)}var Qn=Ut('<svg viewBox="0 0 64 64" fill="currentColor" height="20" width="20" data-sonner-warning-icon="" xmlns="http://www.w3.org/2000/svg"><path d="M32.427,7.987c2.183,0.124 4,1.165 5.096,3.281l17.936,36.208c1.739,3.66 -0.954,8.585 -5.373,8.656l-36.119,0c-4.022,-0.064 -7.322,-4.631 -5.352,-8.696l18.271,-36.207c0.342,-0.65 0.498,-0.838 0.793,-1.179c1.186,-1.375 2.483,-2.111 4.748,-2.063Zm-0.295,3.997c-0.687,0.034 -1.316,0.419 -1.659,1.017c-6.312,11.979 -12.397,24.081 -18.301,36.267c-0.546,1.225 0.391,2.797 1.762,2.863c12.06,0.195 24.125,0.195 36.185,0c1.325,-0.064 2.321,-1.584 1.769,-2.85c-5.793,-12.184 -11.765,-24.286 -17.966,-36.267c-0.366,-0.651 -0.903,-1.042 -1.79,-1.03Z"></path><path d="M33.631,40.581l-3.348,0l-0.368,-16.449l4.1,0l-0.384,16.449Zm-3.828,5.03c0,-0.609 0.197,-1.113 0.592,-1.514c0.396,-0.4 0.935,-0.601 1.618,-0.601c0.684,0 1.223,0.201 1.618,0.601c0.395,0.401 0.593,0.905 0.593,1.514c0,0.587 -0.193,1.078 -0.577,1.473c-0.385,0.395 -0.929,0.593 -1.634,0.593c-0.705,0 -1.249,-0.198 -1.634,-0.593c-0.384,-0.395 -0.576,-0.886 -0.576,-1.473Z"></path></svg>');function pn(n){var t=Qn();s(n,t)}var $n=Ut('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" height="20" width="20" data-sonner-info-icon=""><path fill-rule="evenodd" d="M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z" clip-rule="evenodd"></path></svg>');function to(n){var t=$n();s(n,t)}var eo=Ut('<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" data-sonner-close-icon=""><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>');function no(n){var t=eo();s(n,t)}const oo=3,Qe="24px",pe="16px",io=4e3,ro=356,ao=14,Ae="dark",se="light";function so(n,t){const o={};return[n,t].forEach((i,r)=>{const u=r===1,a=u?"--mobile-offset":"--offset",_=u?pe:Qe;function v(P){["top","right","bottom","left"].forEach(O=>{o[`${a}-${O}`]=typeof P=="number"?`${P}px`:P})}typeof i=="number"||typeof i=="string"?v(i):typeof i=="object"?["top","right","bottom","left"].forEach(P=>{const O=i[P];O===void 0?o[`${a}-${P}`]=_:o[`${a}-${P}`]=typeof O=="number"?`${O}px`:O}):v(_)}),o}var co=rt("<ol></ol>"),lo=rt('<section aria-live="polite" aria-relevant="additions text" aria-atomic="false" class="svelte-nbs0zk"><!></section>');function uo(n,t){ht(t,!0);function o(l){return l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?Ae:se}let i=k(t,"invert",3,!1),r=k(t,"position",3,"bottom-right"),u=k(t,"hotkey",19,()=>["altKey","KeyT"]),a=k(t,"expand",3,!1),_=k(t,"closeButton",3,!1),v=k(t,"offset",3,Qe),P=k(t,"mobileOffset",3,pe),O=k(t,"theme",3,"light"),at=k(t,"richColors",3,!1),j=k(t,"duration",3,io),st=k(t,"visibleToasts",3,oo),R=k(t,"toastOptions",19,()=>({})),tt=k(t,"dir",7,"auto"),lt=k(t,"gap",3,ao),G=k(t,"pauseWhenPageIsHidden",3,!1),q=k(t,"containerAriaLabel",3,"Notifications"),Ht=k(t,"closeButtonAriaLabel",3,"Close toast"),de=Ct(t,["$$slots","$$events","$$legacy","invert","position","hotkey","expand","closeButton","offset","mobileOffset","theme","richColors","duration","visibleToasts","toastOptions","dir","gap","pauseWhenPageIsHidden","loadingIcon","successIcon","errorIcon","warningIcon","closeIcon","infoIcon","containerAriaLabel","class","closeButtonAriaLabel","onblur","onfocus","onmouseenter","onmousemove","onmouseleave","ondragend","onpointerdown","onpointerup"]);function fe(){if(tt()!=="auto")return tt();if(typeof window>"u"||typeof document>"u")return"ltr";const l=document.documentElement.getAttribute("dir");return l==="auto"||!l?(Gt(()=>tt(window.getComputedStyle(document.documentElement).direction??"ltr")),tt()):(Gt(()=>tt(l)),l)}const z=m(()=>Array.from(new Set([r(),...Z.toasts.filter(l=>l.position).map(l=>l.position)].filter(Boolean))));let et=B(!1),Wt=B(!1),Dt=B(Rt(o(O()))),It=B(void 0),Tt=B(null),Lt=B(!1);const Bt=m(()=>u().join("+").replace(/Key/g,"").replace(/Digit/g,""));ct(()=>{Z.toasts.length<=1&&c(et,!1)}),ct(()=>{const l=Z.toasts.filter(H=>H.dismiss&&!H.delete);if(l.length>0){const H=Z.toasts.map(gt=>l.find(Ot=>Ot.id===gt.id)?{...gt,delete:!0}:gt);Z.toasts=H}}),ct(()=>()=>{e(It)&&e(Tt)&&(e(Tt).focus({preventScroll:!0}),c(Tt,null),c(Lt,!1))}),Ce(()=>(Z.reset(),xt(document,"keydown",H=>{u().every(vt=>H[vt]||H.code===vt)&&(c(et,!0),e(It)?.focus()),H.code==="Escape"&&(document.activeElement===e(It)||e(It)?.contains(document.activeElement))&&c(et,!1)}))),ct(()=>{if(O()!=="system"&&c(Dt,O()),typeof window<"u"){O()==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?c(Dt,Ae):c(Dt,se));const l=window.matchMedia("(prefers-color-scheme: dark)"),H=({matches:gt})=>{O()==="system"&&c(Dt,gt?Ae:se,!0)};"addEventListener"in l?l.addEventListener("change",H):l.addListener(H)}});const pt=l=>{t.onblur?.(l),e(Lt)&&!l.currentTarget.contains(l.relatedTarget)&&(c(Lt,!1),e(Tt)&&(e(Tt).focus({preventScroll:!0}),c(Tt,null)))},he=l=>{t.onfocus?.(l),!(l.target instanceof HTMLElement&&l.target.dataset.dismissible==="false")&&(e(Lt)||(c(Lt,!0),c(Tt,l.relatedTarget,!0)))},me=l=>{t.onpointerdown?.(l),!(l.target instanceof HTMLElement&&l.target.dataset.dismissible==="false")&&c(Wt,!0)},ge=l=>{t.onmouseenter?.(l),c(et,!0)},Kt=l=>{t.onmouseleave?.(l),e(Wt)||c(et,!1)},ot=l=>{t.onmousemove?.(l),c(et,!0)},ve=l=>{t.ondragend?.(l),c(et,!1)},we=l=>{t.onpointerup?.(l),c(Wt,!1)};Mn.set(new mn);var St=lo();A(St,"tabindex",-1);var $t=it(St);{var Ft=l=>{var H=y(),gt=g(H);le(gt,18,()=>e(z),vt=>vt,(vt,Ot,ye,ze)=>{const te=m(()=>{const[f,Vt]=Ot.split("-");return{y:f,x:Vt}}),wt=m(()=>so(v(),P()));var Et=co();Me(Et,f=>({tabindex:-1,dir:f,class:t.class,"data-sonner-toaster":!0,"data-sonner-theme":e(Dt),"data-y-position":e(te).y,"data-x-position":e(te).x,style:t.style,onblur:pt,onfocus:he,onmouseenter:ge,onmousemove:ot,onmouseleave:Kt,ondragend:ve,onpointerdown:me,onpointerup:we,...de,[fn]:{"--front-toast-height":`${Z.heights[0]?.height}px`,"--width":`${ro}px`,"--gap":`${lt()}px`,"--offset-top":e(wt)["--offset-top"],"--offset-right":e(wt)["--offset-right"],"--offset-bottom":e(wt)["--offset-bottom"],"--offset-left":e(wt)["--offset-left"],"--mobile-offset-top":e(wt)["--mobile-offset-top"],"--mobile-offset-right":e(wt)["--mobile-offset-right"],"--mobile-offset-bottom":e(wt)["--mobile-offset-bottom"],"--mobile-offset-left":e(wt)["--mobile-offset-left"]}}),[fe],void 0,void 0,"svelte-nbs0zk"),le(Et,23,()=>Z.toasts.filter(f=>!f.position&&e(ye)===0||f.position===Ot),f=>f.id,(f,Vt,ee,Ne)=>{{const _e=ut=>{var X=y(),dt=g(X);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.successIcon??Q),s(d,D)},S=d=>{Gn(d)};L(dt,d=>{t.successIcon?d(x):t.successIcon!==null&&d(S,1)})}s(ut,X)},be=ut=>{var X=y(),dt=g(X);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.errorIcon??Q),s(d,D)},S=d=>{Jn(d)};L(dt,d=>{t.errorIcon?d(x):t.errorIcon!==null&&d(S,1)})}s(ut,X)},xe=ut=>{var X=y(),dt=g(X);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.warningIcon??Q),s(d,D)},S=d=>{pn(d)};L(dt,d=>{t.warningIcon?d(x):t.warningIcon!==null&&d(S,1)})}s(ut,X)},h=ut=>{var X=y(),dt=g(X);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.infoIcon??Q),s(d,D)},S=d=>{to(d)};L(dt,d=>{t.infoIcon?d(x):t.infoIcon!==null&&d(S,1)})}s(ut,X)},w=ut=>{var X=y(),dt=g(X);{var x=d=>{var D=y(),V=g(D);U(V,()=>t.closeIcon??Q),s(d,D)},S=d=>{no(d)};L(dt,d=>{t.closeIcon?d(x):t.closeIcon!==null&&d(S,1)})}s(ut,X)};let T=m(()=>R()?.duration??j()),M=m(()=>R()?.class??""),C=m(()=>R()?.descriptionClass||""),E=m(()=>R()?.style??""),K=m(()=>R().classes||{}),zt=m(()=>R().unstyled??!1),Yt=m(()=>R()?.cancelButtonStyle??""),Ie=m(()=>R()?.actionButtonStyle??""),ne=m(()=>R()?.closeButtonAriaLabel??Ht());Yn(f,{get index(){return e(ee)},get toast(){return e(Vt)},get defaultRichColors(){return at()},get duration(){return e(T)},get class(){return e(M)},get descriptionClass(){return e(C)},get invert(){return i()},get visibleToasts(){return st()},get closeButton(){return _()},get interacting(){return e(Wt)},get position(){return Ot},get style(){return e(E)},get classes(){return e(K)},get unstyled(){return e(zt)},get cancelButtonStyle(){return e(Yt)},get actionButtonStyle(){return e(Ie)},get closeButtonAriaLabel(){return e(ne)},get expandByDefault(){return a()},get expanded(){return e(et)},get pauseWhenPageIsHidden(){return G()},get loadingIcon(){return t.loadingIcon},successIcon:_e,errorIcon:be,warningIcon:xe,infoIcon:h,closeIcon:w,$$slots:{successIcon:!0,errorIcon:!0,warningIcon:!0,infoIcon:!0,closeIcon:!0}})}}),$(Et),Je(Et,f=>c(It,f),()=>e(It)),nt(()=>Et.dir=Et.dir),s(vt,Et)}),s(l,H)};L($t,l=>{Z.toasts.length>0&&l(Ft)})}$(St),nt(()=>A(St,"aria-label",`${q()??""} ${e(Bt)??""}`)),s(n,St),mt()}const $e=typeof window<"u"?window:void 0;function fo(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}let ho=class{#e;#t;constructor(t={}){const{window:o=$e,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Jt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?fo(this.#e):null}};new ho;function mo(n,t){switch(n){case"post":ct(t);break;case"pre":Xe(t);break}}function tn(n,t,o,i={}){const{lazy:r=!1}=i;let u=!r,a=Array.isArray(n)?[]:void 0;mo(t,()=>{const _=Array.isArray(n)?n.map(P=>P()):n();if(!u){u=!0,a=_;return}const v=Gt(()=>o(_,a));return a=_,v})}function Le(n,t,o){tn(n,"post",t,o)}function go(n,t,o){tn(n,"pre",t,o)}Le.pre=go;function vo(n,t){switch(n){case"local":return t.localStorage;case"session":return t.sessionStorage}}class en{#e;#t;#o;#n;#r;#i=B(0);constructor(t,o,i={}){const{storage:r="local",serializer:u={serialize:JSON.stringify,deserialize:JSON.parse},syncTabs:a=!0,window:_=$e}=i;if(this.#e=o,this.#t=t,this.#o=u,_===void 0)return;const v=vo(r,_);this.#n=v;const P=v.getItem(t);P!==null?this.#e=this.#a(P):this.#s(o),a&&r==="local"&&(this.#r=Jt(()=>xt(_,"storage",this.#c)))}get current(){this.#r?.(),e(this.#i);const t=this.#a(this.#n?.getItem(this.#t))??this.#e,o=new WeakMap,i=r=>{if(r===null||r?.constructor.name==="Date"||typeof r!="object")return r;let u=o.get(r);return u||(u=new Proxy(r,{get:(a,_)=>(e(this.#i),i(Reflect.get(a,_))),set:(a,_,v)=>(c(this.#i,e(this.#i)+1),Reflect.set(a,_,v),this.#s(t),!0)}),o.set(r,u)),u};return i(t)}set current(t){this.#s(t),c(this.#i,e(this.#i)+1)}#c=t=>{t.key!==this.#t||t.newValue===null||(this.#e=this.#a(t.newValue),c(this.#i,e(this.#i)+1))};#a(t){try{return this.#o.deserialize(t)}catch(o){console.error(`Error when parsing "${t}" from persisted store "${this.#t}"`,o);return}}#s(t){try{t!=null&&this.#n?.setItem(this.#t,this.#o.serialize(t))}catch(o){console.error(`Error when writing value from persisted store "${this.#t}" to ${this.#n}`,o)}}}function qe(n){return n.filter(t=>t.length>0)}const nn={getItem:n=>null,setItem:(n,t)=>{}},ue=typeof document<"u";function wo(n){return typeof n=="function"}function yo(n){return n!==null&&typeof n=="object"}const Xt=Symbol("box"),Oe=Symbol("is-writable");function _o(n){return yo(n)&&Xt in n}function bo(n){return F.isBox(n)&&Oe in n}function F(n){let t=B(Rt(n));return{[Xt]:!0,[Oe]:!0,get current(){return e(t)},set current(o){c(t,o,!0)}}}function xo(n,t){const o=m(n);return t?{[Xt]:!0,[Oe]:!0,get current(){return e(o)},set current(i){t(i)}}:{[Xt]:!0,get current(){return n()}}}function Io(n){return F.isBox(n)?n:wo(n)?F.with(n):F(n)}function To(n){return Object.entries(n).reduce((t,[o,i])=>F.isBox(i)?(F.isWritableBox(i)?Object.defineProperty(t,o,{get(){return i.current},set(r){i.current=r}}):Object.defineProperty(t,o,{get(){return i.current}}),t):Object.assign(t,{[o]:i}),{})}function So(n){return F.isWritableBox(n)?{[Xt]:!0,get current(){return n.current}}:n}F.from=Io;F.with=xo;F.flatten=To;F.readonly=So;F.isBox=_o;F.isWritableBox=bo;function Eo(n,t){const o=RegExp(n,"g");return i=>{if(typeof i!="string")throw new TypeError(`expected an argument of type string, but got ${typeof i}`);return i.match(o)?i.replace(o,t):i}}const Ao=Eo(/[A-Z]/,n=>`-${n.toLowerCase()}`);function ko(n){if(!n||typeof n!="object"||Array.isArray(n))throw new TypeError(`expected an argument of type object, but got ${typeof n}`);return Object.keys(n).map(t=>`${Ao(t)}: ${n[t]};`).join(`
|
|
3
|
+
`)}function Bo(n={}){return ko(n).replace(`
|
|
4
|
+
`," ")}const Po={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",transform:"translateX(-100%)"};Bo(Po);const Mo=typeof window<"u"?window:void 0;function Co(n){let t=n.activeElement;for(;t?.shadowRoot;){const o=t.shadowRoot.activeElement;if(o===t)break;t=o}return t}class Do{#e;#t;constructor(t={}){const{window:o=Mo,document:i=o?.document}=t;o!==void 0&&(this.#e=i,this.#t=Jt(r=>{const u=xt(o,"focusin",r),a=xt(o,"focusout",r);return()=>{u(),a()}}))}get current(){return this.#t?.(),this.#e?Co(this.#e):null}}new Do;const ke=F("mode-watcher-mode"),Be=F("mode-watcher-theme"),Lo=["dark","light","system"];function Ue(n){return typeof n!="string"?!1:Lo.includes(n)}class Oo{#e="system";#t=ue?localStorage:nn;#o=this.#t.getItem(ke.current);#n=Ue(this.#o)?this.#o:this.#e;#r=B(Rt(this.#i()));#i(t=this.#n){return new en(ke.current,t,{serializer:{serialize:o=>o,deserialize:o=>Ue(o)?o:this.#e}})}constructor(){De(()=>Le.pre(()=>ke.current,(t,o)=>{const i=e(this.#r).current;c(this.#r,this.#i(i),!0),o&&localStorage.removeItem(o)}))}get current(){return e(this.#r).current}set current(t){e(this.#r).current=t}}class zo{#e=void 0;#t=!0;#o=B(Rt(this.#e));#n=typeof window<"u"&&typeof window.matchMedia=="function"?new kn("prefers-color-scheme: light"):{current:!1};query(){ue&&c(this.#o,this.#n.current?"light":"dark",!0)}tracking(t){this.#t=t}constructor(){De(()=>{Xe(()=>{this.#t&&this.query()})}),this.query=this.query.bind(this),this.tracking=this.tracking.bind(this)}get current(){return e(this.#o)}}const Ke=new Oo,No=new zo;class Ro{#e=ue?localStorage:nn;#t=this.#e.getItem(Be.current);#o=this.#t===null||this.#t===void 0?"":this.#t;#n=B(Rt(this.#r()));#r(t=this.#o){return new en(Be.current,t,{serializer:{serialize:o=>typeof o!="string"?"":o,deserialize:o=>o}})}constructor(){De(()=>Le.pre(()=>Be.current,(t,o)=>{const i=e(this.#n).current;c(this.#n,this.#r(i),!0),o&&localStorage.removeItem(o)}))}get current(){return e(this.#n).current}set current(t){e(this.#n).current=t}}new Ro;let Ye,Ze,Ge=!1,Zt=null;function Ho(){return Zt||(Zt=document.createElement("style"),Zt.appendChild(document.createTextNode(`* {
|
|
5
|
+
-webkit-transition: none !important;
|
|
6
|
+
-moz-transition: none !important;
|
|
7
|
+
-o-transition: none !important;
|
|
8
|
+
-ms-transition: none !important;
|
|
9
|
+
transition: none !important;
|
|
10
|
+
}`)),Zt)}function Wo(n,t=!1){if(typeof document>"u")return;if(!Ge){Ge=!0,n();return}if(typeof window<"u"&&window.__vitest_worker__){n();return}clearTimeout(Ye),clearTimeout(Ze);const i=Ho(),r=()=>document.head.appendChild(i),u=()=>{i.parentNode&&document.head.removeChild(i)};function a(){n(),window.requestAnimationFrame(u)}if(typeof window.requestAnimationFrame<"u"){r(),t?a():window.requestAnimationFrame(()=>{a()});return}r(),Ye=window.setTimeout(()=>{n(),Ze=window.setTimeout(u,16)},16)}const ce=F(void 0),Fo=F(!0),Vo=F(!1),jo=F([]),qo=F([]);function Uo(){const n=m(()=>{if(!ue)return;const t=Ke.current==="system"?No.current:Ke.current,o=qe(jo.current),i=qe(qo.current);function r(){const u=document.documentElement,a=document.querySelector('meta[name="theme-color"]');t==="light"?(o.length&&u.classList.remove(...o),i.length&&u.classList.add(...i),u.style.colorScheme="light",a&&ce.current&&a.setAttribute("content",ce.current.light)):(i.length&&u.classList.remove(...i),o.length&&u.classList.add(...o),u.style.colorScheme="dark",a&&ce.current&&a.setAttribute("content",ce.current.dark))}return Fo.current?Wo(r,Vo.current):r(),t});return{get current(){return e(n)}}}const Ko=Uo();const Yo={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};const Zo=n=>{for(const t in n)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};var Go=Ut("<svg><!><!></svg>");function Qt(n,t){ht(t,!0);const o=k(t,"color",3,"currentColor"),i=k(t,"size",3,24),r=k(t,"strokeWidth",3,2),u=k(t,"absoluteStrokeWidth",3,!1),a=k(t,"iconNode",19,()=>[]),_=Ct(t,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]);var v=Go();Me(v,(at,j)=>({...Yo,...at,..._,width:i(),height:i(),stroke:o(),"stroke-width":j,class:["lucide-icon lucide",t.name&&`lucide-${t.name}`,t.class]}),[()=>!t.children&&!Zo(_)&&{"aria-hidden":"true"},()=>u()?Number(r())*24/Number(i()):r()]);var P=it(v);le(P,17,a,vn,(at,j)=>{var st=m(()=>ln(e(j),2));let R=()=>e(st)[0],tt=()=>e(st)[1];var lt=y(),G=g(lt);gn(G,R,!0,(q,Ht)=>{Me(q,()=>({...tt()}))}),s(at,lt)});var O=Mt(P);U(O,()=>t.children??Q),$(v),s(n,v),mt()}function Xo(n,t){ht(t,!0);let o=Ct(t,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56"}]];Qt(n,kt({name:"loader-circle"},()=>o,{get iconNode(){return i},children:(r,u)=>{var a=y(),_=g(a);U(_,()=>t.children??Q),s(r,a)},$$slots:{default:!0}})),mt()}function Jo(n,t){ht(t,!0);let o=Ct(t,["$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]];Qt(n,kt({name:"circle-check"},()=>o,{get iconNode(){return i},children:(r,u)=>{var a=y(),_=g(a);U(_,()=>t.children??Q),s(r,a)},$$slots:{default:!0}})),mt()}function Qo(n,t){ht(t,!0);let o=Ct(t,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"m15 9-6 6"}],["path",{d:"M2.586 16.726A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2h6.624a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586z"}],["path",{d:"m9 9 6 6"}]];Qt(n,kt({name:"octagon-x"},()=>o,{get iconNode(){return i},children:(r,u)=>{var a=y(),_=g(a);U(_,()=>t.children??Q),s(r,a)},$$slots:{default:!0}})),mt()}function po(n,t){ht(t,!0);let o=Ct(t,["$$slots","$$events","$$legacy"]);const i=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 16v-4"}],["path",{d:"M12 8h.01"}]];Qt(n,kt({name:"info"},()=>o,{get iconNode(){return i},children:(r,u)=>{var a=y(),_=g(a);U(_,()=>t.children??Q),s(r,a)},$$slots:{default:!0}})),mt()}function $o(n,t){ht(t,!0);let o=Ct(t,["$$slots","$$events","$$legacy"]);const i=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];Qt(n,kt({name:"triangle-alert"},()=>o,{get iconNode(){return i},children:(r,u)=>{var a=y(),_=g(a);U(_,()=>t.children??Q),s(r,a)},$$slots:{default:!0}})),mt()}function ti(n,t){ht(t,!0);let o=Ct(t,["$$slots","$$events","$$legacy"]);uo(n,kt({get theme(){return Ko.current},class:"toaster group",style:"--normal-bg: var(--color-bg-elevated); --normal-text: var(--color-text-primary); --normal-border: var(--color-border-strong);"},()=>o,{loadingIcon:v=>{Xo(v,{class:"size-4 animate-spin"})},successIcon:v=>{Jo(v,{class:"size-4"})},errorIcon:v=>{Qo(v,{class:"size-4"})},infoIcon:v=>{po(v,{class:"size-4"})},warningIcon:v=>{$o(v,{class:"size-4"})},$$slots:{loadingIcon:!0,successIcon:!0,errorIcon:!0,infoIcon:!0,warningIcon:!0}})),mt()}var ei=rt('<div style="display: contents;"><!> <!></div>');function mi(n,t){ht(t,!0);const o=typeof localStorage<"u"?localStorage.getItem("theme"):null;let i=B(Rt(o==="light"?"light":"dark"));Pe("theme",{get current(){return e(i)},toggle(){c(i,e(i)==="dark"?"light":"dark",!0),localStorage.setItem("theme",e(i))}});const u=typeof localStorage<"u"?localStorage.getItem("chatOpen"):null;let a=B(u==="true");Pe("chat",{get open(){return e(a)},toggle(){c(a,!e(a)),localStorage.setItem("chatOpen",String(e(a)))},close(){c(a,!1),localStorage.setItem("chatOpen","false")}}),ct(()=>{document.documentElement.setAttribute("data-theme",e(i))});let v=B(null);ct(()=>{if(re.loading)return;const j=re.user?.email??(re.authEnabled?null:"__open__");j&&j!==e(v)&&(e(v)!==null&&wn.deselect(),c(v,j,!0),We.load(),Fe.connect()),!j&&e(v)&&(c(v,null),Fe.disconnect())}),Ce(async()=>{const j=window.location.pathname,st=j==="/login",R=j==="/setup",{authenticated:tt,authEnabled:lt,needsSetup:G}=await re.checkAuth();if(G&&!R){Ee("/setup");return}if(lt&&!tt&&!st){Ee("/login");return}if(tt&&(st||R)){Ee("/");return}st||R||(jt(()=>import("../chunks/BB_5th5W.js"),__vite__mapDeps([0,1,2]),import.meta.url).catch(()=>{}),Promise.all([jt(()=>import("../chunks/Cs5oz2oJ.js"),[],import.meta.url),jt(()=>import("../chunks/BVBRzmeQ.js").then(q=>q.i),__vite__mapDeps([3,4]),import.meta.url),jt(()=>import("../chunks/B1y7Wy5O.js"),__vite__mapDeps([5,4,3,6,7,8]),import.meta.url),jt(()=>import("../chunks/D2aTbzFm.js"),__vite__mapDeps([6,7,4,3]),import.meta.url),jt(()=>import("../chunks/BXuvR8Ks.js").then(q=>q.i),[],import.meta.url)]).catch(()=>{}),window.addEventListener("sg-theme-change",q=>{c(i,q.detail,!0)}))});var P=ei();hn("12qhfyh",j=>{un(()=>{dn.title=(We.name||"Studiograph")??""})});var O=it(P);U(O,()=>t.children);var at=Mt(O,2);ti(at,{}),$(P),nt(()=>A(P,"data-theme",e(i))),s(n,P),mt()}export{mi as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as u,f as h,s as a}from"../chunks/Cs_ROD7H.js";import"../chunks/CQCkXCml.js";import{y as g,f as l,I as v,A as d,B as e,G as o,D as _}from"../chunks/BeBar3OL.js";import{i as x}from"../chunks/DiP47fAp.js";import{s as $,p}from"../chunks/D4FXhiC2.js";const k={get error(){return p.error},get status(){return p.status}};$.updated.check;const m=k;var b=h("<h1> </h1> <p> </p>",1);function G(i,f){g(f,!1),x();var t=b(),r=l(t),n=e(r,!0);o(r);var s=_(r,2),c=e(s,!0);o(s),v(()=>{a(n,m.status),a(c,m.error?.message)}),u(i,t),d()}export{G as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as v,s as $,f as d}from"../chunks/Cs_ROD7H.js";import"../chunks/CQCkXCml.js";import{y as b,z as C,A,B as t,D as l,F as S,G as e,I as V}from"../chunks/BeBar3OL.js";import{i as m}from"../chunks/xBRYfpah.js";import{i as k}from"../chunks/DiP47fAp.js";import{A as P}from"../chunks/Cg9NOuOl.js";import{V as z,C as B}from"../chunks/B7eduG_j.js";import{w as p}from"../chunks/DP09rP34.js";import{n as D}from"../chunks/CXuhHL4d.js";var E=d('<h2 class="svelte-1uha8ag"> </h2>'),F=d('<div class="content-row svelte-1uha8ag"><div class="entity-area svelte-1uha8ag"><!> <div class="welcome svelte-1uha8ag"><!> <p class="svelte-1uha8ag">Select an entity from the sidebar to get started.</p></div></div> <!></div>');function M(c,f){b(f,!1);const h=C("chat");D.showEntity(),k(),P(c,{children:(g,G)=>{var o=F(),s=t(o),i=t(s);z(i,{activeView:"entity"});var n=l(i,2),_=t(n);{var u=a=>{var r=E(),y=t(r);e(r),V(()=>$(y,`Welcome to ${(p.name||"Studiograph")??""}`)),v(a,r)};m(_,a=>{p.nameLoaded&&a(u)})}S(2),e(n),e(s);var w=l(s,2);{var x=a=>{B(a,{})};m(w,a=>{h.open&&a(x)})}e(o),v(g,o)},$$slots:{default:!0}}),A()}export{M as component};
|