@dickpy/dsh-imagegen 1.5.0 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/README.md +11 -8
  2. package/docs/images/ecommerce-mode.png +0 -0
  3. package/docs/images/gallery-workspace.png +0 -0
  4. package/docs/images/image-generation-studio-three-column.png +0 -0
  5. package/docs/images/imagegen-overview.png +0 -0
  6. package/docs/images/plugin-settings.png +0 -0
  7. package/docs/images/prompt-template-library.png +0 -0
  8. package/lib/client.js +824 -449
  9. package/lib/client.js.map +1 -1
  10. package/lib/index.js +496 -80
  11. package/package.json +23 -17
  12. package/src/client/ImageGenPanel.tsx +10 -8
  13. package/src/client/InspirationGallery.tsx +106 -0
  14. package/src/client/SettingsCard.tsx +1 -1
  15. package/src/client/TemplateLibrary.tsx +159 -48
  16. package/src/client/api.ts +41 -8
  17. package/src/client/channels-form.ts +1 -1
  18. package/src/client/conversation-sync.ts +1 -1
  19. package/src/client/image-toolview.tsx +16 -10
  20. package/src/client/index.ts +5 -4
  21. package/src/client/inspiration.module.css +148 -0
  22. package/src/client/locales.ts +34 -8
  23. package/src/client/mount.tsx +1 -1
  24. package/src/client/settings-form.ts +2 -1
  25. package/src/client/settings-scope.ts +9 -5
  26. package/src/client/templates.module.css +95 -0
  27. package/src/index.ts +26 -6
  28. package/src/protocol.ts +81 -7
  29. package/src/routes.ts +128 -12
  30. package/src/settings-compat.ts +60 -0
  31. package/src/template-favorites.ts +108 -0
  32. package/src/templates/canghe-cases.json +11126 -0
  33. package/src/templates-store.ts +179 -68
  34. package/docs/images/image-generation-studio-single.png +0 -0
  35. package/docs/images/image-generation-studio.png +0 -0
  36. package/docs/images/poster-features-16x9.png +0 -0
package/lib/client.js CHANGED
@@ -9,7 +9,7 @@ window.__ModuleLoader__.load({
9
9
  let react_dom = require("react-dom");
10
10
  let _deepseek_ai_dsh_client_ui_primitives = require("@deepseek-ai/dsh-client-ui-primitives");
11
11
  let react_jsx_runtime = require("react/jsx-runtime");
12
- let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
12
+ let _deepseek_ai_dsh_client_store = require("@deepseek-ai/dsh-client-store");
13
13
  //#region src/protocol.ts
14
14
  /** Same-origin route family (loopback-only, mirroring the dsh-ssh fence). */
15
15
  const SETTINGS_API = {
@@ -76,16 +76,43 @@ window.__ModuleLoader__.load({
76
76
  image: "/api/dsh-imagegen/gallery/image"
77
77
  };
78
78
  /**
79
- * Same-origin route family for the bundled prompt-template library
80
- * (awesome-gpt-image-2 mirror). The case list ships inside the package and is
81
- * served by the host; reference images are proxied through the `image` prefix
82
- * route and cached on disk so repeated views never hit the network again.
79
+ * Same-origin route family for the prompt-template libraries. The library is
80
+ * multi-source: every request names a source id from {@link TEMPLATE_SOURCES},
81
+ * each source keeps an independent snapshot/image cache host-side, and
82
+ * reference images are proxied through the source-scoped `image` prefix route
83
+ * (`…/image/<sourceId>/<file>`) and cached on disk so repeated views never hit
84
+ * the network again.
83
85
  */
84
86
  const TEMPLATES_API = {
85
87
  list: "/api/dsh-imagegen/templates/list",
86
88
  refresh: "/api/dsh-imagegen/templates/refresh",
89
+ sample: "/api/dsh-imagegen/templates/sample",
87
90
  image: "/api/dsh-imagegen/templates/image"
88
91
  };
92
+ /** Same-origin route family for the user's saved (favorited) templates. */
93
+ const TEMPLATE_FAVORITES_API = {
94
+ list: "/api/dsh-imagegen/templates/favorites/list",
95
+ add: "/api/dsh-imagegen/templates/favorites/add",
96
+ remove: "/api/dsh-imagegen/templates/favorites/remove"
97
+ };
98
+ /**
99
+ * The template-library source registry. Each entry is fully independent (own
100
+ * upstream JSON, own image pool, own refresh state) and renders as its own
101
+ * tab; adding a source later means appending an entry here plus a host-side
102
+ * fetch definition in templates-store.ts and an optional bundled snapshot.
103
+ */
104
+ const TEMPLATE_SOURCES = [{
105
+ id: "vibeui",
106
+ label: "精选案例库",
107
+ homepage: "https://vibeui.top/",
108
+ description: "awesome-gpt-image-2 精选提示词案例(vibeui.top 镜像)"
109
+ }, {
110
+ id: "canghe",
111
+ label: "沧河案例库",
112
+ homepage: "https://gpt-image2.canghe.ai/",
113
+ description: "GPT-Image2 Prompt Gallery(gpt-image2.canghe.ai,定期更新)"
114
+ }];
115
+ TEMPLATE_SOURCES[0].id;
89
116
  //#endregion
90
117
  //#region src/client/api.ts
91
118
  /**
@@ -245,10 +272,15 @@ window.__ModuleLoader__.load({
245
272
  })
246
273
  }))).entries;
247
274
  }
248
- /** Fetch the prompt-template library (bundled snapshot or refreshed copy). */
249
- async templatesList() {
250
- const body = await readEnvelope(await fetch(TEMPLATES_API.list, { method: "POST" }));
275
+ /** Fetch one template source's list (bundled snapshot or refreshed copy). */
276
+ async templatesList(sourceId) {
277
+ const body = await readEnvelope(await fetch(TEMPLATES_API.list, {
278
+ method: "POST",
279
+ headers: { "content-type": "application/json" },
280
+ body: JSON.stringify({ source: sourceId })
281
+ }));
251
282
  return {
283
+ sourceId: body.sourceId,
252
284
  cases: body.cases,
253
285
  total: body.total,
254
286
  origin: body.origin,
@@ -256,14 +288,50 @@ window.__ModuleLoader__.load({
256
288
  fetchedAt: body.fetchedAt
257
289
  };
258
290
  }
259
- /** Re-download the template library from the upstream mirror (host-side). */
260
- async templatesRefresh() {
261
- const body = await readEnvelope(await fetch(TEMPLATES_API.refresh, { method: "POST" }));
291
+ /** Re-download one template source's list from its upstream mirror (host-side). */
292
+ async templatesRefresh(sourceId) {
293
+ const body = await readEnvelope(await fetch(TEMPLATES_API.refresh, {
294
+ method: "POST",
295
+ headers: { "content-type": "application/json" },
296
+ body: JSON.stringify({ source: sourceId })
297
+ }));
262
298
  return {
299
+ sourceId: body.sourceId,
263
300
  total: body.total,
264
301
  fetchedAt: body.fetchedAt
265
302
  };
266
303
  }
304
+ /** Draw random cases across every source (studio inspiration wall). */
305
+ async templatesSample(count) {
306
+ return (await readEnvelope(await fetch(TEMPLATES_API.sample, {
307
+ method: "POST",
308
+ headers: { "content-type": "application/json" },
309
+ body: JSON.stringify({ count })
310
+ }))).samples;
311
+ }
312
+ /** List the host-persisted template favorites. */
313
+ async favoritesList() {
314
+ return (await readEnvelope(await fetch(TEMPLATE_FAVORITES_API.list, { method: "POST" }))).favorites;
315
+ }
316
+ /** Star one template (the host keeps a full case snapshot). */
317
+ async favoritesAdd(sourceId, item) {
318
+ return (await readEnvelope(await fetch(TEMPLATE_FAVORITES_API.add, {
319
+ method: "POST",
320
+ headers: { "content-type": "application/json" },
321
+ body: JSON.stringify({
322
+ source: sourceId,
323
+ case: item
324
+ })
325
+ }))).favorites;
326
+ }
327
+ /** Unstar one template by its favorites key. */
328
+ async favoritesRemove(key) {
329
+ return (await readEnvelope(await fetch(TEMPLATE_FAVORITES_API.remove, {
330
+ method: "POST",
331
+ headers: { "content-type": "application/json" },
332
+ body: JSON.stringify({ key })
333
+ }))).favorites;
334
+ }
267
335
  };
268
336
  //#endregion
269
337
  //#region src/client/controller.ts
@@ -589,6 +657,7 @@ window.__ModuleLoader__.load({
589
657
  "settings.invalidNumber": "请输入有效数字",
590
658
  "templates.open": "模板库",
591
659
  "templates.title": "提示词模板库",
660
+ "templates.sources": "模板库来源",
592
661
  "templates.meta": "共 {count} 个模板 · {origin}",
593
662
  "templates.origin.bundled": "内置快照",
594
663
  "templates.origin.refreshed": "在线刷新",
@@ -599,21 +668,32 @@ window.__ModuleLoader__.load({
599
668
  "templates.use": "使用此提示词",
600
669
  "templates.copy": "复制提示词",
601
670
  "templates.copied": "已复制",
602
- "templates.refresh": "刷新模板库",
671
+ "templates.refresh": "刷新本库",
603
672
  "templates.refreshing": "刷新中…",
604
673
  "templates.refreshed": "已刷新,共 {count} 个模板",
605
674
  "templates.refreshFailed": "刷新失败:{error}",
675
+ "templates.favorites": "收藏",
676
+ "templates.favoritesHint": "只看已收藏的模板",
677
+ "templates.favoritesEmpty": "还没有收藏,点击模板卡片右上角的星标即可收藏",
678
+ "templates.favoriteAdd": "收藏此模板",
679
+ "templates.favoriteRemove": "取消收藏",
680
+ "templates.favorite": "收藏",
681
+ "templates.unfavorite": "已收藏",
606
682
  "templates.cacheAll": "缓存全部图片",
607
- "templates.cacheAllHint": "通过本机代理把全部参考图缓存到本地磁盘,之后离线也能浏览",
683
+ "templates.cacheAllHint": "通过本机代理把当前模板库的全部参考图缓存到本地磁盘,之后离线也能浏览",
608
684
  "templates.caching": "缓存中 {done}/{total}…",
609
685
  "templates.cached": "图片已全部缓存",
610
686
  "templates.empty": "没有匹配的模板",
611
687
  "templates.loading": "正在加载模板库…",
612
688
  "templates.loadFailed": "模板库加载失败:{error}",
613
689
  "templates.retry": "重试",
614
- "templates.attribution": "模板与图片来自 awesome-gpt-image-2 项目,作者链接见各模板详情",
615
- "templates.source": "来源:vibeui.top",
690
+ "templates.attribution": "模板与图片来自各来源站点,作者链接见模板详情",
691
+ "templates.source": "来源:{label}",
616
692
  "templates.featured": "精选",
693
+ "inspiration.title": "灵感案例",
694
+ "inspiration.shuffle": "随机",
695
+ "inspiration.shuffling": "换一批…",
696
+ "inspiration.useHint": "点击使用该提示词",
617
697
  "channels.title": "渠道",
618
698
  "channels.hint": "填写各渠道的 API 地址与密钥即可使用对应模型",
619
699
  "channels.empty": "尚无渠道,点击下方按钮添加",
@@ -950,6 +1030,7 @@ window.__ModuleLoader__.load({
950
1030
  "settings.invalidNumber": "Enter a valid number",
951
1031
  "templates.open": "Templates",
952
1032
  "templates.title": "Prompt Template Library",
1033
+ "templates.sources": "Template sources",
953
1034
  "templates.meta": "{count} templates · {origin}",
954
1035
  "templates.origin.bundled": "bundled snapshot",
955
1036
  "templates.origin.refreshed": "refreshed online",
@@ -960,21 +1041,32 @@ window.__ModuleLoader__.load({
960
1041
  "templates.use": "Use this prompt",
961
1042
  "templates.copy": "Copy prompt",
962
1043
  "templates.copied": "Copied",
963
- "templates.refresh": "Refresh library",
1044
+ "templates.refresh": "Refresh this library",
964
1045
  "templates.refreshing": "Refreshing…",
965
1046
  "templates.refreshed": "Refreshed — {count} templates",
966
1047
  "templates.refreshFailed": "Refresh failed: {error}",
1048
+ "templates.favorites": "Favorites",
1049
+ "templates.favoritesHint": "Show favorited templates only",
1050
+ "templates.favoritesEmpty": "No favorites yet — tap the star in a card's top-right corner to save one",
1051
+ "templates.favoriteAdd": "Favorite this template",
1052
+ "templates.favoriteRemove": "Remove from favorites",
1053
+ "templates.favorite": "Favorite",
1054
+ "templates.unfavorite": "Favorited",
967
1055
  "templates.cacheAll": "Cache all images",
968
- "templates.cacheAllHint": "Mirror every reference image to local disk through the host proxy, for offline browsing",
1056
+ "templates.cacheAllHint": "Mirror every reference image of the current library to local disk through the host proxy, for offline browsing",
969
1057
  "templates.caching": "Caching {done}/{total}…",
970
1058
  "templates.cached": "All images cached",
971
1059
  "templates.empty": "No matching templates",
972
1060
  "templates.loading": "Loading the template library…",
973
1061
  "templates.loadFailed": "Failed to load the library: {error}",
974
1062
  "templates.retry": "Retry",
975
- "templates.attribution": "Templates and images come from the awesome-gpt-image-2 project; author links are on each template",
976
- "templates.source": "Source: vibeui.top",
1063
+ "templates.attribution": "Templates and images come from each source site; author links are on each template",
1064
+ "templates.source": "Source: {label}",
977
1065
  "templates.featured": "Featured",
1066
+ "inspiration.title": "Inspiration",
1067
+ "inspiration.shuffle": "Shuffle",
1068
+ "inspiration.shuffling": "Shuffling…",
1069
+ "inspiration.useHint": "Click to use this prompt",
978
1070
  "channels.title": "Channels",
979
1071
  "channels.hint": "Fill in each channel's API URL and key to use its models",
980
1072
  "channels.empty": "No channels yet — add one below",
@@ -1051,73 +1143,84 @@ window.__ModuleLoader__.load({
1051
1143
  }
1052
1144
  //#endregion
1053
1145
  //#region \0dsh-css:E:\dsh-plugin\src\client\templates.module.css.mjs
1054
- const css$3 = ".o0mAxG_overlay,.o0mAxG_overlay *,.o0mAxG_overlay :before,.o0mAxG_overlay :after{box-sizing:border-box}.o0mAxG_overlay{z-index:130;background:var(--dsw-alias-bg-mask-1);color:var(--dsw-alias-label-primary);font-family:var(--dsw-font-family);justify-content:center;align-items:center;padding:28px;display:flex;position:fixed;inset:0}.o0mAxG_shell{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);border-radius:14px;flex-direction:column;width:min(1180px,100%);height:100%;max-height:100%;display:flex;overflow:hidden;box-shadow:0 18px 60px #00000047}.o0mAxG_header{flex:none;justify-content:space-between;align-items:center;gap:12px;padding:14px 18px 10px;display:flex}.o0mAxG_heading{align-items:baseline;gap:10px;min-width:0;display:flex}.o0mAxG_title{margin:0;font-size:15px;font-weight:650}.o0mAxG_meta{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:12px}.o0mAxG_headerActions{flex:none;align-items:center;gap:8px;display:inline-flex}.o0mAxG_close{width:28px;height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:8px;justify-content:center;align-items:center;display:inline-flex}.o0mAxG_close:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.o0mAxG_toolbar{flex-direction:column;flex:none;gap:10px;padding:0 18px 12px;display:flex}.o0mAxG_search{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);width:100%;height:34px;color:var(--dsw-alias-label-primary);border-radius:9px;outline:none;padding:0 12px;font-family:inherit;font-size:13px}.o0mAxG_search:focus{border-color:var(--dsw-alias-brand-primary)}.o0mAxG_search::placeholder{color:var(--dsw-alias-label-dimmed)}.o0mAxG_categoryRow{flex-wrap:wrap;gap:6px;max-height:64px;display:flex;overflow-y:auto}.o0mAxG_categoryPill{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);height:26px;color:var(--dsw-alias-label-secondary);cursor:pointer;white-space:nowrap;border-radius:999px;padding:0 11px;font-family:inherit;font-size:12px}.o0mAxG_categoryPill:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.o0mAxG_categoryPill[data-active]{border-color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-brand-primary);color:var(--dsw-alias-bg-base)}.o0mAxG_notice{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);border-radius:9px;flex:none;margin:0 18px 10px;padding:8px 12px;font-size:12px}.o0mAxG_body{flex:1;min-height:0;padding:2px 18px 14px;overflow-y:auto}.o0mAxG_state{height:100%;min-height:220px;color:var(--dsw-alias-label-tertiary);flex-direction:column;justify-content:center;align-items:center;gap:12px;font-size:13px;display:flex}.o0mAxG_spinner{border:2px solid var(--dsw-alias-border-l2);border-top-color:var(--dsw-alias-brand-primary);border-radius:50%;width:26px;height:26px;animation:.9s linear infinite o0mAxG_dsh-imagegen-templates-spin}@keyframes o0mAxG_dsh-imagegen-templates-spin{to{transform:rotate(360deg)}}.o0mAxG_grid{grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;display:grid}.o0mAxG_card{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);cursor:pointer;text-align:left;color:var(--dsw-alias-label-primary);border-radius:11px;flex-direction:column;gap:0;padding:0;font-family:inherit;transition:border-color .15s,transform .15s;display:flex;overflow:hidden}.o0mAxG_card:hover{border-color:var(--dsw-alias-brand-primary);transform:translateY(-1px)}.o0mAxG_thumbWrap{aspect-ratio:1;background:var(--dsw-alias-bg-layer-2);width:100%;display:block;position:relative}.o0mAxG_thumb{object-fit:cover;width:100%;height:100%;display:block}.o0mAxG_thumbPlaceholder{width:100%;height:100%;color:var(--dsw-alias-label-dimmed);justify-content:center;align-items:center;display:flex}.o0mAxG_featuredBadge{background:var(--dsw-alias-brand-primary);color:var(--dsw-alias-bg-base);border-radius:999px;padding:2px 8px;font-size:11px;font-weight:600;position:absolute;top:8px;left:8px}.o0mAxG_cardBody{flex-direction:column;gap:4px;min-width:0;padding:9px 11px 10px;display:flex}.o0mAxG_cardTitle{-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12.5px;font-weight:600;line-height:1.35;display:-webkit-box;overflow:hidden}.o0mAxG_cardMeta{min-width:0;color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;font-size:11px;display:flex}.o0mAxG_cardCategory{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 7px}.o0mAxG_cardSource{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.o0mAxG_footer{border-top:1px solid var(--dsw-alias-border-l1);flex:none;justify-content:space-between;align-items:center;gap:10px;padding:9px 18px;display:flex}.o0mAxG_attribution{color:var(--dsw-alias-label-dimmed);min-width:0;font-size:11.5px}.o0mAxG_sourceLink{color:var(--dsw-alias-brand-primary);white-space:nowrap;flex:none;font-size:11.5px;font-weight:600;text-decoration:none}.o0mAxG_sourceLink:hover{text-decoration:underline}.o0mAxG_detailOverlay{background:var(--dsw-alias-bg-mask-1);justify-content:center;align-items:center;padding:34px;display:flex;position:absolute;inset:0}.o0mAxG_detail{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);border-radius:14px;grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,5fr) minmax(0,4fr);gap:0;width:min(980px,100%);max-height:100%;display:grid;overflow:hidden;box-shadow:0 18px 60px #00000052}.o0mAxG_detailMedia{background:var(--dsw-alias-bg-layer-2);justify-content:center;align-items:center;min-height:0;display:flex;overflow:hidden}.o0mAxG_detailImage{object-fit:contain;width:100%;height:100%;display:block}.o0mAxG_detailInfo{flex-direction:column;gap:10px;min-height:0;padding:18px;display:flex;overflow-y:auto}.o0mAxG_detailTitle{margin:0;font-size:15px;font-weight:650;line-height:1.4}.o0mAxG_detailMeta{color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;align-items:center;gap:8px;font-size:12px;display:flex}.o0mAxG_detailLink{color:var(--dsw-alias-brand-primary);text-overflow:ellipsis;white-space:nowrap;text-decoration:none;overflow:hidden}.o0mAxG_detailLink:hover{text-decoration:underline}.o0mAxG_detailPrompt{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);min-height:0;color:var(--dsw-alias-label-primary);white-space:pre-wrap;word-break:break-word;user-select:text;border-radius:10px;flex:1;margin:0;padding:12px;font-family:inherit;font-size:12.5px;line-height:1.6;overflow-y:auto}.o0mAxG_detailActions{background:var(--dsw-alias-bg-base);border-top:1px solid var(--dsw-alias-border-l1);flex:none;gap:8px;margin:0 -18px -18px;padding:12px 18px;display:flex;position:sticky;bottom:0}@media (width<=760px){.o0mAxG_detail{grid-template-rows:minmax(0,3fr) minmax(0,4fr);grid-template-columns:1fr}}";
1055
- const tagId$3 = "@dickpy/dsh-imagegen/templates.module.css";
1056
- if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
1146
+ const css$4 = ".o0mAxG_overlay,.o0mAxG_overlay *,.o0mAxG_overlay :before,.o0mAxG_overlay :after{box-sizing:border-box}.o0mAxG_overlay{z-index:130;background:var(--dsw-alias-bg-mask-1);color:var(--dsw-alias-label-primary);font-family:var(--dsw-font-family);justify-content:center;align-items:center;padding:28px;display:flex;position:fixed;inset:0}.o0mAxG_shell{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);border-radius:14px;flex-direction:column;width:min(1180px,100%);height:100%;max-height:100%;display:flex;overflow:hidden;box-shadow:0 18px 60px #00000047}.o0mAxG_header{flex:none;justify-content:space-between;align-items:center;gap:12px;padding:14px 18px 10px;display:flex}.o0mAxG_heading{align-items:baseline;gap:10px;min-width:0;display:flex}.o0mAxG_title{margin:0;font-size:15px;font-weight:650}.o0mAxG_meta{color:var(--dsw-alias-label-tertiary);white-space:nowrap;font-size:12px}.o0mAxG_headerActions{flex:none;align-items:center;gap:8px;display:inline-flex}.o0mAxG_close{width:28px;height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:8px;justify-content:center;align-items:center;display:inline-flex}.o0mAxG_close:hover{background:var(--dsw-alias-interactive-bg-hover);color:var(--dsw-alias-label-primary)}.o0mAxG_sourceTabs{border-bottom:1px solid var(--dsw-alias-border-l1);flex:none;align-items:center;gap:6px;padding:0 18px 10px;display:flex}.o0mAxG_sourceTab{height:30px;color:var(--dsw-alias-label-secondary);cursor:pointer;white-space:nowrap;background:0 0;border:1px solid #0000;border-bottom:none;border-radius:9px 9px 0 0;align-items:center;gap:6px;padding:0 14px;font-family:inherit;font-size:13px;font-weight:600;display:inline-flex}.o0mAxG_sourceTab:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.o0mAxG_sourceTab[data-active]{border-color:var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-brand-primary);border-radius:9px}.o0mAxG_sourceTabCount{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-tertiary);border-radius:999px;padding:0 6px;font-size:11px;font-weight:500}.o0mAxG_sourceTab[data-active] .o0mAxG_sourceTabCount{color:var(--dsw-alias-label-secondary)}.o0mAxG_toolbar{flex-direction:column;flex:none;gap:10px;padding:0 18px 12px;display:flex}.o0mAxG_search{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);width:100%;height:34px;color:var(--dsw-alias-label-primary);border-radius:9px;outline:none;padding:0 12px;font-family:inherit;font-size:13px}.o0mAxG_search:focus{border-color:var(--dsw-alias-brand-primary)}.o0mAxG_search::placeholder{color:var(--dsw-alias-label-dimmed)}.o0mAxG_categoryRow{flex-wrap:wrap;gap:6px;max-height:64px;display:flex;overflow-y:auto}.o0mAxG_categoryPill{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);height:26px;color:var(--dsw-alias-label-secondary);cursor:pointer;white-space:nowrap;border-radius:999px;padding:0 11px;font-family:inherit;font-size:12px}.o0mAxG_categoryPill:hover{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-interactive-bg-hover)}.o0mAxG_categoryPill[data-active]{border-color:var(--dsw-alias-brand-primary);background:var(--dsw-alias-brand-primary);color:var(--dsw-alias-bg-base)}.o0mAxG_notice{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-secondary);border-radius:9px;flex:none;margin:0 18px 10px;padding:8px 12px;font-size:12px}.o0mAxG_body{flex:1;min-height:0;padding:2px 18px 14px;overflow-y:auto}.o0mAxG_state{height:100%;min-height:220px;color:var(--dsw-alias-label-tertiary);flex-direction:column;justify-content:center;align-items:center;gap:12px;font-size:13px;display:flex}.o0mAxG_spinner{border:2px solid var(--dsw-alias-border-l2);border-top-color:var(--dsw-alias-brand-primary);border-radius:50%;width:26px;height:26px;animation:.9s linear infinite o0mAxG_dsh-imagegen-templates-spin}@keyframes o0mAxG_dsh-imagegen-templates-spin{to{transform:rotate(360deg)}}.o0mAxG_grid{grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:12px;display:grid}.o0mAxG_card{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);cursor:pointer;text-align:left;color:var(--dsw-alias-label-primary);border-radius:11px;flex-direction:column;gap:0;padding:0;font-family:inherit;transition:border-color .15s,transform .15s;display:flex;overflow:hidden}.o0mAxG_card:hover{border-color:var(--dsw-alias-brand-primary);transform:translateY(-1px)}.o0mAxG_thumbWrap{aspect-ratio:1;background:var(--dsw-alias-bg-layer-2);width:100%;display:block;position:relative}.o0mAxG_thumb{object-fit:cover;width:100%;height:100%;display:block}.o0mAxG_thumbPlaceholder{width:100%;height:100%;color:var(--dsw-alias-label-dimmed);justify-content:center;align-items:center;display:flex}.o0mAxG_featuredBadge{background:var(--dsw-alias-brand-primary);color:var(--dsw-alias-bg-base);border-radius:999px;padding:2px 8px;font-size:11px;font-weight:600;position:absolute;top:8px;left:8px}.o0mAxG_favStar{color:#ffffffd9;cursor:pointer;opacity:0;background:#00000059;border:none;border-radius:8px;justify-content:center;align-items:center;width:26px;height:26px;padding:0;transition:opacity .15s;display:inline-flex;position:absolute;top:6px;right:6px}.o0mAxG_card:hover .o0mAxG_favStar,.o0mAxG_favStar:focus-visible,.o0mAxG_favStar[data-active]{opacity:1}.o0mAxG_favStar:hover{color:#fff;background:#0000008c}.o0mAxG_favStar[data-active]{color:#ffb020}@media (hover:none){.o0mAxG_favStar{opacity:1}}.o0mAxG_cardBody{flex-direction:column;gap:4px;min-width:0;padding:9px 11px 10px;display:flex}.o0mAxG_cardTitle{-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12.5px;font-weight:600;line-height:1.35;display:-webkit-box;overflow:hidden}.o0mAxG_cardMeta{min-width:0;color:var(--dsw-alias-label-tertiary);align-items:center;gap:6px;font-size:11px;display:flex}.o0mAxG_cardCategory{background:var(--dsw-alias-bg-layer-2);color:var(--dsw-alias-label-secondary);border-radius:999px;flex:none;padding:1px 7px}.o0mAxG_cardSource{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.o0mAxG_footer{border-top:1px solid var(--dsw-alias-border-l1);flex:none;justify-content:space-between;align-items:center;gap:10px;padding:9px 18px;display:flex}.o0mAxG_attribution{color:var(--dsw-alias-label-dimmed);min-width:0;font-size:11.5px}.o0mAxG_sourceLink{color:var(--dsw-alias-brand-primary);white-space:nowrap;flex:none;font-size:11.5px;font-weight:600;text-decoration:none}.o0mAxG_sourceLink:hover{text-decoration:underline}.o0mAxG_detailOverlay{background:var(--dsw-alias-bg-mask-1);justify-content:center;align-items:center;padding:34px;display:flex;position:absolute;inset:0}.o0mAxG_detail{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-base);border-radius:14px;grid-template-rows:minmax(0,1fr);grid-template-columns:minmax(0,5fr) minmax(0,4fr);gap:0;width:min(980px,100%);max-height:100%;display:grid;overflow:hidden;box-shadow:0 18px 60px #00000052}.o0mAxG_detailMedia{background:var(--dsw-alias-bg-layer-2);justify-content:center;align-items:center;min-height:0;display:flex;overflow:hidden}.o0mAxG_detailImage{object-fit:contain;width:100%;height:100%;display:block}.o0mAxG_detailInfo{flex-direction:column;gap:10px;min-height:0;padding:18px;display:flex;overflow-y:auto}.o0mAxG_detailTitle{margin:0;font-size:15px;font-weight:650;line-height:1.4}.o0mAxG_detailMeta{color:var(--dsw-alias-label-tertiary);flex-wrap:wrap;align-items:center;gap:8px;font-size:12px;display:flex}.o0mAxG_detailLink{color:var(--dsw-alias-brand-primary);text-overflow:ellipsis;white-space:nowrap;text-decoration:none;overflow:hidden}.o0mAxG_detailLink:hover{text-decoration:underline}.o0mAxG_detailPrompt{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);min-height:0;color:var(--dsw-alias-label-primary);white-space:pre-wrap;word-break:break-word;user-select:text;border-radius:10px;flex:1;margin:0;padding:12px;font-family:inherit;font-size:12.5px;line-height:1.6;overflow-y:auto}.o0mAxG_detailActions{background:var(--dsw-alias-bg-base);border-top:1px solid var(--dsw-alias-border-l1);flex:none;gap:8px;margin:0 -18px -18px;padding:12px 18px;display:flex;position:sticky;bottom:0}@media (width<=760px){.o0mAxG_detail{grid-template-rows:minmax(0,3fr) minmax(0,4fr);grid-template-columns:1fr}}";
1147
+ const tagId$4 = "@dickpy/dsh-imagegen/templates.module.css";
1148
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$4) + "]") === null) {
1057
1149
  const tag = document.createElement("style");
1058
1150
  tag.dataset.plugin = "@dickpy/dsh-imagegen";
1059
- tag.dataset.pluginCss = tagId$3;
1060
- tag.textContent = css$3;
1151
+ tag.dataset.pluginCss = tagId$4;
1152
+ tag.textContent = css$4;
1061
1153
  document.head.appendChild(tag);
1062
1154
  }
1063
1155
  var templates_module_css_default = {
1064
- "dsh-imagegen-templates-spin": "o0mAxG_dsh-imagegen-templates-spin",
1065
- "headerActions": "o0mAxG_headerActions",
1066
- "cardMeta": "o0mAxG_cardMeta",
1156
+ "card": "o0mAxG_card",
1157
+ "shell": "o0mAxG_shell",
1067
1158
  "detailPrompt": "o0mAxG_detailPrompt",
1068
- "close": "o0mAxG_close",
1069
- "detailLink": "o0mAxG_detailLink",
1070
- "overlay": "o0mAxG_overlay",
1071
- "categoryPill": "o0mAxG_categoryPill",
1072
- "notice": "o0mAxG_notice",
1073
- "title": "o0mAxG_title",
1074
- "grid": "o0mAxG_grid",
1075
- "cardSource": "o0mAxG_cardSource",
1076
- "heading": "o0mAxG_heading",
1077
- "thumbWrap": "o0mAxG_thumbWrap",
1078
- "detail": "o0mAxG_detail",
1079
- "thumbPlaceholder": "o0mAxG_thumbPlaceholder",
1080
- "detailMedia": "o0mAxG_detailMedia",
1081
- "detailInfo": "o0mAxG_detailInfo",
1082
- "thumb": "o0mAxG_thumb",
1083
1159
  "footer": "o0mAxG_footer",
1084
- "attribution": "o0mAxG_attribution",
1085
- "cardCategory": "o0mAxG_cardCategory",
1086
1160
  "sourceLink": "o0mAxG_sourceLink",
1087
- "meta": "o0mAxG_meta",
1088
- "toolbar": "o0mAxG_toolbar",
1089
- "detailActions": "o0mAxG_detailActions",
1161
+ "detail": "o0mAxG_detail",
1090
1162
  "cardTitle": "o0mAxG_cardTitle",
1091
- "search": "o0mAxG_search",
1092
- "spinner": "o0mAxG_spinner",
1163
+ "heading": "o0mAxG_heading",
1164
+ "thumbPlaceholder": "o0mAxG_thumbPlaceholder",
1165
+ "overlay": "o0mAxG_overlay",
1166
+ "detailOverlay": "o0mAxG_detailOverlay",
1167
+ "cardSource": "o0mAxG_cardSource",
1168
+ "meta": "o0mAxG_meta",
1093
1169
  "cardBody": "o0mAxG_cardBody",
1094
- "featuredBadge": "o0mAxG_featuredBadge",
1170
+ "sourceTabCount": "o0mAxG_sourceTabCount",
1171
+ "toolbar": "o0mAxG_toolbar",
1172
+ "detailImage": "o0mAxG_detailImage",
1173
+ "detailLink": "o0mAxG_detailLink",
1174
+ "categoryPill": "o0mAxG_categoryPill",
1095
1175
  "body": "o0mAxG_body",
1096
- "detailMeta": "o0mAxG_detailMeta",
1176
+ "grid": "o0mAxG_grid",
1177
+ "thumb": "o0mAxG_thumb",
1178
+ "close": "o0mAxG_close",
1179
+ "cardCategory": "o0mAxG_cardCategory",
1097
1180
  "header": "o0mAxG_header",
1181
+ "detailActions": "o0mAxG_detailActions",
1098
1182
  "categoryRow": "o0mAxG_categoryRow",
1099
- "detailImage": "o0mAxG_detailImage",
1100
- "detailTitle": "o0mAxG_detailTitle",
1183
+ "sourceTabs": "o0mAxG_sourceTabs",
1184
+ "notice": "o0mAxG_notice",
1185
+ "headerActions": "o0mAxG_headerActions",
1186
+ "dsh-imagegen-templates-spin": "o0mAxG_dsh-imagegen-templates-spin",
1187
+ "featuredBadge": "o0mAxG_featuredBadge",
1188
+ "detailMedia": "o0mAxG_detailMedia",
1189
+ "favStar": "o0mAxG_favStar",
1190
+ "attribution": "o0mAxG_attribution",
1191
+ "spinner": "o0mAxG_spinner",
1101
1192
  "state": "o0mAxG_state",
1102
- "card": "o0mAxG_card",
1103
- "shell": "o0mAxG_shell",
1104
- "detailOverlay": "o0mAxG_detailOverlay"
1193
+ "title": "o0mAxG_title",
1194
+ "cardMeta": "o0mAxG_cardMeta",
1195
+ "sourceTab": "o0mAxG_sourceTab",
1196
+ "detailTitle": "o0mAxG_detailTitle",
1197
+ "detailInfo": "o0mAxG_detailInfo",
1198
+ "search": "o0mAxG_search",
1199
+ "thumbWrap": "o0mAxG_thumbWrap",
1200
+ "detailMeta": "o0mAxG_detailMeta"
1105
1201
  };
1106
1202
  //#endregion
1107
1203
  //#region src/client/TemplateLibrary.tsx
1108
1204
  /**
1109
- * Prompt-template library overlay: a searchable, category-filtered gallery of
1110
- * the bundled awesome-gpt-image-2 cases. The case list is served by the host
1111
- * (bundled snapshot, optionally refreshed online); reference images load
1112
- * lazily through the host's caching proxy, so browsing progressively mirrors
1113
- * the gallery onto the local disk. Picking a template hands its prompt back
1114
- * to the studio form.
1205
+ * Prompt-template library overlay: a multi-source, searchable, category-
1206
+ * filtered gallery. Each registered source (TEMPLATE_SOURCES) renders as its
1207
+ * own tab with an independent list, refresh state, and image pool; case lists
1208
+ * are served by the host (bundled snapshot, optionally refreshed online or
1209
+ * auto-synced in the background) and reference images load lazily through the
1210
+ * host's caching proxy, so browsing progressively mirrors the gallery onto the
1211
+ * local disk. Templates can be starred; favorites persist host-side as full
1212
+ * case snapshots and are reachable through the ★ filter pill per tab. Picking
1213
+ * a template hands its prompt back to the studio form.
1115
1214
  */
1116
1215
  /** Concurrent image downloads while caching the whole gallery offline. */
1117
1216
  const CACHE_ALL_CONCURRENCY = 4;
1217
+ /** Stable favorites key of one case within a source. */
1218
+ function favoriteKeyOf(sourceId, item) {
1219
+ return `${sourceId}:${item.id}`;
1220
+ }
1118
1221
  /** Same-origin URL of one case's reference image (host caching proxy). */
1119
- function imageUrlOf(item) {
1120
- return `${TEMPLATES_API.image}/${encodeURIComponent(item.image)}`;
1222
+ function imageUrlOf$1(sourceId, item) {
1223
+ return `${TEMPLATES_API.image}/${encodeURIComponent(sourceId)}/${encodeURIComponent(item.image)}`;
1121
1224
  }
1122
1225
  /** A card thumbnail that falls back to a placeholder when the proxy 404s. */
1123
1226
  function TemplateThumb(props) {
@@ -1153,7 +1256,7 @@ window.__ModuleLoader__.load({
1153
1256
  });
1154
1257
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
1155
1258
  className: templates_module_css_default.thumb,
1156
- src: imageUrlOf(props.item),
1259
+ src: imageUrlOf$1(props.sourceId, props.item),
1157
1260
  alt: props.item.title,
1158
1261
  loading: "lazy",
1159
1262
  onError: () => {
@@ -1161,13 +1264,50 @@ window.__ModuleLoader__.load({
1161
1264
  }
1162
1265
  });
1163
1266
  }
1267
+ /** Card-corner star toggle; the click must not open the detail view. Rendered
1268
+ * as a span (a button cannot nest inside the card button). */
1269
+ function FavoriteStar(props) {
1270
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1271
+ role: "button",
1272
+ tabIndex: 0,
1273
+ className: templates_module_css_default.favStar,
1274
+ "data-active": props.active ? "" : void 0,
1275
+ "aria-label": props.title,
1276
+ title: props.title,
1277
+ onClick: (event) => {
1278
+ event.stopPropagation();
1279
+ props.onToggle();
1280
+ },
1281
+ onKeyDown: (event) => {
1282
+ if (event.key !== "Enter" && event.key !== " ") return;
1283
+ event.stopPropagation();
1284
+ event.preventDefault();
1285
+ props.onToggle();
1286
+ },
1287
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
1288
+ viewBox: "0 0 24 24",
1289
+ width: "15",
1290
+ height: "15",
1291
+ fill: props.active ? "currentColor" : "none",
1292
+ stroke: "currentColor",
1293
+ strokeWidth: "1.6",
1294
+ strokeLinecap: "round",
1295
+ strokeLinejoin: "round",
1296
+ "aria-hidden": "true",
1297
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M12 3.6l2.6 5.3 5.8.8-4.2 4.1 1 5.8-5.2-2.7-5.2 2.7 1-5.8L3.6 9.7l5.8-.8z" })
1298
+ })
1299
+ });
1300
+ }
1164
1301
  /** The template-library modal. Rendered through a portal above the studio. */
1165
1302
  function TemplateLibrary(props) {
1166
1303
  const { api, onUse, onClose } = props;
1167
- const [list, setList] = (0, react.useState)(null);
1168
- const [loadError, setLoadError] = (0, react.useState)(null);
1304
+ const [activeSource, setActiveSource] = (0, react.useState)(TEMPLATE_SOURCES[0].id);
1305
+ const [lists, setLists] = (0, react.useState)({});
1306
+ const [loadErrors, setLoadErrors] = (0, react.useState)({});
1307
+ const [favorites, setFavorites] = (0, react.useState)([]);
1169
1308
  const [query, setQuery] = (0, react.useState)("");
1170
1309
  const [category, setCategory] = (0, react.useState)("");
1310
+ const [favoritesOnly, setFavoritesOnly] = (0, react.useState)(false);
1171
1311
  const [selected, setSelected] = (0, react.useState)(null);
1172
1312
  const [copied, setCopied] = (0, react.useState)(false);
1173
1313
  const [refreshing, setRefreshing] = (0, react.useState)(false);
@@ -1178,20 +1318,42 @@ window.__ModuleLoader__.load({
1178
1318
  total: 0
1179
1319
  });
1180
1320
  const searchRef = (0, react.useRef)(null);
1181
- const load = () => {
1182
- api.templatesList().then((result) => {
1183
- setList(result);
1184
- setLoadError(null);
1321
+ const list = lists[activeSource];
1322
+ const loadError = loadErrors[activeSource] || null;
1323
+ /** Fetch one source's list into the per-source cache. */
1324
+ const loadSource = (sourceId) => {
1325
+ api.templatesList(sourceId).then((result) => {
1326
+ setLists((current) => ({
1327
+ ...current,
1328
+ [sourceId]: result
1329
+ }));
1330
+ setLoadErrors((current) => ({
1331
+ ...current,
1332
+ [sourceId]: ""
1333
+ }));
1185
1334
  }).catch((caught) => {
1186
- setLoadError(errorMessage(caught));
1335
+ setLoadErrors((current) => ({
1336
+ ...current,
1337
+ [sourceId]: errorMessage(caught)
1338
+ }));
1187
1339
  });
1188
1340
  };
1189
1341
  (0, react.useEffect)(() => {
1190
- load();
1342
+ loadSource(TEMPLATE_SOURCES[0].id);
1343
+ api.favoritesList().then(setFavorites).catch(() => {});
1191
1344
  searchRef.current?.focus();
1192
1345
  }, []);
1346
+ const switchSource = (sourceId) => {
1347
+ if (sourceId === activeSource) return;
1348
+ setActiveSource(sourceId);
1349
+ setCategory("");
1350
+ setFavoritesOnly(false);
1351
+ setSelected(null);
1352
+ setNotice(null);
1353
+ if (lists[sourceId] === void 0) loadSource(sourceId);
1354
+ };
1193
1355
  const categories = (0, react.useMemo)(() => {
1194
- if (list === null) return [];
1356
+ if (list === void 0) return [];
1195
1357
  const counts = /* @__PURE__ */ new Map();
1196
1358
  for (const item of list.cases) {
1197
1359
  const entry = counts.get(item.category) ?? {
@@ -1207,16 +1369,21 @@ window.__ModuleLoader__.load({
1207
1369
  count: value.count
1208
1370
  }));
1209
1371
  }, [list]);
1372
+ /** Favorites of the active source, as standalone case snapshots. */
1373
+ const activeFavorites = (0, react.useMemo)(() => favorites.filter((entry) => entry.sourceId === activeSource).map((entry) => entry.case), [favorites, activeSource]);
1374
+ const favKeys = (0, react.useMemo)(() => new Set(favorites.map((entry) => entry.key)), [favorites]);
1210
1375
  const filtered = (0, react.useMemo)(() => {
1211
- if (list === null) return [];
1376
+ const pool = favoritesOnly ? activeFavorites : list?.cases ?? [];
1212
1377
  const needle = query.trim().toLowerCase();
1213
- return list.cases.filter((item) => {
1378
+ return pool.filter((item) => {
1214
1379
  if (category !== "" && item.category !== category) return false;
1215
1380
  if (needle === "") return true;
1216
1381
  return item.title.toLowerCase().includes(needle) || item.prompt.toLowerCase().includes(needle) || item.sourceLabel.toLowerCase().includes(needle);
1217
1382
  });
1218
1383
  }, [
1219
1384
  list,
1385
+ activeFavorites,
1386
+ favoritesOnly,
1220
1387
  query,
1221
1388
  category
1222
1389
  ]);
@@ -1235,10 +1402,12 @@ window.__ModuleLoader__.load({
1235
1402
  setRefreshing(true);
1236
1403
  setNotice(null);
1237
1404
  try {
1238
- const result = await api.templatesRefresh();
1239
- const reloaded = await api.templatesList();
1240
- setList(reloaded);
1241
- setLoadError(null);
1405
+ const result = await api.templatesRefresh(activeSource);
1406
+ const reloaded = await api.templatesList(activeSource);
1407
+ setLists((current) => ({
1408
+ ...current,
1409
+ [activeSource]: reloaded
1410
+ }));
1242
1411
  setNotice(tt("templates.refreshed", { count: result.total }));
1243
1412
  } catch (caught) {
1244
1413
  setNotice(tt("templates.refreshFailed", { error: errorMessage(caught) }));
@@ -1246,9 +1415,14 @@ window.__ModuleLoader__.load({
1246
1415
  setRefreshing(false);
1247
1416
  }
1248
1417
  };
1249
- /** Mirror every reference image through the host cache (offline browsing). */
1418
+ /** Star / unstar one template of the active source. */
1419
+ const toggleFavorite = (item) => {
1420
+ const key = favoriteKeyOf(activeSource, item);
1421
+ (favKeys.has(key) ? api.favoritesRemove(key) : api.favoritesAdd(activeSource, item)).then(setFavorites).catch(() => {});
1422
+ };
1423
+ /** Mirror every reference image of the active source through the host cache. */
1250
1424
  const cacheAllImages = async () => {
1251
- if (cacheAll.running || list === null) return;
1425
+ if (cacheAll.running || list === void 0) return;
1252
1426
  const files = [...new Set(list.cases.map((item) => item.image).filter((name) => name !== ""))];
1253
1427
  setCacheAll({
1254
1428
  running: true,
@@ -1261,7 +1435,7 @@ window.__ModuleLoader__.load({
1261
1435
  const file = files[index];
1262
1436
  index += 1;
1263
1437
  try {
1264
- await fetch(`${TEMPLATES_API.image}/${encodeURIComponent(file)}`);
1438
+ await fetch(`${TEMPLATES_API.image}/${encodeURIComponent(activeSource)}/${encodeURIComponent(file)}`);
1265
1439
  } catch {}
1266
1440
  setCacheAll((current) => ({
1267
1441
  ...current,
@@ -1298,7 +1472,8 @@ window.__ModuleLoader__.load({
1298
1472
  setCopied(false);
1299
1473
  }
1300
1474
  };
1301
- const originLabel = list === null ? "" : tt(list.origin === "refreshed" ? "templates.origin.refreshed" : "templates.origin.bundled");
1475
+ const originLabel = list === void 0 ? "" : tt(list.origin === "refreshed" ? "templates.origin.refreshed" : "templates.origin.bundled");
1476
+ const activeMeta = TEMPLATE_SOURCES.find((source) => source.id === activeSource);
1302
1477
  return (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1303
1478
  className: templates_module_css_default.overlay,
1304
1479
  role: "dialog",
@@ -1318,7 +1493,7 @@ window.__ModuleLoader__.load({
1318
1493
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
1319
1494
  className: templates_module_css_default.title,
1320
1495
  children: tt("templates.title")
1321
- }), list !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1496
+ }), list !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1322
1497
  className: templates_module_css_default.meta,
1323
1498
  children: tt("templates.meta", {
1324
1499
  count: list.total,
@@ -1340,7 +1515,7 @@ window.__ModuleLoader__.load({
1340
1515
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1341
1516
  variant: "outline",
1342
1517
  size: "sm",
1343
- disabled: list === null || cacheAll.running,
1518
+ disabled: list === void 0 || cacheAll.running,
1344
1519
  title: tt("templates.cacheAllHint"),
1345
1520
  onClick: () => {
1346
1521
  cacheAllImages();
@@ -1371,6 +1546,26 @@ window.__ModuleLoader__.load({
1371
1546
  ]
1372
1547
  })]
1373
1548
  }),
1549
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1550
+ className: templates_module_css_default.sourceTabs,
1551
+ role: "tablist",
1552
+ "aria-label": tt("templates.sources"),
1553
+ children: TEMPLATE_SOURCES.map((source) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1554
+ type: "button",
1555
+ role: "tab",
1556
+ "aria-selected": source.id === activeSource,
1557
+ className: templates_module_css_default.sourceTab,
1558
+ "data-active": source.id === activeSource ? "" : void 0,
1559
+ title: source.description,
1560
+ onClick: () => {
1561
+ switchSource(source.id);
1562
+ },
1563
+ children: [source.label, lists[source.id] !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1564
+ className: templates_module_css_default.sourceTabCount,
1565
+ children: lists[source.id].total
1566
+ }) : null]
1567
+ }, source.id))
1568
+ }),
1374
1569
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1375
1570
  className: templates_module_css_default.toolbar,
1376
1571
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
@@ -1384,27 +1579,46 @@ window.__ModuleLoader__.load({
1384
1579
  }
1385
1580
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1386
1581
  className: templates_module_css_default.categoryRow,
1387
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1388
- type: "button",
1389
- className: templates_module_css_default.categoryPill,
1390
- "data-active": category === "" ? "" : void 0,
1391
- onClick: () => {
1392
- setCategory("");
1393
- },
1394
- children: [tt("templates.all"), list !== null ? ` ${list.total}` : ""]
1395
- }), categories.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1396
- type: "button",
1397
- className: templates_module_css_default.categoryPill,
1398
- "data-active": category === entry.key ? "" : void 0,
1399
- onClick: () => {
1400
- setCategory(entry.key);
1401
- },
1402
- children: [
1403
- entry.label,
1404
- " ",
1405
- entry.count
1406
- ]
1407
- }, entry.key))]
1582
+ children: [
1583
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1584
+ type: "button",
1585
+ className: templates_module_css_default.categoryPill,
1586
+ "data-active": favoritesOnly ? "" : void 0,
1587
+ title: tt("templates.favoritesHint"),
1588
+ onClick: () => {
1589
+ setFavoritesOnly((value) => !value);
1590
+ },
1591
+ children: [
1592
+ "★ ",
1593
+ tt("templates.favorites"),
1594
+ activeFavorites.length > 0 ? ` ${activeFavorites.length}` : ""
1595
+ ]
1596
+ }),
1597
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1598
+ type: "button",
1599
+ className: templates_module_css_default.categoryPill,
1600
+ "data-active": !favoritesOnly && category === "" ? "" : void 0,
1601
+ onClick: () => {
1602
+ setFavoritesOnly(false);
1603
+ setCategory("");
1604
+ },
1605
+ children: [tt("templates.all"), list !== void 0 ? ` ${list.total}` : ""]
1606
+ }),
1607
+ categories.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1608
+ type: "button",
1609
+ className: templates_module_css_default.categoryPill,
1610
+ "data-active": !favoritesOnly && category === entry.key ? "" : void 0,
1611
+ onClick: () => {
1612
+ setFavoritesOnly(false);
1613
+ setCategory(entry.key);
1614
+ },
1615
+ children: [
1616
+ entry.label,
1617
+ " ",
1618
+ entry.count
1619
+ ]
1620
+ }, entry.key))
1621
+ ]
1408
1622
  })]
1409
1623
  }),
1410
1624
  notice !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
@@ -1415,7 +1629,7 @@ window.__ModuleLoader__.load({
1415
1629
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1416
1630
  className: templates_module_css_default.body,
1417
1631
  children: [
1418
- list === null && loadError === null ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1632
+ list === void 0 && loadError === null ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1419
1633
  className: templates_module_css_default.state,
1420
1634
  role: "status",
1421
1635
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: templates_module_css_default.spinner }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: tt("templates.loading") })]
@@ -1427,18 +1641,20 @@ window.__ModuleLoader__.load({
1427
1641
  variant: "outline",
1428
1642
  size: "sm",
1429
1643
  onClick: () => {
1430
- setLoadError(null);
1431
- setList(null);
1432
- load();
1644
+ setLoadErrors((current) => ({
1645
+ ...current,
1646
+ [activeSource]: ""
1647
+ }));
1648
+ loadSource(activeSource);
1433
1649
  },
1434
1650
  children: tt("templates.retry")
1435
1651
  })]
1436
1652
  }) : null,
1437
- list !== null && filtered.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1653
+ loadError === null && (list !== void 0 || favoritesOnly) && filtered.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1438
1654
  className: templates_module_css_default.state,
1439
- children: tt("templates.empty")
1655
+ children: favoritesOnly && activeFavorites.length === 0 ? tt("templates.favoritesEmpty") : tt("templates.empty")
1440
1656
  }) : null,
1441
- list !== null && filtered.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1657
+ filtered.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1442
1658
  className: templates_module_css_default.grid,
1443
1659
  children: filtered.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1444
1660
  type: "button",
@@ -1449,10 +1665,23 @@ window.__ModuleLoader__.load({
1449
1665
  },
1450
1666
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1451
1667
  className: templates_module_css_default.thumbWrap,
1452
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TemplateThumb, { item }), item.featured ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1453
- className: templates_module_css_default.featuredBadge,
1454
- children: tt("templates.featured")
1455
- }) : null]
1668
+ children: [
1669
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TemplateThumb, {
1670
+ sourceId: activeSource,
1671
+ item
1672
+ }),
1673
+ item.featured ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1674
+ className: templates_module_css_default.featuredBadge,
1675
+ children: tt("templates.featured")
1676
+ }) : null,
1677
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(FavoriteStar, {
1678
+ active: favKeys.has(favoriteKeyOf(activeSource, item)),
1679
+ title: favKeys.has(favoriteKeyOf(activeSource, item)) ? tt("templates.favoriteRemove") : tt("templates.favoriteAdd"),
1680
+ onToggle: () => {
1681
+ toggleFavorite(item);
1682
+ }
1683
+ })
1684
+ ]
1456
1685
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1457
1686
  className: templates_module_css_default.cardBody,
1458
1687
  children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
@@ -1469,7 +1698,7 @@ window.__ModuleLoader__.load({
1469
1698
  }) : null]
1470
1699
  })]
1471
1700
  })]
1472
- }, item.id))
1701
+ }, `${activeSource}:${item.id}`))
1473
1702
  }) : null
1474
1703
  ]
1475
1704
  }),
@@ -1480,10 +1709,10 @@ window.__ModuleLoader__.load({
1480
1709
  children: tt("templates.attribution")
1481
1710
  }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
1482
1711
  className: templates_module_css_default.sourceLink,
1483
- href: "https://vibeui.top/",
1712
+ href: activeMeta.homepage,
1484
1713
  target: "_blank",
1485
1714
  rel: "noreferrer",
1486
- children: tt("templates.source")
1715
+ children: tt("templates.source", { label: activeMeta.label })
1487
1716
  })]
1488
1717
  })
1489
1718
  ]
@@ -1501,7 +1730,7 @@ window.__ModuleLoader__.load({
1501
1730
  className: templates_module_css_default.detailMedia,
1502
1731
  children: selected.image !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
1503
1732
  className: templates_module_css_default.detailImage,
1504
- src: imageUrlOf(selected),
1733
+ src: imageUrlOf$1(activeSource, selected),
1505
1734
  alt: selected.title
1506
1735
  }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1507
1736
  className: templates_module_css_default.thumbPlaceholder,
@@ -1560,6 +1789,14 @@ window.__ModuleLoader__.load({
1560
1789
  },
1561
1790
  children: copied ? tt("templates.copied") : tt("templates.copy")
1562
1791
  }),
1792
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1793
+ variant: "outline",
1794
+ size: "md",
1795
+ onClick: () => {
1796
+ toggleFavorite(selected);
1797
+ },
1798
+ children: favKeys.has(favoriteKeyOf(activeSource, selected)) ? tt("templates.unfavorite") : tt("templates.favorite")
1799
+ }),
1563
1800
  /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1564
1801
  variant: "outline",
1565
1802
  size: "md",
@@ -1577,6 +1814,176 @@ window.__ModuleLoader__.load({
1577
1814
  }), document.body);
1578
1815
  }
1579
1816
  //#endregion
1817
+ //#region \0dsh-css:E:\dsh-plugin\src\client\inspiration.module.css.mjs
1818
+ const css$3 = ".IgRnJG_wrap{width:min(880px,100%);font-family:var(--dsw-font-family);flex-direction:column;align-items:center;gap:16px;margin:auto;padding:24px;display:flex}.IgRnJG_title{color:var(--dsw-alias-label-primary);font-size:15px;font-weight:650}.IgRnJG_emptyIcon{color:var(--dsw-alias-label-dimmed);display:inline-flex}.IgRnJG_emptyTitle{color:var(--dsw-alias-label-primary);margin-top:-6px;font-size:15px;font-weight:650}.IgRnJG_emptyHint{color:var(--dsw-alias-label-tertiary);font-size:12.5px}.IgRnJG_grid{grid-template-columns:repeat(4,1fr);gap:12px;width:100%;display:grid}@media (width<=900px){.IgRnJG_grid{grid-template-columns:repeat(3,1fr)}}@media (width<=560px){.IgRnJG_grid{grid-template-columns:repeat(2,1fr)}}.IgRnJG_tile{aspect-ratio:1;border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);cursor:pointer;border-radius:12px;width:100%;padding:0;transition:transform .15s,border-color .15s,box-shadow .15s;display:block;position:relative;overflow:hidden}.IgRnJG_tile:hover{border-color:var(--dsw-alias-brand-primary);transform:translateY(-2px);box-shadow:0 6px 18px #0000001f}.IgRnJG_thumbWrap{display:block;position:absolute;inset:0}.IgRnJG_thumb{object-fit:cover;width:100%;height:100%;display:block}.IgRnJG_thumbFallback{background:var(--dsw-alias-bg-layer-2);width:100%;height:100%;color:var(--dsw-alias-label-tertiary);text-align:center;justify-content:center;align-items:center;padding:6px;font-size:11px;line-height:1.4;display:flex;overflow:hidden}.IgRnJG_thumbTitle{text-overflow:ellipsis;white-space:nowrap;color:#fff;text-align:center;opacity:0;pointer-events:none;background:linear-gradient(#0000,#0000008c);padding:14px 8px 6px;font-size:10.5px;transition:opacity .15s;position:absolute;inset:auto 0 0;overflow:hidden}.IgRnJG_tile:hover .IgRnJG_thumbTitle{opacity:1}.IgRnJG_spinner{border:2px solid var(--dsw-alias-border-l2);border-top-color:var(--dsw-alias-brand-primary);border-radius:50%;width:20px;height:20px;animation:.9s linear infinite IgRnJG_dsh-imagegen-inspiration-spin}@keyframes IgRnJG_dsh-imagegen-inspiration-spin{to{transform:rotate(360deg)}}@media (hover:none){.IgRnJG_thumbTitle{opacity:1}}";
1819
+ const tagId$3 = "@dickpy/dsh-imagegen/inspiration.module.css";
1820
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$3) + "]") === null) {
1821
+ const tag = document.createElement("style");
1822
+ tag.dataset.plugin = "@dickpy/dsh-imagegen";
1823
+ tag.dataset.pluginCss = tagId$3;
1824
+ tag.textContent = css$3;
1825
+ document.head.appendChild(tag);
1826
+ }
1827
+ var inspiration_module_css_default = {
1828
+ "thumbWrap": "IgRnJG_thumbWrap",
1829
+ "thumbTitle": "IgRnJG_thumbTitle",
1830
+ "emptyIcon": "IgRnJG_emptyIcon",
1831
+ "thumb": "IgRnJG_thumb",
1832
+ "grid": "IgRnJG_grid",
1833
+ "emptyHint": "IgRnJG_emptyHint",
1834
+ "thumbFallback": "IgRnJG_thumbFallback",
1835
+ "spinner": "IgRnJG_spinner",
1836
+ "dsh-imagegen-inspiration-spin": "IgRnJG_dsh-imagegen-inspiration-spin",
1837
+ "tile": "IgRnJG_tile",
1838
+ "wrap": "IgRnJG_wrap",
1839
+ "title": "IgRnJG_title",
1840
+ "emptyTitle": "IgRnJG_emptyTitle"
1841
+ };
1842
+ //#endregion
1843
+ //#region src/client/InspirationGallery.tsx
1844
+ /**
1845
+ * Inspiration wall for the studio's empty canvas: a small grid of random
1846
+ * template cases sampled host-side across every library source. Clicking a
1847
+ * card hands its prompt to the form; the 随机 button re-rolls the pick. On
1848
+ * failure the wall collapses to nothing (the panel falls back to the plain
1849
+ * empty-state hint).
1850
+ */
1851
+ /** Card count per deal — a 4×3 wall that uses the canvas's spare width. */
1852
+ const SAMPLE_COUNT = 12;
1853
+ /** Same-origin proxy URL of one sampled case's reference image. */
1854
+ function imageUrlOf(sample) {
1855
+ return `${TEMPLATES_API.image}/${encodeURIComponent(sample.sourceId)}/${encodeURIComponent(sample.case.image)}`;
1856
+ }
1857
+ /** One thumbnail that degrades to a text tile when the image 404s. */
1858
+ function SampleThumb(props) {
1859
+ const [failed, setFailed] = (0, react.useState)(false);
1860
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
1861
+ className: inspiration_module_css_default.thumbWrap,
1862
+ children: [props.sample.case.image !== "" && !failed ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
1863
+ className: inspiration_module_css_default.thumb,
1864
+ src: imageUrlOf(props.sample),
1865
+ alt: props.sample.case.title,
1866
+ loading: "lazy",
1867
+ onError: () => {
1868
+ setFailed(true);
1869
+ }
1870
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1871
+ className: inspiration_module_css_default.thumbFallback,
1872
+ "aria-hidden": "true",
1873
+ children: props.sample.case.title
1874
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1875
+ className: inspiration_module_css_default.thumbTitle,
1876
+ children: props.sample.case.title
1877
+ })]
1878
+ });
1879
+ }
1880
+ /** The random-case wall shown while the canvas has no results. */
1881
+ function InspirationGallery(props) {
1882
+ const { api, onUse } = props;
1883
+ const [samples, setSamples] = (0, react.useState)(null);
1884
+ const [loading, setLoading] = (0, react.useState)(false);
1885
+ const deal = () => {
1886
+ if (loading) return;
1887
+ setLoading(true);
1888
+ api.templatesSample(SAMPLE_COUNT).then(setSamples).catch(() => {
1889
+ setSamples((current) => current ?? []);
1890
+ }).finally(() => {
1891
+ setLoading(false);
1892
+ });
1893
+ };
1894
+ (0, react.useEffect)(() => {
1895
+ deal();
1896
+ }, []);
1897
+ if (samples !== null && samples.length === 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1898
+ className: inspiration_module_css_default.wrap,
1899
+ "aria-label": tt("inspiration.title"),
1900
+ children: [
1901
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1902
+ className: inspiration_module_css_default.emptyIcon,
1903
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
1904
+ viewBox: "0 0 24 24",
1905
+ width: "34",
1906
+ height: "34",
1907
+ fill: "none",
1908
+ stroke: "currentColor",
1909
+ strokeWidth: "1.2",
1910
+ strokeLinecap: "round",
1911
+ strokeLinejoin: "round",
1912
+ "aria-hidden": "true",
1913
+ children: [
1914
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
1915
+ x: "3",
1916
+ y: "3",
1917
+ width: "18",
1918
+ height: "18",
1919
+ rx: "3"
1920
+ }),
1921
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
1922
+ cx: "8.5",
1923
+ cy: "8.5",
1924
+ r: "1.5"
1925
+ }),
1926
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 15l-5-5L5 21" })
1927
+ ]
1928
+ })
1929
+ }),
1930
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1931
+ className: inspiration_module_css_default.emptyTitle,
1932
+ children: tt("canvas.emptyTitle")
1933
+ }),
1934
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1935
+ className: inspiration_module_css_default.emptyHint,
1936
+ children: tt("canvas.emptyHint")
1937
+ })
1938
+ ]
1939
+ });
1940
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1941
+ className: inspiration_module_css_default.wrap,
1942
+ "aria-label": tt("inspiration.title"),
1943
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1944
+ className: inspiration_module_css_default.title,
1945
+ children: tt("inspiration.title")
1946
+ }), samples === null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1947
+ className: inspiration_module_css_default.spinner,
1948
+ "aria-hidden": "true"
1949
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1950
+ className: inspiration_module_css_default.grid,
1951
+ children: samples.map((sample) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
1952
+ type: "button",
1953
+ className: inspiration_module_css_default.tile,
1954
+ title: tt("inspiration.useHint"),
1955
+ onClick: () => {
1956
+ onUse(sample.case.prompt);
1957
+ },
1958
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(SampleThumb, { sample })
1959
+ }, `${sample.sourceId}:${sample.case.id}`))
1960
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(_deepseek_ai_dsh_client_ui_primitives.Button, {
1961
+ variant: "outline",
1962
+ size: "sm",
1963
+ disabled: loading,
1964
+ onClick: deal,
1965
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
1966
+ viewBox: "0 0 24 24",
1967
+ width: "14",
1968
+ height: "14",
1969
+ fill: "none",
1970
+ stroke: "currentColor",
1971
+ strokeWidth: "1.8",
1972
+ strokeLinecap: "round",
1973
+ strokeLinejoin: "round",
1974
+ "aria-hidden": "true",
1975
+ children: [
1976
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M2 18h1.4c1.3 0 2.5-.6 3.3-1.7l6.1-8.6c.8-1.1 2-1.7 3.3-1.7H22" }),
1977
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m18 2 4 4-4 4" }),
1978
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M2 6h1.9c1.5 0 2.9.9 3.6 2.2" }),
1979
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M22 18h-5.9c-1.3 0-2.6-.7-3.3-1.8l-.5-.8" }),
1980
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "m18 14 4 4-4 4" })
1981
+ ]
1982
+ }), loading ? tt("inspiration.shuffling") : tt("inspiration.shuffle")]
1983
+ })] })]
1984
+ });
1985
+ }
1986
+ //#endregion
1580
1987
  //#region src/client/settings-scope.ts
1581
1988
  /**
1582
1989
  * Browser-side settings scope for the dsh-imagegen namespace, served by the
@@ -1634,7 +2041,7 @@ window.__ModuleLoader__.load({
1634
2041
  constructor(api, spec) {
1635
2042
  this.api = api;
1636
2043
  this.spec = spec;
1637
- this.store = (0, _deepseek_ai_dsh_client_runtime_client.createSnapshotStore)({
2044
+ this.store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)({
1638
2045
  status: "loading",
1639
2046
  value: void 0,
1640
2047
  base: void 0,
@@ -1643,8 +2050,8 @@ window.__ModuleLoader__.load({
1643
2050
  writable: false,
1644
2051
  mode: "host"
1645
2052
  });
1646
- this.keySet = (0, _deepseek_ai_dsh_client_runtime_client.createSnapshotStore)(false);
1647
- this.secretSets = (0, _deepseek_ai_dsh_client_runtime_client.createSnapshotStore)({});
2053
+ this.keySet = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)(false);
2054
+ this.secretSets = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)({});
1648
2055
  }
1649
2056
  getSnapshot() {
1650
2057
  return this.store.getSnapshot();
@@ -1685,6 +2092,9 @@ window.__ModuleLoader__.load({
1685
2092
  path: [field]
1686
2093
  }]));
1687
2094
  }
2095
+ mutate(ops, expectedRevision) {
2096
+ return this.enqueue(() => this.writeOps([...ops], expectedRevision));
2097
+ }
1688
2098
  /** Apply several path ops in one revision-fenced mutate call (atomic save).
1689
2099
  * Path ops may address plain-object fields (e.g. `channelSecrets.<id>`),
1690
2100
  * but never navigate *inside* arrays — write array fields wholesale. */
@@ -1733,8 +2143,8 @@ window.__ModuleLoader__.load({
1733
2143
  }
1734
2144
  this.accept(view, writable);
1735
2145
  }
1736
- async writeOps(ops) {
1737
- const revision = this.getSnapshot().revision;
2146
+ async writeOps(ops, expectedRevision) {
2147
+ const revision = expectedRevision ?? this.getSnapshot().revision;
1738
2148
  let response;
1739
2149
  try {
1740
2150
  response = await this.api.mutate({
@@ -1950,226 +2360,226 @@ window.__ModuleLoader__.load({
1950
2360
  document.head.appendChild(tag);
1951
2361
  }
1952
2362
  var panel_module_css_default = {
1953
- "optionRow": "Yvqh9W_optionRow",
1954
- "galleryFilterNote": "Yvqh9W_galleryFilterNote",
1955
- "ecommerceAsset": "Yvqh9W_ecommerceAsset",
1956
- "ecommerceFooterHint": "Yvqh9W_ecommerceFooterHint",
1957
- "lightboxClose": "Yvqh9W_lightboxClose",
1958
- "imageCaption": "Yvqh9W_imageCaption",
1959
- "taskTrayCount": "Yvqh9W_taskTrayCount",
1960
- "lightboxActions": "Yvqh9W_lightboxActions",
1961
- "ecommerceRefRow": "Yvqh9W_ecommerceRefRow",
1962
- "historyHeader": "Yvqh9W_historyHeader",
1963
- "paramGroup": "Yvqh9W_paramGroup",
1964
- "gallerySelectMode": "Yvqh9W_gallerySelectMode",
1965
- "lightboxCaptionRow": "Yvqh9W_lightboxCaptionRow",
1966
- "entryLabel": "Yvqh9W_entryLabel",
1967
- "configToggle": "Yvqh9W_configToggle",
1968
- "sessionTab": "Yvqh9W_sessionTab",
1969
- "galleryBadge": "Yvqh9W_galleryBadge",
1970
- "historyTitle": "Yvqh9W_historyTitle",
1971
- "topNavDivider": "Yvqh9W_topNavDivider",
1972
- "configResizer": "Yvqh9W_configResizer",
1973
- "taskTrayChevron": "Yvqh9W_taskTrayChevron",
1974
- "generateInner": "Yvqh9W_generateInner",
1975
- "historyActions": "Yvqh9W_historyActions",
1976
- "zoomHint": "Yvqh9W_zoomHint",
1977
- "modelSelect": "Yvqh9W_modelSelect",
1978
- "enhanceButton": "Yvqh9W_enhanceButton",
1979
- "sidebarHistoryHost": "Yvqh9W_sidebarHistoryHost",
1980
- "lightboxImage": "Yvqh9W_lightboxImage",
1981
- "conversationToast": "Yvqh9W_conversationToast",
1982
- "lightboxEdit": "Yvqh9W_lightboxEdit",
1983
- "canvasStateTitle": "Yvqh9W_canvasStateTitle",
1984
- "galleryHeading": "Yvqh9W_galleryHeading",
1985
- "ecommerceResults": "Yvqh9W_ecommerceResults",
1986
- "galleryTags": "Yvqh9W_galleryTags",
1987
- "spinner": "Yvqh9W_spinner",
1988
- "taskTray": "Yvqh9W_taskTray",
1989
- "modeRow": "Yvqh9W_modeRow",
1990
- "historyThumbPlaceholder": "Yvqh9W_historyThumbPlaceholder",
1991
- "historyEmpty": "Yvqh9W_historyEmpty",
1992
- "ecommercePlanBack": "Yvqh9W_ecommercePlanBack",
1993
- "conversationAdd": "Yvqh9W_conversationAdd",
1994
- "ecommerceSlotCount": "Yvqh9W_ecommerceSlotCount",
1995
- "ecommerceGroups": "Yvqh9W_ecommerceGroups",
1996
- "bigSpinner": "Yvqh9W_bigSpinner",
1997
- "taskRows": "Yvqh9W_taskRows",
1998
- "configScroll": "Yvqh9W_configScroll",
1999
- "galleryToast": "Yvqh9W_galleryToast",
2000
- "lightboxNav": "Yvqh9W_lightboxNav",
2001
- "ecommerceAssets": "Yvqh9W_ecommerceAssets",
2002
- "panelHeading": "Yvqh9W_panelHeading",
2003
- "galleryTagFilter": "Yvqh9W_galleryTagFilter",
2004
- "comparisonFullscreen": "Yvqh9W_comparisonFullscreen",
2005
- "lightboxTools": "Yvqh9W_lightboxTools",
2006
- "optionGrid": "Yvqh9W_optionGrid",
2007
- "galleryCount": "Yvqh9W_galleryCount",
2008
- "modelMenu": "Yvqh9W_modelMenu",
2009
- "paramHint": "Yvqh9W_paramHint",
2010
- "ecommerceParamGrid": "Yvqh9W_ecommerceParamGrid",
2363
+ "modelMenuList": "Yvqh9W_modelMenuList",
2011
2364
  "lightboxCopy": "Yvqh9W_lightboxCopy",
2012
- "templatesButton": "Yvqh9W_templatesButton",
2013
- "canvasState": "Yvqh9W_canvasState",
2014
- "ecommerceWorkspace": "Yvqh9W_ecommerceWorkspace",
2015
- "promptFooter": "Yvqh9W_promptFooter",
2016
- "galleryFilterDivider": "Yvqh9W_galleryFilterDivider",
2365
+ "panelTitle": "Yvqh9W_panelTitle",
2366
+ "taskRows": "Yvqh9W_taskRows",
2367
+ "modePill": "Yvqh9W_modePill",
2368
+ "modelSelect": "Yvqh9W_modelSelect",
2017
2369
  "lightboxCaption": "Yvqh9W_lightboxCaption",
2018
- "entry": "Yvqh9W_entry",
2019
- "canvas": "Yvqh9W_canvas",
2020
- "configHeader": "Yvqh9W_configHeader",
2021
- "chatResizer": "Yvqh9W_chatResizer",
2022
- "ecommerceResultsHeader": "Yvqh9W_ecommerceResultsHeader",
2023
- "updateBanner": "Yvqh9W_updateBanner",
2370
+ "sessionTabs": "Yvqh9W_sessionTabs",
2371
+ "lightboxScaleFrame": "Yvqh9W_lightboxScaleFrame",
2372
+ "galleryTagFilterList": "Yvqh9W_galleryTagFilterList",
2373
+ "ecommerceGroupGrid": "Yvqh9W_ecommerceGroupGrid",
2374
+ "historyHeaderActions": "Yvqh9W_historyHeaderActions",
2375
+ "configGuideBody": "Yvqh9W_configGuideBody",
2376
+ "updateActions": "Yvqh9W_updateActions",
2377
+ "historyList": "Yvqh9W_historyList",
2024
2378
  "topNavItem": "Yvqh9W_topNavItem",
2025
- "galleryClear": "Yvqh9W_galleryClear",
2026
- "compareModelChoices": "Yvqh9W_compareModelChoices",
2027
- "referenceActions": "Yvqh9W_referenceActions",
2028
- "comparisonBoard": "Yvqh9W_comparisonBoard",
2379
+ "ecommerceFieldLabel": "Yvqh9W_ecommerceFieldLabel",
2380
+ "galleryWorkspace": "Yvqh9W_galleryWorkspace",
2381
+ "ecommerceAdvancedToggle": "Yvqh9W_ecommerceAdvancedToggle",
2382
+ "panelHeader": "Yvqh9W_panelHeader",
2383
+ "historyMeta": "Yvqh9W_historyMeta",
2384
+ "galleryToolbar": "Yvqh9W_galleryToolbar",
2029
2385
  "galleryCardInfo": "Yvqh9W_galleryCardInfo",
2030
- "galleryBulkButton": "Yvqh9W_galleryBulkButton",
2031
- "ecommercePlanList": "Yvqh9W_ecommercePlanList",
2386
+ "historyNew": "Yvqh9W_historyNew",
2387
+ "updateBanner": "Yvqh9W_updateBanner",
2388
+ "ecommerceTaskState": "Yvqh9W_ecommerceTaskState",
2389
+ "gallerySearch": "Yvqh9W_gallerySearch",
2390
+ "configHeader": "Yvqh9W_configHeader",
2391
+ "sessionTab": "Yvqh9W_sessionTab",
2392
+ "ecommerceSlotCard": "Yvqh9W_ecommerceSlotCard",
2393
+ "optionPill": "Yvqh9W_optionPill",
2394
+ "galleryCardActions": "Yvqh9W_galleryCardActions",
2395
+ "canvas": "Yvqh9W_canvas",
2396
+ "ecommercePrimaryAction": "Yvqh9W_ecommercePrimaryAction",
2397
+ "galleryViewToggle": "Yvqh9W_galleryViewToggle",
2398
+ "galleryFilterHeading": "Yvqh9W_galleryFilterHeading",
2399
+ "ecommerceTaskActions": "Yvqh9W_ecommerceTaskActions",
2400
+ "optionRow": "Yvqh9W_optionRow",
2401
+ "dshImageGenSpin": "Yvqh9W_dshImageGenSpin",
2032
2402
  "entryIcon": "Yvqh9W_entryIcon",
2403
+ "panelHeaderActions": "Yvqh9W_panelHeaderActions",
2404
+ "galleryAdd": "Yvqh9W_galleryAdd",
2405
+ "ecommerceSectionHint": "Yvqh9W_ecommerceSectionHint",
2033
2406
  "ecommerceResultBadge": "Yvqh9W_ecommerceResultBadge",
2034
- "ecommerceAdvancedChevron": "Yvqh9W_ecommerceAdvancedChevron",
2035
- "historyThumb": "Yvqh9W_historyThumb",
2036
- "lightboxScaleFrame": "Yvqh9W_lightboxScaleFrame",
2037
- "ecommerceFieldLabel": "Yvqh9W_ecommerceFieldLabel",
2038
- "comparisonImageButton": "Yvqh9W_comparisonImageButton",
2039
- "card": "Yvqh9W_card",
2040
- "configGuideBody": "Yvqh9W_configGuideBody",
2041
- "ecommerceField": "Yvqh9W_ecommerceField",
2042
- "ecommerceTaskState": "Yvqh9W_ecommerceTaskState",
2043
- "galleryWorkspace": "Yvqh9W_galleryWorkspace",
2044
- "lightbox": "Yvqh9W_lightbox",
2407
+ "taskTrayHeader": "Yvqh9W_taskTrayHeader",
2408
+ "lightboxStage": "Yvqh9W_lightboxStage",
2409
+ "studio": "Yvqh9W_studio",
2410
+ "taskTrayCount": "Yvqh9W_taskTrayCount",
2411
+ "ecommerceAssetAdd": "Yvqh9W_ecommerceAssetAdd",
2412
+ "chatToggle": "Yvqh9W_chatToggle",
2413
+ "uploadBox": "Yvqh9W_uploadBox",
2045
2414
  "generateButton": "Yvqh9W_generateButton",
2046
- "galleryRatioList": "Yvqh9W_galleryRatioList",
2047
- "taskPrompt": "Yvqh9W_taskPrompt",
2415
+ "canvasMeta": "Yvqh9W_canvasMeta",
2416
+ "entry": "Yvqh9W_entry",
2417
+ "sessionTabIcon": "Yvqh9W_sessionTabIcon",
2418
+ "ecommerceResultsActions": "Yvqh9W_ecommerceResultsActions",
2419
+ "canvasStateHint": "Yvqh9W_canvasStateHint",
2420
+ "lightboxActions": "Yvqh9W_lightboxActions",
2421
+ "modeRow": "Yvqh9W_modeRow",
2422
+ "galleryFilterCount": "Yvqh9W_galleryFilterCount",
2423
+ "prompt": "Yvqh9W_prompt",
2048
2424
  "lightboxZoomLevel": "Yvqh9W_lightboxZoomLevel",
2425
+ "lightboxEdit": "Yvqh9W_lightboxEdit",
2426
+ "galleryFilterNote": "Yvqh9W_galleryFilterNote",
2427
+ "compareModelChoices": "Yvqh9W_compareModelChoices",
2428
+ "comparisonFullscreen": "Yvqh9W_comparisonFullscreen",
2429
+ "galleryTagEdit": "Yvqh9W_galleryTagEdit",
2430
+ "galleryRatio": "Yvqh9W_galleryRatio",
2431
+ "topNavDivider": "Yvqh9W_topNavDivider",
2432
+ "canvasEmptyIcon": "Yvqh9W_canvasEmptyIcon",
2433
+ "comparisonGrid": "Yvqh9W_comparisonGrid",
2049
2434
  "historyPrompt": "Yvqh9W_historyPrompt",
2050
- "ecommercePlanMini": "Yvqh9W_ecommercePlanMini",
2435
+ "galleryCount": "Yvqh9W_galleryCount",
2051
2436
  "sessionTabLabel": "Yvqh9W_sessionTabLabel",
2052
- "prompt": "Yvqh9W_prompt",
2053
- "lightboxMeta": "Yvqh9W_lightboxMeta",
2054
- "modelLabel": "Yvqh9W_modelLabel",
2055
- "gallerySelectionBar": "Yvqh9W_gallerySelectionBar",
2056
- "galleryCardActions": "Yvqh9W_galleryCardActions",
2057
- "galleryAvatar": "Yvqh9W_galleryAvatar",
2058
- "githubLink": "Yvqh9W_githubLink",
2059
- "galleryToolbar": "Yvqh9W_galleryToolbar",
2060
- "galleryCardFooter": "Yvqh9W_galleryCardFooter",
2437
+ "historyTitle": "Yvqh9W_historyTitle",
2438
+ "updateRelease": "Yvqh9W_updateRelease",
2439
+ "historyFilters": "Yvqh9W_historyFilters",
2440
+ "historyItem": "Yvqh9W_historyItem",
2441
+ "ecommerceWorkspace": "Yvqh9W_ecommerceWorkspace",
2442
+ "chatResizer": "Yvqh9W_chatResizer",
2443
+ "ecommerceStructureGrid": "Yvqh9W_ecommerceStructureGrid",
2444
+ "ecommerceAsset": "Yvqh9W_ecommerceAsset",
2445
+ "ecommercePlanBack": "Yvqh9W_ecommercePlanBack",
2446
+ "uploadIcon": "Yvqh9W_uploadIcon",
2447
+ "uploadHint": "Yvqh9W_uploadHint",
2448
+ "modelMenuItem": "Yvqh9W_modelMenuItem",
2449
+ "canvasStateTitle": "Yvqh9W_canvasStateTitle",
2450
+ "canvasBody": "Yvqh9W_canvasBody",
2451
+ "ecommercePlanMini": "Yvqh9W_ecommercePlanMini",
2452
+ "conversationAdd": "Yvqh9W_conversationAdd",
2453
+ "conversationToast": "Yvqh9W_conversationToast",
2454
+ "compareControl": "Yvqh9W_compareControl",
2455
+ "historyActions": "Yvqh9W_historyActions",
2456
+ "promptFooter": "Yvqh9W_promptFooter",
2457
+ "configGuide": "Yvqh9W_configGuide",
2458
+ "gallerySort": "Yvqh9W_gallerySort",
2459
+ "ecommerceSection": "Yvqh9W_ecommerceSection",
2460
+ "paramGroup": "Yvqh9W_paramGroup",
2461
+ "ecommerceAdvancedChevron": "Yvqh9W_ecommerceAdvancedChevron",
2462
+ "generateInner": "Yvqh9W_generateInner",
2463
+ "galleryCard": "Yvqh9W_galleryCard",
2464
+ "imageCard": "Yvqh9W_imageCard",
2465
+ "grid": "Yvqh9W_grid",
2466
+ "configResizer": "Yvqh9W_configResizer",
2467
+ "canvasHistoryTag": "Yvqh9W_canvasHistoryTag",
2468
+ "configScroll": "Yvqh9W_configScroll",
2469
+ "view": "Yvqh9W_view",
2470
+ "lightbox": "Yvqh9W_lightbox",
2471
+ "historyInfo": "Yvqh9W_historyInfo",
2472
+ "comparisonBoard": "Yvqh9W_comparisonBoard",
2473
+ "templatesButton": "Yvqh9W_templatesButton",
2061
2474
  "compareToggle": "Yvqh9W_compareToggle",
2475
+ "paramLabel": "Yvqh9W_paramLabel",
2476
+ "ecommerceParamGrid": "Yvqh9W_ecommerceParamGrid",
2477
+ "galleryClear": "Yvqh9W_galleryClear",
2478
+ "taskRow": "Yvqh9W_taskRow",
2479
+ "ecommerceTaskCard": "Yvqh9W_ecommerceTaskCard",
2480
+ "ecommerceResults": "Yvqh9W_ecommerceResults",
2481
+ "enhanceButton": "Yvqh9W_enhanceButton",
2482
+ "config": "Yvqh9W_config",
2483
+ "bigSpinner": "Yvqh9W_bigSpinner",
2062
2484
  "historySearch": "Yvqh9W_historySearch",
2063
- "lightboxFigure": "Yvqh9W_lightboxFigure",
2064
- "uploadBox": "Yvqh9W_uploadBox",
2485
+ "footer": "Yvqh9W_footer",
2486
+ "zoomHint": "Yvqh9W_zoomHint",
2487
+ "galleryToast": "Yvqh9W_galleryToast",
2488
+ "generation": "Yvqh9W_generation",
2489
+ "ecommerceAssets": "Yvqh9W_ecommerceAssets",
2490
+ "dshImageGenToastIn": "Yvqh9W_dshImageGenToastIn",
2491
+ "topNav": "Yvqh9W_topNav",
2492
+ "historyEmpty": "Yvqh9W_historyEmpty",
2493
+ "ecommerceRefRow": "Yvqh9W_ecommerceRefRow",
2065
2494
  "galleryFilter": "Yvqh9W_galleryFilter",
2066
- "galleryTagEditor": "Yvqh9W_galleryTagEditor",
2067
- "download": "Yvqh9W_download",
2068
- "galleryToolbarActions": "Yvqh9W_galleryToolbarActions",
2069
- "imageCard": "Yvqh9W_imageCard",
2495
+ "galleryRatioList": "Yvqh9W_galleryRatioList",
2496
+ "comparisonImageButton": "Yvqh9W_comparisonImageButton",
2497
+ "spinner": "Yvqh9W_spinner",
2070
2498
  "comparisonFullscreenGrid": "Yvqh9W_comparisonFullscreenGrid",
2499
+ "lightboxCaptionRow": "Yvqh9W_lightboxCaptionRow",
2071
2500
  "gallerySelect": "Yvqh9W_gallerySelect",
2072
- "taskTrayHeader": "Yvqh9W_taskTrayHeader",
2073
- "ecommerceResultsActions": "Yvqh9W_ecommerceResultsActions",
2074
- "topNav": "Yvqh9W_topNav",
2075
- "connectionStatus": "Yvqh9W_connectionStatus",
2076
- "ecommercePlanWarn": "Yvqh9W_ecommercePlanWarn",
2077
- "paramLabel": "Yvqh9W_paramLabel",
2501
+ "ecommerceFooterBody": "Yvqh9W_ecommerceFooterBody",
2078
2502
  "ecommerceGroup": "Yvqh9W_ecommerceGroup",
2079
- "canvasEmptyIcon": "Yvqh9W_canvasEmptyIcon",
2080
- "sessionTabIcon": "Yvqh9W_sessionTabIcon",
2081
- "historyAction": "Yvqh9W_historyAction",
2082
- "ecommerceSlotCard": "Yvqh9W_ecommerceSlotCard",
2083
- "panelHeaderActions": "Yvqh9W_panelHeaderActions",
2084
- "modelMenuList": "Yvqh9W_modelMenuList",
2085
- "taskTrayToggle": "Yvqh9W_taskTrayToggle",
2086
- "updateActions": "Yvqh9W_updateActions",
2087
- "uploadIcon": "Yvqh9W_uploadIcon",
2088
- "canvasMeta": "Yvqh9W_canvasMeta",
2089
- "canvasHistoryTag": "Yvqh9W_canvasHistoryTag",
2090
- "dshImageGenSpin": "Yvqh9W_dshImageGenSpin",
2503
+ "history": "Yvqh9W_history",
2504
+ "ecommerceField": "Yvqh9W_ecommerceField",
2505
+ "ecommerceGroups": "Yvqh9W_ecommerceGroups",
2506
+ "referenceActions": "Yvqh9W_referenceActions",
2507
+ "paramHint": "Yvqh9W_paramHint",
2508
+ "ecommercePlanList": "Yvqh9W_ecommercePlanList",
2509
+ "lightboxFigure": "Yvqh9W_lightboxFigure",
2510
+ "image": "Yvqh9W_image",
2511
+ "sidebarHistoryHost": "Yvqh9W_sidebarHistoryHost",
2512
+ "galleryFilterDivider": "Yvqh9W_galleryFilterDivider",
2513
+ "ecommercePlanWarn": "Yvqh9W_ecommercePlanWarn",
2514
+ "galleryToolbarActions": "Yvqh9W_galleryToolbarActions",
2515
+ "updateText": "Yvqh9W_updateText",
2516
+ "taskTrayClose": "Yvqh9W_taskTrayClose",
2517
+ "gallerySelectMode": "Yvqh9W_gallerySelectMode",
2518
+ "gallerySelectionClear": "Yvqh9W_gallerySelectionClear",
2519
+ "taskTray": "Yvqh9W_taskTray",
2520
+ "imageCaption": "Yvqh9W_imageCaption",
2091
2521
  "galleryImageButton": "Yvqh9W_galleryImageButton",
2092
- "gallerySearch": "Yvqh9W_gallerySearch",
2093
- "historyItem": "Yvqh9W_historyItem",
2522
+ "taskTrayToggle": "Yvqh9W_taskTrayToggle",
2523
+ "ecommerceAdvancedBody": "Yvqh9W_ecommerceAdvancedBody",
2524
+ "ecommerceActionChip": "Yvqh9W_ecommerceActionChip",
2525
+ "previewBadge": "Yvqh9W_previewBadge",
2526
+ "galleryMasonry": "Yvqh9W_galleryMasonry",
2527
+ "galleryCardFooter": "Yvqh9W_galleryCardFooter",
2528
+ "lightboxTools": "Yvqh9W_lightboxTools",
2094
2529
  "promptCount": "Yvqh9W_promptCount",
2095
- "grid": "Yvqh9W_grid",
2096
- "historyHeaderActions": "Yvqh9W_historyHeaderActions",
2097
- "view": "Yvqh9W_view",
2098
- "taskStatus": "Yvqh9W_taskStatus",
2099
- "taskRow": "Yvqh9W_taskRow",
2100
- "galleryCard": "Yvqh9W_galleryCard",
2101
- "footer": "Yvqh9W_footer",
2102
- "galleryImage": "Yvqh9W_galleryImage",
2103
- "ecommerceGroupGrid": "Yvqh9W_ecommerceGroupGrid",
2104
- "panelHeader": "Yvqh9W_panelHeader",
2105
- "lightboxDownload": "Yvqh9W_lightboxDownload",
2106
- "ecommerceSection": "Yvqh9W_ecommerceSection",
2107
- "hiddenFile": "Yvqh9W_hiddenFile",
2108
- "galleryRatio": "Yvqh9W_galleryRatio",
2530
+ "lightboxImage": "Yvqh9W_lightboxImage",
2531
+ "lightboxMeta": "Yvqh9W_lightboxMeta",
2532
+ "gallerySelectionBar": "Yvqh9W_gallerySelectionBar",
2533
+ "galleryBulkButton": "Yvqh9W_galleryBulkButton",
2534
+ "lightboxClose": "Yvqh9W_lightboxClose",
2535
+ "galleryTagEditor": "Yvqh9W_galleryTagEditor",
2109
2536
  "ecommerceResultsEmpty": "Yvqh9W_ecommerceResultsEmpty",
2110
- "historyMain": "Yvqh9W_historyMain",
2111
- "configGuide": "Yvqh9W_configGuide",
2112
- "connectionDot": "Yvqh9W_connectionDot",
2113
- "historyFilters": "Yvqh9W_historyFilters",
2114
- "config": "Yvqh9W_config",
2115
- "ecommerceFooterBody": "Yvqh9W_ecommerceFooterBody",
2116
- "modePill": "Yvqh9W_modePill",
2117
- "ecommerceTaskActions": "Yvqh9W_ecommerceTaskActions",
2118
- "reference": "Yvqh9W_reference",
2119
- "galleryAdd": "Yvqh9W_galleryAdd",
2120
- "gallerySort": "Yvqh9W_gallerySort",
2121
- "galleryViewToggle": "Yvqh9W_galleryViewToggle",
2122
- "galleryMasonry": "Yvqh9W_galleryMasonry",
2537
+ "ecommercePlanNote": "Yvqh9W_ecommercePlanNote",
2538
+ "githubLink": "Yvqh9W_githubLink",
2123
2539
  "galleryRemove": "Yvqh9W_galleryRemove",
2540
+ "referenceImage": "Yvqh9W_referenceImage",
2541
+ "lightboxNav": "Yvqh9W_lightboxNav",
2542
+ "ecommerceFooterHint": "Yvqh9W_ecommerceFooterHint",
2543
+ "lightboxTool": "Yvqh9W_lightboxTool",
2544
+ "ecommerceSlotCount": "Yvqh9W_ecommerceSlotCount",
2545
+ "panelHeading": "Yvqh9W_panelHeading",
2546
+ "optionGrid": "Yvqh9W_optionGrid",
2547
+ "download": "Yvqh9W_download",
2548
+ "lightboxDownload": "Yvqh9W_lightboxDownload",
2549
+ "canvasError": "Yvqh9W_canvasError",
2550
+ "taskTrayChevron": "Yvqh9W_taskTrayChevron",
2124
2551
  "galleryTagInput": "Yvqh9W_galleryTagInput",
2125
- "updateText": "Yvqh9W_updateText",
2126
- "generation": "Yvqh9W_generation",
2127
- "ecommerceAdvancedToggle": "Yvqh9W_ecommerceAdvancedToggle",
2128
- "image": "Yvqh9W_image",
2129
- "historyMeta": "Yvqh9W_historyMeta",
2130
- "modelWrap": "Yvqh9W_modelWrap",
2131
- "lightboxStage": "Yvqh9W_lightboxStage",
2552
+ "card": "Yvqh9W_card",
2132
2553
  "lightboxIndex": "Yvqh9W_lightboxIndex",
2133
- "galleryFilterCount": "Yvqh9W_galleryFilterCount",
2134
- "galleryTagFilterList": "Yvqh9W_galleryTagFilterList",
2135
- "comparisonGrid": "Yvqh9W_comparisonGrid",
2136
- "historyClear": "Yvqh9W_historyClear",
2137
- "studio": "Yvqh9W_studio",
2138
- "ecommercePrimaryAction": "Yvqh9W_ecommercePrimaryAction",
2139
- "previewBadge": "Yvqh9W_previewBadge",
2140
- "chatToggle": "Yvqh9W_chatToggle",
2141
- "lightboxTool": "Yvqh9W_lightboxTool",
2142
- "historyList": "Yvqh9W_historyList",
2143
- "ecommerceAdvancedBody": "Yvqh9W_ecommerceAdvancedBody",
2144
- "dshImageGenToastIn": "Yvqh9W_dshImageGenToastIn",
2145
- "history": "Yvqh9W_history",
2146
- "modelMenuItem": "Yvqh9W_modelMenuItem",
2147
- "sessionTabs": "Yvqh9W_sessionTabs",
2148
- "ecommerceStructureGrid": "Yvqh9W_ecommerceStructureGrid",
2149
- "canvasStateHint": "Yvqh9W_canvasStateHint",
2150
- "ecommerceSectionHint": "Yvqh9W_ecommerceSectionHint",
2554
+ "galleryCardAction": "Yvqh9W_galleryCardAction",
2555
+ "galleryImage": "Yvqh9W_galleryImage",
2556
+ "historyMain": "Yvqh9W_historyMain",
2557
+ "galleryBadge": "Yvqh9W_galleryBadge",
2558
+ "taskStatus": "Yvqh9W_taskStatus",
2559
+ "modelMenu": "Yvqh9W_modelMenu",
2151
2560
  "ecommerceUploadHero": "Yvqh9W_ecommerceUploadHero",
2152
- "referenceImage": "Yvqh9W_referenceImage",
2153
- "galleryTagEdit": "Yvqh9W_galleryTagEdit",
2154
- "ecommerceTaskCard": "Yvqh9W_ecommerceTaskCard",
2155
- "ecommercePlanNote": "Yvqh9W_ecommercePlanNote",
2156
- "ecommerceActionChip": "Yvqh9W_ecommerceActionChip",
2157
- "canvasError": "Yvqh9W_canvasError",
2158
- "galleryFilterHeading": "Yvqh9W_galleryFilterHeading",
2159
- "taskTrayClose": "Yvqh9W_taskTrayClose",
2160
- "uploadHint": "Yvqh9W_uploadHint",
2161
- "optionPill": "Yvqh9W_optionPill",
2162
- "gallerySelectionClear": "Yvqh9W_gallerySelectionClear",
2163
- "updateRelease": "Yvqh9W_updateRelease",
2164
- "historyNew": "Yvqh9W_historyNew",
2165
- "canvasBody": "Yvqh9W_canvasBody",
2561
+ "galleryAvatar": "Yvqh9W_galleryAvatar",
2562
+ "galleryTags": "Yvqh9W_galleryTags",
2563
+ "galleryHeading": "Yvqh9W_galleryHeading",
2166
2564
  "panel": "Yvqh9W_panel",
2167
- "historyInfo": "Yvqh9W_historyInfo",
2168
- "ecommerceAssetAdd": "Yvqh9W_ecommerceAssetAdd",
2169
- "panelTitle": "Yvqh9W_panelTitle",
2170
2565
  "galleryFilters": "Yvqh9W_galleryFilters",
2171
- "compareControl": "Yvqh9W_compareControl",
2172
- "galleryCardAction": "Yvqh9W_galleryCardAction"
2566
+ "canvasState": "Yvqh9W_canvasState",
2567
+ "ecommerceResultsHeader": "Yvqh9W_ecommerceResultsHeader",
2568
+ "connectionDot": "Yvqh9W_connectionDot",
2569
+ "galleryTagFilter": "Yvqh9W_galleryTagFilter",
2570
+ "historyAction": "Yvqh9W_historyAction",
2571
+ "entryLabel": "Yvqh9W_entryLabel",
2572
+ "connectionStatus": "Yvqh9W_connectionStatus",
2573
+ "historyClear": "Yvqh9W_historyClear",
2574
+ "historyThumb": "Yvqh9W_historyThumb",
2575
+ "configToggle": "Yvqh9W_configToggle",
2576
+ "taskPrompt": "Yvqh9W_taskPrompt",
2577
+ "historyHeader": "Yvqh9W_historyHeader",
2578
+ "reference": "Yvqh9W_reference",
2579
+ "modelWrap": "Yvqh9W_modelWrap",
2580
+ "modelLabel": "Yvqh9W_modelLabel",
2581
+ "hiddenFile": "Yvqh9W_hiddenFile",
2582
+ "historyThumbPlaceholder": "Yvqh9W_historyThumbPlaceholder"
2173
2583
  };
2174
2584
  //#endregion
2175
2585
  //#region src/client/ImageGenPanel.tsx
@@ -5309,47 +5719,12 @@ window.__ModuleLoader__.load({
5309
5719
  role: "alert",
5310
5720
  children: tt("canvas.error", { error })
5311
5721
  }) : null,
5312
- !generating && !error && images.length === 0 && workspace !== "ecommerce" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5313
- className: panel_module_css_default.canvasState,
5314
- children: [
5315
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5316
- className: panel_module_css_default.canvasEmptyIcon,
5317
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
5318
- viewBox: "0 0 24 24",
5319
- width: "34",
5320
- height: "34",
5321
- fill: "none",
5322
- stroke: "currentColor",
5323
- strokeWidth: "1.2",
5324
- strokeLinecap: "round",
5325
- strokeLinejoin: "round",
5326
- "aria-hidden": "true",
5327
- children: [
5328
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
5329
- x: "3",
5330
- y: "3",
5331
- width: "18",
5332
- height: "18",
5333
- rx: "3"
5334
- }),
5335
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
5336
- cx: "8.5",
5337
- cy: "8.5",
5338
- r: "1.5"
5339
- }),
5340
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 15l-5-5L5 21" })
5341
- ]
5342
- })
5343
- }),
5344
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5345
- className: panel_module_css_default.canvasStateTitle,
5346
- children: tt("canvas.emptyTitle")
5347
- }),
5348
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
5349
- className: panel_module_css_default.canvasStateHint,
5350
- children: tt("canvas.emptyHint")
5351
- })
5352
- ]
5722
+ !generating && !error && images.length === 0 && workspace !== "ecommerce" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(InspirationGallery, {
5723
+ api,
5724
+ onUse: (text) => {
5725
+ setPrompt(text);
5726
+ setError(null);
5727
+ }
5353
5728
  }) : null,
5354
5729
  !generating && images.length > 0 && workspace !== "ecommerce" ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
5355
5730
  className: panel_module_css_default.canvasBody,
@@ -6247,7 +6622,7 @@ window.__ModuleLoader__.load({
6247
6622
  }
6248
6623
  /** Publish a projection of this form, rebuilt whenever the scope or a draft changes. */
6249
6624
  bind(project) {
6250
- const store = (0, _deepseek_ai_dsh_client_runtime_client.createSnapshotStore)(project());
6625
+ const store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)(project());
6251
6626
  this.listeners.add(() => {
6252
6627
  store.set(project());
6253
6628
  });
@@ -6463,7 +6838,7 @@ window.__ModuleLoader__.load({
6463
6838
  }
6464
6839
  /** Publish a projection of this form, rebuilt on every scope or draft change. */
6465
6840
  bind(project) {
6466
- const store = (0, _deepseek_ai_dsh_client_runtime_client.createSnapshotStore)(project());
6841
+ const store = (0, _deepseek_ai_dsh_client_store.createSnapshotStore)(project());
6467
6842
  this.listeners.add(() => {
6468
6843
  store.set(project());
6469
6844
  });
@@ -6650,97 +7025,97 @@ window.__ModuleLoader__.load({
6650
7025
  document.head.appendChild(tag);
6651
7026
  }
6652
7027
  var settings_card_module_css_default = {
6653
- "modelBadge": "i1cc5G_modelBadge",
6654
- "headText": "i1cc5G_headText",
6655
- "channelDotWarn": "i1cc5G_channelDotWarn",
6656
- "channelName": "i1cc5G_channelName",
6657
- "spacer": "i1cc5G_spacer",
6658
- "modelRows": "i1cc5G_modelRows",
6659
- "save": "i1cc5G_save",
6660
- "input": "i1cc5G_input",
7028
+ "pending": "i1cc5G_pending",
7029
+ "card": "i1cc5G_card",
7030
+ "badge": "i1cc5G_badge",
6661
7031
  "optionalContent": "i1cc5G_optionalContent",
6662
- "modelSection": "i1cc5G_modelSection",
6663
- "chevron": "i1cc5G_chevron",
6664
7032
  "presetList": "i1cc5G_presetList",
6665
- "channelAddRow": "i1cc5G_channelAddRow",
7033
+ "headText": "i1cc5G_headText",
7034
+ "header": "i1cc5G_header",
7035
+ "notExposed": "i1cc5G_notExposed",
7036
+ "disclosure": "i1cc5G_disclosure",
7037
+ "footer": "i1cc5G_footer",
6666
7038
  "channelRow": "i1cc5G_channelRow",
6667
- "badge": "i1cc5G_badge",
7039
+ "editorPanel": "i1cc5G_editorPanel",
7040
+ "badges": "i1cc5G_badges",
7041
+ "editorField": "i1cc5G_editorField",
6668
7042
  "select": "i1cc5G_select",
6669
- "modelRowRemove": "i1cc5G_modelRowRemove",
7043
+ "chevronOpen": "i1cc5G_chevronOpen",
7044
+ "editorFooter": "i1cc5G_editorFooter",
6670
7045
  "presetMeta": "i1cc5G_presetMeta",
6671
- "textareaInvalid": "i1cc5G_textareaInvalid",
6672
- "failed": "i1cc5G_failed",
6673
- "editorPanel": "i1cc5G_editorPanel",
6674
- "presetHint": "i1cc5G_presetHint",
6675
- "modelChip": "i1cc5G_modelChip",
6676
- "modelChoices": "i1cc5G_modelChoices",
6677
- "reset": "i1cc5G_reset",
6678
- "detectOk": "i1cc5G_detectOk",
6679
- "channelAction": "i1cc5G_channelAction",
6680
- "hint": "i1cc5G_hint",
6681
- "modelSummary": "i1cc5G_modelSummary",
6682
- "presetName": "i1cc5G_presetName",
6683
- "sectionDivider": "i1cc5G_sectionDivider",
6684
- "discard": "i1cc5G_discard",
6685
- "textarea": "i1cc5G_textarea",
6686
- "channelAdd": "i1cc5G_channelAdd",
6687
- "editorDivider": "i1cc5G_editorDivider",
7046
+ "modelCandidate": "i1cc5G_modelCandidate",
6688
7047
  "channelList": "i1cc5G_channelList",
6689
- "editorSectionHeader": "i1cc5G_editorSectionHeader",
6690
- "channelBadge": "i1cc5G_channelBadge",
6691
- "presetRow": "i1cc5G_presetRow",
6692
- "invalid": "i1cc5G_invalid",
6693
- "presetInlineHeader": "i1cc5G_presetInlineHeader",
6694
- "sectionHint": "i1cc5G_sectionHint",
6695
- "modelFetch": "i1cc5G_modelFetch",
6696
- "addModel": "i1cc5G_addModel",
6697
- "modelArrow": "i1cc5G_modelArrow",
6698
- "editorClose": "i1cc5G_editorClose",
6699
- "sectionTitle": "i1cc5G_sectionTitle",
6700
- "badges": "i1cc5G_badges",
6701
- "disclosure": "i1cc5G_disclosure",
6702
- "modelCandidateList": "i1cc5G_modelCandidateList",
6703
- "modelCandidateLabel": "i1cc5G_modelCandidateLabel",
6704
- "inlineDisclosure": "i1cc5G_inlineDisclosure",
6705
- "versionLabel": "i1cc5G_versionLabel",
6706
- "channelEmpty": "i1cc5G_channelEmpty",
6707
7048
  "channelMain": "i1cc5G_channelMain",
6708
- "deleteConfirmText": "i1cc5G_deleteConfirmText",
6709
- "versionRow": "i1cc5G_versionRow",
6710
7049
  "name": "i1cc5G_name",
7050
+ "chevron": "i1cc5G_chevron",
7051
+ "modelBadge": "i1cc5G_modelBadge",
6711
7052
  "editorHeader": "i1cc5G_editorHeader",
6712
- "editorFooter": "i1cc5G_editorFooter",
6713
- "channelDotReady": "i1cc5G_channelDotReady",
6714
- "editorBackdrop": "i1cc5G_editorBackdrop",
6715
- "footer": "i1cc5G_footer",
6716
- "notExposed": "i1cc5G_notExposed",
6717
- "head": "i1cc5G_head",
7053
+ "presetInline": "i1cc5G_presetInline",
7054
+ "modelChip": "i1cc5G_modelChip",
7055
+ "failed": "i1cc5G_failed",
6718
7056
  "versionValue": "i1cc5G_versionValue",
6719
- "body": "i1cc5G_body",
6720
- "inputInvalid": "i1cc5G_inputInvalid",
6721
- "modelRow": "i1cc5G_modelRow",
6722
- "sectionHeader": "i1cc5G_sectionHeader",
6723
- "modelRowBadges": "i1cc5G_modelRowBadges",
7057
+ "head": "i1cc5G_head",
7058
+ "editorSectionHeader": "i1cc5G_editorSectionHeader",
7059
+ "editorDivider": "i1cc5G_editorDivider",
7060
+ "sectionHint": "i1cc5G_sectionHint",
7061
+ "versionLabel": "i1cc5G_versionLabel",
7062
+ "sectionDivider": "i1cc5G_sectionDivider",
7063
+ "channelDotWarn": "i1cc5G_channelDotWarn",
6724
7064
  "channelDanger": "i1cc5G_channelDanger",
6725
- "field": "i1cc5G_field",
6726
- "description": "i1cc5G_description",
6727
- "modelCandidate": "i1cc5G_modelCandidate",
6728
- "channelSection": "i1cc5G_channelSection",
6729
- "channelControls": "i1cc5G_channelControls",
7065
+ "label": "i1cc5G_label",
7066
+ "save": "i1cc5G_save",
7067
+ "editorClose": "i1cc5G_editorClose",
7068
+ "presetInlineHeader": "i1cc5G_presetInlineHeader",
7069
+ "channelHost": "i1cc5G_channelHost",
6730
7070
  "channelMeta": "i1cc5G_channelMeta",
6731
- "card": "i1cc5G_card",
6732
- "editorField": "i1cc5G_editorField",
6733
- "presetInline": "i1cc5G_presetInline",
7071
+ "presetName": "i1cc5G_presetName",
7072
+ "presetRow": "i1cc5G_presetRow",
7073
+ "reset": "i1cc5G_reset",
7074
+ "description": "i1cc5G_description",
7075
+ "inputInvalid": "i1cc5G_inputInvalid",
6734
7076
  "modelFetchRow": "i1cc5G_modelFetchRow",
6735
- "header": "i1cc5G_header",
6736
- "pending": "i1cc5G_pending",
7077
+ "body": "i1cc5G_body",
7078
+ "invalid": "i1cc5G_invalid",
7079
+ "textareaInvalid": "i1cc5G_textareaInvalid",
7080
+ "sectionHeader": "i1cc5G_sectionHeader",
7081
+ "modelChoices": "i1cc5G_modelChoices",
7082
+ "channelAction": "i1cc5G_channelAction",
6737
7083
  "editorTools": "i1cc5G_editorTools",
7084
+ "discard": "i1cc5G_discard",
7085
+ "channelSection": "i1cc5G_channelSection",
7086
+ "channelName": "i1cc5G_channelName",
7087
+ "modelRowRemove": "i1cc5G_modelRowRemove",
7088
+ "modelRow": "i1cc5G_modelRow",
7089
+ "modelRowBadges": "i1cc5G_modelRowBadges",
7090
+ "modelArrow": "i1cc5G_modelArrow",
7091
+ "channelControls": "i1cc5G_channelControls",
7092
+ "field": "i1cc5G_field",
7093
+ "deleteConfirmText": "i1cc5G_deleteConfirmText",
7094
+ "addModel": "i1cc5G_addModel",
7095
+ "modelRows": "i1cc5G_modelRows",
7096
+ "channelBadge": "i1cc5G_channelBadge",
7097
+ "inlineDisclosure": "i1cc5G_inlineDisclosure",
7098
+ "channelAdd": "i1cc5G_channelAdd",
7099
+ "presetHint": "i1cc5G_presetHint",
7100
+ "textarea": "i1cc5G_textarea",
7101
+ "modelSummary": "i1cc5G_modelSummary",
7102
+ "manualModelRow": "i1cc5G_manualModelRow",
7103
+ "modelFetch": "i1cc5G_modelFetch",
6738
7104
  "readOnly": "i1cc5G_readOnly",
7105
+ "hint": "i1cc5G_hint",
7106
+ "spacer": "i1cc5G_spacer",
7107
+ "editorBackdrop": "i1cc5G_editorBackdrop",
7108
+ "modelSection": "i1cc5G_modelSection",
7109
+ "input": "i1cc5G_input",
7110
+ "detectOk": "i1cc5G_detectOk",
7111
+ "versionRow": "i1cc5G_versionRow",
7112
+ "sectionTitle": "i1cc5G_sectionTitle",
6739
7113
  "modelRowInputs": "i1cc5G_modelRowInputs",
6740
- "chevronOpen": "i1cc5G_chevronOpen",
6741
- "label": "i1cc5G_label",
6742
- "manualModelRow": "i1cc5G_manualModelRow",
6743
- "channelHost": "i1cc5G_channelHost"
7114
+ "modelCandidateList": "i1cc5G_modelCandidateList",
7115
+ "modelCandidateLabel": "i1cc5G_modelCandidateLabel",
7116
+ "channelEmpty": "i1cc5G_channelEmpty",
7117
+ "channelAddRow": "i1cc5G_channelAddRow",
7118
+ "channelDotReady": "i1cc5G_channelDotReady"
6744
7119
  };
6745
7120
  //#endregion
6746
7121
  //#region src/client/SettingsCard.tsx
@@ -8003,16 +8378,16 @@ window.__ModuleLoader__.load({
8003
8378
  document.head.appendChild(tag);
8004
8379
  }
8005
8380
  var image_toolview_module_css_default = {
8381
+ "images": "_3eGrYG_images",
8382
+ "message": "_3eGrYG_message",
8006
8383
  "loading": "_3eGrYG_loading",
8384
+ "header": "_3eGrYG_header",
8007
8385
  "icon": "_3eGrYG_icon",
8386
+ "error": "_3eGrYG_error",
8387
+ "image": "_3eGrYG_image",
8008
8388
  "imageLink": "_3eGrYG_imageLink",
8009
- "images": "_3eGrYG_images",
8010
8389
  "status": "_3eGrYG_status",
8011
- "header": "_3eGrYG_header",
8012
- "root": "_3eGrYG_root",
8013
- "image": "_3eGrYG_image",
8014
- "error": "_3eGrYG_error",
8015
- "message": "_3eGrYG_message"
8390
+ "root": "_3eGrYG_root"
8016
8391
  };
8017
8392
  //#endregion
8018
8393
  //#region src/client/image-toolview.tsx
@@ -8021,8 +8396,7 @@ window.__ModuleLoader__.load({
8021
8396
  }
8022
8397
  function imageRefsOf(block) {
8023
8398
  if (!isSettled(block)) return [];
8024
- const resultContent = block.resultView?.card === "generic" ? block.resultView.content ?? [] : [];
8025
- return [...block.content, ...resultContent].flatMap((content) => content.type === "image" ? [content.attachment] : []);
8399
+ return block.content.flatMap((content) => content.type === "image" ? [content.attachment] : []);
8026
8400
  }
8027
8401
  function textOf(block) {
8028
8402
  if (!isSettled(block)) return "";
@@ -8178,7 +8552,8 @@ window.__ModuleLoader__.load({
8178
8552
  "get_image_generation_task"
8179
8553
  ]) yield ctx.slots.register({
8180
8554
  name: "tool.call.toolview",
8181
- key
8555
+ key,
8556
+ inject: (sessionId) => ({ sessionId })
8182
8557
  }, ImageToolView);
8183
8558
  });
8184
8559
  }