@acedatacloud/nexior 3.278.9 → 3.278.11
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/dist/assets/{ApiCodeButton-REzWFnTi.js → ApiCodeButton-feBeDY_l.js} +1 -1
- package/dist/assets/{AskUserQuestionCard-EupVrx6h.js → AskUserQuestionCard-BNG9tgX3.js} +1 -1
- package/dist/assets/{Auth-CZyrj9-3.js → Auth-CFtmbm4s.js} +1 -1
- package/dist/assets/{Bare-B1kEhTSm.js → Bare-CVOZ6WhP.js} +1 -1
- package/dist/assets/{BotPlaceholder-D6AUYJbe.js → BotPlaceholder-Bio6tWP-.js} +1 -1
- package/dist/assets/{BottomFooter-FhdYe5dh.js → BottomFooter-DGE-61DB.js} +1 -1
- package/dist/assets/{Callback-CNue-cpb.js → Callback-QtNwO7hi.js} +1 -1
- package/dist/assets/Console-Qh-lS-l0.js +1 -0
- package/dist/assets/{Console-DZ9YgJA2.css → Console-geveU-NA.css} +1 -1
- package/dist/assets/{Consumption-BuxjrihL.js → Consumption-BGQCLo2d.js} +1 -1
- package/dist/assets/{Conversation-CtkO8jCx.js → Conversation-CWyRiU0O.js} +1 -1
- package/dist/assets/{CopyToClipboard-CkWzEIbo.js → CopyToClipboard-koQ26Tcr.js} +1 -1
- package/dist/assets/{Detail-CZhLSdUg.js → Detail--YGsXI_e.js} +2 -2
- package/dist/assets/{Extra-Bt8RcdvE.js → Extra-Chca_xwq.js} +1 -1
- package/dist/assets/{FilePreview-CGYMHZJL.js → FilePreview-B8BzFTso.js} +1 -1
- package/dist/assets/{Hailuo-v_qhDSni.js → Hailuo-C7l7D1BL.js} +1 -1
- package/dist/assets/{History-fqmkkEyY.js → History-sZtU-DCc.js} +1 -1
- package/dist/assets/{ImagePreview-GRjlSvS4.js → ImagePreview-i57G906Z.js} +1 -1
- package/dist/assets/{ImageWrapper-BXMMoMt0.js → ImageWrapper-DgXbFDyb.js} +1 -1
- package/dist/assets/{Index-CRFp52Yn.js → Index-4lOxs7FZ.js} +1 -1
- package/dist/assets/{Index-QVw1-svc.js → Index-4uMAtfi9.js} +1 -1
- package/dist/assets/{Index-gtLgKZEJ.js → Index-6Cwryqbx.js} +1 -1
- package/dist/assets/{Index-CUBneeOA.js → Index-B13S2DCQ.js} +1 -1
- package/dist/assets/{Index-Bb0_rKP4.js → Index-B2Wx5LpE.js} +1 -1
- package/dist/assets/{Index-BqGJJRjE.js → Index-B87iIVhq.js} +1 -1
- package/dist/assets/{Index-C0zTgyrH.js → Index-B8_I0C3q.js} +1 -1
- package/dist/assets/{Index-DHLXqKae.js → Index-BFTS01qq.js} +1 -1
- package/dist/assets/{Index-Cw3f1lpX.js → Index-BH7U9nYl.js} +1 -1
- package/dist/assets/{Index-uSSx9k9W.js → Index-BMT58pnU.js} +1 -1
- package/dist/assets/{Index-o7sXC2_x.js → Index-BVeOaPr2.js} +1 -1
- package/dist/assets/{Index-C6uAvoOh.js → Index-BsqPXPax.js} +1 -1
- package/dist/assets/{Index-BkREEaRd.js → Index-C2ClM0J0.js} +1 -1
- package/dist/assets/{Index-B74Z6yEL.js → Index-CBPydDRK.js} +1 -1
- package/dist/assets/Index-CCYZShWJ.js +1 -0
- package/dist/assets/{Index-CBP-ENqe.js → Index-CDIopN2W.js} +1 -1
- package/dist/assets/{Index-B4RDAnRv.js → Index-CYs8GX8u.js} +1 -1
- package/dist/assets/{Index-lhi3gupn.js → Index-CbNdh4oo.js} +1 -1
- package/dist/assets/{Index-Dv6QH5PC.css → Index-D3mLso2o.css} +1 -1
- package/dist/assets/{Index-CIevkASp.js → Index-D8grKlQd.js} +1 -1
- package/dist/assets/{Index-DB_CFn0s.js → Index-DARSvrKZ.js} +1 -1
- package/dist/assets/{Index-BrXsiIVv.js → Index-DDzLF0GM.js} +1 -1
- package/dist/assets/{Index-Be6ee_wk.js → Index-DFy2vHKx.js} +1 -1
- package/dist/assets/{Index-CADslUeN.js → Index-DKM4R-xj.js} +1 -1
- package/dist/assets/{Index-Bl2iZfs-.js → Index-DSMiWjHz.js} +1 -1
- package/dist/assets/{Index-BZTeBNpg.js → Index-Du6JsDJR.js} +1 -1
- package/dist/assets/{Index-Mtr6NRqd.js → Index-n2i3DnLz.js} +1 -1
- package/dist/assets/{Invitees-Do26z-J6.js → Invitees-Dgf_77sP.js} +1 -1
- package/dist/assets/{List-Db5992c5.js → List-BzSMcEyW.js} +1 -1
- package/dist/assets/List-DkH1xntn.css +1 -0
- package/dist/assets/List-DomB431w.js +1 -0
- package/dist/assets/{List-B6_jg8v-.js → List-XoG7Xt0G.js} +1 -1
- package/dist/assets/{Main-D-hvVOor.js → Main-Cyf3R30m.js} +1 -1
- package/dist/assets/{Model-ypXMgUVu.js → Model-J-BTjOcX.js} +1 -1
- package/dist/assets/{Navigator-Dj9Klk4n.js → Navigator-2xcHNzY1.js} +1 -1
- package/dist/assets/{NoTasks-D1nl515w.js → NoTasks-DAeqCkUW.js} +1 -1
- package/dist/assets/{NotFound-B7Xz2xis.js → NotFound-1H1po9gD.js} +1 -1
- package/dist/assets/{Pagination-CmrSJ6KO.js → Pagination-CZ34KO1q.js} +1 -1
- package/dist/assets/{Pay-CZddANc4.js → Pay-1Wwgwg3d.js} +1 -1
- package/dist/assets/{Player-Cv61tC1H.js → Player-CyN6Hw7Q.js} +1 -1
- package/dist/assets/{Seedance-5gWXmNhJ.js → Seedance-iUn5Clgg.js} +1 -1
- package/dist/assets/Status-48hnSwu7.js +1 -0
- package/dist/assets/{Status-vxUmkSa3.css → Status-DOMWM533.css} +1 -1
- package/dist/assets/{Subscribe-BJY3joIy.js → Subscribe-DdXjpsuk.js} +1 -1
- package/dist/assets/{TabSwitcher-zHIVqqC5.js → TabSwitcher-CcFHRLm4.js} +1 -1
- package/dist/assets/{Tts-F9mnYoWl.js → Tts-BEyr5s_h.js} +1 -1
- package/dist/assets/{VideoPlayer-jpXY2eqV.js → VideoPlayer-CyTjj97Y.js} +1 -1
- package/dist/assets/{avatar-BqxJwwVv.js → avatar-B0V40v2P.js} +1 -1
- package/dist/assets/{basic-DeI97u8Z.js → basic-D9FGsTlm.js} +1 -1
- package/dist/assets/{chat-0kuFIBOF.js → chat-Cnn_7e2U.js} +1 -1
- package/dist/assets/codingBridge-BKReXYMk.js +2 -0
- package/dist/assets/{codingBridgeNotify-Cj8knhgo.js → codingBridgeNotify-CEKfzQHC.js} +2 -2
- package/dist/assets/{collapse-OXWImjIB.js → collapse-BMk9zKLQ.js} +1 -1
- package/dist/assets/{createTaskActions-BXstjj_-.js → createTaskActions-CW9I9-hx.js} +1 -1
- package/dist/assets/{date-picker-DkUmHWbO.js → date-picker-Bg12oDVj.js} +1 -1
- package/dist/assets/{dropdown-BqlZM7xP.js → dropdown-DK8XSJXf.js} +1 -1
- package/dist/assets/{esm-DkX0Owqf.js → esm-10sb_iKx.js} +1 -1
- package/dist/assets/{esm-BH24VVaM.js → esm-BWHJ6rt3.js} +1 -1
- package/dist/assets/{esm-DHvo4C7K.js → esm-Bso5aS3F.js} +2 -2
- package/dist/assets/{esm-BqjOE_Rz.js → esm-DHzjueGu.js} +3 -3
- package/dist/assets/{esm-2tCBm0S9.js → esm-Df08THmb.js} +1 -1
- package/dist/assets/esm-Dul3wKjs.js +1 -0
- package/dist/assets/{esm-DosahcCz.js → esm-vqpN-k34.js} +2 -2
- package/dist/assets/{fish-Da9qHrfc.js → fish-BZfES53J.js} +1 -1
- package/dist/assets/{flux-D20EfUog.js → flux-BWZm9ynk.js} +1 -1
- package/dist/assets/{grokvideo-B4bJdb1D.js → grokvideo-DpnF-F6W.js} +1 -1
- package/dist/assets/{hailuo-BUq4X2iE.js → hailuo-CrFjflY8.js} +1 -1
- package/dist/assets/{headshots--mbPZPAq.js → headshots-D5lEHgbQ.js} +1 -1
- package/dist/assets/{image-ttyLLhNO.js → image-_ExVBzK6.js} +1 -1
- package/dist/assets/{index-BcUyz1eC.js → index-Cmr4LxuY.js} +4 -4
- package/dist/assets/{index.browser.esm-D7qwwbRo.js → index.browser.esm-DJTNhA1q.js} +1 -1
- package/dist/assets/{index.es-yT7dU_Va.js → index.es-CqtN0wgr.js} +1 -1
- package/dist/assets/{input-number-CRxXaQtg.js → input-number-wRL7m93t.js} +1 -1
- package/dist/assets/{kling-Crk_aDmo.js → kling-CcA6leVT.js} +1 -1
- package/dist/assets/{luma-D-MxQBcL.js → luma-DyrSGu8x.js} +1 -1
- package/dist/assets/{midjourney-BbXzDU-a.js → midjourney-DuplXjsM.js} +1 -1
- package/dist/assets/{nanobanana-Cit_myRl.js → nanobanana-WwgCOHmm.js} +1 -1
- package/dist/assets/{openaiimage-mTdO9rAh.js → openaiimage-CGNzKJmi.js} +1 -1
- package/dist/assets/{pagination-BIoA190D.js → pagination-CvCeL5yB.js} +1 -1
- package/dist/assets/{pika-C5HrKDuf.js → pika-ABP7PXx8.js} +1 -1
- package/dist/assets/{pixverse-CbGESB37.js → pixverse-CATZH8eD.js} +1 -1
- package/dist/assets/{popover-D-4s8qzP.js → popover-Chl5TeKm.js} +1 -1
- package/dist/assets/{producer-uiAkFvjr.js → producer-DU6kXM1l.js} +1 -1
- package/dist/assets/{qrart-FZ43PKQa.js → qrart-CCQcG3Dp.js} +1 -1
- package/dist/assets/{row-BaHDdZz8.js → row-CeOAYLyL.js} +1 -1
- package/dist/assets/{seedance-5wbj0nko.js → seedance-BDilt0cH.js} +1 -1
- package/dist/assets/{seedream-BxlpdHg-.js → seedream-DpXJxhv-.js} +1 -1
- package/dist/assets/{select-CbNogKSw.js → select-CIZk9ihC.js} +1 -1
- package/dist/assets/{serp-DRGKWQuh.js → serp-D8yf9VWT.js} +1 -1
- package/dist/assets/{slider-BMEjpoHD.js → slider-CVsDfSUQ.js} +1 -1
- package/dist/assets/{solana-wallets-4HrZaG6K.js → solana-wallets-DUlXcExI.js} +2 -2
- package/dist/assets/{solana-wallets-vue-DXPEFDyY.js → solana-wallets-vue-B2ETWntQ.js} +1 -1
- package/dist/assets/{sora-BP2fiqEm.js → sora-kfJpsUIO.js} +1 -1
- package/dist/assets/{suno-B-4V86AS.js → suno-CJdn3Qle.js} +1 -1
- package/dist/assets/{switch-tbd54zD9.js → switch-BdOpfax3.js} +1 -1
- package/dist/assets/{tabs-Dg2VTIGH.js → tabs-C-7HQMjK.js} +1 -1
- package/dist/assets/{upload-_lBvoaGk.js → upload-Bwmqeewp.js} +1 -1
- package/dist/assets/{veo-C4OUYU0q.js → veo-1--Z6tXz.js} +1 -1
- package/dist/assets/{wan-Clufix5r.js → wan-BtiqHPzV.js} +1 -1
- package/dist/assets/{web-DMeH2Mwz.js → web-BKK5HiC8.js} +1 -1
- package/dist/assets/{web-DkeLGLL2.js → web-BkR4PXe7.js} +1 -1
- package/dist/assets/{web-hkYj3ZPj.js → web-ChqC6zGd.js} +1 -1
- package/dist/assets/{web-DNMeUKX7.js → web-ZEBilPtd.js} +1 -1
- package/dist/assets/{web-C8WBlBz4.js → web-xeTO-NXb.js} +1 -1
- package/dist/assets/{webextrator-vrN0dTOu.js → webextrator-BsxDAXt0.js} +1 -1
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/Console-n8bdLCss.js +0 -1
- package/dist/assets/Index-BI04nE8j.js +0 -1
- package/dist/assets/List-B5FFHyhW.js +0 -1
- package/dist/assets/List-CE6I940A.css +0 -1
- package/dist/assets/Status-_YHPCaWd.js +0 -1
- package/dist/assets/codingBridge-BBAHwtN1.js +0 -2
- package/dist/assets/esm-D__U9o7L.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
.markdown-body{--base-size-16:1rem;--base-size-24:1.5rem;--base-size-4:.25rem;--base-size-40:2.5rem;--base-size-8:.5rem;--base-text-weight-medium:500;--base-text-weight-normal:400;--base-text-weight-semibold:600;--fontStack-monospace:ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;--fontStack-sansSerif:-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";--fgColor-accent:Highlight}@media (prefers-color-scheme:dark){.markdown-body,[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--fgColor-accent:#4493f8;--bgColor-attention-muted:#bb800926;--bgColor-default:#0d1117;--bgColor-muted:#151b23;--bgColor-neutral-muted:#656c7633;--borderColor-accent-emphasis:#1f6feb;--borderColor-attention-emphasis:#9e6a03;--borderColor-danger-emphasis:#da3633;--borderColor-default:#3d444d;--borderColor-done-emphasis:#8957e5;--borderColor-success-emphasis:#238636;--color-prettylights-syntax-brackethighlighter-angle:#9198a1;--color-prettylights-syntax-brackethighlighter-unmatched:#f85149;--color-prettylights-syntax-carriage-return-bg:#b62324;--color-prettylights-syntax-carriage-return-text:#f0f6fc;--color-prettylights-syntax-comment:#9198a1;--color-prettylights-syntax-constant:#79c0ff;--color-prettylights-syntax-constant-other-reference-link:#a5d6ff;--color-prettylights-syntax-entity:#d2a8ff;--color-prettylights-syntax-entity-tag:#7ee787;--color-prettylights-syntax-keyword:#ff7b72;--color-prettylights-syntax-markup-bold:#f0f6fc;--color-prettylights-syntax-markup-changed-bg:#5a1e02;--color-prettylights-syntax-markup-changed-text:#ffdfb6;--color-prettylights-syntax-markup-deleted-bg:#67060c;--color-prettylights-syntax-markup-deleted-text:#ffdcd7;--color-prettylights-syntax-markup-heading:#1f6feb;--color-prettylights-syntax-markup-ignored-bg:#1158c7;--color-prettylights-syntax-markup-ignored-text:#f0f6fc;--color-prettylights-syntax-markup-inserted-bg:#033a16;--color-prettylights-syntax-markup-inserted-text:#aff5b4;--color-prettylights-syntax-markup-italic:#f0f6fc;--color-prettylights-syntax-markup-list:#f2cc60;--color-prettylights-syntax-meta-diff-range:#d2a8ff;--color-prettylights-syntax-storage-modifier-import:#f0f6fc;--color-prettylights-syntax-string:#a5d6ff;--color-prettylights-syntax-string-regexp:#7ee787;--color-prettylights-syntax-sublimelinter-gutter-mark:#3d444d;--color-prettylights-syntax-variable:#ffa657;--fgColor-attention:#d29922;--fgColor-danger:#f85149;--fgColor-default:#f0f6fc;--fgColor-done:#ab7df8;--fgColor-muted:#9198a1;--fgColor-success:#3fb950;--borderColor-muted:#3d444db3;--color-prettylights-syntax-invalid-illegal-bg:var(--bgColor-danger-muted);--color-prettylights-syntax-invalid-illegal-text:var(--fgColor-danger);--focus-outlineColor:var(--borderColor-accent-emphasis);--borderColor-neutral-muted:var(--borderColor-muted)}}@media (prefers-color-scheme:light){.markdown-body,[data-theme=light]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--fgColor-danger:#d1242f;--bgColor-attention-muted:#fff8c5;--bgColor-muted:#f6f8fa;--bgColor-neutral-muted:#818b981f;--borderColor-accent-emphasis:#0969da;--borderColor-attention-emphasis:#9a6700;--borderColor-danger-emphasis:#cf222e;--borderColor-default:#d1d9e0;--borderColor-done-emphasis:#8250df;--borderColor-success-emphasis:#1a7f37;--color-prettylights-syntax-brackethighlighter-angle:#59636e;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-comment:#59636e;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-prettylights-syntax-entity:#6639ba;--color-prettylights-syntax-entity-tag:#0550ae;--color-prettylights-syntax-invalid-illegal-text:var(--fgColor-danger);--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-markup-ignored-text:#d1d9e0;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-sublimelinter-gutter-mark:#818b98;--color-prettylights-syntax-variable:#953800;--fgColor-accent:#0969da;--fgColor-attention:#9a6700;--fgColor-done:#8250df;--fgColor-muted:#59636e;--fgColor-success:#1a7f37;--bgColor-default:#fff;--borderColor-muted:#d1d9e0b3;--color-prettylights-syntax-invalid-illegal-bg:var(--bgColor-danger-muted);--color-prettylights-syntax-markup-bold:#1f2328;--color-prettylights-syntax-markup-italic:#1f2328;--color-prettylights-syntax-storage-modifier-import:#1f2328;--fgColor-default:#1f2328;--focus-outlineColor:var(--borderColor-accent-emphasis);--borderColor-neutral-muted:var(--borderColor-muted)}}.markdown-body{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-weight:var(--base-text-weight-normal,400);color:var(--fgColor-default);background-color:var(--bgColor-default);font-family:var(--fontStack-sansSerif,-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji");word-wrap:break-word;margin:0;font-size:16px;line-height:1.5}.markdown-body a{text-underline-offset:.2rem;text-decoration:underline}.markdown-body .octicon{fill:currentColor;vertical-align:text-bottom;display:inline-block}.markdown-body h1:hover .anchor .octicon-link:before,.markdown-body h2:hover .anchor .octicon-link:before,.markdown-body h3:hover .anchor .octicon-link:before,.markdown-body h4:hover .anchor .octicon-link:before,.markdown-body h5:hover .anchor .octicon-link:before,.markdown-body h6:hover .anchor .octicon-link:before{content:" ";background-color:currentColor;width:16px;height:16px;display:inline-block;-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>")}.markdown-body details,.markdown-body figcaption,.markdown-body figure{display:block}.markdown-body summary{display:list-item}.markdown-body [hidden]{display:none!important}.markdown-body a{color:var(--fgColor-accent);background-color:#0000;text-decoration:none}.markdown-body abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.markdown-body b,.markdown-body strong{font-weight:var(--base-text-weight-semibold,600)}.markdown-body dfn{font-style:italic}.markdown-body h1{font-weight:var(--base-text-weight-semibold,600);border-bottom:1px solid var(--borderColor-muted);margin:.67em 0;padding-bottom:.3em;font-size:2em}.markdown-body mark{background-color:var(--bgColor-attention-muted);color:var(--fgColor-default)}.markdown-body small{font-size:90%}.markdown-body sub,.markdown-body sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}.markdown-body sub{bottom:-.25em}.markdown-body sup{top:-.5em}.markdown-body img{box-sizing:content-box;border-style:none;max-width:100%}.markdown-body code,.markdown-body kbd,.markdown-body pre,.markdown-body samp{font-family:monospace;font-size:1em}.markdown-body figure{margin:1em var(--base-size-40)}.markdown-body hr{box-sizing:content-box;border-bottom:1px solid var(--borderColor-muted);height:.25em;margin:var(--base-size-24) 0;background:0 0;background-color:var(--borderColor-default);border:0;padding:0;overflow:hidden}.markdown-body input{font:inherit;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible}.markdown-body [type=button],.markdown-body [type=reset],.markdown-body [type=submit]{appearance:button}.markdown-body [type=checkbox],.markdown-body [type=radio]{box-sizing:border-box;padding:0}.markdown-body [type=number]::-webkit-inner-spin-button{height:auto}.markdown-body [type=number]::-webkit-outer-spin-button{height:auto}.markdown-body [type=search]::-webkit-search-cancel-button{appearance:none}.markdown-body [type=search]::-webkit-search-decoration{appearance:none}.markdown-body ::-webkit-input-placeholder{color:inherit;opacity:.54}.markdown-body ::-webkit-file-upload-button{appearance:button;font:inherit}.markdown-body a:hover{text-decoration:underline}.markdown-body ::placeholder{color:var(--fgColor-muted);opacity:1}.markdown-body hr:before{content:"";display:table}.markdown-body hr:after{clear:both;content:"";display:table}.markdown-body table{border-spacing:0;border-collapse:collapse;font-variant:tabular-nums;width:max-content;max-width:100%;display:block;overflow:auto}.markdown-body td,.markdown-body th{padding:0}.markdown-body details summary{cursor:pointer}.markdown-body a:focus,.markdown-body [role=button]:focus,.markdown-body input[type=radio]:focus,.markdown-body input[type=checkbox]:focus{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:focus:not(:focus-visible),.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body input[type=radio]:focus:not(:focus-visible),.markdown-body input[type=checkbox]:focus:not(:focus-visible){outline:1px solid #0000}.markdown-body a:focus-visible,.markdown-body [role=button]:focus-visible,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:not([class]):focus,.markdown-body a:not([class]):focus-visible,.markdown-body input[type=radio]:focus,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus,.markdown-body input[type=checkbox]:focus-visible{outline-offset:0}.markdown-body kbd{padding:var(--base-size-4);font:11px var(--fontStack-monospace,ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);color:var(--fgColor-default);vertical-align:middle;background-color:var(--bgColor-muted);border:solid 1px var(--borderColor-neutral-muted);border-bottom-color:var(--borderColor-neutral-muted);box-shadow:inset 0 -1px 0 var(--borderColor-neutral-muted);border-radius:6px;line-height:10px;display:inline-block}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:var(--base-size-24);margin-bottom:var(--base-size-16);font-weight:var(--base-text-weight-semibold,600);line-height:1.25}.markdown-body h2{font-weight:var(--base-text-weight-semibold,600);border-bottom:1px solid var(--borderColor-muted);padding-bottom:.3em;font-size:1.5em}.markdown-body h3{font-weight:var(--base-text-weight-semibold,600);font-size:1.25em}.markdown-body h4{font-weight:var(--base-text-weight-semibold,600);font-size:1em}.markdown-body h5{font-weight:var(--base-text-weight-semibold,600);font-size:.875em}.markdown-body h6{font-weight:var(--base-text-weight-semibold,600);color:var(--fgColor-muted);font-size:.85em}.markdown-body p{margin-top:0;margin-bottom:10px}.markdown-body blockquote{color:var(--fgColor-muted);border-left:.25em solid var(--borderColor-default);margin:0;padding:0 1em}.markdown-body ul,.markdown-body ol{margin-top:0;margin-bottom:0;padding-left:2em}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ul ul ol,.markdown-body ul ol ol,.markdown-body ol ul ol,.markdown-body ol ol ol{list-style-type:lower-alpha}.markdown-body dd{margin-left:0}.markdown-body tt,.markdown-body code,.markdown-body samp{font-family:var(--fontStack-monospace,ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px}.markdown-body pre{font-family:var(--fontStack-monospace,ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);word-wrap:normal;margin-top:0;margin-bottom:0;font-size:12px}.markdown-body .octicon{vertical-align:text-bottom;fill:currentColor;display:inline-block;overflow:visible!important}.markdown-body input::-webkit-outer-spin-button{appearance:none;margin:0}.markdown-body input::-webkit-inner-spin-button{appearance:none;margin:0}.markdown-body .mr-2{margin-right:var(--base-size-8,8px)!important}.markdown-body:before{content:"";display:table}.markdown-body:after{clear:both;content:"";display:table}.markdown-body>:first-child{margin-top:0!important}.markdown-body>:last-child{margin-bottom:0!important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:var(--fgColor-danger)}.markdown-body .anchor{float:left;padding-right:var(--base-size-4);margin-left:-20px;line-height:1}.markdown-body .anchor:focus{outline:none}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre,.markdown-body details{margin-top:0;margin-bottom:var(--base-size-16)}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:var(--fgColor-default);vertical-align:middle;visibility:hidden}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body h1 tt,.markdown-body h1 code,.markdown-body h2 tt,.markdown-body h2 code,.markdown-body h3 tt,.markdown-body h3 code,.markdown-body h4 tt,.markdown-body h4 code,.markdown-body h5 tt,.markdown-body h5 code,.markdown-body h6 tt,.markdown-body h6 code{font-size:inherit;padding:0 .2em}.markdown-body summary h1,.markdown-body summary h2,.markdown-body summary h3,.markdown-body summary h4,.markdown-body summary h5,.markdown-body summary h6{display:inline-block}.markdown-body summary h1 .anchor,.markdown-body summary h2 .anchor,.markdown-body summary h3 .anchor,.markdown-body summary h4 .anchor,.markdown-body summary h5 .anchor,.markdown-body summary h6 .anchor{margin-left:-40px}.markdown-body summary h1,.markdown-body summary h2{border-bottom:0;padding-bottom:0}.markdown-body ul.no-list,.markdown-body ol.no-list{padding:0;list-style-type:none}.markdown-body ol[type=a\ s]{list-style-type:lower-alpha}.markdown-body ol[type=A\ s]{list-style-type:upper-alpha}.markdown-body ol[type=i\ s]{list-style-type:lower-roman}.markdown-body ol[type=I\ s]{list-style-type:upper-roman}.markdown-body ol[type="1"],.markdown-body div>ol:not([type]){list-style-type:decimal}.markdown-body ul ul,.markdown-body ul ol,.markdown-body ol ol,.markdown-body ol ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:var(--base-size-16)}.markdown-body li+li{margin-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{margin-top:var(--base-size-16);font-size:1em;font-style:italic;font-weight:var(--base-text-weight-semibold,600);padding:0}.markdown-body dl dd{padding:0 var(--base-size-16);margin-bottom:var(--base-size-16)}.markdown-body table th{font-weight:var(--base-text-weight-semibold,600)}.markdown-body table th,.markdown-body table td{border:1px solid var(--borderColor-default);padding:6px 13px}.markdown-body table td>:last-child{margin-bottom:0}.markdown-body table tr{background-color:var(--bgColor-default);border-top:1px solid var(--borderColor-muted)}.markdown-body table tr:nth-child(2n){background-color:var(--bgColor-muted)}.markdown-body table img{background-color:#0000}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body .emoji{vertical-align:text-top;background-color:#0000;max-width:none}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{float:left;border:1px solid var(--borderColor-default);width:auto;margin:13px 0 0;padding:7px;display:block;overflow:hidden}.markdown-body span.frame span img{float:left;display:block}.markdown-body span.frame span span{clear:both;color:var(--fgColor-default);padding:5px 0 0;display:block}.markdown-body span.align-center{clear:both;display:block;overflow:hidden}.markdown-body span.align-center>span{text-align:center;margin:13px auto 0;display:block;overflow:hidden}.markdown-body span.align-center span img{text-align:center;margin:0 auto}.markdown-body span.align-right{clear:both;display:block;overflow:hidden}.markdown-body span.align-right>span{text-align:right;margin:13px 0 0;display:block;overflow:hidden}.markdown-body span.align-right span img{text-align:right;margin:0}.markdown-body span.float-left{float:left;margin-right:13px;display:block;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{float:right;margin-left:13px;display:block;overflow:hidden}.markdown-body span.float-right>span{text-align:right;margin:13px auto 0;display:block;overflow:hidden}.markdown-body code,.markdown-body tt{white-space:break-spaces;background-color:var(--bgColor-neutral-muted);border-radius:6px;margin:0;padding:.2em .4em;font-size:85%}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{-webkit-text-decoration:inherit;text-decoration:inherit}.markdown-body samp{font-size:85%}.markdown-body pre code{font-size:100%}.markdown-body pre>code{word-break:normal;white-space:pre;background:0 0;border:0;margin:0;padding:0}.markdown-body .highlight{margin-bottom:var(--base-size-16)}.markdown-body .highlight pre{word-break:normal;margin-bottom:0}.markdown-body .highlight pre,.markdown-body pre{padding:var(--base-size-16);color:var(--fgColor-default);background-color:var(--bgColor-muted);border-radius:6px;font-size:85%;line-height:1.45;overflow:auto}.markdown-body pre code,.markdown-body pre tt{line-height:inherit;word-wrap:normal;background-color:#0000;border:0;margin:0;padding:0;display:inline;overflow:visible}.markdown-body .csv-data td,.markdown-body .csv-data th{text-align:left;white-space:nowrap;padding:5px;font-size:12px;line-height:1;overflow:hidden}.markdown-body .csv-data .blob-num{padding:10px var(--base-size-8) 9px;text-align:right;background:var(--bgColor-default);border:0}.markdown-body .csv-data tr{border-top:0}.markdown-body .csv-data th{font-weight:var(--base-text-weight-semibold,600);background:var(--bgColor-muted);border-top:0}.markdown-body [data-footnote-ref]:before{content:"["}.markdown-body [data-footnote-ref]:after{content:"]"}.markdown-body .footnotes{color:var(--fgColor-muted);border-top:1px solid var(--borderColor-default);font-size:12px}.markdown-body .footnotes ol{padding-left:var(--base-size-16)}.markdown-body .footnotes ol ul{padding-left:var(--base-size-16);margin-top:var(--base-size-16);display:inline-block}.markdown-body .footnotes li{position:relative}.markdown-body .footnotes li:target:before{top:calc(var(--base-size-8)*-1);right:calc(var(--base-size-8)*-1);bottom:calc(var(--base-size-8)*-1);left:calc(var(--base-size-24)*-1);pointer-events:none;content:"";border:2px solid var(--borderColor-accent-emphasis);border-radius:6px;position:absolute}.markdown-body .footnotes li:target{color:var(--fgColor-default)}.markdown-body .footnotes .data-footnote-backref g-emoji{font-family:monospace}.markdown-body .pl-c{color:var(--color-prettylights-syntax-comment)}.markdown-body .pl-c1,.markdown-body .pl-s .pl-v{color:var(--color-prettylights-syntax-constant)}.markdown-body .pl-e,.markdown-body .pl-en{color:var(--color-prettylights-syntax-entity)}.markdown-body .pl-smi,.markdown-body .pl-s .pl-s1{color:var(--color-prettylights-syntax-storage-modifier-import)}.markdown-body .pl-ent{color:var(--color-prettylights-syntax-entity-tag)}.markdown-body .pl-k{color:var(--color-prettylights-syntax-keyword)}.markdown-body .pl-s,.markdown-body .pl-pds,.markdown-body .pl-s .pl-pse .pl-s1,.markdown-body .pl-sr,.markdown-body .pl-sr .pl-cce,.markdown-body .pl-sr .pl-sre,.markdown-body .pl-sr .pl-sra{color:var(--color-prettylights-syntax-string)}.markdown-body .pl-v,.markdown-body .pl-smw{color:var(--color-prettylights-syntax-variable)}.markdown-body .pl-bu{color:var(--color-prettylights-syntax-brackethighlighter-unmatched)}.markdown-body .pl-ii{color:var(--color-prettylights-syntax-invalid-illegal-text);background-color:var(--color-prettylights-syntax-invalid-illegal-bg)}.markdown-body .pl-c2{color:var(--color-prettylights-syntax-carriage-return-text);background-color:var(--color-prettylights-syntax-carriage-return-bg)}.markdown-body .pl-sr .pl-cce{color:var(--color-prettylights-syntax-string-regexp);font-weight:700}.markdown-body .pl-ml{color:var(--color-prettylights-syntax-markup-list)}.markdown-body .pl-mh,.markdown-body .pl-mh .pl-en,.markdown-body .pl-ms{color:var(--color-prettylights-syntax-markup-heading);font-weight:700}.markdown-body .pl-mi{color:var(--color-prettylights-syntax-markup-italic);font-style:italic}.markdown-body .pl-mb{color:var(--color-prettylights-syntax-markup-bold);font-weight:700}.markdown-body .pl-md{color:var(--color-prettylights-syntax-markup-deleted-text);background-color:var(--color-prettylights-syntax-markup-deleted-bg)}.markdown-body .pl-mi1{color:var(--color-prettylights-syntax-markup-inserted-text);background-color:var(--color-prettylights-syntax-markup-inserted-bg)}.markdown-body .pl-mc{color:var(--color-prettylights-syntax-markup-changed-text);background-color:var(--color-prettylights-syntax-markup-changed-bg)}.markdown-body .pl-mi2{color:var(--color-prettylights-syntax-markup-ignored-text);background-color:var(--color-prettylights-syntax-markup-ignored-bg)}.markdown-body .pl-mdr{color:var(--color-prettylights-syntax-meta-diff-range);font-weight:700}.markdown-body .pl-ba{color:var(--color-prettylights-syntax-brackethighlighter-angle)}.markdown-body .pl-sg{color:var(--color-prettylights-syntax-sublimelinter-gutter-mark)}.markdown-body .pl-corl{color:var(--color-prettylights-syntax-constant-other-reference-link);text-decoration:underline}.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body [role=tabpanel][tabindex="0"]:focus:not(:focus-visible),.markdown-body button:focus:not(:focus-visible),.markdown-body summary:focus:not(:focus-visible),.markdown-body a:focus:not(:focus-visible){box-shadow:none;outline:none}.markdown-body [tabindex="0"]:focus:not(:focus-visible),.markdown-body details-dialog:focus:not(:focus-visible){outline:none}.markdown-body g-emoji{min-width:1ch;font-family:Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:1em;font-weight:var(--base-text-weight-normal,400);vertical-align:-.075em;line-height:1;display:inline-block;font-style:normal!important}.markdown-body g-emoji img{width:1em;height:1em}.markdown-body a:has(>p,>div,>pre,>blockquote){display:block}.markdown-body a:has(>p,>div,>pre,>blockquote):not(:has(.snippet-clipboard-content,>pre)){width:fit-content}.markdown-body a:has(>p,>div,>pre,>blockquote):has(.snippet-clipboard-content,>pre):focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:2px}.markdown-body .task-list-item{list-style-type:none}.markdown-body .task-list-item label{font-weight:var(--base-text-weight-normal,400)}.markdown-body .task-list-item.enabled label{cursor:pointer}.markdown-body .task-list-item+.task-list-item{margin-top:var(--base-size-4)}.markdown-body .task-list-item .handle{display:none}.markdown-body .task-list-item-checkbox{vertical-align:middle;margin:0 .2em .25em -1.4em}.markdown-body ul:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) .task-list-item-checkbox,.markdown-body ol:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body .contains-task-list:hover .task-list-item-convert-container,.markdown-body .contains-task-list:focus-within .task-list-item-convert-container{clip-path:none;width:auto;height:24px;display:block;overflow:visible}.markdown-body ::-webkit-calendar-picker-indicator{filter:invert(50%)}.markdown-body .markdown-alert{padding:var(--base-size-8) var(--base-size-16);margin-bottom:var(--base-size-16);color:inherit;border-left:.25em solid var(--borderColor-default)}.markdown-body .markdown-alert>:first-child{margin-top:0}.markdown-body .markdown-alert>:last-child{margin-bottom:0}.markdown-body .markdown-alert .markdown-alert-title{font-weight:var(--base-text-weight-medium,500);align-items:center;line-height:1;display:flex}.markdown-body .markdown-alert.markdown-alert-note{border-left-color:var(--borderColor-accent-emphasis)}.markdown-body .markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--fgColor-accent)}.markdown-body .markdown-alert.markdown-alert-important{border-left-color:var(--borderColor-done-emphasis)}.markdown-body .markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--fgColor-done)}.markdown-body .markdown-alert.markdown-alert-warning{border-left-color:var(--borderColor-attention-emphasis)}.markdown-body .markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--fgColor-attention)}.markdown-body .markdown-alert.markdown-alert-tip{border-left-color:var(--borderColor-success-emphasis)}.markdown-body .markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--fgColor-success)}.markdown-body .markdown-alert.markdown-alert-caution{border-left-color:var(--borderColor-danger-emphasis)}.markdown-body .markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--fgColor-danger)}.markdown-body>:first-child>.heading-element:first-child{margin-top:0!important}.markdown-body .highlight pre:has(+.zeroclipboard-container){min-height:52px}.cb-edit-btn[data-v-17816a06]{border:1px solid var(--app-border-subtle);background:var(--app-content-bg);width:26px;height:26px;color:var(--app-text-subtle);cursor:pointer;border-radius:9999px;flex:none;justify-content:center;align-items:center;font-size:11px;transition:color .15s,border-color .15s,opacity .15s;display:inline-flex}.cb-edit-btn[data-v-17816a06]:hover{color:var(--el-color-primary);border-color:var(--el-color-primary-light-5)}.transcript-item[data-v-17816a06] .markdown-body{color:inherit;font-size:inherit;line-height:inherit;background:0 0}.transcript-item[data-v-17816a06] .markdown-body>:first-child{margin-top:0}.transcript-item[data-v-17816a06] .markdown-body>:last-child{margin-bottom:0}.transcript-item[data-v-17816a06] .markdown-body ol{list-style:decimal}.transcript-item[data-v-17816a06] .markdown-body ul{list-style:outside}.transcript-item[data-v-17816a06] .markdown-body pre{background:0 0;border-radius:6px;margin:0;padding:0;overflow:hidden}.transcript-item[data-v-17816a06] .markdown-body pre code{color:#fff}.transcript-item[data-v-17816a06] .markdown-body a{color:var(--el-color-primary);text-decoration:underline}.cb-stream-text.is-streaming[data-v-17816a06] .markdown-body>:last-child:after{content:"";vertical-align:text-bottom;background:var(--el-color-primary);border-radius:1px;width:.45em;height:1em;margin-left:2px;animation:1s step-end infinite cb-caret-blink-17816a06;display:inline-block}@keyframes cb-caret-blink-17816a06{0%,50%{opacity:1}50.01%,to{opacity:0}}.cb-thinking__spinner[data-v-6087e9e6]{width:1em;font-family:var(--el-font-family-mono,monospace);display:inline-block}.cb-thinking__caret[data-v-6087e9e6]{margin-left:1px;animation:1s step-end infinite cb-thinking-blink-6087e9e6}@keyframes cb-thinking-blink-6087e9e6{0%,50%{opacity:1}50.01%,to{opacity:0}}.cb-question-dock[data-v-aa5e6831]{--auq-max-height:min(52dvh, 560px);flex-direction:column;min-height:0;display:flex}.cb-composer[data-v-aa5e6831]{position:relative}.cb-composer__input[data-v-aa5e6831] .el-textarea__inner{box-shadow:none;min-height:unset;background:0 0;border:none;padding:6px 4px;font-size:14px;line-height:1.5}@media (width<=767px){.cb-composer__input[data-v-aa5e6831] .el-textarea__inner{font-size:16px}}.cb-cwd-input[data-v-aa5e6831] .el-input__wrapper{border-radius:9999px}.cb-cwd-browse[data-v-aa5e6831]{color:var(--app-text-subtle);cursor:pointer;justify-content:center;align-items:center;transition:color .15s;display:inline-flex}.cb-cwd-browse[data-v-aa5e6831]:hover,.cb-cwd-browse[data-v-aa5e6831]:focus-visible{color:var(--el-color-primary);outline:none}.cb-slash-menu[data-v-aa5e6831]{z-index:20;border:1px solid var(--app-border-subtle);background:var(--app-content-bg);border-radius:12px;max-height:260px;margin:0;padding:4px;list-style:none;position:absolute;bottom:calc(100% + 6px);left:0;right:0;overflow-y:auto;box-shadow:0 8px 24px #0000001f}.cb-slash-menu__item[data-v-aa5e6831]{cursor:pointer;color:var(--app-text);border-radius:8px;align-items:baseline;gap:8px;padding:6px 10px;font-size:13px;display:flex}.cb-slash-menu__item--active[data-v-aa5e6831]{background:var(--app-content-hover-bg)}.cb-slash-menu__name[data-v-aa5e6831]{font-family:var(--el-font-family-mono,monospace);color:var(--el-color-primary);flex:none}.cb-slash-menu__hint[data-v-aa5e6831]{color:var(--app-text-subtle);flex:none;font-size:11px}.cb-slash-menu__desc[data-v-aa5e6831]{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--app-text-subtle);flex:1;font-size:12px;overflow:hidden}.cb-edit-cancel[data-v-aa5e6831]{color:var(--app-text-subtle);cursor:pointer;flex:none;transition:color .15s}.cb-edit-cancel[data-v-aa5e6831]:hover{color:var(--el-color-primary)}.cb-restore-code[data-v-aa5e6831]{height:auto}.cb-restore-code[data-v-aa5e6831] .el-checkbox__label{font-size:12px}.cb-icon-btn[data-v-aa5e6831]{border:1px solid var(--app-border-subtle);width:30px;height:30px;color:var(--app-text-subtle);cursor:pointer;background:0 0;border-radius:9999px;flex:none;justify-content:center;align-items:center;font-size:13px;transition:color .15s,border-color .15s;display:inline-flex}.cb-icon-btn[data-v-aa5e6831]:hover{color:var(--el-color-primary);border-color:var(--el-color-primary-light-5)}.cb-pill[data-v-aa5e6831]{border:1px solid var(--app-border-subtle);max-width:240px;height:28px;color:var(--app-text-subtle);cursor:pointer;background:0 0;border-radius:9999px;align-items:center;gap:6px;padding:0 10px;font-size:12px;line-height:1.2;transition:color .15s,border-color .15s;display:inline-flex}.cb-pill[data-v-aa5e6831]:hover{color:var(--el-color-primary);border-color:var(--el-color-primary-light-5)}.cb-pill__icon[data-v-aa5e6831]{flex:none;font-size:12px}.cb-pill__brand[data-v-aa5e6831]{-o-object-fit:contain;object-fit:contain;vertical-align:middle;flex:none;width:14px;height:14px}.cb-pill__caret[data-v-aa5e6831]{opacity:.55;flex:none;margin-left:2px;font-size:9px}.cb-pill--static[data-v-aa5e6831]{cursor:default}.cb-pill--static[data-v-aa5e6831]:hover{color:var(--app-text-subtle);border-color:var(--app-border-subtle)}html.dark .cb-pill__brand--invert[data-v-aa5e6831]{filter:invert()}.cb-model-menu[data-v-aa5e6831]{flex-direction:column;gap:2px;max-height:240px;display:flex;overflow-y:auto}.cb-model-option[data-v-aa5e6831]{text-align:left;cursor:pointer;width:100%;color:inherit;background:0 0;border:none;border-radius:6px;align-items:center;padding:6px 8px;font-size:13px;display:flex}.cb-model-option__check[data-v-aa5e6831]{flex:none;margin-right:6px;font-size:11px}.cb-model-option[data-v-aa5e6831]:hover{background:var(--app-content-hover-bg)}.cb-model-custom[data-v-aa5e6831]{border-top:1px solid var(--app-border-color,#00000014);margin-top:4px;padding-top:6px}.step-index[data-v-3d1ed01f]{color:#fff;background-color:var(--el-color-primary);border-radius:9999px;flex:none;justify-content:center;align-items:center;width:24px;height:24px;font-size:12px;display:flex}.cmd[data-v-3d1ed01f]{background-color:var(--app-sidebar-bg);border:1px solid var(--app-border-subtle);white-space:nowrap;border-radius:6px;padding:6px 10px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;display:block;overflow-x:auto}.item[data-v-89efc2be]{transition:border-color .15s}.item[data-v-89efc2be]:hover{border-color:var(--el-color-primary)}.provider-icon[data-v-89efc2be]{-o-object-fit:contain;object-fit:contain;flex:none;width:16px;height:16px}.running-dot[data-v-89efc2be]{background:var(--el-color-success);width:8px;height:8px;box-shadow:0 0 0 3px color-mix(in srgb, var(--el-color-success) 25%, transparent);border-radius:9999px;flex:none}html.dark .provider-icon--invert[data-v-89efc2be]{filter:invert()}.menu[data-v-44a88ff4]{display:none}@media (width<=767px){.sidebar[data-v-44a88ff4]{display:none}.menu[data-v-44a88ff4]{left:8px;top:calc(45px + var(--app-safe-area-top));z-index:1000;display:block;position:absolute}}
|
|
1
|
+
.markdown-body{--base-size-16:1rem;--base-size-24:1.5rem;--base-size-4:.25rem;--base-size-40:2.5rem;--base-size-8:.5rem;--base-text-weight-medium:500;--base-text-weight-normal:400;--base-text-weight-semibold:600;--fontStack-monospace:ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace;--fontStack-sansSerif:-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";--fgColor-accent:Highlight}@media (prefers-color-scheme:dark){.markdown-body,[data-theme=dark]{--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark;--fgColor-accent:#4493f8;--bgColor-attention-muted:#bb800926;--bgColor-default:#0d1117;--bgColor-muted:#151b23;--bgColor-neutral-muted:#656c7633;--borderColor-accent-emphasis:#1f6feb;--borderColor-attention-emphasis:#9e6a03;--borderColor-danger-emphasis:#da3633;--borderColor-default:#3d444d;--borderColor-done-emphasis:#8957e5;--borderColor-success-emphasis:#238636;--color-prettylights-syntax-brackethighlighter-angle:#9198a1;--color-prettylights-syntax-brackethighlighter-unmatched:#f85149;--color-prettylights-syntax-carriage-return-bg:#b62324;--color-prettylights-syntax-carriage-return-text:#f0f6fc;--color-prettylights-syntax-comment:#9198a1;--color-prettylights-syntax-constant:#79c0ff;--color-prettylights-syntax-constant-other-reference-link:#a5d6ff;--color-prettylights-syntax-entity:#d2a8ff;--color-prettylights-syntax-entity-tag:#7ee787;--color-prettylights-syntax-keyword:#ff7b72;--color-prettylights-syntax-markup-bold:#f0f6fc;--color-prettylights-syntax-markup-changed-bg:#5a1e02;--color-prettylights-syntax-markup-changed-text:#ffdfb6;--color-prettylights-syntax-markup-deleted-bg:#67060c;--color-prettylights-syntax-markup-deleted-text:#ffdcd7;--color-prettylights-syntax-markup-heading:#1f6feb;--color-prettylights-syntax-markup-ignored-bg:#1158c7;--color-prettylights-syntax-markup-ignored-text:#f0f6fc;--color-prettylights-syntax-markup-inserted-bg:#033a16;--color-prettylights-syntax-markup-inserted-text:#aff5b4;--color-prettylights-syntax-markup-italic:#f0f6fc;--color-prettylights-syntax-markup-list:#f2cc60;--color-prettylights-syntax-meta-diff-range:#d2a8ff;--color-prettylights-syntax-storage-modifier-import:#f0f6fc;--color-prettylights-syntax-string:#a5d6ff;--color-prettylights-syntax-string-regexp:#7ee787;--color-prettylights-syntax-sublimelinter-gutter-mark:#3d444d;--color-prettylights-syntax-variable:#ffa657;--fgColor-attention:#d29922;--fgColor-danger:#f85149;--fgColor-default:#f0f6fc;--fgColor-done:#ab7df8;--fgColor-muted:#9198a1;--fgColor-success:#3fb950;--borderColor-muted:#3d444db3;--color-prettylights-syntax-invalid-illegal-bg:var(--bgColor-danger-muted);--color-prettylights-syntax-invalid-illegal-text:var(--fgColor-danger);--focus-outlineColor:var(--borderColor-accent-emphasis);--borderColor-neutral-muted:var(--borderColor-muted)}}@media (prefers-color-scheme:light){.markdown-body,[data-theme=light]{--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light;--fgColor-danger:#d1242f;--bgColor-attention-muted:#fff8c5;--bgColor-muted:#f6f8fa;--bgColor-neutral-muted:#818b981f;--borderColor-accent-emphasis:#0969da;--borderColor-attention-emphasis:#9a6700;--borderColor-danger-emphasis:#cf222e;--borderColor-default:#d1d9e0;--borderColor-done-emphasis:#8250df;--borderColor-success-emphasis:#1a7f37;--color-prettylights-syntax-brackethighlighter-angle:#59636e;--color-prettylights-syntax-brackethighlighter-unmatched:#82071e;--color-prettylights-syntax-carriage-return-bg:#cf222e;--color-prettylights-syntax-carriage-return-text:#f6f8fa;--color-prettylights-syntax-comment:#59636e;--color-prettylights-syntax-constant:#0550ae;--color-prettylights-syntax-constant-other-reference-link:#0a3069;--color-prettylights-syntax-entity:#6639ba;--color-prettylights-syntax-entity-tag:#0550ae;--color-prettylights-syntax-invalid-illegal-text:var(--fgColor-danger);--color-prettylights-syntax-keyword:#cf222e;--color-prettylights-syntax-markup-changed-bg:#ffd8b5;--color-prettylights-syntax-markup-changed-text:#953800;--color-prettylights-syntax-markup-deleted-bg:#ffebe9;--color-prettylights-syntax-markup-deleted-text:#82071e;--color-prettylights-syntax-markup-heading:#0550ae;--color-prettylights-syntax-markup-ignored-bg:#0550ae;--color-prettylights-syntax-markup-ignored-text:#d1d9e0;--color-prettylights-syntax-markup-inserted-bg:#dafbe1;--color-prettylights-syntax-markup-inserted-text:#116329;--color-prettylights-syntax-markup-list:#3b2300;--color-prettylights-syntax-meta-diff-range:#8250df;--color-prettylights-syntax-string:#0a3069;--color-prettylights-syntax-string-regexp:#116329;--color-prettylights-syntax-sublimelinter-gutter-mark:#818b98;--color-prettylights-syntax-variable:#953800;--fgColor-accent:#0969da;--fgColor-attention:#9a6700;--fgColor-done:#8250df;--fgColor-muted:#59636e;--fgColor-success:#1a7f37;--bgColor-default:#fff;--borderColor-muted:#d1d9e0b3;--color-prettylights-syntax-invalid-illegal-bg:var(--bgColor-danger-muted);--color-prettylights-syntax-markup-bold:#1f2328;--color-prettylights-syntax-markup-italic:#1f2328;--color-prettylights-syntax-storage-modifier-import:#1f2328;--fgColor-default:#1f2328;--focus-outlineColor:var(--borderColor-accent-emphasis);--borderColor-neutral-muted:var(--borderColor-muted)}}.markdown-body{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;font-weight:var(--base-text-weight-normal,400);color:var(--fgColor-default);background-color:var(--bgColor-default);font-family:var(--fontStack-sansSerif,-apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji");word-wrap:break-word;margin:0;font-size:16px;line-height:1.5}.markdown-body a{text-underline-offset:.2rem;text-decoration:underline}.markdown-body .octicon{fill:currentColor;vertical-align:text-bottom;display:inline-block}.markdown-body h1:hover .anchor .octicon-link:before,.markdown-body h2:hover .anchor .octicon-link:before,.markdown-body h3:hover .anchor .octicon-link:before,.markdown-body h4:hover .anchor .octicon-link:before,.markdown-body h5:hover .anchor .octicon-link:before,.markdown-body h6:hover .anchor .octicon-link:before{content:" ";background-color:currentColor;width:16px;height:16px;display:inline-block;-webkit-mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>");mask-image:url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' version='1.1' aria-hidden='true'><path fill-rule='evenodd' d='M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z'></path></svg>")}.markdown-body details,.markdown-body figcaption,.markdown-body figure{display:block}.markdown-body summary{display:list-item}.markdown-body [hidden]{display:none!important}.markdown-body a{color:var(--fgColor-accent);background-color:#0000;text-decoration:none}.markdown-body abbr[title]{border-bottom:none;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}.markdown-body b,.markdown-body strong{font-weight:var(--base-text-weight-semibold,600)}.markdown-body dfn{font-style:italic}.markdown-body h1{font-weight:var(--base-text-weight-semibold,600);border-bottom:1px solid var(--borderColor-muted);margin:.67em 0;padding-bottom:.3em;font-size:2em}.markdown-body mark{background-color:var(--bgColor-attention-muted);color:var(--fgColor-default)}.markdown-body small{font-size:90%}.markdown-body sub,.markdown-body sup{vertical-align:baseline;font-size:75%;line-height:0;position:relative}.markdown-body sub{bottom:-.25em}.markdown-body sup{top:-.5em}.markdown-body img{box-sizing:content-box;border-style:none;max-width:100%}.markdown-body code,.markdown-body kbd,.markdown-body pre,.markdown-body samp{font-family:monospace;font-size:1em}.markdown-body figure{margin:1em var(--base-size-40)}.markdown-body hr{box-sizing:content-box;border-bottom:1px solid var(--borderColor-muted);height:.25em;margin:var(--base-size-24) 0;background:0 0;background-color:var(--borderColor-default);border:0;padding:0;overflow:hidden}.markdown-body input{font:inherit;font-family:inherit;font-size:inherit;line-height:inherit;margin:0;overflow:visible}.markdown-body [type=button],.markdown-body [type=reset],.markdown-body [type=submit]{appearance:button}.markdown-body [type=checkbox],.markdown-body [type=radio]{box-sizing:border-box;padding:0}.markdown-body [type=number]::-webkit-inner-spin-button{height:auto}.markdown-body [type=number]::-webkit-outer-spin-button{height:auto}.markdown-body [type=search]::-webkit-search-cancel-button{appearance:none}.markdown-body [type=search]::-webkit-search-decoration{appearance:none}.markdown-body ::-webkit-input-placeholder{color:inherit;opacity:.54}.markdown-body ::-webkit-file-upload-button{appearance:button;font:inherit}.markdown-body a:hover{text-decoration:underline}.markdown-body ::placeholder{color:var(--fgColor-muted);opacity:1}.markdown-body hr:before{content:"";display:table}.markdown-body hr:after{clear:both;content:"";display:table}.markdown-body table{border-spacing:0;border-collapse:collapse;font-variant:tabular-nums;width:max-content;max-width:100%;display:block;overflow:auto}.markdown-body td,.markdown-body th{padding:0}.markdown-body details summary{cursor:pointer}.markdown-body a:focus,.markdown-body [role=button]:focus,.markdown-body input[type=radio]:focus,.markdown-body input[type=checkbox]:focus{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:focus:not(:focus-visible),.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body input[type=radio]:focus:not(:focus-visible),.markdown-body input[type=checkbox]:focus:not(:focus-visible){outline:1px solid #0000}.markdown-body a:focus-visible,.markdown-body [role=button]:focus-visible,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:-2px;box-shadow:none}.markdown-body a:not([class]):focus,.markdown-body a:not([class]):focus-visible,.markdown-body input[type=radio]:focus,.markdown-body input[type=radio]:focus-visible,.markdown-body input[type=checkbox]:focus,.markdown-body input[type=checkbox]:focus-visible{outline-offset:0}.markdown-body kbd{padding:var(--base-size-4);font:11px var(--fontStack-monospace,ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);color:var(--fgColor-default);vertical-align:middle;background-color:var(--bgColor-muted);border:solid 1px var(--borderColor-neutral-muted);border-bottom-color:var(--borderColor-neutral-muted);box-shadow:inset 0 -1px 0 var(--borderColor-neutral-muted);border-radius:6px;line-height:10px;display:inline-block}.markdown-body h1,.markdown-body h2,.markdown-body h3,.markdown-body h4,.markdown-body h5,.markdown-body h6{margin-top:var(--base-size-24);margin-bottom:var(--base-size-16);font-weight:var(--base-text-weight-semibold,600);line-height:1.25}.markdown-body h2{font-weight:var(--base-text-weight-semibold,600);border-bottom:1px solid var(--borderColor-muted);padding-bottom:.3em;font-size:1.5em}.markdown-body h3{font-weight:var(--base-text-weight-semibold,600);font-size:1.25em}.markdown-body h4{font-weight:var(--base-text-weight-semibold,600);font-size:1em}.markdown-body h5{font-weight:var(--base-text-weight-semibold,600);font-size:.875em}.markdown-body h6{font-weight:var(--base-text-weight-semibold,600);color:var(--fgColor-muted);font-size:.85em}.markdown-body p{margin-top:0;margin-bottom:10px}.markdown-body blockquote{color:var(--fgColor-muted);border-left:.25em solid var(--borderColor-default);margin:0;padding:0 1em}.markdown-body ul,.markdown-body ol{margin-top:0;margin-bottom:0;padding-left:2em}.markdown-body ol ol,.markdown-body ul ol{list-style-type:lower-roman}.markdown-body ul ul ol,.markdown-body ul ol ol,.markdown-body ol ul ol,.markdown-body ol ol ol{list-style-type:lower-alpha}.markdown-body dd{margin-left:0}.markdown-body tt,.markdown-body code,.markdown-body samp{font-family:var(--fontStack-monospace,ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);font-size:12px}.markdown-body pre{font-family:var(--fontStack-monospace,ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace);word-wrap:normal;margin-top:0;margin-bottom:0;font-size:12px}.markdown-body .octicon{vertical-align:text-bottom;fill:currentColor;display:inline-block;overflow:visible!important}.markdown-body input::-webkit-outer-spin-button{appearance:none;margin:0}.markdown-body input::-webkit-inner-spin-button{appearance:none;margin:0}.markdown-body .mr-2{margin-right:var(--base-size-8,8px)!important}.markdown-body:before{content:"";display:table}.markdown-body:after{clear:both;content:"";display:table}.markdown-body>:first-child{margin-top:0!important}.markdown-body>:last-child{margin-bottom:0!important}.markdown-body a:not([href]){color:inherit;text-decoration:none}.markdown-body .absent{color:var(--fgColor-danger)}.markdown-body .anchor{float:left;padding-right:var(--base-size-4);margin-left:-20px;line-height:1}.markdown-body .anchor:focus{outline:none}.markdown-body p,.markdown-body blockquote,.markdown-body ul,.markdown-body ol,.markdown-body dl,.markdown-body table,.markdown-body pre,.markdown-body details{margin-top:0;margin-bottom:var(--base-size-16)}.markdown-body blockquote>:first-child{margin-top:0}.markdown-body blockquote>:last-child{margin-bottom:0}.markdown-body h1 .octicon-link,.markdown-body h2 .octicon-link,.markdown-body h3 .octicon-link,.markdown-body h4 .octicon-link,.markdown-body h5 .octicon-link,.markdown-body h6 .octicon-link{color:var(--fgColor-default);vertical-align:middle;visibility:hidden}.markdown-body h1:hover .anchor,.markdown-body h2:hover .anchor,.markdown-body h3:hover .anchor,.markdown-body h4:hover .anchor,.markdown-body h5:hover .anchor,.markdown-body h6:hover .anchor{text-decoration:none}.markdown-body h1:hover .anchor .octicon-link,.markdown-body h2:hover .anchor .octicon-link,.markdown-body h3:hover .anchor .octicon-link,.markdown-body h4:hover .anchor .octicon-link,.markdown-body h5:hover .anchor .octicon-link,.markdown-body h6:hover .anchor .octicon-link{visibility:visible}.markdown-body h1 tt,.markdown-body h1 code,.markdown-body h2 tt,.markdown-body h2 code,.markdown-body h3 tt,.markdown-body h3 code,.markdown-body h4 tt,.markdown-body h4 code,.markdown-body h5 tt,.markdown-body h5 code,.markdown-body h6 tt,.markdown-body h6 code{font-size:inherit;padding:0 .2em}.markdown-body summary h1,.markdown-body summary h2,.markdown-body summary h3,.markdown-body summary h4,.markdown-body summary h5,.markdown-body summary h6{display:inline-block}.markdown-body summary h1 .anchor,.markdown-body summary h2 .anchor,.markdown-body summary h3 .anchor,.markdown-body summary h4 .anchor,.markdown-body summary h5 .anchor,.markdown-body summary h6 .anchor{margin-left:-40px}.markdown-body summary h1,.markdown-body summary h2{border-bottom:0;padding-bottom:0}.markdown-body ul.no-list,.markdown-body ol.no-list{padding:0;list-style-type:none}.markdown-body ol[type=a\ s]{list-style-type:lower-alpha}.markdown-body ol[type=A\ s]{list-style-type:upper-alpha}.markdown-body ol[type=i\ s]{list-style-type:lower-roman}.markdown-body ol[type=I\ s]{list-style-type:upper-roman}.markdown-body ol[type="1"],.markdown-body div>ol:not([type]){list-style-type:decimal}.markdown-body ul ul,.markdown-body ul ol,.markdown-body ol ol,.markdown-body ol ul{margin-top:0;margin-bottom:0}.markdown-body li>p{margin-top:var(--base-size-16)}.markdown-body li+li{margin-top:.25em}.markdown-body dl{padding:0}.markdown-body dl dt{margin-top:var(--base-size-16);font-size:1em;font-style:italic;font-weight:var(--base-text-weight-semibold,600);padding:0}.markdown-body dl dd{padding:0 var(--base-size-16);margin-bottom:var(--base-size-16)}.markdown-body table th{font-weight:var(--base-text-weight-semibold,600)}.markdown-body table th,.markdown-body table td{border:1px solid var(--borderColor-default);padding:6px 13px}.markdown-body table td>:last-child{margin-bottom:0}.markdown-body table tr{background-color:var(--bgColor-default);border-top:1px solid var(--borderColor-muted)}.markdown-body table tr:nth-child(2n){background-color:var(--bgColor-muted)}.markdown-body table img{background-color:#0000}.markdown-body img[align=right]{padding-left:20px}.markdown-body img[align=left]{padding-right:20px}.markdown-body .emoji{vertical-align:text-top;background-color:#0000;max-width:none}.markdown-body span.frame{display:block;overflow:hidden}.markdown-body span.frame>span{float:left;border:1px solid var(--borderColor-default);width:auto;margin:13px 0 0;padding:7px;display:block;overflow:hidden}.markdown-body span.frame span img{float:left;display:block}.markdown-body span.frame span span{clear:both;color:var(--fgColor-default);padding:5px 0 0;display:block}.markdown-body span.align-center{clear:both;display:block;overflow:hidden}.markdown-body span.align-center>span{text-align:center;margin:13px auto 0;display:block;overflow:hidden}.markdown-body span.align-center span img{text-align:center;margin:0 auto}.markdown-body span.align-right{clear:both;display:block;overflow:hidden}.markdown-body span.align-right>span{text-align:right;margin:13px 0 0;display:block;overflow:hidden}.markdown-body span.align-right span img{text-align:right;margin:0}.markdown-body span.float-left{float:left;margin-right:13px;display:block;overflow:hidden}.markdown-body span.float-left span{margin:13px 0 0}.markdown-body span.float-right{float:right;margin-left:13px;display:block;overflow:hidden}.markdown-body span.float-right>span{text-align:right;margin:13px auto 0;display:block;overflow:hidden}.markdown-body code,.markdown-body tt{white-space:break-spaces;background-color:var(--bgColor-neutral-muted);border-radius:6px;margin:0;padding:.2em .4em;font-size:85%}.markdown-body code br,.markdown-body tt br{display:none}.markdown-body del code{-webkit-text-decoration:inherit;text-decoration:inherit}.markdown-body samp{font-size:85%}.markdown-body pre code{font-size:100%}.markdown-body pre>code{word-break:normal;white-space:pre;background:0 0;border:0;margin:0;padding:0}.markdown-body .highlight{margin-bottom:var(--base-size-16)}.markdown-body .highlight pre{word-break:normal;margin-bottom:0}.markdown-body .highlight pre,.markdown-body pre{padding:var(--base-size-16);color:var(--fgColor-default);background-color:var(--bgColor-muted);border-radius:6px;font-size:85%;line-height:1.45;overflow:auto}.markdown-body pre code,.markdown-body pre tt{line-height:inherit;word-wrap:normal;background-color:#0000;border:0;margin:0;padding:0;display:inline;overflow:visible}.markdown-body .csv-data td,.markdown-body .csv-data th{text-align:left;white-space:nowrap;padding:5px;font-size:12px;line-height:1;overflow:hidden}.markdown-body .csv-data .blob-num{padding:10px var(--base-size-8) 9px;text-align:right;background:var(--bgColor-default);border:0}.markdown-body .csv-data tr{border-top:0}.markdown-body .csv-data th{font-weight:var(--base-text-weight-semibold,600);background:var(--bgColor-muted);border-top:0}.markdown-body [data-footnote-ref]:before{content:"["}.markdown-body [data-footnote-ref]:after{content:"]"}.markdown-body .footnotes{color:var(--fgColor-muted);border-top:1px solid var(--borderColor-default);font-size:12px}.markdown-body .footnotes ol{padding-left:var(--base-size-16)}.markdown-body .footnotes ol ul{padding-left:var(--base-size-16);margin-top:var(--base-size-16);display:inline-block}.markdown-body .footnotes li{position:relative}.markdown-body .footnotes li:target:before{top:calc(var(--base-size-8)*-1);right:calc(var(--base-size-8)*-1);bottom:calc(var(--base-size-8)*-1);left:calc(var(--base-size-24)*-1);pointer-events:none;content:"";border:2px solid var(--borderColor-accent-emphasis);border-radius:6px;position:absolute}.markdown-body .footnotes li:target{color:var(--fgColor-default)}.markdown-body .footnotes .data-footnote-backref g-emoji{font-family:monospace}.markdown-body .pl-c{color:var(--color-prettylights-syntax-comment)}.markdown-body .pl-c1,.markdown-body .pl-s .pl-v{color:var(--color-prettylights-syntax-constant)}.markdown-body .pl-e,.markdown-body .pl-en{color:var(--color-prettylights-syntax-entity)}.markdown-body .pl-smi,.markdown-body .pl-s .pl-s1{color:var(--color-prettylights-syntax-storage-modifier-import)}.markdown-body .pl-ent{color:var(--color-prettylights-syntax-entity-tag)}.markdown-body .pl-k{color:var(--color-prettylights-syntax-keyword)}.markdown-body .pl-s,.markdown-body .pl-pds,.markdown-body .pl-s .pl-pse .pl-s1,.markdown-body .pl-sr,.markdown-body .pl-sr .pl-cce,.markdown-body .pl-sr .pl-sre,.markdown-body .pl-sr .pl-sra{color:var(--color-prettylights-syntax-string)}.markdown-body .pl-v,.markdown-body .pl-smw{color:var(--color-prettylights-syntax-variable)}.markdown-body .pl-bu{color:var(--color-prettylights-syntax-brackethighlighter-unmatched)}.markdown-body .pl-ii{color:var(--color-prettylights-syntax-invalid-illegal-text);background-color:var(--color-prettylights-syntax-invalid-illegal-bg)}.markdown-body .pl-c2{color:var(--color-prettylights-syntax-carriage-return-text);background-color:var(--color-prettylights-syntax-carriage-return-bg)}.markdown-body .pl-sr .pl-cce{color:var(--color-prettylights-syntax-string-regexp);font-weight:700}.markdown-body .pl-ml{color:var(--color-prettylights-syntax-markup-list)}.markdown-body .pl-mh,.markdown-body .pl-mh .pl-en,.markdown-body .pl-ms{color:var(--color-prettylights-syntax-markup-heading);font-weight:700}.markdown-body .pl-mi{color:var(--color-prettylights-syntax-markup-italic);font-style:italic}.markdown-body .pl-mb{color:var(--color-prettylights-syntax-markup-bold);font-weight:700}.markdown-body .pl-md{color:var(--color-prettylights-syntax-markup-deleted-text);background-color:var(--color-prettylights-syntax-markup-deleted-bg)}.markdown-body .pl-mi1{color:var(--color-prettylights-syntax-markup-inserted-text);background-color:var(--color-prettylights-syntax-markup-inserted-bg)}.markdown-body .pl-mc{color:var(--color-prettylights-syntax-markup-changed-text);background-color:var(--color-prettylights-syntax-markup-changed-bg)}.markdown-body .pl-mi2{color:var(--color-prettylights-syntax-markup-ignored-text);background-color:var(--color-prettylights-syntax-markup-ignored-bg)}.markdown-body .pl-mdr{color:var(--color-prettylights-syntax-meta-diff-range);font-weight:700}.markdown-body .pl-ba{color:var(--color-prettylights-syntax-brackethighlighter-angle)}.markdown-body .pl-sg{color:var(--color-prettylights-syntax-sublimelinter-gutter-mark)}.markdown-body .pl-corl{color:var(--color-prettylights-syntax-constant-other-reference-link);text-decoration:underline}.markdown-body [role=button]:focus:not(:focus-visible),.markdown-body [role=tabpanel][tabindex="0"]:focus:not(:focus-visible),.markdown-body button:focus:not(:focus-visible),.markdown-body summary:focus:not(:focus-visible),.markdown-body a:focus:not(:focus-visible){box-shadow:none;outline:none}.markdown-body [tabindex="0"]:focus:not(:focus-visible),.markdown-body details-dialog:focus:not(:focus-visible){outline:none}.markdown-body g-emoji{min-width:1ch;font-family:Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol;font-size:1em;font-weight:var(--base-text-weight-normal,400);vertical-align:-.075em;line-height:1;display:inline-block;font-style:normal!important}.markdown-body g-emoji img{width:1em;height:1em}.markdown-body a:has(>p,>div,>pre,>blockquote){display:block}.markdown-body a:has(>p,>div,>pre,>blockquote):not(:has(.snippet-clipboard-content,>pre)){width:fit-content}.markdown-body a:has(>p,>div,>pre,>blockquote):has(.snippet-clipboard-content,>pre):focus-visible{outline:2px solid var(--focus-outlineColor);outline-offset:2px}.markdown-body .task-list-item{list-style-type:none}.markdown-body .task-list-item label{font-weight:var(--base-text-weight-normal,400)}.markdown-body .task-list-item.enabled label{cursor:pointer}.markdown-body .task-list-item+.task-list-item{margin-top:var(--base-size-4)}.markdown-body .task-list-item .handle{display:none}.markdown-body .task-list-item-checkbox{vertical-align:middle;margin:0 .2em .25em -1.4em}.markdown-body ul:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) .task-list-item-checkbox,.markdown-body ol:is(:lang(ae),:lang(ar),:lang(arc),:lang(bcc),:lang(bqi),:lang(ckb),:lang(dv),:lang(fa),:lang(glk),:lang(he),:lang(ku),:lang(mzn),:lang(nqo),:lang(pnb),:lang(ps),:lang(sd),:lang(ug),:lang(ur),:lang(yi)) .task-list-item-checkbox{margin:0 -1.6em .25em .2em}.markdown-body .contains-task-list:hover .task-list-item-convert-container,.markdown-body .contains-task-list:focus-within .task-list-item-convert-container{clip-path:none;width:auto;height:24px;display:block;overflow:visible}.markdown-body ::-webkit-calendar-picker-indicator{filter:invert(50%)}.markdown-body .markdown-alert{padding:var(--base-size-8) var(--base-size-16);margin-bottom:var(--base-size-16);color:inherit;border-left:.25em solid var(--borderColor-default)}.markdown-body .markdown-alert>:first-child{margin-top:0}.markdown-body .markdown-alert>:last-child{margin-bottom:0}.markdown-body .markdown-alert .markdown-alert-title{font-weight:var(--base-text-weight-medium,500);align-items:center;line-height:1;display:flex}.markdown-body .markdown-alert.markdown-alert-note{border-left-color:var(--borderColor-accent-emphasis)}.markdown-body .markdown-alert.markdown-alert-note .markdown-alert-title{color:var(--fgColor-accent)}.markdown-body .markdown-alert.markdown-alert-important{border-left-color:var(--borderColor-done-emphasis)}.markdown-body .markdown-alert.markdown-alert-important .markdown-alert-title{color:var(--fgColor-done)}.markdown-body .markdown-alert.markdown-alert-warning{border-left-color:var(--borderColor-attention-emphasis)}.markdown-body .markdown-alert.markdown-alert-warning .markdown-alert-title{color:var(--fgColor-attention)}.markdown-body .markdown-alert.markdown-alert-tip{border-left-color:var(--borderColor-success-emphasis)}.markdown-body .markdown-alert.markdown-alert-tip .markdown-alert-title{color:var(--fgColor-success)}.markdown-body .markdown-alert.markdown-alert-caution{border-left-color:var(--borderColor-danger-emphasis)}.markdown-body .markdown-alert.markdown-alert-caution .markdown-alert-title{color:var(--fgColor-danger)}.markdown-body>:first-child>.heading-element:first-child{margin-top:0!important}.markdown-body .highlight pre:has(+.zeroclipboard-container){min-height:52px}.cb-edit-btn[data-v-17816a06]{border:1px solid var(--app-border-subtle);background:var(--app-content-bg);width:26px;height:26px;color:var(--app-text-subtle);cursor:pointer;border-radius:9999px;flex:none;justify-content:center;align-items:center;font-size:11px;transition:color .15s,border-color .15s,opacity .15s;display:inline-flex}.cb-edit-btn[data-v-17816a06]:hover{color:var(--el-color-primary);border-color:var(--el-color-primary-light-5)}.transcript-item[data-v-17816a06] .markdown-body{color:inherit;font-size:inherit;line-height:inherit;background:0 0}.transcript-item[data-v-17816a06] .markdown-body>:first-child{margin-top:0}.transcript-item[data-v-17816a06] .markdown-body>:last-child{margin-bottom:0}.transcript-item[data-v-17816a06] .markdown-body ol{list-style:decimal}.transcript-item[data-v-17816a06] .markdown-body ul{list-style:outside}.transcript-item[data-v-17816a06] .markdown-body pre{background:0 0;border-radius:6px;margin:0;padding:0;overflow:hidden}.transcript-item[data-v-17816a06] .markdown-body pre code{color:#fff}.transcript-item[data-v-17816a06] .markdown-body a{color:var(--el-color-primary);text-decoration:underline}.cb-stream-text.is-streaming[data-v-17816a06] .markdown-body>:last-child:after{content:"";vertical-align:text-bottom;background:var(--el-color-primary);border-radius:1px;width:.45em;height:1em;margin-left:2px;animation:1s step-end infinite cb-caret-blink-17816a06;display:inline-block}@keyframes cb-caret-blink-17816a06{0%,50%{opacity:1}50.01%,to{opacity:0}}.cb-thinking__spinner[data-v-6087e9e6]{width:1em;font-family:var(--el-font-family-mono,monospace);display:inline-block}.cb-thinking__caret[data-v-6087e9e6]{margin-left:1px;animation:1s step-end infinite cb-thinking-blink-6087e9e6}@keyframes cb-thinking-blink-6087e9e6{0%,50%{opacity:1}50.01%,to{opacity:0}}.cb-question-dock[data-v-b97e033b]{--auq-max-height:min(52dvh, 560px);flex-direction:column;min-height:0;display:flex}.cb-composer[data-v-b97e033b]{position:relative}.cb-composer__input[data-v-b97e033b] .el-textarea__inner{box-shadow:none;min-height:unset;background:0 0;border:none;padding:6px 4px;font-size:14px;line-height:1.5}@media (width<=767px){.cb-composer__input[data-v-b97e033b] .el-textarea__inner{font-size:16px}}.cb-cwd-input[data-v-b97e033b] .el-input__wrapper{border-radius:9999px}.cb-cwd-browse[data-v-b97e033b]{color:var(--app-text-subtle);cursor:pointer;justify-content:center;align-items:center;transition:color .15s;display:inline-flex}.cb-cwd-browse[data-v-b97e033b]:hover,.cb-cwd-browse[data-v-b97e033b]:focus-visible{color:var(--el-color-primary);outline:none}.cb-slash-menu[data-v-b97e033b]{z-index:20;border:1px solid var(--app-border-subtle);background:var(--app-content-bg);border-radius:12px;max-height:260px;margin:0;padding:4px;list-style:none;position:absolute;bottom:calc(100% + 6px);left:0;right:0;overflow-y:auto;box-shadow:0 8px 24px #0000001f}.cb-slash-menu__item[data-v-b97e033b]{cursor:pointer;color:var(--app-text);border-radius:8px;align-items:baseline;gap:8px;padding:6px 10px;font-size:13px;display:flex}.cb-slash-menu__item--active[data-v-b97e033b]{background:var(--app-content-hover-bg)}.cb-slash-menu__name[data-v-b97e033b]{font-family:var(--el-font-family-mono,monospace);color:var(--el-color-primary);flex:none}.cb-slash-menu__hint[data-v-b97e033b]{color:var(--app-text-subtle);flex:none;font-size:11px}.cb-slash-menu__desc[data-v-b97e033b]{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--app-text-subtle);flex:1;font-size:12px;overflow:hidden}.cb-edit-cancel[data-v-b97e033b]{color:var(--app-text-subtle);cursor:pointer;flex:none;transition:color .15s}.cb-edit-cancel[data-v-b97e033b]:hover{color:var(--el-color-primary)}.cb-restore-code[data-v-b97e033b]{height:auto}.cb-restore-code[data-v-b97e033b] .el-checkbox__label{font-size:12px}.cb-icon-btn[data-v-b97e033b]{border:1px solid var(--app-border-subtle);width:30px;height:30px;color:var(--app-text-subtle);cursor:pointer;background:0 0;border-radius:9999px;flex:none;justify-content:center;align-items:center;font-size:13px;transition:color .15s,border-color .15s;display:inline-flex}.cb-icon-btn[data-v-b97e033b]:hover{color:var(--el-color-primary);border-color:var(--el-color-primary-light-5)}.cb-pill[data-v-b97e033b]{border:1px solid var(--app-border-subtle);max-width:240px;height:28px;color:var(--app-text-subtle);cursor:pointer;background:0 0;border-radius:9999px;align-items:center;gap:6px;padding:0 10px;font-size:12px;line-height:1.2;transition:color .15s,border-color .15s;display:inline-flex}.cb-pill[data-v-b97e033b]:hover{color:var(--el-color-primary);border-color:var(--el-color-primary-light-5)}.cb-pill__icon[data-v-b97e033b]{flex:none;font-size:12px}.cb-pill__brand[data-v-b97e033b]{-o-object-fit:contain;object-fit:contain;vertical-align:middle;flex:none;width:14px;height:14px}.cb-pill__caret[data-v-b97e033b]{opacity:.55;flex:none;margin-left:2px;font-size:9px}.cb-pill--static[data-v-b97e033b]{cursor:default}.cb-pill--static[data-v-b97e033b]:hover{color:var(--app-text-subtle);border-color:var(--app-border-subtle)}html.dark .cb-pill__brand--invert[data-v-b97e033b]{filter:invert()}.cb-model-menu[data-v-b97e033b]{flex-direction:column;gap:2px;max-height:240px;display:flex;overflow-y:auto}.cb-model-option[data-v-b97e033b]{text-align:left;cursor:pointer;width:100%;color:inherit;background:0 0;border:none;border-radius:6px;align-items:center;padding:6px 8px;font-size:13px;display:flex}.cb-model-option__check[data-v-b97e033b]{flex:none;margin-right:6px;font-size:11px}.cb-model-option[data-v-b97e033b]:hover{background:var(--app-content-hover-bg)}.cb-model-custom[data-v-b97e033b]{border-top:1px solid var(--app-border-color,#00000014);margin-top:4px;padding-top:6px}.step-index[data-v-3d1ed01f]{color:#fff;background-color:var(--el-color-primary);border-radius:9999px;flex:none;justify-content:center;align-items:center;width:24px;height:24px;font-size:12px;display:flex}.cmd[data-v-3d1ed01f]{background-color:var(--app-sidebar-bg);border:1px solid var(--app-border-subtle);white-space:nowrap;border-radius:6px;padding:6px 10px;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;font-size:12px;display:block;overflow-x:auto}.item[data-v-fa29bb91]{transition:border-color .15s}.item[data-v-fa29bb91]:hover{border-color:var(--el-color-primary)}.provider-icon[data-v-fa29bb91]{-o-object-fit:contain;object-fit:contain;flex:none;width:16px;height:16px}.running-dot[data-v-fa29bb91]{background:var(--el-color-success);width:8px;height:8px;box-shadow:0 0 0 3px color-mix(in srgb, var(--el-color-success) 25%, transparent);border-radius:9999px;flex:none}html.dark .provider-icon--invert[data-v-fa29bb91]{filter:invert()}.menu[data-v-44a88ff4]{display:none}@media (width<=767px){.sidebar[data-v-44a88ff4]{display:none}.menu[data-v-44a88ff4]{left:8px;top:calc(45px + var(--app-safe-area-top));z-index:1000;display:block;position:absolute}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{$ as e,A as t,D as n,F as r,N as i,O as a,P as o,S as s,Vt as c,Wt as l,Z as u,b as d,dt as f,et as p,k as m,tt as h,ut as g,v as _}from"./vendor-chart-BJCvKk8-.js";import{t as v}from"./button-DfsQodL-.js";import{n as y,r as b,t as x}from"./select-CbNogKSw.js";import{t as S}from"./upload-_lBvoaGk.js";import{t as C}from"./tooltip-BLwTovWL.js";import{t as w}from"./image-ttyLLhNO.js";import{t as T}from"./alert-OvnfgMB-.js";import{t as E}from"./drawer-Dpuj2uIl.js";import{t as D}from"./input-number-CRxXaQtg.js";import{t as O}from"./switch-tbd54zD9.js";import{Cn as k,Tn as A,_i as j,_n as M,bn as N,gn as P,hn as ee,mn as te,pn as ne,vn as re,wn as ie,xn as F,yn as I}from"./constants-Doj9A7vw.js";import{Ar as L,At as R,Cr as z,E as B,In as V,Pt as H,br as U,jt as W,kt as G,tn as K}from"./index-BcUyz1eC.js";import{t as q}from"./index.es-yT7dU_Va.js";import{t as J}from"./CopyToClipboard-CkWzEIbo.js";import{t as Y}from"./ImagePreview-GRjlSvS4.js";import{n as ae}from"./taskDrawerMixin-DEgO_R5H.js";import{t as oe}from"./BotPlaceholder-D6AUYJbe.js";import{i as X,n as se,t as ce}from"./pagination-BIoA190D.js";import{n as le,t as ue}from"./NoTasks-D1nl515w.js";import{t as de}from"./Consumption-BuxjrihL.js";import{t as fe}from"./ApiCodeButton-REzWFnTi.js";import{t as pe}from"./ImageWrapper-BXMMoMt0.js";var me=r({name:`LayoutNanobanana`,components:{ElDrawer:E,ElButton:v,FontAwesomeIcon:q},mixins:[ae]}),he={class:`main flex flex-row flex-1`},ge={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},_e={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ve(e,r,i,a,s,c){let l=h(`font-awesome-icon`),d=h(`el-button`),m=h(`el-drawer`);return u(),t(`div`,he,[n(`div`,ge,[p(e.$slots,`config`,{},void 0,!0)]),n(`div`,_e,[p(e.$slots,`result`,{},void 0,!0)]),f(o(d,{circle:``,class:`menu`,onClick:r[0]||=t=>e.drawer=!0},{default:g(()=>[o(l,{icon:`fa-solid fa-magic`})]),_:1},512),[[_,!e.tasksEmpty]]),o(m,{modelValue:e.drawer,"onUpdate:modelValue":r[1]||=t=>e.drawer=t,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:g(()=>[p(e.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var ye=B(me,[[`render`,ve],[`__scopeId`,`data-v-cca80bbd`]]),be=r({name:`PromptInput`,components:{PromptTextarea:le},computed:{prompt:{get(){return this.$store.state.openaiimage?.config?.prompt},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,prompt:e})}}},mounted(){this.prompt||=``}});function xe(e,t,n,r,i,o){let s=h(`prompt-textarea`);return u(),a(s,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`openaiimage.name.prompt`),info:e.$t(`openaiimage.description.prompt`),placeholder:e.$t(`openaiimage.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Se=B(be,[[`render`,xe]]),Ce=r({name:`ImageUrlsInput`,components:{ElUpload:S,ElButton:v,InfoIcon:X,ImagePreview:Y,FontAwesomeIcon:q},mixins:[R],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.openaiimage?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},mounted(){},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImageUrls()},onExceed(){L.warning(this.$t(`openaiimage.message.uploadImageExceed`))},onError(){L.error(this.$t(`openaiimage.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,image_urls:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImageUrls()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImageUrls()}}}),we={class:`field flex items-center justify-between`},Te={class:`title font-bold text-[14px] mb-[10px]`},Ee={class:`upload-wrapper flex flex-col items-start gap-[8px]`},De={class:`controls flex items-center`},Oe={class:`file-list flex flex-wrap gap-[10px]`};function ke(r,c,d,f,p,m){let _=h(`font-awesome-icon`),v=h(`el-button`),y=h(`el-upload`),b=h(`info-icon`),x=h(`image-preview`);return u(),t(s,null,[n(`div`,we,[n(`h2`,Te,l(r.$t(`openaiimage.name.imageUrls`)),1),n(`div`,Ee,[n(`div`,De,[o(y,{"file-list":r.fileList,"onUpdate:fileList":c[0]||=e=>r.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value`,limit:5,multiple:!0,"show-file-list":!1,action:r.uploadUrl,"on-exceed":r.onExceed,"on-error":r.onError,"on-success":r.onSuccess,"on-change":r.onChange,"on-remove":r.onRemove,headers:r.headers},{default:g(()=>[o(v,{size:`small`,type:`primary`,round:``},{default:g(()=>[o(_,{icon:`fa-solid fa-upload`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`]),o(b,{content:r.$t(`openaiimage.description.imageUrls`),class:`ml-2`},null,8,[`content`])])])]),n(`div`,Oe,[(u(!0),t(s,null,e(r.fileList,(e,t)=>(u(),a(x,{key:e.uid||e?.response?.file_url||e.url||t,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>r.onRemovePreview(t,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])],64)}var Ae=B(Ce,[[`render`,ke]]),je=r({name:`OpenAIImageModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:X},data(){return{options:[{value:re,label:this.$t(`openaiimage.model.gptImage1`)},{value:I,label:this.$t(`openaiimage.model.gptImage15`)},{value:N,label:this.$t(`openaiimage.model.gptImage2`)}]}},computed:{value:{get(){return this.$store.state.openaiimage?.config?.model},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,model:e})}},modelDescription(){return this.$t(`openaiimage.description.model`)}},mounted(){this.value||=P}}),Me={class:`field`},Ne={class:`label`},Pe={class:`box`},Fe={class:`title font-bold`};function Ie(r,i,c,d,f,p){let m=h(`info-icon`),_=h(`el-option`),v=h(`el-select`);return u(),t(`div`,Me,[n(`div`,Ne,[n(`div`,Pe,[n(`h2`,Fe,l(r.$t(`openaiimage.name.model`)),1),o(m,{content:r.modelDescription,class:`info`},null,8,[`content`])])]),o(v,{modelValue:r.value,"onUpdate:modelValue":i[0]||=e=>r.value=e,class:`value`,placeholder:r.$t(`openaiimage.placeholder.select`)},{default:g(()=>[(u(!0),t(s,null,e(r.options,e=>(u(),a(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Le=B(je,[[`render`,Ie],[`__scopeId`,`data-v-cec771bd`]]);function Z(e){if(!e)return;let t=/^(\d+)x(\d+)$/.exec(e);if(t)return{w:Number(t[1]),h:Number(t[2])}}var Re=r({name:`OpenAIImageSizeSelector`,components:{ElSelect:b,ElOption:x,ElOptionGroup:y,ElSwitch:O,ElInputNumber:D,InfoIcon:X},data(){return{customMode:!1,customWidth:1024,customHeight:1024}},computed:{model(){return this.$store.state.openaiimage?.config?.model||`gpt-image-2`},storedSize(){return this.$store.state.openaiimage?.config?.size},emptySizeValue(){return``},customSupported(){return ee.includes(this.model)},presets(){return F[this.model]??F[`gpt-image-2`]??[]},presetGroups(){return this.model===`gpt-image-2`?[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:k},{label:this.$t(`openaiimage.sizeGroup.preset2k`),options:ie},{label:this.$t(`openaiimage.sizeGroup.preset4k`),options:A}]:[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:this.presets}]},useCustom:{get(){return this.customSupported&&this.customMode},set(e){if(!(e&&!this.customSupported))if(this.customMode=e,e){if(this.customError)return;this.commitSize(`${this.customWidth}x${this.customHeight}`)}else this.commitSize()}},presetValue:{get(){let e=this.storedSize;return e&&this.presets.includes(e)?e:this.emptySizeValue},set(e){this.customMode=!1,this.commitSize(e||void 0)}},multiple(){return 16},minSide(){return 256},maxSide(){return ne},customError(){let e=this.customWidth,t=this.customHeight;return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?this.$t(`openaiimage.error.customSizePositive`):e%this.multiple!==0||t%this.multiple!==0?this.$t(`openaiimage.error.customSizeMultiple`,{multiple:this.multiple}):e<this.minSide||t<this.minSide?this.$t(`openaiimage.error.customSizeMin`,{min:this.minSide}):Math.max(e,t)>this.maxSide?this.$t(`openaiimage.error.customSizeMax`,{max:this.maxSide}):e*t>8294400?this.$t(`openaiimage.error.customSizePixels`,{pixels:te.toLocaleString()}):``}},watch:{model:{immediate:!1,handler(){this.customSupported||(this.customMode=!1);let e=this.storedSize;if(!e||this.presets.includes(e))return;let t=Z(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h,!this.customError)||this.commitSize()}},storedSize(e){if(!e){this.customMode=!1;return}if(this.presets.includes(e)){this.customMode=!1;return}let t=Z(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth!==t.w&&(this.customWidth=t.w),this.customHeight!==t.h&&(this.customHeight=t.h))},customWidth(){this.syncCustomToStore()},customHeight(){this.syncCustomToStore()}},mounted(){let e=this.storedSize,t=Z(e);e&&t&&this.customSupported&&!this.presets.includes(e)&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h)},methods:{commitSize(e){let t={...this.$store.state.openaiimage?.config};e?t.size=e:delete t.size,this.$store.commit(`openaiimage/setConfig`,t)},syncCustomToStore(){this.useCustom&&(this.customError||this.commitSize(`${this.customWidth}x${this.customHeight}`))}}}),ze={class:`resolution`},Be={class:`field`},Ve={class:`label`},He={class:`box`},Ue={class:`title font-bold`},We={class:`field custom-toggle`},Ge={class:`label`},Ke={class:`box`},qe={class:`title font-bold`},Je={key:0,class:`custom-inputs`},Ye={class:`row`},Xe={class:`row-label`},Ze={class:`row`},Qe={class:`row-label`},$e={key:0,class:`error`};function et(r,i,c,d,f,p){let _=h(`info-icon`),v=h(`el-option`),y=h(`el-option-group`),b=h(`el-select`),x=h(`el-switch`),S=h(`el-input-number`);return u(),t(`div`,ze,[n(`div`,Be,[n(`div`,Ve,[n(`div`,He,[n(`h2`,Ue,l(r.$t(`openaiimage.name.size`)),1),o(_,{content:r.$t(`openaiimage.description.size`),class:`info`},null,8,[`content`])])]),o(b,{modelValue:r.presetValue,"onUpdate:modelValue":i[0]||=e=>r.presetValue=e,class:`value`,placeholder:r.$t(`openaiimage.placeholder.select`),disabled:r.useCustom},{default:g(()=>[o(v,{label:r.$t(`suno.gender.auto`),value:r.emptySizeValue},null,8,[`label`,`value`]),(u(!0),t(s,null,e(r.presetGroups,n=>(u(),a(y,{key:n.label,label:n.label},{default:g(()=>[(u(!0),t(s,null,e(n.options,e=>(u(),a(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])]),r.customSupported?(u(),t(s,{key:0},[n(`div`,We,[n(`div`,Ge,[n(`div`,Ke,[n(`h2`,qe,l(r.$t(`openaiimage.name.customSize`)),1),o(_,{content:r.$t(`openaiimage.description.customSize`),class:`info`},null,8,[`content`])])]),o(x,{modelValue:r.useCustom,"onUpdate:modelValue":i[1]||=e=>r.useCustom=e,class:`value-switch`},null,8,[`modelValue`])]),r.useCustom?(u(),t(`div`,Je,[n(`div`,Ye,[n(`span`,Xe,l(r.$t(`openaiimage.name.width`)),1),o(S,{modelValue:r.customWidth,"onUpdate:modelValue":i[2]||=e=>r.customWidth=e,class:`row-input`,min:r.minSide,max:r.maxSide,step:r.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),n(`div`,Ze,[n(`span`,Qe,l(r.$t(`openaiimage.name.height`)),1),o(S,{modelValue:r.customHeight,"onUpdate:modelValue":i[3]||=e=>r.customHeight=e,class:`row-input`,min:r.minSide,max:r.maxSide,step:r.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),r.customError?(u(),t(`div`,$e,l(r.customError),1)):m(``,!0)])):m(``,!0)],64)):m(``,!0)])}var tt=r({name:`ConfigPanel`,components:{ElButton:v,FontAwesomeIcon:q,PromptInput:Se,Consumption:de,ImageUrlsInput:Ae,ModelSelector:Le,ResolutionSelector:B(Re,[[`render`,et],[`__scopeId`,`data-v-d5544d69`]])},emits:[`generate`],computed:{config(){return this.$store.state.openaiimage?.config},consumption(){return H({...this.config||{}},this.service?.cost)},service(){return this.$store.state.openaiimage?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),nt={class:`flex flex-col h-full`},rt={class:`flex-1 overflow-y-auto p-5`},it={class:`flex flex-col items-center justify-center px-5 pb-5`};function at(e,r,a,s,c,d){let f=h(`model-selector`),p=h(`resolution-selector`),m=h(`prompt-input`),_=h(`image-urls-input`),v=h(`consumption`),y=h(`font-awesome-icon`),b=h(`el-button`);return u(),t(`div`,nt,[n(`div`,rt,[o(f,{class:`mb-4`}),o(p,{class:`mb-4`}),o(m,{class:`mb-4`}),o(_,{class:`mb-4`})]),n(`div`,it,[o(v,{value:e.consumption,service:e.service},null,8,[`value`,`service`]),o(b,{type:`primary`,class:`btn w-full`,round:``,onClick:e.onGenerate},{default:g(()=>[o(y,{icon:`fa-solid fa-magic`,class:`mr-2`}),i(` `+l(e.$t(`openaiimage.button.generate`)),1)]),_:1},8,[`onClick`])])])}var ot=B(tt,[[`render`,at]]),st=r({name:`TaskPreview`,components:{ElImage:w,CopyToClipboard:J,FontAwesomeIcon:q,ElAlert:T,ImageWrapper:pe,ElButton:v,ElTooltip:C,ImagePreview:Y,ApiCodeButton:fe},props:{modelValue:{type:Object,required:!0}},setup(){return{OPENAIIMAGE_LOGO:M}},computed:{isEditRequest(){let e=this.modelValue?.request;return this.modelValue?.type===`images_edits`||e?.action===`edit`||this.referenceImages.length>0},showTaskType(){return!!(this.modelValue?.request?.action||this.modelValue?.type||this.referenceImages.length>0)},taskTypeLabel(){return this.isEditRequest?this.$t(`openaiimage.name.edits`):this.$t(`openaiimage.name.generate`)},openaiimagePath(){return this.isEditRequest?`/openai/images/edits`:`/openai/images/generations`},openaiimageCodeBody(){let e=this.modelValue?.request;if(!e)return;let t={...e};if(delete t.action,delete t.callback_url,this.isEditRequest){delete t.image_urls,delete t.image;let e=this.referenceImages;e.length===1?t.image=e[0]:e.length>1&&(t.image=e)}else delete t.image_urls,delete t.image;return t},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{let n=t;if(n?.image_url||n?.url){e.push(n);return}n?.b64_json&&e.push({...n,url:`data:image/png;base64,${n.b64_json}`})}),e},referenceImages(){let e=this.modelValue?.request;if(!e)return[];let t=Array.isArray(e.image_urls)?e.image_urls:[];if(t.length>0)return t.filter(e=>typeof e==`string`&&e.length>0);let n=e.image;return Array.isArray(n)?n.filter(e=>typeof e==`string`&&e.length>0):typeof n==`string`&&n.length>0?[n]:Array.isArray(e.images)?e.images.map(e=>{if(typeof e==`string`)return e;if(e&&typeof e==`object`)return e.image_url}).filter(e=>typeof e==`string`&&e.length>0):[]}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.openaiimage?.config||{}};t.image_urls=[e],this.$store.commit(`openaiimage/setConfig`,t)}}}),ct={class:`preview`},lt={class:`left`},ut={class:`main`},dt={class:`bot`},ft={class:`datetime`},pt={class:`info`},mt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},ht={key:1,class:`prompt mt-2`},gt={key:0},_t={key:0,class:c({content:!0,failed:!0})},vt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},yt={class:c({operations:!0,"mt-2":!0,"mb-2":!0})},bt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},St={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ct={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Et={key:1,class:c({content:!0})},Dt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Pt={key:2,class:c({content:!0})},Q={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function Rt(r,c,f,p,_,v){let y=h(`el-image`),b=h(`image-preview`),x=h(`image-wrapper`),S=h(`el-button`),C=h(`el-tooltip`),w=h(`api-code-button`),T=h(`font-awesome-icon`),E=h(`copy-to-clipboard`),D=h(`el-alert`);return u(),t(`div`,ct,[n(`div`,lt,[o(y,{src:r.OPENAIIMAGE_LOGO,class:`avatar`},null,8,[`src`])]),n(`div`,ut,[n(`div`,dt,[i(l(r.$t(`openaiimage.name.openaiimageBot`))+` `,1),n(`span`,ft,l(r.$dayjs.format(``+new Date(parseFloat((r.modelValue?.created_at||``).toString())*1e3))),1)]),n(`div`,pt,[r.referenceImages.length>0?(u(),t(`div`,mt,[(u(!0),t(s,null,e(r.referenceImages,(e,t)=>(u(),a(b,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):m(``,!0),r.modelValue?.request?.prompt?(u(),t(`p`,ht,[i(l(r.modelValue?.request?.prompt)+` `,1),r.modelValue?.response?m(``,!0):(u(),t(`span`,gt,` - (`+l(r.$t(`openaiimage.status.pending`))+`) `,1))])):m(``,!0)]),r.modelValue?.response?.success===!0?(u(),t(`div`,_t,[n(`div`,vt,[(u(!0),t(s,null,e(r.images,(e,t)=>(u(),a(x,{key:t,src:e?.image_url||e?.url||``,"raw-src":e?.image_url||e?.url||``},null,8,[`src`,`raw-src`]))),128))]),n(`div`,yt,[o(C,{class:`box-item`,effect:`dark`,content:r.$t(`common.button.edit`),placement:`top-start`},{default:g(()=>[o(S,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=d(e=>r.onEdit(r.images?.[0]?.image_url||r.images?.[0]?.url),[`stop`])},{default:g(()=>[i(l(r.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),o(w,{path:r.openaiimagePath,body:r.openaiimageCodeBody},null,8,[`path`,`body`])]),o(D,{closable:!1,class:`mt-2 success`},{default:g(()=>[r.modelValue?.request?.model?(u(),t(`p`,bt,[o(T,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.model`))+`: `+l(r.modelValue?.request?.model),1)])):m(``,!0),r.modelValue?.request?.size?(u(),t(`p`,xt,[o(T,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.size`))+`: `+l(r.modelValue?.request?.size),1)])):m(``,!0),r.showTaskType?(u(),t(`p`,St,[o(T,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.task`))+`: `+l(r.taskTypeLabel),1)])):m(``,!0),n(`p`,Ct,[o(T,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.taskId`))+`: `+l(r.modelValue?.id)+` `,1),o(E,{content:r.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),r.modelValue?.elapsed?(u(),t(`p`,wt,[o(T,{icon:`fa-solid fa-clock`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.elapsed`))+`: `+l(r.modelValue?.elapsed?.toFixed(2))+`s `,1)])):m(``,!0),r.modelValue?.response?.trace_id?(u(),t(`p`,Tt,[o(T,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.traceId`))+`: `+l(r.modelValue?.response?.trace_id)+` `,1),o(E,{content:r.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):m(``,!0)]),_:1})])):r.modelValue?.response?.success===!1?(u(),t(`div`,Et,[o(D,{closable:!1,class:`failure`},{template:g(()=>[o(T,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.failure`)),1)]),default:g(()=>[r.modelValue?.request?.model?(u(),t(`p`,Dt,[o(T,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.model`))+`: `+l(r.modelValue?.request?.model),1)])):m(``,!0),r.modelValue?.request?.size?(u(),t(`p`,Ot,[o(T,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.size`))+`: `+l(r.modelValue?.request?.size),1)])):m(``,!0),r.showTaskType?(u(),t(`p`,kt,[o(T,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.task`))+`: `+l(r.taskTypeLabel),1)])):m(``,!0),n(`p`,At,[o(T,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.taskId`))+`: `+l(r.modelValue?.id)+` `,1),o(E,{content:r.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n(`p`,jt,[o(T,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.failureReason`))+`: `+l(r.modelValue?.response?.error?.message)+` `,1),o(E,{content:r.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),r.modelValue?.elapsed?(u(),t(`p`,Mt,[o(T,{icon:`fa-solid fa-clock`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.elapsed`))+`: `+l(r.modelValue?.elapsed?.toFixed(2))+`s `,1)])):m(``,!0),r.modelValue?.response?.trace_id?(u(),t(`p`,Nt,[o(T,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.traceId`))+`: `+l(r.modelValue?.response?.trace_id)+` `,1),o(E,{content:r.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):m(``,!0)]),_:1})])):(u(),t(`div`,Pt,[o(D,{closable:!1,class:`info`},{template:g(()=>[o(T,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.failure`)),1)]),default:g(()=>[r.modelValue?.request?.model?(u(),t(`p`,Q,[o(T,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.model`))+`: `+l(r.modelValue?.request?.model),1)])):m(``,!0),r.modelValue?.request?.size?(u(),t(`p`,Ft,[o(T,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.size`))+`: `+l(r.modelValue?.request?.size),1)])):m(``,!0),r.showTaskType?(u(),t(`p`,It,[o(T,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.task`))+`: `+l(r.taskTypeLabel),1)])):m(``,!0),n(`p`,Lt,[o(T,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.taskId`))+`: `+l(r.modelValue?.id)+` `,1),o(E,{content:r.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var zt=r({name:`RecentPanel`,components:{TaskPreview:B(st,[[`render`,Rt],[`__scopeId`,`data-v-8ee5fb87`]]),BotPlaceholder:oe,NoTasks:ue,ScrollList:se},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.openaiimage?.tasks,items:this.$store.state.openaiimage?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Bt={key:0},Vt={key:2,class:`w-full h-full flex items-center justify-center`};function Ht(n,r,i,c,l,d){let f=h(`bot-placeholder`),p=h(`task-preview`),_=h(`scroll-list`),v=h(`no-tasks`);return u(),t(s,null,[n.tasks?.items===void 0?(u(),t(`div`,Bt,[o(f)])):n.tasks?.items?.length&&n.tasks?.items?.length>0?(u(),a(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:n.loading,onReachTop:r[0]||=e=>n.$emit(`reach-top`)},{default:g(()=>[(u(!0),t(s,null,e(n.tasks?.items,e=>(u(),a(p,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):m(``,!0),n.tasks?.items?.length===0?(u(),t(`div`,Vt,[o(v)])):m(``,!0)],64)}var Ut=B(zt,[[`render`,Ht]]),$=j(`openaiimage`),Wt=r({name:`OpenAIImageIndex`,components:{ConfigPanel:ot,Layout:ye,RecentPanel:Ut},mixins:[W],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.openaiimage?.status?.getApplications===U.Request},tasksLoading(){return this.$store.state.openaiimage?.status?.getTasks===U.Request},credential(){return this.$store.state.openaiimage?.credential},config(){return this.$store.state.openaiimage?.config},application(){return this.$store.state.openaiimage?.application},tasks(){return this.$store.state.openaiimage?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ce({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`openaiimage/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`openaiimage/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`openaiimage/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!G(this.uploadTracker,e=>this.$t(e),e=>L.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;if(!this.hasText(e.prompt)){L.error(this.$t(`openaiimage.message.promptRequired`));return}e.prompt=e.prompt.trim(),!t&&`image_urls`in e&&delete e.image_urls,e.size||delete e.size;let n={...e,action:`generate`,callback_url:$},r={action:`edit`,model:e?.model,prompt:e?.prompt,size:e?.size,image_urls:e?.image_urls||[],callback_url:$},i=this.credential?.token;if(!i){console.error(`no token specified`);return}L.info(this.$t(`openaiimage.message.startingTask`)),V(`openaiimage`,t?K.edit(r,{token:i}):K.generate(n,{token:i})).then(e=>{console.debug(`task accepted`,e.data?.task_id),L.success(this.$t(`openaiimage.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?L.error(this.$t(`openaiimage.message.usedUp`)):L.error(this.$t(`openaiimage.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function Gt(e,t,n,r,i,s){let c=h(`config-panel`),l=h(`recent-panel`),d=h(`layout`);return u(),a(d,null,{config:g(()=>[o(c,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:g(()=>[o(l,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Kt=B(Wt,[[`render`,Gt]]);export{Kt as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{$ as e,A as t,D as n,F as r,N as i,O as a,P as o,S as s,Vt as c,Wt as l,Z as u,b as d,dt as f,et as p,k as m,tt as h,ut as g,v as _}from"./vendor-chart-BJCvKk8-.js";import{t as v}from"./button-DfsQodL-.js";import{n as y,r as b,t as x}from"./select-CIZk9ihC.js";import{t as S}from"./upload-Bwmqeewp.js";import{t as C}from"./tooltip-BLwTovWL.js";import{t as w}from"./image-_ExVBzK6.js";import{t as T}from"./alert-OvnfgMB-.js";import{t as E}from"./drawer-Dpuj2uIl.js";import{t as D}from"./input-number-wRL7m93t.js";import{t as O}from"./switch-BdOpfax3.js";import{Cn as k,Tn as A,_i as j,_n as M,bn as N,gn as P,hn as ee,mn as te,pn as ne,vn as re,wn as ie,xn as F,yn as I}from"./constants-Doj9A7vw.js";import{Ar as L,At as R,Cr as z,E as B,In as V,Pt as H,br as U,jt as W,kt as G,tn as K}from"./index-Cmr4LxuY.js";import{t as q}from"./index.es-CqtN0wgr.js";import{t as J}from"./CopyToClipboard-koQ26Tcr.js";import{t as Y}from"./ImagePreview-i57G906Z.js";import{n as ae}from"./taskDrawerMixin-DEgO_R5H.js";import{t as oe}from"./BotPlaceholder-Bio6tWP-.js";import{i as X,n as se,t as ce}from"./pagination-CvCeL5yB.js";import{n as le,t as ue}from"./NoTasks-DAeqCkUW.js";import{t as de}from"./Consumption-BGQCLo2d.js";import{t as fe}from"./ApiCodeButton-feBeDY_l.js";import{t as pe}from"./ImageWrapper-DgXbFDyb.js";var me=r({name:`LayoutNanobanana`,components:{ElDrawer:E,ElButton:v,FontAwesomeIcon:q},mixins:[ae]}),he={class:`main flex flex-row flex-1`},ge={class:`config w-[320px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},_e={class:`result h-full p-6 flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function ve(e,r,i,a,s,c){let l=h(`font-awesome-icon`),d=h(`el-button`),m=h(`el-drawer`);return u(),t(`div`,he,[n(`div`,ge,[p(e.$slots,`config`,{},void 0,!0)]),n(`div`,_e,[p(e.$slots,`result`,{},void 0,!0)]),f(o(d,{circle:``,class:`menu`,onClick:r[0]||=t=>e.drawer=!0},{default:g(()=>[o(l,{icon:`fa-solid fa-magic`})]),_:1},512),[[_,!e.tasksEmpty]]),o(m,{modelValue:e.drawer,"onUpdate:modelValue":r[1]||=t=>e.drawer=t,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:g(()=>[p(e.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var ye=B(me,[[`render`,ve],[`__scopeId`,`data-v-cca80bbd`]]),be=r({name:`PromptInput`,components:{PromptTextarea:le},computed:{prompt:{get(){return this.$store.state.openaiimage?.config?.prompt},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,prompt:e})}}},mounted(){this.prompt||=``}});function xe(e,t,n,r,i,o){let s=h(`prompt-textarea`);return u(),a(s,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`openaiimage.name.prompt`),info:e.$t(`openaiimage.description.prompt`),placeholder:e.$t(`openaiimage.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Se=B(be,[[`render`,xe]]),Ce=r({name:`ImageUrlsInput`,components:{ElUpload:S,ElButton:v,InfoIcon:X,ImagePreview:Y,FontAwesomeIcon:q},mixins:[R],data(){return{fileList:[],uploadUrl:z()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.openaiimage?.config?.image_urls}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},mounted(){},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImageUrls()},onExceed(){L.warning(this.$t(`openaiimage.message.uploadImageExceed`))},onError(){L.error(this.$t(`openaiimage.message.uploadImageError`))},onSetImageUrls(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,image_urls:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImageUrls()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImageUrls()}}}),we={class:`field flex items-center justify-between`},Te={class:`title font-bold text-[14px] mb-[10px]`},Ee={class:`upload-wrapper flex flex-col items-start gap-[8px]`},De={class:`controls flex items-center`},Oe={class:`file-list flex flex-wrap gap-[10px]`};function ke(r,c,d,f,p,m){let _=h(`font-awesome-icon`),v=h(`el-button`),y=h(`el-upload`),b=h(`info-icon`),x=h(`image-preview`);return u(),t(s,null,[n(`div`,we,[n(`h2`,Te,l(r.$t(`openaiimage.name.imageUrls`)),1),n(`div`,Ee,[n(`div`,De,[o(y,{"file-list":r.fileList,"onUpdate:fileList":c[0]||=e=>r.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,class:`value`,limit:5,multiple:!0,"show-file-list":!1,action:r.uploadUrl,"on-exceed":r.onExceed,"on-error":r.onError,"on-success":r.onSuccess,"on-change":r.onChange,"on-remove":r.onRemove,headers:r.headers},{default:g(()=>[o(v,{size:`small`,type:`primary`,round:``},{default:g(()=>[o(_,{icon:`fa-solid fa-upload`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`]),o(b,{content:r.$t(`openaiimage.description.imageUrls`),class:`ml-2`},null,8,[`content`])])])]),n(`div`,Oe,[(u(!0),t(s,null,e(r.fileList,(e,t)=>(u(),a(x,{key:e.uid||e?.response?.file_url||e.url||t,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>r.onRemovePreview(t,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])],64)}var Ae=B(Ce,[[`render`,ke]]),je=r({name:`OpenAIImageModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:X},data(){return{options:[{value:re,label:this.$t(`openaiimage.model.gptImage1`)},{value:I,label:this.$t(`openaiimage.model.gptImage15`)},{value:N,label:this.$t(`openaiimage.model.gptImage2`)}]}},computed:{value:{get(){return this.$store.state.openaiimage?.config?.model},set(e){this.$store.commit(`openaiimage/setConfig`,{...this.$store.state.openaiimage?.config,model:e})}},modelDescription(){return this.$t(`openaiimage.description.model`)}},mounted(){this.value||=P}}),Me={class:`field`},Ne={class:`label`},Pe={class:`box`},Fe={class:`title font-bold`};function Ie(r,i,c,d,f,p){let m=h(`info-icon`),_=h(`el-option`),v=h(`el-select`);return u(),t(`div`,Me,[n(`div`,Ne,[n(`div`,Pe,[n(`h2`,Fe,l(r.$t(`openaiimage.name.model`)),1),o(m,{content:r.modelDescription,class:`info`},null,8,[`content`])])]),o(v,{modelValue:r.value,"onUpdate:modelValue":i[0]||=e=>r.value=e,class:`value`,placeholder:r.$t(`openaiimage.placeholder.select`)},{default:g(()=>[(u(!0),t(s,null,e(r.options,e=>(u(),a(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])}var Le=B(je,[[`render`,Ie],[`__scopeId`,`data-v-cec771bd`]]);function Z(e){if(!e)return;let t=/^(\d+)x(\d+)$/.exec(e);if(t)return{w:Number(t[1]),h:Number(t[2])}}var Re=r({name:`OpenAIImageSizeSelector`,components:{ElSelect:b,ElOption:x,ElOptionGroup:y,ElSwitch:O,ElInputNumber:D,InfoIcon:X},data(){return{customMode:!1,customWidth:1024,customHeight:1024}},computed:{model(){return this.$store.state.openaiimage?.config?.model||`gpt-image-2`},storedSize(){return this.$store.state.openaiimage?.config?.size},emptySizeValue(){return``},customSupported(){return ee.includes(this.model)},presets(){return F[this.model]??F[`gpt-image-2`]??[]},presetGroups(){return this.model===`gpt-image-2`?[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:k},{label:this.$t(`openaiimage.sizeGroup.preset2k`),options:ie},{label:this.$t(`openaiimage.sizeGroup.preset4k`),options:A}]:[{label:this.$t(`openaiimage.sizeGroup.standard1k`),options:this.presets}]},useCustom:{get(){return this.customSupported&&this.customMode},set(e){if(!(e&&!this.customSupported))if(this.customMode=e,e){if(this.customError)return;this.commitSize(`${this.customWidth}x${this.customHeight}`)}else this.commitSize()}},presetValue:{get(){let e=this.storedSize;return e&&this.presets.includes(e)?e:this.emptySizeValue},set(e){this.customMode=!1,this.commitSize(e||void 0)}},multiple(){return 16},minSide(){return 256},maxSide(){return ne},customError(){let e=this.customWidth,t=this.customHeight;return!Number.isFinite(e)||!Number.isFinite(t)||e<=0||t<=0?this.$t(`openaiimage.error.customSizePositive`):e%this.multiple!==0||t%this.multiple!==0?this.$t(`openaiimage.error.customSizeMultiple`,{multiple:this.multiple}):e<this.minSide||t<this.minSide?this.$t(`openaiimage.error.customSizeMin`,{min:this.minSide}):Math.max(e,t)>this.maxSide?this.$t(`openaiimage.error.customSizeMax`,{max:this.maxSide}):e*t>8294400?this.$t(`openaiimage.error.customSizePixels`,{pixels:te.toLocaleString()}):``}},watch:{model:{immediate:!1,handler(){this.customSupported||(this.customMode=!1);let e=this.storedSize;if(!e||this.presets.includes(e))return;let t=Z(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h,!this.customError)||this.commitSize()}},storedSize(e){if(!e){this.customMode=!1;return}if(this.presets.includes(e)){this.customMode=!1;return}let t=Z(e);t&&this.customSupported&&(this.customMode=!0,this.customWidth!==t.w&&(this.customWidth=t.w),this.customHeight!==t.h&&(this.customHeight=t.h))},customWidth(){this.syncCustomToStore()},customHeight(){this.syncCustomToStore()}},mounted(){let e=this.storedSize,t=Z(e);e&&t&&this.customSupported&&!this.presets.includes(e)&&(this.customMode=!0,this.customWidth=t.w,this.customHeight=t.h)},methods:{commitSize(e){let t={...this.$store.state.openaiimage?.config};e?t.size=e:delete t.size,this.$store.commit(`openaiimage/setConfig`,t)},syncCustomToStore(){this.useCustom&&(this.customError||this.commitSize(`${this.customWidth}x${this.customHeight}`))}}}),ze={class:`resolution`},Be={class:`field`},Ve={class:`label`},He={class:`box`},Ue={class:`title font-bold`},We={class:`field custom-toggle`},Ge={class:`label`},Ke={class:`box`},qe={class:`title font-bold`},Je={key:0,class:`custom-inputs`},Ye={class:`row`},Xe={class:`row-label`},Ze={class:`row`},Qe={class:`row-label`},$e={key:0,class:`error`};function et(r,i,c,d,f,p){let _=h(`info-icon`),v=h(`el-option`),y=h(`el-option-group`),b=h(`el-select`),x=h(`el-switch`),S=h(`el-input-number`);return u(),t(`div`,ze,[n(`div`,Be,[n(`div`,Ve,[n(`div`,He,[n(`h2`,Ue,l(r.$t(`openaiimage.name.size`)),1),o(_,{content:r.$t(`openaiimage.description.size`),class:`info`},null,8,[`content`])])]),o(b,{modelValue:r.presetValue,"onUpdate:modelValue":i[0]||=e=>r.presetValue=e,class:`value`,placeholder:r.$t(`openaiimage.placeholder.select`),disabled:r.useCustom},{default:g(()=>[o(v,{label:r.$t(`suno.gender.auto`),value:r.emptySizeValue},null,8,[`label`,`value`]),(u(!0),t(s,null,e(r.presetGroups,n=>(u(),a(y,{key:n.label,label:n.label},{default:g(()=>[(u(!0),t(s,null,e(n.options,e=>(u(),a(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:2},1032,[`label`]))),128))]),_:1},8,[`modelValue`,`placeholder`,`disabled`])]),r.customSupported?(u(),t(s,{key:0},[n(`div`,We,[n(`div`,Ge,[n(`div`,Ke,[n(`h2`,qe,l(r.$t(`openaiimage.name.customSize`)),1),o(_,{content:r.$t(`openaiimage.description.customSize`),class:`info`},null,8,[`content`])])]),o(x,{modelValue:r.useCustom,"onUpdate:modelValue":i[1]||=e=>r.useCustom=e,class:`value-switch`},null,8,[`modelValue`])]),r.useCustom?(u(),t(`div`,Je,[n(`div`,Ye,[n(`span`,Xe,l(r.$t(`openaiimage.name.width`)),1),o(S,{modelValue:r.customWidth,"onUpdate:modelValue":i[2]||=e=>r.customWidth=e,class:`row-input`,min:r.minSide,max:r.maxSide,step:r.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),n(`div`,Ze,[n(`span`,Qe,l(r.$t(`openaiimage.name.height`)),1),o(S,{modelValue:r.customHeight,"onUpdate:modelValue":i[3]||=e=>r.customHeight=e,class:`row-input`,min:r.minSide,max:r.maxSide,step:r.multiple,"step-strictly":!0,"controls-position":`right`},null,8,[`modelValue`,`min`,`max`,`step`])]),r.customError?(u(),t(`div`,$e,l(r.customError),1)):m(``,!0)])):m(``,!0)],64)):m(``,!0)])}var tt=r({name:`ConfigPanel`,components:{ElButton:v,FontAwesomeIcon:q,PromptInput:Se,Consumption:de,ImageUrlsInput:Ae,ModelSelector:Le,ResolutionSelector:B(Re,[[`render`,et],[`__scopeId`,`data-v-d5544d69`]])},emits:[`generate`],computed:{config(){return this.$store.state.openaiimage?.config},consumption(){return H({...this.config||{}},this.service?.cost)},service(){return this.$store.state.openaiimage?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),nt={class:`flex flex-col h-full`},rt={class:`flex-1 overflow-y-auto p-5`},it={class:`flex flex-col items-center justify-center px-5 pb-5`};function at(e,r,a,s,c,d){let f=h(`model-selector`),p=h(`resolution-selector`),m=h(`prompt-input`),_=h(`image-urls-input`),v=h(`consumption`),y=h(`font-awesome-icon`),b=h(`el-button`);return u(),t(`div`,nt,[n(`div`,rt,[o(f,{class:`mb-4`}),o(p,{class:`mb-4`}),o(m,{class:`mb-4`}),o(_,{class:`mb-4`})]),n(`div`,it,[o(v,{value:e.consumption,service:e.service},null,8,[`value`,`service`]),o(b,{type:`primary`,class:`btn w-full`,round:``,onClick:e.onGenerate},{default:g(()=>[o(y,{icon:`fa-solid fa-magic`,class:`mr-2`}),i(` `+l(e.$t(`openaiimage.button.generate`)),1)]),_:1},8,[`onClick`])])])}var ot=B(tt,[[`render`,at]]),st=r({name:`TaskPreview`,components:{ElImage:w,CopyToClipboard:J,FontAwesomeIcon:q,ElAlert:T,ImageWrapper:pe,ElButton:v,ElTooltip:C,ImagePreview:Y,ApiCodeButton:fe},props:{modelValue:{type:Object,required:!0}},setup(){return{OPENAIIMAGE_LOGO:M}},computed:{isEditRequest(){let e=this.modelValue?.request;return this.modelValue?.type===`images_edits`||e?.action===`edit`||this.referenceImages.length>0},showTaskType(){return!!(this.modelValue?.request?.action||this.modelValue?.type||this.referenceImages.length>0)},taskTypeLabel(){return this.isEditRequest?this.$t(`openaiimage.name.edits`):this.$t(`openaiimage.name.generate`)},openaiimagePath(){return this.isEditRequest?`/openai/images/edits`:`/openai/images/generations`},openaiimageCodeBody(){let e=this.modelValue?.request;if(!e)return;let t={...e};if(delete t.action,delete t.callback_url,this.isEditRequest){delete t.image_urls,delete t.image;let e=this.referenceImages;e.length===1?t.image=e[0]:e.length>1&&(t.image=e)}else delete t.image_urls,delete t.image;return t},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{let n=t;if(n?.image_url||n?.url){e.push(n);return}n?.b64_json&&e.push({...n,url:`data:image/png;base64,${n.b64_json}`})}),e},referenceImages(){let e=this.modelValue?.request;if(!e)return[];let t=Array.isArray(e.image_urls)?e.image_urls:[];if(t.length>0)return t.filter(e=>typeof e==`string`&&e.length>0);let n=e.image;return Array.isArray(n)?n.filter(e=>typeof e==`string`&&e.length>0):typeof n==`string`&&n.length>0?[n]:Array.isArray(e.images)?e.images.map(e=>{if(typeof e==`string`)return e;if(e&&typeof e==`object`)return e.image_url}).filter(e=>typeof e==`string`&&e.length>0):[]}},methods:{onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.openaiimage?.config||{}};t.image_urls=[e],this.$store.commit(`openaiimage/setConfig`,t)}}}),ct={class:`preview`},lt={class:`left`},ut={class:`main`},dt={class:`bot`},ft={class:`datetime`},pt={class:`info`},mt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},ht={key:1,class:`prompt mt-2`},gt={key:0},_t={key:0,class:c({content:!0,failed:!0})},vt={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},yt={class:c({operations:!0,"mt-2":!0,"mb-2":!0})},bt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},xt={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},St={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ct={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},wt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Tt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Et={key:1,class:c({content:!0})},Dt={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ot={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},kt={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},At={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},jt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Mt={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Nt={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},Pt={key:2,class:c({content:!0})},Q={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Ft={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},It={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},Lt={class:`text-[var(--el-text-color-regular)] text-xs mb-2`};function Rt(r,c,f,p,_,v){let y=h(`el-image`),b=h(`image-preview`),x=h(`image-wrapper`),S=h(`el-button`),C=h(`el-tooltip`),w=h(`api-code-button`),T=h(`font-awesome-icon`),E=h(`copy-to-clipboard`),D=h(`el-alert`);return u(),t(`div`,ct,[n(`div`,lt,[o(y,{src:r.OPENAIIMAGE_LOGO,class:`avatar`},null,8,[`src`])]),n(`div`,ut,[n(`div`,dt,[i(l(r.$t(`openaiimage.name.openaiimageBot`))+` `,1),n(`span`,ft,l(r.$dayjs.format(``+new Date(parseFloat((r.modelValue?.created_at||``).toString())*1e3))),1)]),n(`div`,pt,[r.referenceImages.length>0?(u(),t(`div`,mt,[(u(!0),t(s,null,e(r.referenceImages,(e,t)=>(u(),a(b,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):m(``,!0),r.modelValue?.request?.prompt?(u(),t(`p`,ht,[i(l(r.modelValue?.request?.prompt)+` `,1),r.modelValue?.response?m(``,!0):(u(),t(`span`,gt,` - (`+l(r.$t(`openaiimage.status.pending`))+`) `,1))])):m(``,!0)]),r.modelValue?.response?.success===!0?(u(),t(`div`,_t,[n(`div`,vt,[(u(!0),t(s,null,e(r.images,(e,t)=>(u(),a(x,{key:t,src:e?.image_url||e?.url||``,"raw-src":e?.image_url||e?.url||``},null,8,[`src`,`raw-src`]))),128))]),n(`div`,yt,[o(C,{class:`box-item`,effect:`dark`,content:r.$t(`common.button.edit`),placement:`top-start`},{default:g(()=>[o(S,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=d(e=>r.onEdit(r.images?.[0]?.image_url||r.images?.[0]?.url),[`stop`])},{default:g(()=>[i(l(r.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),o(w,{path:r.openaiimagePath,body:r.openaiimageCodeBody},null,8,[`path`,`body`])]),o(D,{closable:!1,class:`mt-2 success`},{default:g(()=>[r.modelValue?.request?.model?(u(),t(`p`,bt,[o(T,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.model`))+`: `+l(r.modelValue?.request?.model),1)])):m(``,!0),r.modelValue?.request?.size?(u(),t(`p`,xt,[o(T,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.size`))+`: `+l(r.modelValue?.request?.size),1)])):m(``,!0),r.showTaskType?(u(),t(`p`,St,[o(T,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.task`))+`: `+l(r.taskTypeLabel),1)])):m(``,!0),n(`p`,Ct,[o(T,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.taskId`))+`: `+l(r.modelValue?.id)+` `,1),o(E,{content:r.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),r.modelValue?.elapsed?(u(),t(`p`,wt,[o(T,{icon:`fa-solid fa-clock`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.elapsed`))+`: `+l(r.modelValue?.elapsed?.toFixed(2))+`s `,1)])):m(``,!0),r.modelValue?.response?.trace_id?(u(),t(`p`,Tt,[o(T,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.traceId`))+`: `+l(r.modelValue?.response?.trace_id)+` `,1),o(E,{content:r.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):m(``,!0)]),_:1})])):r.modelValue?.response?.success===!1?(u(),t(`div`,Et,[o(D,{closable:!1,class:`failure`},{template:g(()=>[o(T,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.failure`)),1)]),default:g(()=>[r.modelValue?.request?.model?(u(),t(`p`,Dt,[o(T,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.model`))+`: `+l(r.modelValue?.request?.model),1)])):m(``,!0),r.modelValue?.request?.size?(u(),t(`p`,Ot,[o(T,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.size`))+`: `+l(r.modelValue?.request?.size),1)])):m(``,!0),r.showTaskType?(u(),t(`p`,kt,[o(T,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.task`))+`: `+l(r.taskTypeLabel),1)])):m(``,!0),n(`p`,At,[o(T,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.taskId`))+`: `+l(r.modelValue?.id)+` `,1),o(E,{content:r.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),n(`p`,jt,[o(T,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.failureReason`))+`: `+l(r.modelValue?.response?.error?.message)+` `,1),o(E,{content:r.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])]),r.modelValue?.elapsed?(u(),t(`p`,Mt,[o(T,{icon:`fa-solid fa-clock`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.elapsed`))+`: `+l(r.modelValue?.elapsed?.toFixed(2))+`s `,1)])):m(``,!0),r.modelValue?.response?.trace_id?(u(),t(`p`,Nt,[o(T,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.traceId`))+`: `+l(r.modelValue?.response?.trace_id)+` `,1),o(E,{content:r.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):m(``,!0)]),_:1})])):(u(),t(`div`,Pt,[o(D,{closable:!1,class:`info`},{template:g(()=>[o(T,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.failure`)),1)]),default:g(()=>[r.modelValue?.request?.model?(u(),t(`p`,Q,[o(T,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.model`))+`: `+l(r.modelValue?.request?.model),1)])):m(``,!0),r.modelValue?.request?.size?(u(),t(`p`,Ft,[o(T,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.size`))+`: `+l(r.modelValue?.request?.size),1)])):m(``,!0),r.showTaskType?(u(),t(`p`,It,[o(T,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.task`))+`: `+l(r.taskTypeLabel),1)])):m(``,!0),n(`p`,Lt,[o(T,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(r.$t(`openaiimage.name.taskId`))+`: `+l(r.modelValue?.id)+` `,1),o(E,{content:r.modelValue?.id,class:`btn-copy`},null,8,[`content`])])]),_:1})]))])])}var zt=r({name:`RecentPanel`,components:{TaskPreview:B(st,[[`render`,Rt],[`__scopeId`,`data-v-8ee5fb87`]]),BotPlaceholder:oe,NoTasks:ue,ScrollList:se},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],data(){return{job:0}},computed:{tasks(){return{...this.$store.state.openaiimage?.tasks,items:this.$store.state.openaiimage?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),Bt={key:0},Vt={key:2,class:`w-full h-full flex items-center justify-center`};function Ht(n,r,i,c,l,d){let f=h(`bot-placeholder`),p=h(`task-preview`),_=h(`scroll-list`),v=h(`no-tasks`);return u(),t(s,null,[n.tasks?.items===void 0?(u(),t(`div`,Bt,[o(f)])):n.tasks?.items?.length&&n.tasks?.items?.length>0?(u(),a(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:n.loading,onReachTop:r[0]||=e=>n.$emit(`reach-top`)},{default:g(()=>[(u(!0),t(s,null,e(n.tasks?.items,e=>(u(),a(p,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):m(``,!0),n.tasks?.items?.length===0?(u(),t(`div`,Vt,[o(v)])):m(``,!0)],64)}var Ut=B(zt,[[`render`,Ht]]),$=j(`openaiimage`),Wt=r({name:`OpenAIImageIndex`,components:{ConfigPanel:ot,Layout:ye,RecentPanel:Ut},mixins:[W],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.openaiimage?.status?.getApplications===U.Request},tasksLoading(){return this.$store.state.openaiimage?.status?.getTasks===U.Request},credential(){return this.$store.state.openaiimage?.credential},config(){return this.$store.state.openaiimage?.config},application(){return this.$store.state.openaiimage?.application},tasks(){return this.$store.state.openaiimage?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ce({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`openaiimage/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`openaiimage/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`openaiimage/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!G(this.uploadTracker,e=>this.$t(e),e=>L.warning(e)))return;let e={...this.config||{}},t=Array.isArray(e?.image_urls)&&e.image_urls.length>0;if(!this.hasText(e.prompt)){L.error(this.$t(`openaiimage.message.promptRequired`));return}e.prompt=e.prompt.trim(),!t&&`image_urls`in e&&delete e.image_urls,e.size||delete e.size;let n={...e,action:`generate`,callback_url:$},r={action:`edit`,model:e?.model,prompt:e?.prompt,size:e?.size,image_urls:e?.image_urls||[],callback_url:$},i=this.credential?.token;if(!i){console.error(`no token specified`);return}L.info(this.$t(`openaiimage.message.startingTask`)),V(`openaiimage`,t?K.edit(r,{token:i}):K.generate(n,{token:i})).then(e=>{console.debug(`task accepted`,e.data?.task_id),L.success(this.$t(`openaiimage.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?L.error(this.$t(`openaiimage.message.usedUp`)):L.error(this.$t(`openaiimage.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()},hasText(e){return typeof e==`string`&&e.trim().length>0}}});function Gt(e,t,n,r,i,s){let c=h(`config-panel`),l=h(`recent-panel`),d=h(`layout`);return u(),a(d,null,{config:g(()=>[o(c,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:g(()=>[o(l,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var Kt=B(Wt,[[`render`,Gt]]);export{Kt as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{$ as e,A as t,D as n,F as r,M as i,N as a,O as o,P as s,S as c,Wt as l,Z as u,b as d,et as f,k as p,tt as m,ut as h,y as g}from"./vendor-chart-BJCvKk8-.js";import{t as _}from"./button-DfsQodL-.js";import{r as v,t as y}from"./select-CbNogKSw.js";import{n as b,t as x}from"./tabs-Dg2VTIGH.js";import{t as S}from"./tooltip-BLwTovWL.js";import{t as C}from"./image-ttyLLhNO.js";import{t as w}from"./alert-OvnfgMB-.js";import{n as T,r as E}from"./radio-BmBXySlN.js";import{n as D,t as O}from"./collapse-OXWImjIB.js";import{t as k}from"./drawer-Dpuj2uIl.js";import{t as ee}from"./input-number-CRxXaQtg.js";import{t as te}from"./switch-tbd54zD9.js";import"./constants-Doj9A7vw.js";import{Ar as A,E as j,Lr as M,Pt as N,br as P}from"./index-BcUyz1eC.js";import{t as F}from"./index.es-yT7dU_Va.js";import{t as I}from"./CopyToClipboard-CkWzEIbo.js";import{t as L}from"./Consumption-BuxjrihL.js";var R=r({name:`LayoutWebextrator`,components:{ElDrawer:k,ElButton:_,FontAwesomeIcon:F},data(){return{drawer:!1}}}),z={class:`main flex flex-row flex-1`},B={class:`config w-[340px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},V={class:`result h-full flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function H(e,r,i,a,o,c){let l=m(`font-awesome-icon`),d=m(`el-button`),p=m(`el-drawer`);return u(),t(`div`,z,[n(`div`,B,[f(e.$slots,`config`,{},void 0,!0)]),n(`div`,V,[f(e.$slots,`result`,{},void 0,!0)]),s(d,{circle:``,class:`menu`,onClick:r[0]||=t=>e.drawer=!0},{default:h(()=>[s(l,{icon:`fa-solid fa-sliders`})]),_:1}),s(p,{modelValue:e.drawer,"onUpdate:modelValue":r[1]||=t=>e.drawer=t,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:h(()=>[f(e.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var U=j(R,[[`render`,H],[`__scopeId`,`data-v-7b1cd8ae`]]),W=r({name:`ModeSelector`,components:{ElRadioGroup:E,ElRadioButton:T,FontAwesomeIcon:F},computed:{value:{get(){return this.$store.state.webextrator?.config?.mode},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,mode:e})}}}}),G={class:`field`},K={class:`title font-bold`};function q(e,r,i,o,c,d){let f=m(`font-awesome-icon`),p=m(`el-radio-button`),g=m(`el-radio-group`);return u(),t(`div`,G,[n(`h2`,K,l(e.$t(`webextrator.name.mode`)),1),s(g,{modelValue:e.value,"onUpdate:modelValue":r[0]||=t=>e.value=t,class:`value w-full`},{default:h(()=>[s(p,{label:`extract`,value:`extract`},{default:h(()=>[s(f,{icon:`fa-solid fa-wand-magic-sparkles`,class:`mr-1`}),a(` `+l(e.$t(`webextrator.mode.extract`)),1)]),_:1}),s(p,{label:`render`,value:`render`},{default:h(()=>[s(f,{icon:`fa-solid fa-globe`,class:`mr-1`}),a(` `+l(e.$t(`webextrator.mode.render`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var J=j(W,[[`render`,q],[`__scopeId`,`data-v-31e6c11d`]]),Y=r({name:`UrlInput`,components:{ElInput:M},emits:[`submit`],computed:{url:{get(){return this.$store.state.webextrator?.config?.url||``},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,url:e})}}},methods:{onEnter(){this.$emit(`submit`)}}}),X={class:`field`},Z={class:`title font-bold`};function Q(e,r,i,a,o,c){let f=m(`el-input`);return u(),t(`div`,X,[n(`h2`,Z,l(e.$t(`webextrator.name.url`)),1),s(f,{modelValue:e.url,"onUpdate:modelValue":r[0]||=t=>e.url=t,type:`textarea`,rows:2,class:`prompt`,placeholder:e.$t(`webextrator.placeholder.url`),onKeydown:g(d(e.onEnter,[`exact`,`prevent`]),[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeydown`])])}var ne=j(Y,[[`render`,Q],[`__scopeId`,`data-v-18488009`]]),re=r({name:`ExpectedTypeSelector`,components:{ElSelect:v,ElOption:y},computed:{value:{get(){return this.$store.state.webextrator?.config?.expected_type},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,expected_type:e})}}},mounted(){this.value||=`general`}}),ie={class:`field`},ae={class:`title font-bold`};function oe(e,r,i,a,o,c){let d=m(`el-option`),f=m(`el-select`);return u(),t(`div`,ie,[n(`h2`,ae,l(e.$t(`webextrator.name.expectedType`)),1),s(f,{modelValue:e.value,"onUpdate:modelValue":r[0]||=t=>e.value=t,class:`value`},{default:h(()=>[s(d,{value:`general`,label:e.$t(`webextrator.expectedType.general`)},null,8,[`label`]),s(d,{value:`article`,label:e.$t(`webextrator.expectedType.article`)},null,8,[`label`]),s(d,{value:`product`,label:e.$t(`webextrator.expectedType.product`)},null,8,[`label`])]),_:1},8,[`modelValue`])])}var se=j(re,[[`render`,oe],[`__scopeId`,`data-v-3b572c49`]]),ce=r({name:`LlmToggle`,components:{ElSwitch:te,ElTooltip:S,FontAwesomeIcon:F},computed:{value:{get(){return!!this.$store.state.webextrator?.config?.enable_llm},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,enable_llm:e})}}}}),le={class:`field`},ue={class:`title font-bold`};function de(e,r,i,o,c,d){let f=m(`font-awesome-icon`),p=m(`el-tooltip`),g=m(`el-switch`);return u(),t(`div`,le,[n(`h2`,ue,[a(l(e.$t(`webextrator.name.enableLlm`))+` `,1),s(p,{effect:`dark`,content:e.$t(`webextrator.description.enableLlm`),placement:`top`},{default:h(()=>[s(f,{icon:`fa-solid fa-circle-info`,class:`ml-1 text-[var(--el-text-color-secondary)] text-xs`})]),_:1},8,[`content`])]),s(g,{modelValue:e.value,"onUpdate:modelValue":r[0]||=t=>e.value=t,class:`value`},null,8,[`modelValue`])])}var fe=j(ce,[[`render`,de],[`__scopeId`,`data-v-32fa7c89`]]),pe=[`image`,`font`,`media`,`stylesheet`,`xhr`,`fetch`],me=r({name:`AdvancedOptions`,components:{ElCollapse:O,ElCollapseItem:D,ElInput:M,ElInputNumber:ee,ElSelect:v,ElOption:y},data(){return{active:[]}},computed:{resourceKinds(){return pe},waitUntil:{get(){return this.$store.state.webextrator?.config?.wait_until||`networkidle`},set(e){this.commit({wait_until:e})}},waitForSelector:{get(){return this.$store.state.webextrator?.config?.wait_for_selector||``},set(e){this.commit({wait_for_selector:e})}},timeout:{get(){return this.$store.state.webextrator?.config?.timeout??30},set(e){this.commit({timeout:e})}},delay:{get(){return this.$store.state.webextrator?.config?.delay??0},set(e){this.commit({delay:e})}},blockResources:{get(){return this.$store.state.webextrator?.config?.block_resources||[]},set(e){this.commit({block_resources:e})}}},methods:{commit(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,...e})}}}),he={class:`field`},ge={class:`sub-title`},_e={class:`field`},ve={class:`sub-title`},ye={class:`field`},be={class:`sub-title`},xe={class:`field`},Se={class:`sub-title`},Ce={class:`field`},we={class:`sub-title`};function Te(r,i,a,d,f,p){let g=m(`el-option`),_=m(`el-select`),v=m(`el-input`),y=m(`el-input-number`),b=m(`el-collapse-item`),x=m(`el-collapse`);return u(),o(x,{modelValue:r.active,"onUpdate:modelValue":i[5]||=e=>r.active=e,class:`advanced`},{default:h(()=>[s(b,{title:r.$t(`webextrator.name.advanced`),name:`advanced`},{default:h(()=>[n(`div`,he,[n(`h2`,ge,l(r.$t(`webextrator.name.waitUntil`)),1),s(_,{modelValue:r.waitUntil,"onUpdate:modelValue":i[0]||=e=>r.waitUntil=e,class:`value`},{default:h(()=>[s(g,{value:`networkidle`,label:r.$t(`webextrator.waitUntil.networkidle`)},null,8,[`label`]),s(g,{value:`load`,label:r.$t(`webextrator.waitUntil.load`)},null,8,[`label`]),s(g,{value:`domcontentloaded`,label:r.$t(`webextrator.waitUntil.domcontentloaded`)},null,8,[`label`]),s(g,{value:`commit`,label:r.$t(`webextrator.waitUntil.commit`)},null,8,[`label`])]),_:1},8,[`modelValue`])]),n(`div`,_e,[n(`h2`,ve,l(r.$t(`webextrator.name.waitForSelector`)),1),s(v,{modelValue:r.waitForSelector,"onUpdate:modelValue":i[1]||=e=>r.waitForSelector=e,placeholder:r.$t(`webextrator.placeholder.waitForSelector`)},null,8,[`modelValue`,`placeholder`])]),n(`div`,ye,[n(`h2`,be,l(r.$t(`webextrator.name.timeout`)),1),s(y,{modelValue:r.timeout,"onUpdate:modelValue":i[2]||=e=>r.timeout=e,min:1,max:120,step:5,"controls-position":`right`,class:`w-full`},null,8,[`modelValue`])]),n(`div`,xe,[n(`h2`,Se,l(r.$t(`webextrator.name.delay`)),1),s(y,{modelValue:r.delay,"onUpdate:modelValue":i[3]||=e=>r.delay=e,min:0,max:30,step:1,"controls-position":`right`,class:`w-full`},null,8,[`modelValue`])]),n(`div`,Ce,[n(`h2`,we,l(r.$t(`webextrator.name.blockResources`)),1),s(_,{modelValue:r.blockResources,"onUpdate:modelValue":i[4]||=e=>r.blockResources=e,multiple:``,"collapse-tags":``,placeholder:r.$t(`webextrator.placeholder.blockResources`),class:`w-full`},{default:h(()=>[(u(!0),t(c,null,e(r.resourceKinds,e=>(u(),o(g,{key:e,label:r.$t(`webextrator.blockResource.${e}`),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])}var Ee=r({name:`WebextratorConfigPanel`,components:{ElButton:_,FontAwesomeIcon:F,ModeSelector:J,UrlInput:ne,ExpectedTypeSelector:se,LlmToggle:fe,AdvancedOptions:j(me,[[`render`,Te],[`__scopeId`,`data-v-8f36d2df`]]),Consumption:L},emits:[`run`],computed:{config(){return this.$store.state.webextrator?.config},service(){return this.$store.state.webextrator?.service},consumption(){return N(this.config||{},this.service?.cost)},running(){return this.$store.state.webextrator?.status?.run===P.Request},isExtract(){return(this.config?.mode||`extract`)===`extract`},canRun(){let e=(this.config?.url||``).trim();return/^https?:\/\//i.test(e)}},methods:{onRun(){this.canRun&&this.$emit(`run`)}}}),De={class:`flex flex-col h-full`},Oe={class:`flex-1 overflow-y-auto p-5`},ke={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ae(e,r,i,o,d,f){let g=m(`mode-selector`),_=m(`url-input`),v=m(`expected-type-selector`),y=m(`llm-toggle`),b=m(`advanced-options`),x=m(`consumption`),S=m(`font-awesome-icon`),C=m(`el-button`);return u(),t(`div`,De,[n(`div`,Oe,[s(g,{class:`mb-4`}),s(_,{class:`mb-4`,onSubmit:e.onRun},null,8,[`onSubmit`]),e.isExtract?(u(),t(c,{key:0},[s(v,{class:`mb-4`}),s(y,{class:`mb-4`})],64)):p(``,!0),s(b,{class:`mb-4`})]),n(`div`,ke,[s(x,{value:e.consumption,service:e.service},null,8,[`value`,`service`]),s(C,{type:`primary`,class:`w-full`,round:``,loading:e.running,disabled:!e.canRun,onClick:e.onRun},{default:h(()=>[s(S,{icon:`fa-solid fa-bolt`,class:`mr-2`}),a(` `+l(e.$t(e.isExtract?`webextrator.button.extract`:`webextrator.button.render`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])])}var je=j(Ee,[[`render`,Ae]]),Me=e=>!!e&&e.kind!==`render`,Ne=r({name:`WebextratorResultPanel`,components:{ElAlert:w,ElImage:C,ElTabs:b,ElTabPane:x,FontAwesomeIcon:F,CopyToClipboard:I},data(){return{activeTab:`markdown`}},computed:{response(){return this.$store.state.webextrator?.response},running(){return this.$store.state.webextrator?.status?.run===P.Request},data(){return this.response?.data},renderData(){return this.data&&this.data.kind===`render`?this.data:void 0},extractData(){return Me(this.data)?this.data:void 0},finalUrl(){let e=this.data;return e?.finalUrl||e?.final_url||e?.url},contentTypeLabel(){let e=this.data;return e?.contentType||e?.content_type||e?.expected_type},screenshotSrc(){let e=this.data?.screenshot;if(e)return e.startsWith(`data:`)||e.startsWith(`http`)?e:`data:image/png;base64,${e}`},markdown(){let e=this.data;return e?.markdown||e?.content||``},plainText(){return this.data?.text||``},html(){return this.data?.html||``},links(){return Array.isArray(this.data?.links)?this.data.links:[]},linksPlain(){return this.links.join(`
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{$ as e,A as t,D as n,F as r,M as i,N as a,O as o,P as s,S as c,Wt as l,Z as u,b as d,et as f,k as p,tt as m,ut as h,y as g}from"./vendor-chart-BJCvKk8-.js";import{t as _}from"./button-DfsQodL-.js";import{r as v,t as y}from"./select-CIZk9ihC.js";import{n as b,t as x}from"./tabs-C-7HQMjK.js";import{t as S}from"./tooltip-BLwTovWL.js";import{t as C}from"./image-_ExVBzK6.js";import{t as w}from"./alert-OvnfgMB-.js";import{n as T,r as E}from"./radio-BmBXySlN.js";import{n as D,t as O}from"./collapse-BMk9zKLQ.js";import{t as k}from"./drawer-Dpuj2uIl.js";import{t as ee}from"./input-number-wRL7m93t.js";import{t as te}from"./switch-BdOpfax3.js";import"./constants-Doj9A7vw.js";import{Ar as A,E as j,Lr as M,Pt as N,br as P}from"./index-Cmr4LxuY.js";import{t as F}from"./index.es-CqtN0wgr.js";import{t as I}from"./CopyToClipboard-koQ26Tcr.js";import{t as L}from"./Consumption-BGQCLo2d.js";var R=r({name:`LayoutWebextrator`,components:{ElDrawer:k,ElButton:_,FontAwesomeIcon:F},data(){return{drawer:!1}}}),z={class:`main flex flex-row flex-1`},B={class:`config w-[340px] flex-none h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},V={class:`result h-full flex-1 flex flex-col min-w-0 overflow-x-hidden bg-[var(--app-content-bg)]`};function H(e,r,i,a,o,c){let l=m(`font-awesome-icon`),d=m(`el-button`),p=m(`el-drawer`);return u(),t(`div`,z,[n(`div`,B,[f(e.$slots,`config`,{},void 0,!0)]),n(`div`,V,[f(e.$slots,`result`,{},void 0,!0)]),s(d,{circle:``,class:`menu`,onClick:r[0]||=t=>e.drawer=!0},{default:h(()=>[s(l,{icon:`fa-solid fa-sliders`})]),_:1}),s(p,{modelValue:e.drawer,"onUpdate:modelValue":r[1]||=t=>e.drawer=t,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:h(()=>[f(e.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var U=j(R,[[`render`,H],[`__scopeId`,`data-v-7b1cd8ae`]]),W=r({name:`ModeSelector`,components:{ElRadioGroup:E,ElRadioButton:T,FontAwesomeIcon:F},computed:{value:{get(){return this.$store.state.webextrator?.config?.mode},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,mode:e})}}}}),G={class:`field`},K={class:`title font-bold`};function q(e,r,i,o,c,d){let f=m(`font-awesome-icon`),p=m(`el-radio-button`),g=m(`el-radio-group`);return u(),t(`div`,G,[n(`h2`,K,l(e.$t(`webextrator.name.mode`)),1),s(g,{modelValue:e.value,"onUpdate:modelValue":r[0]||=t=>e.value=t,class:`value w-full`},{default:h(()=>[s(p,{label:`extract`,value:`extract`},{default:h(()=>[s(f,{icon:`fa-solid fa-wand-magic-sparkles`,class:`mr-1`}),a(` `+l(e.$t(`webextrator.mode.extract`)),1)]),_:1}),s(p,{label:`render`,value:`render`},{default:h(()=>[s(f,{icon:`fa-solid fa-globe`,class:`mr-1`}),a(` `+l(e.$t(`webextrator.mode.render`)),1)]),_:1})]),_:1},8,[`modelValue`])])}var J=j(W,[[`render`,q],[`__scopeId`,`data-v-31e6c11d`]]),Y=r({name:`UrlInput`,components:{ElInput:M},emits:[`submit`],computed:{url:{get(){return this.$store.state.webextrator?.config?.url||``},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,url:e})}}},methods:{onEnter(){this.$emit(`submit`)}}}),X={class:`field`},Z={class:`title font-bold`};function Q(e,r,i,a,o,c){let f=m(`el-input`);return u(),t(`div`,X,[n(`h2`,Z,l(e.$t(`webextrator.name.url`)),1),s(f,{modelValue:e.url,"onUpdate:modelValue":r[0]||=t=>e.url=t,type:`textarea`,rows:2,class:`prompt`,placeholder:e.$t(`webextrator.placeholder.url`),onKeydown:g(d(e.onEnter,[`exact`,`prevent`]),[`enter`])},null,8,[`modelValue`,`placeholder`,`onKeydown`])])}var ne=j(Y,[[`render`,Q],[`__scopeId`,`data-v-18488009`]]),re=r({name:`ExpectedTypeSelector`,components:{ElSelect:v,ElOption:y},computed:{value:{get(){return this.$store.state.webextrator?.config?.expected_type},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,expected_type:e})}}},mounted(){this.value||=`general`}}),ie={class:`field`},ae={class:`title font-bold`};function oe(e,r,i,a,o,c){let d=m(`el-option`),f=m(`el-select`);return u(),t(`div`,ie,[n(`h2`,ae,l(e.$t(`webextrator.name.expectedType`)),1),s(f,{modelValue:e.value,"onUpdate:modelValue":r[0]||=t=>e.value=t,class:`value`},{default:h(()=>[s(d,{value:`general`,label:e.$t(`webextrator.expectedType.general`)},null,8,[`label`]),s(d,{value:`article`,label:e.$t(`webextrator.expectedType.article`)},null,8,[`label`]),s(d,{value:`product`,label:e.$t(`webextrator.expectedType.product`)},null,8,[`label`])]),_:1},8,[`modelValue`])])}var se=j(re,[[`render`,oe],[`__scopeId`,`data-v-3b572c49`]]),ce=r({name:`LlmToggle`,components:{ElSwitch:te,ElTooltip:S,FontAwesomeIcon:F},computed:{value:{get(){return!!this.$store.state.webextrator?.config?.enable_llm},set(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,enable_llm:e})}}}}),le={class:`field`},ue={class:`title font-bold`};function de(e,r,i,o,c,d){let f=m(`font-awesome-icon`),p=m(`el-tooltip`),g=m(`el-switch`);return u(),t(`div`,le,[n(`h2`,ue,[a(l(e.$t(`webextrator.name.enableLlm`))+` `,1),s(p,{effect:`dark`,content:e.$t(`webextrator.description.enableLlm`),placement:`top`},{default:h(()=>[s(f,{icon:`fa-solid fa-circle-info`,class:`ml-1 text-[var(--el-text-color-secondary)] text-xs`})]),_:1},8,[`content`])]),s(g,{modelValue:e.value,"onUpdate:modelValue":r[0]||=t=>e.value=t,class:`value`},null,8,[`modelValue`])])}var fe=j(ce,[[`render`,de],[`__scopeId`,`data-v-32fa7c89`]]),pe=[`image`,`font`,`media`,`stylesheet`,`xhr`,`fetch`],me=r({name:`AdvancedOptions`,components:{ElCollapse:O,ElCollapseItem:D,ElInput:M,ElInputNumber:ee,ElSelect:v,ElOption:y},data(){return{active:[]}},computed:{resourceKinds(){return pe},waitUntil:{get(){return this.$store.state.webextrator?.config?.wait_until||`networkidle`},set(e){this.commit({wait_until:e})}},waitForSelector:{get(){return this.$store.state.webextrator?.config?.wait_for_selector||``},set(e){this.commit({wait_for_selector:e})}},timeout:{get(){return this.$store.state.webextrator?.config?.timeout??30},set(e){this.commit({timeout:e})}},delay:{get(){return this.$store.state.webextrator?.config?.delay??0},set(e){this.commit({delay:e})}},blockResources:{get(){return this.$store.state.webextrator?.config?.block_resources||[]},set(e){this.commit({block_resources:e})}}},methods:{commit(e){this.$store.commit(`webextrator/setConfig`,{...this.$store.state.webextrator?.config,...e})}}}),he={class:`field`},ge={class:`sub-title`},_e={class:`field`},ve={class:`sub-title`},ye={class:`field`},be={class:`sub-title`},xe={class:`field`},Se={class:`sub-title`},Ce={class:`field`},we={class:`sub-title`};function Te(r,i,a,d,f,p){let g=m(`el-option`),_=m(`el-select`),v=m(`el-input`),y=m(`el-input-number`),b=m(`el-collapse-item`),x=m(`el-collapse`);return u(),o(x,{modelValue:r.active,"onUpdate:modelValue":i[5]||=e=>r.active=e,class:`advanced`},{default:h(()=>[s(b,{title:r.$t(`webextrator.name.advanced`),name:`advanced`},{default:h(()=>[n(`div`,he,[n(`h2`,ge,l(r.$t(`webextrator.name.waitUntil`)),1),s(_,{modelValue:r.waitUntil,"onUpdate:modelValue":i[0]||=e=>r.waitUntil=e,class:`value`},{default:h(()=>[s(g,{value:`networkidle`,label:r.$t(`webextrator.waitUntil.networkidle`)},null,8,[`label`]),s(g,{value:`load`,label:r.$t(`webextrator.waitUntil.load`)},null,8,[`label`]),s(g,{value:`domcontentloaded`,label:r.$t(`webextrator.waitUntil.domcontentloaded`)},null,8,[`label`]),s(g,{value:`commit`,label:r.$t(`webextrator.waitUntil.commit`)},null,8,[`label`])]),_:1},8,[`modelValue`])]),n(`div`,_e,[n(`h2`,ve,l(r.$t(`webextrator.name.waitForSelector`)),1),s(v,{modelValue:r.waitForSelector,"onUpdate:modelValue":i[1]||=e=>r.waitForSelector=e,placeholder:r.$t(`webextrator.placeholder.waitForSelector`)},null,8,[`modelValue`,`placeholder`])]),n(`div`,ye,[n(`h2`,be,l(r.$t(`webextrator.name.timeout`)),1),s(y,{modelValue:r.timeout,"onUpdate:modelValue":i[2]||=e=>r.timeout=e,min:1,max:120,step:5,"controls-position":`right`,class:`w-full`},null,8,[`modelValue`])]),n(`div`,xe,[n(`h2`,Se,l(r.$t(`webextrator.name.delay`)),1),s(y,{modelValue:r.delay,"onUpdate:modelValue":i[3]||=e=>r.delay=e,min:0,max:30,step:1,"controls-position":`right`,class:`w-full`},null,8,[`modelValue`])]),n(`div`,Ce,[n(`h2`,we,l(r.$t(`webextrator.name.blockResources`)),1),s(_,{modelValue:r.blockResources,"onUpdate:modelValue":i[4]||=e=>r.blockResources=e,multiple:``,"collapse-tags":``,placeholder:r.$t(`webextrator.placeholder.blockResources`),class:`w-full`},{default:h(()=>[(u(!0),t(c,null,e(r.resourceKinds,e=>(u(),o(g,{key:e,label:r.$t(`webextrator.blockResource.${e}`),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])]),_:1},8,[`title`])]),_:1},8,[`modelValue`])}var Ee=r({name:`WebextratorConfigPanel`,components:{ElButton:_,FontAwesomeIcon:F,ModeSelector:J,UrlInput:ne,ExpectedTypeSelector:se,LlmToggle:fe,AdvancedOptions:j(me,[[`render`,Te],[`__scopeId`,`data-v-8f36d2df`]]),Consumption:L},emits:[`run`],computed:{config(){return this.$store.state.webextrator?.config},service(){return this.$store.state.webextrator?.service},consumption(){return N(this.config||{},this.service?.cost)},running(){return this.$store.state.webextrator?.status?.run===P.Request},isExtract(){return(this.config?.mode||`extract`)===`extract`},canRun(){let e=(this.config?.url||``).trim();return/^https?:\/\//i.test(e)}},methods:{onRun(){this.canRun&&this.$emit(`run`)}}}),De={class:`flex flex-col h-full`},Oe={class:`flex-1 overflow-y-auto p-5`},ke={class:`flex flex-col items-center justify-center px-5 pb-5`};function Ae(e,r,i,o,d,f){let g=m(`mode-selector`),_=m(`url-input`),v=m(`expected-type-selector`),y=m(`llm-toggle`),b=m(`advanced-options`),x=m(`consumption`),S=m(`font-awesome-icon`),C=m(`el-button`);return u(),t(`div`,De,[n(`div`,Oe,[s(g,{class:`mb-4`}),s(_,{class:`mb-4`,onSubmit:e.onRun},null,8,[`onSubmit`]),e.isExtract?(u(),t(c,{key:0},[s(v,{class:`mb-4`}),s(y,{class:`mb-4`})],64)):p(``,!0),s(b,{class:`mb-4`})]),n(`div`,ke,[s(x,{value:e.consumption,service:e.service},null,8,[`value`,`service`]),s(C,{type:`primary`,class:`w-full`,round:``,loading:e.running,disabled:!e.canRun,onClick:e.onRun},{default:h(()=>[s(S,{icon:`fa-solid fa-bolt`,class:`mr-2`}),a(` `+l(e.$t(e.isExtract?`webextrator.button.extract`:`webextrator.button.render`)),1)]),_:1},8,[`loading`,`disabled`,`onClick`])])])}var je=j(Ee,[[`render`,Ae]]),Me=e=>!!e&&e.kind!==`render`,Ne=r({name:`WebextratorResultPanel`,components:{ElAlert:w,ElImage:C,ElTabs:b,ElTabPane:x,FontAwesomeIcon:F,CopyToClipboard:I},data(){return{activeTab:`markdown`}},computed:{response(){return this.$store.state.webextrator?.response},running(){return this.$store.state.webextrator?.status?.run===P.Request},data(){return this.response?.data},renderData(){return this.data&&this.data.kind===`render`?this.data:void 0},extractData(){return Me(this.data)?this.data:void 0},finalUrl(){let e=this.data;return e?.finalUrl||e?.final_url||e?.url},contentTypeLabel(){let e=this.data;return e?.contentType||e?.content_type||e?.expected_type},screenshotSrc(){let e=this.data?.screenshot;if(e)return e.startsWith(`data:`)||e.startsWith(`http`)?e:`data:image/png;base64,${e}`},markdown(){let e=this.data;return e?.markdown||e?.content||``},plainText(){return this.data?.text||``},html(){return this.data?.html||``},links(){return Array.isArray(this.data?.links)?this.data.links:[]},linksPlain(){return this.links.join(`
|
|
2
2
|
`)},images(){return Array.isArray(this.data?.images)?this.data.images:[]},structuredPretty(){return this.extractData?.structured?JSON.stringify(this.extractData.structured,null,2):``},rawPretty(){return this.response?JSON.stringify(this.response,null,2):``},errorMessage(){if(this.response?.success===!1){let e=this.response?.error;return e?.message||e?.code||this.$t(`webextrator.message.failed`)}}},watch:{response:{handler(){this.resetTab()},immediate:!0}},methods:{resetTab(){this.markdown?this.activeTab=`markdown`:this.extractData?.structured?this.activeTab=`structured`:this.plainText?this.activeTab=`text`:this.html?this.activeTab=`html`:this.activeTab=`raw`}}}),Pe={class:`h-full overflow-y-auto p-6`},Fe={key:0,class:`max-w-4xl mx-auto py-4`},Ie={class:`flex items-center gap-2 mb-3 text-[var(--el-color-primary)] text-sm`},Le={key:1,class:`flex flex-col items-center justify-center py-24 text-[var(--el-text-color-disabled)]`},Re={class:`text-base mb-1`},ze={class:`text-xs opacity-70`},Be={key:2,class:`max-w-4xl mx-auto py-4`},Ve={class:`text-xs whitespace-pre-wrap break-words`},He={key:3,class:`max-w-4xl mx-auto`},Ue={class:`mb-4`},We={class:`text-xl font-semibold leading-snug mb-1 break-words text-[var(--el-text-color-primary)]`},Ge={class:`flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-[var(--el-text-color-secondary)]`},Ke=[`href`],qe={key:1},Je={key:2},Ye={key:3},Xe={key:0,class:`mt-2 text-sm text-[var(--el-text-color-regular)] leading-relaxed line-clamp-3`},Ze={key:0,class:`mb-5`},Qe={class:`tab-toolbar`},$e={class:`content-block`},et={class:`tab-toolbar`},tt={class:`content-block`},$={class:`tab-toolbar`},nt={class:`content-block code`},rt={class:`tab-toolbar`},it={class:`links-list`},at=[`href`],ot={class:`grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-2`},st={class:`tab-toolbar`},ct={class:`content-block code`},lt={class:`tab-toolbar`},ut={class:`content-block code`};function dt(r,d,f,g,_,v){let y=m(`font-awesome-icon`),b=m(`el-alert`),x=m(`el-image`),S=m(`copy-to-clipboard`),C=m(`el-tab-pane`),w=m(`el-tabs`);return u(),t(`div`,Pe,[r.running?(u(),t(`div`,Fe,[n(`div`,Ie,[s(y,{icon:`fa-solid fa-circle-notch`,spin:``}),n(`span`,null,l(r.$t(`webextrator.message.running`)),1)]),d[1]||=i(`<div class="mb-6 animate-pulse" data-v-b05b4db0><div class="h-5 w-3/5 rounded bg-[var(--el-fill-color-dark)] mb-2" data-v-b05b4db0></div><div class="h-3 w-2/5 rounded bg-[var(--el-fill-color)] mb-4" data-v-b05b4db0></div><div class="h-64 w-full rounded bg-[var(--el-fill-color)] mb-3" data-v-b05b4db0></div><div class="h-3 w-full rounded bg-[var(--el-fill-color)] mb-1" data-v-b05b4db0></div><div class="h-3 w-5/6 rounded bg-[var(--el-fill-color)] mb-1" data-v-b05b4db0></div><div class="h-3 w-4/6 rounded bg-[var(--el-fill-color)]" data-v-b05b4db0></div></div>`,1)])):!r.response&&!r.errorMessage?(u(),t(`div`,Le,[s(y,{icon:`fa-solid fa-globe`,class:`text-6xl mb-4 opacity-30`}),n(`p`,Re,l(r.$t(`webextrator.description.intro`)),1),n(`p`,ze,l(r.$t(`webextrator.description.introHint`)),1)])):r.errorMessage?(u(),t(`div`,Be,[s(b,{type:`error`,closable:!1,"show-icon":``,title:r.$t(`webextrator.message.failed`)},{default:h(()=>[n(`pre`,Ve,l(r.errorMessage),1)]),_:1},8,[`title`])])):r.data?(u(),t(`div`,He,[n(`header`,Ue,[n(`h1`,We,l(r.data.title||r.$t(`webextrator.message.untitled`)),1),n(`div`,Ge,[r.finalUrl?(u(),t(`a`,{key:0,href:r.finalUrl,target:`_blank`,rel:`noopener`,class:`hover:underline truncate max-w-[60%]`},[s(y,{icon:`fa-solid fa-up-right-from-square`,class:`mr-1`}),a(l(r.finalUrl),1)],8,Ke)):p(``,!0),r.renderData?.status?(u(),t(`span`,qe,[s(y,{icon:`fa-solid fa-signal`,class:`mr-1`}),a(l(r.renderData.status),1)])):p(``,!0),r.response?.elapsed?(u(),t(`span`,Je,[s(y,{icon:`fa-solid fa-clock`,class:`mr-1`}),a(l(r.response.elapsed.toFixed(2))+`s `,1)])):p(``,!0),r.contentTypeLabel?(u(),t(`span`,Ye,[s(y,{icon:`fa-solid fa-tag`,class:`mr-1`}),a(l(r.contentTypeLabel),1)])):p(``,!0)]),r.extractData?.description?(u(),t(`p`,Xe,l(r.extractData.description),1)):p(``,!0)]),r.screenshotSrc?(u(),t(`figure`,Ze,[s(x,{src:r.screenshotSrc,fit:`contain`,"preview-src-list":[r.screenshotSrc],"preview-teleported":``,"hide-on-click-modal":``,class:`w-full max-h-[480px] rounded border border-[var(--app-border-subtle)] bg-[var(--el-fill-color-light)]`},null,8,[`src`,`preview-src-list`])])):p(``,!0),s(w,{modelValue:r.activeTab,"onUpdate:modelValue":d[0]||=e=>r.activeTab=e,class:`result-tabs`},{default:h(()=>[r.markdown?(u(),o(C,{key:0,label:r.$t(`webextrator.tab.markdown`),name:`markdown`},{default:h(()=>[n(`div`,Qe,[s(S,{content:r.markdown},null,8,[`content`])]),n(`pre`,$e,l(r.markdown),1)]),_:1},8,[`label`])):p(``,!0),r.plainText?(u(),o(C,{key:1,label:r.$t(`webextrator.tab.text`),name:`text`},{default:h(()=>[n(`div`,et,[s(S,{content:r.plainText},null,8,[`content`])]),n(`pre`,tt,l(r.plainText),1)]),_:1},8,[`label`])):p(``,!0),r.extractData?.structured?(u(),o(C,{key:2,label:r.$t(`webextrator.tab.structured`),name:`structured`},{default:h(()=>[n(`div`,$,[s(S,{content:r.structuredPretty},null,8,[`content`])]),n(`pre`,nt,l(r.structuredPretty),1)]),_:1},8,[`label`])):p(``,!0),r.links.length?(u(),o(C,{key:3,label:`${r.$t(`webextrator.tab.links`)} (${r.links.length})`,name:`links`},{default:h(()=>[n(`div`,rt,[s(S,{content:r.linksPlain},null,8,[`content`])]),n(`ul`,it,[(u(!0),t(c,null,e(r.links,(e,r)=>(u(),t(`li`,{key:r,class:`truncate`},[n(`a`,{href:e,target:`_blank`,rel:`noopener`},l(e),9,at)]))),128))])]),_:1},8,[`label`])):p(``,!0),r.images.length?(u(),o(C,{key:4,label:`${r.$t(`webextrator.tab.images`)} (${r.images.length})`,name:`images`},{default:h(()=>[n(`div`,ot,[(u(!0),t(c,null,e(r.images,(e,t)=>(u(),o(x,{key:t,src:e,fit:`cover`,loading:`lazy`,"preview-src-list":r.images,"initial-index":t,"preview-teleported":``,"hide-on-click-modal":``,class:`aspect-square w-full rounded bg-[var(--el-fill-color-light)]`},null,8,[`src`,`preview-src-list`,`initial-index`]))),128))])]),_:1},8,[`label`])):p(``,!0),r.html?(u(),o(C,{key:5,label:r.$t(`webextrator.tab.html`),name:`html`},{default:h(()=>[n(`div`,st,[s(S,{content:r.html},null,8,[`content`])]),n(`pre`,ct,l(r.html),1)]),_:1},8,[`label`])):p(``,!0),s(C,{label:r.$t(`webextrator.tab.raw`),name:`raw`},{default:h(()=>[n(`div`,lt,[s(S,{content:r.rawPretty},null,8,[`content`])]),n(`pre`,ut,l(r.rawPretty),1)]),_:1},8,[`label`])]),_:1},8,[`modelValue`])])):p(``,!0)])}var ft=r({name:`WebextratorIndex`,components:{Layout:U,ConfigPanel:je,ResultPanel:j(Ne,[[`render`,dt],[`__scopeId`,`data-v-b05b4db0`]])},inject:[`initialized`],async mounted(){await this.$store.dispatch(`webextrator/getService`)},methods:{async onRun(){let e=this.$store.state.webextrator?.config;if(!e?.url)return;let t=(e.mode||`extract`)===`extract`;A.info(this.$t(t?`webextrator.message.extracting`:`webextrator.message.rendering`));try{await this.$store.dispatch(`webextrator/run`),A.success(this.$t(`webextrator.message.success`))}catch(e){let t=e?.response?.data?.error?.code||e?.response?.data?.code;t===`used_up`?A.error(this.$t(`webextrator.message.usedUp`)):t===`too_many_requests`?A.error(this.$t(`webextrator.message.busy`)):t===`timeout`?A.error(this.$t(`webextrator.message.timeout`)):A.error(this.$t(`webextrator.message.failed`))}}}});function pt(e,t,n,r,i,a){let c=m(`config-panel`),l=m(`result-panel`),d=m(`layout`);return u(),o(d,null,{config:h(()=>[s(c,{onRun:e.onRun},null,8,[`onRun`])]),result:h(()=>[s(l)]),_:1})}var mt=j(ft,[[`render`,pt]]);export{mt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./rolldown-runtime--c01j_DQ.js";import{$ as e,A as t,D as n,F as r,N as i,O as a,P as o,S as s,Vt as c,Wt as l,Z as u,b as d,dt as f,et as p,k as m,tt as h,ut as g,v as _}from"./vendor-chart-BJCvKk8-.js";import{t as v}from"./button-DfsQodL-.js";import{n as y,r as b,t as x}from"./select-CbNogKSw.js";import{t as S}from"./upload-_lBvoaGk.js";import{t as C}from"./tooltip-BLwTovWL.js";import{t as w}from"./image-ttyLLhNO.js";import{t as T}from"./alert-OvnfgMB-.js";import{t as E}from"./drawer-Dpuj2uIl.js";import{t as D}from"./input-number-CRxXaQtg.js";import{t as ee}from"./switch-tbd54zD9.js";import{_i as te,an as O,cn as k,dn as A,en as ne,fn as j,in as M,ln as N,on as P,rn as F,sn as I,tn as L}from"./constants-Doj9A7vw.js";import{Ar as R,At as re,Cr as ie,E as z,In as B,Mt as V,Pt as H,br as U,en as W,jt as G,kr as K,kt as q}from"./index-BcUyz1eC.js";import{t as J}from"./index.es-yT7dU_Va.js";import{t as Y}from"./CopyToClipboard-CkWzEIbo.js";import{t as X}from"./ImagePreview-GRjlSvS4.js";import{n as ae}from"./taskDrawerMixin-DEgO_R5H.js";import{t as oe}from"./BotPlaceholder-D6AUYJbe.js";import{i as Z,n as se,t as ce}from"./pagination-BIoA190D.js";import{n as le,t as ue}from"./NoTasks-D1nl515w.js";import{t as de}from"./Consumption-BuxjrihL.js";import{t as fe}from"./ApiCodeButton-REzWFnTi.js";import{t as pe}from"./ImageWrapper-BXMMoMt0.js";var me=r({name:`LayoutSeedream`,components:{ElDrawer:E,ElButton:v,FontAwesomeIcon:J},mixins:[ae]}),he={class:`main flex flex-row flex-1`},ge={class:`config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},_e={class:`result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]`};function ve(e,r,i,a,s,c){let l=h(`font-awesome-icon`),d=h(`el-button`),m=h(`el-drawer`);return u(),t(`div`,he,[n(`div`,ge,[p(e.$slots,`config`,{},void 0,!0)]),n(`div`,_e,[p(e.$slots,`result`,{},void 0,!0)]),f(o(d,{circle:``,class:`menu`,onClick:r[0]||=t=>e.drawer=!0},{default:g(()=>[o(l,{icon:`fa-solid fa-magic`})]),_:1},512),[[_,!e.tasksEmpty]]),o(m,{modelValue:e.drawer,"onUpdate:modelValue":r[1]||=t=>e.drawer=t,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:g(()=>[p(e.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var ye=z(me,[[`render`,ve],[`__scopeId`,`data-v-2a1715d6`]]),be=r({name:`SeedreamPromptInput`,components:{PromptTextarea:le},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||=``}});function xe(e,t,n,r,i,o){let s=h(`prompt-textarea`);return u(),a(s,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedream.name.prompt`),info:e.$t(`seedream.description.prompt`),placeholder:e.$t(`seedream.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Se=z(be,[[`render`,xe]]),Ce={image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};function Q(e){switch(e){case P:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!0};case O:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case M:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case F:return{image:!1,imageRequired:!1,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!0,guidanceScale:!0,guidanceScaleDefault:L[F],outputFormat:!1,tools:!1};case I:return{image:!0,imageRequired:!0,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!1,guidanceScale:!0,guidanceScaleDefault:L[I],outputFormat:!1,tools:!1};default:return Ce}}var we=[`1K`,`2K`,`3K`,`4K`];function Te(e,t){if(!e)return[];let n=t.model??e.model;if(!n)return[];let r=Q(n),i=[];Array.isArray(e.image)&&e.image.length>0&&!r.image&&i.push({field:`image`,i18nLabel:`seedream.name.imageUrls`});let a=typeof e.size==`string`?e.size:void 0;if(a){let e=a.toUpperCase();(we.includes(e)&&!r.sizeTiers.includes(e)||a===`adaptive`&&!r.sizeAdaptive)&&i.push({field:`size`,i18nLabel:`seedream.name.size`})}return e.sequential_image_generation===`auto`&&!r.groupGeneration&&i.push({field:`sequential_image_generation`,i18nLabel:`seedream.name.maxImages`}),e.seed!==void 0&&e.seed!==null&&!r.seed&&i.push({field:`seed`,i18nLabel:`seedream.name.seed`}),e.guidance_scale!==void 0&&e.guidance_scale!==null&&!r.guidanceScale&&i.push({field:`guidance_scale`,i18nLabel:`seedream.name.guidanceScale`}),e.output_format&&!r.outputFormat&&i.push({field:`output_format`,i18nLabel:`seedream.name.outputFormat`}),Array.isArray(e.tools)&&e.tools.length>0&&!r.tools&&i.push({field:`tools`,i18nLabel:`seedream.name.tools`}),i}function Ee(e,t,n){let r={...e},i=Q(n.model??e.model);for(let e of t)switch(e.field){case`image`:delete r.image;break;case`size`:i.sizePixelDefault?r.size=i.sizePixelDefault:delete r.size;break;case`sequential_image_generation`:r.sequential_image_generation=`disabled`,delete r.sequential_image_generation_options;break;case`seed`:delete r.seed;break;case`guidance_scale`:delete r.guidance_scale;break;case`output_format`:delete r.output_format;break;case`tools`:delete r.tools;break}return r}var De=r({name:`SeedreamImageInput`,components:{ElUpload:S,ElButton:v,InfoIcon:Z,ImagePreview:X,FontAwesomeIcon:J},mixins:[V,re],data(){return{fileList:[],uploadUrl:ie()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image},model(){return this.$store.state.seedream?.config?.model},supported(){return Q(this.model).image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){R.warning(this.$t(`seedream.message.uploadImageExceed`))},onError(){R.error(this.$t(`seedream.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),Oe={key:0},ke={class:`field`},Ae={class:`label`},je={class:`box`},Me={class:`title font-bold`},Ne={class:`value`},Pe={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function Fe(r,c,d,f,p,_){let v=h(`info-icon`),y=h(`font-awesome-icon`),b=h(`el-button`),x=h(`el-upload`),S=h(`image-preview`);return r.supported?(u(),t(`div`,Oe,[n(`div`,ke,[n(`div`,Ae,[n(`div`,je,[n(`h2`,Me,l(r.$t(`seedream.name.imageUrls`)),1),o(v,{content:r.$t(`seedream.description.imageUrls`),class:`info`},null,8,[`content`])])]),n(`div`,Ne,[o(x,{ref:`uploader`,"file-list":r.fileList,"onUpdate:fileList":c[0]||=e=>r.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,limit:14,multiple:!0,"show-file-list":!1,action:r.uploadUrl,"on-exceed":r.onExceed,"on-error":r.onError,"on-success":r.onSuccess,"on-change":r.onChange,"on-remove":r.onRemove,headers:r.headers},{default:g(()=>[o(b,{size:`small`,type:`primary`,round:``},{default:g(()=>[o(y,{icon:`fa-solid fa-upload`,class:`mr-1`}),i(` `+l(r.$t(`seedream.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),n(`div`,Pe,[(u(!0),t(s,null,e(r.fileList,(e,t)=>(u(),a(S,{key:e.uid||e?.response?.file_url||e.url||t,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>r.onRemovePreview(t,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])):m(``,!0)}var Ie=z(De,[[`render`,Fe],[`__scopeId`,`data-v-6ef4c2e4`]]),Le=r({name:`SeedreamModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:Z},data(){return{revertKey:0,options:[{value:P,label:this.$t(`seedream.model.seedream50`)},{value:O,label:this.$t(`seedream.model.seedream45`)},{value:M,label:this.$t(`seedream.model.seedream40`)},{value:F,label:this.$t(`seedream.model.seedream30t2i`)},{value:I,label:this.$t(`seedream.model.seededit30i2i`)}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){this.value||this.applyModel(ne)},methods:{async onChange(e){let t=this.$store.state.seedream?.config||{},n=Te(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await K.confirm(this.$t(`seedream.message.featureNotSupportedBody`,{fields:r}),this.$t(`seedream.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`seedream.button.confirmContinue`),cancelButtonText:this.$t(`seedream.button.cancelSwitch`),type:`warning`});let i=Ee({...t,model:e},n,{model:e});this.$store.commit(`seedream/setConfig`,i),R.success(this.$t(`seedream.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e})}}}),Re={class:`field`},ze={class:`label`},Be={class:`box`},Ve={class:`title font-bold`};function He(r,i,c,d,f,p){let m=h(`info-icon`),_=h(`el-option`),v=h(`el-select`);return u(),t(`div`,Re,[n(`div`,ze,[n(`div`,Be,[n(`h2`,Ve,l(r.$t(`seedream.name.model`)),1),o(m,{content:r.$t(`seedream.description.model`),class:`info`},null,8,[`content`])])]),(u(),a(v,{key:r.revertKey,"model-value":r.value,class:`value`,placeholder:r.$t(`seedream.placeholder.select`),onChange:r.onChange},{default:g(()=>[(u(!0),t(s,null,e(r.options,e=>(u(),a(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Ue=z(Le,[[`render`,He],[`__scopeId`,`data-v-8892a12c`]]),We=r({name:`SeedreamSizeSelector`,components:{ElSelect:b,ElOption:x,ElOptionGroup:y,InfoIcon:Z},data(){return{SEEDREAM_SIZE_ADAPTIVE:A,pixelOptions:N}},computed:{model(){return this.$store.state.seedream?.config?.model},capabilities(){return Q(this.model)},value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,size:e})}}},watch:{model:{immediate:!0,handler(){if(this.value)return;let e=this.capabilities;e.sizeTiers.length?this.value=e.sizeTiers.includes(`2K`)?`2K`:e.sizeTiers[0]:e.sizePixelDefault&&(this.value=e.sizePixelDefault)}}}}),Ge={class:`field`},Ke={class:`label`},qe={class:`box`},Je={class:`title font-bold`};function Ye(r,i,c,d,f,p){let _=h(`info-icon`),v=h(`el-option`),y=h(`el-option-group`),b=h(`el-select`);return u(),t(`div`,Ge,[n(`div`,Ke,[n(`div`,qe,[n(`h2`,Je,l(r.$t(`seedream.name.size`)),1),o(_,{content:r.$t(`seedream.description.size`),class:`info`},null,8,[`content`])])]),o(b,{modelValue:r.value,"onUpdate:modelValue":i[0]||=e=>r.value=e,class:`value`,placeholder:r.$t(`seedream.placeholder.size`),filterable:``,"allow-create":``,"default-first-option":``},{default:g(()=>[r.capabilities.sizeTiers.length?(u(),a(y,{key:0,label:r.$t(`seedream.size.group.tier`)},{default:g(()=>[(u(!0),t(s,null,e(r.capabilities.sizeTiers,e=>(u(),a(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])):m(``,!0),r.capabilities.sizeAdaptive?(u(),a(y,{key:1,label:r.$t(`seedream.size.group.adaptive`)},{default:g(()=>[(u(),a(v,{key:r.SEEDREAM_SIZE_ADAPTIVE,label:r.$t(`seedream.size.adaptive`),value:r.SEEDREAM_SIZE_ADAPTIVE},null,8,[`label`,`value`]))]),_:1},8,[`label`])):m(``,!0),o(y,{label:r.$t(`seedream.size.group.pixel`)},{default:g(()=>[(u(!0),t(s,null,e(r.pixelOptions,e=>(u(),a(v,{key:e.value,label:`${e.value} (${e.ratio})`,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])]),_:1},8,[`modelValue`,`placeholder`])])}var Xe=z(We,[[`render`,Ye],[`__scopeId`,`data-v-dd7bd021`]]),Ze=r({name:`SeedreamMaxImagesSelector`,components:{ElInputNumber:D,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).groupGeneration},referenceImageCount(){let e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){let e=15-this.referenceImageCount;return Math.max(1,Math.min(15,e))},value:{get(){let e=this.config?.sequential_image_generation_options?.max_images;return typeof e==`number`&&e>=1?e:1},set(e){let t={...this.config||{}},n=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));n>1?(t.sequential_image_generation=`auto`,t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:n}):(t.sequential_image_generation=`disabled`,t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit(`seedream/setConfig`,t)}}},watch:{effectiveMax(e){this.value>e&&(this.value=e)}}}),Qe={key:0,class:`field`},$e={class:`label`},et={class:`box`},tt={class:`title font-bold`},nt={class:`value`};function rt(e,r,i,a,s,c){let d=h(`info-icon`),f=h(`el-input-number`);return e.supported?(u(),t(`div`,Qe,[n(`div`,$e,[n(`div`,et,[n(`h2`,tt,l(e.$t(`seedream.name.maxImages`)),1),o(d,{content:e.$t(`seedream.description.maxImages`),class:`info`},null,8,[`content`])])]),n(`div`,nt,[o(f,{modelValue:e.value,"onUpdate:modelValue":r[0]||=t=>e.value=t,min:1,max:e.effectiveMax,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`,`max`])])])):m(``,!0)}var it=z(Ze,[[`render`,rt],[`__scopeId`,`data-v-f079fd20`]]),at=r({name:`SeedreamOutputFormatSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:Z},data(){return{options:[...k]}},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).outputFormat},value:{get(){return this.config?.output_format},set(e){let t={...this.config||{}};t.output_format=e,this.$store.commit(`seedream/setConfig`,t)}}}}),ot={key:0,class:`field`},st={class:`label`},ct={class:`box`},lt={class:`title font-bold`};function ut(r,i,c,d,f,p){let _=h(`info-icon`),v=h(`el-option`),y=h(`el-select`);return r.supported?(u(),t(`div`,ot,[n(`div`,st,[n(`div`,ct,[n(`h2`,lt,l(r.$t(`seedream.name.outputFormat`)),1),o(_,{content:r.$t(`seedream.description.outputFormat`),class:`info`},null,8,[`content`])])]),o(y,{modelValue:r.value,"onUpdate:modelValue":i[0]||=e=>r.value=e,class:`value`,placeholder:r.$t(`seedream.placeholder.select`)},{default:g(()=>[(u(!0),t(s,null,e(r.options,e=>(u(),a(v,{key:e,label:e.toUpperCase(),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])):m(``,!0)}var dt=z(at,[[`render`,ut],[`__scopeId`,`data-v-69ea4c07`]]),ft=r({name:`SeedreamSeedInput`,components:{ElInputNumber:D,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).seed},value:{get(){let e=this.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedream/setConfig`,t)}}}}),pt={key:0,class:`field`},mt={class:`label`},ht={class:`box`},gt={class:`title font-bold`},_t={class:`value`};function vt(e,r,i,a,s,c){let d=h(`info-icon`),f=h(`el-input-number`);return e.supported?(u(),t(`div`,pt,[n(`div`,mt,[n(`div`,ht,[n(`h2`,gt,l(e.$t(`seedream.name.seed`)),1),o(d,{content:e.$t(`seedream.description.seed`),class:`info`},null,8,[`content`])])]),n(`div`,_t,[o(f,{modelValue:e.value,"onUpdate:modelValue":r[0]||=t=>e.value=t,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):m(``,!0)}var yt=z(ft,[[`render`,vt],[`__scopeId`,`data-v-10cdc1e0`]]),bt=r({name:`SeedreamGuidanceScaleInput`,components:{ElInputNumber:D,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).guidanceScale},defaultValue(){return Q(this.config?.model).guidanceScaleDefault??2.5},value:{get(){let e=this.config?.guidance_scale;return typeof e==`number`?e:this.defaultValue},set(e){let t={...this.config||{}};t.guidance_scale=typeof e==`number`&&e>=1&&e<=10?e:this.defaultValue,this.$store.commit(`seedream/setConfig`,t)}}}}),xt={key:0,class:`field`},St={class:`label`},Ct={class:`box`},wt={class:`title font-bold`},Tt={class:`value`};function Et(e,r,i,a,s,c){let d=h(`info-icon`),f=h(`el-input-number`);return e.supported?(u(),t(`div`,xt,[n(`div`,St,[n(`div`,Ct,[n(`h2`,wt,l(e.$t(`seedream.name.guidanceScale`)),1),o(d,{content:e.$t(`seedream.description.guidanceScale`),class:`info`},null,8,[`content`])])]),n(`div`,Tt,[o(f,{modelValue:e.value,"onUpdate:modelValue":r[0]||=t=>e.value=t,min:1,max:10,step:.1,precision:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):m(``,!0)}var Dt=z(bt,[[`render`,Et],[`__scopeId`,`data-v-7386f064`]]),Ot=r({name:`SeedreamWatermarkSwitch`,components:{ElSwitch:ee,InfoIcon:Z},computed:{value:{get(){let e=this.$store.state.seedream?.config?.watermark;return e===void 0?!1:!!e},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,watermark:e})}}}}),kt={class:`field`},At={class:`label`},jt={class:`box`},Mt={class:`title font-bold`},Nt={class:`value`};function Pt(e,r,i,a,s,c){let d=h(`info-icon`),f=h(`el-switch`);return u(),t(`div`,kt,[n(`div`,At,[n(`div`,jt,[n(`h2`,Mt,l(e.$t(`seedream.name.watermark`)),1),o(d,{content:e.$t(`seedream.description.watermark`),class:`info`},null,8,[`content`])])]),n(`div`,Nt,[o(f,{modelValue:e.value,"onUpdate:modelValue":r[0]||=t=>e.value=t},null,8,[`modelValue`])])])}var Ft=r({name:`SeedreamConfigPanel`,components:{ElButton:v,FontAwesomeIcon:J,PromptInput:Se,Consumption:de,ImageInput:Ie,ModelSelector:Ue,SizeSelector:Xe,MaxImagesSelector:it,OutputFormatSelector:dt,SeedInput:yt,GuidanceScaleInput:Dt,WatermarkSwitch:z(Ot,[[`render`,Pt],[`__scopeId`,`data-v-9e2abf0f`]])},emits:[`generate`],computed:{config(){return this.$store.state.seedream?.config},consumption(){let e={...this.config||{}},t=Array.isArray(e?.image)&&e.image.length>0,n=e?.sequential_image_generation===`auto`?Math.max(1,Math.floor(e?.sequential_image_generation_options?.max_images||1)):1;return H({...e,action:t?`edit`:`generate`,model:j(e?.model),count:n},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),It={class:`flex flex-col h-full`},Lt={class:`flex-1 overflow-y-auto p-5`},Rt={class:`flex flex-col items-center justify-center px-5 pb-5`};function zt(e,r,a,s,c,d){let f=h(`model-selector`),p=h(`size-selector`),m=h(`max-images-selector`),_=h(`output-format-selector`),v=h(`seed-input`),y=h(`guidance-scale-input`),b=h(`watermark-switch`),x=h(`prompt-input`),S=h(`image-input`),C=h(`consumption`),w=h(`font-awesome-icon`),T=h(`el-button`);return u(),t(`div`,It,[n(`div`,Lt,[o(f,{class:`mb-4`}),o(p,{class:`mb-4`}),o(m,{class:`mb-4`}),o(_,{class:`mb-4`}),o(v,{class:`mb-4`}),o(y,{class:`mb-4`}),o(b,{class:`mb-4`}),o(x,{class:`mb-4`}),o(S,{class:`mb-4`})]),n(`div`,Rt,[o(C,{value:e.consumption,service:e.service},null,8,[`value`,`service`]),o(T,{type:`primary`,class:`btn w-full`,round:``,onClick:e.onGenerate},{default:g(()=>[o(w,{icon:`fa-solid fa-magic`,class:`mr-2`}),i(` `+l(e.$t(`seedream.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Bt=z(Ft,[[`render`,zt]]),Vt=r({name:`SeedreamTaskPreview`,components:{ElImage:w,CopyToClipboard:Y,FontAwesomeIcon:J,ElAlert:T,ImageWrapper:pe,ElButton:v,ElTooltip:C,ImagePreview:X,ApiCodeButton:fe},props:{modelValue:{type:Object,required:!0}},computed:{isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return j(e)||e},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit(`seedream/setConfig`,t)}}}),Ht={class:`preview`},Ut={class:`left`},Wt={class:`main`},Gt={class:`bot`},Kt={class:`datetime`},qt={class:`info`},Jt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Yt={key:1,class:`prompt mt-2`},Xt={key:0},Zt={key:0,class:c({content:!0})},Qt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$t={key:1,class:c({content:!0,failed:!0})},en={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},tn={class:c({operations:!0,"mt-2":!0,"mb-2":!0})},nn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},an={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},on={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$={key:2,class:c({content:!0})},ln={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},un={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hn={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},gn={key:3,class:c({content:!0})},_n={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function yn(r,c,f,p,_,v){let y=h(`el-image`),b=h(`image-preview`),x=h(`font-awesome-icon`),S=h(`copy-to-clipboard`),C=h(`el-alert`),w=h(`image-wrapper`),T=h(`el-button`),E=h(`el-tooltip`),D=h(`api-code-button`);return u(),t(`div`,Ht,[n(`div`,Ut,[o(y,{src:`https://cdn.acedata.cloud/9egrbn.png`,class:`avatar`})]),n(`div`,Wt,[n(`div`,Gt,[i(l(r.$t(`seedream.name.seedreamBot`))+` `,1),n(`span`,Kt,l(r.$dayjs.format(``+new Date(parseFloat((r.modelValue?.created_at||``).toString())*1e3))),1)]),n(`div`,qt,[Array.isArray(r.modelValue?.request?.image)&&r.modelValue?.request?.image.length>0?(u(),t(`div`,Jt,[(u(!0),t(s,null,e(r.modelValue?.request?.image,(e,t)=>(u(),a(b,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):m(``,!0),r.modelValue?.request?.prompt?(u(),t(`p`,Yt,[i(l(r.modelValue?.request?.prompt)+` `,1),r.modelValue?.response?m(``,!0):(u(),t(`span`,Xt,` - (`+l(r.$t(`seedream.status.pending`))+`) `,1))])):m(``,!0)]),r.modelValue?.response?r.modelValue?.response?.success===!0?(u(),t(`div`,$t,[n(`div`,en,[(u(!0),t(s,null,e(r.images,(e,t)=>(u(),a(w,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),n(`div`,tn,[o(E,{class:`box-item`,effect:`dark`,content:r.$t(`common.button.edit`),placement:`top-start`},{default:g(()=>[o(T,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=d(e=>r.onEdit(r.images?.[0]?.image_url),[`stop`])},{default:g(()=>[i(l(r.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),o(D,{path:`/seedream/images`,body:r.modelValue?.request},null,8,[`body`])]),o(C,{closable:!1,class:`mt-2 success`},{default:g(()=>[r.modelValue?.request?.model?(u(),t(`p`,nn,[o(x,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.model`))+`: `+l(r.shortModel(r.modelValue?.request?.model)),1)])):m(``,!0),r.modelValue?.request?.size?(u(),t(`p`,rn,[o(x,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.size`))+`: `+l(r.modelValue?.request?.size),1)])):m(``,!0),n(`p`,an,[o(x,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.task`))+`: `+l(r.isEdit?r.$t(`seedream.name.edits`):r.$t(`seedream.name.generate`)),1)]),n(`p`,on,[o(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.taskId`))+`: `+l(r.modelValue?.id)+` `,1),o(S,{content:r.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),r.modelValue?.elapsed?(u(),t(`p`,sn,[o(x,{icon:`fa-solid fa-clock`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.elapsed`))+`: `+l(r.modelValue?.elapsed?.toFixed(2))+`s `,1)])):m(``,!0),r.modelValue?.response?.trace_id?(u(),t(`p`,cn,[o(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.traceId`))+`: `+l(r.modelValue?.response?.trace_id)+` `,1),o(S,{content:r.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):m(``,!0)]),_:1})])):r.modelValue?.response?.success===!1?(u(),t(`div`,$,[o(C,{closable:!1,class:`failure`},{template:g(()=>[o(x,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.failure`)),1)]),default:g(()=>[r.modelValue?.request?.model?(u(),t(`p`,ln,[o(x,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.model`))+`: `+l(r.shortModel(r.modelValue?.request?.model)),1)])):m(``,!0),r.modelValue?.request?.size?(u(),t(`p`,un,[o(x,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.size`))+`: `+l(r.modelValue?.request?.size),1)])):m(``,!0),n(`p`,dn,[o(x,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.task`))+`: `+l(r.isEdit?r.$t(`seedream.name.edits`):r.$t(`seedream.name.generate`)),1)]),n(`p`,fn,[o(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.taskId`))+`: `+l(r.modelValue?.id)+` `,1),o(S,{content:r.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),r.modelValue?.response?.error?.message?(u(),t(`p`,pn,[o(x,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.failureReason`))+`: `+l(r.modelValue?.response?.error?.message)+` `,1),o(S,{content:r.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])])):m(``,!0),r.modelValue?.elapsed?(u(),t(`p`,mn,[o(x,{icon:`fa-solid fa-clock`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.elapsed`))+`: `+l(r.modelValue?.elapsed?.toFixed(2))+`s `,1)])):m(``,!0),r.modelValue?.response?.trace_id?(u(),t(`p`,hn,[o(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.traceId`))+`: `+l(r.modelValue?.response?.trace_id)+` `,1),o(S,{content:r.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):m(``,!0)]),_:1})])):(u(),t(`div`,gn,[o(C,{closable:!1,class:`info`},{template:g(()=>[o(x,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.status`)),1)]),default:g(()=>[n(`p`,_n,[o(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.taskId`))+`: `+l(r.modelValue?.id)+` `,1),o(S,{content:r.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),r.modelValue?.response?.trace_id?(u(),t(`p`,vn,[o(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.traceId`))+`: `+l(r.modelValue?.response?.trace_id)+` `,1),o(S,{content:r.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):m(``,!0)]),_:1})])):(u(),t(`div`,Zt,[o(C,{closable:!1,class:`info`},{template:g(()=>[o(x,{icon:`fa-regular fa-clock`,class:`mr-1`}),i(` `+l(r.$t(`seedream.status.pending`)),1)]),default:g(()=>[n(`p`,Qt,[o(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.taskId`))+`: `+l(r.modelValue?.id)+` `,1),o(S,{content:r.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var bn=r({name:`SeedreamRecentPanel`,components:{TaskPreview:z(Vt,[[`render`,yn],[`__scopeId`,`data-v-1b4654bc`]]),BotPlaceholder:oe,NoTasks:ue,ScrollList:se},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),xn={key:0},Sn={key:2,class:`w-full h-full flex items-center justify-center`};function Cn(n,r,i,c,l,d){let f=h(`bot-placeholder`),p=h(`task-preview`),_=h(`scroll-list`),v=h(`no-tasks`);return u(),t(s,null,[n.tasks?.items===void 0?(u(),t(`div`,xn,[o(f)])):n.tasks?.items?.length&&n.tasks?.items?.length>0?(u(),a(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:n.loading,onReachTop:r[0]||=e=>n.$emit(`reach-top`)},{default:g(()=>[(u(!0),t(s,null,e(n.tasks?.items,e=>(u(),a(p,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):m(``,!0),n.tasks?.items?.length===0?(u(),t(`div`,Sn,[o(v)])):m(``,!0)],64)}var wn=z(bn,[[`render`,Cn]]),Tn=te(`seedream`),En=r({name:`SeedreamIndex`,components:{ConfigPanel:Bt,Layout:ye,RecentPanel:wn},mixins:[G],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===U.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===U.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ce({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`seedream/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`seedream/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`seedream/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!q(this.uploadTracker,e=>this.$t(e),e=>R.warning(e)))return;let e={...this.config||{}};!(Array.isArray(e?.image)&&e.image.length>0)&&`image`in e&&delete e.image,e?.size||delete e.size;let t={...e,callback_url:Tn},n=this.credential?.token;if(!n){console.error(`no token specified`);return}R.info(this.$t(`seedream.message.startingTask`)),B(`seedream`,W.generate(t,{token:n})).then(()=>{R.success(this.$t(`seedream.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?R.error(this.$t(`seedream.message.usedUp`)):R.error(this.$t(`seedream.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Dn(e,t,n,r,i,s){let c=h(`config-panel`),l=h(`recent-panel`),d=h(`layout`);return u(),a(d,null,{config:g(()=>[o(c,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:g(()=>[o(l,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var On=z(En,[[`render`,Dn]]);export{On as default};
|
|
1
|
+
import"./rolldown-runtime--c01j_DQ.js";import{$ as e,A as t,D as n,F as r,N as i,O as a,P as o,S as s,Vt as c,Wt as l,Z as u,b as d,dt as f,et as p,k as m,tt as h,ut as g,v as _}from"./vendor-chart-BJCvKk8-.js";import{t as v}from"./button-DfsQodL-.js";import{n as y,r as b,t as x}from"./select-CIZk9ihC.js";import{t as S}from"./upload-Bwmqeewp.js";import{t as C}from"./tooltip-BLwTovWL.js";import{t as w}from"./image-_ExVBzK6.js";import{t as T}from"./alert-OvnfgMB-.js";import{t as E}from"./drawer-Dpuj2uIl.js";import{t as D}from"./input-number-wRL7m93t.js";import{t as ee}from"./switch-BdOpfax3.js";import{_i as te,an as O,cn as k,dn as A,en as ne,fn as j,in as M,ln as N,on as P,rn as F,sn as I,tn as L}from"./constants-Doj9A7vw.js";import{Ar as R,At as re,Cr as ie,E as z,In as B,Mt as V,Pt as H,br as U,en as W,jt as G,kr as K,kt as q}from"./index-Cmr4LxuY.js";import{t as J}from"./index.es-CqtN0wgr.js";import{t as Y}from"./CopyToClipboard-koQ26Tcr.js";import{t as X}from"./ImagePreview-i57G906Z.js";import{n as ae}from"./taskDrawerMixin-DEgO_R5H.js";import{t as oe}from"./BotPlaceholder-Bio6tWP-.js";import{i as Z,n as se,t as ce}from"./pagination-CvCeL5yB.js";import{n as le,t as ue}from"./NoTasks-DAeqCkUW.js";import{t as de}from"./Consumption-BGQCLo2d.js";import{t as fe}from"./ApiCodeButton-feBeDY_l.js";import{t as pe}from"./ImageWrapper-DgXbFDyb.js";var me=r({name:`LayoutSeedream`,components:{ElDrawer:E,ElButton:v,FontAwesomeIcon:J},mixins:[ae]}),he={class:`main flex flex-row flex-1`},ge={class:`config w-[320px] h-full overflow-y-auto bg-[var(--app-sidebar-bg)] border-r border-[var(--app-border-subtle)]`},_e={class:`result h-full p-6 flex-1 flex flex-col bg-[var(--app-content-bg)]`};function ve(e,r,i,a,s,c){let l=h(`font-awesome-icon`),d=h(`el-button`),m=h(`el-drawer`);return u(),t(`div`,he,[n(`div`,ge,[p(e.$slots,`config`,{},void 0,!0)]),n(`div`,_e,[p(e.$slots,`result`,{},void 0,!0)]),f(o(d,{circle:``,class:`menu`,onClick:r[0]||=t=>e.drawer=!0},{default:g(()=>[o(l,{icon:`fa-solid fa-magic`})]),_:1},512),[[_,!e.tasksEmpty]]),o(m,{modelValue:e.drawer,"onUpdate:modelValue":r[1]||=t=>e.drawer=t,direction:`ltr`,"with-header":!1,size:`340px`,class:`drawer`},{default:g(()=>[p(e.$slots,`config`,{},void 0,!0)]),_:3},8,[`modelValue`])])}var ye=z(me,[[`render`,ve],[`__scopeId`,`data-v-2a1715d6`]]),be=r({name:`SeedreamPromptInput`,components:{PromptTextarea:le},computed:{prompt:{get(){return this.$store.state.seedream?.config?.prompt},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,prompt:e})}}},mounted(){this.prompt||=``}});function xe(e,t,n,r,i,o){let s=h(`prompt-textarea`);return u(),a(s,{modelValue:e.prompt,"onUpdate:modelValue":t[0]||=t=>e.prompt=t,title:e.$t(`seedream.name.prompt`),info:e.$t(`seedream.description.prompt`),placeholder:e.$t(`seedream.placeholder.prompt`)},null,8,[`modelValue`,`title`,`info`,`placeholder`])}var Se=z(be,[[`render`,xe]]),Ce={image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,sizePixelDefault:void 0,groupGeneration:!1,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};function Q(e){switch(e){case P:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`3K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!0,tools:!0};case O:return{image:!0,imageRequired:!1,sizeTiers:[`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case M:return{image:!0,imageRequired:!1,sizeTiers:[`1K`,`2K`,`4K`],sizeAdaptive:!0,sizePixel:!0,groupGeneration:!0,seed:!1,guidanceScale:!1,outputFormat:!1,tools:!1};case F:return{image:!1,imageRequired:!1,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!0,guidanceScale:!0,guidanceScaleDefault:L[F],outputFormat:!1,tools:!1};case I:return{image:!0,imageRequired:!0,sizeTiers:[],sizeAdaptive:!1,sizePixel:!0,sizePixelDefault:`1024x1024`,groupGeneration:!1,seed:!1,guidanceScale:!0,guidanceScaleDefault:L[I],outputFormat:!1,tools:!1};default:return Ce}}var we=[`1K`,`2K`,`3K`,`4K`];function Te(e,t){if(!e)return[];let n=t.model??e.model;if(!n)return[];let r=Q(n),i=[];Array.isArray(e.image)&&e.image.length>0&&!r.image&&i.push({field:`image`,i18nLabel:`seedream.name.imageUrls`});let a=typeof e.size==`string`?e.size:void 0;if(a){let e=a.toUpperCase();(we.includes(e)&&!r.sizeTiers.includes(e)||a===`adaptive`&&!r.sizeAdaptive)&&i.push({field:`size`,i18nLabel:`seedream.name.size`})}return e.sequential_image_generation===`auto`&&!r.groupGeneration&&i.push({field:`sequential_image_generation`,i18nLabel:`seedream.name.maxImages`}),e.seed!==void 0&&e.seed!==null&&!r.seed&&i.push({field:`seed`,i18nLabel:`seedream.name.seed`}),e.guidance_scale!==void 0&&e.guidance_scale!==null&&!r.guidanceScale&&i.push({field:`guidance_scale`,i18nLabel:`seedream.name.guidanceScale`}),e.output_format&&!r.outputFormat&&i.push({field:`output_format`,i18nLabel:`seedream.name.outputFormat`}),Array.isArray(e.tools)&&e.tools.length>0&&!r.tools&&i.push({field:`tools`,i18nLabel:`seedream.name.tools`}),i}function Ee(e,t,n){let r={...e},i=Q(n.model??e.model);for(let e of t)switch(e.field){case`image`:delete r.image;break;case`size`:i.sizePixelDefault?r.size=i.sizePixelDefault:delete r.size;break;case`sequential_image_generation`:r.sequential_image_generation=`disabled`,delete r.sequential_image_generation_options;break;case`seed`:delete r.seed;break;case`guidance_scale`:delete r.guidance_scale;break;case`output_format`:delete r.output_format;break;case`tools`:delete r.tools;break}return r}var De=r({name:`SeedreamImageInput`,components:{ElUpload:S,ElButton:v,InfoIcon:Z,ImagePreview:X,FontAwesomeIcon:J},mixins:[V,re],data(){return{fileList:[],uploadUrl:ie()+`/api/v1/files/`,suppressWatch:!1}},computed:{headers(){return{Authorization:`Bearer ${this.$store.state.token.access}`}},urls(){return this.fileList.map(e=>e?.response?.file_url).filter(e=>!!e)},value(){return this.$store.state.seedream?.config?.image},model(){return this.$store.state.seedream?.config?.model},supported(){return Q(this.model).image}},watch:{value:{immediate:!0,handler(e){if(this.suppressWatch)return;if(!e||e.length===0){let e=(this.fileList||[]).filter(e=>!e?.response?.file_url);this.fileList=e.length?e:[];return}let t=[];e.forEach(e=>{let n=this.fileList.find(t=>t?.response?.file_url===e||t?.url===e);n?t.push(n):t.push({name:e.split(`/`).pop()||e,url:e,status:`success`,percentage:100,response:{file_url:e}})}),(this.fileList||[]).filter(e=>!e?.response?.file_url).forEach(e=>{t.some(t=>t===e||t?.url===e?.url||t?.response?.file_url===e?.response?.file_url)||t.push(e)}),this.fileList=t}}},methods:{onChange(e){if(!e?.url&&e?.raw)try{e.url=URL.createObjectURL(e.raw)}catch{}},onRemove(e){if(e?.url&&typeof e.url==`string`&&e.url.startsWith(`blob:`))try{URL.revokeObjectURL(e.url)}catch{}this.onSetImages()},onExceed(){R.warning(this.$t(`seedream.message.uploadImageExceed`))},onError(){R.error(this.$t(`seedream.message.uploadImageError`))},onSetImages(){let e=this.urls;this.suppressWatch=!0,this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,image:e}),this.$nextTick(()=>{this.suppressWatch=!1})},async onSuccess(e,t){e?.file_url&&(t.url=e.file_url,t.response=e),this.onSetImages()},onRemovePreview(e,t){if(this.fileList.splice(e,1),t?.url&&typeof t.url==`string`&&t.url.startsWith(`blob:`))try{URL.revokeObjectURL(t.url)}catch{}this.onSetImages()}}}),Oe={key:0},ke={class:`field`},Ae={class:`label`},je={class:`box`},Me={class:`title font-bold`},Ne={class:`value`},Pe={class:`file-list mt-2 flex flex-wrap gap-[10px]`};function Fe(r,c,d,f,p,_){let v=h(`info-icon`),y=h(`font-awesome-icon`),b=h(`el-button`),x=h(`el-upload`),S=h(`image-preview`);return r.supported?(u(),t(`div`,Oe,[n(`div`,ke,[n(`div`,Ae,[n(`div`,je,[n(`h2`,Me,l(r.$t(`seedream.name.imageUrls`)),1),o(v,{content:r.$t(`seedream.description.imageUrls`),class:`info`},null,8,[`content`])])]),n(`div`,Ne,[o(x,{ref:`uploader`,"file-list":r.fileList,"onUpdate:fileList":c[0]||=e=>r.fileList=e,accept:`.png,.jpg,.jpeg,.gif,.bmp,.webp`,name:`file`,limit:14,multiple:!0,"show-file-list":!1,action:r.uploadUrl,"on-exceed":r.onExceed,"on-error":r.onError,"on-success":r.onSuccess,"on-change":r.onChange,"on-remove":r.onRemove,headers:r.headers},{default:g(()=>[o(b,{size:`small`,type:`primary`,round:``},{default:g(()=>[o(y,{icon:`fa-solid fa-upload`,class:`mr-1`}),i(` `+l(r.$t(`seedream.button.uploadImageUrls`)),1)]),_:1})]),_:1},8,[`file-list`,`action`,`on-exceed`,`on-error`,`on-success`,`on-change`,`on-remove`,`headers`])])]),n(`div`,Pe,[(u(!0),t(s,null,e(r.fileList,(e,t)=>(u(),a(S,{key:e.uid||e?.response?.file_url||e.url||t,url:e.url||e?.response?.file_url,name:e.name,percentage:e.percentage,onRemove:n=>r.onRemovePreview(t,e)},null,8,[`url`,`name`,`percentage`,`onRemove`]))),128))])])):m(``,!0)}var Ie=z(De,[[`render`,Fe],[`__scopeId`,`data-v-6ef4c2e4`]]),Le=r({name:`SeedreamModelSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:Z},data(){return{revertKey:0,options:[{value:P,label:this.$t(`seedream.model.seedream50`)},{value:O,label:this.$t(`seedream.model.seedream45`)},{value:M,label:this.$t(`seedream.model.seedream40`)},{value:F,label:this.$t(`seedream.model.seedream30t2i`)},{value:I,label:this.$t(`seedream.model.seededit30i2i`)}]}},computed:{value(){return this.$store.state.seedream?.config?.model}},mounted(){this.value||this.applyModel(ne)},methods:{async onChange(e){let t=this.$store.state.seedream?.config||{},n=Te(t,{model:e});if(n.length===0){this.applyModel(e);return}let r=n.map(e=>this.$t(e.i18nLabel)).join(`、`);try{await K.confirm(this.$t(`seedream.message.featureNotSupportedBody`,{fields:r}),this.$t(`seedream.message.featureNotSupportedTitle`),{confirmButtonText:this.$t(`seedream.button.confirmContinue`),cancelButtonText:this.$t(`seedream.button.cancelSwitch`),type:`warning`});let i=Ee({...t,model:e},n,{model:e});this.$store.commit(`seedream/setConfig`,i),R.success(this.$t(`seedream.message.featureRemovedNotice`,{fields:r}))}catch{this.revertKey+=1}},applyModel(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,model:e})}}}),Re={class:`field`},ze={class:`label`},Be={class:`box`},Ve={class:`title font-bold`};function He(r,i,c,d,f,p){let m=h(`info-icon`),_=h(`el-option`),v=h(`el-select`);return u(),t(`div`,Re,[n(`div`,ze,[n(`div`,Be,[n(`h2`,Ve,l(r.$t(`seedream.name.model`)),1),o(m,{content:r.$t(`seedream.description.model`),class:`info`},null,8,[`content`])])]),(u(),a(v,{key:r.revertKey,"model-value":r.value,class:`value`,placeholder:r.$t(`seedream.placeholder.select`),onChange:r.onChange},{default:g(()=>[(u(!0),t(s,null,e(r.options,e=>(u(),a(_,{key:e.value,label:e.label,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`model-value`,`placeholder`,`onChange`]))])}var Ue=z(Le,[[`render`,He],[`__scopeId`,`data-v-8892a12c`]]),We=r({name:`SeedreamSizeSelector`,components:{ElSelect:b,ElOption:x,ElOptionGroup:y,InfoIcon:Z},data(){return{SEEDREAM_SIZE_ADAPTIVE:A,pixelOptions:N}},computed:{model(){return this.$store.state.seedream?.config?.model},capabilities(){return Q(this.model)},value:{get(){return this.$store.state.seedream?.config?.size},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,size:e})}}},watch:{model:{immediate:!0,handler(){if(this.value)return;let e=this.capabilities;e.sizeTiers.length?this.value=e.sizeTiers.includes(`2K`)?`2K`:e.sizeTiers[0]:e.sizePixelDefault&&(this.value=e.sizePixelDefault)}}}}),Ge={class:`field`},Ke={class:`label`},qe={class:`box`},Je={class:`title font-bold`};function Ye(r,i,c,d,f,p){let _=h(`info-icon`),v=h(`el-option`),y=h(`el-option-group`),b=h(`el-select`);return u(),t(`div`,Ge,[n(`div`,Ke,[n(`div`,qe,[n(`h2`,Je,l(r.$t(`seedream.name.size`)),1),o(_,{content:r.$t(`seedream.description.size`),class:`info`},null,8,[`content`])])]),o(b,{modelValue:r.value,"onUpdate:modelValue":i[0]||=e=>r.value=e,class:`value`,placeholder:r.$t(`seedream.placeholder.size`),filterable:``,"allow-create":``,"default-first-option":``},{default:g(()=>[r.capabilities.sizeTiers.length?(u(),a(y,{key:0,label:r.$t(`seedream.size.group.tier`)},{default:g(()=>[(u(!0),t(s,null,e(r.capabilities.sizeTiers,e=>(u(),a(v,{key:e,label:e,value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])):m(``,!0),r.capabilities.sizeAdaptive?(u(),a(y,{key:1,label:r.$t(`seedream.size.group.adaptive`)},{default:g(()=>[(u(),a(v,{key:r.SEEDREAM_SIZE_ADAPTIVE,label:r.$t(`seedream.size.adaptive`),value:r.SEEDREAM_SIZE_ADAPTIVE},null,8,[`label`,`value`]))]),_:1},8,[`label`])):m(``,!0),o(y,{label:r.$t(`seedream.size.group.pixel`)},{default:g(()=>[(u(!0),t(s,null,e(r.pixelOptions,e=>(u(),a(v,{key:e.value,label:`${e.value} (${e.ratio})`,value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`label`])]),_:1},8,[`modelValue`,`placeholder`])])}var Xe=z(We,[[`render`,Ye],[`__scopeId`,`data-v-dd7bd021`]]),Ze=r({name:`SeedreamMaxImagesSelector`,components:{ElInputNumber:D,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).groupGeneration},referenceImageCount(){let e=this.config?.image;return Array.isArray(e)?e.length:0},effectiveMax(){let e=15-this.referenceImageCount;return Math.max(1,Math.min(15,e))},value:{get(){let e=this.config?.sequential_image_generation_options?.max_images;return typeof e==`number`&&e>=1?e:1},set(e){let t={...this.config||{}},n=Math.max(1,Math.min(this.effectiveMax,Math.floor(e||1)));n>1?(t.sequential_image_generation=`auto`,t.sequential_image_generation_options={...t.sequential_image_generation_options||{},max_images:n}):(t.sequential_image_generation=`disabled`,t.sequential_image_generation_options&&delete t.sequential_image_generation_options),this.$store.commit(`seedream/setConfig`,t)}}},watch:{effectiveMax(e){this.value>e&&(this.value=e)}}}),Qe={key:0,class:`field`},$e={class:`label`},et={class:`box`},tt={class:`title font-bold`},nt={class:`value`};function rt(e,r,i,a,s,c){let d=h(`info-icon`),f=h(`el-input-number`);return e.supported?(u(),t(`div`,Qe,[n(`div`,$e,[n(`div`,et,[n(`h2`,tt,l(e.$t(`seedream.name.maxImages`)),1),o(d,{content:e.$t(`seedream.description.maxImages`),class:`info`},null,8,[`content`])])]),n(`div`,nt,[o(f,{modelValue:e.value,"onUpdate:modelValue":r[0]||=t=>e.value=t,min:1,max:e.effectiveMax,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`,`max`])])])):m(``,!0)}var it=z(Ze,[[`render`,rt],[`__scopeId`,`data-v-f079fd20`]]),at=r({name:`SeedreamOutputFormatSelector`,components:{ElSelect:b,ElOption:x,InfoIcon:Z},data(){return{options:[...k]}},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).outputFormat},value:{get(){return this.config?.output_format},set(e){let t={...this.config||{}};t.output_format=e,this.$store.commit(`seedream/setConfig`,t)}}}}),ot={key:0,class:`field`},st={class:`label`},ct={class:`box`},lt={class:`title font-bold`};function ut(r,i,c,d,f,p){let _=h(`info-icon`),v=h(`el-option`),y=h(`el-select`);return r.supported?(u(),t(`div`,ot,[n(`div`,st,[n(`div`,ct,[n(`h2`,lt,l(r.$t(`seedream.name.outputFormat`)),1),o(_,{content:r.$t(`seedream.description.outputFormat`),class:`info`},null,8,[`content`])])]),o(y,{modelValue:r.value,"onUpdate:modelValue":i[0]||=e=>r.value=e,class:`value`,placeholder:r.$t(`seedream.placeholder.select`)},{default:g(()=>[(u(!0),t(s,null,e(r.options,e=>(u(),a(v,{key:e,label:e.toUpperCase(),value:e},null,8,[`label`,`value`]))),128))]),_:1},8,[`modelValue`,`placeholder`])])):m(``,!0)}var dt=z(at,[[`render`,ut],[`__scopeId`,`data-v-69ea4c07`]]),ft=r({name:`SeedreamSeedInput`,components:{ElInputNumber:D,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).seed},value:{get(){let e=this.config?.seed;return typeof e==`number`?e:-1},set(e){let t={...this.config||{}};t.seed=typeof e==`number`&&Number.isInteger(e)?e:-1,this.$store.commit(`seedream/setConfig`,t)}}}}),pt={key:0,class:`field`},mt={class:`label`},ht={class:`box`},gt={class:`title font-bold`},_t={class:`value`};function vt(e,r,i,a,s,c){let d=h(`info-icon`),f=h(`el-input-number`);return e.supported?(u(),t(`div`,pt,[n(`div`,mt,[n(`div`,ht,[n(`h2`,gt,l(e.$t(`seedream.name.seed`)),1),o(d,{content:e.$t(`seedream.description.seed`),class:`info`},null,8,[`content`])])]),n(`div`,_t,[o(f,{modelValue:e.value,"onUpdate:modelValue":r[0]||=t=>e.value=t,min:-1,max:2147483647,step:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):m(``,!0)}var yt=z(ft,[[`render`,vt],[`__scopeId`,`data-v-10cdc1e0`]]),bt=r({name:`SeedreamGuidanceScaleInput`,components:{ElInputNumber:D,InfoIcon:Z},computed:{config(){return this.$store.state.seedream?.config||{}},supported(){return Q(this.config?.model).guidanceScale},defaultValue(){return Q(this.config?.model).guidanceScaleDefault??2.5},value:{get(){let e=this.config?.guidance_scale;return typeof e==`number`?e:this.defaultValue},set(e){let t={...this.config||{}};t.guidance_scale=typeof e==`number`&&e>=1&&e<=10?e:this.defaultValue,this.$store.commit(`seedream/setConfig`,t)}}}}),xt={key:0,class:`field`},St={class:`label`},Ct={class:`box`},wt={class:`title font-bold`},Tt={class:`value`};function Et(e,r,i,a,s,c){let d=h(`info-icon`),f=h(`el-input-number`);return e.supported?(u(),t(`div`,xt,[n(`div`,St,[n(`div`,Ct,[n(`h2`,wt,l(e.$t(`seedream.name.guidanceScale`)),1),o(d,{content:e.$t(`seedream.description.guidanceScale`),class:`info`},null,8,[`content`])])]),n(`div`,Tt,[o(f,{modelValue:e.value,"onUpdate:modelValue":r[0]||=t=>e.value=t,min:1,max:10,step:.1,precision:1,size:`default`,"controls-position":`right`,class:`counter`},null,8,[`modelValue`])])])):m(``,!0)}var Dt=z(bt,[[`render`,Et],[`__scopeId`,`data-v-7386f064`]]),Ot=r({name:`SeedreamWatermarkSwitch`,components:{ElSwitch:ee,InfoIcon:Z},computed:{value:{get(){let e=this.$store.state.seedream?.config?.watermark;return e===void 0?!1:!!e},set(e){this.$store.commit(`seedream/setConfig`,{...this.$store.state.seedream?.config,watermark:e})}}}}),kt={class:`field`},At={class:`label`},jt={class:`box`},Mt={class:`title font-bold`},Nt={class:`value`};function Pt(e,r,i,a,s,c){let d=h(`info-icon`),f=h(`el-switch`);return u(),t(`div`,kt,[n(`div`,At,[n(`div`,jt,[n(`h2`,Mt,l(e.$t(`seedream.name.watermark`)),1),o(d,{content:e.$t(`seedream.description.watermark`),class:`info`},null,8,[`content`])])]),n(`div`,Nt,[o(f,{modelValue:e.value,"onUpdate:modelValue":r[0]||=t=>e.value=t},null,8,[`modelValue`])])])}var Ft=r({name:`SeedreamConfigPanel`,components:{ElButton:v,FontAwesomeIcon:J,PromptInput:Se,Consumption:de,ImageInput:Ie,ModelSelector:Ue,SizeSelector:Xe,MaxImagesSelector:it,OutputFormatSelector:dt,SeedInput:yt,GuidanceScaleInput:Dt,WatermarkSwitch:z(Ot,[[`render`,Pt],[`__scopeId`,`data-v-9e2abf0f`]])},emits:[`generate`],computed:{config(){return this.$store.state.seedream?.config},consumption(){let e={...this.config||{}},t=Array.isArray(e?.image)&&e.image.length>0,n=e?.sequential_image_generation===`auto`?Math.max(1,Math.floor(e?.sequential_image_generation_options?.max_images||1)):1;return H({...e,action:t?`edit`:`generate`,model:j(e?.model),count:n},this.service?.cost)},service(){return this.$store.state.seedream?.service}},methods:{onGenerate(){this.$emit(`generate`)}}}),It={class:`flex flex-col h-full`},Lt={class:`flex-1 overflow-y-auto p-5`},Rt={class:`flex flex-col items-center justify-center px-5 pb-5`};function zt(e,r,a,s,c,d){let f=h(`model-selector`),p=h(`size-selector`),m=h(`max-images-selector`),_=h(`output-format-selector`),v=h(`seed-input`),y=h(`guidance-scale-input`),b=h(`watermark-switch`),x=h(`prompt-input`),S=h(`image-input`),C=h(`consumption`),w=h(`font-awesome-icon`),T=h(`el-button`);return u(),t(`div`,It,[n(`div`,Lt,[o(f,{class:`mb-4`}),o(p,{class:`mb-4`}),o(m,{class:`mb-4`}),o(_,{class:`mb-4`}),o(v,{class:`mb-4`}),o(y,{class:`mb-4`}),o(b,{class:`mb-4`}),o(x,{class:`mb-4`}),o(S,{class:`mb-4`})]),n(`div`,Rt,[o(C,{value:e.consumption,service:e.service},null,8,[`value`,`service`]),o(T,{type:`primary`,class:`btn w-full`,round:``,onClick:e.onGenerate},{default:g(()=>[o(w,{icon:`fa-solid fa-magic`,class:`mr-2`}),i(` `+l(e.$t(`seedream.button.generate`)),1)]),_:1},8,[`onClick`])])])}var Bt=z(Ft,[[`render`,zt]]),Vt=r({name:`SeedreamTaskPreview`,components:{ElImage:w,CopyToClipboard:Y,FontAwesomeIcon:J,ElAlert:T,ImageWrapper:pe,ElButton:v,ElTooltip:C,ImagePreview:X,ApiCodeButton:fe},props:{modelValue:{type:Object,required:!0}},computed:{isEdit(){return Array.isArray(this.modelValue?.request?.image)&&(this.modelValue?.request?.image?.length||0)>0},images(){let e=[];return Array.isArray(this.modelValue?.response?.data)&&this.modelValue?.response?.data?.forEach(t=>{e.push(t)}),e}},methods:{shortModel(e){return j(e)||e},onEdit(e){if(!e)return;console.debug(`Edit image:`,e);let t={...this.$store.state.seedream?.config||{}};t.image=[e],this.$store.commit(`seedream/setConfig`,t)}}}),Ht={class:`preview`},Ut={class:`left`},Wt={class:`main`},Gt={class:`bot`},Kt={class:`datetime`},qt={class:`info`},Jt={key:0,class:`flex justify-start items-center gap-2 mt-2 w-full overflow-x-auto`},Yt={key:1,class:`prompt mt-2`},Xt={key:0},Zt={key:0,class:c({content:!0})},Qt={class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$t={key:1,class:c({content:!0,failed:!0})},en={class:`flex justify-start items-center gap-4 w-full overflow-x-auto`},tn={class:c({operations:!0,"mt-2":!0,"mb-2":!0})},nn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},rn={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},an={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},on={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},sn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},cn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},$={key:2,class:c({content:!0})},ln={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},un={key:1,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},dn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},fn={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},pn={key:2,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},mn={key:3,class:`text-[var(--el-text-color-regular)] text-xs mb-2`},hn={key:4,class:`text-[var(--el-text-color-regular)] text-xs mb-0`},gn={key:3,class:c({content:!0})},_n={class:`text-[var(--el-text-color-regular)] text-xs mb-2`},vn={key:0,class:`text-[var(--el-text-color-regular)] text-xs mb-0`};function yn(r,c,f,p,_,v){let y=h(`el-image`),b=h(`image-preview`),x=h(`font-awesome-icon`),S=h(`copy-to-clipboard`),C=h(`el-alert`),w=h(`image-wrapper`),T=h(`el-button`),E=h(`el-tooltip`),D=h(`api-code-button`);return u(),t(`div`,Ht,[n(`div`,Ut,[o(y,{src:`https://cdn.acedata.cloud/9egrbn.png`,class:`avatar`})]),n(`div`,Wt,[n(`div`,Gt,[i(l(r.$t(`seedream.name.seedreamBot`))+` `,1),n(`span`,Kt,l(r.$dayjs.format(``+new Date(parseFloat((r.modelValue?.created_at||``).toString())*1e3))),1)]),n(`div`,qt,[Array.isArray(r.modelValue?.request?.image)&&r.modelValue?.request?.image.length>0?(u(),t(`div`,Jt,[(u(!0),t(s,null,e(r.modelValue?.request?.image,(e,t)=>(u(),a(b,{key:t,url:e,name:`image-${t+1}`,closable:!1},null,8,[`url`,`name`]))),128))])):m(``,!0),r.modelValue?.request?.prompt?(u(),t(`p`,Yt,[i(l(r.modelValue?.request?.prompt)+` `,1),r.modelValue?.response?m(``,!0):(u(),t(`span`,Xt,` - (`+l(r.$t(`seedream.status.pending`))+`) `,1))])):m(``,!0)]),r.modelValue?.response?r.modelValue?.response?.success===!0?(u(),t(`div`,$t,[n(`div`,en,[(u(!0),t(s,null,e(r.images,(e,t)=>(u(),a(w,{key:t,src:e?.image_url,"raw-src":e?.image_url},null,8,[`src`,`raw-src`]))),128))]),n(`div`,tn,[o(E,{class:`box-item`,effect:`dark`,content:r.$t(`common.button.edit`),placement:`top-start`},{default:g(()=>[o(T,{type:`info`,size:`small`,class:`btn-action`,onClick:c[0]||=d(e=>r.onEdit(r.images?.[0]?.image_url),[`stop`])},{default:g(()=>[i(l(r.$t(`common.button.edit`)),1)]),_:1})]),_:1},8,[`content`]),o(D,{path:`/seedream/images`,body:r.modelValue?.request},null,8,[`body`])]),o(C,{closable:!1,class:`mt-2 success`},{default:g(()=>[r.modelValue?.request?.model?(u(),t(`p`,nn,[o(x,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.model`))+`: `+l(r.shortModel(r.modelValue?.request?.model)),1)])):m(``,!0),r.modelValue?.request?.size?(u(),t(`p`,rn,[o(x,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.size`))+`: `+l(r.modelValue?.request?.size),1)])):m(``,!0),n(`p`,an,[o(x,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.task`))+`: `+l(r.isEdit?r.$t(`seedream.name.edits`):r.$t(`seedream.name.generate`)),1)]),n(`p`,on,[o(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.taskId`))+`: `+l(r.modelValue?.id)+` `,1),o(S,{content:r.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])]),r.modelValue?.elapsed?(u(),t(`p`,sn,[o(x,{icon:`fa-solid fa-clock`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.elapsed`))+`: `+l(r.modelValue?.elapsed?.toFixed(2))+`s `,1)])):m(``,!0),r.modelValue?.response?.trace_id?(u(),t(`p`,cn,[o(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.traceId`))+`: `+l(r.modelValue?.response?.trace_id)+` `,1),o(S,{content:r.modelValue?.response?.trace_id,class:`btn-copy inline-block`},null,8,[`content`])])):m(``,!0)]),_:1})])):r.modelValue?.response?.success===!1?(u(),t(`div`,$,[o(C,{closable:!1,class:`failure`},{template:g(()=>[o(x,{icon:`fa-solid fa-exclamation-triangle`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.failure`)),1)]),default:g(()=>[r.modelValue?.request?.model?(u(),t(`p`,ln,[o(x,{icon:`fa-solid fa-cube`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.model`))+`: `+l(r.shortModel(r.modelValue?.request?.model)),1)])):m(``,!0),r.modelValue?.request?.size?(u(),t(`p`,un,[o(x,{icon:`fa-solid fa-image`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.size`))+`: `+l(r.modelValue?.request?.size),1)])):m(``,!0),n(`p`,dn,[o(x,{icon:`fa-solid fa-bolt`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.task`))+`: `+l(r.isEdit?r.$t(`seedream.name.edits`):r.$t(`seedream.name.generate`)),1)]),n(`p`,fn,[o(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.taskId`))+`: `+l(r.modelValue?.id)+` `,1),o(S,{content:r.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),r.modelValue?.response?.error?.message?(u(),t(`p`,pn,[o(x,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.failureReason`))+`: `+l(r.modelValue?.response?.error?.message)+` `,1),o(S,{content:r.modelValue?.response?.error?.message,class:`btn-copy`},null,8,[`content`])])):m(``,!0),r.modelValue?.elapsed?(u(),t(`p`,mn,[o(x,{icon:`fa-solid fa-clock`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.elapsed`))+`: `+l(r.modelValue?.elapsed?.toFixed(2))+`s `,1)])):m(``,!0),r.modelValue?.response?.trace_id?(u(),t(`p`,hn,[o(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.traceId`))+`: `+l(r.modelValue?.response?.trace_id)+` `,1),o(S,{content:r.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):m(``,!0)]),_:1})])):(u(),t(`div`,gn,[o(C,{closable:!1,class:`info`},{template:g(()=>[o(x,{icon:`fa-solid fa-circle-info`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.status`)),1)]),default:g(()=>[n(`p`,_n,[o(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.taskId`))+`: `+l(r.modelValue?.id)+` `,1),o(S,{content:r.modelValue?.id,class:`btn-copy`},null,8,[`content`])]),r.modelValue?.response?.trace_id?(u(),t(`p`,vn,[o(x,{icon:`fa-solid fa-hashtag`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.traceId`))+`: `+l(r.modelValue?.response?.trace_id)+` `,1),o(S,{content:r.modelValue?.response?.trace_id,class:`btn-copy`},null,8,[`content`])])):m(``,!0)]),_:1})])):(u(),t(`div`,Zt,[o(C,{closable:!1,class:`info`},{template:g(()=>[o(x,{icon:`fa-regular fa-clock`,class:`mr-1`}),i(` `+l(r.$t(`seedream.status.pending`)),1)]),default:g(()=>[n(`p`,Qt,[o(x,{icon:`fa-solid fa-magic`,class:`mr-1`}),i(` `+l(r.$t(`seedream.name.taskId`))+`: `+l(r.modelValue?.id)+` `,1),o(S,{content:r.modelValue?.id,class:`btn-copy inline-block`},null,8,[`content`])])]),_:1})]))])])}var bn=r({name:`SeedreamRecentPanel`,components:{TaskPreview:z(Vt,[[`render`,yn],[`__scopeId`,`data-v-1b4654bc`]]),BotPlaceholder:oe,NoTasks:ue,ScrollList:se},props:{loading:{type:Boolean,default:!1}},emits:[`reach-top`],computed:{tasks(){return{...this.$store.state.seedream?.tasks,items:this.$store.state.seedream?.tasks?.items?.slice()}}},methods:{getScrollElement(){return this.$refs.scrollList?.getScrollElement?.()}}}),xn={key:0},Sn={key:2,class:`w-full h-full flex items-center justify-center`};function Cn(n,r,i,c,l,d){let f=h(`bot-placeholder`),p=h(`task-preview`),_=h(`scroll-list`),v=h(`no-tasks`);return u(),t(s,null,[n.tasks?.items===void 0?(u(),t(`div`,xn,[o(f)])):n.tasks?.items?.length&&n.tasks?.items?.length>0?(u(),a(_,{key:1,ref:`scrollList`,class:`tasks h-full w-full overflow-y-auto`,loading:n.loading,onReachTop:r[0]||=e=>n.$emit(`reach-top`)},{default:g(()=>[(u(!0),t(s,null,e(n.tasks?.items,e=>(u(),a(p,{key:e.id,"model-value":e},null,8,[`model-value`]))),128))]),_:1},8,[`loading`])):m(``,!0),n.tasks?.items?.length===0?(u(),t(`div`,Sn,[o(v)])):m(``,!0)],64)}var wn=z(bn,[[`render`,Cn]]),Tn=te(`seedream`),En=r({name:`SeedreamIndex`,components:{ConfigPanel:Bt,Layout:ye,RecentPanel:wn},mixins:[G],inject:[`initialized`],data(){return{task:void 0,job:0,loading:!1}},computed:{applicationsLoading(){return this.$store.state.seedream?.status?.getApplications===U.Request},tasksLoading(){return this.$store.state.seedream?.status?.getTasks===U.Request},credential(){return this.$store.state.seedream?.credential},config(){return this.$store.state.seedream?.config},application(){return this.$store.state.seedream?.application},tasks(){return this.$store.state.seedream?.tasks}},watch:{tasks:{handler(e,t){e?.items?.length>t?.items?.length&&console.debug(`new tasks detected`)},deep:!0},initialized:{async handler(e){e&&(console.debug(`layout initialized`),await this.onGetTasks(),await this.onScrollDown(),this.job=window.setInterval(()=>{this.onGetTasks()},5e3))},immediate:!0}},async mounted(){await this.onGetService()},async unmounted(){window.clearInterval(this.job)},methods:{async onReachTop(){await ce({tasks:this.tasks,getTasks:()=>this.tasks,loading:this.loading,setLoading:e=>this.loading=e,isBlocked:()=>this.tasksLoading,fetch:e=>this.onGetTasks({createdAtMax:e}),getScrollElement:()=>this.getTasksScrollElement()})},async onGetService(){console.debug(`start onGetService`),await this.$store.dispatch(`seedream/getService`),console.debug(`end onGetService`)},async onGetApplication(){console.debug(`start onGetApplication`),await this.$store.dispatch(`seedream/getApplications`),console.debug(`end onGetApplication`),await this.onGetTasks()},async onScrollDown(){await this.$nextTick();let e=this.getTasksScrollElement();e&&(e.scrollTop=e.scrollHeight)},async onGetTasks(e){if(this.applicationsLoading||this.tasksLoading){console.debug(`loading`);return}console.debug(`start onGetTasks`,e);let{limit:t=20,createdAtMin:n,createdAtMax:r}=e||{};console.debug(`limit`,t,`createdAtMin`,n,`createdAtMax`,r),await this.$store.dispatch(`seedream/getTasks`,{limit:t,createdAtMin:n,createdAtMax:r})},async onGenerate(){if(!q(this.uploadTracker,e=>this.$t(e),e=>R.warning(e)))return;let e={...this.config||{}};!(Array.isArray(e?.image)&&e.image.length>0)&&`image`in e&&delete e.image,e?.size||delete e.size;let t={...e,callback_url:Tn},n=this.credential?.token;if(!n){console.error(`no token specified`);return}R.info(this.$t(`seedream.message.startingTask`)),B(`seedream`,W.generate(t,{token:n})).then(()=>{R.success(this.$t(`seedream.message.startTaskSuccess`))}).catch(e=>{let t=e?.response?.data;t?.error?.code===`used_up`?R.error(this.$t(`seedream.message.usedUp`)):R.error(this.$t(`seedream.message.startTaskFailed`)+(t?.error?.message||``))}).finally(async()=>{setTimeout(async()=>{await this.onGetTasks(),await this.onScrollDown()},1e3)})},getTasksScrollElement(){return this.$refs.recentPanel?.getScrollElement?.()}}});function Dn(e,t,n,r,i,s){let c=h(`config-panel`),l=h(`recent-panel`),d=h(`layout`);return u(),a(d,null,{config:g(()=>[o(c,{onGenerate:e.onGenerate},null,8,[`onGenerate`])]),result:g(()=>[o(l,{ref:`recentPanel`,loading:e.loading,onReachTop:e.onReachTop},null,8,[`loading`,`onReachTop`])]),_:1})}var On=z(En,[[`render`,Dn]]);export{On as default};
|