@xtrable-ltd/nanoesis 0.1.27 → 0.1.28

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 (28) hide show
  1. package/dist/adapter-azure-blob.js +1 -1
  2. package/dist/{chunk-CH4DCPNN.js → chunk-BCWZRKMF.js} +42 -55
  3. package/dist/{chunk-EGQLAHLP.js → chunk-GFQT7BYP.js} +1 -1
  4. package/dist/editor-api.d.ts +23 -11
  5. package/dist/editor-api.js +2 -2
  6. package/dist/index.js +1 -1
  7. package/dist/mcp.js +3 -3
  8. package/editor/assets/{MigrationsPane-eijyEoIw.js → MigrationsPane-CtPr1oUg.js} +1 -1
  9. package/editor/assets/{TemplatesPane-DjFFkccd.js → TemplatesPane-TAfekASM.js} +7 -7
  10. package/editor/assets/{cssMode-BNSyZV7c.js → cssMode-BcU22nqp.js} +1 -1
  11. package/editor/assets/{freemarker2-B8rz05rs.js → freemarker2-B-QbEUNh.js} +1 -1
  12. package/editor/assets/{handlebars-B3M9DD2d.js → handlebars-DV6BwKT-.js} +1 -1
  13. package/editor/assets/{html-BajOMTpc.js → html-BC8FYPjv.js} +1 -1
  14. package/editor/assets/{htmlMode-Cqrnk3KF.js → htmlMode-CuTG0OKP.js} +1 -1
  15. package/editor/assets/index-BGqgRhO7.js +142 -0
  16. package/editor/assets/{javascript-CgKgaKRj.js → javascript-Dkg4BI3B.js} +1 -1
  17. package/editor/assets/{jsonMode-B4i8iNyO.js → jsonMode-GEjr-YmZ.js} +1 -1
  18. package/editor/assets/{liquid-DJaUoyuM.js → liquid-Xm_A7c9U.js} +1 -1
  19. package/editor/assets/{mdx-DBfFAeUj.js → mdx-BVQuw7Zm.js} +1 -1
  20. package/editor/assets/{python-ClvSkGDd.js → python-8sgL70mf.js} +1 -1
  21. package/editor/assets/{razor-BJcU60fL.js → razor-Dc1MxAkI.js} +1 -1
  22. package/editor/assets/{tsMode-8Lhfeq5V.js → tsMode-DHtFLIS4.js} +1 -1
  23. package/editor/assets/{typescript-D3i2tBiq.js → typescript-D88EeJzi.js} +1 -1
  24. package/editor/assets/{xml-CXwucYqL.js → xml-CBE14H0l.js} +1 -1
  25. package/editor/assets/{yaml-D48SS_IL.js → yaml-OUgHM8CE.js} +1 -1
  26. package/editor/index.html +1 -1
  27. package/package.json +1 -1
  28. package/editor/assets/index-BtwjABtU.js +0 -145
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  contentTypeFor
3
- } from "./chunk-EGQLAHLP.js";
3
+ } from "./chunk-GFQT7BYP.js";
4
4
 
5
5
  // ../../adapters/azure-blob/src/container.ts
6
6
  var InMemoryBlobContainer = class {
@@ -18,7 +18,7 @@ import {
18
18
  renderReferenceMarkdown,
19
19
  validateSite,
20
20
  workingStoreRoundTripDiagnostic
21
- } from "./chunk-EGQLAHLP.js";
21
+ } from "./chunk-GFQT7BYP.js";
22
22
 
23
23
  // ../editor-api/src/scaffold.ts
24
24
  var HOME_HTML = `<!doctype html>
@@ -112,46 +112,6 @@ function json(status, data) {
112
112
  function methodNotAllowed() {
113
113
  return json(405, { ok: false, error: "POST only" });
114
114
  }
115
- var NDJSON = "application/x-ndjson";
116
- function streamingPublish(deps) {
117
- const stream = async function* () {
118
- const encoder = new TextEncoder();
119
- const line = (event) => encoder.encode(`${JSON.stringify(event)}
120
- `);
121
- const queue = [];
122
- let wake;
123
- let settled = false;
124
- let thrown;
125
- const onProgress = (event) => {
126
- queue.push(event);
127
- wake?.();
128
- };
129
- const running = deps.publish({ onProgress }).then(
130
- () => void 0,
131
- (error) => {
132
- thrown = error;
133
- }
134
- ).finally(() => {
135
- settled = true;
136
- wake?.();
137
- });
138
- for (; ; ) {
139
- if (queue.length === 0 && !settled) {
140
- await new Promise((resolve2) => {
141
- wake = resolve2;
142
- });
143
- wake = void 0;
144
- }
145
- while (queue.length > 0) yield line(queue.shift());
146
- if (settled && queue.length === 0) break;
147
- }
148
- await running;
149
- if (thrown !== void 0) {
150
- yield line({ phase: "error", message: thrown instanceof Error ? thrown.message : String(thrown) });
151
- }
152
- };
153
- return { status: 200, headers: { "content-type": NDJSON, "cache-control": "no-store" }, stream };
154
- }
155
115
  function withDefaultHeaders(response) {
156
116
  const headers = { ...response.headers ?? {} };
157
117
  if (headers["cache-control"] === void 0) {
@@ -576,9 +536,18 @@ async function dispatchApi(deps, req) {
576
536
  if (req.method !== "GET") return json(405, { ok: false, error: "GET only" });
577
537
  return json(200, await planPublish(deps.store));
578
538
  }
539
+ case "/api/publish/progress": {
540
+ if (req.method !== "GET") return json(405, { ok: false, error: "GET only" });
541
+ const since = Number.parseInt(get("since"), 10);
542
+ const snapshot = deps.publishProgress?.(Number.isFinite(since) ? since : 0) ?? {
543
+ running: false,
544
+ total: 0,
545
+ events: []
546
+ };
547
+ return json(200, snapshot);
548
+ }
579
549
  case "/api/publish": {
580
550
  if (req.method !== "POST") return methodNotAllowed();
581
- if ((req.getHeader("accept") ?? "").includes(NDJSON)) return streamingPublish(deps);
582
551
  const result = await deps.publish();
583
552
  if (result.ok) {
584
553
  return json(200, {
@@ -969,27 +938,45 @@ function createEditor(config) {
969
938
  const sink = asSink(config.website);
970
939
  const wipeBeforePublish = config.wipeBeforePublish ?? true;
971
940
  const reconcile = config.enumerate === void 0 ? void 0 : async () => working.reconcile([...await config.enumerate()]);
941
+ let progressEvents = [];
942
+ let progressRunning = false;
972
943
  const publish = async (options) => {
973
- const validation = await validateSite(working);
974
- if (validation.ok && wipeBeforePublish && config.website.wipe !== void 0) {
975
- await config.website.wipe();
944
+ progressEvents = [];
945
+ progressRunning = true;
946
+ const record = (event) => {
947
+ progressEvents.push(event);
948
+ options?.onProgress?.(event);
949
+ };
950
+ try {
951
+ const validation = await validateSite(working);
952
+ if (validation.ok && wipeBeforePublish && config.website.wipe !== void 0) {
953
+ await config.website.wipe();
954
+ }
955
+ const dir = config.users === void 0 ? void 0 : authorDirectory(await config.users());
956
+ const prebuild = typeof config.prebuild === "function" ? await config.prebuild() : config.prebuild;
957
+ return await publishSite(working, sink, {
958
+ ...config.images !== void 0 && { imageEncoder: config.images },
959
+ ...config.purge !== void 0 && { purge: config.purge },
960
+ ...config.baseUrl !== void 0 && { baseUrl: config.baseUrl },
961
+ ...dir !== void 0 && { authorDirectory: dir },
962
+ ...prebuild !== void 0 && { prebuild },
963
+ onProgress: record
964
+ });
965
+ } finally {
966
+ progressRunning = false;
976
967
  }
977
- const dir = config.users === void 0 ? void 0 : authorDirectory(await config.users());
978
- const prebuild = typeof config.prebuild === "function" ? await config.prebuild() : config.prebuild;
979
- return publishSite(working, sink, {
980
- ...config.images !== void 0 && { imageEncoder: config.images },
981
- ...config.purge !== void 0 && { purge: config.purge },
982
- ...config.baseUrl !== void 0 && { baseUrl: config.baseUrl },
983
- ...dir !== void 0 && { authorDirectory: dir },
984
- ...prebuild !== void 0 && { prebuild },
985
- ...options?.onProgress !== void 0 && { onProgress: options.onProgress }
986
- });
987
968
  };
969
+ const publishProgress = (since) => ({
970
+ running: progressRunning,
971
+ total: progressEvents.length,
972
+ events: progressEvents.slice(Math.max(0, since))
973
+ });
988
974
  const users = config.users;
989
975
  const deps = {
990
976
  store: working,
991
977
  identity: config.login,
992
978
  publish,
979
+ publishProgress,
993
980
  diagnostics: config.diagnostics ?? buildDefaultDiagnostics(),
994
981
  ...reconcile !== void 0 && { reconcile },
995
982
  ...config.authEndpoints !== void 0 && { authEndpoints: config.authEndpoints },
@@ -2051,7 +2051,7 @@ function urlForItem(contentPath) {
2051
2051
  }
2052
2052
 
2053
2053
  // ../engine/src/compile/site.ts
2054
- var DEFAULT_IMAGE_CONCURRENCY = 16;
2054
+ var DEFAULT_IMAGE_CONCURRENCY = 4;
2055
2055
  async function planPages(tree, source, components) {
2056
2056
  const templateCache = /* @__PURE__ */ new Map();
2057
2057
  const getTemplate = async (name) => {
@@ -1,4 +1,4 @@
1
- import { WorkingStore, IdentityProvider, ProgressReporter, PublishResult, ReconcileResult, AuthEndpoints, UserAdminEndpoints, AuthorOption, DiagnosticRegistry, Storage, ImageEncoder, PurgeService, UserSummary, PreBuildHook, AuthorDirectory, Repair, DiagnosticCheck } from '@nanoesis/engine';
1
+ import { WorkingStore, IdentityProvider, ProgressReporter, PublishResult, PublishProgress, ReconcileResult, AuthEndpoints, UserAdminEndpoints, AuthorOption, DiagnosticRegistry, Storage, ImageEncoder, PurgeService, UserSummary, PreBuildHook, AuthorDirectory, Repair, DiagnosticCheck } from '@nanoesis/engine';
2
2
  export { Storage } from '@nanoesis/engine';
3
3
 
4
4
  /**
@@ -93,13 +93,18 @@ interface ApiResponse {
93
93
  readonly status: number;
94
94
  readonly headers?: Record<string, string>;
95
95
  readonly body?: string | Uint8Array;
96
- /**
97
- * A streaming body (DESIGN §11): when present, the host writes these chunks as they are
98
- * produced instead of `body`, for the publish-progress NDJSON stream. A host that cannot
99
- * stream may buffer the chunks and send them as one body, the client decodes the same
100
- * NDJSON either way. `body` is ignored when `stream` is set.
101
- */
102
- readonly stream?: () => AsyncIterable<Uint8Array>;
96
+ }
97
+ /**
98
+ * A snapshot of the publish progress log from a cursor (DESIGN §11): the events a poller
99
+ * has not seen yet (`events`, those at index `since` onward), the running total so the
100
+ * client can advance its cursor, and whether a publish is still in flight. The editor polls
101
+ * `GET /api/publish/progress` for this and folds the events into its timeline. This is the
102
+ * progress transport for hosts that cannot stream an HTTP response (Azure Consumption).
103
+ */
104
+ interface PublishProgressLog {
105
+ readonly running: boolean;
106
+ readonly total: number;
107
+ readonly events: readonly PublishProgress[];
103
108
  }
104
109
  interface ApiDeps {
105
110
  /** The editor working store (read + write/delete/rename), any {@link WorkingStore}. */
@@ -108,13 +113,20 @@ interface ApiDeps {
108
113
  readonly identity: IdentityProvider;
109
114
  /**
110
115
  * Run the publish pipeline (host binds source/sink/purge). The optional `onProgress`
111
- * callback receives {@link PublishProgress} events as the publish runs, so the streaming
112
- * `/api/publish` route can relay a live timeline; a caller that ignores it (the MCP
113
- * publish tool, tests) gets the same buffered {@link PublishResult}.
116
+ * callback receives {@link PublishProgress} events as the publish runs; a caller that
117
+ * ignores it (the MCP publish tool, tests) still gets the buffered {@link PublishResult}.
114
118
  */
115
119
  readonly publish: (options?: {
116
120
  onProgress?: ProgressReporter;
117
121
  }) => Promise<PublishResult>;
122
+ /**
123
+ * Optional live-progress snapshot for the editor's publish timeline (DESIGN §11). The
124
+ * running publish records its events; `GET /api/publish/progress?since=N` returns the
125
+ * events from cursor `N` plus whether it is still running, so the client polls instead of
126
+ * relying on HTTP streaming (which Azure Consumption does not support). Omitted on a host
127
+ * that does not track progress; the route then reports an idle log.
128
+ */
129
+ readonly publishProgress?: (since: number) => PublishProgressLog;
118
130
  /**
119
131
  * Optional index-reconcile (DESIGN §11d): rebuild the working store's content index
120
132
  * from the keys actually present, recovering files that arrived by a path that
@@ -21,8 +21,8 @@ import {
21
21
  serveEditorAsset,
22
22
  templateSnapshotIntegrityDiagnostic,
23
23
  templateSuffixConflictDiagnostic
24
- } from "./chunk-CH4DCPNN.js";
25
- import "./chunk-EGQLAHLP.js";
24
+ } from "./chunk-BCWZRKMF.js";
25
+ import "./chunk-GFQT7BYP.js";
26
26
  export {
27
27
  FileBrandingStore,
28
28
  InMemoryBrandingStore,
package/dist/index.js CHANGED
@@ -79,7 +79,7 @@ import {
79
79
  versionNumber,
80
80
  wholeValueToken,
81
81
  workingStoreRoundTripDiagnostic
82
- } from "./chunk-EGQLAHLP.js";
82
+ } from "./chunk-GFQT7BYP.js";
83
83
  export {
84
84
  CACHE_IMMUTABLE,
85
85
  CACHE_REVALIDATE,
package/dist/mcp.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  MCP_TOOLS,
4
4
  callMcpTool,
5
5
  readMcpResource
6
- } from "./chunk-CH4DCPNN.js";
7
- import "./chunk-EGQLAHLP.js";
6
+ } from "./chunk-BCWZRKMF.js";
7
+ import "./chunk-GFQT7BYP.js";
8
8
 
9
9
  // ../../hosts/host-mcp/src/http.ts
10
10
  import { WebStandardStreamableHTTPServerTransport } from "@modelcontextprotocol/sdk/server/webStandardStreamableHttp.js";
@@ -56,7 +56,7 @@ function createMcpServer(deps, identity) {
56
56
  }
57
57
 
58
58
  // ../../hosts/host-mcp/src/http.ts
59
- var DEFAULT_VERSION = true ? "0.1.27" : "0.0.0-workspace";
59
+ var DEFAULT_VERSION = true ? "0.1.28" : "0.0.0-workspace";
60
60
  async function handleMcpRequest(deps, request, opts) {
61
61
  const server = createMcpServer(deps, {
62
62
  name: opts?.name ?? "nanoesis",
@@ -1,4 +1,4 @@
1
- import{ai as Ke,aG as F,ag as Te,aa as g,W as w,T as e,h as n,ab as Qe,q as a,Q as z,aH as h,y as j,aC as o,R as _,au as v,r as Ve,J as U,x as Ye,i as ze,aN as Ue,aA as c,aI as J,aw as X,ax as _e,Y as Xe,at as Ze,ac as ea}from"./index-BtwjABtU.js";var aa=_('<p class="placeholder svelte-1lpfi31">Loading preview…</p>'),ta=_('<p class="error svelte-1lpfi31" role="alert"> </p>'),la=_("<option> </option>"),sa=_('<select class="svelte-1lpfi31"></select>'),ra=_('<li class="orphan svelte-1lpfi31"><div class="orphan-head svelte-1lpfi31"><code class="orphan-name svelte-1lpfi31"> </code> <span class="orphan-value svelte-1lpfi31"> </span></div> <div class="orphan-actions svelte-1lpfi31" role="radiogroup"><label class="svelte-1lpfi31"><input type="radio" value="drop"/> Drop</label> <label class="svelte-1lpfi31"><input type="radio" value="keep"/> Keep (unrendered)</label> <label class="svelte-1lpfi31"><input type="radio" value="rename"/> Rename to</label> <!></div></li>'),ia=_(`<section class="resolutions svelte-1lpfi31" aria-label="Orphan field resolutions"><h3 class="svelte-1lpfi31">Orphan fields</h3> <p class="hint svelte-1lpfi31">These fields exist in this item's JSON but the current template doesn't render them.
1
+ import{ai as Ke,aG as F,ag as Te,aa as g,W as w,T as e,h as n,ab as Qe,q as a,Q as z,aH as h,y as j,aC as o,R as _,au as v,r as Ve,J as U,x as Ye,i as ze,aN as Ue,aA as c,aI as J,aw as X,ax as _e,Y as Xe,at as Ze,ac as ea}from"./index-BGqgRhO7.js";var aa=_('<p class="placeholder svelte-1lpfi31">Loading preview…</p>'),ta=_('<p class="error svelte-1lpfi31" role="alert"> </p>'),la=_("<option> </option>"),sa=_('<select class="svelte-1lpfi31"></select>'),ra=_('<li class="orphan svelte-1lpfi31"><div class="orphan-head svelte-1lpfi31"><code class="orphan-name svelte-1lpfi31"> </code> <span class="orphan-value svelte-1lpfi31"> </span></div> <div class="orphan-actions svelte-1lpfi31" role="radiogroup"><label class="svelte-1lpfi31"><input type="radio" value="drop"/> Drop</label> <label class="svelte-1lpfi31"><input type="radio" value="keep"/> Keep (unrendered)</label> <label class="svelte-1lpfi31"><input type="radio" value="rename"/> Rename to</label> <!></div></li>'),ia=_(`<section class="resolutions svelte-1lpfi31" aria-label="Orphan field resolutions"><h3 class="svelte-1lpfi31">Orphan fields</h3> <p class="hint svelte-1lpfi31">These fields exist in this item's JSON but the current template doesn't render them.
2
2
  Pick what to do with each.</p> <ul class="orphans svelte-1lpfi31"></ul></section>`),na=_('<p class="error svelte-1lpfi31" role="alert"> </p>'),oa=_('<div class="diff svelte-1lpfi31"><section class="pane svelte-1lpfi31" aria-label="Previous version (left)"><header class="pane-head svelte-1lpfi31"><!></header> <pre class="source svelte-1lpfi31"> </pre></section> <section class="pane svelte-1lpfi31" aria-label="Current template (right)"><header class="pane-head svelte-1lpfi31"> </header> <pre class="source svelte-1lpfi31"> </pre></section></div> <!> <!> <div class="commit-bar svelte-1lpfi31"><button type="button" class="primary svelte-1lpfi31"> </button></div>',1),va=_('<header class="detail-head svelte-1lpfi31"><button type="button" class="back svelte-1lpfi31">← Back</button> <h2 class="svelte-1lpfi31"> </h2></header> <!>',1),pa=_('<p class="error svelte-1lpfi31" role="alert"> </p>'),ca=_('<p class="placeholder svelte-1lpfi31">Loading…</p>'),fa=_(`<div class="empty svelte-1lpfi31"><h3 class="svelte-1lpfi31">All caught up</h3> <p>Every content item's fields match its bound template. Migrations show up here when a
3
3
  destructive template edit (or a manual hand-edit) leaves an item with orphan fields.</p></div>`),ua=_('<li class="item"><button class="item-row svelte-1lpfi31" type="button"><span class="item-path svelte-1lpfi31"><code> </code></span> <span class="item-summary svelte-1lpfi31"><!> <!> <!></span> <span class="open-icon svelte-1lpfi31">→</span></button></li>'),da=_('<section class="group svelte-1lpfi31"><h3 class="group-title svelte-1lpfi31"><code class="svelte-1lpfi31"> </code> <span class="count svelte-1lpfi31"> </span></h3> <ul class="items svelte-1lpfi31"></ul></section>'),ma=_('<header class="list-head svelte-1lpfi31"><h2>Migrations</h2> <button type="button" class="svelte-1lpfi31"> </button></header> <!>',1),_a=_('<div class="migrations svelte-1lpfi31"><!> <!></div>');function ga(Re,Le){Ke(Le,!0);let M=F(null),u=F(null),Z=F(!1),C=F(null),r=F(Te({})),he=F(Te({})),N=F(!1),W=F(null);g.ensureLoaded();async function Ce(s){v(M,s,!0),v(r,{},!0),v(he,{},!0),v(u,null),v(C,null),v(Z,!0);try{v(u,await ea(s),!0);const f={};for(const l of e(u).orphans){const d=Ee(l.name,e(u).currentTemplateFields);f[l.name]=d?{rename:d}:"keep"}v(r,f,!0)}catch(f){v(C,f instanceof Error?f.message:String(f),!0)}finally{v(Z,!1)}}function ge(){v(M,null),v(u,null),v(C,null)}function Ee(s,f){const l=s.toLowerCase();for(const d of f)if(d.toLowerCase().startsWith(l)||d.toLowerCase().endsWith(l))return d;return null}async function Se(){if(!(e(M)===null||e(u)===null)){v(N,!0),v(W,null);try{const s={drop:Object.entries(e(r)).filter(([,l])=>l==="drop").map(([l])=>l),keep:Object.entries(e(r)).filter(([,l])=>l==="keep").map(([l])=>l),rename:Object.fromEntries(Object.entries(e(r)).filter(([,l])=>typeof l=="object"&&l!==null&&"rename"in l).map(([l,d])=>[l,d.rename])),fill:{...e(he)}},f=await ze(e(M),s);g.refresh().catch(()=>{}),ge()}catch(s){v(W,s instanceof Error?s.message:String(s),!0)}finally{v(N,!1)}}}function Pe(s){return typeof s=="string"?s:JSON.stringify(s)}const qe=Ue(()=>g.list===null?[]:Object.entries(g.list.byTemplate).map(([s,f])=>({template:s,items:[...f].sort((l,d)=>l.path.localeCompare(d.path))})));var be=_a(),xe=a(be);{var Ae=s=>{var f=va(),l=z(f),d=a(l),ee=o(d,2),ae=a(ee),te=o(l,2);{var le=i=>{var m=aa();n(i,m)},se=i=>{var m=ta(),k=a(m);h(()=>c(k,e(C))),n(i,m)},re=i=>{var m=oa(),k=z(m),R=a(k),O=a(R),I=a(O);{var $=p=>{var x=J();h(()=>c(x,`Before — ${e(u).left.template??""}`)),n(p,x)},D=p=>{var x=J("Before — no snapshot available");n(p,x)};w(I,p=>{e(u).left?p($):p(D,-1)})}var ie=o(O,2),ne=a(ie),oe=o(R,2),G=a(oe),E=a(G),b=o(G,2),H=a(b),S=o(k,2);{var K=p=>{var x=ia(),P=o(a(x),4);U(P,21,()=>e(u).orphans,q=>q.name,(q,t)=>{var y=ra(),V=a(y),ye=a(V),We=a(ye),Ie=o(ye,2),$e=a(Ie),we=o(V,2),ke=a(we),fe=a(ke),Fe=o(ke,2),ue=a(Fe),je=o(Fe,2),de=a(je),De=o(je,2);{var Ge=A=>{var T=sa();U(T,20,()=>e(u).currentTemplateFields,B=>B,(B,me)=>{var Y=la(),He=a(Y),Oe={};h(()=>{c(He,me),Oe!==(Oe=me)&&(Y.value=(Y.__value=me)??"")}),n(B,Y)});var Me;Xe(T),h(()=>{Me!==(Me=e(r)[e(t).name].rename)&&(T.value=(T.__value=e(r)[e(t).name].rename)??"",Ze(T,e(r)[e(t).name].rename))}),j("change",T,B=>v(r,{...e(r),[e(t).name]:{rename:B.currentTarget.value}},!0)),n(A,T)};w(De,A=>{typeof e(r)[e(t).name]=="object"&&e(r)[e(t).name]!==null&&"rename"in e(r)[e(t).name]&&A(Ge)})}h(A=>{c(We,e(t).name),c($e,A),X(we,"aria-label",`Resolution for ${e(t).name}`),X(fe,"name",`d-${e(t).name}`),_e(fe,e(r)[e(t).name]==="drop"),X(ue,"name",`d-${e(t).name}`),_e(ue,e(r)[e(t).name]==="keep"),X(de,"name",`d-${e(t).name}`),_e(de,typeof e(r)[e(t).name]=="object"&&e(r)[e(t).name]!==null&&"rename"in e(r)[e(t).name])},[()=>Pe(e(t).value)]),j("change",fe,()=>v(r,{...e(r),[e(t).name]:"drop"},!0)),j("change",ue,()=>v(r,{...e(r),[e(t).name]:"keep"},!0)),j("change",de,()=>v(r,{...e(r),[e(t).name]:{rename:e(u).currentTemplateFields[0]??""}},!0)),n(q,y)}),n(p,x)};w(S,p=>{e(u).orphans.length>0&&p(K)})}var Q=o(S,2);{var ve=p=>{var x=na(),P=a(x);h(()=>c(P,e(W))),n(p,x)};w(Q,p=>{e(W)&&p(ve)})}var pe=o(Q,2),L=a(pe),ce=a(L);h(()=>{var p;c(ne,((p=e(u).left)==null?void 0:p.html)??"(no snapshot covers this item)"),c(E,`After — ${e(u).right.template??""}`),c(H,e(u).right.html),L.disabled=e(N)||e(u).orphans.length===0,c(ce,e(N)?"Migrating…":"Migrate item")}),j("click",L,Se),n(i,m)};w(te,i=>{e(Z)?i(le):e(C)?i(se,1):e(u)&&i(re,2)})}h(()=>c(ae,e(M))),j("click",d,ge),n(s,f)},Be=s=>{var f=ma(),l=z(f),d=o(a(l),2),ee=a(d),ae=o(l,2);{var te=i=>{var m=pa(),k=a(m);h(()=>c(k,g.error)),n(i,m)},le=i=>{var m=ca();n(i,m)},se=i=>{var m=fa();n(i,m)},re=i=>{var m=Ve(),k=z(m);U(k,17,()=>e(qe),R=>R.template,(R,O)=>{var I=da(),$=a(I),D=a($),ie=a(D),ne=o(D,2),oe=a(ne),G=o($,2);U(G,21,()=>e(O).items,E=>E.path,(E,b)=>{var H=ua(),S=a(H),K=a(S),Q=a(K),ve=a(Q),pe=o(K,2),L=a(pe);{var ce=t=>{var y=J();h(V=>c(y,`${e(b).orphanFields.length??""} orphan field${e(b).orphanFields.length===1?"":"s"}:
4
4
  ${V??""}`),[()=>e(b).orphanFields.join(", ")]),n(t,y)};w(L,t=>{e(b).orphanFields.length>0&&t(ce)})}var p=o(L,2);{var x=t=>{var y=J();h(()=>c(y,`· ${e(b).missingRequiredFields.length??""} missing required`)),n(t,y)};w(p,t=>{e(b).missingRequiredFields.length>0&&t(x)})}var P=o(p,2);{var q=t=>{var y=J();h(()=>c(y,`· best-fit: ${e(b).bestFitSnapshot??""}`)),n(t,y)};w(P,t=>{e(b).bestFitSnapshot&&t(q)})}h(()=>c(ve,e(b).path)),j("click",S,()=>Ce(e(b).path)),n(E,H)}),h(()=>{c(ie,e(O).template),c(oe,`${e(O).items.length??""} item${e(O).items.length===1?"":"s"}`)}),n(R,I)}),n(i,m)};w(ae,i=>{g.error?i(te):g.loading&&g.list===null?i(le,1):g.count===0?i(se,2):i(re,-1)})}h(()=>{d.disabled=g.loading,c(ee,g.loading?"Refreshing…":"Refresh")}),j("click",d,()=>g.refresh()),n(s,f)};w(xe,s=>{e(M)!==null?s(Ae):s(Be,-1)})}var Je=o(xe,2);{var Ne=s=>{};w(Je,s=>{!e(M)&&g.list===null&&s(Ne)})}n(Re,be),Qe()}Ye(["click","change"]);export{ga as default};