@dickpy/dsh-imagegen 1.0.6 → 1.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js CHANGED
@@ -12,7 +12,7 @@ window.__ModuleLoader__.load({
12
12
  let _deepseek_ai_dsh_client_runtime_client = require("@deepseek-ai/dsh-client-runtime/client");
13
13
  //#region src/protocol.ts
14
14
  /** Published package version shared by the host updater and the client UI. */
15
- const PLUGIN_VERSION = "1.0.6";
15
+ const PLUGIN_VERSION = "1.0.9";
16
16
  /** Same-origin route family (loopback-only, mirroring the dsh-ssh fence). */
17
17
  const SETTINGS_API = {
18
18
  describe: "/api/dsh-imagegen/settings/describe",
@@ -38,6 +38,17 @@ window.__ModuleLoader__.load({
38
38
  clear: "/api/dsh-imagegen/history/clear",
39
39
  image: "/api/dsh-imagegen/history/image"
40
40
  };
41
+ /**
42
+ * Same-origin route family for the bundled prompt-template library
43
+ * (awesome-gpt-image-2 mirror). The case list ships inside the package and is
44
+ * served by the host; reference images are proxied through the `image` prefix
45
+ * route and cached on disk so repeated views never hit the network again.
46
+ */
47
+ const TEMPLATES_API = {
48
+ list: "/api/dsh-imagegen/templates/list",
49
+ refresh: "/api/dsh-imagegen/templates/refresh",
50
+ image: "/api/dsh-imagegen/templates/image"
51
+ };
41
52
  //#endregion
42
53
  //#region src/client/api.ts
43
54
  /**
@@ -114,6 +125,25 @@ window.__ModuleLoader__.load({
114
125
  async historyClear() {
115
126
  return (await readEnvelope(await fetch(HISTORY_API.clear, { method: "POST" }))).entries;
116
127
  }
128
+ /** Fetch the prompt-template library (bundled snapshot or refreshed copy). */
129
+ async templatesList() {
130
+ const body = await readEnvelope(await fetch(TEMPLATES_API.list, { method: "POST" }));
131
+ return {
132
+ cases: body.cases,
133
+ total: body.total,
134
+ origin: body.origin,
135
+ repository: body.repository,
136
+ fetchedAt: body.fetchedAt
137
+ };
138
+ }
139
+ /** Re-download the template library from the upstream mirror (host-side). */
140
+ async templatesRefresh() {
141
+ const body = await readEnvelope(await fetch(TEMPLATES_API.refresh, { method: "POST" }));
142
+ return {
143
+ total: body.total,
144
+ fetchedAt: body.fetchedAt
145
+ };
146
+ }
117
147
  };
118
148
  //#endregion
119
149
  //#region src/client/controller.ts
@@ -261,7 +291,34 @@ window.__ModuleLoader__.load({
261
291
  "settings.off": "关",
262
292
  "settings.overridden": "已覆盖",
263
293
  "settings.reset": "重置",
264
- "settings.invalidNumber": "请输入有效数字"
294
+ "settings.invalidNumber": "请输入有效数字",
295
+ "templates.open": "模板库",
296
+ "templates.title": "提示词模板库",
297
+ "templates.meta": "共 {count} 个模板 · {origin}",
298
+ "templates.origin.bundled": "内置快照",
299
+ "templates.origin.refreshed": "在线刷新",
300
+ "templates.search": "搜索模板标题或提示词…",
301
+ "templates.all": "全部",
302
+ "templates.close": "关闭",
303
+ "templates.back": "返回列表",
304
+ "templates.use": "使用此提示词",
305
+ "templates.copy": "复制提示词",
306
+ "templates.copied": "已复制",
307
+ "templates.refresh": "刷新模板库",
308
+ "templates.refreshing": "刷新中…",
309
+ "templates.refreshed": "已刷新,共 {count} 个模板",
310
+ "templates.refreshFailed": "刷新失败:{error}",
311
+ "templates.cacheAll": "缓存全部图片",
312
+ "templates.cacheAllHint": "通过本机代理把全部参考图缓存到本地磁盘,之后离线也能浏览",
313
+ "templates.caching": "缓存中 {done}/{total}…",
314
+ "templates.cached": "图片已全部缓存",
315
+ "templates.empty": "没有匹配的模板",
316
+ "templates.loading": "正在加载模板库…",
317
+ "templates.loadFailed": "模板库加载失败:{error}",
318
+ "templates.retry": "重试",
319
+ "templates.attribution": "模板与图片来自 awesome-gpt-image-2 项目,作者链接见各模板详情",
320
+ "templates.source": "来源:vibeui.top",
321
+ "templates.featured": "精选"
265
322
  };
266
323
  const en = {
267
324
  "entry.label": "AI Image",
@@ -371,7 +428,34 @@ window.__ModuleLoader__.load({
371
428
  "settings.off": "Off",
372
429
  "settings.overridden": "Overridden",
373
430
  "settings.reset": "Reset",
374
- "settings.invalidNumber": "Enter a valid number"
431
+ "settings.invalidNumber": "Enter a valid number",
432
+ "templates.open": "Templates",
433
+ "templates.title": "Prompt Template Library",
434
+ "templates.meta": "{count} templates · {origin}",
435
+ "templates.origin.bundled": "bundled snapshot",
436
+ "templates.origin.refreshed": "refreshed online",
437
+ "templates.search": "Search template titles or prompts…",
438
+ "templates.all": "All",
439
+ "templates.close": "Close",
440
+ "templates.back": "Back to list",
441
+ "templates.use": "Use this prompt",
442
+ "templates.copy": "Copy prompt",
443
+ "templates.copied": "Copied",
444
+ "templates.refresh": "Refresh library",
445
+ "templates.refreshing": "Refreshing…",
446
+ "templates.refreshed": "Refreshed — {count} templates",
447
+ "templates.refreshFailed": "Refresh failed: {error}",
448
+ "templates.cacheAll": "Cache all images",
449
+ "templates.cacheAllHint": "Mirror every reference image to local disk through the host proxy, for offline browsing",
450
+ "templates.caching": "Caching {done}/{total}…",
451
+ "templates.cached": "All images cached",
452
+ "templates.empty": "No matching templates",
453
+ "templates.loading": "Loading the template library…",
454
+ "templates.loadFailed": "Failed to load the library: {error}",
455
+ "templates.retry": "Retry",
456
+ "templates.attribution": "Templates and images come from the awesome-gpt-image-2 project; author links are on each template",
457
+ "templates.source": "Source: vibeui.top",
458
+ "templates.featured": "Featured"
375
459
  };
376
460
  //#endregion
377
461
  //#region src/client/helpers.ts
@@ -398,8 +482,535 @@ window.__ModuleLoader__.load({
398
482
  return String(error);
399
483
  }
400
484
  //#endregion
485
+ //#region \0dsh-css:E:\dsh-plugin\src\client\templates.module.css.mjs
486
+ const css$2 = ".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}}";
487
+ const tagId$2 = "@dickpy/dsh-imagegen/templates.module.css";
488
+ if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$2) + "]") === null) {
489
+ const tag = document.createElement("style");
490
+ tag.dataset.plugin = "@dickpy/dsh-imagegen";
491
+ tag.dataset.pluginCss = tagId$2;
492
+ tag.textContent = css$2;
493
+ document.head.appendChild(tag);
494
+ }
495
+ var templates_module_css_default = {
496
+ "title": "o0mAxG_title",
497
+ "meta": "o0mAxG_meta",
498
+ "cardBody": "o0mAxG_cardBody",
499
+ "thumb": "o0mAxG_thumb",
500
+ "cardSource": "o0mAxG_cardSource",
501
+ "card": "o0mAxG_card",
502
+ "detailActions": "o0mAxG_detailActions",
503
+ "dsh-imagegen-templates-spin": "o0mAxG_dsh-imagegen-templates-spin",
504
+ "sourceLink": "o0mAxG_sourceLink",
505
+ "detailOverlay": "o0mAxG_detailOverlay",
506
+ "thumbPlaceholder": "o0mAxG_thumbPlaceholder",
507
+ "close": "o0mAxG_close",
508
+ "detailMedia": "o0mAxG_detailMedia",
509
+ "state": "o0mAxG_state",
510
+ "toolbar": "o0mAxG_toolbar",
511
+ "detailMeta": "o0mAxG_detailMeta",
512
+ "featuredBadge": "o0mAxG_featuredBadge",
513
+ "cardCategory": "o0mAxG_cardCategory",
514
+ "spinner": "o0mAxG_spinner",
515
+ "thumbWrap": "o0mAxG_thumbWrap",
516
+ "detailTitle": "o0mAxG_detailTitle",
517
+ "overlay": "o0mAxG_overlay",
518
+ "categoryRow": "o0mAxG_categoryRow",
519
+ "categoryPill": "o0mAxG_categoryPill",
520
+ "notice": "o0mAxG_notice",
521
+ "body": "o0mAxG_body",
522
+ "detail": "o0mAxG_detail",
523
+ "header": "o0mAxG_header",
524
+ "attribution": "o0mAxG_attribution",
525
+ "detailInfo": "o0mAxG_detailInfo",
526
+ "footer": "o0mAxG_footer",
527
+ "shell": "o0mAxG_shell",
528
+ "detailPrompt": "o0mAxG_detailPrompt",
529
+ "headerActions": "o0mAxG_headerActions",
530
+ "heading": "o0mAxG_heading",
531
+ "cardTitle": "o0mAxG_cardTitle",
532
+ "cardMeta": "o0mAxG_cardMeta",
533
+ "detailImage": "o0mAxG_detailImage",
534
+ "search": "o0mAxG_search",
535
+ "grid": "o0mAxG_grid",
536
+ "detailLink": "o0mAxG_detailLink"
537
+ };
538
+ //#endregion
539
+ //#region src/client/TemplateLibrary.tsx
540
+ /**
541
+ * Prompt-template library overlay: a searchable, category-filtered gallery of
542
+ * the bundled awesome-gpt-image-2 cases. The case list is served by the host
543
+ * (bundled snapshot, optionally refreshed online); reference images load
544
+ * lazily through the host's caching proxy, so browsing progressively mirrors
545
+ * the gallery onto the local disk. Picking a template hands its prompt back
546
+ * to the studio form.
547
+ */
548
+ /** Concurrent image downloads while caching the whole gallery offline. */
549
+ const CACHE_ALL_CONCURRENCY = 4;
550
+ /** Same-origin URL of one case's reference image (host caching proxy). */
551
+ function imageUrlOf(item) {
552
+ return `${TEMPLATES_API.image}/${encodeURIComponent(item.image)}`;
553
+ }
554
+ /** A card thumbnail that falls back to a placeholder when the proxy 404s. */
555
+ function TemplateThumb(props) {
556
+ const [failed, setFailed] = (0, react.useState)(false);
557
+ if (props.item.image === "" || failed) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
558
+ className: templates_module_css_default.thumbPlaceholder,
559
+ "aria-hidden": "true",
560
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
561
+ viewBox: "0 0 24 24",
562
+ width: "26",
563
+ height: "26",
564
+ fill: "none",
565
+ stroke: "currentColor",
566
+ strokeWidth: "1.2",
567
+ strokeLinecap: "round",
568
+ strokeLinejoin: "round",
569
+ children: [
570
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("rect", {
571
+ x: "3",
572
+ y: "3",
573
+ width: "18",
574
+ height: "18",
575
+ rx: "3"
576
+ }),
577
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("circle", {
578
+ cx: "8.5",
579
+ cy: "8.5",
580
+ r: "1.5"
581
+ }),
582
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M21 15l-5-5L5 21" })
583
+ ]
584
+ })
585
+ });
586
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
587
+ className: templates_module_css_default.thumb,
588
+ src: imageUrlOf(props.item),
589
+ alt: props.item.title,
590
+ loading: "lazy",
591
+ onError: () => {
592
+ setFailed(true);
593
+ }
594
+ });
595
+ }
596
+ /** The template-library modal. Rendered through a portal above the studio. */
597
+ function TemplateLibrary(props) {
598
+ const { api, onUse, onClose } = props;
599
+ const [list, setList] = (0, react.useState)(null);
600
+ const [loadError, setLoadError] = (0, react.useState)(null);
601
+ const [query, setQuery] = (0, react.useState)("");
602
+ const [category, setCategory] = (0, react.useState)("");
603
+ const [selected, setSelected] = (0, react.useState)(null);
604
+ const [copied, setCopied] = (0, react.useState)(false);
605
+ const [refreshing, setRefreshing] = (0, react.useState)(false);
606
+ const [notice, setNotice] = (0, react.useState)(null);
607
+ const [cacheAll, setCacheAll] = (0, react.useState)({
608
+ running: false,
609
+ done: 0,
610
+ total: 0
611
+ });
612
+ const searchRef = (0, react.useRef)(null);
613
+ const load = () => {
614
+ api.templatesList().then((result) => {
615
+ setList(result);
616
+ setLoadError(null);
617
+ }).catch((caught) => {
618
+ setLoadError(errorMessage(caught));
619
+ });
620
+ };
621
+ (0, react.useEffect)(() => {
622
+ load();
623
+ searchRef.current?.focus();
624
+ }, []);
625
+ const categories = (0, react.useMemo)(() => {
626
+ if (list === null) return [];
627
+ const counts = /* @__PURE__ */ new Map();
628
+ for (const item of list.cases) {
629
+ const entry = counts.get(item.category) ?? {
630
+ label: item.categoryZh || item.category,
631
+ count: 0
632
+ };
633
+ entry.count += 1;
634
+ counts.set(item.category, entry);
635
+ }
636
+ return [...counts.entries()].map(([key, value]) => ({
637
+ key,
638
+ label: value.label,
639
+ count: value.count
640
+ }));
641
+ }, [list]);
642
+ const filtered = (0, react.useMemo)(() => {
643
+ if (list === null) return [];
644
+ const needle = query.trim().toLowerCase();
645
+ return list.cases.filter((item) => {
646
+ if (category !== "" && item.category !== category) return false;
647
+ if (needle === "") return true;
648
+ return item.title.toLowerCase().includes(needle) || item.prompt.toLowerCase().includes(needle) || item.sourceLabel.toLowerCase().includes(needle);
649
+ });
650
+ }, [
651
+ list,
652
+ query,
653
+ category
654
+ ]);
655
+ (0, react.useEffect)(() => {
656
+ const onKey = (event) => {
657
+ if (event.key !== "Escape") return;
658
+ event.stopPropagation();
659
+ if (selected !== null) setSelected(null);
660
+ else onClose();
661
+ };
662
+ window.addEventListener("keydown", onKey, true);
663
+ return () => window.removeEventListener("keydown", onKey, true);
664
+ }, [selected, onClose]);
665
+ const refresh = async () => {
666
+ if (refreshing) return;
667
+ setRefreshing(true);
668
+ setNotice(null);
669
+ try {
670
+ const result = await api.templatesRefresh();
671
+ const reloaded = await api.templatesList();
672
+ setList(reloaded);
673
+ setLoadError(null);
674
+ setNotice(tt("templates.refreshed", { count: result.total }));
675
+ } catch (caught) {
676
+ setNotice(tt("templates.refreshFailed", { error: errorMessage(caught) }));
677
+ } finally {
678
+ setRefreshing(false);
679
+ }
680
+ };
681
+ /** Mirror every reference image through the host cache (offline browsing). */
682
+ const cacheAllImages = async () => {
683
+ if (cacheAll.running || list === null) return;
684
+ const files = [...new Set(list.cases.map((item) => item.image).filter((name) => name !== ""))];
685
+ setCacheAll({
686
+ running: true,
687
+ done: 0,
688
+ total: files.length
689
+ });
690
+ let index = 0;
691
+ const worker = async () => {
692
+ while (index < files.length) {
693
+ const file = files[index];
694
+ index += 1;
695
+ try {
696
+ await fetch(`${TEMPLATES_API.image}/${encodeURIComponent(file)}`);
697
+ } catch {}
698
+ setCacheAll((current) => ({
699
+ ...current,
700
+ done: current.done + 1
701
+ }));
702
+ }
703
+ };
704
+ await Promise.all(Array.from({ length: CACHE_ALL_CONCURRENCY }, () => worker()));
705
+ setCacheAll({
706
+ running: false,
707
+ done: files.length,
708
+ total: files.length
709
+ });
710
+ };
711
+ const copyPrompt = async (text) => {
712
+ try {
713
+ if (navigator.clipboard?.writeText !== void 0) await navigator.clipboard.writeText(text);
714
+ else {
715
+ const textarea = document.createElement("textarea");
716
+ textarea.value = text;
717
+ textarea.style.position = "fixed";
718
+ textarea.style.opacity = "0";
719
+ document.body.appendChild(textarea);
720
+ textarea.select();
721
+ const copiedOk = document.execCommand("copy");
722
+ textarea.remove();
723
+ if (!copiedOk) throw new Error("copy failed");
724
+ }
725
+ setCopied(true);
726
+ window.setTimeout(() => {
727
+ setCopied(false);
728
+ }, 1800);
729
+ } catch {
730
+ setCopied(false);
731
+ }
732
+ };
733
+ const originLabel = list === null ? "" : tt(list.origin === "refreshed" ? "templates.origin.refreshed" : "templates.origin.bundled");
734
+ return (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
735
+ className: templates_module_css_default.overlay,
736
+ role: "dialog",
737
+ "aria-modal": "true",
738
+ "aria-label": tt("templates.title"),
739
+ onClick: onClose,
740
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
741
+ className: templates_module_css_default.shell,
742
+ onClick: (event) => {
743
+ event.stopPropagation();
744
+ },
745
+ children: [
746
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("header", {
747
+ className: templates_module_css_default.header,
748
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
749
+ className: templates_module_css_default.heading,
750
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h3", {
751
+ className: templates_module_css_default.title,
752
+ children: tt("templates.title")
753
+ }), list !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
754
+ className: templates_module_css_default.meta,
755
+ children: tt("templates.meta", {
756
+ count: list.total,
757
+ origin: originLabel
758
+ })
759
+ }) : null]
760
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
761
+ className: templates_module_css_default.headerActions,
762
+ children: [
763
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
764
+ variant: "outline",
765
+ size: "sm",
766
+ disabled: refreshing || cacheAll.running,
767
+ onClick: () => {
768
+ refresh();
769
+ },
770
+ children: refreshing ? tt("templates.refreshing") : tt("templates.refresh")
771
+ }),
772
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
773
+ variant: "outline",
774
+ size: "sm",
775
+ disabled: list === null || cacheAll.running,
776
+ title: tt("templates.cacheAllHint"),
777
+ onClick: () => {
778
+ cacheAllImages();
779
+ },
780
+ children: cacheAll.running ? tt("templates.caching", {
781
+ done: cacheAll.done,
782
+ total: cacheAll.total
783
+ }) : cacheAll.total > 0 && cacheAll.done === cacheAll.total ? tt("templates.cached") : tt("templates.cacheAll")
784
+ }),
785
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
786
+ type: "button",
787
+ className: templates_module_css_default.close,
788
+ "aria-label": tt("templates.close"),
789
+ title: tt("templates.close"),
790
+ onClick: onClose,
791
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
792
+ viewBox: "0 0 16 16",
793
+ width: "16",
794
+ height: "16",
795
+ fill: "none",
796
+ stroke: "currentColor",
797
+ strokeWidth: "1.6",
798
+ strokeLinecap: "round",
799
+ "aria-hidden": "true",
800
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M4 4l8 8M12 4l-8 8" })
801
+ })
802
+ })
803
+ ]
804
+ })]
805
+ }),
806
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
807
+ className: templates_module_css_default.toolbar,
808
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
809
+ ref: searchRef,
810
+ type: "search",
811
+ className: templates_module_css_default.search,
812
+ placeholder: tt("templates.search"),
813
+ value: query,
814
+ onChange: (event) => {
815
+ setQuery(event.target.value);
816
+ }
817
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
818
+ className: templates_module_css_default.categoryRow,
819
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
820
+ type: "button",
821
+ className: templates_module_css_default.categoryPill,
822
+ "data-active": category === "" ? "" : void 0,
823
+ onClick: () => {
824
+ setCategory("");
825
+ },
826
+ children: [tt("templates.all"), list !== null ? ` ${list.total}` : ""]
827
+ }), categories.map((entry) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
828
+ type: "button",
829
+ className: templates_module_css_default.categoryPill,
830
+ "data-active": category === entry.key ? "" : void 0,
831
+ onClick: () => {
832
+ setCategory(entry.key);
833
+ },
834
+ children: [
835
+ entry.label,
836
+ " ",
837
+ entry.count
838
+ ]
839
+ }, entry.key))]
840
+ })]
841
+ }),
842
+ notice !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
843
+ className: templates_module_css_default.notice,
844
+ role: "status",
845
+ children: notice
846
+ }) : null,
847
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
848
+ className: templates_module_css_default.body,
849
+ children: [
850
+ list === null && loadError === null ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
851
+ className: templates_module_css_default.state,
852
+ role: "status",
853
+ 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") })]
854
+ }) : null,
855
+ loadError !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
856
+ className: templates_module_css_default.state,
857
+ role: "alert",
858
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { children: tt("templates.loadFailed", { error: loadError }) }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
859
+ variant: "outline",
860
+ size: "sm",
861
+ onClick: () => {
862
+ setLoadError(null);
863
+ setList(null);
864
+ load();
865
+ },
866
+ children: tt("templates.retry")
867
+ })]
868
+ }) : null,
869
+ list !== null && filtered.length === 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
870
+ className: templates_module_css_default.state,
871
+ children: tt("templates.empty")
872
+ }) : null,
873
+ list !== null && filtered.length > 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
874
+ className: templates_module_css_default.grid,
875
+ children: filtered.map((item) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
876
+ type: "button",
877
+ className: templates_module_css_default.card,
878
+ onClick: () => {
879
+ setSelected(item);
880
+ setCopied(false);
881
+ },
882
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
883
+ className: templates_module_css_default.thumbWrap,
884
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(TemplateThumb, { item }), item.featured ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
885
+ className: templates_module_css_default.featuredBadge,
886
+ children: tt("templates.featured")
887
+ }) : null]
888
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
889
+ className: templates_module_css_default.cardBody,
890
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
891
+ className: templates_module_css_default.cardTitle,
892
+ children: item.title
893
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
894
+ className: templates_module_css_default.cardMeta,
895
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
896
+ className: templates_module_css_default.cardCategory,
897
+ children: item.categoryZh || item.category
898
+ }), item.sourceLabel !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
899
+ className: templates_module_css_default.cardSource,
900
+ children: item.sourceLabel
901
+ }) : null]
902
+ })]
903
+ })]
904
+ }, item.id))
905
+ }) : null
906
+ ]
907
+ }),
908
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("footer", {
909
+ className: templates_module_css_default.footer,
910
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
911
+ className: templates_module_css_default.attribution,
912
+ children: tt("templates.attribution")
913
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
914
+ className: templates_module_css_default.sourceLink,
915
+ href: "https://vibeui.top/",
916
+ target: "_blank",
917
+ rel: "noreferrer",
918
+ children: tt("templates.source")
919
+ })]
920
+ })
921
+ ]
922
+ }), selected !== null ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
923
+ className: templates_module_css_default.detailOverlay,
924
+ onClick: () => {
925
+ setSelected(null);
926
+ },
927
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
928
+ className: templates_module_css_default.detail,
929
+ onClick: (event) => {
930
+ event.stopPropagation();
931
+ },
932
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
933
+ className: templates_module_css_default.detailMedia,
934
+ children: selected.image !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("img", {
935
+ className: templates_module_css_default.detailImage,
936
+ src: imageUrlOf(selected),
937
+ alt: selected.title
938
+ }) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
939
+ className: templates_module_css_default.thumbPlaceholder,
940
+ "aria-hidden": "true"
941
+ })
942
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
943
+ className: templates_module_css_default.detailInfo,
944
+ children: [
945
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("h4", {
946
+ className: templates_module_css_default.detailTitle,
947
+ children: selected.title
948
+ }),
949
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
950
+ className: templates_module_css_default.detailMeta,
951
+ children: [
952
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
953
+ className: templates_module_css_default.cardCategory,
954
+ children: selected.categoryZh || selected.category
955
+ }),
956
+ selected.sourceUrl !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
957
+ className: templates_module_css_default.detailLink,
958
+ href: selected.sourceUrl,
959
+ target: "_blank",
960
+ rel: "noreferrer",
961
+ children: selected.sourceLabel || selected.sourceUrl
962
+ }) : null,
963
+ selected.githubUrl !== "" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("a", {
964
+ className: templates_module_css_default.detailLink,
965
+ href: selected.githubUrl,
966
+ target: "_blank",
967
+ rel: "noreferrer",
968
+ children: "GitHub"
969
+ }) : null
970
+ ]
971
+ }),
972
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("pre", {
973
+ className: templates_module_css_default.detailPrompt,
974
+ children: selected.prompt
975
+ }),
976
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
977
+ className: templates_module_css_default.detailActions,
978
+ children: [
979
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
980
+ variant: "primary",
981
+ size: "md",
982
+ onClick: () => {
983
+ onUse(selected.prompt);
984
+ },
985
+ children: tt("templates.use")
986
+ }),
987
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
988
+ variant: "outline",
989
+ size: "md",
990
+ onClick: () => {
991
+ copyPrompt(selected.prompt);
992
+ },
993
+ children: copied ? tt("templates.copied") : tt("templates.copy")
994
+ }),
995
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Button, {
996
+ variant: "outline",
997
+ size: "md",
998
+ onClick: () => {
999
+ setSelected(null);
1000
+ },
1001
+ children: tt("templates.back")
1002
+ })
1003
+ ]
1004
+ })
1005
+ ]
1006
+ })]
1007
+ })
1008
+ }) : null]
1009
+ }), document.body);
1010
+ }
1011
+ //#endregion
401
1012
  //#region \0dsh-css:E:\dsh-plugin\src\client\panel.module.css.mjs
402
- const css$1 = "[data-pane=conversation]{position:relative}[data-dsh-imagegen-view]{z-index:60;background:var(--dsw-alias-bg-base);display:none;position:absolute;inset:0}html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ssh-active]) [data-dsh-imagegen-view]{display:block}html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ssh-active]) [data-pane=conversation]>:not([data-dsh-imagegen-view]),html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ssh-active]) [class*=centerCol]>:not([data-dsh-imagegen-view]){display:none!important}.Yvqh9W_entry{width:100%;height:32px;color:var(--dsw-alias-label-secondary);cursor:pointer;white-space:nowrap;background:0 0;border:none;border-radius:8px;align-items:center;gap:8px;padding:0 12px;font-size:13px;display:flex}.Yvqh9W_entry:hover{background:var(--dsw-specific-sidebar-nav-item-hover);color:var(--dsw-alias-label-primary)}.Yvqh9W_entry[data-active]{background:var(--dsw-specific-sidebar-nav-item-active);color:var(--dsw-alias-label-primary);font-weight:600}.Yvqh9W_entryIcon{flex:none;justify-content:center;align-items:center;display:inline-flex}.Yvqh9W_entryLabel{text-overflow:ellipsis;overflow:hidden}[data-dsh-frame][data-sidebar-collapsed] .Yvqh9W_entry{justify-content:center;width:100%;padding:0}[data-dsh-frame][data-sidebar-collapsed] .Yvqh9W_entryLabel{display:none}.Yvqh9W_view{overflow:hidden}.Yvqh9W_panel,.Yvqh9W_panel *,.Yvqh9W_panel :before,.Yvqh9W_panel :after{box-sizing:border-box}.Yvqh9W_panel{background:var(--dsw-alias-bg-base);min-width:0;height:100%;min-height:0;color:var(--dsw-alias-label-primary);font-family:var(--dsw-font-family);flex-direction:column;gap:10px;padding:14px 16px 16px;display:flex;overflow:hidden}.Yvqh9W_panelHeader{flex:none;justify-content:space-between;align-items:center;gap:12px;display:flex}.Yvqh9W_panelHeading{align-items:baseline;gap:10px;min-width:0;display:flex}.Yvqh9W_panelTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;margin:0;font-size:16px;font-weight:700}.Yvqh9W_panelSubtitle{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:12px;overflow:hidden}.Yvqh9W_connectionStatus{border:1px solid var(--dsw-alias-label-error);height:28px;color:var(--dsw-alias-label-error);font:inherit;white-space:nowrap;background:0 0;border-radius:8px;flex:none;align-items:center;gap:6px;padding:0 10px;font-size:12px;line-height:1;display:inline-flex}.Yvqh9W_connectionStatus[data-connected=true]{border-color:var(--dsw-alias-state-success-primary);color:var(--dsw-alias-state-success-primary)}.Yvqh9W_connectionDot{background:currentColor;border-radius:50%;width:6px;height:6px}.Yvqh9W_updateBanner{border:1px solid var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-state-warn-primary);overflow-wrap:anywhere;border-radius:10px;flex:none;justify-content:space-between;align-items:center;gap:12px;padding:7px 10px 7px 12px;font-size:12px;line-height:1.5;display:flex}.Yvqh9W_updateBanner[data-kind=ok]{color:var(--dsw-alias-state-success-primary);border-color:var(--dsw-alias-state-success-primary)}.Yvqh9W_updateText{min-width:0}.Yvqh9W_updateActions{flex:none;align-items:center;gap:10px;display:inline-flex}.Yvqh9W_updateRelease{color:inherit;text-underline-offset:2px;white-space:nowrap;text-decoration:underline}@media (width<=700px){.Yvqh9W_panelHeader{align-items:flex-start}.Yvqh9W_panelHeading{flex-direction:column;align-items:flex-start;gap:2px}.Yvqh9W_updateBanner{flex-direction:column;align-items:flex-start}.Yvqh9W_updateActions{justify-content:space-between;width:100%}}.Yvqh9W_studio{flex:1;gap:14px;min-width:0;min-height:0;display:flex}.Yvqh9W_config{flex-direction:column;flex:none;gap:12px;width:300px;min-width:260px;max-width:340px;height:100%;min-height:0;display:flex;overflow:hidden}.Yvqh9W_configScroll{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-border-l2) transparent;flex-direction:column;flex:1;gap:12px;min-height:0;padding-right:2px;display:flex;overflow-y:auto}.Yvqh9W_configScroll::-webkit-scrollbar{width:8px}.Yvqh9W_configScroll::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l2);border-radius:999px}.Yvqh9W_canvas{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:12px;flex-direction:column;flex:1;min-width:0;min-height:0;display:flex;position:relative;overflow:hidden}.Yvqh9W_history{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:12px;flex-direction:column;flex:none;width:240px;min-width:200px;max-width:280px;min-height:0;display:flex;overflow:hidden}.Yvqh9W_historyHeader{border-bottom:1px solid var(--dsw-alias-border-l1);flex:none;justify-content:space-between;align-items:center;gap:8px;padding:10px 12px;display:flex}.Yvqh9W_historyTitle{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600}.Yvqh9W_historyClear{font:inherit;color:var(--dsw-alias-label-tertiary);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;background:0 0;border-radius:999px;padding:2px 8px;font-size:11.5px}.Yvqh9W_historyClear:hover{color:var(--dsw-alias-label-error);border-color:var(--dsw-alias-label-error)}.Yvqh9W_historyList{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-border-l2) transparent;flex-direction:column;flex:1;gap:8px;min-height:0;padding:10px;display:flex;overflow-y:auto}.Yvqh9W_historyList::-webkit-scrollbar{width:8px}.Yvqh9W_historyList::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l2);border-radius:999px}.Yvqh9W_historyEmpty{text-align:center;color:var(--dsw-alias-label-tertiary);flex:1;justify-content:center;align-items:center;padding:20px;font-size:12px;line-height:1.6;display:flex}.Yvqh9W_historyItem{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:10px;flex-direction:column;flex:none;gap:6px;padding:8px;display:flex}.Yvqh9W_historyItem:hover{border-color:var(--dsw-alias-border-l2)}.Yvqh9W_historyItem[data-active]{border-color:var(--dsw-alias-brand-primary)}.Yvqh9W_historyMain{font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:none;align-items:flex-start;gap:8px;min-width:0;padding:0;display:flex}.Yvqh9W_historyThumb{object-fit:cover;background:var(--dsw-alias-bg-base);border-radius:8px;flex:none;width:52px;height:52px}.Yvqh9W_historyThumbPlaceholder{background:var(--dsw-alias-bg-layer-3);border-radius:8px;flex:none;width:52px;height:52px}.Yvqh9W_historyInfo{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.Yvqh9W_historyPrompt{color:var(--dsw-alias-label-primary);-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12px;line-height:1.4;display:-webkit-box;overflow:hidden}.Yvqh9W_historyMeta{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}.Yvqh9W_historyActions{justify-content:flex-end;gap:6px;display:flex}.Yvqh9W_historyAction{font:inherit;color:var(--dsw-alias-label-secondary);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;background:0 0;border-radius:999px;padding:2px 8px;font-size:11.5px}.Yvqh9W_historyAction:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.Yvqh9W_historyAction[data-danger]:hover{color:var(--dsw-alias-label-error);border-color:var(--dsw-alias-label-error)}.Yvqh9W_card{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;flex-direction:column;flex:none;gap:10px;padding:12px;display:flex}.Yvqh9W_modeRow{align-items:center;gap:8px;display:flex}.Yvqh9W_modePill{flex:1;justify-content:center;height:28px;font-size:13px}.Yvqh9W_uploadBox{min-height:128px;color:var(--dsw-alias-label-secondary);border:1.5px dashed var(--dsw-alias-border-l2);cursor:pointer;font:inherit;text-align:center;background:0 0;border-radius:12px;flex-direction:column;justify-content:center;align-items:center;gap:6px;padding:16px;font-size:12.5px;display:flex}.Yvqh9W_uploadBox:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed);background:var(--dsw-alias-interactive-bg-hover)}.Yvqh9W_uploadBox:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.Yvqh9W_uploadIcon{color:var(--dsw-alias-label-tertiary);display:inline-flex}.Yvqh9W_uploadHint{color:var(--dsw-alias-label-tertiary);font-size:11px}.Yvqh9W_reference{flex-direction:column;gap:8px;display:flex}.Yvqh9W_referenceImage{object-fit:contain;background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l1);border-radius:10px;width:100%;max-height:176px}.Yvqh9W_referenceActions{gap:8px;display:flex}.Yvqh9W_hiddenFile{display:none}.Yvqh9W_prompt{width:100%;min-height:120px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-3);border:1px solid var(--dsw-alias-border-l2);resize:vertical;box-sizing:border-box;border-radius:10px;outline:none;padding:10px 12px;font-family:inherit;font-size:13px;line-height:1.6}.Yvqh9W_prompt:focus-visible{border-color:var(--dsw-alias-brand-primary)}.Yvqh9W_prompt::placeholder{color:var(--dsw-alias-label-tertiary)}.Yvqh9W_promptFooter{justify-content:flex-end;margin-top:-6px;display:flex}.Yvqh9W_promptCount{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px}.Yvqh9W_paramGroup{flex-direction:column;gap:8px;display:flex}.Yvqh9W_paramLabel{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600}.Yvqh9W_optionRow{flex-wrap:wrap;gap:6px;display:flex}.Yvqh9W_optionGrid{grid-template-columns:repeat(3,1fr);gap:6px;display:grid}.Yvqh9W_optionPill{justify-content:center}.Yvqh9W_paramHint{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:1.45}.Yvqh9W_footer{border-top:1px solid var(--dsw-alias-border-l1);flex-direction:column;flex:none;align-items:stretch;gap:8px;padding:10px 2px 0 0;display:flex}.Yvqh9W_modelWrap{flex-direction:column;gap:5px;min-width:0;display:flex}.Yvqh9W_modelLabel{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600}.Yvqh9W_modelSelect{width:100%;height:36px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;border-radius:18px;outline:none;padding:0 12px;font-family:inherit;font-size:13px}.Yvqh9W_modelSelect:focus-visible{border-color:var(--dsw-alias-brand-primary)}.Yvqh9W_modelSelect:disabled{opacity:.55}.Yvqh9W_generateButton{width:100%}.Yvqh9W_generateInner{align-items:center;gap:7px;display:inline-flex}.Yvqh9W_canvasState{text-align:center;color:var(--dsw-alias-label-tertiary);flex-direction:column;flex:1;justify-content:center;align-items:center;gap:8px;padding:24px;display:flex}.Yvqh9W_canvasStateTitle{color:var(--dsw-alias-label-secondary);font-size:14px;font-weight:600}.Yvqh9W_canvasStateHint{max-width:380px;font-size:12px;line-height:1.6}.Yvqh9W_canvasEmptyIcon{color:var(--dsw-alias-label-tertiary);margin-bottom:4px;display:inline-flex}.Yvqh9W_canvasError{color:var(--dsw-alias-label-error);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-label-error);overflow-wrap:anywhere;border-radius:10px;flex:none;margin:14px;padding:10px 14px;font-size:12.5px;line-height:1.6}.Yvqh9W_canvasBody{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-border-l2) transparent;flex-direction:column;flex:1;gap:10px;min-height:0;padding:14px;display:flex;overflow-y:auto}.Yvqh9W_canvasBody::-webkit-scrollbar{width:8px}.Yvqh9W_canvasBody::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l2);border-radius:999px}.Yvqh9W_canvasMeta{color:var(--dsw-alias-label-tertiary);flex:none;align-items:center;gap:8px;font-size:12px;display:flex}.Yvqh9W_canvasHistoryTag{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);white-space:nowrap;border-radius:999px;padding:1px 8px;font-size:11px}.Yvqh9W_grid{flex:1;grid-template-rows:repeat(2,minmax(0,1fr));grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;min-height:0;display:grid}.Yvqh9W_grid[data-count=\"1\"] .Yvqh9W_imageCard{grid-area:1/1/3/3}.Yvqh9W_imageCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);cursor:zoom-in;border-radius:12px;flex-direction:column;min-height:0;margin:0;display:flex;position:relative;overflow:hidden}.Yvqh9W_imageCard:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.Yvqh9W_image{object-fit:cover;background:var(--dsw-alias-bg-base);flex:1;width:100%;min-height:0;display:block}.Yvqh9W_imageCaption{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;border-top:1px solid var(--dsw-alias-border-l1);padding:7px 10px;font-size:11px;line-height:1.5;overflow:hidden}.Yvqh9W_download{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-mask-1);border:1px solid var(--dsw-alias-border-l2);opacity:0;backdrop-filter:blur(4px);border-radius:999px;padding:2px 10px;font-size:12px;font-weight:500;line-height:20px;text-decoration:none;transition:opacity .12s;position:absolute;top:8px;right:8px}.Yvqh9W_imageCard:hover .Yvqh9W_download{opacity:1}.Yvqh9W_download:hover{background:var(--dsw-alias-bg-base)}.Yvqh9W_zoomHint{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-mask-1);border:1px solid var(--dsw-alias-border-l2);opacity:0;backdrop-filter:blur(4px);pointer-events:none;border-radius:999px;align-items:center;gap:5px;padding:2px 10px;font-size:12px;font-weight:500;line-height:20px;transition:opacity .12s;display:inline-flex;position:absolute;bottom:8px;left:8px}.Yvqh9W_imageCard:hover .Yvqh9W_zoomHint{opacity:1}.Yvqh9W_spinner,.Yvqh9W_bigSpinner{border:2px solid;border-top-color:#0000;border-radius:50%;flex:none;animation:.8s linear infinite Yvqh9W_dshImageGenSpin;display:inline-block}.Yvqh9W_spinner{width:11px;height:11px}.Yvqh9W_bigSpinner{width:30px;height:30px;color:var(--dsw-alias-state-business-primary);border-width:3px;margin-bottom:6px}.Yvqh9W_lightbox{z-index:1000;backdrop-filter:blur(6px);background:#000000b8;justify-content:center;align-items:center;padding:24px;display:flex;position:fixed;inset:0}.Yvqh9W_lightboxClose{color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff47;border-radius:50%;justify-content:center;align-items:center;width:38px;height:38px;display:inline-flex;position:absolute;top:16px;right:16px}.Yvqh9W_lightboxClose:hover{background:#ffffff42}.Yvqh9W_lightboxNav{color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff47;border-radius:50%;justify-content:center;align-items:center;width:42px;height:42px;display:inline-flex;position:absolute;top:50%;transform:translateY(-50%)}.Yvqh9W_lightboxNav:hover{background:#ffffff42}.Yvqh9W_lightboxNav[data-dir=prev]{left:max(20px,50% - 640px)}.Yvqh9W_lightboxNav[data-dir=next]{right:max(20px,50% - 640px)}.Yvqh9W_lightboxFigure{flex-direction:column;gap:10px;width:min(1100px,100vw - 160px);max-width:min(1100px,100vw - 160px);height:min(820px,100vh - 48px);min-height:0;margin:0;display:flex}.Yvqh9W_lightboxStage{background:#ffffff0a;border-radius:10px;flex:1;min-height:0;position:relative;overflow:auto}.Yvqh9W_lightboxScaleFrame{justify-content:center;align-items:center;min-width:100%;min-height:100%;display:flex}.Yvqh9W_lightboxImage{object-fit:contain;border-radius:10px;max-width:100%;max-height:100%;display:block;box-shadow:0 24px 80px #00000080}.Yvqh9W_lightboxTools{justify-content:center;align-items:center;gap:6px;display:flex}.Yvqh9W_lightboxTool,.Yvqh9W_lightboxZoomLevel,.Yvqh9W_lightboxCopy{color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff47;justify-content:center;align-items:center;display:inline-flex}.Yvqh9W_lightboxTool,.Yvqh9W_lightboxZoomLevel{height:32px}.Yvqh9W_lightboxTool{border-radius:50%;width:32px}.Yvqh9W_lightboxZoomLevel{min-width:58px;font:inherit;font-variant-numeric:tabular-nums;border-radius:999px;padding:0 9px;font-size:12px}.Yvqh9W_lightboxTool:hover,.Yvqh9W_lightboxZoomLevel:hover,.Yvqh9W_lightboxCopy:hover{background:#ffffff42}.Yvqh9W_lightboxCaptionRow{align-items:flex-start;gap:8px;min-width:0;display:flex}.Yvqh9W_lightboxCaption{color:#ffffffe6;-webkit-line-clamp:3;-webkit-box-orient:vertical;flex:1;min-width:0;font-size:12px;line-height:1.6;display:-webkit-box;overflow:hidden}.Yvqh9W_lightboxCopy{min-height:28px;font:inherit;white-space:nowrap;border-radius:999px;flex:none;gap:5px;padding:4px 9px;font-size:12px}.Yvqh9W_lightboxMeta{justify-content:space-between;align-items:center;gap:12px;display:flex}.Yvqh9W_lightboxIndex{color:#fffc;font-variant-numeric:tabular-nums;font-size:12px}.Yvqh9W_lightboxActions{align-items:center;gap:8px;display:inline-flex}.Yvqh9W_lightboxDownload,.Yvqh9W_lightboxEdit{font:inherit;color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff47;border-radius:999px;padding:4px 14px;font-size:12.5px;font-weight:500;text-decoration:none}.Yvqh9W_lightboxDownload:hover,.Yvqh9W_lightboxEdit:hover{background:#ffffff42}.Yvqh9W_lightboxEdit{color:#fff;background:#ffffff24;border:1px solid #ffffff47;border-radius:999px}@media (width<=720px){.Yvqh9W_lightbox{padding:16px}.Yvqh9W_lightboxFigure{width:calc(100vw - 32px);max-width:none}.Yvqh9W_lightboxNav[data-dir=prev]{left:20px}.Yvqh9W_lightboxNav[data-dir=next]{right:20px}.Yvqh9W_lightboxCaptionRow,.Yvqh9W_lightboxMeta{flex-direction:column;align-items:stretch}.Yvqh9W_lightboxCopy,.Yvqh9W_lightboxActions{align-self:flex-end}}@keyframes Yvqh9W_dshImageGenSpin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.Yvqh9W_download,.Yvqh9W_spinner,.Yvqh9W_bigSpinner{transition:none;animation-duration:1.5s}}";
1013
+ const css$1 = "[data-pane=conversation]{position:relative}[data-dsh-imagegen-view]{z-index:60;background:var(--dsw-alias-bg-base);display:none;position:absolute;inset:0}html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ssh-active]) [data-dsh-imagegen-view]{display:block}html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ssh-active]) [data-pane=conversation]>:not([data-dsh-imagegen-view]),html[data-dsh-imagegen-active]:not([data-dsh-taskboard-active]):not([data-dsh-ssh-active]) [class*=centerCol]>:not([data-dsh-imagegen-view]){display:none!important}.Yvqh9W_entry{width:100%;height:32px;color:var(--dsw-alias-label-secondary);cursor:pointer;white-space:nowrap;background:0 0;border:none;border-radius:8px;align-items:center;gap:8px;padding:0 12px;font-size:13px;display:flex}.Yvqh9W_entry:hover{background:var(--dsw-specific-sidebar-nav-item-hover);color:var(--dsw-alias-label-primary)}.Yvqh9W_entry[data-active]{background:var(--dsw-specific-sidebar-nav-item-active);color:var(--dsw-alias-label-primary);font-weight:600}.Yvqh9W_entryIcon{flex:none;justify-content:center;align-items:center;display:inline-flex}.Yvqh9W_entryLabel{text-overflow:ellipsis;overflow:hidden}[data-dsh-frame][data-sidebar-collapsed] .Yvqh9W_entry{justify-content:center;width:100%;padding:0}[data-dsh-frame][data-sidebar-collapsed] .Yvqh9W_entryLabel{display:none}.Yvqh9W_view{overflow:hidden}.Yvqh9W_panel,.Yvqh9W_panel *,.Yvqh9W_panel :before,.Yvqh9W_panel :after{box-sizing:border-box}.Yvqh9W_panel{background:var(--dsw-alias-bg-base);min-width:0;height:100%;min-height:0;color:var(--dsw-alias-label-primary);font-family:var(--dsw-font-family);flex-direction:column;gap:10px;padding:14px 16px 16px;display:flex;overflow:hidden}.Yvqh9W_panelHeader{flex:none;justify-content:space-between;align-items:center;gap:12px;display:flex}.Yvqh9W_panelHeading{align-items:baseline;gap:10px;min-width:0;display:flex}.Yvqh9W_panelTitle{color:var(--dsw-alias-label-primary);white-space:nowrap;margin:0;font-size:16px;font-weight:700}.Yvqh9W_panelSubtitle{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:12px;overflow:hidden}.Yvqh9W_connectionStatus{border:1px solid var(--dsw-alias-label-error);height:28px;color:var(--dsw-alias-label-error);font:inherit;white-space:nowrap;background:0 0;border-radius:8px;flex:none;align-items:center;gap:6px;padding:0 10px;font-size:12px;line-height:1;display:inline-flex}.Yvqh9W_connectionStatus[data-connected=true]{border-color:var(--dsw-alias-state-success-primary);color:var(--dsw-alias-state-success-primary)}.Yvqh9W_connectionDot{background:currentColor;border-radius:50%;width:6px;height:6px}.Yvqh9W_updateBanner{border:1px solid var(--dsw-alias-state-warn-primary);color:var(--dsw-alias-state-warn-primary);overflow-wrap:anywhere;border-radius:10px;flex:none;justify-content:space-between;align-items:center;gap:12px;padding:7px 10px 7px 12px;font-size:12px;line-height:1.5;display:flex}.Yvqh9W_updateBanner[data-kind=ok]{color:var(--dsw-alias-state-success-primary);border-color:var(--dsw-alias-state-success-primary)}.Yvqh9W_updateText{min-width:0}.Yvqh9W_updateActions{flex:none;align-items:center;gap:10px;display:inline-flex}.Yvqh9W_updateRelease{color:inherit;text-underline-offset:2px;white-space:nowrap;text-decoration:underline}@media (width<=700px){.Yvqh9W_panelHeader{align-items:flex-start}.Yvqh9W_panelHeading{flex-direction:column;align-items:flex-start;gap:2px}.Yvqh9W_updateBanner{flex-direction:column;align-items:flex-start}.Yvqh9W_updateActions{justify-content:space-between;width:100%}}.Yvqh9W_studio{flex:1;gap:14px;min-width:0;min-height:0;display:flex}.Yvqh9W_config{flex-direction:column;flex:none;gap:12px;width:300px;min-width:260px;max-width:340px;height:100%;min-height:0;display:flex;overflow:hidden}.Yvqh9W_configScroll{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-border-l2) transparent;flex-direction:column;flex:1;gap:12px;min-height:0;padding-right:2px;display:flex;overflow-y:auto}.Yvqh9W_configScroll::-webkit-scrollbar{width:8px}.Yvqh9W_configScroll::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l2);border-radius:999px}.Yvqh9W_canvas{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:12px;flex-direction:column;flex:1;min-width:0;min-height:0;display:flex;position:relative;overflow:hidden}.Yvqh9W_history{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-1);border-radius:12px;flex-direction:column;flex:none;width:240px;min-width:200px;max-width:280px;min-height:0;display:flex;overflow:hidden}.Yvqh9W_historyHeader{border-bottom:1px solid var(--dsw-alias-border-l1);flex:none;justify-content:space-between;align-items:center;gap:8px;padding:10px 12px;display:flex}.Yvqh9W_historyTitle{color:var(--dsw-alias-label-primary);font-size:13px;font-weight:600}.Yvqh9W_historyClear{font:inherit;color:var(--dsw-alias-label-tertiary);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;background:0 0;border-radius:999px;padding:2px 8px;font-size:11.5px}.Yvqh9W_historyClear:hover{color:var(--dsw-alias-label-error);border-color:var(--dsw-alias-label-error)}.Yvqh9W_historyList{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-border-l2) transparent;flex-direction:column;flex:1;gap:8px;min-height:0;padding:10px;display:flex;overflow-y:auto}.Yvqh9W_historyList::-webkit-scrollbar{width:8px}.Yvqh9W_historyList::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l2);border-radius:999px}.Yvqh9W_historyEmpty{text-align:center;color:var(--dsw-alias-label-tertiary);flex:1;justify-content:center;align-items:center;padding:20px;font-size:12px;line-height:1.6;display:flex}.Yvqh9W_historyItem{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);border-radius:10px;flex-direction:column;flex:none;gap:6px;padding:8px;display:flex}.Yvqh9W_historyItem:hover{border-color:var(--dsw-alias-border-l2)}.Yvqh9W_historyItem[data-active]{border-color:var(--dsw-alias-brand-primary)}.Yvqh9W_historyMain{font:inherit;color:inherit;text-align:left;cursor:pointer;background:0 0;border:none;align-items:flex-start;gap:8px;min-width:0;padding:0;display:flex}.Yvqh9W_historyThumb{object-fit:cover;background:var(--dsw-alias-bg-base);border-radius:8px;flex:none;width:52px;height:52px}.Yvqh9W_historyThumbPlaceholder{background:var(--dsw-alias-bg-layer-3);border-radius:8px;flex:none;width:52px;height:52px}.Yvqh9W_historyInfo{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.Yvqh9W_historyPrompt{color:var(--dsw-alias-label-primary);-webkit-line-clamp:2;-webkit-box-orient:vertical;font-size:12px;line-height:1.4;display:-webkit-box;overflow:hidden}.Yvqh9W_historyMeta{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;font-size:11px;overflow:hidden}.Yvqh9W_historyActions{justify-content:flex-end;gap:6px;display:flex}.Yvqh9W_historyAction{font:inherit;color:var(--dsw-alias-label-secondary);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;background:0 0;border-radius:999px;padding:2px 8px;font-size:11.5px}.Yvqh9W_historyAction:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed)}.Yvqh9W_historyAction[data-danger]:hover{color:var(--dsw-alias-label-error);border-color:var(--dsw-alias-label-error)}.Yvqh9W_card{background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l1);border-radius:12px;flex-direction:column;flex:none;gap:10px;padding:12px;display:flex}.Yvqh9W_modeRow{align-items:center;gap:8px;display:flex}.Yvqh9W_modePill{flex:1;justify-content:center;height:28px;font-size:13px}.Yvqh9W_uploadBox{min-height:128px;color:var(--dsw-alias-label-secondary);border:1.5px dashed var(--dsw-alias-border-l2);cursor:pointer;font:inherit;text-align:center;background:0 0;border-radius:12px;flex-direction:column;justify-content:center;align-items:center;gap:6px;padding:16px;font-size:12.5px;display:flex}.Yvqh9W_uploadBox:hover{color:var(--dsw-alias-label-primary);border-color:var(--dsw-alias-label-dimmed);background:var(--dsw-alias-interactive-bg-hover)}.Yvqh9W_uploadBox:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.Yvqh9W_uploadIcon{color:var(--dsw-alias-label-tertiary);display:inline-flex}.Yvqh9W_uploadHint{color:var(--dsw-alias-label-tertiary);font-size:11px}.Yvqh9W_reference{flex-direction:column;gap:8px;display:flex}.Yvqh9W_referenceImage{object-fit:contain;background:var(--dsw-alias-bg-base);border:1px solid var(--dsw-alias-border-l1);border-radius:10px;width:100%;max-height:176px}.Yvqh9W_referenceActions{gap:8px;display:flex}.Yvqh9W_hiddenFile{display:none}.Yvqh9W_prompt{width:100%;min-height:120px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-3);border:1px solid var(--dsw-alias-border-l2);resize:vertical;box-sizing:border-box;border-radius:10px;outline:none;padding:10px 12px;font-family:inherit;font-size:13px;line-height:1.6}.Yvqh9W_prompt:focus-visible{border-color:var(--dsw-alias-brand-primary)}.Yvqh9W_prompt::placeholder{color:var(--dsw-alias-label-tertiary)}.Yvqh9W_promptFooter{justify-content:space-between;align-items:center;gap:8px;margin-top:-6px;display:flex}.Yvqh9W_templatesButton{border:1px solid var(--dsw-alias-brand-primary);background:linear-gradient(135deg, color-mix(in srgb, var(--dsw-alias-brand-primary) 14%, transparent), color-mix(in srgb, var(--dsw-alias-brand-primary) 5%, transparent));height:26px;color:var(--dsw-alias-brand-primary);cursor:pointer;box-shadow:0 1px 0 color-mix(in srgb, var(--dsw-alias-brand-primary) 22%, transparent);border-radius:999px;align-items:center;gap:6px;padding:0 12px;font-family:inherit;font-size:12px;font-weight:600;transition:transform .12s,box-shadow .12s,background .12s;display:inline-flex}.Yvqh9W_templatesButton svg{flex:none}.Yvqh9W_templatesButton:hover{background:linear-gradient(135deg, color-mix(in srgb, var(--dsw-alias-brand-primary) 24%, transparent), color-mix(in srgb, var(--dsw-alias-brand-primary) 8%, transparent));color:var(--dsw-alias-brand-primary);box-shadow:0 2px 6px color-mix(in srgb, var(--dsw-alias-brand-primary) 30%, transparent);transform:translateY(-1px)}.Yvqh9W_templatesButton:active{transform:translateY(0)}.Yvqh9W_promptCount{color:var(--dsw-alias-label-tertiary);font-variant-numeric:tabular-nums;font-size:11px}.Yvqh9W_paramGroup{flex-direction:column;gap:8px;display:flex}.Yvqh9W_paramLabel{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600}.Yvqh9W_optionRow{flex-wrap:wrap;gap:6px;display:flex}.Yvqh9W_optionGrid{grid-template-columns:repeat(3,1fr);gap:6px;display:grid}.Yvqh9W_optionPill{justify-content:center}.Yvqh9W_paramHint{color:var(--dsw-alias-label-tertiary);font-size:11px;line-height:1.45}.Yvqh9W_footer{border-top:1px solid var(--dsw-alias-border-l1);flex-direction:column;flex:none;align-items:stretch;gap:8px;padding:10px 2px 0 0;display:flex}.Yvqh9W_modelWrap{flex-direction:column;gap:5px;min-width:0;display:flex}.Yvqh9W_modelLabel{color:var(--dsw-alias-label-secondary);font-size:12px;font-weight:600}.Yvqh9W_modelSelect{width:100%;height:36px;color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);cursor:pointer;border-radius:18px;outline:none;padding:0 12px;font-family:inherit;font-size:13px}.Yvqh9W_modelSelect:focus-visible{border-color:var(--dsw-alias-brand-primary)}.Yvqh9W_modelSelect:disabled{opacity:.55}.Yvqh9W_generateButton{width:100%}.Yvqh9W_generateInner{align-items:center;gap:7px;display:inline-flex}.Yvqh9W_canvasState{text-align:center;color:var(--dsw-alias-label-tertiary);flex-direction:column;flex:1;justify-content:center;align-items:center;gap:8px;padding:24px;display:flex}.Yvqh9W_canvasStateTitle{color:var(--dsw-alias-label-secondary);font-size:14px;font-weight:600}.Yvqh9W_canvasStateHint{max-width:380px;font-size:12px;line-height:1.6}.Yvqh9W_canvasEmptyIcon{color:var(--dsw-alias-label-tertiary);margin-bottom:4px;display:inline-flex}.Yvqh9W_canvasError{color:var(--dsw-alias-label-error);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-label-error);overflow-wrap:anywhere;border-radius:10px;flex:none;margin:14px;padding:10px 14px;font-size:12.5px;line-height:1.6}.Yvqh9W_canvasBody{scrollbar-width:thin;scrollbar-color:var(--dsw-alias-border-l2) transparent;flex-direction:column;flex:1;gap:10px;min-height:0;padding:14px;display:flex;overflow-y:auto}.Yvqh9W_canvasBody::-webkit-scrollbar{width:8px}.Yvqh9W_canvasBody::-webkit-scrollbar-thumb{background:var(--dsw-alias-border-l2);border-radius:999px}.Yvqh9W_canvasMeta{color:var(--dsw-alias-label-tertiary);flex:none;align-items:center;gap:8px;font-size:12px;display:flex}.Yvqh9W_canvasHistoryTag{color:var(--dsw-alias-label-secondary);background:var(--dsw-alias-bg-layer-2);border:1px solid var(--dsw-alias-border-l2);white-space:nowrap;border-radius:999px;padding:1px 8px;font-size:11px}.Yvqh9W_grid{flex:1;grid-template-rows:repeat(2,minmax(0,1fr));grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;min-height:0;display:grid}.Yvqh9W_grid[data-count=\"1\"] .Yvqh9W_imageCard{grid-area:1/1/3/3}.Yvqh9W_imageCard{border:1px solid var(--dsw-alias-border-l1);background:var(--dsw-alias-bg-layer-2);cursor:zoom-in;border-radius:12px;flex-direction:column;min-height:0;margin:0;display:flex;position:relative;overflow:hidden}.Yvqh9W_imageCard:focus-visible{outline:2px solid var(--dsw-alias-brand-primary);outline-offset:1px}.Yvqh9W_image{object-fit:cover;background:var(--dsw-alias-bg-base);flex:1;width:100%;min-height:0;display:block}.Yvqh9W_imageCaption{color:var(--dsw-alias-label-tertiary);white-space:nowrap;text-overflow:ellipsis;border-top:1px solid var(--dsw-alias-border-l1);padding:7px 10px;font-size:11px;line-height:1.5;overflow:hidden}.Yvqh9W_download{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-mask-1);border:1px solid var(--dsw-alias-border-l2);opacity:0;backdrop-filter:blur(4px);border-radius:999px;padding:2px 10px;font-size:12px;font-weight:500;line-height:20px;text-decoration:none;transition:opacity .12s;position:absolute;top:8px;right:8px}.Yvqh9W_imageCard:hover .Yvqh9W_download{opacity:1}.Yvqh9W_download:hover{background:var(--dsw-alias-bg-base)}.Yvqh9W_zoomHint{color:var(--dsw-alias-label-primary);background:var(--dsw-alias-bg-mask-1);border:1px solid var(--dsw-alias-border-l2);opacity:0;backdrop-filter:blur(4px);pointer-events:none;border-radius:999px;align-items:center;gap:5px;padding:2px 10px;font-size:12px;font-weight:500;line-height:20px;transition:opacity .12s;display:inline-flex;position:absolute;bottom:8px;left:8px}.Yvqh9W_imageCard:hover .Yvqh9W_zoomHint{opacity:1}.Yvqh9W_spinner,.Yvqh9W_bigSpinner{border:2px solid;border-top-color:#0000;border-radius:50%;flex:none;animation:.8s linear infinite Yvqh9W_dshImageGenSpin;display:inline-block}.Yvqh9W_spinner{width:11px;height:11px}.Yvqh9W_bigSpinner{width:30px;height:30px;color:var(--dsw-alias-state-business-primary);border-width:3px;margin-bottom:6px}.Yvqh9W_lightbox{z-index:1000;backdrop-filter:blur(6px);background:#000000b8;justify-content:center;align-items:center;padding:24px;display:flex;position:fixed;inset:0}.Yvqh9W_lightboxClose{color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff47;border-radius:50%;justify-content:center;align-items:center;width:38px;height:38px;display:inline-flex;position:absolute;top:16px;right:16px}.Yvqh9W_lightboxClose:hover{background:#ffffff42}.Yvqh9W_lightboxNav{color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff47;border-radius:50%;justify-content:center;align-items:center;width:42px;height:42px;display:inline-flex;position:absolute;top:50%;transform:translateY(-50%)}.Yvqh9W_lightboxNav:hover{background:#ffffff42}.Yvqh9W_lightboxNav[data-dir=prev]{left:max(20px,50% - 640px)}.Yvqh9W_lightboxNav[data-dir=next]{right:max(20px,50% - 640px)}.Yvqh9W_lightboxFigure{flex-direction:column;gap:10px;width:min(1100px,100vw - 160px);max-width:min(1100px,100vw - 160px);height:min(820px,100vh - 48px);min-height:0;margin:0;display:flex}.Yvqh9W_lightboxStage{background:#ffffff0a;border-radius:10px;flex:1;min-height:0;position:relative;overflow:auto}.Yvqh9W_lightboxScaleFrame{justify-content:center;align-items:center;min-width:100%;min-height:100%;display:flex}.Yvqh9W_lightboxImage{object-fit:contain;border-radius:10px;max-width:100%;max-height:100%;display:block;box-shadow:0 24px 80px #00000080}.Yvqh9W_lightboxTools{justify-content:center;align-items:center;gap:6px;display:flex}.Yvqh9W_lightboxTool,.Yvqh9W_lightboxZoomLevel,.Yvqh9W_lightboxCopy{color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff47;justify-content:center;align-items:center;display:inline-flex}.Yvqh9W_lightboxTool,.Yvqh9W_lightboxZoomLevel{height:32px}.Yvqh9W_lightboxTool{border-radius:50%;width:32px}.Yvqh9W_lightboxZoomLevel{min-width:58px;font:inherit;font-variant-numeric:tabular-nums;border-radius:999px;padding:0 9px;font-size:12px}.Yvqh9W_lightboxTool:hover,.Yvqh9W_lightboxZoomLevel:hover,.Yvqh9W_lightboxCopy:hover{background:#ffffff42}.Yvqh9W_lightboxCaptionRow{align-items:flex-start;gap:8px;min-width:0;display:flex}.Yvqh9W_lightboxCaption{color:#ffffffe6;-webkit-line-clamp:3;-webkit-box-orient:vertical;flex:1;min-width:0;font-size:12px;line-height:1.6;display:-webkit-box;overflow:hidden}.Yvqh9W_lightboxCopy{min-height:28px;font:inherit;white-space:nowrap;border-radius:999px;flex:none;gap:5px;padding:4px 9px;font-size:12px}.Yvqh9W_lightboxMeta{justify-content:space-between;align-items:center;gap:12px;display:flex}.Yvqh9W_lightboxIndex{color:#fffc;font-variant-numeric:tabular-nums;font-size:12px}.Yvqh9W_lightboxActions{align-items:center;gap:8px;display:inline-flex}.Yvqh9W_lightboxDownload,.Yvqh9W_lightboxEdit{font:inherit;color:#fff;cursor:pointer;background:#ffffff24;border:1px solid #ffffff47;border-radius:999px;padding:4px 14px;font-size:12.5px;font-weight:500;text-decoration:none}.Yvqh9W_lightboxDownload:hover,.Yvqh9W_lightboxEdit:hover{background:#ffffff42}.Yvqh9W_lightboxEdit{color:#fff;background:#ffffff24;border:1px solid #ffffff47;border-radius:999px}@media (width<=720px){.Yvqh9W_lightbox{padding:16px}.Yvqh9W_lightboxFigure{width:calc(100vw - 32px);max-width:none}.Yvqh9W_lightboxNav[data-dir=prev]{left:20px}.Yvqh9W_lightboxNav[data-dir=next]{right:20px}.Yvqh9W_lightboxCaptionRow,.Yvqh9W_lightboxMeta{flex-direction:column;align-items:stretch}.Yvqh9W_lightboxCopy,.Yvqh9W_lightboxActions{align-self:flex-end}}@keyframes Yvqh9W_dshImageGenSpin{to{transform:rotate(360deg)}}@media (prefers-reduced-motion:reduce){.Yvqh9W_download,.Yvqh9W_spinner,.Yvqh9W_bigSpinner{transition:none;animation-duration:1.5s}}";
403
1014
  const tagId$1 = "@dickpy/dsh-imagegen/panel.module.css";
404
1015
  if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId$1) + "]") === null) {
405
1016
  const tag = document.createElement("style");
@@ -409,100 +1020,101 @@ window.__ModuleLoader__.load({
409
1020
  document.head.appendChild(tag);
410
1021
  }
411
1022
  var panel_module_css_default = {
412
- "uploadIcon": "Yvqh9W_uploadIcon",
413
- "bigSpinner": "Yvqh9W_bigSpinner",
414
- "hiddenFile": "Yvqh9W_hiddenFile",
415
1023
  "updateRelease": "Yvqh9W_updateRelease",
416
- "panelSubtitle": "Yvqh9W_panelSubtitle",
417
- "historyMain": "Yvqh9W_historyMain",
418
- "view": "Yvqh9W_view",
419
- "historyAction": "Yvqh9W_historyAction",
420
- "entryLabel": "Yvqh9W_entryLabel",
421
- "historyEmpty": "Yvqh9W_historyEmpty",
422
- "connectionDot": "Yvqh9W_connectionDot",
423
- "canvasState": "Yvqh9W_canvasState",
424
- "uploadBox": "Yvqh9W_uploadBox",
425
- "canvasStateTitle": "Yvqh9W_canvasStateTitle",
426
- "lightboxClose": "Yvqh9W_lightboxClose",
427
- "lightboxImage": "Yvqh9W_lightboxImage",
428
- "download": "Yvqh9W_download",
429
- "entryIcon": "Yvqh9W_entryIcon",
430
- "canvas": "Yvqh9W_canvas",
1024
+ "canvasHistoryTag": "Yvqh9W_canvasHistoryTag",
1025
+ "lightboxCaptionRow": "Yvqh9W_lightboxCaptionRow",
1026
+ "panelHeading": "Yvqh9W_panelHeading",
1027
+ "generateButton": "Yvqh9W_generateButton",
1028
+ "historyHeader": "Yvqh9W_historyHeader",
1029
+ "footer": "Yvqh9W_footer",
1030
+ "imageCard": "Yvqh9W_imageCard",
1031
+ "spinner": "Yvqh9W_spinner",
1032
+ "reference": "Yvqh9W_reference",
431
1033
  "panelHeader": "Yvqh9W_panelHeader",
432
- "config": "Yvqh9W_config",
433
- "generateInner": "Yvqh9W_generateInner",
434
- "grid": "Yvqh9W_grid",
435
- "history": "Yvqh9W_history",
436
- "lightboxCopy": "Yvqh9W_lightboxCopy",
1034
+ "canvasStateHint": "Yvqh9W_canvasStateHint",
1035
+ "historyInfo": "Yvqh9W_historyInfo",
1036
+ "lightboxEdit": "Yvqh9W_lightboxEdit",
1037
+ "promptCount": "Yvqh9W_promptCount",
437
1038
  "historyTitle": "Yvqh9W_historyTitle",
438
- "paramGroup": "Yvqh9W_paramGroup",
439
- "spinner": "Yvqh9W_spinner",
440
- "modePill": "Yvqh9W_modePill",
441
- "canvasError": "Yvqh9W_canvasError",
442
1039
  "uploadHint": "Yvqh9W_uploadHint",
443
- "reference": "Yvqh9W_reference",
444
- "zoomHint": "Yvqh9W_zoomHint",
445
- "canvasHistoryTag": "Yvqh9W_canvasHistoryTag",
446
- "lightboxTool": "Yvqh9W_lightboxTool",
447
1040
  "promptFooter": "Yvqh9W_promptFooter",
448
- "lightbox": "Yvqh9W_lightbox",
449
- "canvasEmptyIcon": "Yvqh9W_canvasEmptyIcon",
450
- "lightboxZoomLevel": "Yvqh9W_lightboxZoomLevel",
451
- "modelWrap": "Yvqh9W_modelWrap",
452
- "updateText": "Yvqh9W_updateText",
453
1041
  "prompt": "Yvqh9W_prompt",
454
- "historyHeader": "Yvqh9W_historyHeader",
455
- "updateBanner": "Yvqh9W_updateBanner",
456
- "canvasStateHint": "Yvqh9W_canvasStateHint",
457
- "updateActions": "Yvqh9W_updateActions",
458
- "optionGrid": "Yvqh9W_optionGrid",
459
- "historyPrompt": "Yvqh9W_historyPrompt",
460
- "promptCount": "Yvqh9W_promptCount",
461
1042
  "modelSelect": "Yvqh9W_modelSelect",
462
- "canvasBody": "Yvqh9W_canvasBody",
1043
+ "lightboxImage": "Yvqh9W_lightboxImage",
1044
+ "download": "Yvqh9W_download",
1045
+ "view": "Yvqh9W_view",
1046
+ "optionGrid": "Yvqh9W_optionGrid",
1047
+ "grid": "Yvqh9W_grid",
1048
+ "entryLabel": "Yvqh9W_entryLabel",
1049
+ "canvas": "Yvqh9W_canvas",
1050
+ "historyItem": "Yvqh9W_historyItem",
1051
+ "uploadIcon": "Yvqh9W_uploadIcon",
1052
+ "entryIcon": "Yvqh9W_entryIcon",
1053
+ "hiddenFile": "Yvqh9W_hiddenFile",
1054
+ "lightboxCopy": "Yvqh9W_lightboxCopy",
1055
+ "connectionStatus": "Yvqh9W_connectionStatus",
1056
+ "modeRow": "Yvqh9W_modeRow",
1057
+ "config": "Yvqh9W_config",
1058
+ "referenceImage": "Yvqh9W_referenceImage",
1059
+ "modelWrap": "Yvqh9W_modelWrap",
1060
+ "historyActions": "Yvqh9W_historyActions",
1061
+ "history": "Yvqh9W_history",
1062
+ "paramLabel": "Yvqh9W_paramLabel",
1063
+ "modelLabel": "Yvqh9W_modelLabel",
1064
+ "templatesButton": "Yvqh9W_templatesButton",
1065
+ "generateInner": "Yvqh9W_generateInner",
1066
+ "paramGroup": "Yvqh9W_paramGroup",
1067
+ "canvasState": "Yvqh9W_canvasState",
463
1068
  "lightboxScaleFrame": "Yvqh9W_lightboxScaleFrame",
1069
+ "historyList": "Yvqh9W_historyList",
1070
+ "lightboxActions": "Yvqh9W_lightboxActions",
464
1071
  "lightboxMeta": "Yvqh9W_lightboxMeta",
465
- "panelHeading": "Yvqh9W_panelHeading",
1072
+ "historyThumbPlaceholder": "Yvqh9W_historyThumbPlaceholder",
1073
+ "canvasStateTitle": "Yvqh9W_canvasStateTitle",
1074
+ "imageCaption": "Yvqh9W_imageCaption",
1075
+ "canvasError": "Yvqh9W_canvasError",
1076
+ "historyMain": "Yvqh9W_historyMain",
1077
+ "image": "Yvqh9W_image",
1078
+ "lightboxStage": "Yvqh9W_lightboxStage",
466
1079
  "historyThumb": "Yvqh9W_historyThumb",
467
- "historyInfo": "Yvqh9W_historyInfo",
468
- "referenceImage": "Yvqh9W_referenceImage",
469
- "entry": "Yvqh9W_entry",
470
- "optionPill": "Yvqh9W_optionPill",
471
- "paramLabel": "Yvqh9W_paramLabel",
1080
+ "lightbox": "Yvqh9W_lightbox",
1081
+ "lightboxFigure": "Yvqh9W_lightboxFigure",
472
1082
  "historyClear": "Yvqh9W_historyClear",
473
- "panel": "Yvqh9W_panel",
474
- "panelTitle": "Yvqh9W_panelTitle",
475
- "historyThumbPlaceholder": "Yvqh9W_historyThumbPlaceholder",
476
- "studio": "Yvqh9W_studio",
1083
+ "historyEmpty": "Yvqh9W_historyEmpty",
1084
+ "historyPrompt": "Yvqh9W_historyPrompt",
1085
+ "historyAction": "Yvqh9W_historyAction",
477
1086
  "referenceActions": "Yvqh9W_referenceActions",
478
- "dshImageGenSpin": "Yvqh9W_dshImageGenSpin",
1087
+ "updateActions": "Yvqh9W_updateActions",
1088
+ "optionPill": "Yvqh9W_optionPill",
1089
+ "card": "Yvqh9W_card",
479
1090
  "lightboxNav": "Yvqh9W_lightboxNav",
480
- "imageCaption": "Yvqh9W_imageCaption",
481
- "lightboxTools": "Yvqh9W_lightboxTools",
482
- "lightboxDownload": "Yvqh9W_lightboxDownload",
483
- "imageCard": "Yvqh9W_imageCard",
1091
+ "connectionDot": "Yvqh9W_connectionDot",
1092
+ "uploadBox": "Yvqh9W_uploadBox",
1093
+ "panelSubtitle": "Yvqh9W_panelSubtitle",
484
1094
  "paramHint": "Yvqh9W_paramHint",
485
- "historyList": "Yvqh9W_historyList",
486
- "historyItem": "Yvqh9W_historyItem",
487
- "lightboxIndex": "Yvqh9W_lightboxIndex",
488
- "lightboxFigure": "Yvqh9W_lightboxFigure",
489
1095
  "optionRow": "Yvqh9W_optionRow",
490
- "card": "Yvqh9W_card",
491
- "footer": "Yvqh9W_footer",
492
- "generateButton": "Yvqh9W_generateButton",
1096
+ "lightboxZoomLevel": "Yvqh9W_lightboxZoomLevel",
1097
+ "panelTitle": "Yvqh9W_panelTitle",
1098
+ "lightboxIndex": "Yvqh9W_lightboxIndex",
1099
+ "canvasEmptyIcon": "Yvqh9W_canvasEmptyIcon",
1100
+ "entry": "Yvqh9W_entry",
1101
+ "modePill": "Yvqh9W_modePill",
1102
+ "lightboxTool": "Yvqh9W_lightboxTool",
1103
+ "lightboxDownload": "Yvqh9W_lightboxDownload",
1104
+ "updateText": "Yvqh9W_updateText",
1105
+ "updateBanner": "Yvqh9W_updateBanner",
1106
+ "studio": "Yvqh9W_studio",
1107
+ "dshImageGenSpin": "Yvqh9W_dshImageGenSpin",
493
1108
  "canvasMeta": "Yvqh9W_canvasMeta",
494
- "lightboxStage": "Yvqh9W_lightboxStage",
495
- "modeRow": "Yvqh9W_modeRow",
1109
+ "lightboxClose": "Yvqh9W_lightboxClose",
1110
+ "lightboxTools": "Yvqh9W_lightboxTools",
496
1111
  "configScroll": "Yvqh9W_configScroll",
497
1112
  "historyMeta": "Yvqh9W_historyMeta",
498
- "image": "Yvqh9W_image",
499
- "lightboxCaptionRow": "Yvqh9W_lightboxCaptionRow",
1113
+ "canvasBody": "Yvqh9W_canvasBody",
1114
+ "zoomHint": "Yvqh9W_zoomHint",
1115
+ "bigSpinner": "Yvqh9W_bigSpinner",
500
1116
  "lightboxCaption": "Yvqh9W_lightboxCaption",
501
- "lightboxActions": "Yvqh9W_lightboxActions",
502
- "lightboxEdit": "Yvqh9W_lightboxEdit",
503
- "modelLabel": "Yvqh9W_modelLabel",
504
- "connectionStatus": "Yvqh9W_connectionStatus",
505
- "historyActions": "Yvqh9W_historyActions"
1117
+ "panel": "Yvqh9W_panel"
506
1118
  };
507
1119
  //#endregion
508
1120
  //#region src/client/ImageGenPanel.tsx
@@ -647,6 +1259,7 @@ window.__ModuleLoader__.load({
647
1259
  const [updating, setUpdating] = (0, react.useState)(false);
648
1260
  const [updateMessage, setUpdateMessage] = (0, react.useState)(null);
649
1261
  const [updateResult, setUpdateResult] = (0, react.useState)(null);
1262
+ const [libraryOpen, setLibraryOpen] = (0, react.useState)(false);
650
1263
  const fileInput = (0, react.useRef)(null);
651
1264
  const previewStage = (0, react.useRef)(null);
652
1265
  const elapsed = useElapsed(generating, startedAt);
@@ -1047,12 +1660,31 @@ window.__ModuleLoader__.load({
1047
1660
  onChange: (event) => {
1048
1661
  setPrompt(event.target.value);
1049
1662
  }
1050
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
1663
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1051
1664
  className: panel_module_css_default.promptFooter,
1052
- children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1665
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
1666
+ type: "button",
1667
+ className: panel_module_css_default.templatesButton,
1668
+ title: tt("templates.title"),
1669
+ onClick: () => {
1670
+ setLibraryOpen(true);
1671
+ },
1672
+ children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("svg", {
1673
+ viewBox: "0 0 16 16",
1674
+ width: "12",
1675
+ height: "12",
1676
+ fill: "none",
1677
+ stroke: "currentColor",
1678
+ strokeWidth: "1.4",
1679
+ strokeLinecap: "round",
1680
+ strokeLinejoin: "round",
1681
+ "aria-hidden": "true",
1682
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", { d: "M2.5 3.5h11M2.5 8h11M2.5 12.5h7" })
1683
+ }), tt("templates.open")]
1684
+ }), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
1053
1685
  className: panel_module_css_default.promptCount,
1054
1686
  children: tt("prompt.count", { count: prompt.length })
1055
- })
1687
+ })]
1056
1688
  })]
1057
1689
  }),
1058
1690
  /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("section", {
@@ -1389,6 +2021,18 @@ window.__ModuleLoader__.load({
1389
2021
  })
1390
2022
  ]
1391
2023
  }),
2024
+ libraryOpen ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(TemplateLibrary, {
2025
+ api,
2026
+ onClose: () => {
2027
+ setLibraryOpen(false);
2028
+ },
2029
+ onUse: (text) => {
2030
+ setMode("text");
2031
+ setPrompt(text);
2032
+ setError(null);
2033
+ setLibraryOpen(false);
2034
+ }
2035
+ }) : null,
1392
2036
  preview !== null && previewImage !== null ? (0, react_dom.createPortal)(/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
1393
2037
  className: panel_module_css_default.lightbox,
1394
2038
  role: "dialog",
@@ -2100,35 +2744,35 @@ window.__ModuleLoader__.load({
2100
2744
  document.head.appendChild(tag);
2101
2745
  }
2102
2746
  var settings_card_module_css_default = {
2103
- "failed": "i1cc5G_failed",
2104
- "versionValue": "i1cc5G_versionValue",
2105
- "badges": "i1cc5G_badges",
2106
- "input": "i1cc5G_input",
2107
- "label": "i1cc5G_label",
2108
- "head": "i1cc5G_head",
2109
- "field": "i1cc5G_field",
2110
- "headText": "i1cc5G_headText",
2111
- "discard": "i1cc5G_discard",
2112
2747
  "pending": "i1cc5G_pending",
2113
- "notExposed": "i1cc5G_notExposed",
2114
- "badge": "i1cc5G_badge",
2748
+ "save": "i1cc5G_save",
2749
+ "card": "i1cc5G_card",
2115
2750
  "inputInvalid": "i1cc5G_inputInvalid",
2751
+ "versionValue": "i1cc5G_versionValue",
2752
+ "description": "i1cc5G_description",
2116
2753
  "versionRow": "i1cc5G_versionRow",
2117
- "versionLabel": "i1cc5G_versionLabel",
2118
- "reset": "i1cc5G_reset",
2119
- "hint": "i1cc5G_hint",
2754
+ "head": "i1cc5G_head",
2755
+ "header": "i1cc5G_header",
2756
+ "name": "i1cc5G_name",
2757
+ "failed": "i1cc5G_failed",
2758
+ "notExposed": "i1cc5G_notExposed",
2120
2759
  "chevron": "i1cc5G_chevron",
2121
- "description": "i1cc5G_description",
2760
+ "field": "i1cc5G_field",
2761
+ "hint": "i1cc5G_hint",
2762
+ "discard": "i1cc5G_discard",
2763
+ "badges": "i1cc5G_badges",
2764
+ "select": "i1cc5G_select",
2122
2765
  "readOnly": "i1cc5G_readOnly",
2123
2766
  "footer": "i1cc5G_footer",
2124
- "body": "i1cc5G_body",
2125
- "select": "i1cc5G_select",
2126
- "save": "i1cc5G_save",
2127
- "header": "i1cc5G_header",
2128
2767
  "chevronOpen": "i1cc5G_chevronOpen",
2129
- "card": "i1cc5G_card",
2130
2768
  "invalid": "i1cc5G_invalid",
2131
- "name": "i1cc5G_name"
2769
+ "body": "i1cc5G_body",
2770
+ "versionLabel": "i1cc5G_versionLabel",
2771
+ "input": "i1cc5G_input",
2772
+ "label": "i1cc5G_label",
2773
+ "headText": "i1cc5G_headText",
2774
+ "badge": "i1cc5G_badge",
2775
+ "reset": "i1cc5G_reset"
2132
2776
  };
2133
2777
  //#endregion
2134
2778
  //#region src/client/SettingsCard.tsx
@@ -2700,8 +3344,7 @@ window.__ModuleLoader__.load({
2700
3344
  const settingsCard = new ImageGenSettingsCardController(scope);
2701
3345
  ctx.slots.inject("settings.plugin.item", () => ctx.slots.register({
2702
3346
  name: "settings.plugin.item",
2703
- id: "imagegen",
2704
- order: 30,
3347
+ key: "dsh-imagegen",
2705
3348
  locale: NS,
2706
3349
  inject: () => settingsCard.inject()
2707
3350
  }, ImageGenSettingsCard));