@hachej/boring-ui-cli 0.1.23 → 0.1.24

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.
Files changed (66) hide show
  1. package/dist/server/cli.js +30 -8
  2. package/package.json +7 -7
  3. package/public/assets/{CodeEditor-DQqOn4xz-Yh4ayLZ2.js → CodeEditor-DQqOn4xz-BnYIpEQ0.js} +1 -1
  4. package/public/assets/FileTree-DjPzfDMq-jOFMfLV-.js +21 -0
  5. package/public/assets/{MarkdownEditor-DKC4gNT4-B88S4PUU.js → MarkdownEditor-BbSy0bLV-_8qFqqna.js} +1 -1
  6. package/public/assets/{_baseUniq-BkPl99io.js → _baseUniq-DysFpiFw.js} +1 -1
  7. package/public/assets/{arc-BmCLWzzl.js → arc-D0sqkACA.js} +1 -1
  8. package/public/assets/{architectureDiagram-Q4EWVU46-DNYm8a_3.js → architectureDiagram-Q4EWVU46-DnyELkA2.js} +1 -1
  9. package/public/assets/{blockDiagram-DXYQGD6D-BF3un1-S.js → blockDiagram-DXYQGD6D-DEkkj6Fh.js} +1 -1
  10. package/public/assets/{c4Diagram-AHTNJAMY-URnru7yI.js → c4Diagram-AHTNJAMY-CEZo72O7.js} +1 -1
  11. package/public/assets/channel-Ci4DEwaO.js +1 -0
  12. package/public/assets/{chunk-4BX2VUAB-BVFFRFXt.js → chunk-4BX2VUAB-kct9rMc4.js} +1 -1
  13. package/public/assets/{chunk-4TB4RGXK-CVAE0ox0.js → chunk-4TB4RGXK-przR2bht.js} +1 -1
  14. package/public/assets/{chunk-55IACEB6-BiR4CudN.js → chunk-55IACEB6-BtFWJCbx.js} +1 -1
  15. package/public/assets/{chunk-EDXVE4YY-C4vYYcCx.js → chunk-EDXVE4YY-wnitHF3B.js} +1 -1
  16. package/public/assets/{chunk-FMBD7UC4-DUKj3k11.js → chunk-FMBD7UC4-8PDhdiie.js} +1 -1
  17. package/public/assets/{chunk-OYMX7WX6-D2OABfzB.js → chunk-OYMX7WX6-TDftW5K8.js} +1 -1
  18. package/public/assets/{chunk-QZHKN3VN-Ba-S7G-B.js → chunk-QZHKN3VN-B5vnQXaM.js} +1 -1
  19. package/public/assets/{chunk-YZCP3GAM-ul5LJwPS.js → chunk-YZCP3GAM-CGg2izn8.js} +1 -1
  20. package/public/assets/classDiagram-6PBFFD2Q-0PAZNzgC.js +1 -0
  21. package/public/assets/classDiagram-v2-HSJHXN6E-0PAZNzgC.js +1 -0
  22. package/public/assets/clone-_lPYOTLf.js +1 -0
  23. package/public/assets/{cose-bilkent-S5V4N54A-C-Fvtfty.js → cose-bilkent-S5V4N54A-CjXKbjHV.js} +1 -1
  24. package/public/assets/{dagre-KV5264BT-CJcaV7N3.js → dagre-KV5264BT-D-wBcwT7.js} +1 -1
  25. package/public/assets/{diagram-5BDNPKRD-CCYWKSat.js → diagram-5BDNPKRD-Ch4e4G6h.js} +1 -1
  26. package/public/assets/{diagram-G4DWMVQ6-udD9oNU1.js → diagram-G4DWMVQ6-a_PPD1uY.js} +1 -1
  27. package/public/assets/{diagram-MMDJMWI5-MZ_ruQb8.js → diagram-MMDJMWI5-D9Lkv8IB.js} +1 -1
  28. package/public/assets/{diagram-TYMM5635-CtE_8FNM.js → diagram-TYMM5635-BlfaVidf.js} +1 -1
  29. package/public/assets/{erDiagram-SMLLAGMA-U5_hlC3D.js → erDiagram-SMLLAGMA-CUWacc8b.js} +1 -1
  30. package/public/assets/{flowDiagram-DWJPFMVM-o-Z0zrdA.js → flowDiagram-DWJPFMVM-DVIhUX7Z.js} +1 -1
  31. package/public/assets/{ganttDiagram-T4ZO3ILL-j779cARK.js → ganttDiagram-T4ZO3ILL-g3ncLabH.js} +1 -1
  32. package/public/assets/{gitGraphDiagram-UUTBAWPF-BX9RAJRq.js → gitGraphDiagram-UUTBAWPF-DpPqglKx.js} +1 -1
  33. package/public/assets/{graph-DlYXjTAJ.js → graph-CDl50skT.js} +1 -1
  34. package/public/assets/{highlighted-body-OFNGDK62-ByN1GLP7.js → highlighted-body-OFNGDK62-BcVhfY0-.js} +1 -1
  35. package/public/assets/index-C9S_GD0T.js +1330 -0
  36. package/public/assets/{index-mdYLn1DD.js → index-CrFvzn5a.js} +1 -1
  37. package/public/assets/index-Css1pwyY.css +1 -0
  38. package/public/assets/{infoDiagram-42DDH7IO-HM3KaJwr.js → infoDiagram-42DDH7IO-COfGVlDB.js} +1 -1
  39. package/public/assets/{ishikawaDiagram-UXIWVN3A-CqWWzJaQ.js → ishikawaDiagram-UXIWVN3A-BbjR1GdS.js} +1 -1
  40. package/public/assets/{journeyDiagram-VCZTEJTY-NAb0Yk_n.js → journeyDiagram-VCZTEJTY-DJHw1u4a.js} +1 -1
  41. package/public/assets/{kanban-definition-6JOO6SKY-CPygy9YY.js → kanban-definition-6JOO6SKY-agbEFS20.js} +1 -1
  42. package/public/assets/{layout-DJ-6dQrs.js → layout-BtrYpvUW.js} +1 -1
  43. package/public/assets/{linear-CszDTGQA.js → linear-C4IQ6Sya.js} +1 -1
  44. package/public/assets/{min-DdDDvpR0.js → min-DDWmdqiX.js} +1 -1
  45. package/public/assets/{mindmap-definition-QFDTVHPH-elHTlBo0.js → mindmap-definition-QFDTVHPH-By9_uC_s.js} +1 -1
  46. package/public/assets/{pieDiagram-DEJITSTG-BPqw1uEN.js → pieDiagram-DEJITSTG-DfzJSvMR.js} +1 -1
  47. package/public/assets/{quadrantDiagram-34T5L4WZ-BJtfLOqE.js → quadrantDiagram-34T5L4WZ-BszNW2Gc.js} +1 -1
  48. package/public/assets/{requirementDiagram-MS252O5E-hA1WZpUI.js → requirementDiagram-MS252O5E-fdyCkRN5.js} +1 -1
  49. package/public/assets/{sankeyDiagram-XADWPNL6-DuHhU3WJ.js → sankeyDiagram-XADWPNL6-tg2HOfl2.js} +1 -1
  50. package/public/assets/{sequenceDiagram-FGHM5R23-Tbl1IuRt.js → sequenceDiagram-FGHM5R23-GF78cQ5y.js} +1 -1
  51. package/public/assets/{stateDiagram-FHFEXIEX-CH-CvjPW.js → stateDiagram-FHFEXIEX-C709lyuE.js} +1 -1
  52. package/public/assets/stateDiagram-v2-QKLJ7IA2-BbgcVrKo.js +1 -0
  53. package/public/assets/{timeline-definition-GMOUNBTQ-DHg1w3KA.js → timeline-definition-GMOUNBTQ-D2y-83yP.js} +1 -1
  54. package/public/assets/{vennDiagram-DHZGUBPP-Cbxk2-mx.js → vennDiagram-DHZGUBPP-BOsWwU4c.js} +1 -1
  55. package/public/assets/{wardley-RL74JXVD-BYEnGe7z.js → wardley-RL74JXVD-NEg4mPyC.js} +1 -1
  56. package/public/assets/{wardleyDiagram-NUSXRM2D-C07IfeYR.js → wardleyDiagram-NUSXRM2D-BbXAj99t.js} +1 -1
  57. package/public/assets/{xychartDiagram-5P7HB3ND-BZ0V0kZ7.js → xychartDiagram-5P7HB3ND-C8Y3cC5f.js} +1 -1
  58. package/public/index.html +2 -2
  59. package/public/assets/FileTree-D8Rmj8Bo-DJJHTVaR.js +0 -21
  60. package/public/assets/channel-_BVFc0Dy.js +0 -1
  61. package/public/assets/classDiagram-6PBFFD2Q-bjpfB5It.js +0 -1
  62. package/public/assets/classDiagram-v2-HSJHXN6E-bjpfB5It.js +0 -1
  63. package/public/assets/clone-BuO94cG9.js +0 -1
  64. package/public/assets/index-1f1360Wi.js +0 -1325
  65. package/public/assets/index-C0ZcKMwm.css +0 -1
  66. package/public/assets/stateDiagram-v2-QKLJ7IA2-D4ZL0hgv.js +0 -1
@@ -15,8 +15,6 @@ import { basename, dirname, isAbsolute, join, relative, resolve } from "node:pat
15
15
  import { fileURLToPath } from "node:url";
16
16
  import { parseArgs } from "node:util";
17
17
  import { createLocalWorkspaceRegistry } from "./localWorkspaces.js";
18
- import { scaffoldPlugin } from "./scaffoldPlugin.js";
19
- import { findHintForError, formatVerifyResult, verifyPlugin } from "./verifyPlugin.js";
20
18
  const MODE_MAP = {
21
19
  "local": "direct",
22
20
  // no sandbox, full network access
@@ -126,6 +124,23 @@ async function registerStatic(app, publicDir) {
126
124
  return reply.sendFile("index.html", publicDir);
127
125
  });
128
126
  }
127
+ const HELP_TEXT = [
128
+ "Usage: boring-ui [workspace] [options]",
129
+ "",
130
+ "Commands:",
131
+ " boring-ui [workspace] Start the workspace UI for a folder",
132
+ " boring-ui workspaces <subcommand> Manage saved local workspaces",
133
+ " boring-ui scaffold-plugin <name> [workspace]",
134
+ " Scaffold a hot-reloadable plugin",
135
+ " boring-ui verify-plugin [name] [workspace]",
136
+ " Validate plugin manifests/files",
137
+ "",
138
+ "Options:",
139
+ " -p, --port <port> HTTP port (default: 5200)",
140
+ " --host <host> Listen host (default: 0.0.0.0)",
141
+ " -m, --mode <mode> local-sandbox or local (default: local-sandbox)",
142
+ " -h, --help Show this help"
143
+ ].join("\n");
129
144
  const AUTH_GUIDE = [
130
145
  "",
131
146
  " \u26A0 No LLM provider configured.",
@@ -134,7 +149,7 @@ const AUTH_GUIDE = [
134
149
  " sign in to a subscription (Claude Pro/Max, ChatGPT Plus, Copilot):",
135
150
  "",
136
151
  " pi # if installed globally",
137
- " npx @mariozechner/pi-coding-agent # otherwise",
152
+ " npx @earendil-works/pi-coding-agent # otherwise",
138
153
  "",
139
154
  " Then at pi's prompt: /login",
140
155
  "",
@@ -441,11 +456,16 @@ async function runCli(options) {
441
456
  host: { type: "string" },
442
457
  mode: { type: "string", short: "m" },
443
458
  name: { type: "string", short: "n" },
444
- path: { type: "string" }
459
+ path: { type: "string" },
460
+ help: { type: "boolean", short: "h" }
445
461
  },
446
462
  allowPositionals: true,
447
463
  strict: false
448
464
  });
465
+ if (args.help) {
466
+ console.log(HELP_TEXT);
467
+ return;
468
+ }
449
469
  const port = Number(args.port ?? process.env.PORT) || 5200;
450
470
  const host = args.host ?? process.env.HOST ?? "0.0.0.0";
451
471
  const rawMode = args.mode ?? process.env.BORING_MODE ?? "local-sandbox";
@@ -477,11 +497,11 @@ async function runCli(options) {
477
497
  return;
478
498
  }
479
499
  if (positionals[0] === "scaffold-plugin") {
480
- handleScaffoldPluginCommand({ positionals });
500
+ await handleScaffoldPluginCommand({ positionals });
481
501
  return;
482
502
  }
483
503
  if (positionals[0] === "verify-plugin") {
484
- handleVerifyPluginCommand({ positionals });
504
+ await handleVerifyPluginCommand({ positionals });
485
505
  return;
486
506
  }
487
507
  await startFolderMode({
@@ -492,12 +512,13 @@ async function runCli(options) {
492
512
  function defaultWorkspaceRoot() {
493
513
  return process.env.BORING_AGENT_WORKSPACE_ROOT ?? process.cwd();
494
514
  }
495
- function handleVerifyPluginCommand(opts) {
515
+ async function handleVerifyPluginCommand(opts) {
496
516
  const maybeName = opts.positionals[1];
497
517
  const maybeWorkspace = opts.positionals[2];
498
518
  const looksLikePath = maybeName && (maybeName.includes("/") || maybeName.startsWith("."));
499
519
  const name = looksLikePath ? void 0 : maybeName;
500
520
  const workspaceRoot = resolve(maybeWorkspace ?? (looksLikePath ? maybeName : defaultWorkspaceRoot()));
521
+ const { findHintForError, formatVerifyResult, verifyPlugin } = await import("./verifyPlugin.js");
501
522
  const result = verifyPlugin({ workspaceRoot, ...name ? { name } : {} });
502
523
  console.log(formatVerifyResult(result));
503
524
  if (!result.ok) {
@@ -516,12 +537,13 @@ function handleVerifyPluginCommand(opts) {
516
537
  process.exit(1);
517
538
  }
518
539
  }
519
- function handleScaffoldPluginCommand(opts) {
540
+ async function handleScaffoldPluginCommand(opts) {
520
541
  const name = opts.positionals[1];
521
542
  if (!name) {
522
543
  throw new Error("usage: boring-ui scaffold-plugin <name> [workspace]");
523
544
  }
524
545
  const workspaceRoot = resolve(opts.positionals[2] ?? defaultWorkspaceRoot());
546
+ const { scaffoldPlugin } = await import("./scaffoldPlugin.js");
525
547
  const result = scaffoldPlugin({ name, workspaceRoot });
526
548
  console.log(`scaffolded ${name}`);
527
549
  console.log(` dir ${result.pluginDir}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hachej/boring-ui-cli",
3
- "version": "0.1.23",
3
+ "version": "0.1.24",
4
4
  "description": "Turn an agent into an app",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,12 +13,12 @@
13
13
  "templates/"
14
14
  ],
15
15
  "dependencies": {
16
- "@fastify/static": "^8.0.0",
16
+ "@fastify/static": "^9.1.1",
17
17
  "fastify": "^5.4.0",
18
18
  "lucide-react": "^1.8.0",
19
- "@hachej/boring-agent": "0.1.23",
20
- "@hachej/boring-ui-kit": "0.1.23",
21
- "@hachej/boring-workspace": "0.1.23"
19
+ "@hachej/boring-workspace": "0.1.24",
20
+ "@hachej/boring-agent": "0.1.24",
21
+ "@hachej/boring-ui-kit": "0.1.24"
22
22
  },
23
23
  "devDependencies": {
24
24
  "@tailwindcss/vite": "^4.0.0",
@@ -41,7 +41,7 @@
41
41
  "build": "tsup",
42
42
  "build:front": "vite build",
43
43
  "build:full": "node scripts/build-full.mjs",
44
- "typecheck": "pnpm --filter @hachej/boring-agent build && pnpm --filter @hachej/boring-workspace build && tsc --noEmit",
45
- "test": "pnpm --filter @hachej/boring-ui-kit build && vitest run"
44
+ "typecheck": "tsc --noEmit",
45
+ "test": "vitest run"
46
46
  }
47
47
  }
@@ -1,4 +1,4 @@
1
- import{r as he,j as hi,bk as fp,bl as ua}from"./index-1f1360Wi.js";import{k as up,b as dp,s as pp}from"./index-Vcq4gwWv.js";let no=[],Fh=[];(()=>{let i="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<i.length;e++)(e%2?Fh:no).push(t=t+i[e])})();function mp(i){if(i<768)return!1;for(let e=0,t=no.length;;){let r=e+t>>1;if(i<no[r])t=r;else if(i>=Fh[r])e=r+1;else return!0;if(e==t)return!1}}function da(i){return i>=127462&&i<=127487}const pa=8205;function gp(i,e,t=!0,r=!0){return(t?Hh:Qp)(i,e,r)}function Hh(i,e,t){if(e==i.length)return e;e&&Kh(i.charCodeAt(e))&&Jh(i.charCodeAt(e-1))&&e--;let r=fs(i,e);for(e+=ma(r);e<i.length;){let n=fs(i,e);if(r==pa||n==pa||t&&mp(n))e+=ma(n),r=n;else if(da(n)){let s=0,o=e-2;for(;o>=0&&da(fs(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function Qp(i,e,t){for(;e>0;){let r=Hh(i,e-2,t);if(r<e)return r;e--}return 0}function fs(i,e){let t=i.charCodeAt(e);if(!Jh(t)||e+1==i.length)return t;let r=i.charCodeAt(e+1);return Kh(r)?(t-55296<<10)+(r-56320)+65536:t}function Kh(i){return i>=56320&&i<57344}function Jh(i){return i>=55296&&i<56320}function ma(i){return i<65536?1:2}class E{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,r){[e,t]=wi(this,e,t);let n=[];return this.decompose(0,e,n,2),r.length&&r.decompose(0,r.length,n,3),this.decompose(t,this.length,n,1),He.from(n,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=wi(this,e,t);let r=[];return this.decompose(e,t,r,0),He.from(r,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),r=this.length-this.scanIdentical(e,-1),n=new Hi(this),s=new Hi(e);for(let o=t,l=t;;){if(n.next(o),s.next(o),o=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(l+=n.value.length,n.done||l>=r)return!0}}iter(e=1){return new Hi(this,e)}iterRange(e,t=this.length){return new ec(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let n=this.line(e).from;r=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new tc(r)}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]?E.empty:e.length<=32?new ie(e):He.from(ie.split(e,[]))}}class ie extends E{constructor(e,t=Sp(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,n){for(let s=0;;s++){let o=this.text[s],l=n+o.length;if((t?r:l)>=e)return new kp(n,l,r,o);n=l+1,r++}}decompose(e,t,r,n){let s=e<=0&&t>=this.length?this:new ie(ga(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(n&1){let o=r.pop(),l=sn(s.text,o.text.slice(),0,s.length);if(l.length<=32)r.push(new ie(l,o.length+s.length));else{let a=l.length>>1;r.push(new ie(l.slice(0,a)),new ie(l.slice(a)))}}else r.push(s)}replace(e,t,r){if(!(r instanceof ie))return super.replace(e,t,r);[e,t]=wi(this,e,t);let n=sn(this.text,sn(r.text,ga(this.text,0,e)),t),s=this.length+r.length-(t-e);return n.length<=32?new ie(n,s):He.from(ie.split(n,[]),s)}sliceString(e,t=this.length,r=`
1
+ import{r as he,j as hi,bk as fp,bl as ua}from"./index-C9S_GD0T.js";import{k as up,b as dp,s as pp}from"./index-Vcq4gwWv.js";let no=[],Fh=[];(()=>{let i="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<i.length;e++)(e%2?Fh:no).push(t=t+i[e])})();function mp(i){if(i<768)return!1;for(let e=0,t=no.length;;){let r=e+t>>1;if(i<no[r])t=r;else if(i>=Fh[r])e=r+1;else return!0;if(e==t)return!1}}function da(i){return i>=127462&&i<=127487}const pa=8205;function gp(i,e,t=!0,r=!0){return(t?Hh:Qp)(i,e,r)}function Hh(i,e,t){if(e==i.length)return e;e&&Kh(i.charCodeAt(e))&&Jh(i.charCodeAt(e-1))&&e--;let r=fs(i,e);for(e+=ma(r);e<i.length;){let n=fs(i,e);if(r==pa||n==pa||t&&mp(n))e+=ma(n),r=n;else if(da(n)){let s=0,o=e-2;for(;o>=0&&da(fs(i,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function Qp(i,e,t){for(;e>0;){let r=Hh(i,e-2,t);if(r<e)return r;e--}return 0}function fs(i,e){let t=i.charCodeAt(e);if(!Jh(t)||e+1==i.length)return t;let r=i.charCodeAt(e+1);return Kh(r)?(t-55296<<10)+(r-56320)+65536:t}function Kh(i){return i>=56320&&i<57344}function Jh(i){return i>=55296&&i<56320}function ma(i){return i<65536?1:2}class E{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,r){[e,t]=wi(this,e,t);let n=[];return this.decompose(0,e,n,2),r.length&&r.decompose(0,r.length,n,3),this.decompose(t,this.length,n,1),He.from(n,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=wi(this,e,t);let r=[];return this.decompose(e,t,r,0),He.from(r,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),r=this.length-this.scanIdentical(e,-1),n=new Hi(this),s=new Hi(e);for(let o=t,l=t;;){if(n.next(o),s.next(o),o=0,n.lineBreak!=s.lineBreak||n.done!=s.done||n.value!=s.value)return!1;if(l+=n.value.length,n.done||l>=r)return!0}}iter(e=1){return new Hi(this,e)}iterRange(e,t=this.length){return new ec(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let n=this.line(e).from;r=this.iterRange(n,Math.max(n,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new tc(r)}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]?E.empty:e.length<=32?new ie(e):He.from(ie.split(e,[]))}}class ie extends E{constructor(e,t=Sp(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,n){for(let s=0;;s++){let o=this.text[s],l=n+o.length;if((t?r:l)>=e)return new kp(n,l,r,o);n=l+1,r++}}decompose(e,t,r,n){let s=e<=0&&t>=this.length?this:new ie(ga(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(n&1){let o=r.pop(),l=sn(s.text,o.text.slice(),0,s.length);if(l.length<=32)r.push(new ie(l,o.length+s.length));else{let a=l.length>>1;r.push(new ie(l.slice(0,a)),new ie(l.slice(a)))}}else r.push(s)}replace(e,t,r){if(!(r instanceof ie))return super.replace(e,t,r);[e,t]=wi(this,e,t);let n=sn(this.text,sn(r.text,ga(this.text,0,e)),t),s=this.length+r.length-(t-e);return n.length<=32?new ie(n,s):He.from(ie.split(n,[]),s)}sliceString(e,t=this.length,r=`
2
2
  `){[e,t]=wi(this,e,t);let n="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let l=this.text[o],a=s+l.length;s>e&&o&&(n+=r),e<a&&t>s&&(n+=l.slice(Math.max(0,e-s),t-s)),s=a+1}return n}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],n=-1;for(let s of e)r.push(s),n+=s.length+1,r.length==32&&(t.push(new ie(r,n)),r=[],n=-1);return n>-1&&t.push(new ie(r,n)),t}}class He extends E{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,n){for(let s=0;;s++){let o=this.children[s],l=n+o.length,a=r+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,r,n);n=l+1,r=a+1}}decompose(e,t,r,n){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let l=this.children[s],a=o+l.length;if(e<=a&&t>=o){let O=n&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!O?r.push(l):l.decompose(e-o,t-o,r,O)}o=a+1}}replace(e,t,r){if([e,t]=wi(this,e,t),r.lines<this.lines)for(let n=0,s=0;n<this.children.length;n++){let o=this.children[n],l=s+o.length;if(e>=s&&t<=l){let a=o.replace(e-s,t-s,r),O=this.lines-o.lines+a.lines;if(a.lines<O>>4&&a.lines>O>>6){let h=this.children.slice();return h[n]=a,new He(h,this.length-(t-e)+r.length)}return super.replace(s,l,a)}s=l+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=`
3
3
  `){[e,t]=wi(this,e,t);let n="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let l=this.children[s],a=o+l.length;o>e&&s&&(n+=r),e<a&&t>o&&(n+=l.sliceString(e-o,t-o,r)),o=a+1}return n}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof He))return 0;let r=0,[n,s,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;n+=t,s+=t){if(n==o||s==l)return r;let a=this.children[n],O=e.children[s];if(a!=O)return r+a.scanIdentical(O,t);r+=a.length+1}}static from(e,t=e.reduce((r,n)=>r+n.length+1,-1)){let r=0;for(let u of e)r+=u.lines;if(r<32){let u=[];for(let p of e)p.flatten(u);return new ie(u,t)}let n=Math.max(32,r>>5),s=n<<1,o=n>>1,l=[],a=0,O=-1,h=[];function c(u){let p;if(u.lines>s&&u instanceof He)for(let m of u.children)c(m);else u.lines>o&&(a>o||!a)?(f(),l.push(u)):u instanceof ie&&a&&(p=h[h.length-1])instanceof ie&&u.lines+p.lines<=32?(a+=u.lines,O+=u.length+1,h[h.length-1]=new ie(p.text.concat(u.text),p.length+1+u.length)):(a+u.lines>n&&f(),a+=u.lines,O+=u.length+1,h.push(u))}function f(){a!=0&&(l.push(h.length==1?h[0]:He.from(h,O)),O=-1,a=h.length=0)}for(let u of e)c(u);return f(),l.length==1?l[0]:new He(l,t)}}E.empty=new ie([""],0);function Sp(i){let e=-1;for(let t of i)e+=t.length+1;return e}function sn(i,e,t=0,r=1e9){for(let n=0,s=0,o=!0;s<i.length&&n<=r;s++){let l=i[s],a=n+l.length;a>=t&&(a>r&&(l=l.slice(0,r-n)),n<t&&(l=l.slice(t-n)),o?(e[e.length-1]+=l,o=!1):e.push(l)),n=a+1}return e}function ga(i,e,t){return sn(i,[""],e,t)}class Hi{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 ie?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,n=this.nodes[r],s=this.offsets[r],o=s>>1,l=n instanceof ie?n.text.length:n.children.length;if(o==(t>0?l:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=`
4
4
  `,this;e--}else if(n instanceof ie){let a=n.text[o+(t<0?-1:0)];if(this.offsets[r]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=n.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof ie?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class ec{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new Hi(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}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 r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:n}=this.cursor.next(e);return this.pos+=(n.length+e)*t,this.value=n.length<=r?n:t<0?n.slice(n.length-r):n.slice(0,r),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 tc{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:n}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(E.prototype[Symbol.iterator]=function(){return this.iter()},Hi.prototype[Symbol.iterator]=ec.prototype[Symbol.iterator]=tc.prototype[Symbol.iterator]=function(){return this});let kp=class{constructor(e,t,r,n){this.from=e,this.to=t,this.number=r,this.text=n}get length(){return this.to-this.from}};function wi(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function ae(i,e,t=!0,r=!0){return gp(i,e,t,r)}function bp(i){return i>=56320&&i<57344}function yp(i){return i>=55296&&i<56320}function ic(i,e){let t=i.charCodeAt(e);if(!yp(t)||e+1==i.length)return t;let r=i.charCodeAt(e+1);return bp(r)?(t-55296<<10)+(r-56320)+65536:t}function xp(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function rc(i){return i<65536?1:2}const so=/\r\n?|\n/;var Qe=(function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i})(Qe||(Qe={}));class nt{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 r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,n=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(r,n,s),n+=s):n+=o,r+=s}}iterChangedRanges(e,t=!1){oo(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],n=this.sections[t++];n<0?e.push(r,n):e.push(n,r)}return new nt(e)}composeDesc(e){return this.empty?e:e.empty?this:nc(this,e)}mapDesc(e,t=!1){return e.empty?this:lo(this,e,t)}mapPos(e,t=-1,r=Qe.Simple){let n=0,s=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],O=n+l;if(a<0){if(O>e)return s+(e-n);s+=l}else{if(r!=Qe.Simple&&O>=e&&(r==Qe.TrackDel&&n<e&&O>e||r==Qe.TrackBefore&&n<e||r==Qe.TrackAfter&&O>e))return null;if(O>e||O==e&&t<0&&!l)return e==n||t<0?s:s+a;s+=a}n=O}if(e>n)throw new RangeError(`Position ${e} is out of range for changeset of length ${n}`);return s}touchesRange(e,t=e){for(let r=0,n=0;r<this.sections.length&&n<=t;){let s=this.sections[r++],o=this.sections[r++],l=n+s;if(o>=0&&n<=t&&l>=e)return n<e&&l>t?"cover":!0;n=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],n=this.sections[t++];e+=(e?" ":"")+r+(n>=0?":"+n:"")}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 nt(e)}static create(e){return new nt(e)}}class se extends nt{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 oo(this,(t,r,n,s,o)=>e=e.replace(n,n+(r-t),o),!1),e}mapDesc(e,t=!1){return lo(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let n=0,s=0;n<t.length;n+=2){let o=t[n],l=t[n+1];if(l>=0){t[n]=l,t[n+1]=o;let a=n>>1;for(;r.length<a;)r.push(E.empty);r.push(o?e.slice(s,s+o):E.empty)}s+=o}return new se(t,r)}compose(e){return this.empty?e:e.empty?this:nc(this,e,!0)}map(e,t=!1){return e.empty?this:lo(this,e,t,!0)}iterChanges(e,t=!1){oo(this,e,t)}get desc(){return nt.create(this.sections)}filter(e){let t=[],r=[],n=[],s=new or(this);e:for(let o=0,l=0;;){let a=o==e.length?1e9:e[o++];for(;l<a||l==a&&s.len==0;){if(s.done)break e;let h=Math.min(s.len,a-l);ue(n,h,-1);let c=s.ins==-1?-1:s.off==0?s.ins:0;ue(t,h,c),c>0&&Rt(r,t,s.text),s.forward(h),l+=h}let O=e[o++];for(;l<O;){if(s.done)break e;let h=Math.min(s.len,O-l);ue(t,h,-1),ue(n,h,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(h),l+=h}}return{changes:new se(t,r),filtered:nt.create(n)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t],n=this.sections[t+1];n<0?e.push(r):n==0?e.push([r]):e.push([r].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,r){let n=[],s=[],o=0,l=null;function a(h=!1){if(!h&&!n.length)return;o<t&&ue(n,t-o,-1);let c=new se(n,s);l=l?l.compose(c.map(l)):c,n=[],s=[],o=0}function O(h){if(Array.isArray(h))for(let c of h)O(c);else if(h instanceof se){if(h.length!=t)throw new RangeError(`Mismatched change set length (got ${h.length}, expected ${t})`);a(),l=l?l.compose(h.map(l)):h}else{let{from:c,to:f=c,insert:u}=h;if(c>f||c<0||f>t)throw new RangeError(`Invalid change range ${c} to ${f} (in doc of length ${t})`);let p=u?typeof u=="string"?E.of(u.split(r||so)):u:E.empty,m=p.length;if(c==f&&m==0)return;c<o&&a(),c>o&&ue(n,c-o,-1),ue(n,f-c,m),Rt(s,n,p),o=f}}return O(e),a(!l),l}static empty(e){return new se(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let n=0;n<e.length;n++){let s=e[n];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;r.length<n;)r.push(E.empty);r[n]=E.of(s.slice(1)),t.push(s[0],r[n].length)}}}return new se(t,r)}static createSet(e,t){return new se(e,t)}}function ue(i,e,t,r=!1){if(e==0&&t<=0)return;let n=i.length-2;n>=0&&t<=0&&t==i[n+1]?i[n]+=e:n>=0&&e==0&&i[n]==0?i[n+1]+=t:r?(i[n]+=e,i[n+1]+=t):i.push(e,t)}function Rt(i,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r<i.length)i[i.length-1]=i[i.length-1].append(t);else{for(;i.length<r;)i.push(E.empty);i.push(t)}}function oo(i,e,t){let r=i.inserted;for(let n=0,s=0,o=0;o<i.sections.length;){let l=i.sections[o++],a=i.sections[o++];if(a<0)n+=l,s+=l;else{let O=n,h=s,c=E.empty;for(;O+=l,h+=a,a&&r&&(c=c.append(r[o-2>>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)l=i.sections[o++],a=i.sections[o++];e(n,O,s,h,c),n=O,s=h}}}function lo(i,e,t,r=!1){let n=[],s=r?[]:null,o=new or(i),l=new or(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let O=Math.min(o.len,l.len);ue(n,O,-1),o.forward(O),l.forward(O)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!t))){let O=l.len;for(ue(n,l.ins,-1);O;){let h=Math.min(o.len,O);o.ins>=0&&a<o.i&&o.len<=h&&(ue(n,0,o.ins),s&&Rt(s,n,o.text),a=o.i),o.forward(h),O-=h}l.next()}else if(o.ins>=0){let O=0,h=o.len;for(;h;)if(l.ins==-1){let c=Math.min(h,l.len);O+=c,h-=c,l.forward(c)}else if(l.ins==0&&l.len<h)h-=l.len,l.next();else break;ue(n,O,a<o.i?o.ins:0),s&&a<o.i&&Rt(s,n,o.text),a=o.i,o.forward(o.len-h)}else{if(o.done&&l.done)return s?se.createSet(n,s):nt.create(n);throw new Error("Mismatched change set lengths")}}}function nc(i,e,t=!1){let r=[],n=t?[]:null,s=new or(i),o=new or(e);for(let l=!1;;){if(s.done&&o.done)return n?se.createSet(r,n):nt.create(r);if(s.ins==0)ue(r,s.len,0,l),s.next();else if(o.len==0&&!o.done)ue(r,0,o.ins,l),n&&Rt(n,r,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(s.len2,o.len),O=r.length;if(s.ins==-1){let h=o.ins==-1?-1:o.off?0:o.ins;ue(r,a,h,l),n&&h&&Rt(n,r,o.text)}else o.ins==-1?(ue(r,s.off?0:s.len,a,l),n&&Rt(n,r,s.textBit(a))):(ue(r,s.off?0:s.len,o.off?0:o.ins,l),n&&!o.off&&Rt(n,r,o.text));l=(s.ins>a||o.ins>=0&&o.len>a)&&(l||r.length>O),s.forward2(a),o.forward(a)}}}}class or{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?E.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?E.empty:t[r].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 It{constructor(e,t,r){this.from=e,this.to=t,this.flags=r}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 r,n;return this.empty?r=n=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),n=e.mapPos(this.to,-1)),r==this.from&&n==this.to?this:new It(r,n,this.flags)}extend(e,t=e,r=0){if(e<=this.anchor&&t>=this.anchor)return S.range(e,t,void 0,void 0,r);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return S.range(this.anchor,n,void 0,void 0,r)}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 S.range(e.anchor,e.head)}static create(e,t,r){return new It(e,t,r)}}class S{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:S.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new S([this.main],0)}addRange(e,t=!0){return S.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let r=this.ranges.slice();return r[t]=e,S.create(r,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 S(e.ranges.map(t=>It.fromJSON(t)),e.main)}static single(e,t=e){return new S([S.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 r=0,n=0;n<e.length;n++){let s=e[n];if(s.empty?s.from<=r:s.from<r)return S.normalized(e.slice(),t);r=s.to}return new S(e,t)}static cursor(e,t=0,r,n){return It.create(e,e,(t==0?0:t<0?8:16)|(r==null?7:Math.min(6,r))|(n??16777215)<<6)}static range(e,t,r,n,s){let o=(r??16777215)<<6|(n==null?7:Math.min(6,n));return!s&&e!=t&&(s=t<e?1:-1),t<e?It.create(t,e,48|o):It.create(e,t,(s?s<0?8:16:0)|o)}static normalized(e,t=0){let r=e[t];e.sort((n,s)=>n.from-s.from),t=e.indexOf(r);for(let n=1;n<e.length;n++){let s=e[n],o=e[n-1];if(s.empty?s.from<=o.to:s.from<o.to){let l=o.from,a=Math.max(s.to,o.to);n<=t&&t--,e.splice(--n,2,s.anchor>s.head?S.range(a,l):S.range(l,a))}}return new S(e,t)}}function sc(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let dl=0;class Z{constructor(e,t,r,n,s){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=n,this.id=dl++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new Z(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:pl),!!e.static,e.enables)}of(e){return new on([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new on(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new on(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function pl(i,e){return i==e||i.length==e.length&&i.every((t,r)=>t===e[r])}class on{constructor(e,t,r,n){this.dependencies=e,this.facet=t,this.type=r,this.value=n,this.id=dl++}dynamicSlot(e){var t;let r=this.value,n=this.facet.compareInput,s=this.id,o=e[s]>>1,l=this.type==2,a=!1,O=!1,h=[];for(let c of this.dependencies)c=="doc"?a=!0:c=="selection"?O=!0:(((t=e[c.id])!==null&&t!==void 0?t:1)&1)==0&&h.push(e[c.id]);return{create(c){return c.values[o]=r(c),1},update(c,f){if(a&&f.docChanged||O&&(f.docChanged||f.selection)||ao(c,h)){let u=r(c);if(l?!Qa(u,c.values[o],n):!n(u,c.values[o]))return c.values[o]=u,1}return 0},reconfigure:(c,f)=>{let u,p=f.config.address[s];if(p!=null){let m=gn(f,p);if(this.dependencies.every(g=>g instanceof Z?f.facet(g)===c.facet(g):g instanceof We?f.field(g,!1)==c.field(g,!1):!0)||(l?Qa(u=r(c),m,n):n(u=r(c),m)))return c.values[o]=m,0}else u=r(c);return c.values[o]=u,1}}}}function Qa(i,e,t){if(i.length!=e.length)return!1;for(let r=0;r<i.length;r++)if(!t(i[r],e[r]))return!1;return!0}function ao(i,e){let t=!1;for(let r of e)Ki(i,r)&1&&(t=!0);return t}function Pp(i,e,t){let r=t.map(a=>i[a.id]),n=t.map(a=>a.type),s=r.filter(a=>!(a&1)),o=i[e.id]>>1;function l(a){let O=[];for(let h=0;h<r.length;h++){let c=gn(a,r[h]);if(n[h]==2)for(let f of c)O.push(f);else O.push(c)}return e.combine(O)}return{create(a){for(let O of r)Ki(a,O);return a.values[o]=l(a),1},update(a,O){if(!ao(a,s))return 0;let h=l(a);return e.compare(h,a.values[o])?0:(a.values[o]=h,1)},reconfigure(a,O){let h=ao(a,r),c=O.config.facets[e.id],f=O.facet(e);if(c&&!h&&pl(t,c))return a.values[o]=f,0;let u=l(a);return e.compare(u,f)?(a.values[o]=f,0):(a.values[o]=u,1)}}}const Wr=Z.define({static:!0});class We{constructor(e,t,r,n,s){this.id=e,this.createF=t,this.updateF=r,this.compareF=n,this.spec=s,this.provides=void 0}static define(e){let t=new We(dl++,e.create,e.update,e.compare||((r,n)=>r===n),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Wr).find(r=>r.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,n)=>{let s=r.values[t],o=this.updateF(s,n);return this.compareF(s,o)?0:(r.values[t]=o,1)},reconfigure:(r,n)=>{let s=r.facet(Wr),o=n.facet(Wr),l;return(l=s.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(r.values[t]=l.create(r),1):n.config.address[this.id]!=null?(r.values[t]=n.field(this),0):(r.values[t]=this.create(r),1)}}}init(e){return[this,Wr.of({field:this,create:e})]}get extension(){return this}}const Bt={lowest:4,low:3,default:2,high:1,highest:0};function Ei(i){return e=>new oc(e,i)}const oi={highest:Ei(Bt.highest),high:Ei(Bt.high),default:Ei(Bt.default),low:Ei(Bt.low),lowest:Ei(Bt.lowest)};class oc{constructor(e,t){this.inner=e,this.prec=t}}class gt{of(e){return new Oo(this,e)}reconfigure(e){return gt.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class Oo{constructor(e,t){this.compartment=e,this.inner=t}}class mn{constructor(e,t,r,n,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=n,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<r.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,r){let n=[],s=Object.create(null),o=new Map;for(let f of $p(e,t,o))f instanceof We?n.push(f):(s[f.facet.id]||(s[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],O=[];for(let f of n)l[f.id]=O.length<<1,O.push(u=>f.slot(u));let h=r==null?void 0:r.config.facets;for(let f in s){let u=s[f],p=u[0].facet,m=h&&h[f]||[];if(u.every(g=>g.type==0))if(l[p.id]=a.length<<1|1,pl(m,u))a.push(r.facet(p));else{let g=p.combine(u.map(Q=>Q.value));a.push(r&&p.compare(g,r.facet(p))?r.facet(p):g)}else{for(let g of u)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=O.length<<1,O.push(Q=>g.dynamicSlot(Q)));l[p.id]=O.length<<1,O.push(g=>Pp(g,p,u))}}let c=O.map(f=>f(l));return new mn(e,o,c,l,a,s)}}function $p(i,e,t){let r=[[],[],[],[],[]],n=new Map;function s(o,l){let a=n.get(o);if(a!=null){if(a<=l)return;let O=r[a].indexOf(o);O>-1&&r[a].splice(O,1),o instanceof Oo&&t.delete(o.compartment)}if(n.set(o,l),Array.isArray(o))for(let O of o)s(O,l);else if(o instanceof Oo){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let O=e.get(o.compartment)||o.inner;t.set(o.compartment,O),s(O,l)}else if(o instanceof oc)s(o.inner,o.prec);else if(o instanceof We)r[l].push(o),o.provides&&s(o.provides,l);else if(o instanceof on)r[l].push(o),o.facet.extensions&&s(o.facet.extensions,Bt.default);else{let O=o.extension;if(!O)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(O,l)}}return s(i,Bt.default),r.reduce((o,l)=>o.concat(l))}function Ki(i,e){if(e&1)return 2;let t=e>>1,r=i.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;i.status[t]=4;let n=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|n}function gn(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}const lc=Z.define(),ho=Z.define({combine:i=>i.some(e=>e),static:!0}),ac=Z.define({combine:i=>i.length?i[0]:void 0,static:!0}),Oc=Z.define(),hc=Z.define(),cc=Z.define(),fc=Z.define({combine:i=>i.length?i[0]:!1});class $t{constructor(e,t){this.type=e,this.value=t}static define(){return new wp}}class wp{of(e){return new $t(this,e)}}class vp{constructor(e){this.map=e}of(e){return new Y(this,e)}}class Y{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 Y(this.type,t)}is(e){return this.type==e}static define(e={}){return new vp(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let n of e){let s=n.map(t);s&&r.push(s)}return r}}Y.reconfigure=Y.define();Y.appendConfig=Y.define();class ne{constructor(e,t,r,n,s,o){this.startState=e,this.changes=t,this.selection=r,this.effects=n,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,r&&sc(r,t.newLength),s.some(l=>l.type==ne.time)||(this.annotations=s.concat(ne.time.of(Date.now())))}static create(e,t,r,n,s,o){return new ne(e,t,r,n,s,o)}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(ne.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}ne.time=$t.define();ne.userEvent=$t.define();ne.addToHistory=$t.define();ne.remote=$t.define();function Tp(i,e){let t=[];for(let r=0,n=0;;){let s,o;if(r<i.length&&(n==e.length||e[n]>=i[r]))s=i[r++],o=i[r++];else if(n<e.length)s=e[n++],o=e[n++];else return t;!t.length||t[t.length-1]<s?t.push(s,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function uc(i,e,t){var r;let n,s,o;return t?(n=e.changes,s=se.empty(e.changes.length),o=i.changes.compose(e.changes)):(n=e.changes.map(i.changes),s=i.changes.mapDesc(e.changes,!0),o=i.changes.compose(n)),{changes:o,selection:e.selection?e.selection.map(s):(r=i.selection)===null||r===void 0?void 0:r.map(n),effects:Y.mapEffects(i.effects,n).concat(Y.mapEffects(e.effects,s)),annotations:i.annotations.length?i.annotations.concat(e.annotations):e.annotations,scrollIntoView:i.scrollIntoView||e.scrollIntoView}}function co(i,e,t){let r=e.selection,n=Qi(e.annotations);return e.userEvent&&(n=n.concat(ne.userEvent.of(e.userEvent))),{changes:e.changes instanceof se?e.changes:se.of(e.changes||[],t,i.facet(ac)),selection:r&&(r instanceof S?r:S.single(r.anchor,r.head)),effects:Qi(e.effects),annotations:n,scrollIntoView:!!e.scrollIntoView}}function dc(i,e,t){let r=co(i,e.length?e[0]:{},i.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 o=!!e[s].sequential;r=uc(r,co(i,e[s],o?r.changes.newLength:i.doc.length),o)}let n=ne.create(i,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return Zp(t?Xp(n):n)}function Xp(i){let e=i.startState,t=!0;for(let n of e.facet(Oc)){let s=n(i);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:Tp(t,s))}if(t!==!0){let n,s;if(t===!1)s=i.changes.invertedDesc,n=se.empty(e.doc.length);else{let o=i.changes.filter(t);n=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}i=ne.create(e,n,i.selection&&i.selection.map(s),Y.mapEffects(i.effects,s),i.annotations,i.scrollIntoView)}let r=e.facet(hc);for(let n=r.length-1;n>=0;n--){let s=r[n](i);s instanceof ne?i=s:Array.isArray(s)&&s.length==1&&s[0]instanceof ne?i=s[0]:i=dc(e,Qi(s),!1)}return i}function Zp(i){let e=i.startState,t=e.facet(cc),r=i;for(let n=t.length-1;n>=0;n--){let s=t[n](i);s&&Object.keys(s).length&&(r=uc(r,co(e,s,i.changes.newLength),!0))}return r==i?i:ne.create(e,i.changes,i.selection,r.effects,r.annotations,r.scrollIntoView)}const Rp=[];function Qi(i){return i==null?Rp:Array.isArray(i)?i:[i]}var re=(function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i})(re||(re={}));const Cp=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let fo;try{fo=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function qp(i){if(fo)return fo.test(i);for(let e=0;e<i.length;e++){let t=i[e];if(/\w/.test(t)||t>"€"&&(t.toUpperCase()!=t.toLowerCase()||Cp.test(t)))return!0}return!1}function Ap(i){return e=>{if(!/\S/.test(e))return re.Space;if(qp(e))return re.Word;for(let t=0;t<i.length;t++)if(e.indexOf(i[t])>-1)return re.Word;return re.Other}}class _{constructor(e,t,r,n,s,o){this.config=e,this.doc=t,this.selection=r,this.values=n,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)Ki(this,l<<1);this.computeSlot=null}field(e,t=!0){let r=this.config.address[e.id];if(r==null){if(t)throw new RangeError("Field is not present in this state");return}return Ki(this,r),gn(this,r)}update(...e){return dc(this,e,!0)}applyTransaction(e){let t=this.config,{base:r,compartments:n}=t;for(let l of e.effects)l.is(gt.reconfigure)?(t&&(n=new Map,t.compartments.forEach((a,O)=>n.set(O,a)),t=null),n.set(l.value.compartment,l.value.extension)):l.is(Y.reconfigure)?(t=null,r=l.value):l.is(Y.appendConfig)&&(t=null,r=Qi(r).concat(l.value));let s;t?s=e.startState.values.slice():(t=mn.resolve(r,n,this),s=new _(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,O)=>O.reconfigure(a,this),null).values);let o=e.startState.facet(ho)?e.newSelection:e.newSelection.asSingle();new _(t,e.newDoc,o,s,(l,a)=>a.update(l,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:S.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),n=this.changes(r.changes),s=[r.range],o=Qi(r.effects);for(let l=1;l<t.ranges.length;l++){let a=e(t.ranges[l]),O=this.changes(a.changes),h=O.map(n);for(let f=0;f<l;f++)s[f]=s[f].map(h);let c=n.mapDesc(O,!0);s.push(a.range.map(c)),n=n.compose(h),o=Y.mapEffects(o,h).concat(Y.mapEffects(Qi(a.effects),c))}return{changes:n,selection:S.create(s,t.mainIndex),effects:o}}changes(e=[]){return e instanceof se?e:se.of(e,this.doc.length,this.facet(_.lineSeparator))}toText(e){return E.of(e.split(this.facet(_.lineSeparator)||so))}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:(Ki(this,t),gn(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let n=e[r];n instanceof We&&this.config.address[n.id]!=null&&(t[r]=n.spec.toJSON(this.field(e[r]),this))}return t}static fromJSON(e,t={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let n=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let o=r[s],l=e[s];n.push(o.init(a=>o.spec.fromJSON(l,a)))}}return _.create({doc:e.doc,selection:S.fromJSON(e.selection),extensions:t.extensions?n.concat([t.extensions]):n})}static create(e={}){let t=mn.resolve(e.extensions||[],new Map),r=e.doc instanceof E?e.doc:E.of((e.doc||"").split(t.staticFacet(_.lineSeparator)||so)),n=e.selection?e.selection instanceof S?e.selection:S.single(e.selection.anchor,e.selection.head):S.single(0);return sc(n,r.length),t.staticFacet(ho)||(n=n.asSingle()),new _(t,r,n,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(_.tabSize)}get lineBreak(){return this.facet(_.lineSeparator)||`
@@ -0,0 +1,21 @@
1
+ import{bM as ir,r as h,bN as or,j as y,aP as un,bl as J,b_ as ln,b$ as cn,bX as dn,bW as fn}from"./index-C9S_GD0T.js";import{s as hn}from"./index-CrFvzn5a.js";/**
2
+ * @license lucide-react v1.8.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const gn=[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]],pn=ir("folder-open",gn);/**
7
+ * @license lucide-react v1.8.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const vn=[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]],yn=ir("folder",vn),ar=h.createContext(null);function A(){const t=h.useContext(ar);if(t===null)throw new Error("No Tree Api Provided");return t}const sr=h.createContext(null);function mn(){const t=h.useContext(sr);if(t===null)throw new Error("Provide a NodesContext");return t}const ur=h.createContext(null);function bn(){const t=h.useContext(ur);if(t===null)throw new Error("Provide a DnDContext");return t}const lr=h.createContext(0);function cr(){h.useContext(lr)}function de(t,e,r){return Math.max(Math.min(t,r),e)}function dr(t){return t&&t.isLeaf}function fr(t){return t&&t.isInternal&&!t.isOpen}function hr(t){var e;return t&&t.isOpen&&!(!((e=t.children)===null||e===void 0)&&e.length)}const gr=(t,e)=>{let r=t;for(;r;){if(r.id===e.id)return!0;r=r.parent}return!1},pr=t=>{if(!t.parent)throw Error("Node does not have a parent");return t.parent.children.findIndex(e=>e.id===t.id)};function Je(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let r of t.children){const n=Je(r,e);if(n)return n}return null}function ye(t,e){if(e(t),t.children)for(let r of t.children)ye(r,e)}function vr(t){const e=mr(t);let r;for(let n=0;n<e.length;++n)if(e[n]===t){r=On(e,n);break}r==null||r.focus()}function yr(t){const e=mr(t);let r;for(let n=0;n<e.length;++n)if(e[n]===t){r=Sn(e,n);break}r==null||r.focus()}function On(t,e){return e+1<t.length?t[e+1]:t[0]}function Sn(t,e){return e-1>=0?t[e-1]:t[t.length-1]}function mr(t){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(e=>e===t||!t.contains(e))}function ie(t,e){return typeof e=="boolean"?e:typeof e=="string"?t[e]:e(t)}function br(t){return t===null?null:W(t)}function W(t){return typeof t=="string"?t:t.id}function Or(t,...e){if(t)return t(...e)}function Sr(t){return new Promise((e,r)=>{let n=0;function i(){n+=1,n===100&&r(),t()?e():setTimeout(i,10)}i()})}function Ir(t){var e,r;const n=t.focusedNode;return n?n.isOpen?0:n.parent?n.childIndex+1:0:(r=(e=t.root.children)===null||e===void 0?void 0:e.length)!==null&&r!==void 0?r:0}function Dr(t){const e=t.focusedNode;return e?e.isOpen?e.id:e.parent&&!e.parent.isRoot?e.parent.id:null:null}const In=Object.freeze(Object.defineProperty({__proto__:null,access:ie,bound:de,dfs:Je,focusNextElement:vr,focusPrevElement:yr,getInsertIndex:Ir,getInsertParentId:Dr,identify:W,identifyNull:br,indexOf:pr,isClosed:fr,isDescendant:gr,isItem:dr,isOpenWithEmptyChildren:hr,safeRun:Or,waitFor:Sr,walk:ye},Symbol.toStringTag,{value:"Module"})),Dn={display:"flex",alignItems:"center",zIndex:1},Tn={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},wn={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},Cn=or.memo(function({top:e,left:r,indent:n}){const i={position:"absolute",pointerEvents:"none",top:e-2+"px",left:r+"px",right:n+"px"};return y.jsxs("div",{style:Object.assign(Object.assign({},Dn),i),children:[y.jsx("div",{style:Object.assign({},wn)}),y.jsx("div",{style:Object.assign({},Tn)})]})});function En({node:t,attrs:e,innerRef:r,children:n}){return y.jsx("div",Object.assign({},e,{ref:r,onFocus:i=>i.stopPropagation(),onClick:t.handleClick,children:n}))}function _n(t){return y.jsxs("div",{ref:t.dragHandle,style:t.style,children:[y.jsx("span",{onClick:e=>{e.stopPropagation(),t.node.toggle()},children:t.node.isLeaf?"🌳":t.node.isOpen?"🗁":"🗀"})," ",t.node.isEditing?y.jsx(Nn,Object.assign({},t)):y.jsx(xn,Object.assign({},t))]})}function xn(t){return y.jsx(y.Fragment,{children:y.jsx("span",{children:t.node.data.name})})}function Nn({node:t}){const e=h.useRef();return h.useEffect(()=>{var r,n;(r=e.current)===null||r===void 0||r.focus(),(n=e.current)===null||n===void 0||n.select()},[]),y.jsx("input",{ref:e,defaultValue:t.data.name,onBlur:()=>t.reset(),onKeyDown:r=>{var n;r.key==="Escape"&&t.reset(),r.key==="Enter"&&t.submit(((n=e.current)===null||n===void 0?void 0:n.value)||"")}})}function Ee(t){return{type:"EDIT",id:t}}function Pn(t={id:null},e){return e.type==="EDIT"?Object.assign(Object.assign({},t),{id:e.id}):t}function G(t){return{type:"FOCUS",id:t}}function Rn(){return{type:"TREE_BLUR"}}function kn(t={id:null,treeFocused:!1},e){return e.type==="FOCUS"?Object.assign(Object.assign({},t),{id:e.id,treeFocused:!0}):e.type==="TREE_BLUR"?Object.assign(Object.assign({},t),{treeFocused:!1}):t}class me{constructor(e){this.handleClick=r=>{r.metaKey&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():r.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=e.tree,this.id=e.id,this.data=e.data,this.level=e.level,this.children=e.children,this.parent=e.parent,this.isDraggable=e.isDraggable,this.rowIndex=e.rowIndex}get isRoot(){return this.id===ae}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var e;return this.isSelected&&!(!((e=this.prev)===null||e===void 0)&&e.isSelected)}get isSelectedEnd(){var e;return this.isSelected&&!(!((e=this.next)===null||e===void 0)&&e.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(e=>e.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var e,r;const n=this.childIndex;return(r=(e=this.parent)===null||e===void 0?void 0:e.children[n+1])!==null&&r!==void 0?r:null}isAncestorOf(e){if(!e)return!1;let r=e;for(;r;){if(r.id===this.id)return!0;r=r.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(e){this.tree.submit(this,e)}reset(){this.tree.reset()}clone(){return new me(Object.assign({},this))}edit(){return this.tree.edit(this)}}const ae="__REACT_ARBORIST_INTERNAL_ROOT__";function ct(t){var e;function r(o,a,s){const u=t.accessId(o),c=new me({tree:t,data:o,level:a,parent:s,id:u,children:null,isDraggable:t.isDraggable(o),rowIndex:null}),d=t.accessChildren(o);return d&&(c.children=d.map(p=>r(p,a+1,c))),c}const n=new me({tree:t,id:ae,data:{id:ae},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),i=(e=t.props.data)!==null&&e!==void 0?e:[];return n.children=i.map(o=>r(o,0,n)),n}const Be={open(t,e){return{type:"VISIBILITY_OPEN",id:t,filtered:e}},close(t,e){return{type:"VISIBILITY_CLOSE",id:t,filtered:e}},toggle(t,e){return{type:"VISIBILITY_TOGGLE",id:t,filtered:e}},clear(t){return{type:"VISIBILITY_CLEAR",filtered:t}}};function dt(t={},e){if(e.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},t),{[e.id]:!0});if(e.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},t),{[e.id]:!1});if(e.type==="VISIBILITY_TOGGLE"){const r=t[e.id];return Object.assign(Object.assign({},t),{[e.id]:!r})}else return e.type==="VISIBILITY_CLEAR"?{}:t}function An(t={filtered:{},unfiltered:{}},e){return e.type.startsWith("VISIBILITY")?e.filtered?Object.assign(Object.assign({},t),{filtered:dt(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:dt(t.unfiltered,e)}):t}const Z=t=>{var e;return{nodes:{open:{filtered:{},unfiltered:(e=t==null?void 0:t.initialOpenState)!==null&&e!==void 0?e:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},$={clear:()=>({type:"SELECTION_CLEAR"}),only:t=>({type:"SELECTION_ONLY",id:W(t)}),add:t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(W)}),remove:t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(W)}),set:t=>Object.assign({type:"SELECTION_SET"},t),mostRecent:t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:W(t)}),anchor:t=>({type:"SELECTION_ANCHOR",id:t===null?null:W(t)})};function Mn(t=Z().nodes.selection,e){const r=t.ids;switch(e.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},t),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},t),{ids:new Set([e.id])});case"SELECTION_ADD":return e.ids.length===0?t:(e.ids.forEach(n=>r.add(n)),Object.assign(Object.assign({},t),{ids:new Set(r)}));case"SELECTION_REMOVE":return e.ids.length===0?t:(e.ids.forEach(n=>r.delete(n)),Object.assign(Object.assign({},t),{ids:new Set(r)}));case"SELECTION_SET":return Object.assign(Object.assign({},t),{ids:e.ids,mostRecent:e.mostRecent,anchor:e.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},t),{mostRecent:e.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},t),{anchor:e.id});default:return t}}const ee={cursor(t){return{type:"DND_CURSOR",cursor:t}},dragStart(t,e){return{type:"DND_DRAG_START",id:t,dragIds:e}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(t,e){return{type:"DND_HOVERING",parentId:t,index:e}}};function jn(t=Z().dnd,e){switch(e.type){case"DND_CURSOR":return Object.assign(Object.assign({},t),{cursor:e.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},t),{dragId:e.id,dragIds:e.dragIds});case"DND_DRAG_END":return Z().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}const Ln={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},$n=t=>{if(!t)return{display:"none"};const{x:e,y:r}=t;return{transform:`translate(${e}px, ${r}px)`}},Fn=t=>{if(!t)return{display:"none"};const{x:e,y:r}=t;return{transform:`translate(${e+10}px, ${r+10}px)`}};function Tr({offset:t,mouse:e,id:r,dragIds:n,isDragging:i}){return y.jsxs(Hn,{isDragging:i,children:[y.jsx(Un,{offset:t,children:y.jsx(Bn,{id:r,dragIds:n})}),y.jsx(zn,{mouse:e,count:n.length})]})}const Hn=h.memo(function(e){return e.isDragging?y.jsx("div",{style:Ln,children:e.children}):null});function Un(t){return y.jsx("div",{className:"row preview",style:$n(t.offset),children:t.children})}function zn(t){const{count:e,mouse:r}=t;return e>1?y.jsx("div",{className:"selected-count",style:Fn(r),children:e}):null}const Bn=h.memo(function(e){const r=A(),n=r.get(e.id);return n?y.jsx(r.renderNode,{preview:!0,node:n,style:{paddingLeft:n.level*r.indent,opacity:.2,background:"transparent"},tree:r}):null});function We(){return We=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},We.apply(null,arguments)}function ft(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qe(t,e){return qe=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},qe(t,e)}function Wn(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,qe(t,e)}var ht=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function qn(t,e){return!!(t===e||ht(t)&&ht(e))}function Vn(t,e){if(t.length!==e.length)return!1;for(var r=0;r<t.length;r++)if(!qn(t[r],e[r]))return!1;return!0}function _e(t,e){e===void 0&&(e=Vn);var r,n=[],i,o=!1;function a(){for(var s=[],u=0;u<arguments.length;u++)s[u]=arguments[u];return o&&r===this&&e(s,n)||(i=t.apply(this,s),o=!0,r=this,n=s),i}return a}var Gn=typeof performance=="object"&&typeof performance.now=="function",gt=Gn?function(){return performance.now()}:function(){return Date.now()};function pt(t){cancelAnimationFrame(t.id)}function Kn(t,e){var r=gt();function n(){gt()-r>=e?t.call(null):i.id=requestAnimationFrame(n)}var i={id:requestAnimationFrame(n)};return i}var xe=-1;function vt(t){if(t===void 0&&(t=!1),xe===-1||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(e),xe=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return xe}var K=null;function yt(t){if(t===void 0&&(t=!1),K===null||t){var e=document.createElement("div"),r=e.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var n=document.createElement("div"),i=n.style;return i.width="100px",i.height="100px",e.appendChild(n),document.body.appendChild(e),e.scrollLeft>0?K="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?K="negative":K="positive-ascending"),document.body.removeChild(e),K}return K}var Yn=150,Xn=function(e,r){return e};function Qn(t){var e,r=t.getItemOffset,n=t.getEstimatedTotalSize,i=t.getItemSize,o=t.getOffsetForIndexAndAlignment,a=t.getStartIndexForOffset,s=t.getStopIndexForStartIndex,u=t.initInstanceProps,c=t.shouldResetStyleCacheOnItemSizeChange,d=t.validateProps;return e=(function(p){Wn(b,p);function b(S){var l;return l=p.call(this,S)||this,l._instanceProps=u(l.props,ft(l)),l._outerRef=void 0,l._resetIsScrollingTimeoutId=null,l.state={instance:ft(l),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof l.props.initialScrollOffset=="number"?l.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},l._callOnItemsRendered=void 0,l._callOnItemsRendered=_e(function(f,g,v,O){return l.props.onItemsRendered({overscanStartIndex:f,overscanStopIndex:g,visibleStartIndex:v,visibleStopIndex:O})}),l._callOnScroll=void 0,l._callOnScroll=_e(function(f,g,v){return l.props.onScroll({scrollDirection:f,scrollOffset:g,scrollUpdateWasRequested:v})}),l._getItemStyle=void 0,l._getItemStyle=function(f){var g=l.props,v=g.direction,O=g.itemSize,w=g.layout,D=l._getItemStyleCache(c&&O,c&&w,c&&v),E;if(D.hasOwnProperty(f))E=D[f];else{var _=r(l.props,f,l._instanceProps),T=i(l.props,f,l._instanceProps),x=v==="horizontal"||w==="horizontal",N=v==="rtl",H=x?_:0;D[f]=E={position:"absolute",left:N?void 0:H,right:N?H:void 0,top:x?0:_,height:x?"100%":T,width:x?T:"100%"}}return E},l._getItemStyleCache=void 0,l._getItemStyleCache=_e(function(f,g,v){return{}}),l._onScrollHorizontal=function(f){var g=f.currentTarget,v=g.clientWidth,O=g.scrollLeft,w=g.scrollWidth;l.setState(function(D){if(D.scrollOffset===O)return null;var E=l.props.direction,_=O;if(E==="rtl")switch(yt()){case"negative":_=-O;break;case"positive-descending":_=w-v-O;break}return _=Math.max(0,Math.min(_,w-v)),{isScrolling:!0,scrollDirection:D.scrollOffset<_?"forward":"backward",scrollOffset:_,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._onScrollVertical=function(f){var g=f.currentTarget,v=g.clientHeight,O=g.scrollHeight,w=g.scrollTop;l.setState(function(D){if(D.scrollOffset===w)return null;var E=Math.max(0,Math.min(w,O-v));return{isScrolling:!0,scrollDirection:D.scrollOffset<E?"forward":"backward",scrollOffset:E,scrollUpdateWasRequested:!1}},l._resetIsScrollingDebounced)},l._outerRefSetter=function(f){var g=l.props.outerRef;l._outerRef=f,typeof g=="function"?g(f):g!=null&&typeof g=="object"&&g.hasOwnProperty("current")&&(g.current=f)},l._resetIsScrollingDebounced=function(){l._resetIsScrollingTimeoutId!==null&&pt(l._resetIsScrollingTimeoutId),l._resetIsScrollingTimeoutId=Kn(l._resetIsScrolling,Yn)},l._resetIsScrolling=function(){l._resetIsScrollingTimeoutId=null,l.setState({isScrolling:!1},function(){l._getItemStyleCache(-1,null)})},l}b.getDerivedStateFromProps=function(l,f){return Jn(l,f),d(l),null};var m=b.prototype;return m.scrollTo=function(l){l=Math.max(0,l),this.setState(function(f){return f.scrollOffset===l?null:{scrollDirection:f.scrollOffset<l?"forward":"backward",scrollOffset:l,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},m.scrollToItem=function(l,f){f===void 0&&(f="auto");var g=this.props,v=g.itemCount,O=g.layout,w=this.state.scrollOffset;l=Math.max(0,Math.min(l,v-1));var D=0;if(this._outerRef){var E=this._outerRef;O==="vertical"?D=E.scrollWidth>E.clientWidth?vt():0:D=E.scrollHeight>E.clientHeight?vt():0}this.scrollTo(o(this.props,l,f,w,this._instanceProps,D))},m.componentDidMount=function(){var l=this.props,f=l.direction,g=l.initialScrollOffset,v=l.layout;if(typeof g=="number"&&this._outerRef!=null){var O=this._outerRef;f==="horizontal"||v==="horizontal"?O.scrollLeft=g:O.scrollTop=g}this._callPropsCallbacks()},m.componentDidUpdate=function(){var l=this.props,f=l.direction,g=l.layout,v=this.state,O=v.scrollOffset,w=v.scrollUpdateWasRequested;if(w&&this._outerRef!=null){var D=this._outerRef;if(f==="horizontal"||g==="horizontal")if(f==="rtl")switch(yt()){case"negative":D.scrollLeft=-O;break;case"positive-ascending":D.scrollLeft=O;break;default:var E=D.clientWidth,_=D.scrollWidth;D.scrollLeft=_-E-O;break}else D.scrollLeft=O;else D.scrollTop=O}this._callPropsCallbacks()},m.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&pt(this._resetIsScrollingTimeoutId)},m.render=function(){var l=this.props,f=l.children,g=l.className,v=l.direction,O=l.height,w=l.innerRef,D=l.innerElementType,E=l.innerTagName,_=l.itemCount,T=l.itemData,x=l.itemKey,N=x===void 0?Xn:x,H=l.layout,B=l.outerElementType,en=l.outerTagName,tn=l.style,rn=l.useIsScrolling,nn=l.width,at=this.state.isScrolling,Ce=v==="horizontal"||H==="horizontal",on=Ce?this._onScrollHorizontal:this._onScrollVertical,st=this._getRangeToRender(),an=st[0],sn=st[1],ut=[];if(_>0)for(var te=an;te<=sn;te++)ut.push(h.createElement(f,{data:T,key:N(te,T),index:te,isScrolling:rn?at:void 0,style:this._getItemStyle(te)}));var lt=n(this.props,this._instanceProps);return h.createElement(B||en||"div",{className:g,onScroll:on,ref:this._outerRefSetter,style:We({position:"relative",height:O,width:nn,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:v},tn)},h.createElement(D||E||"div",{children:ut,ref:w,style:{height:Ce?"100%":lt,pointerEvents:at?"none":void 0,width:Ce?lt:"100%"}}))},m._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var l=this.props.itemCount;if(l>0){var f=this._getRangeToRender(),g=f[0],v=f[1],O=f[2],w=f[3];this._callOnItemsRendered(g,v,O,w)}}if(typeof this.props.onScroll=="function"){var D=this.state,E=D.scrollDirection,_=D.scrollOffset,T=D.scrollUpdateWasRequested;this._callOnScroll(E,_,T)}},m._getRangeToRender=function(){var l=this.props,f=l.itemCount,g=l.overscanCount,v=this.state,O=v.isScrolling,w=v.scrollDirection,D=v.scrollOffset;if(f===0)return[0,0,0,0];var E=a(this.props,D,this._instanceProps),_=s(this.props,E,D,this._instanceProps),T=!O||w==="backward"?Math.max(1,g):1,x=!O||w==="forward"?Math.max(1,g):1;return[Math.max(0,E-T),Math.max(0,Math.min(f-1,_+x)),E,_]},b})(h.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var Jn=function(e,r){e.children,e.direction,e.height,e.layout,e.innerTagName,e.outerTagName,e.width,r.instance},Zn=Qn({getItemOffset:function(e,r){var n=e.itemSize;return r*n},getItemSize:function(e,r){var n=e.itemSize;return n},getEstimatedTotalSize:function(e){var r=e.itemCount,n=e.itemSize;return n*r},getOffsetForIndexAndAlignment:function(e,r,n,i,o,a){var s=e.direction,u=e.height,c=e.itemCount,d=e.itemSize,p=e.layout,b=e.width,m=s==="horizontal"||p==="horizontal",S=m?b:u,l=Math.max(0,c*d-S),f=Math.min(l,r*d),g=Math.max(0,r*d-S+d+a);switch(n==="smart"&&(i>=g-S&&i<=f+S?n="auto":n="center"),n){case"start":return f;case"end":return g;case"center":{var v=Math.round(g+(f-g)/2);return v<Math.ceil(S/2)?0:v>l+Math.floor(S/2)?l:v}case"auto":default:return i>=g&&i<=f?i:i<g?g:f}},getStartIndexForOffset:function(e,r){var n=e.itemCount,i=e.itemSize;return Math.max(0,Math.min(n-1,Math.floor(r/i)))},getStopIndexForStartIndex:function(e,r,n){var i=e.direction,o=e.height,a=e.itemCount,s=e.itemSize,u=e.layout,c=e.width,d=i==="horizontal"||u==="horizontal",p=r*s,b=d?c:o,m=Math.ceil((b+n-p)/s);return Math.max(0,Math.min(a-1,r+m-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){e.itemSize}});function ei(){var t,e;const r=A(),i=bn().cursor;if(!i||i.type!=="line")return null;const o=r.indent,a=r.rowHeight*i.index+((e=(t=r.props.padding)!==null&&t!==void 0?t:r.props.paddingTop)!==null&&e!==void 0?e:0),s=o*i.level,u=r.renderCursor;return y.jsx(u,{top:a,left:s,indent:o})}var ti=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};const ri=h.forwardRef(function(e,r){const{children:n}=e,i=ti(e,["children"]),o=A();return y.jsxs("div",Object.assign({ref:r},i,{onClick:a=>{a.currentTarget===a.target&&o.deselectAll()},children:[y.jsx(ni,{}),n]}))}),ni=()=>{const t=A();return y.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:y.jsx(ei,{})})};var ii=function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(t);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(t,n[i])&&(r[n[i]]=t[n[i]]);return r};const oi=h.forwardRef(function(e,r){var n,i,o,a,{style:s}=e,u=ii(e,["style"]);const c=A(),d=(i=(n=c.props.padding)!==null&&n!==void 0?n:c.props.paddingTop)!==null&&i!==void 0?i:0,p=(a=(o=c.props.padding)!==null&&o!==void 0?o:c.props.paddingBottom)!==null&&a!==void 0?a:0;return y.jsx("div",Object.assign({ref:r,style:Object.assign(Object.assign({},s),{height:`${parseFloat(s.height)+d+p}px`})},u))});var wr=h.createContext({dragDropManager:void 0}),L;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(L||(L={}));function I(t,e){for(var r=arguments.length,n=new Array(r>2?r-2:0),i=2;i<r;i++)n[i-2]=arguments[i];if(!t){var o;if(e===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;o=new Error(e.replace(/%s/g,function(){return n[a++]})),o.name="Invariant Violation"}throw o.framesToPop=1,o}}var Ze="dnd-core/INIT_COORDS",Se="dnd-core/BEGIN_DRAG",et="dnd-core/PUBLISH_DRAG_SOURCE",Ie="dnd-core/HOVER",De="dnd-core/DROP",Te="dnd-core/END_DRAG";function mt(t,e){return{type:Ze,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function fe(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?fe=function(r){return typeof r}:fe=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},fe(t)}function ai(t,e,r){return e.split(".").reduce(function(n,i){return n&&n[i]?n[i]:r||null},t)}function si(t,e){return t.filter(function(r){return r!==e})}function Cr(t){return fe(t)==="object"}function ui(t,e){var r=new Map,n=function(a){r.set(a,r.has(a)?r.get(a)+1:1)};t.forEach(n),e.forEach(n);var i=[];return r.forEach(function(o,a){o===1&&i.push(a)}),i}function li(t,e){return t.filter(function(r){return e.indexOf(r)>-1})}var ci={type:Ze,payload:{clientOffset:null,sourceClientOffset:null}};function di(t){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},i=n.publishSource,o=i===void 0?!0:i,a=n.clientOffset,s=n.getSourceClientOffset,u=t.getMonitor(),c=t.getRegistry();t.dispatch(mt(a)),fi(r,u,c);var d=pi(r,u);if(d===null){t.dispatch(ci);return}var p=null;if(a){if(!s)throw new Error("getSourceClientOffset must be defined");hi(s),p=s(d)}t.dispatch(mt(a,p));var b=c.getSource(d),m=b.beginDrag(u,d);if(m!=null){gi(m),c.pinSource(d);var S=c.getSourceType(d);return{type:Se,payload:{itemType:S,item:m,sourceId:d,clientOffset:a||null,sourceClientOffset:p||null,isSourcePublic:!!o}}}}}function fi(t,e,r){I(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(n){I(r.getSource(n),"Expected sourceIds to be registered.")})}function hi(t){I(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function gi(t){I(Cr(t),"Item must be an object.")}function pi(t,e){for(var r=null,n=t.length-1;n>=0;n--)if(e.canDragSource(t[n])){r=t[n];break}return r}function vi(t){return function(){var r=t.getMonitor();if(r.isDragging())return{type:et}}}function Ve(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(r){return r===e}):t===e}function yi(t){return function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=n.clientOffset;mi(r);var o=r.slice(0),a=t.getMonitor(),s=t.getRegistry();bi(o,a,s);var u=a.getItemType();return Oi(o,s,u),Si(o,a,s),{type:Ie,payload:{targetIds:o,clientOffset:i||null}}}}function mi(t){I(Array.isArray(t),"Expected targetIds to be an array.")}function bi(t,e,r){I(e.isDragging(),"Cannot call hover while not dragging."),I(!e.didDrop(),"Cannot call hover after drop.");for(var n=0;n<t.length;n++){var i=t[n];I(t.lastIndexOf(i)===n,"Expected targetIds to be unique in the passed array.");var o=r.getTarget(i);I(o,"Expected targetIds to be registered.")}}function Oi(t,e,r){for(var n=t.length-1;n>=0;n--){var i=t[n],o=e.getTargetType(i);Ve(o,r)||t.splice(n,1)}}function Si(t,e,r){t.forEach(function(n){var i=r.getTarget(n);i.hover(e,n)})}function bt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Ot(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?bt(Object(r),!0).forEach(function(n){Ii(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ii(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Di(t){return function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=t.getMonitor(),i=t.getRegistry();Ti(n);var o=Ei(n);o.forEach(function(a,s){var u=wi(a,s,i,n),c={type:De,payload:{dropResult:Ot(Ot({},r),u)}};t.dispatch(c)})}}function Ti(t){I(t.isDragging(),"Cannot call drop while not dragging."),I(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function wi(t,e,r,n){var i=r.getTarget(t),o=i?i.drop(n,t):void 0;return Ci(o),typeof o>"u"&&(o=e===0?{}:n.getDropResult()),o}function Ci(t){I(typeof t>"u"||Cr(t),"Drop result must either be an object or undefined.")}function Ei(t){var e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function _i(t){return function(){var r=t.getMonitor(),n=t.getRegistry();xi(r);var i=r.getSourceId();if(i!=null){var o=n.getSource(i,!0);o.endDrag(r,i),n.unpinSource()}return{type:Te}}}function xi(t){I(t.isDragging(),"Cannot call endDrag while not dragging.")}function Ni(t){return{beginDrag:di(t),publishDragSource:vi(t),hover:yi(t),drop:Di(t),endDrag:_i(t)}}function Pi(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ri(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ki(t,e,r){return e&&Ri(t.prototype,e),t}function re(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ai=(function(){function t(e,r){var n=this;Pi(this,t),re(this,"store",void 0),re(this,"monitor",void 0),re(this,"backend",void 0),re(this,"isSetUp",!1),re(this,"handleRefCountChange",function(){var i=n.store.getState().refCount>0;n.backend&&(i&&!n.isSetUp?(n.backend.setup(),n.isSetUp=!0):!i&&n.isSetUp&&(n.backend.teardown(),n.isSetUp=!1))}),this.store=e,this.monitor=r,e.subscribe(this.handleRefCountChange)}return ki(t,[{key:"receiveBackend",value:function(r){this.backend=r}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var r=this,n=this.store.dispatch;function i(a){return function(){for(var s=arguments.length,u=new Array(s),c=0;c<s;c++)u[c]=arguments[c];var d=a.apply(r,u);typeof d<"u"&&n(d)}}var o=Ni(this);return Object.keys(o).reduce(function(a,s){var u=o[s];return a[s]=i(u),a},{})}},{key:"dispatch",value:function(r){this.store.dispatch(r)}}]),t})();function M(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var St=(function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"})(),It=function(){return Math.random().toString(36).substring(7).split("").join(".")},Dt={INIT:"@@redux/INIT"+It(),REPLACE:"@@redux/REPLACE"+It()};function Mi(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function Er(t,e,r){var n;if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(M(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(M(1));return r(Er)(t,e)}if(typeof t!="function")throw new Error(M(2));var i=t,o=e,a=[],s=a,u=!1;function c(){s===a&&(s=a.slice())}function d(){if(u)throw new Error(M(3));return o}function p(l){if(typeof l!="function")throw new Error(M(4));if(u)throw new Error(M(5));var f=!0;return c(),s.push(l),function(){if(f){if(u)throw new Error(M(6));f=!1,c();var v=s.indexOf(l);s.splice(v,1),a=null}}}function b(l){if(!Mi(l))throw new Error(M(7));if(typeof l.type>"u")throw new Error(M(8));if(u)throw new Error(M(9));try{u=!0,o=i(o,l)}finally{u=!1}for(var f=a=s,g=0;g<f.length;g++){var v=f[g];v()}return l}function m(l){if(typeof l!="function")throw new Error(M(10));i=l,b({type:Dt.REPLACE})}function S(){var l,f=p;return l={subscribe:function(v){if(typeof v!="object"||v===null)throw new Error(M(11));function O(){v.next&&v.next(d())}O();var w=f(O);return{unsubscribe:w}}},l[St]=function(){return this},l}return b({type:Dt.INIT}),n={dispatch:b,subscribe:p,getState:d,replaceReducer:m},n[St]=S,n}var ji=function(e,r){return e===r};function Li(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function $i(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:ji;if(t.length!==e.length)return!1;for(var n=0;n<t.length;++n)if(!r(t[n],e[n]))return!1;return!0}function Tt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function wt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Tt(Object(r),!0).forEach(function(n){Fi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Tt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Fi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ct={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Hi(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ct,e=arguments.length>1?arguments[1]:void 0,r=e.payload;switch(e.type){case Ze:case Se:return{initialSourceClientOffset:r.sourceClientOffset,initialClientOffset:r.clientOffset,clientOffset:r.clientOffset};case Ie:return Li(t.clientOffset,r.clientOffset)?t:wt(wt({},t),{},{clientOffset:r.clientOffset});case Te:case De:return Ct;default:return t}}var tt="dnd-core/ADD_SOURCE",rt="dnd-core/ADD_TARGET",nt="dnd-core/REMOVE_SOURCE",we="dnd-core/REMOVE_TARGET";function Ui(t){return{type:tt,payload:{sourceId:t}}}function zi(t){return{type:rt,payload:{targetId:t}}}function Bi(t){return{type:nt,payload:{sourceId:t}}}function Wi(t){return{type:we,payload:{targetId:t}}}function Et(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function j(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Et(Object(r),!0).forEach(function(n){qi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Et(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function qi(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Vi={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Gi(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Vi,e=arguments.length>1?arguments[1]:void 0,r=e.payload;switch(e.type){case Se:return j(j({},t),{},{itemType:r.itemType,item:r.item,sourceId:r.sourceId,isSourcePublic:r.isSourcePublic,dropResult:null,didDrop:!1});case et:return j(j({},t),{},{isSourcePublic:!0});case Ie:return j(j({},t),{},{targetIds:r.targetIds});case we:return t.targetIds.indexOf(r.targetId)===-1?t:j(j({},t),{},{targetIds:si(t.targetIds,r.targetId)});case De:return j(j({},t),{},{dropResult:r.dropResult,didDrop:!0,targetIds:[]});case Te:return j(j({},t),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function Ki(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case tt:case rt:return t+1;case nt:case we:return t-1;default:return t}}var be=[],it=[];be.__IS_NONE__=!0;it.__IS_ALL__=!0;function Yi(t,e){if(t===be)return!1;if(t===it||typeof e>"u")return!0;var r=li(e,t);return r.length>0}function Xi(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ie:break;case tt:case rt:case we:case nt:return be;case Se:case et:case Te:case De:default:return it}var e=t.payload,r=e.targetIds,n=r===void 0?[]:r,i=e.prevTargetIds,o=i===void 0?[]:i,a=ui(n,o),s=a.length>0||!$i(n,o);if(!s)return be;var u=o[o.length-1],c=n[n.length-1];return u!==c&&(u&&a.push(u),c&&a.push(c)),a}function Qi(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return t+1}function _t(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function xt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_t(Object(r),!0).forEach(function(n){Ji(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_t(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ji(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Zi(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:Xi(t.dirtyHandlerIds,{type:e.type,payload:xt(xt({},e.payload),{},{prevTargetIds:ai(t,"dragOperation.targetIds",[])})}),dragOffset:Hi(t.dragOffset,e),refCount:Ki(t.refCount,e),dragOperation:Gi(t.dragOperation,e),stateId:Qi(t.stateId)}}function eo(t,e){return{x:t.x+e.x,y:t.y+e.y}}function _r(t,e){return{x:t.x-e.x,y:t.y-e.y}}function to(t){var e=t.clientOffset,r=t.initialClientOffset,n=t.initialSourceClientOffset;return!e||!r||!n?null:_r(eo(e,n),r)}function ro(t){var e=t.clientOffset,r=t.initialClientOffset;return!e||!r?null:_r(e,r)}function no(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function io(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function oo(t,e,r){return e&&io(t.prototype,e),t}function Nt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ao=(function(){function t(e,r){no(this,t),Nt(this,"store",void 0),Nt(this,"registry",void 0),this.store=e,this.registry=r}return oo(t,[{key:"subscribeToStateChange",value:function(r){var n=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=i.handlerIds;I(typeof r=="function","listener must be a function."),I(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,s=function(){var c=n.store.getState(),d=c.stateId;try{var p=d===a||d===a+1&&!Yi(c.dirtyHandlerIds,o);p||r()}finally{a=d}};return this.store.subscribe(s)}},{key:"subscribeToOffsetChange",value:function(r){var n=this;I(typeof r=="function","listener must be a function.");var i=this.store.getState().dragOffset,o=function(){var s=n.store.getState().dragOffset;s!==i&&(i=s,r())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r);return I(n,"Expected to find a valid source. sourceId=".concat(r)),this.isDragging()?!1:n.canDrag(this,r)}},{key:"canDropOnTarget",value:function(r){if(!r)return!1;var n=this.registry.getTarget(r);if(I(n,"Expected to find a valid target. targetId=".concat(r)),!this.isDragging()||this.didDrop())return!1;var i=this.registry.getTargetType(r),o=this.getItemType();return Ve(i,o)&&n.canDrop(this,r)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(r){if(!r)return!1;var n=this.registry.getSource(r,!0);if(I(n,"Expected to find a valid source. sourceId=".concat(r)),!this.isDragging()||!this.isSourcePublic())return!1;var i=this.registry.getSourceType(r),o=this.getItemType();return i!==o?!1:n.isDragging(this,r)}},{key:"isOverTarget",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!r)return!1;var i=n.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(r),a=this.getItemType();if(a&&!Ve(o,a))return!1;var s=this.getTargetIds();if(!s.length)return!1;var u=s.indexOf(r);return i?u===s.length-1:u>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return to(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return ro(this.store.getState().dragOffset)}}]),t})(),so=0;function uo(){return so++}function he(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?he=function(r){return typeof r}:he=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},he(t)}function lo(t){I(typeof t.canDrag=="function","Expected canDrag to be a function."),I(typeof t.beginDrag=="function","Expected beginDrag to be a function."),I(typeof t.endDrag=="function","Expected endDrag to be a function.")}function co(t){I(typeof t.canDrop=="function","Expected canDrop to be a function."),I(typeof t.hover=="function","Expected hover to be a function."),I(typeof t.drop=="function","Expected beginDrag to be a function.")}function Ge(t,e){if(e&&Array.isArray(t)){t.forEach(function(r){return Ge(r,!1)});return}I(typeof t=="string"||he(t)==="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const Pt=typeof global<"u"?global:self,xr=Pt.MutationObserver||Pt.WebKitMutationObserver;function Nr(t){return function(){const r=setTimeout(i,0),n=setInterval(i,50);function i(){clearTimeout(r),clearInterval(n),t()}}}function fo(t){let e=1;const r=new xr(t),n=document.createTextNode("");return r.observe(n,{characterData:!0}),function(){e=-e,n.data=e}}const ho=typeof xr=="function"?fo:Nr;class go{enqueueTask(e){const{queue:r,requestFlush:n}=this;r.length||(n(),this.flushing=!0),r[r.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const r=this.index;if(this.index++,e[r].call(),this.index>this.capacity){for(let n=0,i=e.length-this.index;n<i;n++)e[n]=e[n+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=ho(this.flush),this.requestErrorThrow=Nr(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class po{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,r){this.onError=e,this.release=r,this.task=null}}class vo{create(e){const r=this.freeTasks,n=r.length?r.pop():new po(this.onError,i=>r[r.length]=i);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}const Pr=new go,yo=new vo(Pr.registerPendingError);function mo(t){Pr.enqueueTask(yo.create(t))}function bo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Oo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function So(t,e,r){return e&&Oo(t.prototype,e),t}function Y(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Io(t,e){return Co(t)||wo(t,e)||To(t,e)||Do()}function Do(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
12
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function To(t,e){if(t){if(typeof t=="string")return Rt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rt(t,e)}}function Rt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function wo(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function Co(t){if(Array.isArray(t))return t}function Eo(t){var e=uo().toString();switch(t){case L.SOURCE:return"S".concat(e);case L.TARGET:return"T".concat(e);default:throw new Error("Unknown Handler Role: ".concat(t))}}function kt(t){switch(t[0]){case"S":return L.SOURCE;case"T":return L.TARGET;default:I(!1,"Cannot parse handler ID: ".concat(t))}}function At(t,e){var r=t.entries(),n=!1;do{var i=r.next(),o=i.done,a=Io(i.value,2),s=a[1];if(s===e)return!0;n=!!o}while(!n);return!1}var _o=(function(){function t(e){bo(this,t),Y(this,"types",new Map),Y(this,"dragSources",new Map),Y(this,"dropTargets",new Map),Y(this,"pinnedSourceId",null),Y(this,"pinnedSource",null),Y(this,"store",void 0),this.store=e}return So(t,[{key:"addSource",value:function(r,n){Ge(r),lo(n);var i=this.addHandler(L.SOURCE,r,n);return this.store.dispatch(Ui(i)),i}},{key:"addTarget",value:function(r,n){Ge(r,!0),co(n);var i=this.addHandler(L.TARGET,r,n);return this.store.dispatch(zi(i)),i}},{key:"containsHandler",value:function(r){return At(this.dragSources,r)||At(this.dropTargets,r)}},{key:"getSource",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;I(this.isSourceId(r),"Expected a valid source ID.");var i=n&&r===this.pinnedSourceId,o=i?this.pinnedSource:this.dragSources.get(r);return o}},{key:"getTarget",value:function(r){return I(this.isTargetId(r),"Expected a valid target ID."),this.dropTargets.get(r)}},{key:"getSourceType",value:function(r){return I(this.isSourceId(r),"Expected a valid source ID."),this.types.get(r)}},{key:"getTargetType",value:function(r){return I(this.isTargetId(r),"Expected a valid target ID."),this.types.get(r)}},{key:"isSourceId",value:function(r){var n=kt(r);return n===L.SOURCE}},{key:"isTargetId",value:function(r){var n=kt(r);return n===L.TARGET}},{key:"removeSource",value:function(r){var n=this;I(this.getSource(r),"Expected an existing source."),this.store.dispatch(Bi(r)),mo(function(){n.dragSources.delete(r),n.types.delete(r)})}},{key:"removeTarget",value:function(r){I(this.getTarget(r),"Expected an existing target."),this.store.dispatch(Wi(r)),this.dropTargets.delete(r),this.types.delete(r)}},{key:"pinSource",value:function(r){var n=this.getSource(r);I(n,"Expected an existing source."),this.pinnedSourceId=r,this.pinnedSource=n}},{key:"unpinSource",value:function(){I(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(r,n,i){var o=Eo(r);return this.types.set(o,n),r===L.SOURCE?this.dragSources.set(o,i):r===L.TARGET&&this.dropTargets.set(o,i),o}}]),t})();function Rr(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=xo(n),o=new ao(i,new _o(i)),a=new Ai(i,o),s=t(a,e,r);return a.receiveBackend(s),a}function xo(t){var e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return Er(Zi,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}var No=["children"];function Po(t,e){return Mo(t)||Ao(t,e)||ko(t,e)||Ro()}function Ro(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
13
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ko(t,e){if(t){if(typeof t=="string")return Mt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Mt(t,e)}}function Mt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Ao(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function Mo(t){if(Array.isArray(t))return t}function jo(t,e){if(t==null)return{};var r=Lo(t,e),n,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)n=o[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Lo(t,e){if(t==null)return{};var r={},n=Object.keys(t),i,o;for(o=0;o<n.length;o++)i=n[o],!(e.indexOf(i)>=0)&&(r[i]=t[i]);return r}var jt=0,ge=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),$o=h.memo(function(e){var r=e.children,n=jo(e,No),i=Fo(n),o=Po(i,2),a=o[0],s=o[1];return h.useEffect(function(){if(s){var u=kr();return++jt,function(){--jt===0&&(u[ge]=null)}}},[]),y.jsx(wr.Provider,Object.assign({value:a},{children:r}),void 0)});function Fo(t){if("manager"in t){var e={dragDropManager:t.manager};return[e,!1]}var r=Ho(t.backend,t.context,t.options,t.debugMode),n=!t.context;return[r,n]}function Ho(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:kr(),r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=e;return i[ge]||(i[ge]={dragDropManager:Rr(t,e,r,n)}),i[ge]}function kr(){return typeof global<"u"?global:window}function Uo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Bo(t,e,r){return e&&zo(t.prototype,e),t}function Lt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ne=!1,Pe=!1,Wo=(function(){function t(e){Uo(this,t),Lt(this,"internalMonitor",void 0),Lt(this,"sourceId",null),this.internalMonitor=e.getMonitor()}return Bo(t,[{key:"receiveHandlerId",value:function(r){this.sourceId=r}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){I(!Ne,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Ne=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Ne=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;I(!Pe,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Pe=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Pe=!1}}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"isDraggingSource",value:function(r){return this.internalMonitor.isDraggingSource(r)}},{key:"isOverTarget",value:function(r,n){return this.internalMonitor.isOverTarget(r,n)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(r){return this.internalMonitor.subscribeToOffsetChange(r)}},{key:"canDragSource",value:function(r){return this.internalMonitor.canDragSource(r)}},{key:"canDropOnTarget",value:function(r){return this.internalMonitor.canDropOnTarget(r)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t})();function qo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Vo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Go(t,e,r){return e&&Vo(t.prototype,e),t}function $t(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Re=!1,Ko=(function(){function t(e){qo(this,t),$t(this,"internalMonitor",void 0),$t(this,"targetId",null),this.internalMonitor=e.getMonitor()}return Go(t,[{key:"receiveHandlerId",value:function(r){this.targetId=r}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(r,n){return this.internalMonitor.subscribeToStateChange(r,n)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;I(!Re,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return Re=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{Re=!1}}},{key:"isOver",value:function(r){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,r):!1}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t})();function Yo(t){if(typeof t.type!="string"){var e=t.type.displayName||t.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(e," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}function Xo(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!h.isValidElement(e)){var n=e;return t(n,r),n}var i=e;Yo(i);var o=r?function(a){return t(a,r)}:t;return Qo(i,o)}}function Ar(t){var e={};return Object.keys(t).forEach(function(r){var n=t[r];if(r.endsWith("Ref"))e[r]=t[r];else{var i=Xo(n);e[r]=function(){return i}}}),e}function Ft(t,e){typeof t=="function"?t(e):t.current=e}function Qo(t,e){var r=t.ref;return I(typeof r!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),r?h.cloneElement(t,{ref:function(i){Ft(r,i),Ft(e,i)}}):h.cloneElement(t,{ref:e})}function pe(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?pe=function(r){return typeof r}:pe=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},pe(t)}function Ke(t){return t!==null&&pe(t)==="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Ye(t,e,r,n){var i=void 0;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),u=0;u<o.length;u++){var c=o[u];if(!s(c))return!1;var d=t[c],p=e[c];if(i=void 0,i===!1||i===void 0&&d!==p)return!1}return!0}function Jo(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Zo(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ea(t,e,r){return e&&Zo(t.prototype,e),t}function R(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ta=(function(){function t(e){var r=this;Jo(this,t),R(this,"hooks",Ar({dragSource:function(i,o){r.clearDragSource(),r.dragSourceOptions=o||null,Ke(i)?r.dragSourceRef=i:r.dragSourceNode=i,r.reconnectDragSource()},dragPreview:function(i,o){r.clearDragPreview(),r.dragPreviewOptions=o||null,Ke(i)?r.dragPreviewRef=i:r.dragPreviewNode=i,r.reconnectDragPreview()}})),R(this,"handlerId",null),R(this,"dragSourceRef",null),R(this,"dragSourceNode",void 0),R(this,"dragSourceOptionsInternal",null),R(this,"dragSourceUnsubscribe",void 0),R(this,"dragPreviewRef",null),R(this,"dragPreviewNode",void 0),R(this,"dragPreviewOptionsInternal",null),R(this,"dragPreviewUnsubscribe",void 0),R(this,"lastConnectedHandlerId",null),R(this,"lastConnectedDragSource",null),R(this,"lastConnectedDragSourceOptions",null),R(this,"lastConnectedDragPreview",null),R(this,"lastConnectedDragPreviewOptions",null),R(this,"backend",void 0),this.backend=e}return ea(t,[{key:"receiveHandlerId",value:function(r){this.handlerId!==r&&(this.handlerId=r,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(r){this.dragSourceOptionsInternal=r}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(r){this.dragPreviewOptionsInternal=r}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var r=this.dragSource,n=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();if(n&&this.disconnectDragSource(),!!this.handlerId){if(!r){this.lastConnectedDragSource=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=r,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,r,this.dragSourceOptions))}}},{key:"reconnectDragPreview",value:function(){var r=this.dragPreview,n=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(n&&this.disconnectDragPreview(),!!this.handlerId){if(!r){this.lastConnectedDragPreview=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=r,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,r,this.dragPreviewOptions))}}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!Ye(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Ye(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),t})();function ra(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function na(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ia(t,e,r){return e&&na(t.prototype,e),t}function U(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var oa=(function(){function t(e){var r=this;ra(this,t),U(this,"hooks",Ar({dropTarget:function(i,o){r.clearDropTarget(),r.dropTargetOptions=o,Ke(i)?r.dropTargetRef=i:r.dropTargetNode=i,r.reconnect()}})),U(this,"handlerId",null),U(this,"dropTargetRef",null),U(this,"dropTargetNode",void 0),U(this,"dropTargetOptionsInternal",null),U(this,"unsubscribeDropTarget",void 0),U(this,"lastConnectedHandlerId",null),U(this,"lastConnectedDropTarget",null),U(this,"lastConnectedDropTargetOptions",null),U(this,"backend",void 0),this.backend=e}return ia(t,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var r=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();r&&this.disconnectDropTarget();var n=this.dropTarget;if(this.handlerId){if(!n){this.lastConnectedDropTarget=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=n,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,n,this.dropTargetOptions))}}},{key:"receiveHandlerId",value:function(r){r!==this.handlerId&&(this.handlerId=r,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(r){this.dropTargetOptionsInternal=r}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!Ye(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),t})();function aa(t,e,r){var n=r.getRegistry(),i=n.addTarget(t,e);return[i,function(){return n.removeTarget(i)}]}function sa(t,e,r){var n=r.getRegistry(),i=n.addSource(t,e);return[i,function(){return n.removeSource(i)}]}var q=typeof window<"u"?h.useLayoutEffect:h.useEffect;function ve(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?ve=function(r){return typeof r}:ve=function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},ve(t)}function ua(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function la(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ca(t,e,r){return e&&la(t.prototype,e),t}function ke(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var da=(function(){function t(e,r,n){ua(this,t),ke(this,"spec",void 0),ke(this,"monitor",void 0),ke(this,"connector",void 0),this.spec=e,this.monitor=r,this.connector=n}return ca(t,[{key:"beginDrag",value:function(){var r,n=this.spec,i=this.monitor,o=null;return ve(n.item)==="object"?o=n.item:typeof n.item=="function"?o=n.item(i):o={},(r=o)!==null&&r!==void 0?r:null}},{key:"canDrag",value:function(){var r=this.spec,n=this.monitor;return typeof r.canDrag=="boolean"?r.canDrag:typeof r.canDrag=="function"?r.canDrag(n):!0}},{key:"isDragging",value:function(r,n){var i=this.spec,o=this.monitor,a=i.isDragging;return a?a(o):n===r.getSourceId()}},{key:"endDrag",value:function(){var r=this.spec,n=this.monitor,i=this.connector,o=r.end;o&&o(n.getItem(),n),i.reconnect()}}]),t})();function fa(t,e,r){var n=h.useMemo(function(){return new da(t,e,r)},[e,r]);return h.useEffect(function(){n.spec=t},[t]),n}function V(){var t=h.useContext(wr),e=t.dragDropManager;return I(e!=null,"Expected drag drop context"),e}function ha(t){return h.useMemo(function(){var e=t.type;return I(e!=null,"spec.type must be defined"),e},[t])}function ga(t,e){return ma(t)||ya(t,e)||va(t,e)||pa()}function pa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
14
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function va(t,e){if(t){if(typeof t=="string")return Ht(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ht(t,e)}}function Ht(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ya(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function ma(t){if(Array.isArray(t))return t}function ba(t,e,r){var n=V(),i=fa(t,e,r),o=ha(t);q(function(){if(o!=null){var s=sa(o,i,n),u=ga(s,2),c=u[0],d=u[1];return e.receiveHandlerId(c),r.receiveHandlerId(c),d}},[n,e,r,i,o])}function Oa(t){return Ta(t)||Da(t)||Ia(t)||Sa()}function Sa(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
15
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ia(t,e){if(t){if(typeof t=="string")return Xe(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xe(t,e)}}function Da(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Ta(t){if(Array.isArray(t))return Xe(t)}function Xe(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Mr(t,e){var r=Oa(e||[]);return e==null&&typeof t!="function"&&r.push(t),h.useMemo(function(){return typeof t=="function"?t():t},r)}function wa(){var t=V();return h.useMemo(function(){return new Wo(t)},[t])}function Ca(t,e){var r=V(),n=h.useMemo(function(){return new ta(r.getBackend())},[r]);return q(function(){return n.dragSourceOptions=t||null,n.reconnect(),function(){return n.disconnectDragSource()}},[n,t]),q(function(){return n.dragPreviewOptions=e||null,n.reconnect(),function(){return n.disconnectDragPreview()}},[n,e]),n}var Ae,Ut;function Ea(){return Ut||(Ut=1,Ae=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var a=o[i];if(!t(e[a],r[a]))return!1}return!0}return e!==e&&r!==r}),Ae}var _a=Ea();const xa=un(_a);function Na(t,e){return Aa(t)||ka(t,e)||Ra(t,e)||Pa()}function Pa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
16
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ra(t,e){if(t){if(typeof t=="string")return zt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zt(t,e)}}function zt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ka(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function Aa(t){if(Array.isArray(t))return t}function jr(t,e,r){var n=h.useState(function(){return e(t)}),i=Na(n,2),o=i[0],a=i[1],s=h.useCallback(function(){var u=e(t);xa(o,u)||(a(u),r&&r())},[o,t,r]);return q(s),[o,s]}function Ma(t,e){return Fa(t)||$a(t,e)||La(t,e)||ja()}function ja(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
17
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function La(t,e){if(t){if(typeof t=="string")return Bt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bt(t,e)}}function Bt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function $a(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function Fa(t){if(Array.isArray(t))return t}function Ha(t,e,r){var n=jr(t,e,r),i=Ma(n,2),o=i[0],a=i[1];return q(function(){var u=t.getHandlerId();if(u!=null)return t.subscribeToStateChange(a,{handlerIds:[u]})},[t,a]),o}function Lr(t,e,r){return Ha(e,t||function(){return{}},function(){return r.reconnect()})}function Ua(t){return h.useMemo(function(){return t.hooks.dragSource()},[t])}function za(t){return h.useMemo(function(){return t.hooks.dragPreview()},[t])}function Ba(t,e){var r=Mr(t,e);I(!r.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var n=wa(),i=Ca(r.options,r.previewOptions);return ba(r,n,i),[Lr(r.collect,n,i),Ua(i),za(i)]}function Wa(t){var e=t.accept;return h.useMemo(function(){return I(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]},[e])}function qa(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Va(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Ga(t,e,r){return e&&Va(t.prototype,e),t}function Wt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ka=(function(){function t(e,r){qa(this,t),Wt(this,"spec",void 0),Wt(this,"monitor",void 0),this.spec=e,this.monitor=r}return Ga(t,[{key:"canDrop",value:function(){var r=this.spec,n=this.monitor;return r.canDrop?r.canDrop(n.getItem(),n):!0}},{key:"hover",value:function(){var r=this.spec,n=this.monitor;r.hover&&r.hover(n.getItem(),n)}},{key:"drop",value:function(){var r=this.spec,n=this.monitor;if(r.drop)return r.drop(n.getItem(),n)}}]),t})();function Ya(t,e){var r=h.useMemo(function(){return new Ka(t,e)},[e]);return h.useEffect(function(){r.spec=t},[t]),r}function Xa(t,e){return es(t)||Za(t,e)||Ja(t,e)||Qa()}function Qa(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
18
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ja(t,e){if(t){if(typeof t=="string")return qt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return qt(t,e)}}function qt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Za(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function es(t){if(Array.isArray(t))return t}function ts(t,e,r){var n=V(),i=Ya(t,e),o=Wa(t);q(function(){var s=aa(o,i,n),u=Xa(s,2),c=u[0],d=u[1];return e.receiveHandlerId(c),r.receiveHandlerId(c),d},[n,e,i,r,o.map(function(a){return a.toString()}).join("|")])}function rs(){var t=V();return h.useMemo(function(){return new Ko(t)},[t])}function ns(t){var e=V(),r=h.useMemo(function(){return new oa(e.getBackend())},[e]);return q(function(){return r.dropTargetOptions=t||null,r.reconnect(),function(){return r.disconnectDropTarget()}},[t]),r}function is(t){return h.useMemo(function(){return t.hooks.dropTarget()},[t])}function $r(t,e){var r=Mr(t,e),n=rs(),i=ns(r.options);return ts(r,n,i),[Lr(r.collect,n,i),is(i)]}function os(t,e){return ls(t)||us(t,e)||ss(t,e)||as()}function as(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
19
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ss(t,e){if(t){if(typeof t=="string")return Vt(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Vt(t,e)}}function Vt(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function us(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n=[],i=!0,o=!1,a,s;try{for(r=r.call(t);!(i=(a=r.next()).done)&&(n.push(a.value),!(e&&n.length===e));i=!0);}catch(u){o=!0,s=u}finally{try{!i&&r.return!=null&&r.return()}finally{if(o)throw s}}return n}}function ls(t){if(Array.isArray(t))return t}function cs(t){var e=V(),r=e.getMonitor(),n=jr(r,t),i=os(n,2),o=i[0],a=i[1];return h.useEffect(function(){return r.subscribeToOffsetChange(a)}),h.useEffect(function(){return r.subscribeToStateChange(a)}),o}function Fr(t){var e=null,r=function(){return e==null&&(e=t()),e};return r}function ds(t,e){return t.filter(function(r){return r!==e})}function fs(t,e){var r=new Set,n=function(a){return r.add(a)};t.forEach(n),e.forEach(n);var i=[];return r.forEach(function(o){return i.push(o)}),i}function hs(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function gs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function ps(t,e,r){return e&&gs(t.prototype,e),t}function Gt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var vs=(function(){function t(e){hs(this,t),Gt(this,"entered",[]),Gt(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return ps(t,[{key:"enter",value:function(r){var n=this,i=this.entered.length,o=function(s){return n.isNodeInDocument(s)&&(!s.contains||s.contains(r))};return this.entered=fs(this.entered.filter(o),[r]),i===0&&this.entered.length>0}},{key:"leave",value:function(r){var n=this.entered.length;return this.entered=ds(this.entered.filter(this.isNodeInDocument),r),n>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t})(),ys=Fr(function(){return/firefox/i.test(navigator.userAgent)}),Hr=Fr(function(){return!!window.safari});function ms(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function bs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Os(t,e,r){return e&&bs(t.prototype,e),t}function ne(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Kt=(function(){function t(e,r){ms(this,t),ne(this,"xs",void 0),ne(this,"ys",void 0),ne(this,"c1s",void 0),ne(this,"c2s",void 0),ne(this,"c3s",void 0);for(var n=e.length,i=[],o=0;o<n;o++)i.push(o);i.sort(function(T,x){return e[T]<e[x]?-1:1});for(var a=[],s=[],u,c,d=0;d<n-1;d++)u=e[d+1]-e[d],c=r[d+1]-r[d],a.push(u),s.push(c/u);for(var p=[s[0]],b=0;b<a.length-1;b++){var m=s[b],S=s[b+1];if(m*S<=0)p.push(0);else{u=a[b];var l=a[b+1],f=u+l;p.push(3*f/((f+l)/m+(f+u)/S))}}p.push(s[s.length-1]);for(var g=[],v=[],O,w=0;w<p.length-1;w++){O=s[w];var D=p[w],E=1/a[w],_=D+p[w+1]-O-O;g.push((O-D-_)*E),v.push(_*E*E)}this.xs=e,this.ys=r,this.c1s=p,this.c2s=g,this.c3s=v}return Os(t,[{key:"interpolate",value:function(r){var n=this.xs,i=this.ys,o=this.c1s,a=this.c2s,s=this.c3s,u=n.length-1;if(r===n[u])return i[u];for(var c=0,d=s.length-1,p;c<=d;){p=Math.floor(.5*(c+d));var b=n[p];if(b<r)c=p+1;else if(b>r)d=p-1;else return i[p]}u=Math.max(0,d);var m=r-n[u],S=m*m;return i[u]+o[u]*m+a[u]*S+s[u]*m*S}}]),t})(),Ss=1;function Ur(t){var e=t.nodeType===Ss?t:t.parentElement;if(!e)return null;var r=e.getBoundingClientRect(),n=r.top,i=r.left;return{x:i,y:n}}function se(t){return{x:t.clientX,y:t.clientY}}function Is(t){var e;return t.nodeName==="IMG"&&(ys()||!((e=document.documentElement)!==null&&e!==void 0&&e.contains(t)))}function Ds(t,e,r,n){var i=t?e.width:r,o=t?e.height:n;return Hr()&&t&&(o/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:o}}function Ts(t,e,r,n,i){var o=Is(e),a=o?t:e,s=Ur(a),u={x:r.x-s.x,y:r.y-s.y},c=t.offsetWidth,d=t.offsetHeight,p=n.anchorX,b=n.anchorY,m=Ds(o,e,c,d),S=m.dragPreviewWidth,l=m.dragPreviewHeight,f=function(){var _=new Kt([0,.5,1],[u.y,u.y/d*l,u.y+l-d]),T=_.interpolate(b);return Hr()&&o&&(T+=(window.devicePixelRatio-1)*l),T},g=function(){var _=new Kt([0,.5,1],[u.x,u.x/c*S,u.x+S-c]);return _.interpolate(p)},v=i.offsetX,O=i.offsetY,w=v===0||v,D=O===0||O;return{x:w?v:g(),y:D?O:f()}}var zr="__NATIVE_FILE__",Br="__NATIVE_URL__",Wr="__NATIVE_TEXT__",qr="__NATIVE_HTML__";const Yt=Object.freeze(Object.defineProperty({__proto__:null,FILE:zr,HTML:qr,TEXT:Wr,URL:Br},Symbol.toStringTag,{value:"Module"}));function Me(t,e,r){var n=e.reduce(function(i,o){return i||t.getData(o)},"");return n??r}var X;function ue(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Qe=(X={},ue(X,zr,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items},dataTransfer:function(e){return e}},matchesTypes:["Files"]}),ue(X,qr,{exposeProperties:{html:function(e,r){return Me(e,r,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),ue(X,Br,{exposeProperties:{urls:function(e,r){return Me(e,r,"").split(`
20
+ `)},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),ue(X,Wr,{exposeProperties:{text:function(e,r){return Me(e,r,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),X);function ws(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Cs(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Es(t,e,r){return e&&Cs(t.prototype,e),t}function Xt(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var _s=(function(){function t(e){ws(this,t),Xt(this,"item",void 0),Xt(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return Es(t,[{key:"initializeExposedProperties",value:function(){var r=this;Object.keys(this.config.exposeProperties).forEach(function(n){Object.defineProperty(r.item,n,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(n,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(r){var n=this;if(r){var i={};Object.keys(this.config.exposeProperties).forEach(function(o){i[o]={value:n.config.exposeProperties[o](r,n.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,i)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(r,n){return n===r.getSourceId()}},{key:"endDrag",value:function(){}}]),t})();function xs(t,e){var r=new _s(Qe[t]);return r.loadDataTransfer(e),r}function je(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(Qe).filter(function(r){var n=Qe[r].matchesTypes;return n.some(function(i){return e.indexOf(i)>-1})})[0]||null}function Ns(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ps(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function Rs(t,e,r){return e&&Ps(t.prototype,e),t}function Le(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var ks=(function(){function t(e,r){Ns(this,t),Le(this,"ownerDocument",null),Le(this,"globalContext",void 0),Le(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=r}return Rs(t,[{key:"window",get:function(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}},{key:"document",get:function(){var r;return(r=this.globalContext)!==null&&r!==void 0&&r.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var r;return((r=this.optionsArgs)===null||r===void 0?void 0:r.rootElement)||this.window}}]),t})();function Qt(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n)}return r}function Jt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qt(Object(r),!0).forEach(function(n){C(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qt(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function As(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ms(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function js(t,e,r){return e&&Ms(t.prototype,e),t}function C(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var Ls=(function(){function t(e,r,n){var i=this;As(this,t),C(this,"options",void 0),C(this,"actions",void 0),C(this,"monitor",void 0),C(this,"registry",void 0),C(this,"enterLeaveCounter",void 0),C(this,"sourcePreviewNodes",new Map),C(this,"sourcePreviewNodeOptions",new Map),C(this,"sourceNodes",new Map),C(this,"sourceNodeOptions",new Map),C(this,"dragStartSourceIds",null),C(this,"dropTargetIds",[]),C(this,"dragEnterTargetIds",[]),C(this,"currentNativeSource",null),C(this,"currentNativeHandle",null),C(this,"currentDragSourceNode",null),C(this,"altKeyPressed",!1),C(this,"mouseMoveTimeoutTimer",null),C(this,"asyncEndDragFrameId",null),C(this,"dragOverTargetIds",null),C(this,"lastClientOffset",null),C(this,"hoverRafId",null),C(this,"getSourceClientOffset",function(o){var a=i.sourceNodes.get(o);return a&&Ur(a)||null}),C(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),C(this,"isNodeInDocument",function(o){return!!(o&&i.document&&i.document.body&&i.document.body.contains(o))}),C(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=i.currentDragSourceNode;o==null||i.isNodeInDocument(o)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),C(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),C(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var a=i.dragStartSourceIds;i.dragStartSourceIds=null;var s=se(o);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:s});var u=o.dataTransfer,c=je(u);if(i.monitor.isDragging()){if(u&&typeof u.setDragImage=="function"){var d=i.monitor.getSourceId(),p=i.sourceNodes.get(d),b=i.sourcePreviewNodes.get(d)||p;if(b){var m=i.getCurrentSourcePreviewNodeOptions(),S=m.anchorX,l=m.anchorY,f=m.offsetX,g=m.offsetY,v={anchorX:S,anchorY:l},O={offsetX:f,offsetY:g},w=Ts(p,b,s,v,O);u.setDragImage(b,w.x,w.y)}}try{u==null||u.setData("application/json",{})}catch{}i.setCurrentDragSourceNode(o.target);var D=i.getCurrentSourcePreviewNodeOptions(),E=D.captureDraggingState;E?i.actions.publishDragSource():setTimeout(function(){return i.actions.publishDragSource()},0)}else if(c)i.beginDragNativeItem(c);else{if(u&&!u.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}}}),C(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),C(this,"handleTopDragEnterCapture",function(o){i.dragEnterTargetIds=[];var a=i.enterLeaveCounter.enter(o.target);if(!(!a||i.monitor.isDragging())){var s=o.dataTransfer,u=je(s);u&&i.beginDragNativeItem(u,s)}}),C(this,"handleTopDragEnter",function(o){var a=i.dragEnterTargetIds;if(i.dragEnterTargetIds=[],!!i.monitor.isDragging()){i.altKeyPressed=o.altKey,a.length>0&&i.actions.hover(a,{clientOffset:se(o)});var s=a.some(function(u){return i.monitor.canDropOnTarget(u)});s&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect()))}}),C(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),C(this,"handleTopDragOver",function(o){var a=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}i.altKeyPressed=o.altKey,i.lastClientOffset=se(o),i.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(i.hoverRafId=requestAnimationFrame(function(){i.monitor.isDragging()&&i.actions.hover(a||[],{clientOffset:i.lastClientOffset}),i.hoverRafId=null}));var s=(a||[]).some(function(u){return i.monitor.canDropOnTarget(u)});s?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),C(this,"handleTopDragLeaveCapture",function(o){i.isDraggingNativeItem()&&o.preventDefault();var a=i.enterLeaveCounter.leave(o.target);a&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),C(this,"handleTopDropCapture",function(o){if(i.dropTargetIds=[],i.isDraggingNativeItem()){var a;o.preventDefault(),(a=i.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)}else je(o.dataTransfer)&&o.preventDefault();i.enterLeaveCounter.reset()}),C(this,"handleTopDrop",function(o){var a=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(a,{clientOffset:se(o)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()}),C(this,"handleSelectStart",function(o){var a=o.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(o.preventDefault(),a.dragDrop()))}),this.options=new ks(r,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new vs(this.isNodeInDocument)}return js(t,[{key:"profile",value:function(){var r,n;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((r=this.dragStartSourceIds)===null||r===void 0?void 0:r.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((n=this.dragOverTargetIds)===null||n===void 0?void 0:n.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var r=this.rootElement;if(r!==void 0){if(r.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");r.__isReactDndBackendSetUp=!0,this.addEventListeners(r)}}},{key:"teardown",value:function(){var r=this.rootElement;if(r!==void 0&&(r.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var n;(n=this.window)===null||n===void 0||n.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(r,n,i){var o=this;return this.sourcePreviewNodeOptions.set(r,i),this.sourcePreviewNodes.set(r,n),function(){o.sourcePreviewNodes.delete(r),o.sourcePreviewNodeOptions.delete(r)}}},{key:"connectDragSource",value:function(r,n,i){var o=this;this.sourceNodes.set(r,n),this.sourceNodeOptions.set(r,i);var a=function(c){return o.handleDragStart(c,r)},s=function(c){return o.handleSelectStart(c)};return n.setAttribute("draggable","true"),n.addEventListener("dragstart",a),n.addEventListener("selectstart",s),function(){o.sourceNodes.delete(r),o.sourceNodeOptions.delete(r),n.removeEventListener("dragstart",a),n.removeEventListener("selectstart",s),n.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(r,n){var i=this,o=function(c){return i.handleDragEnter(c,r)},a=function(c){return i.handleDragOver(c,r)},s=function(c){return i.handleDrop(c,r)};return n.addEventListener("dragenter",o),n.addEventListener("dragover",a),n.addEventListener("drop",s),function(){n.removeEventListener("dragenter",o),n.removeEventListener("dragover",a),n.removeEventListener("drop",s)}}},{key:"addEventListeners",value:function(r){r.addEventListener&&(r.addEventListener("dragstart",this.handleTopDragStart),r.addEventListener("dragstart",this.handleTopDragStartCapture,!0),r.addEventListener("dragend",this.handleTopDragEndCapture,!0),r.addEventListener("dragenter",this.handleTopDragEnter),r.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.addEventListener("dragover",this.handleTopDragOver),r.addEventListener("dragover",this.handleTopDragOverCapture,!0),r.addEventListener("drop",this.handleTopDrop),r.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(r){r.removeEventListener&&(r.removeEventListener("dragstart",this.handleTopDragStart),r.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),r.removeEventListener("dragend",this.handleTopDragEndCapture,!0),r.removeEventListener("dragenter",this.handleTopDragEnter),r.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),r.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),r.removeEventListener("dragover",this.handleTopDragOver),r.removeEventListener("dragover",this.handleTopDragOverCapture,!0),r.removeEventListener("drop",this.handleTopDrop),r.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourceNodeOptions.get(r);return Jt({dropEffect:this.altKeyPressed?"copy":"move"},n||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var r=this.monitor.getSourceId(),n=this.sourcePreviewNodeOptions.get(r);return Jt({anchorX:.5,anchorY:.5,captureDraggingState:!1},n||{})}},{key:"isDraggingNativeItem",value:function(){var r=this.monitor.getItemType();return Object.keys(Yt).some(function(n){return Yt[n]===r})}},{key:"beginDragNativeItem",value:function(r,n){this.clearCurrentDragSourceNode(),this.currentNativeSource=xs(r,n),this.currentNativeHandle=this.registry.addSource(r,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(r){var n=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=r;var i=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=n.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",n.endDragIfSourceWasRemovedFromDOM,!0)},i)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var r;(r=this.window)===null||r===void 0||r.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(r,n){r.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(n))}},{key:"handleDragEnter",value:function(r,n){this.dragEnterTargetIds.unshift(n)}},{key:"handleDragOver",value:function(r,n){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(n)}},{key:"handleDrop",value:function(r,n){this.dropTargetIds.unshift(n)}}]),t})(),le;function $s(){return le||(le=new Image,le.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),le}var Vr=function(e,r,n){return new Ls(e,r,n)};function Fs(t){const e=A(),r=e.selectedIds,[n,i,o]=Ba(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const a=e.isSelected(t.id)?Array.from(r):[t.id];return e.dispatch(ee.dragStart(t.id,a)),{id:t.id,dragIds:a}},end:()=>{e.hideCursor(),e.dispatch(ee.dragEnd())}}),[r,t]);return h.useEffect(()=>{o($s())},[o]),i}function Hs(t,e){const r=t.getBoundingClientRect(),n=e.x-Math.round(r.x),i=e.y-Math.round(r.y),o=r.height,a=i<o/2,s=!a,u=o/4,c=i>u&&i<o-u;return{x:n,inTopHalf:a,inBottomHalf:s,inMiddle:c,atTop:!c&&a,atBottom:!c&&s}}function Us(t,e,r,n){return t?t.isInternal?n.atTop?[e,t]:n.inMiddle?[t,t]:[t,r]:n.inTopHalf?[e,t]:[t,r]:[e,null]}function ce(t,e){return{parentId:t||null,index:e}}function Q(t,e){return{type:"line",index:t,level:e}}function zs(t){return{type:"highlight",id:t}}function $e(t,e){var r;let n=t;for(;n.parent&&n.level>e;)n=n.parent;const i=((r=n.parent)===null||r===void 0?void 0:r.id)||null,o=pr(n)+1;return{parentId:i,index:o}}function Gr(t){var e;const r=Hs(t.element,t.offset),n=t.indent,i=Math.round(Math.max(0,r.x-n)/n),{node:o,nextNode:a,prevNode:s}=t,[u,c]=Us(o,s,a,r);if(o&&o.isInternal&&r.inMiddle)return{drop:ce(o.id,null),cursor:zs(o.id)};if(!u)return{drop:ce((e=c==null?void 0:c.parent)===null||e===void 0?void 0:e.id,0),cursor:Q(0,0)};if(dr(u)){const d=de(i,(c==null?void 0:c.level)||0,u.level);return{drop:$e(u,d),cursor:Q(u.rowIndex+1,d)}}if(fr(u)){const d=de(i,(c==null?void 0:c.level)||0,u.level);return{drop:$e(u,d),cursor:Q(u.rowIndex+1,d)}}if(hr(u)){const d=de(i,0,u.level+1);return d>u.level?{drop:ce(u.id,0),cursor:Q(u.rowIndex+1,d)}:{drop:$e(u,d),cursor:Q(u.rowIndex+1,d)}}return{drop:ce(u==null?void 0:u.id,0),cursor:Q(u.rowIndex+1,u.level+1)}}function Bs(t,e){const r=A(),[n,i]=$r(()=>({accept:"NODE",canDrop:()=>r.canDrop(),hover:(o,a)=>{const s=a.getClientOffset();if(!t.current||!s)return;const{cursor:u,drop:c}=Gr({element:t.current,offset:s,indent:r.indent,node:e,prevNode:e.prev,nextNode:e.next});c&&r.dispatch(ee.hovering(c.parentId,c.index)),a.canDrop()?u&&r.showCursor(u):r.hideCursor()},drop:(o,a)=>{if(!a.canDrop())return null;let{parentId:s,index:u,dragIds:c}=r.state.dnd;Or(r.props.onMove,{dragIds:c,parentId:s===ae?null:s,index:u===null?0:u,dragNodes:r.dragNodes,parentNode:r.get(s)}),r.open(s)}}),[e,t.current,r.props]);return i}function Ws(t){const e=A(),r=e.at(t);if(!r)throw new Error(`Could not find node for index: ${t}`);return h.useMemo(()=>{const n=r.clone();return e.visibleNodes[t]=n,n},[...Object.values(r.state),r])}const qs=or.memo(function({index:e,style:r}){cr(),mn();const n=A(),i=Ws(e),o=h.useRef(null),a=Fs(i),s=Bs(o,i),u=h.useCallback(l=>{o.current=l,s(l)},[s]),c=n.indent*i.level,d=h.useMemo(()=>({paddingLeft:c}),[c]),p=h.useMemo(()=>{var l,f;return Object.assign(Object.assign({},r),{top:parseFloat(r.top)+((f=(l=n.props.padding)!==null&&l!==void 0?l:n.props.paddingTop)!==null&&f!==void 0?f:0)})},[r,n.props.padding,n.props.paddingTop]),b={role:"treeitem","aria-level":i.level+1,"aria-selected":i.isSelected,"aria-expanded":i.isOpen,style:p,tabIndex:-1,className:n.props.rowClassName};h.useEffect(()=>{var l;!i.isEditing&&i.isFocused&&((l=o.current)===null||l===void 0||l.focus({preventScroll:!0}))},[i.isEditing,i.isFocused,o.current]);const m=n.renderNode,S=n.renderRow;return y.jsx(S,{node:i,innerRef:u,attrs:b,children:y.jsx(m,{node:i,tree:n,style:d,dragHandle:a})})});let Fe="",Zt=null;function Kr(){cr();const t=A();return y.jsx("div",{role:"tree",style:{height:t.height,width:t.width,minHeight:0,minWidth:0},onContextMenu:t.props.onContextMenu,onClick:t.props.onClick,tabIndex:0,onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||t.onFocus()},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||t.onBlur()},onKeyDown:e=>{var r;if(t.isEditing)return;if(e.key==="Backspace"){if(!t.props.onDelete)return;const i=Array.from(t.selectedIds);if(i.length>1){let o=t.mostRecentNode;for(;o&&o.isSelected;)o=o.nextSibling;o||(o=t.lastNode),t.focus(o,{scroll:!1}),t.delete(Array.from(i))}else{const o=t.focusedNode;if(o){const a=o.nextSibling,s=o.parent;t.focus(a||s,{scroll:!1}),t.delete(o)}}return}if(e.key==="Tab"&&!e.shiftKey){e.preventDefault(),vr(e.currentTarget);return}if(e.key==="Tab"&&e.shiftKey){e.preventDefault(),yr(e.currentTarget);return}if(e.key==="ArrowDown"){e.preventDefault();const i=t.nextNode;if(e.metaKey){t.select(t.focusedNode),t.activate(t.focusedNode);return}else if(!e.shiftKey||t.props.disableMultiSelection){t.focus(i);return}else{if(!i)return;const o=t.focusedNode;o?o.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.firstNode);return}}if(e.key==="ArrowUp"){e.preventDefault();const i=t.prevNode;if(!e.shiftKey||t.props.disableMultiSelection){t.focus(i);return}else{if(!i)return;const o=t.focusedNode;o?o.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.lastNode);return}}if(e.key==="ArrowRight"){const i=t.focusedNode;if(!i)return;i.isInternal&&i.isOpen?t.focus(t.nextNode):i.isInternal&&t.open(i.id);return}if(e.key==="ArrowLeft"){const i=t.focusedNode;if(!i||i.isRoot)return;i.isInternal&&i.isOpen?t.close(i.id):!((r=i.parent)===null||r===void 0)&&r.isRoot||t.focus(i.parent);return}if(e.key==="a"&&e.metaKey&&!t.props.disableMultiSelection){e.preventDefault(),t.selectAll();return}if(e.key==="a"&&!e.metaKey&&t.props.onCreate){t.createLeaf();return}if(e.key==="A"&&!e.metaKey){if(!t.props.onCreate)return;t.createInternal();return}if(e.key==="Home"){e.preventDefault(),t.focus(t.firstNode);return}if(e.key==="End"){e.preventDefault(),t.focus(t.lastNode);return}if(e.key==="Enter"){const i=t.focusedNode;if(!i||!i.isEditable||!t.props.onRename)return;setTimeout(()=>{i&&t.edit(i)});return}if(e.key===" "){e.preventDefault();const i=t.focusedNode;if(!i)return;i.isLeaf?(i.select(),i.activate()):i.toggle();return}if(e.key==="*"){const i=t.focusedNode;if(!i)return;t.openSiblings(i);return}if(e.key==="PageUp"){e.preventDefault(),t.pageUp();return}e.key==="PageDown"&&(e.preventDefault(),t.pageDown()),clearTimeout(Zt),Fe+=e.key,Zt=setTimeout(()=>{Fe=""},600);const n=t.visibleNodes.find(i=>{const o=i.data.name;return typeof o=="string"?o.toLowerCase().startsWith(Fe):!1});n&&t.focus(n.id)},children:y.jsx(Zn,{className:t.props.className,outerRef:t.listEl,itemCount:t.visibleNodes.length,height:t.height,width:t.width,itemSize:t.rowHeight,overscanCount:t.overscanCount,itemKey:e=>{var r;return((r=t.visibleNodes[e])===null||r===void 0?void 0:r.id)||e},outerElementType:ri,innerElementType:oi,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:qs})})}function er(t){return t.isFiltered?Gs(t.root,t.isMatch.bind(t)):Vs(t.root)}function Vs(t){const e=[];function r(n){var i;n.level>=0&&e.push(n),n.isOpen&&((i=n.children)===null||i===void 0||i.forEach(r))}return r(t),e.forEach(Yr),e}function Gs(t,e){const r={},n=[];function i(a){if(!a.isRoot&&e(a)){r[a.id]=!0;let u=a.parent;for(;u;)r[u.id]=!0,u=u.parent}if(a.children)for(let u of a.children)i(u)}function o(a){var s;a.level>=0&&r[a.id]&&n.push(a),a.isOpen&&((s=a.children)===null||s===void 0||s.forEach(o))}return i(t),o(t),n.forEach(Yr),n}function Yr(t,e){t.rowIndex=e}const tr=t=>t.reduce((e,r,n)=>(e[r.id]=n,e),{});var He=function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(d){try{c(n.next(d))}catch(p){a(p)}}function u(d){try{c(n.throw(d))}catch(p){a(p)}}function c(d){d.done?o(d.value):i(d.value).then(s,u)}c((n=n.apply(t,e||[])).next())})};const{safeRun:P,identify:z,identifyNull:F}=In;class oe{constructor(e,r,n,i){this.store=e,this.props=r,this.list=n,this.listEl=i,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=ct(this),this.visibleNodes=er(this),this.idToIndex=tr(this.visibleNodes)}update(e){this.props=e,this.root=ct(this),this.visibleNodes=er(this),this.idToIndex=tr(this.visibleNodes)}dispatch(e){return this.store.dispatch(e)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var e;return(e=this.props.width)!==null&&e!==void 0?e:300}get height(){var e;return(e=this.props.height)!==null&&e!==void 0?e:500}get indent(){var e;return(e=this.props.indent)!==null&&e!==void 0?e:24}get rowHeight(){var e;return(e=this.props.rowHeight)!==null&&e!==void 0?e:24}get overscanCount(){var e;return(e=this.props.overscanCount)!==null&&e!==void 0?e:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var e;const r=(e=this.props.searchMatch)!==null&&e!==void 0?e:((n,i)=>JSON.stringify(Object.values(n.data)).toLocaleLowerCase().includes(i.toLocaleLowerCase()));return n=>r(n,this.searchTerm)}accessChildren(e){var r;const n=this.props.childrenAccessor||"children";return(r=ie(e,n))!==null&&r!==void 0?r:null}accessId(e){const r=this.props.idAccessor||"id",n=ie(e,r);if(!n)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return n}get firstNode(){var e;return(e=this.visibleNodes[0])!==null&&e!==void 0?e:null}get lastNode(){var e;return(e=this.visibleNodes[this.visibleNodes.length-1])!==null&&e!==void 0?e:null}get focusedNode(){var e;return(e=this.get(this.state.nodes.focus.id))!==null&&e!==void 0?e:null}get mostRecentNode(){var e;return(e=this.get(this.state.nodes.selection.mostRecent))!==null&&e!==void 0?e:null}get nextNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e+1)}get prevNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e-1)}get(e){return e&&e in this.idToIndex&&this.visibleNodes[this.idToIndex[e]]||null}at(e){return this.visibleNodes[e]||null}nodesBetween(e,r){var n;if(e===null||r===null)return[];const i=(n=this.indexOf(e))!==null&&n!==void 0?n:0,o=this.indexOf(r);if(o===null)return[];const a=Math.min(i,o),s=Math.max(i,o);return this.visibleNodes.slice(a,s+1)}indexOf(e){const r=br(e);return r?this.idToIndex[r]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(){return He(this,arguments,void 0,function*(e={}){var r,n;const i=e.parentId===void 0?Dr(this):e.parentId,o=(r=e.index)!==null&&r!==void 0?r:Ir(this),a=(n=e.type)!==null&&n!==void 0?n:"leaf",s=yield P(this.props.onCreate,{type:a,parentId:i,index:o,parentNode:this.get(i)});s&&(this.focus(s),setTimeout(()=>{this.edit(s).then(()=>{this.select(s),this.activate(s)})}))})}delete(e){return He(this,void 0,void 0,function*(){if(!e)return;const n=(Array.isArray(e)?e:[e]).map(z),i=n.map(o=>this.get(o)).filter(o=>!!o);yield P(this.props.onDelete,{nodes:i,ids:n})})}edit(e){const r=z(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(r),this.dispatch(Ee(r)),new Promise(n=>{oe.editPromise=n})}submit(e,r){return He(this,void 0,void 0,function*(){if(!e)return;const n=z(e);yield P(this.props.onRename,{id:n,name:r,node:this.get(n)}),this.dispatch(Ee(null)),this.resolveEdit({cancelled:!1,value:r}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(Ee(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const r=this.get(F(e));r&&P(this.props.onActivate,r)}resolveEdit(e){const r=oe.editPromise;r&&r(e),oe.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let r of Array.from(this.selectedIds)){const n=this.get(r);n&&e.push(n)}return e}focus(e,r={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(G(z(e))),r.scroll!==!1&&this.scrollTo(e),this.focusedNode&&P(this.props.onFocus,this.focusedNode)))}pageUp(){var e,r;const n=this.visibleStartIndex,o=this.visibleStopIndex-n;let a=(r=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&r!==void 0?r:0;a>n?a=n:a=Math.max(n-o,0),this.focus(this.at(a))}pageDown(){var e,r;const n=this.visibleStartIndex,i=this.visibleStopIndex,o=i-n;let a=(r=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&r!==void 0?r:0;a<i?a=i:a=Math.min(a+o,this.visibleNodes.length-1),this.focus(this.at(a))}select(e,r={}){if(!e)return;const n=r.focus!==!1,i=z(e);n&&this.dispatch(G(i)),this.dispatch($.only(i)),this.dispatch($.anchor(i)),this.dispatch($.mostRecent(i)),this.scrollTo(i,r.align),this.focusedNode&&n&&P(this.props.onFocus,this.focusedNode),P(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const r=z(e);this.dispatch($.remove(r)),P(this.props.onSelect,this.selectedNodes)}selectMulti(e,r={}){const n=this.get(F(e));if(!n)return;const i=r.focus!==!1;i&&this.dispatch(G(n.id)),this.dispatch($.add(n.id)),this.dispatch($.anchor(n.id)),this.dispatch($.mostRecent(n.id)),this.scrollTo(n,r.align),this.focusedNode&&i&&P(this.props.onFocus,this.focusedNode),P(this.props.onSelect,this.selectedNodes)}selectContiguous(e){if(!e)return;const r=z(e),{anchor:n,mostRecent:i}=this.state.nodes.selection;this.dispatch(G(r)),this.dispatch($.remove(this.nodesBetween(n,i))),this.dispatch($.add(this.nodesBetween(n,F(r)))),this.dispatch($.mostRecent(r)),this.scrollTo(r),this.focusedNode&&P(this.props.onFocus,this.focusedNode),P(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),P(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(G((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&P(this.props.onFocus,this.focusedNode),P(this.props.onSelect,this.selectedNodes)}setSelection(e){var r;const n=new Set((r=e.ids)===null||r===void 0?void 0:r.map(z)),i=F(e.anchor),o=F(e.mostRecent);this.dispatch($.set({ids:n,anchor:i,mostRecent:o})),P(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:e}=this.state.dnd;switch(e.type){case"highlight":return e.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(e=>this.get(e)).filter(e=>!!e)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var e;if(this.isFiltered)return!1;const r=(e=this.get(this.state.dnd.parentId))!==null&&e!==void 0?e:this.root,n=this.dragNodes,i=this.props.disableDrop;for(const o of n)if(!o||!r||o.isInternal&&gr(r,o))return!1;return typeof i=="function"?!i({parentNode:r,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof i=="string"?!r.data[i]:typeof i=="boolean"?!i:!0}hideCursor(){this.dispatch(ee.cursor({type:"none"}))}showCursor(e){this.dispatch(ee.cursor(e))}open(e){const r=F(e);r&&(this.isOpen(r)||(this.dispatch(Be.open(r,this.isFiltered)),P(this.props.onToggle,r)))}close(e){const r=F(e);r&&this.isOpen(r)&&(this.dispatch(Be.close(r,this.isFiltered)),P(this.props.onToggle,r))}toggle(e){const r=F(e);if(r)return this.isOpen(r)?this.close(r):this.open(r)}openParents(e){const r=F(e);if(!r)return;const n=Je(this.root,r);let i=n==null?void 0:n.parent;for(;i;)this.open(i.id),i=i.parent}openSiblings(e){const r=e.parent;if(!r)this.toggle(e.id);else if(r.children){const n=e.isOpen;for(let i of r.children)i.isInternal&&(n?this.close(i.id):this.open(i.id));this.scrollTo(this.focusedNode)}}openAll(){ye(this.root,e=>{e.isInternal&&e.open()})}closeAll(){ye(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,r="smart"){if(!e)return;const n=z(e);return this.openParents(n),Sr(()=>n in this.idToIndex).then(()=>{var i;const o=this.idToIndex[n];o!==void 0&&((i=this.list.current)===null||i===void 0||i.scrollToItem(o,r))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var e;return!!(!((e=this.props.searchTerm)===null||e===void 0)&&e.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(e){return e?this.state.nodes.selection.ids.has(e):!1}isOpen(e){var r,n,i;if(!e)return!1;if(e===ae)return!0;const o=(r=this.props.openByDefault)!==null&&r!==void 0?r:!0;return this.isFiltered?(n=this.state.nodes.open.filtered[e])!==null&&n!==void 0?n:!0:(i=this.state.nodes.open.unfiltered[e])!==null&&i!==void 0?i:o}isEditable(e){const r=this.props.disableEdit||(()=>!1);return!ie(e,r)}isDraggable(e){const r=this.props.disableDrag||(()=>!1);return!ie(e,r)}isDragging(e){const r=F(e);return r?this.state.nodes.drag.id===r:!1}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){const r=F(e);if(!r)return!1;const{destinationParentId:n,destinationIndex:i}=this.state.nodes.drag;return r===n&&i===null}onFocus(){const e=this.focusedNode||this.firstNode;e&&this.dispatch(G(e.id))}onBlur(){this.dispatch(Rn())}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Kr}get renderRow(){return this.props.renderRow||En}get renderNode(){return this.props.children||_n}get renderDragPreview(){return this.props.renderDragPreview||Tr}get renderCursor(){return this.props.renderCursor||Cn}}function k(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var Ks=typeof Symbol=="function"&&Symbol.observable||"@@observable",rr=Ks,Ue=()=>Math.random().toString(36).substring(7).split("").join("."),Ys={INIT:`@@redux/INIT${Ue()}`,REPLACE:`@@redux/REPLACE${Ue()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${Ue()}`},Oe=Ys;function Xs(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function Xr(t,e,r){if(typeof t!="function")throw new Error(k(2));if(typeof e=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(k(0));if(typeof e=="function"&&typeof r>"u"&&(r=e,e=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(k(1));return r(Xr)(t,e)}let n=t,i=e,o=new Map,a=o,s=0,u=!1;function c(){a===o&&(a=new Map,o.forEach((f,g)=>{a.set(g,f)}))}function d(){if(u)throw new Error(k(3));return i}function p(f){if(typeof f!="function")throw new Error(k(4));if(u)throw new Error(k(5));let g=!0;c();const v=s++;return a.set(v,f),function(){if(g){if(u)throw new Error(k(6));g=!1,c(),a.delete(v),o=null}}}function b(f){if(!Xs(f))throw new Error(k(7));if(typeof f.type>"u")throw new Error(k(8));if(typeof f.type!="string")throw new Error(k(17));if(u)throw new Error(k(9));try{u=!0,i=n(i,f)}finally{u=!1}return(o=a).forEach(v=>{v()}),f}function m(f){if(typeof f!="function")throw new Error(k(10));n=f,b({type:Oe.REPLACE})}function S(){const f=p;return{subscribe(g){if(typeof g!="object"||g===null)throw new Error(k(11));function v(){const w=g;w.next&&w.next(d())}return v(),{unsubscribe:f(v)}},[rr](){return this}}}return b({type:Oe.INIT}),{dispatch:b,subscribe:p,getState:d,replaceReducer:m,[rr]:S}}function Qs(t){Object.keys(t).forEach(e=>{const r=t[e];if(typeof r(void 0,{type:Oe.INIT})>"u")throw new Error(k(12));if(typeof r(void 0,{type:Oe.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(k(13))})}function nr(t){const e=Object.keys(t),r={};for(let o=0;o<e.length;o++){const a=e[o];typeof t[a]=="function"&&(r[a]=t[a])}const n=Object.keys(r);let i;try{Qs(r)}catch(o){i=o}return function(a={},s){if(i)throw i;let u=!1;const c={};for(let d=0;d<n.length;d++){const p=n[d],b=r[p],m=a[p],S=b(m,s);if(typeof S>"u")throw s&&s.type,new Error(k(14));c[p]=S,u=u||S!==m}return u=u||n.length!==Object.keys(a).length,u?c:a}}function Js(t=Z().nodes.drag,e){switch(e.type){case"DND_DRAG_START":return Object.assign(Object.assign({},t),{id:e.id,selectedIds:e.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},t),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return e.parentId!==t.destinationParentId||e.index!=t.destinationIndex?Object.assign(Object.assign({},t),{destinationParentId:e.parentId,destinationIndex:e.index}):t;default:return t}}const Zs=nr({nodes:nr({focus:kn,edit:Pn,open:An,selection:Mn,drag:Js}),dnd:jn}),eu=Z();function tu({treeProps:t,imperativeHandle:e,children:r}){const n=h.useRef(null),i=h.useRef(null),o=h.useRef(Xr(Zs,Z(t))),a=hn.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>eu),s=h.useMemo(()=>new oe(o.current,t,n,i),[]),u=h.useRef(0);return h.useMemo(()=>{u.current+=1,s.update(t)},[...Object.values(t),a.nodes.open]),h.useImperativeHandle(e,()=>s),h.useEffect(()=>{s.props.selection?s.select(s.props.selection,{focus:!1}):s.deselectAll()},[s.props.selection]),h.useEffect(()=>{s.props.searchTerm||o.current.dispatch(Be.clear(!0))},[s.props.searchTerm]),y.jsx(ar.Provider,{value:s,children:y.jsx(lr.Provider,{value:u.current,children:y.jsx(sr.Provider,{value:a.nodes,children:y.jsx(ur.Provider,{value:a.dnd,children:y.jsx($o,Object.assign({},t.dndManager?{manager:t.dndManager}:{backend:t.dndBackend||Vr,options:{rootElement:s.props.dndRootElement||void 0}},{children:r}))})})})})}function ru(){const t=A(),[,e]=$r(()=>({accept:"NODE",canDrop:(r,n)=>n.isOver({shallow:!0})?t.canDrop():!1,hover:(r,n)=>{if(!n.isOver({shallow:!0}))return;const i=n.getClientOffset();if(!t.listEl.current||!i)return;const{cursor:o,drop:a}=Gr({element:t.listEl.current,offset:i,indent:t.indent,node:null,prevNode:t.visibleNodes[t.visibleNodes.length-1],nextNode:null});a&&t.dispatch(ee.hovering(a.parentId,a.index)),n.canDrop()?o&&t.showCursor(o):t.hideCursor()}}),[t]);e(t.listEl)}function nu(t){return ru(),t.children}function iu(){const e=A().props.renderContainer||Kr;return y.jsx(y.Fragment,{children:y.jsx(e,{})})}function ou(){const t=A(),{offset:e,mouse:r,item:n,isDragging:i}=cs(a=>({offset:a.getSourceClientOffset(),mouse:a.getClientOffset(),item:a.getItem(),isDragging:a.isDragging()})),o=t.props.renderDragPreview||Tr;return y.jsx(o,{offset:e,mouse:r,id:(n==null?void 0:n.id)||null,dragIds:(n==null?void 0:n.dragIds)||[],isDragging:i})}class au{constructor(e){this.root=su(e)}get data(){var e,r;return(r=(e=this.root.children)===null||e===void 0?void 0:e.map(n=>n.data))!==null&&r!==void 0?r:[]}create(e){const r=e.parentId?this.find(e.parentId):this.root;if(!r)return null;r.addChild(e.data,e.index)}move(e){const r=this.find(e.id),n=e.parentId?this.find(e.parentId):this.root;!r||!n||(n.addChild(r.data,e.index),r.drop())}update(e){const r=this.find(e.id);r&&r.update(e.changes)}drop(e){const r=this.find(e.id);r&&r.drop()}find(e,r=this.root){if(!r)return null;if(r.id===e)return r;if(r.children){for(let n of r.children){const i=this.find(e,n);if(i)return i}return null}return null}}function su(t){const e=new Qr({id:"ROOT"},null);return e.children=t.map(r=>ot(r,e)),e}function ot(t,e){const r=new Qr(t,e);return t.children&&(r.children=t.children.map(n=>ot(n,r))),r}class Qr{constructor(e,r){this.data=e,this.parent=r,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,r){var n,i;const o=ot(e,this);this.children=(n=this.children)!==null&&n!==void 0?n:[],this.children.splice(r,0,o),this.data.children=(i=this.data.children)!==null&&i!==void 0?i:[],this.data.children.splice(r,0,e)}removeChild(e){var r,n;(r=this.children)===null||r===void 0||r.splice(e,1),(n=this.data.children)===null||n===void 0||n.splice(e,1)}update(e){if(this.hasParent()){const r=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),r),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let uu=0;function lu(t){const[e,r]=h.useState(t),n=h.useMemo(()=>new au(e),[e]);return[e,{onMove:c=>{for(const d of c.dragIds)n.move({id:d,parentId:c.parentId,index:c.index});r(n.data)},onRename:({name:c,id:d})=>{n.update({id:d,changes:{name:c}}),r(n.data)},onCreate:({parentId:c,index:d,type:p})=>{const b={id:`simple-tree-id-${uu++}`,name:""};return p==="internal"&&(b.children=[]),n.create({parentId:c,index:d,data:b}),r(n.data),b},onDelete:c=>{c.ids.forEach(d=>n.drop({id:d})),r(n.data)}}]}function cu(t){if(t.initialData&&t.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(t.initialData&&(t.onCreate||t.onDelete||t.onMove||t.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
21
+ Use the data prop if you want to provide your own handlers.`);if(t.initialData){const[e,r]=lu(t.initialData);return Object.assign(Object.assign(Object.assign({},t),r),{data:e})}else return t}function du(t,e){const r=cu(t);return y.jsxs(tu,{treeProps:r,imperativeHandle:e,children:[y.jsx(nu,{children:y.jsx(iu,{})}),y.jsx(ou,{})]})}const fu=h.forwardRef(du),ze=Symbol.for("@hachej/boring-workspace/file-tree-dnd-manager");function hu(){const t=globalThis;return t[ze]??(t[ze]=Rr(Vr,typeof window>"u"?void 0:window)),t[ze]}const Jr=new Set,Zr=h.createContext({onContextMenu:void 0,editing:null,pendingPaths:Jr,onSubmitEdit:void 0,onCancelEdit:void 0});function gu({initialValue:t,onSubmit:e,onCancel:r,isDraft:n}){const i=h.useRef(null),o=h.useRef(!1);h.useEffect(()=>{const s=i.current;if(s)if(s.focus(),!n&&t.includes(".")){const u=t.lastIndexOf(".");s.setSelectionRange(0,u)}else s.select()},[t,n]);const a=()=>{var s;if(o.current)return;o.current=!0;const u=((s=i.current)==null?void 0:s.value.trim())??"";!u||u===t?r():e(u)};return y.jsx(fn,{ref:i,type:"text",defaultValue:t,"data-testid":"file-tree-edit-input","aria-label":n?"Name":"Rename",onPointerDown:s=>s.stopPropagation(),onClick:s=>s.stopPropagation(),onKeyDown:s=>{s.stopPropagation(),s.key==="Enter"?(s.preventDefault(),a()):s.key==="Escape"&&(s.preventDefault(),o.current=!0,r())},onBlur:a,className:"h-5 min-w-0 flex-1 rounded-sm border-[color:var(--accent)]/60 px-1 text-[13px] leading-[1.2] focus-visible:ring-[color:var(--accent)]"})}function pu({node:t,style:e,dragHandle:r}){const{onContextMenu:n,editing:i,pendingPaths:o,onSubmitEdit:a,onCancelEdit:s}=h.useContext(Zr),u=t.data,c=u.kind==="dir",d=(i==null?void 0:i.path)===u.path,p=o.has(u.path),b=c?t.isOpen?pn:yn:ln(u.name||"untitled");return y.jsxs("div",{ref:r,style:e,className:J("group relative mx-1 flex items-center gap-1.5 rounded-md px-2 py-0.5 text-[13px] leading-[1.4] cursor-pointer select-none text-foreground","transition-colors duration-150 ease-[cubic-bezier(0.22,1,0.36,1)]",!d&&"hover:bg-foreground/[0.04]",t.isSelected&&!d&&"bg-[oklch(from_var(--accent)_l_c_h/0.10)] text-foreground font-medium",t.willReceiveDrop&&"bg-foreground/5 outline outline-1 outline-border"),onClick:m=>{d||(m.stopPropagation(),c?t.toggle():(t.select(),t.activate()))},onContextMenu:m=>{d||u.isDraft||(m.preventDefault(),m.stopPropagation(),n==null||n(m,u))},children:[c?y.jsx(cn,{className:J("h-3 w-3 shrink-0 text-muted-foreground/70 transition-transform duration-150 ease-[cubic-bezier(0.22,1,0.36,1)]",t.isOpen&&"rotate-90"),strokeWidth:2}):y.jsx("span",{className:"w-3 shrink-0"}),y.jsx(b,{className:J("h-4 w-4 shrink-0",t.isSelected?"text-[color:var(--accent)]":"text-muted-foreground/80"),strokeWidth:1.5}),d?y.jsx(gu,{initialValue:(i==null?void 0:i.initialValue)??u.name??"",isDraft:!!(i!=null&&i.isDraft),onSubmit:m=>a==null?void 0:a(u.path,m),onCancel:()=>s==null?void 0:s()}):y.jsx("span",{className:J("truncate",p&&"text-muted-foreground italic"),children:u.name}),p&&!d&&y.jsx(dn,{"data-testid":"file-tree-pending-spinner","aria-label":"Pending",className:"ml-auto h-3 w-3 shrink-0 animate-spin text-muted-foreground/70",strokeWidth:2})]})}function mu({files:t,selectedPath:e,searchQuery:r,height:n=400,editing:i,revealPath:o,pendingPaths:a,onSelect:s,onExpand:u,onCollapse:c,onContextMenu:d,onSubmitEdit:p,onCancelEdit:b,onRevealHandled:m,onDragDrop:S,className:l}){const f=h.useRef(null);h.useEffect(()=>{if(!(i!=null&&i.isDraft))return;const T=requestAnimationFrame(()=>{var x;(x=f.current)==null||x.scrollTo(i.path)});return()=>cancelAnimationFrame(T)},[i==null?void 0:i.isDraft,i==null?void 0:i.path]),h.useEffect(()=>{if(!o)return;let T=0;const x=requestAnimationFrame(()=>{const N=f.current;if(!N)return;N.openParents(o);const H=N.get(o);H&&(H.isInternal&&H.open(),T=requestAnimationFrame(()=>{var B;(B=f.current)==null||B.scrollTo(o),m==null||m(o)}))});return()=>{cancelAnimationFrame(x),cancelAnimationFrame(T)}},[t,m,o]);const g=h.useMemo(()=>e||void 0,[e]),v=h.useCallback(T=>{T.data.kind==="file"&&(s==null||s(T.data.path))},[s]),O=h.useCallback(T=>{var x;const N=(x=f.current)==null?void 0:x.get(T);N&&(N.isOpen?u==null||u(N.data.path):c==null||c(N.data.path))},[u,c]),w=h.useCallback(T=>{if(!S)return;const x=!T.parentNode||T.parentNode.isRoot,N=x?".":T.parentNode.data.path;if(!(!x&&T.parentNode.data.kind!=="dir"))for(const H of T.dragNodes){const B=H.data.path;if(N===B||N!=="."&&N.startsWith(B+"/"))return;S(B,N)}},[S]),D=h.useCallback(T=>{if(!T.parentNode||T.parentNode.isRoot)return!1;if(T.parentNode.data.kind!=="dir")return!0;for(const x of T.dragNodes)if(T.parentNode.data.path===x.data.path||T.parentNode.data.path.startsWith(x.data.path+"/"))return!0;return!1},[]),E=h.useCallback((T,x)=>T.data.name.toLowerCase().includes(x.toLowerCase()),[]),_=h.useMemo(()=>({onContextMenu:d,editing:i??null,pendingPaths:a??Jr,onSubmitEdit:p,onCancelEdit:b}),[d,i,a,p,b]);return t.length===0?y.jsx("div",{className:J("flex h-full items-center justify-center text-sm text-muted-foreground",l),children:"No files"}):y.jsx(Zr.Provider,{value:_,children:y.jsx("div",{"data-boring-workspace-part":"file-tree",className:J("file-tree",l),children:y.jsx(fu,{ref:f,data:t,idAccessor:"path",childrenAccessor:"children",openByDefault:!1,width:"100%",height:n,rowHeight:26,indent:14,selection:g,searchTerm:r??"",searchMatch:E,onActivate:v,onToggle:O,onMove:w,disableDrop:D,disableEdit:!0,dndManager:hu(),children:pu})})})}export{mu as FileTree};
@@ -1,4 +1,4 @@
1
- import{bM as Ie,aK as Ip,r as Z,bN as wn,j as I,bO as Dp,bP as Lp,aP as Pp,bQ as Bp,bR as Nd,bS as Ad,bl as xi,bT as zp,bU as $p,bV as Fp,bW as Hp,bX as Up,bY as Wp,bZ as Vp}from"./index-1f1360Wi.js";import{r as Kp,s as Od}from"./index-mdYLn1DD.js";import{k as qp,b as Gp}from"./index-Vcq4gwWv.js";/**
1
+ import{bM as Ie,aK as Ip,r as Z,bN as wn,j as I,bO as Dp,bP as Lp,aP as Pp,bQ as Bp,bR as Nd,bS as Ad,bl as xi,bT as zp,bU as $p,bV as Fp,bW as Hp,bX as Up,bY as Wp,bZ as Vp}from"./index-C9S_GD0T.js";import{r as Kp,s as Od}from"./index-CrFvzn5a.js";import{k as qp,b as Gp}from"./index-Vcq4gwWv.js";/**
2
2
  * @license lucide-react v1.8.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.