flexdesk 0.2.0 → 0.3.0

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 (56) hide show
  1. package/css/base.css +1484 -181
  2. package/css/flexdesk.css +1311 -18
  3. package/css/overrides.css +44 -0
  4. package/css/tokens.css +45 -0
  5. package/dist/charts.js +5 -3
  6. package/dist/charts.js.map +1 -1
  7. package/dist/{chunk-DVU44T77.js → chunk-ELXVW542.js} +196 -75
  8. package/dist/chunk-ELXVW542.js.map +7 -0
  9. package/dist/chunk-LH5TSOZW.js +1237 -0
  10. package/dist/chunk-LH5TSOZW.js.map +7 -0
  11. package/dist/{chunk-TLZUUFOE.js → chunk-O5OHMWBB.js} +10 -2
  12. package/dist/chunk-O5OHMWBB.js.map +7 -0
  13. package/dist/{chunk-CT4YXXLP.js → chunk-QIU5S2RU.js} +371 -73
  14. package/dist/chunk-QIU5S2RU.js.map +7 -0
  15. package/dist/chunk-QNQHQ24V.js +408 -0
  16. package/dist/chunk-QNQHQ24V.js.map +7 -0
  17. package/dist/{chunk-DRYCDMEG.js → chunk-XKDTIT4Q.js} +168 -12
  18. package/dist/chunk-XKDTIT4Q.js.map +7 -0
  19. package/dist/editor.js +3 -380
  20. package/dist/editor.js.map +3 -3
  21. package/dist/flexdesk.css +1311 -18
  22. package/dist/tiles.js +168 -41
  23. package/dist/tiles.js.map +2 -2
  24. package/dist/tokens.css +45 -0
  25. package/dist/widgets.js +44 -14
  26. package/dist/widgets.js.map +2 -2
  27. package/dist/wm.js +2983 -142
  28. package/dist/wm.js.map +4 -4
  29. package/package.json +3 -2
  30. package/src/charts/chart_types.js +167 -0
  31. package/src/charts/plotly_wrapper.js +178 -10
  32. package/src/editor/notebook_tab_bar.js +39 -3
  33. package/src/tiles/tile_base.js +143 -35
  34. package/src/tiles/tile_grid.js +52 -1
  35. package/src/tiling/command_palette.js +71 -18
  36. package/src/tiling/desktops.js +36 -12
  37. package/src/tiling/keymap.js +24 -4
  38. package/src/tiling/shell.js +135 -24
  39. package/src/tiling/tab_strip.js +184 -0
  40. package/src/tiling/tile_breadcrumb.js +34 -2
  41. package/src/tiling/tile_renderer.js +1386 -21
  42. package/src/tiling/tile_tab_menu.js +101 -0
  43. package/src/tiling/tile_tree.js +82 -0
  44. package/src/tiling/wm.js +2352 -74
  45. package/src/ui/components/action_dropdown.js +34 -3
  46. package/src/ui/components/autocomplete_field.js +65 -13
  47. package/src/ui/components/context_menu.js +79 -8
  48. package/src/ui/components/data_table.js +508 -84
  49. package/src/ui/components/managed_window.js +928 -36
  50. package/src/ui/components/modal.js +214 -8
  51. package/dist/chunk-CT4YXXLP.js.map +0 -7
  52. package/dist/chunk-DRYCDMEG.js.map +0 -7
  53. package/dist/chunk-DVU44T77.js.map +0 -7
  54. package/dist/chunk-TLZUUFOE.js.map +0 -7
  55. package/dist/chunk-UCJ2WD4D.js +0 -625
  56. package/dist/chunk-UCJ2WD4D.js.map +0 -7
@@ -0,0 +1,408 @@
1
+ import {
2
+ DragReorder
3
+ } from "./chunk-WVFGV5FT.js";
4
+
5
+ // src/editor/notebook_tab_bar.js
6
+ var TAB_MIME = "application/x-ecosim-tab";
7
+ var NotebookTabBar = class _NotebookTabBar {
8
+ /** @type {HTMLElement} */
9
+ #container = null;
10
+ /** @type {object[]} [{filePath, label, fileType, isDirty}] */
11
+ #tabs = [];
12
+ /** @type {string|null} */
13
+ #activeTab = null;
14
+ /** @type {object} callbacks */
15
+ #callbacks = {};
16
+ // ─── Context menu ────────────────────────────────────────────────────────
17
+ /** @type {HTMLElement|null} */
18
+ #contextMenuEl = null;
19
+ /** @type {Function|null} */
20
+ #boundHideContextMenu = null;
21
+ // ─── Drag and drop ───────────────────────────────────────────────────────
22
+ /** Same-pane reorder. Cross-pane drops stay in this class's own
23
+ * container handlers (#onStripDrag*).
24
+ * @type {DragReorder|null} */
25
+ #dragReorder = null;
26
+ mount(container, callbacks = {}) {
27
+ this.#container = container;
28
+ this.#callbacks = callbacks;
29
+ this.#container.className = "tabs notebook-tabs";
30
+ this.#boundHideContextMenu = () => this.#hideContextMenu();
31
+ this.#installStripDnDHandlers();
32
+ this.#dragReorder = new DragReorder({
33
+ container: this.#container,
34
+ itemSelector: ".tab",
35
+ keyAttr: "path",
36
+ axis: "x",
37
+ draggableGuard: (e) => {
38
+ if (e.target.closest(".twm-tab-close")) return false;
39
+ const title = e.target.closest(".tab")?.querySelector(".twm-tab-title");
40
+ return title?.getAttribute("contenteditable") !== "true";
41
+ },
42
+ onDragStart: (e, key, item) => {
43
+ try {
44
+ e.dataTransfer.setData(TAB_MIME, key);
45
+ } catch (_) {
46
+ }
47
+ try {
48
+ this.#callbacks.onDragStart?.(e, key, item);
49
+ } catch (err) {
50
+ console.error("[tab-bar] onDragStart threw", err);
51
+ }
52
+ },
53
+ onReorder: (order) => this.#callbacks.onReorder?.(order)
54
+ });
55
+ this.#render();
56
+ }
57
+ /**
58
+ * Sync tabs from ProjectModel state.
59
+ * @param {Array<{ filePath: string, fileType: string, isDirty: boolean }>} tabs
60
+ * @param {string|null} activeFilePath
61
+ */
62
+ update(tabs, activeFilePath) {
63
+ this.#tabs = tabs;
64
+ this.#activeTab = activeFilePath;
65
+ this.#render();
66
+ }
67
+ markDirty(filePath, isDirty) {
68
+ const tab = this.#tabs.find((t) => t.filePath === filePath);
69
+ if (tab) {
70
+ tab.isDirty = isDirty;
71
+ this.#render();
72
+ }
73
+ }
74
+ dispose() {
75
+ this.#hideContextMenu();
76
+ this.#removeStripDnDHandlers();
77
+ this.#dragReorder?.destroy();
78
+ this.#dragReorder = null;
79
+ this.#container = null;
80
+ }
81
+ // Material symbol per file kind, merged over the generic set. The map used to
82
+ // hardcode EcoAgent's kinds — `scenario`, `dashboard`, `model` — so a generic
83
+ // tab bar knew one application's file taxonomy. Pass `fileTypeIcons` to add
84
+ // your own.
85
+ static #FILE_TYPE_ICONS = {
86
+ module: "extension",
87
+ test: "fact_check",
88
+ diff: "difference",
89
+ unknown: "description"
90
+ };
91
+ static #EXTRA_ICONS = {};
92
+ /**
93
+ * Add your application's file kinds to the tab-bar icon map.
94
+ *
95
+ * The map used to hardcode `scenario: 'science'`, `dashboard: 'dashboard'` and
96
+ * `model: 'schema'` — EcoAgent's file taxonomy, baked into a generic tab bar.
97
+ *
98
+ * @param {Object.<string, string>} icons fileType -> material symbol name
99
+ */
100
+ static setFileTypeIcons(icons = {}) {
101
+ _NotebookTabBar.#EXTRA_ICONS = { ...icons };
102
+ }
103
+ static #iconFor(fileType) {
104
+ return _NotebookTabBar.#EXTRA_ICONS[fileType] ?? _NotebookTabBar.#FILE_TYPE_ICONS[fileType] ?? _NotebookTabBar.#FILE_TYPE_ICONS.unknown;
105
+ }
106
+ // ═════════════════════════════════════════════════════════════════════════
107
+ // Rendering
108
+ // ═════════════════════════════════════════════════════════════════════════
109
+ #render() {
110
+ if (!this.#container) return;
111
+ this.#container.innerHTML = "";
112
+ for (const tab of this.#tabs) {
113
+ const isActive = tab.filePath === this.#activeTab;
114
+ const rawPath = tab.filePath.replace(/^(diff|builtin):\/\//, "");
115
+ const label = tab.label ?? (tab.fileType === "diff" ? `\u2194 ${rawPath.split("/").pop()}` : rawPath.split("/").pop().replace(/\.[^.]+$/, ""));
116
+ const icon = _NotebookTabBar.#iconFor(tab.fileType);
117
+ const tabEl = document.createElement("div");
118
+ tabEl.className = `tab${isActive ? " active" : ""}${tab.isPreview ? " tab--preview" : ""}`;
119
+ tabEl.dataset.path = tab.filePath;
120
+ tabEl.title = tab.filePath;
121
+ tabEl.innerHTML = `
122
+ <span class="material-symbols-outlined tab-icon">${icon}</span>
123
+ <span class="twm-tab-title">${this.#escHtml(label)}</span>
124
+ ${tab.isDirty ? '<span class="tab-dirty">\u25CF</span>' : ""}
125
+ ${tab.readonly ? "" : '<button class="twm-tab-close" title="Close tab" aria-label="Close tab">\xD7</button>'}
126
+ `;
127
+ tabEl.addEventListener("click", (e) => {
128
+ if (e.target.closest(".twm-tab-close")) return;
129
+ if (tabEl.querySelector(".twm-tab-title")?.getAttribute("contenteditable") === "true") return;
130
+ this.#callbacks.onActivate?.(tab.filePath);
131
+ });
132
+ tabEl.querySelector(".twm-tab-close")?.addEventListener("click", (e) => {
133
+ e.stopPropagation();
134
+ this.#callbacks.onClose?.(tab.filePath);
135
+ });
136
+ tabEl.addEventListener("dblclick", (e) => {
137
+ if (e.target.closest(".twm-tab-close")) return;
138
+ this.#beginInlineRename(tab.filePath);
139
+ });
140
+ tabEl.addEventListener("keydown", (e) => {
141
+ if (e.key === "F2") {
142
+ e.preventDefault();
143
+ this.#beginInlineRename(tab.filePath);
144
+ }
145
+ });
146
+ tabEl.addEventListener("contextmenu", (e) => {
147
+ e.preventDefault();
148
+ e.stopPropagation();
149
+ this.#showContextMenu(e.clientX, e.clientY, tab.filePath);
150
+ });
151
+ this.#container.appendChild(tabEl);
152
+ }
153
+ this.#dragReorder?.attach();
154
+ }
155
+ // ═════════════════════════════════════════════════════════════════════════
156
+ // Drag and drop reordering (same-pane + cross-pane)
157
+ // ═════════════════════════════════════════════════════════════════════════
158
+ #installStripDnDHandlers() {
159
+ if (!this.#container) return;
160
+ this.#container.addEventListener("dragover", this.#onStripDragOver);
161
+ this.#container.addEventListener("drop", this.#onStripDrop);
162
+ this.#container.addEventListener("dragleave", this.#onStripDragLeave);
163
+ }
164
+ #removeStripDnDHandlers() {
165
+ if (!this.#container) return;
166
+ this.#container.removeEventListener("dragover", this.#onStripDragOver);
167
+ this.#container.removeEventListener("drop", this.#onStripDrop);
168
+ this.#container.removeEventListener("dragleave", this.#onStripDragLeave);
169
+ }
170
+ /** Check whether a drag event carries a cross-pane tab (not from this bar).
171
+ *
172
+ * C33. A HOST MAY NAME A SECOND MIME, at mount, as
173
+ * `callbacks.externalTabMimes` — the tile renderer's tabs are not editor
174
+ * tabs and do not carry `application/x-ecosim-tab`, so without this the
175
+ * strip in tile B would refuse a tab dragged out of tile A's strip. Empty
176
+ * by default, so every existing consumer keeps exactly today's admission
177
+ * test.
178
+ *
179
+ * THE `isActive()` EARLY RETURN STAYS FIRST AND STAYS UNCHANGED. It is the
180
+ * one line that keeps this bar's own reorder from being read as a foreign
181
+ * drop, and no widening of the MIME list may be allowed to reach past it.
182
+ *
183
+ * Only `types` is consulted, never `getData` — under the HTML5 protected
184
+ * mode `getData` returns the empty string for every event except `drop`,
185
+ * so a payload read here would find nothing and arm nothing. */
186
+ #isExternalTabDrag(e) {
187
+ if (this.#dragReorder?.isActive()) return false;
188
+ const extra = Array.isArray(this.#callbacks.externalTabMimes) ? this.#callbacks.externalTabMimes : [];
189
+ try {
190
+ const types = e.dataTransfer.types;
191
+ return types.includes(TAB_MIME) || extra.some((m) => types.includes(m));
192
+ } catch {
193
+ return false;
194
+ }
195
+ }
196
+ // Same-pane reorder is handled by the shared DragReorder module (set
197
+ // up in mount()). These container handlers cover ONLY cross-pane tab
198
+ // drops — gated on `#isExternalTabDrag`, which defers while our own
199
+ // reorder drag is active.
200
+ #onStripDragOver = (e) => {
201
+ if (this.#isExternalTabDrag(e)) {
202
+ e.preventDefault();
203
+ try {
204
+ e.dataTransfer.dropEffect = "move";
205
+ } catch (_) {
206
+ }
207
+ this.#container.classList.add("notebook-tabs--drop-target");
208
+ }
209
+ };
210
+ #onStripDrop = (e) => {
211
+ if (this.#isExternalTabDrag(e)) {
212
+ e.preventDefault();
213
+ this.#container.classList.remove("notebook-tabs--drop-target");
214
+ const filePath = e.dataTransfer.getData(TAB_MIME) || e.dataTransfer.getData("text/plain");
215
+ if (filePath) {
216
+ this.#callbacks.onDropFromOtherPane?.(filePath);
217
+ }
218
+ }
219
+ };
220
+ #onStripDragLeave = (e) => {
221
+ if (!this.#container.contains(e.relatedTarget)) {
222
+ this.#container.classList.remove("notebook-tabs--drop-target");
223
+ }
224
+ };
225
+ // ═════════════════════════════════════════════════════════════════════════
226
+ // Context menu
227
+ // ═════════════════════════════════════════════════════════════════════════
228
+ #showContextMenu(x, y, filePath) {
229
+ this.#hideContextMenu();
230
+ const idx = this.#tabs.findIndex((t) => t.filePath === filePath);
231
+ const total = this.#tabs.length;
232
+ const allItems = [
233
+ { label: "Rename", icon: "edit", action: "rename", shortcut: "F2" },
234
+ { label: "Duplicate", icon: "content_copy", action: "duplicate" },
235
+ { separator: true },
236
+ { label: "Split Right", icon: "vertical_split", action: "split-right", shortcut: "Ctrl+\\" },
237
+ { label: "Move to Other Pane", icon: "swap_horiz", action: "move-to-other" },
238
+ { separator: true },
239
+ { label: "Close", icon: "close", action: "close", danger: true },
240
+ { label: "Close Others", icon: "close_fullscreen", action: "close-others", danger: true, disabled: total <= 1 },
241
+ { label: "Close to the Right", icon: "tab_close", action: "close-right", danger: true, disabled: idx === -1 || idx >= total - 1 },
242
+ { label: "Close All", icon: "tab_close_inactive", action: "close-all", danger: true },
243
+ { label: "Close Saved", icon: "check_circle", action: "close-saved", danger: true },
244
+ { separator: true },
245
+ { label: "Reveal in Explorer", icon: "folder_open", action: "reveal" }
246
+ ];
247
+ const menuFilter = this.#callbacks.menuFilter;
248
+ const items = menuFilter ? allItems.filter((item) => item.separator || menuFilter(item.action, filePath) !== false) : allItems;
249
+ const cleaned = [];
250
+ for (const item of items) {
251
+ if (item.separator) {
252
+ if (cleaned.length > 0 && !cleaned[cleaned.length - 1].separator) cleaned.push(item);
253
+ } else {
254
+ cleaned.push(item);
255
+ }
256
+ }
257
+ while (cleaned.length > 0 && cleaned[cleaned.length - 1].separator) cleaned.pop();
258
+ const menu = document.createElement("div");
259
+ menu.className = "nb-context-menu";
260
+ for (const item of cleaned) {
261
+ if (item.separator) {
262
+ const sep = document.createElement("div");
263
+ sep.className = "nb-context-menu__separator";
264
+ menu.appendChild(sep);
265
+ continue;
266
+ }
267
+ const btn = document.createElement("button");
268
+ btn.className = "nb-context-menu__item";
269
+ if (item.danger) btn.classList.add("nb-context-menu__item--danger");
270
+ if (item.disabled) btn.classList.add("nb-context-menu__item--disabled");
271
+ btn.innerHTML = `<span class="material-symbols-outlined">${item.icon}</span><span>${this.#escHtml(item.label)}</span>${item.shortcut ? `<span class="nb-context-menu__shortcut">${item.shortcut}</span>` : ""}`;
272
+ if (!item.disabled) {
273
+ btn.addEventListener("click", (e) => {
274
+ e.stopPropagation();
275
+ this.#hideContextMenu();
276
+ this.#handleContextMenuAction(item.action, filePath);
277
+ });
278
+ }
279
+ menu.appendChild(btn);
280
+ }
281
+ document.body.appendChild(menu);
282
+ this.#contextMenuEl = menu;
283
+ const rect = menu.getBoundingClientRect();
284
+ const left = Math.min(x, window.innerWidth - rect.width - 8);
285
+ const top = Math.min(y, window.innerHeight - rect.height - 8);
286
+ menu.style.left = `${Math.max(0, left)}px`;
287
+ menu.style.top = `${Math.max(0, top)}px`;
288
+ requestAnimationFrame(() => menu.classList.add("visible"));
289
+ setTimeout(() => {
290
+ document.addEventListener("click", this.#boundHideContextMenu, true);
291
+ document.addEventListener("contextmenu", this.#boundHideContextMenu, true);
292
+ }, 0);
293
+ document.addEventListener("keydown", this.#onKeyDown);
294
+ }
295
+ #hideContextMenu() {
296
+ if (!this.#contextMenuEl) return;
297
+ this.#contextMenuEl.remove();
298
+ this.#contextMenuEl = null;
299
+ document.removeEventListener("click", this.#boundHideContextMenu, true);
300
+ document.removeEventListener("contextmenu", this.#boundHideContextMenu, true);
301
+ document.removeEventListener("keydown", this.#onKeyDown);
302
+ }
303
+ #onKeyDown = (e) => {
304
+ if (e.key === "Escape") this.#hideContextMenu();
305
+ };
306
+ #handleContextMenuAction(action, filePath) {
307
+ switch (action) {
308
+ case "rename":
309
+ this.#beginInlineRename(filePath);
310
+ break;
311
+ case "duplicate":
312
+ this.#callbacks.onDuplicate?.(filePath);
313
+ break;
314
+ case "close":
315
+ this.#callbacks.onClose?.(filePath);
316
+ break;
317
+ case "close-others":
318
+ this.#callbacks.onCloseOthers?.(filePath);
319
+ break;
320
+ case "close-right":
321
+ this.#callbacks.onCloseToRight?.(filePath);
322
+ break;
323
+ case "close-all":
324
+ this.#callbacks.onCloseAll?.();
325
+ break;
326
+ case "close-saved":
327
+ this.#callbacks.onCloseSaved?.();
328
+ break;
329
+ case "split-right":
330
+ this.#callbacks.onSplitRight?.(filePath);
331
+ break;
332
+ case "move-to-other":
333
+ this.#callbacks.onMoveToOtherPane?.(filePath);
334
+ break;
335
+ case "reveal":
336
+ this.#callbacks.onRevealInExplorer?.(filePath);
337
+ break;
338
+ }
339
+ }
340
+ // ═════════════════════════════════════════════════════════════════════════
341
+ // Inline rename (contenteditable on tab title)
342
+ // ═════════════════════════════════════════════════════════════════════════
343
+ #beginInlineRename(filePath) {
344
+ const tabEl = this.#container?.querySelector(`.tab[data-path="${CSS.escape(filePath)}"]`);
345
+ if (!tabEl) return;
346
+ const title = tabEl.querySelector(".twm-tab-title");
347
+ if (!title || title.getAttribute("contenteditable") === "true") return;
348
+ const tab = this.#tabs.find((t) => t.filePath === filePath);
349
+ if (!tab) return;
350
+ if (tab.fileType === "model") return;
351
+ if (filePath.startsWith("builtin://")) return;
352
+ if (tab.readonly) return;
353
+ const original = title.textContent || "";
354
+ title.setAttribute("contenteditable", "true");
355
+ title.focus();
356
+ try {
357
+ const range = document.createRange();
358
+ range.selectNodeContents(title);
359
+ const sel = window.getSelection();
360
+ sel.removeAllRanges();
361
+ sel.addRange(range);
362
+ } catch (_) {
363
+ }
364
+ let committed = false;
365
+ const finish = (commit) => {
366
+ if (committed) return;
367
+ committed = true;
368
+ const newName = (title.textContent || "").trim();
369
+ title.removeAttribute("contenteditable");
370
+ title.removeEventListener("keydown", onKeyDown);
371
+ title.removeEventListener("blur", onBlur, true);
372
+ try {
373
+ window.getSelection()?.removeAllRanges?.();
374
+ } catch (_) {
375
+ }
376
+ if (commit && newName && newName !== original && /^[\w][\w.-]*$/.test(newName)) {
377
+ title.textContent = newName;
378
+ const dir = filePath.split("/").slice(0, -1).join("/");
379
+ const ext = filePath.split(".").pop();
380
+ const newPath = `${dir}/${newName}.${ext}`;
381
+ this.#callbacks.onRename?.(filePath, newPath);
382
+ } else {
383
+ title.textContent = original;
384
+ }
385
+ };
386
+ const onKeyDown = (e) => {
387
+ if (e.key === "Enter") {
388
+ e.preventDefault();
389
+ finish(true);
390
+ } else if (e.key === "Escape") {
391
+ e.preventDefault();
392
+ finish(false);
393
+ }
394
+ e.stopPropagation();
395
+ };
396
+ const onBlur = () => finish(true);
397
+ title.addEventListener("keydown", onKeyDown);
398
+ title.addEventListener("blur", onBlur, true);
399
+ }
400
+ #escHtml(s) {
401
+ return String(s).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
402
+ }
403
+ };
404
+
405
+ export {
406
+ NotebookTabBar
407
+ };
408
+ //# sourceMappingURL=chunk-QNQHQ24V.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../src/editor/notebook_tab_bar.js"],
4
+ "sourcesContent": ["/**\n * NotebookTabBar \u2014 tab strip showing open files, with dirty indicators,\n * close buttons, drag-and-drop reordering, double-click rename, and\n * right-click context menu.\n *\n * Uses the same `.tab` / `.tab-title` / `.tab-dirty` / `.tab-close` DOM structure\n * as the flow-page tab bar, so all editor tab bars share a unified appearance.\n *\n * Calls back into parent via:\n * onActivate(filePath)\n * onClose(filePath)\n * onCloseOthers(filePath)\n * onCloseToRight(filePath)\n * onCloseAll()\n * onCloseSaved()\n * onRename(oldPath, newPath)\n * onDuplicate(filePath)\n * onReorder(orderedPaths)\n * onRevealInExplorer(filePath)\n * onSplitRight(filePath)\n * onMoveToOtherPane(filePath)\n * onDropFromOtherPane(filePath) \u2014 cross-pane drag-and-drop\n */\n\nimport { DragReorder } from '../ui/components/drag_reorder.js';\n\n/** Custom MIME type so tab bars recognise cross-pane drags. */\nconst TAB_MIME = 'application/x-ecosim-tab';\n\nexport class NotebookTabBar {\n /** @type {HTMLElement} */\n #container = null;\n\n /** @type {object[]} [{filePath, label, fileType, isDirty}] */\n #tabs = [];\n\n /** @type {string|null} */\n #activeTab = null;\n\n /** @type {object} callbacks */\n #callbacks = {};\n\n // \u2500\u2500\u2500 Context menu \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n /** @type {HTMLElement|null} */\n #contextMenuEl = null;\n\n /** @type {Function|null} */\n #boundHideContextMenu = null;\n\n // \u2500\u2500\u2500 Drag and drop \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\n /** Same-pane reorder. Cross-pane drops stay in this class's own\n * container handlers (#onStripDrag*).\n * @type {DragReorder|null} */\n #dragReorder = null;\n\n mount(container, callbacks = {}) {\n this.#container = container;\n this.#callbacks = callbacks;\n this.#container.className = 'tabs notebook-tabs';\n this.#boundHideContextMenu = () => this.#hideContextMenu();\n this.#installStripDnDHandlers();\n this.#dragReorder = new DragReorder({\n container: this.#container,\n itemSelector: '.tab',\n keyAttr: 'path',\n axis: 'x',\n draggableGuard: (e) => {\n if (e.target.closest('.twm-tab-close')) return false;\n const title = e.target.closest('.tab')?.querySelector('.twm-tab-title');\n return title?.getAttribute('contenteditable') !== 'true';\n },\n onDragStart: (e, key, item) => {\n // Carry the cross-pane MIME so other panes accept this tab.\n try { e.dataTransfer.setData(TAB_MIME, key); } catch (_) {}\n // C33. \u2026AND LET THE HOST ADD ITS OWN, which is the whole of\n // what a second consumer of this strip needs from it.\n //\n // `DragReorder` publishes this hook for exactly this purpose\n // (\"host hook to augment dataTransfer (e.g. add a cross-pane\n // MIME)\", `../ui/components/drag_reorder.js`), and this class\n // consumed it and stopped there. The tile renderer mounts one\n // of these per tile and needs to mark the drag as one of ITS\n // tabs \u2014 a different question from \"is this an editor tab\",\n // asked of the same gesture.\n //\n // ADDITIVE BY CONSTRUCTION: `TAB_MIME` is set first and\n // unchanged, so `EditorPane`'s existing cross-pane drop cannot\n // notice that anyone else is listening.\n try { this.#callbacks.onDragStart?.(e, key, item); }\n catch (err) { console.error('[tab-bar] onDragStart threw', err); }\n },\n onReorder: (order) => this.#callbacks.onReorder?.(order),\n });\n this.#render();\n }\n\n /**\n * Sync tabs from ProjectModel state.\n * @param {Array<{ filePath: string, fileType: string, isDirty: boolean }>} tabs\n * @param {string|null} activeFilePath\n */\n update(tabs, activeFilePath) {\n this.#tabs = tabs;\n this.#activeTab = activeFilePath;\n this.#render();\n }\n\n markDirty(filePath, isDirty) {\n const tab = this.#tabs.find(t => t.filePath === filePath);\n if (tab) {\n tab.isDirty = isDirty;\n this.#render();\n }\n }\n\n dispose() {\n this.#hideContextMenu();\n this.#removeStripDnDHandlers();\n this.#dragReorder?.destroy();\n this.#dragReorder = null;\n this.#container = null;\n }\n\n // Material symbol per file kind, merged over the generic set. The map used to\n // hardcode EcoAgent's kinds \u2014 `scenario`, `dashboard`, `model` \u2014 so a generic\n // tab bar knew one application's file taxonomy. Pass `fileTypeIcons` to add\n // your own.\n static #FILE_TYPE_ICONS = {\n module: 'extension',\n test: 'fact_check',\n diff: 'difference',\n unknown: 'description',\n };\n\n static #EXTRA_ICONS = {};\n\n /**\n * Add your application's file kinds to the tab-bar icon map.\n *\n * The map used to hardcode `scenario: 'science'`, `dashboard: 'dashboard'` and\n * `model: 'schema'` \u2014 EcoAgent's file taxonomy, baked into a generic tab bar.\n *\n * @param {Object.<string, string>} icons fileType -> material symbol name\n */\n static setFileTypeIcons(icons = {}) {\n NotebookTabBar.#EXTRA_ICONS = { ...icons };\n }\n\n static #iconFor(fileType) {\n return NotebookTabBar.#EXTRA_ICONS[fileType]\n ?? NotebookTabBar.#FILE_TYPE_ICONS[fileType]\n ?? NotebookTabBar.#FILE_TYPE_ICONS.unknown;\n }\n\n // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n // Rendering\n // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n\n #render() {\n if (!this.#container) return;\n\n this.#container.innerHTML = '';\n\n for (const tab of this.#tabs) {\n const isActive = tab.filePath === this.#activeTab;\n const rawPath = tab.filePath.replace(/^(diff|builtin):\\/\\//, '');\n const label = tab.label\n ?? (tab.fileType === 'diff'\n ? `\u2194 ${rawPath.split('/').pop()}`\n : rawPath.split('/').pop().replace(/\\.[^.]+$/, ''));\n const icon = NotebookTabBar.#iconFor(tab.fileType);\n\n const tabEl = document.createElement('div');\n tabEl.className = `tab${isActive ? ' active' : ''}${tab.isPreview ? ' tab--preview' : ''}`;\n tabEl.dataset.path = tab.filePath;\n tabEl.title = tab.filePath;\n\n tabEl.innerHTML = `\n <span class=\"material-symbols-outlined tab-icon\">${icon}</span>\n <span class=\"twm-tab-title\">${this.#escHtml(label)}</span>\n ${tab.isDirty ? '<span class=\"tab-dirty\">\\u25cf</span>' : ''}\n ${tab.readonly ? '' : '<button class=\"twm-tab-close\" title=\"Close tab\" aria-label=\"Close tab\">\\u00d7</button>'}\n `;\n\n // Click \u2192 activate\n tabEl.addEventListener('click', (e) => {\n if (e.target.closest('.twm-tab-close')) return;\n if (tabEl.querySelector('.twm-tab-title')?.getAttribute('contenteditable') === 'true') return;\n this.#callbacks.onActivate?.(tab.filePath);\n });\n\n // Close button\n tabEl.querySelector('.twm-tab-close')?.addEventListener('click', (e) => {\n e.stopPropagation();\n this.#callbacks.onClose?.(tab.filePath);\n });\n\n // Double-click \u2192 inline rename\n tabEl.addEventListener('dblclick', (e) => {\n if (e.target.closest('.twm-tab-close')) return;\n this.#beginInlineRename(tab.filePath);\n });\n\n // F2 \u2192 inline rename\n tabEl.addEventListener('keydown', (e) => {\n if (e.key === 'F2') {\n e.preventDefault();\n this.#beginInlineRename(tab.filePath);\n }\n });\n\n // Context menu\n tabEl.addEventListener('contextmenu', (e) => {\n e.preventDefault();\n e.stopPropagation();\n this.#showContextMenu(e.clientX, e.clientY, tab.filePath);\n });\n\n this.#container.appendChild(tabEl);\n }\n // Make the freshly-rendered tabs draggable-to-reorder.\n this.#dragReorder?.attach();\n }\n\n // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n // Drag and drop reordering (same-pane + cross-pane)\n // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n\n #installStripDnDHandlers() {\n if (!this.#container) return;\n this.#container.addEventListener('dragover', this.#onStripDragOver);\n this.#container.addEventListener('drop', this.#onStripDrop);\n this.#container.addEventListener('dragleave', this.#onStripDragLeave);\n }\n\n #removeStripDnDHandlers() {\n if (!this.#container) return;\n this.#container.removeEventListener('dragover', this.#onStripDragOver);\n this.#container.removeEventListener('drop', this.#onStripDrop);\n this.#container.removeEventListener('dragleave', this.#onStripDragLeave);\n }\n\n /** Check whether a drag event carries a cross-pane tab (not from this bar).\n *\n * C33. A HOST MAY NAME A SECOND MIME, at mount, as\n * `callbacks.externalTabMimes` \u2014 the tile renderer's tabs are not editor\n * tabs and do not carry `application/x-ecosim-tab`, so without this the\n * strip in tile B would refuse a tab dragged out of tile A's strip. Empty\n * by default, so every existing consumer keeps exactly today's admission\n * test.\n *\n * THE `isActive()` EARLY RETURN STAYS FIRST AND STAYS UNCHANGED. It is the\n * one line that keeps this bar's own reorder from being read as a foreign\n * drop, and no widening of the MIME list may be allowed to reach past it.\n *\n * Only `types` is consulted, never `getData` \u2014 under the HTML5 protected\n * mode `getData` returns the empty string for every event except `drop`,\n * so a payload read here would find nothing and arm nothing. */\n #isExternalTabDrag(e) {\n if (this.#dragReorder?.isActive()) return false; // same-pane drag is active\n const extra = Array.isArray(this.#callbacks.externalTabMimes)\n ? this.#callbacks.externalTabMimes : [];\n try {\n const types = e.dataTransfer.types;\n return types.includes(TAB_MIME) || extra.some((m) => types.includes(m));\n } catch { return false; }\n }\n\n // Same-pane reorder is handled by the shared DragReorder module (set\n // up in mount()). These container handlers cover ONLY cross-pane tab\n // drops \u2014 gated on `#isExternalTabDrag`, which defers while our own\n // reorder drag is active.\n\n #onStripDragOver = (e) => {\n if (this.#isExternalTabDrag(e)) {\n e.preventDefault();\n try { e.dataTransfer.dropEffect = 'move'; } catch (_) {}\n this.#container.classList.add('notebook-tabs--drop-target');\n }\n };\n\n #onStripDrop = (e) => {\n if (this.#isExternalTabDrag(e)) {\n e.preventDefault();\n this.#container.classList.remove('notebook-tabs--drop-target');\n const filePath = e.dataTransfer.getData(TAB_MIME) || e.dataTransfer.getData('text/plain');\n if (filePath) {\n this.#callbacks.onDropFromOtherPane?.(filePath);\n }\n }\n };\n\n #onStripDragLeave = (e) => {\n if (!this.#container.contains(e.relatedTarget)) {\n this.#container.classList.remove('notebook-tabs--drop-target');\n }\n };\n\n // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n // Context menu\n // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n\n #showContextMenu(x, y, filePath) {\n this.#hideContextMenu();\n\n const idx = this.#tabs.findIndex(t => t.filePath === filePath);\n const total = this.#tabs.length;\n\n const allItems = [\n { label: 'Rename', icon: 'edit', action: 'rename', shortcut: 'F2' },\n { label: 'Duplicate', icon: 'content_copy', action: 'duplicate' },\n { separator: true },\n { label: 'Split Right', icon: 'vertical_split', action: 'split-right', shortcut: 'Ctrl+\\\\' },\n { label: 'Move to Other Pane',icon: 'swap_horiz', action: 'move-to-other' },\n { separator: true },\n { label: 'Close', icon: 'close', action: 'close', danger: true },\n { label: 'Close Others', icon: 'close_fullscreen', action: 'close-others', danger: true, disabled: total <= 1 },\n { label: 'Close to the Right',icon: 'tab_close', action: 'close-right', danger: true, disabled: idx === -1 || idx >= total - 1 },\n { label: 'Close All', icon: 'tab_close_inactive', action: 'close-all', danger: true },\n { label: 'Close Saved', icon: 'check_circle', action: 'close-saved', danger: true },\n { separator: true },\n { label: 'Reveal in Explorer', icon: 'folder_open', action: 'reveal' },\n ];\n\n const menuFilter = this.#callbacks.menuFilter;\n const items = menuFilter\n ? allItems.filter(item => item.separator || menuFilter(item.action, filePath) !== false)\n : allItems;\n\n // Collapse consecutive / leading / trailing separators\n const cleaned = [];\n for (const item of items) {\n if (item.separator) {\n if (cleaned.length > 0 && !cleaned[cleaned.length - 1].separator) cleaned.push(item);\n } else {\n cleaned.push(item);\n }\n }\n while (cleaned.length > 0 && cleaned[cleaned.length - 1].separator) cleaned.pop();\n\n const menu = document.createElement('div');\n menu.className = 'nb-context-menu';\n\n for (const item of cleaned) {\n if (item.separator) {\n const sep = document.createElement('div');\n sep.className = 'nb-context-menu__separator';\n menu.appendChild(sep);\n continue;\n }\n\n const btn = document.createElement('button');\n btn.className = 'nb-context-menu__item';\n if (item.danger) btn.classList.add('nb-context-menu__item--danger');\n if (item.disabled) btn.classList.add('nb-context-menu__item--disabled');\n\n btn.innerHTML = `<span class=\"material-symbols-outlined\">${item.icon}</span><span>${this.#escHtml(item.label)}</span>${\n item.shortcut ? `<span class=\"nb-context-menu__shortcut\">${item.shortcut}</span>` : ''\n }`;\n\n if (!item.disabled) {\n btn.addEventListener('click', (e) => {\n e.stopPropagation();\n this.#hideContextMenu();\n this.#handleContextMenuAction(item.action, filePath);\n });\n }\n menu.appendChild(btn);\n }\n\n document.body.appendChild(menu);\n this.#contextMenuEl = menu;\n\n // Position with viewport clamping\n const rect = menu.getBoundingClientRect();\n const left = Math.min(x, window.innerWidth - rect.width - 8);\n const top = Math.min(y, window.innerHeight - rect.height - 8);\n menu.style.left = `${Math.max(0, left)}px`;\n menu.style.top = `${Math.max(0, top)}px`;\n\n // Animate in\n requestAnimationFrame(() => menu.classList.add('visible'));\n\n // Dismiss on outside click or Escape\n setTimeout(() => {\n document.addEventListener('click', this.#boundHideContextMenu, true);\n document.addEventListener('contextmenu', this.#boundHideContextMenu, true);\n }, 0);\n document.addEventListener('keydown', this.#onKeyDown);\n }\n\n #hideContextMenu() {\n if (!this.#contextMenuEl) return;\n this.#contextMenuEl.remove();\n this.#contextMenuEl = null;\n document.removeEventListener('click', this.#boundHideContextMenu, true);\n document.removeEventListener('contextmenu', this.#boundHideContextMenu, true);\n document.removeEventListener('keydown', this.#onKeyDown);\n }\n\n #onKeyDown = (e) => {\n if (e.key === 'Escape') this.#hideContextMenu();\n };\n\n #handleContextMenuAction(action, filePath) {\n switch (action) {\n case 'rename': this.#beginInlineRename(filePath); break;\n case 'duplicate': this.#callbacks.onDuplicate?.(filePath); break;\n case 'close': this.#callbacks.onClose?.(filePath); break;\n case 'close-others': this.#callbacks.onCloseOthers?.(filePath); break;\n case 'close-right': this.#callbacks.onCloseToRight?.(filePath); break;\n case 'close-all': this.#callbacks.onCloseAll?.(); break;\n case 'close-saved': this.#callbacks.onCloseSaved?.(); break;\n case 'split-right': this.#callbacks.onSplitRight?.(filePath); break;\n case 'move-to-other':this.#callbacks.onMoveToOtherPane?.(filePath); break;\n case 'reveal': this.#callbacks.onRevealInExplorer?.(filePath); break;\n }\n }\n\n // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n // Inline rename (contenteditable on tab title)\n // \u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\n\n #beginInlineRename(filePath) {\n const tabEl = this.#container?.querySelector(`.tab[data-path=\"${CSS.escape(filePath)}\"]`);\n if (!tabEl) return;\n\n const title = tabEl.querySelector('.twm-tab-title');\n if (!title || title.getAttribute('contenteditable') === 'true') return;\n\n const tab = this.#tabs.find(t => t.filePath === filePath);\n if (!tab) return;\n\n // model.notebook, builtin, and readonly files cannot be renamed\n if (tab.fileType === 'model') return;\n if (filePath.startsWith('builtin://')) return;\n if (tab.readonly) return;\n\n const original = title.textContent || '';\n title.setAttribute('contenteditable', 'true');\n title.focus();\n\n try {\n const range = document.createRange();\n range.selectNodeContents(title);\n const sel = window.getSelection();\n sel.removeAllRanges();\n sel.addRange(range);\n } catch (_) { /* ignore */ }\n\n let committed = false;\n\n const finish = (commit) => {\n if (committed) return;\n committed = true;\n\n const newName = (title.textContent || '').trim();\n title.removeAttribute('contenteditable');\n title.removeEventListener('keydown', onKeyDown);\n title.removeEventListener('blur', onBlur, true);\n\n try { window.getSelection()?.removeAllRanges?.(); } catch (_) { /* ignore */ }\n\n if (commit && newName && newName !== original && /^[\\w][\\w.-]*$/.test(newName)) {\n title.textContent = newName;\n const dir = filePath.split('/').slice(0, -1).join('/');\n const ext = filePath.split('.').pop();\n const newPath = `${dir}/${newName}.${ext}`;\n this.#callbacks.onRename?.(filePath, newPath);\n } else {\n title.textContent = original;\n }\n };\n\n const onKeyDown = (e) => {\n if (e.key === 'Enter') { e.preventDefault(); finish(true); }\n else if (e.key === 'Escape') { e.preventDefault(); finish(false); }\n e.stopPropagation();\n };\n\n const onBlur = () => finish(true);\n\n title.addEventListener('keydown', onKeyDown);\n title.addEventListener('blur', onBlur, true);\n }\n\n #escHtml(s) {\n return String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n }\n}\n"],
5
+ "mappings": ";;;;;AA2BA,IAAM,WAAW;AAEV,IAAM,iBAAN,MAAM,gBAAe;AAAA;AAAA,EAExB,aAAa;AAAA;AAAA,EAGb,QAAQ,CAAC;AAAA;AAAA,EAGT,aAAa;AAAA;AAAA,EAGb,aAAa,CAAC;AAAA;AAAA;AAAA,EAKd,iBAAiB;AAAA;AAAA,EAGjB,wBAAwB;AAAA;AAAA;AAAA;AAAA;AAAA,EAOxB,eAAe;AAAA,EAEf,MAAM,WAAW,YAAY,CAAC,GAAG;AAC7B,SAAK,aAAa;AAClB,SAAK,aAAa;AAClB,SAAK,WAAW,YAAY;AAC5B,SAAK,wBAAwB,MAAM,KAAK,iBAAiB;AACzD,SAAK,yBAAyB;AAC9B,SAAK,eAAe,IAAI,YAAY;AAAA,MAChC,WA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