@runeya/runeya 2.0.158 → 2.0.159
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/agent/index.js +318 -231
- package/agent/index.js.map +1 -1
- package/agent-manager-NR24TCUQ.js +13 -0
- package/chat-MRS24DL3.js +28 -0
- package/{chunk-SVKR7CYU.js → chunk-C3KBWZ24.js} +4 -4
- package/{chunk-TMX3NXMQ.js → chunk-GJ5KN2LL.js} +6 -6
- package/{chunk-DVECWRFG.js → chunk-GPSTFDKW.js} +18 -18
- package/{chunk-L3BEQ75K.js → chunk-JJTSWJXV.js} +5 -5
- package/{chunk-N4ZP7T6L.js → chunk-KNWWJND3.js} +4 -4
- package/{chunk-NV7MBTNW.js → chunk-KWKSPNGO.js} +5 -5
- package/{chunk-EZ35ISYR.js → chunk-LY4HARY5.js} +172 -67
- package/chunk-LY4HARY5.js.map +1 -0
- package/{chunk-ETPXJSVC.js → chunk-UYOJZ34Z.js} +2 -2
- package/{chunk-4HN2AGBV.js → chunk-V7BOVXZI.js} +11 -11
- package/{chunk-N5LP5TPS.js → chunk-YEFYRGSP.js} +2 -2
- package/{chunk-JAMAGUGN.js → chunk-YEZOV6GP.js} +2 -2
- package/{chunk-V7WTXGEJ.js → chunk-ZW4GRZRF.js} +6 -6
- package/{chunk-SGFGQ2EL.js → chunk-ZZZQMQWF.js} +2 -2
- package/{companion-KVAOV52T.js → companion-CGBD5O6Y.js} +9 -9
- package/{desktop-installer-page-DCS2FLA5.js → desktop-installer-page-54PKY3L3.js} +3 -3
- package/{desktop-launcher-ER3J7KAW.js → desktop-launcher-2DWKSS6V.js} +3 -3
- package/{environment-resolver-HT6GTSLA.js → environment-resolver-E7JDNTRO.js} +6 -6
- package/{external-3QTRN4YV.js → external-5I5BUT44.js} +3 -3
- package/index.js +12 -12
- package/{install-gate-WZR3XSN6.js → install-gate-W5D4ZOZK.js} +2 -2
- package/mcp-server/external.js +145 -60
- package/mcp-server/external.js.map +1 -1
- package/mcp-server/index.js +145 -60
- package/mcp-server/index.js.map +1 -1
- package/package.json +1 -1
- package/{project-store-6TFAYAWK.js → project-store-67M34SNQ.js} +7 -7
- package/settings-manager-M5RS5WRM.js +10 -0
- package/{src-DBSSIQC7.js → src-FTYC7P2P.js} +36 -2
- package/{src-F5SK2AL3.js → src-UZX6XOIK.js} +1095 -897
- package/src-UZX6XOIK.js.map +1 -0
- package/{vault-resolver-G3G5YPNG.js → vault-resolver-5Q25S6NI.js} +3 -3
- package/web/assets/{AgentScalarChatInterface.vue-DgXKqqWC.js → AgentScalarChatInterface.vue-DLtiWyFa.js} +1 -1
- package/web/assets/{AgentTerminalPage-B_cExmB6.js → AgentTerminalPage-Ds4QAs67.js} +1 -1
- package/web/assets/{AiChatModals-CNyUOq-o.js → AiChatModals-Ccx5-MPb.js} +1 -1
- package/web/assets/AppLayout--wQ4AU4i.js +1 -0
- package/web/assets/AppLayout-Pi8OZrHN.css +1 -0
- package/web/assets/{AuditPage-C8f1gRUr.js → AuditPage-TlsfnK1U.js} +1 -1
- package/web/assets/{CloudAccountPage-BC45p4uK.js → CloudAccountPage-BuFn-iaB.js} +1 -1
- package/web/assets/{CloudMessagingPage-BCEZdgoe.js → CloudMessagingPage-BcOTKWP1.js} +1 -1
- package/web/assets/{DashboardPage-CGtK_iBU.js → DashboardPage-BLw_tc_p.js} +1 -1
- package/web/assets/{DirectoryPickerDialog-Ciy6QiOl.js → DirectoryPickerDialog-X6P-Gl27.js} +1 -1
- package/web/assets/{EditorIcon-Cx11i-sC.js → EditorIcon-DYGui0zm.js} +1 -1
- package/web/assets/{EnvironmentForm-Dm5RBLw3.js → EnvironmentForm-CNxgYejU.js} +1 -1
- package/web/assets/{EnvironmentFormPage-tEpeq4it.js → EnvironmentFormPage-Cu9tmfeS.js} +1 -1
- package/web/assets/{EnvironmentListPage-D8ppIAWE.js → EnvironmentListPage-RJc8Noj0.js} +1 -1
- package/web/assets/{FlagChip-UumVjPY9.js → FlagChip-DBj0fpJC.js} +1 -1
- package/web/assets/{KanbanBoardPage-CamUcYCQ.js → KanbanBoardPage-CfeFN-sn.js} +3 -3
- package/web/assets/{KanbanListPage-C_DZwAKD.js → KanbanListPage-Bvf_6sKr.js} +1 -1
- package/web/assets/{KnowledgeListPage-BBhzvW-h.js → KnowledgeListPage-8asAbOWR.js} +1 -1
- package/web/assets/{KnowledgePagePage-Bnnhyxfi.js → KnowledgePagePage-CH8ErT7E.js} +1 -1
- package/web/assets/{LaunchProjectPage-BHbOO-qr.js → LaunchProjectPage-Cj4zIh-L.js} +1 -1
- package/web/assets/{LaunchServicesPage-CrKG4CUc.js → LaunchServicesPage-C5yBRgjj.js} +1 -1
- package/web/assets/{LaunchShell-BHgU9IFB.js → LaunchShell-BHRT0Iyo.js} +1 -1
- package/web/assets/{LogViewer-DeTRyWSh.js → LogViewer-B-iEIEx5.js} +1 -1
- package/web/assets/{OrgKeyPrompt-CmHBAJRR.js → OrgKeyPrompt-U4dh8VYn.js} +1 -1
- package/web/assets/{ProcessControls-Bs5rpuyG.js → ProcessControls-DR2mGg4A.js} +1 -1
- package/web/assets/{ProcessDetailPage-BouE6rnn.js → ProcessDetailPage-UdlOtobk.js} +1 -1
- package/web/assets/{ProcessMetrics-DisQYLu6.js → ProcessMetrics-CAiB2nbb.js} +1 -1
- package/web/assets/{ProjectCreateDialog-CK-RH0wb.js → ProjectCreateDialog-JJ_UgVSV.js} +1 -1
- package/web/assets/{ProjectLocationGate-j_EaQ37h.js → ProjectLocationGate-RpWuVQOx.js} +1 -1
- package/web/assets/{ProjectPublishDialog-D7lTBCu_.js → ProjectPublishDialog-DXBAZVgF.js} +1 -1
- package/web/assets/{RandomJobTestPage-D11UxER3.js → RandomJobTestPage-BTyZOdQT.js} +1 -1
- package/web/assets/{ScenarioEditorPage-D0ZyVUSQ.js → ScenarioEditorPage-DO5s-Rb3.js} +1 -1
- package/web/assets/{SendToChatDialog-j61mBTkW.js → SendToChatDialog-jghvXDZk.js} +1 -1
- package/web/assets/{ServiceControlsBar-C2E_SEkD.js → ServiceControlsBar-Bjv9tyyt.js} +1 -1
- package/web/assets/{ServiceDetailPage-m_oJmvYC.js → ServiceDetailPage-DHYpDCfp.js} +1 -1
- package/web/assets/{ServiceFormPage-DyxF-esJ.js → ServiceFormPage-CCXaIoow.js} +1 -1
- package/web/assets/{SettingsPage-BLaufENl.js → SettingsPage-s-668z6W.js} +38 -38
- package/web/assets/{SettingsPage-Dsuzjo8r.css → SettingsPage-x-Rev6ea.css} +1 -1
- package/web/assets/{UnlockPage-BmKWcShW.js → UnlockPage-BNdzhO5C.js} +1 -1
- package/web/assets/{VaultMigrationPage-CScIzmKv.js → VaultMigrationPage-RWmGEMLC.js} +1 -1
- package/web/assets/{VersionBadge-yfgoumwX.js → VersionBadge-Crpf2R7o.js} +1 -1
- package/web/assets/{WikiPage-WQBT7wLD.js → WikiPage-BlemtaAo.js} +1 -1
- package/web/assets/{WikiView-CXXW1EZ1.js → WikiView-Du6Adpd-.js} +1 -1
- package/web/assets/{add-scalar-classes-C4A2C4Db.js → add-scalar-classes-B5tjvEi-.js} +1 -1
- package/web/assets/{agent.store-n7zoFDoU.js → agent.store-5ggNQfb3.js} +1 -1
- package/web/assets/{auth-Bh28S0O0.js → auth-ArDkSMsT.js} +2 -2
- package/web/assets/{cloud-chat.store-C4WdXFzT.js → cloud-chat.store-XJxdooyL.js} +1 -1
- package/web/assets/cloud-client-CMfTrHgZ.js +2 -0
- package/web/assets/{cloud-session-sF4HS72U.js → cloud-session-CHtF1SMt.js} +2 -2
- package/web/assets/dist-CjS_rxe9.js +1 -0
- package/web/assets/{i18n-B8hHo8g2.js → i18n-f_6x1GJ8.js} +2 -2
- package/web/assets/{index-DozDRY7J.css → index-DiXnhxxp.css} +1 -1
- package/web/assets/{index-Ccvk-qRh.js → index-Z4n9BqGD.js} +5 -5
- package/web/assets/{knowledge-host-97o7-gG1.js → knowledge-host-DeJwAH8b.js} +3 -3
- package/web/assets/{modal-BE_ZgM3t.js → modal-Bomcd8xq.js} +1 -1
- package/web/assets/{notification.store-BCON_qHz.js → notification.store-C8qNYGB5.js} +1 -1
- package/web/assets/{project-launch.store-Cd0LhFqV.js → project-launch.store-DBuxvZJr.js} +1 -1
- package/web/assets/{project.store-Doqh_upd.js → project.store-CXP-Oq1W.js} +1 -1
- package/web/assets/{scenario.store-Bttan_98.js → scenario.store-B6TiJlpU.js} +1 -1
- package/web/assets/{service.store-BtPdRbHy.js → service.store-oNOqRX_s.js} +1 -1
- package/web/assets/{settings-scope-BB3H0WrY.js → settings-scope-EYddCMQs.js} +1 -1
- package/web/assets/{settings.store-B51AlAcp.js → settings.store-Dbe4N-TD.js} +1 -1
- package/web/assets/{src-CcVk2-Gw.js → src-B1nAsOcw.js} +1 -1
- package/web/assets/{src-55L4GktS.js → src-BMnPg9V0.js} +1 -1
- package/web/assets/src-BR35jQnn.css +1 -0
- package/web/assets/src-BY3QUJ9Z.css +1 -0
- package/web/assets/src-Cpewe6v-.js +1 -0
- package/web/assets/{trpc-CcVyWYH-.js → trpc-CFd5DIpB.js} +3 -3
- package/web/assets/{useCloudOrg-43CkkppL.js → useCloudOrg-_oj_ijeT.js} +1 -1
- package/web/assets/{useEnvVarAutocomplete-DGB9ZE4S.js → useEnvVarAutocomplete-IIpGvDLc.js} +1 -1
- package/web/assets/{useProjectCatalog-BiDVlcdO.js → useProjectCatalog-DT8MiHr7.js} +1 -1
- package/web/assets/{useProjectCloudOrg-CjDX0EaT.js → useProjectCloudOrg-BgBNXoL1.js} +1 -1
- package/web/assets/{useServiceUrlHost-CVjTMrmw.js → useServiceUrlHost-CzDrWXfO.js} +1 -1
- package/web/assets/uuid-D2uso58z.js +1 -0
- package/web/index.html +19 -19
- package/agent-manager-KDL4JWZN.js +0 -13
- package/chat-H5KZT3O6.js +0 -28
- package/chunk-EZ35ISYR.js.map +0 -1
- package/settings-manager-OTVXDUJS.js +0 -10
- package/src-F5SK2AL3.js.map +0 -1
- package/web/assets/AppLayout-B1-D2-jx.css +0 -1
- package/web/assets/AppLayout-DPNVmCyo.js +0 -1
- package/web/assets/cloud-client-D7GDcRGa.js +0 -2
- package/web/assets/dist-Cx_klvkk.js +0 -1
- package/web/assets/src-16-vEwhK.css +0 -1
- package/web/assets/src-DOziuDw8.css +0 -1
- package/web/assets/src-IxogYJKL.js +0 -1
- package/web/assets/uuid-DfCowYZy.js +0 -1
- /package/{agent-manager-KDL4JWZN.js.map → agent-manager-NR24TCUQ.js.map} +0 -0
- /package/{chat-H5KZT3O6.js.map → chat-MRS24DL3.js.map} +0 -0
- /package/{chunk-SVKR7CYU.js.map → chunk-C3KBWZ24.js.map} +0 -0
- /package/{chunk-TMX3NXMQ.js.map → chunk-GJ5KN2LL.js.map} +0 -0
- /package/{chunk-DVECWRFG.js.map → chunk-GPSTFDKW.js.map} +0 -0
- /package/{chunk-L3BEQ75K.js.map → chunk-JJTSWJXV.js.map} +0 -0
- /package/{chunk-N4ZP7T6L.js.map → chunk-KNWWJND3.js.map} +0 -0
- /package/{chunk-NV7MBTNW.js.map → chunk-KWKSPNGO.js.map} +0 -0
- /package/{chunk-ETPXJSVC.js.map → chunk-UYOJZ34Z.js.map} +0 -0
- /package/{chunk-4HN2AGBV.js.map → chunk-V7BOVXZI.js.map} +0 -0
- /package/{chunk-N5LP5TPS.js.map → chunk-YEFYRGSP.js.map} +0 -0
- /package/{chunk-JAMAGUGN.js.map → chunk-YEZOV6GP.js.map} +0 -0
- /package/{chunk-V7WTXGEJ.js.map → chunk-ZW4GRZRF.js.map} +0 -0
- /package/{chunk-SGFGQ2EL.js.map → chunk-ZZZQMQWF.js.map} +0 -0
- /package/{companion-KVAOV52T.js.map → companion-CGBD5O6Y.js.map} +0 -0
- /package/{desktop-installer-page-DCS2FLA5.js.map → desktop-installer-page-54PKY3L3.js.map} +0 -0
- /package/{desktop-launcher-ER3J7KAW.js.map → desktop-launcher-2DWKSS6V.js.map} +0 -0
- /package/{environment-resolver-HT6GTSLA.js.map → environment-resolver-E7JDNTRO.js.map} +0 -0
- /package/{external-3QTRN4YV.js.map → external-5I5BUT44.js.map} +0 -0
- /package/{install-gate-WZR3XSN6.js.map → install-gate-W5D4ZOZK.js.map} +0 -0
- /package/{project-store-6TFAYAWK.js.map → project-store-67M34SNQ.js.map} +0 -0
- /package/{settings-manager-OTVXDUJS.js.map → settings-manager-M5RS5WRM.js.map} +0 -0
- /package/{src-DBSSIQC7.js.map → src-FTYC7P2P.js.map} +0 -0
- /package/{vault-resolver-G3G5YPNG.js.map → vault-resolver-5Q25S6NI.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e,C as t}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{Ct as n,D as r,E as i,Ht as a,Rt as o,Yt as s,_ as c,b as l,bt as u,ct as ee,en as d,g as f,it as p,k as te,mt as m,nn as h,o as g,qt as _,rn as v,tt as ne,v as y,y as b}from"./runtime-core.esm-bundler-DujKY9QV.js";import{C as x,w as re}from"./runtime-dom.esm-bundler-CyEVRK6B.js";import{n as ie}from"./vue-i18n-o7yraQpR.js";import{n as S}from"./project-launch.store-Cd0LhFqV.js";import{C,J as w,P as ae,U as T,W as oe,Y as E,a as se,dt as ce,ft as D,i as O,k as le,n as ue,r as k,t as A}from"./src-CcVk2-Gw.js";import{t as de}from"./uuid-B2pLMyOM.js";import{n as j,r as fe}from"./project.store-Doqh_upd.js";import{h as pe,l as M,t as me,u as N}from"./dist-Cx_klvkk.js";import{t as P}from"./service.store-BtPdRbHy.js";import{t as F}from"./agent.store-n7zoFDoU.js";import{H as he,U as ge}from"./index-Ccvk-qRh.js";import{t as I}from"./useServiceUrlHost-CVjTMrmw.js";import"./uuid-DfCowYZy.js";import{t as _e}from"./FlagChip-UumVjPY9.js";var L={key:0,class:`env-badge`},R={class:`env-badge__name`},ve=D(te({__name:`EnvironmentBadge`,props:{environmentId:{}},setup(e){let t=e,n=fe(),r=f(()=>n.getById(t.environmentId));function i(e){if(e)return e.startsWith(`#`)?e:`#${e}`}return(e,t)=>r.value?(m(),l(`span`,L,[c(`span`,{class:`env-badge__swatch`,style:h({backgroundColor:i(r.value.bgColor)||i(r.value.color)||`var(--r-primary)`})},null,4),c(`span`,R,v(r.value.name),1)])):b(``,!0)}}),[[`__scopeId`,`data-v-968d7caa`]]),z=150,ye=te({__name:`TagsInput`,props:{modelValue:{},options:{default:()=>[]},placeholder:{default:void 0},inputId:{default:void 0},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`,`change`],setup(n,{emit:r}){let i=n,a=r,o=t([]);function s(e){let t=e.query.trim().toLowerCase(),n=new Set(i.modelValue);o.value=i.options.filter(e=>!n.has(e)&&(!t||e.toLowerCase().includes(t)))}function c(e){a(`update:modelValue`,e),a(`change`,e)}function l(e){c(Array.isArray(e)?e.map(String):[])}function u(e){let t=e.trim();t&&!i.modelValue.includes(t)&&c([...i.modelValue,t])}function ee(e){let t=e.target;u(t.value),t.value=``,o.value=[]}function d(e){let t=e.target;t&&typeof t.value==`string`&&t.value.trim()&&setTimeout(()=>{u(t.value),t.value=``},z)}return(t,r)=>(m(),y(e(O),{"model-value":n.modelValue,multiple:``,suggestions:o.value,"complete-on-focus":!0,placeholder:n.placeholder,"input-id":n.inputId,disabled:n.disabled,"onUpdate:modelValue":l,onComplete:s,onKeydown:x(ee,[`enter`]),onBlur:d},null,8,[`model-value`,`suggestions`,`placeholder`,`input-id`,`disabled`]))}}),be=/^\{\{([^{}]+)\}\}$/,B=/\{\{([^}]+)\}\}/g,V=`environment.`;function xe(e,t){return e.startsWith(V)?t.resolvedEnv[e.slice(12)]||null:t.serviceBuiltins[e]||null}function Se(e,t){let n=e.match(be);return n?xe(n[1],t):null}function Ce(e,t){return e.replace(B,(e,n)=>xe(n,t)??e)}var H={class:`ref-group`},we={class:`ref-option`},U={key:0,class:`ti ti-lock ref-option-secret`},Te={key:1,class:`ref-option-preview`},Ee=40,W=D(te({__name:`VariableRefInput`,props:{modelValue:{},inputId:{},placeholder:{default:``},disabled:{type:Boolean,default:!1},envKeys:{default:()=>[]},meta:{default:()=>({})},resolvedEnv:{default:()=>({})},serviceBuiltins:{default:()=>({})}},emits:[`update:modelValue`,`search`,`focus`,`blur`,`picked`],setup(n,{emit:i}){let o=/\{\{([^}]*)$/,s=n,u=i,{t:ee}=ie(),d=t(``),f=t(``),p=t([]);function te(){let e=d.value.toLowerCase(),t=Object.keys(s.serviceBuiltins).filter(t=>t.toLowerCase().includes(e)).map(e=>`{{${e}}}`),n=s.envKeys.map(e=>`{{environment.${e}}}`);return[...t.length?[{label:ee(`variableRefInput.groupBuiltins`),items:t}]:[],...n.length?[{label:ee(`variableRefInput.groupEnvironment`),items:n}]:[]]}function h(){p.value=te()}a(()=>[s.envKeys,s.serviceBuiltins],h,{deep:!0});function g(e){let t=e.match(be);return t?t[1].replace(/^environment\./,``):e}function ne(e){let t=e.match(be);return!t||!t[1].startsWith(`environment.`)?!1:s.meta[t[1].slice(12)]?.isSecret??!1}function x(e){let t=e.match(be);if(!t)return null;let n=t[1];if(n.startsWith(`environment.`)){let e=s.meta[n.slice(12)];if(!e||e.isSecret)return null}let r=xe(n,{resolvedEnv:s.resolvedEnv,serviceBuiltins:s.serviceBuiltins});return r?re(r):null}function re(e){return e.length>Ee?`${e.slice(0,Ee)}…`:e}function S(e){if(f.value=e.query,C)C=!1,d.value=``;else{let t=e.query.match(o),n=t?t[1]:e.query;d.value=n.replace(/^(environment|service)\./,``).trim()}u(`search`,d.value),h()}let C=!1;function w(){C=!0,u(`focus`)}function ae(e){let t=f.value,n=t.lastIndexOf(`{{`);u(`update:modelValue`,n===-1?e:t.slice(0,n)+e),u(`picked`)}return(t,i)=>(m(),y(e(O),{"input-id":n.inputId,"model-value":n.modelValue,suggestions:p.value,"option-group-label":`label`,"option-group-children":`items`,placeholder:n.placeholder,class:`w-full`,"complete-on-focus":``,disabled:n.disabled,"onUpdate:modelValue":i[0]||=e=>u(`update:modelValue`,e),onComplete:S,onItemSelect:i[1]||=e=>ae(e.value),onFocus:w,onBlur:i[2]||=e=>u(`blur`)},{optiongroup:_(({option:e})=>[c(`span`,H,v(e.label),1)]),option:_(({option:t})=>[c(`span`,we,[r(e(T),{severity:`secondary`,value:g(t)},null,8,[`value`]),ne(t)?(m(),l(`i`,U)):x(t)?(m(),l(`span`,Te,v(x(t)),1)):b(``,!0)])]),_:1},8,[`input-id`,`model-value`,`suggestions`,`placeholder`,`disabled`]))}}),[[`__scopeId`,`data-v-2247bb09`]]);function G(e){let t=!1,n=!1;return async function r(){if(t){n=!0;return}t=!0;try{await e()}finally{t=!1,n&&(n=!1,await r())}}}var K={class:`key-row`},De={class:`expansion-field expansion-field--key`},Oe=[`for`],ke={key:2,class:`value-display`},Ae={key:0,class:`key-row-delete`},je={key:0,class:`flags-row`},Me={key:1,class:`expansion-field expansion-field--tags`},Ne={class:`expansion-label`,for:`varrow-tags-input`},Pe={key:1,class:`tags-display`},Fe={key:2,class:`not-secret-warning`},Ie={key:4,class:`expansion-field expansion-field--description`},Le={class:`expansion-label`},Re={key:5,class:`not-secret-warning`},ze={key:7,class:`expansion-section`},Be={class:`section-header`},Ve={class:`section-title`},He={class:`section-fields`},Ue={class:`expansion-field expansion-field--prepost`},We={class:`expansion-label`,for:`varrow-prefix`},Ge={key:2,class:`value-display`},Ke={class:`expansion-field expansion-field--value`},qe=[`for`],Je=[`aria-label`],Ye={class:`value-help`},Xe={class:`value-help__title`},Ze={class:`value-help__line`},Qe={class:`value-help__line value-help__line--muted`},$e={class:`value-help__subtitle`},et={class:`value-help__builtins`},tt={class:`value-help__line value-help__line--muted`},nt={key:0,class:`secret-input-wrap`},rt=[`disabled`],it=[`title`],at={key:1,class:`value-display value-display--with-actions`},ot={key:0,class:`value-actions`},st={key:0},ct={key:1},lt={class:`expansion-field expansion-field--prepost`},ut={class:`expansion-label`,for:`varrow-suffix`},dt={key:2,class:`value-display`},ft={key:0,class:`preview-value`},pt={key:0,class:`prepost-part prepost-part--pre`},mt={key:1,class:`prepost-part prepost-part--interpolation`},ht={class:`prepost-part--value prepost-resolved-inline`},gt=[`title`],_t={key:2,class:`prepost-part prepost-part--value`},vt={key:3,class:`prepost-part prepost-part--post`},yt={key:9,class:`expansion-section expansion-section--override`},bt={class:`section-header`},xt={class:`section-title`},St={class:`ti ti-info-circle section-title__info`},Ct={class:`section-fields`},wt={class:`expansion-field expansion-field--prepost`},Tt={class:`expansion-label`,for:`varrow-override-prefix`},Et={class:`expansion-field expansion-field--value`},Dt=[`for`],Ot={key:0,class:`secret-input-wrap`},kt=[`disabled`],At=[`title`],jt={class:`expansion-field expansion-field--prepost`},Mt={class:`expansion-label`,for:`varrow-override-suffix`},Nt={key:1,class:`override-view`},Pt={key:0,class:`value-display--with-actions`},Ft={class:`value-actions`},It={key:0,class:`override-value-masked`},Lt={key:1,class:`override-value`},Rt={key:1,class:`override-value`},zt={key:1,class:`override-empty`},Bt={key:0,class:`preview-value preview-value--override`},Vt={key:0,class:`prepost-part prepost-part--pre`},Ht={key:1,class:`prepost-part prepost-part--interpolation`},Ut={key:0,class:`prepost-part--value prepost-resolved-inline`},Wt={key:2,class:`prepost-part prepost-part--value`},Gt={key:3,class:`prepost-part prepost-part--post`},Kt=`{{environment.KEY}}`,qt=D(te({__name:`VariableRowEditor`,props:{environmentId:{},variableId:{},overrides:{},editable:{type:Boolean,default:!0},showOverrides:{type:Boolean,default:!1},canEditSource:{type:Boolean,default:!1},showDelete:{type:Boolean,default:!0},showOverrideBadge:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},resolvedEnv:{default:()=>({})},autocompleteEnabled:{type:Boolean,default:!1},autocompleteSuggestions:{default:()=>[]},autocompleteMeta:{default:()=>({})},serviceBuiltins:{default:()=>({})},isPending:{type:Boolean,default:!1},knownTags:{default:()=>[]}},emits:[`deleted`,`saved`,`autocomplete-search`,`override-changed`,`edit-source`],setup(p,{emit:te}){let h=p,x=te,S=fe(),oe=ae(),{t:E}=ie(),se=t(!1),D=t(!1),le=t(!1),ue=t(!1),k=t(!1),A=t(!1),de=t(null);function j(e,t){navigator.clipboard.writeText(t),de.value=e,setTimeout(()=>{de.value===e&&(de.value=null)},1500)}let pe=f(()=>S.getById(h.environmentId)?.variables?.[h.variableId]),M=t(``),N=t(``),P=t(``),F=t(``),I=t(!1),L=t(!1),R=t(!1),ve=t(!1),z=t(!1),B=t(``),V=t([]),xe=t(!1),H=t(!1),we=t(!1),U=f(()=>xe.value||!!B.value),Te=o(`descriptionEditor`);async function Ee(){xe.value=!0,await ne(),Te.value?.focus?.()}let qt=f(()=>rn(N.value)),q=f(()=>I.value&&!qt.value),Jt=f({get:()=>L.value||R.value,set:e=>{L.value=e}}),Yt=f(()=>R.value?E(`variableRowEditor.shareWithAiHintInjected`):q.value?E(`variableRowEditor.shareWithAiHint`):E(`variableRowEditor.shareWithAiHintPublic`)),Xt=f(()=>h.disabled||z.value);function Zt(){let e=pe.value;M.value=e?.key??``,N.value=e?.value?.value??``,P.value=e?.value?.pre??``,F.value=e?.value?.post??``,I.value=e?.value?.isSecret??!1,L.value=e?.value?.shareWithAi??!1,R.value=e?.value?.injectIntoAi??!1,ve.value=e?.value?.required??!1,z.value=e?.value?.overrideOnly??!1,xe.value=!1,H.value=!1,we.value=!1,B.value=e?.value?.description??``,V.value=[...e?.tags??[]]}function Qt(){z.value&&(N.value=``),Q()}ee(Zt),a(pe,(e,t)=>{!t&&e&&Zt()});let J=f(()=>h.overrides[h.variableId]??null),$t=f(()=>!J.value||H.value),en=f(()=>!h.editable||!!J.value||z.value||we.value);async function tn(){we.value=!0,await ne(),document.querySelector(`#varrow-override-value-secret, #varrow-override-value-plain`)?.focus()}let Y=t(``),X=t(``),Z=t(``);function nn(){let e=J.value;Y.value=e?.pre??``,X.value=e?.value??``,Z.value=e?.post??``}ee(nn),a(J,nn);function rn(e){return be.test(e)}function an(e){let t=e.match(be);return t?t[1].replace(/^environment\./,``):e}let on=f(()=>({resolvedEnv:h.resolvedEnv,serviceBuiltins:h.serviceBuiltins}));function sn(e){return Ce(e,on.value)}function cn(e){return Se(e,on.value)}function ln(e){let t=e.value;M.value=t,N.value=`{{environment.${t}}}`,I.value=!1;let n=h.autocompleteMeta?.[t];n&&(P.value=n.pre,F.value=n.post),Q()}let un=t(null),dn=f(()=>me.map(e=>({ref:`{{${e.name}}}`,desc:E(`builtins.${e.descriptionKey}`)}))),Q=G(async()=>{if(D.value)return;let e=M.value.trim();if(e){se.value=!0;try{await S.upsertVariable(h.environmentId,h.variableId,{key:e,...V.value.length?{tags:V.value}:{},value:{value:N.value,pre:P.value,post:F.value,isSecret:q.value,shareWithAi:L.value,injectIntoAi:R.value,required:ve.value,overrideOnly:z.value,description:B.value}}),h.isPending&&x(`saved`)}catch(e){oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.saveError`),life:4e3})}finally{se.value=!1}}});async function fn(){if(D.value=!0,h.isPending){x(`deleted`);return}se.value=!0;try{J.value&&await S.removeOverride(h.variableId),await S.removeVariable(h.environmentId,h.variableId),x(`deleted`)}catch(e){D.value=!1,oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.deleteError`),life:4e3})}finally{se.value=!1}}async function $(){let e=Y.value||X.value||Z.value;try{if(!e){J.value&&(await S.removeOverride(h.variableId),x(`override-changed`));return}await S.setOverride(h.variableId,{value:{value:X.value,pre:Y.value,post:Z.value}}),x(`override-changed`)}catch(e){oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.overrideError`),life:4e3})}}async function pn(){try{await S.removeOverride(h.variableId),x(`override-changed`)}catch(e){oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.clearOverrideError`),life:4e3})}}function mn(e){let t=e.relatedTarget;(!t||!e.currentTarget.contains(t))&&Q()}return(t,a)=>{let o=n(`tooltip`);return m(),l(`div`,{class:`expansion-form`,onFocusout:mn},[c(`div`,K,[c(`div`,De,[c(`label`,{class:`expansion-label`,for:p.editable&&p.autocompleteEnabled?`varrow-key-ac`:`varrow-key-input`},v(e(E)(`common.key`)),9,Oe),p.editable&&p.autocompleteEnabled?(m(),y(e(O),{key:0,"input-id":`varrow-key-ac`,modelValue:M.value,"onUpdate:modelValue":a[0]||=e=>M.value=e,suggestions:p.autocompleteSuggestions,placeholder:e(E)(`variableRowEditor.variableNamePlaceholder`),class:`w-full`,disabled:p.disabled,onComplete:a[1]||=e=>x(`autocomplete-search`,e.query),onItemSelect:ln,onBlur:e(Q)},null,8,[`modelValue`,`suggestions`,`placeholder`,`disabled`,`onBlur`])):p.editable?(m(),y(e(w),{key:1,id:`varrow-key-input`,modelValue:M.value,"onUpdate:modelValue":a[2]||=e=>M.value=e,placeholder:e(E)(`variableRowEditor.variableNamePlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(m(),l(`code`,ke,v(M.value),1))]),p.showDelete&&p.editable?(m(),l(`div`,Ae,[r(e(ce),{icon:`ti ti-trash`,severity:`danger`,variant:`text`,rounded:``,size:`small`,disabled:p.disabled||se.value,onClick:fn},null,8,[`disabled`])])):b(``,!0)]),p.editable?(m(),l(`div`,je,[qt.value?b(``,!0):(m(),y(_e,{key:0,modelValue:I.value,"onUpdate:modelValue":[a[3]||=e=>I.value=e,e(Q)],label:e(E)(`variableRowEditor.secret`),icon:`ti ti-lock`,hint:e(E)(`variableRowEditor.secretHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`])),r(_e,{modelValue:Jt.value,"onUpdate:modelValue":[a[4]||=e=>Jt.value=e,e(Q)],label:e(E)(`variableRowEditor.shareWithAi`),icon:`ti ti-eye`,hint:Yt.value,locked:R.value,disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`locked`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:R.value,"onUpdate:modelValue":[a[5]||=e=>R.value=e,e(Q)],label:e(E)(`variableRowEditor.injectIntoAi`),icon:`ti ti-login`,hint:e(E)(`variableRowEditor.injectIntoAiHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:ve.value,"onUpdate:modelValue":[a[6]||=e=>ve.value=e,e(Q)],label:e(E)(`variableRowEditor.required`),icon:`ti ti-asterisk`,hint:e(E)(`variableRowEditor.requiredHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:z.value,"onUpdate:modelValue":[a[7]||=e=>z.value=e,Qt],label:e(E)(`variableRowEditor.overrideOnly`),icon:`ti ti-device-desktop`,hint:e(E)(`variableRowEditor.overrideOnlyHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`])])):b(``,!0),p.editable||V.value.length?(m(),l(`div`,Me,[c(`label`,Ne,v(e(E)(`variableRowEditor.tags`)),1),p.editable?(m(),y(ye,{key:0,modelValue:V.value,"onUpdate:modelValue":a[8]||=e=>V.value=e,"input-id":`varrow-tags-input`,options:p.knownTags,placeholder:e(E)(`variableRowEditor.tagsPlaceholder`),disabled:p.disabled,onChange:e(Q)},null,8,[`modelValue`,`options`,`placeholder`,`disabled`,`onChange`])):(m(),l(`div`,Pe,[(m(!0),l(g,null,u(V.value,t=>(m(),y(e(T),{key:t,severity:`secondary`,value:t},null,8,[`value`]))),128))]))])):b(``,!0),p.editable&&!I.value&&!rn(N.value)?(m(),l(`div`,Fe,[a[60]||=c(`i`,{class:`ti ti-info-circle`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.notSecretWarning`)),1)])):b(``,!0),p.editable&&!U.value?(m(),l(`button`,{key:3,type:`button`,class:`add-section-btn`,onClick:Ee},[a[61]||=c(`i`,{class:`ti ti-plus`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.addDescription`)),1)])):b(``,!0),U.value?(m(),l(`div`,Ie,[c(`label`,Le,v(e(E)(`variableRowEditor.description`)),1),r(e(ge),{ref_key:`descriptionEditor`,ref:Te,modelValue:B.value,"onUpdate:modelValue":a[9]||=e=>B.value=e,markdown:``,"min-height":`4rem`,"max-height":`14rem`,editable:p.editable&&!p.disabled,placeholder:e(E)(`variableRowEditor.descriptionPlaceholder`),onLinkClick:e(he)},null,8,[`modelValue`,`editable`,`placeholder`,`onLinkClick`])])):b(``,!0),p.editable&&z.value?(m(),l(`div`,Re,[a[62]||=c(`i`,{class:`ti ti-info-circle`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.overrideOnlyNotice`)),1)])):b(``,!0),$t.value?b(``,!0):(m(),l(`button`,{key:6,type:`button`,class:`add-section-btn`,onClick:a[10]||=e=>H.value=!0},[a[63]||=c(`i`,{class:`ti ti-chevron-right`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.showSharedValue`)),1)])),$t.value?(m(),l(`div`,ze,[c(`div`,Be,[c(`div`,Ve,v(e(E)(`variableRowEditor.value`)),1),J.value?(m(),l(`button`,{key:0,type:`button`,class:`add-section-btn`,onClick:a[11]||=e=>H.value=!1},[a[64]||=c(`i`,{class:`ti ti-chevron-up`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.hideSharedValue`)),1)])):b(``,!0)]),c(`div`,He,[c(`div`,Ue,[c(`label`,We,v(e(E)(`variableRowEditor.prefix`)),1),p.editable&&p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-prefix`,modelValue:P.value,"onUpdate:modelValue":a[12]||=e=>P.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[13]||=e=>x(`autocomplete-search`,e),onBlur:a[14]||=t=>e(Q)(),onPicked:a[15]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):p.editable?(m(),y(e(w),{key:1,id:`varrow-prefix`,modelValue:P.value,"onUpdate:modelValue":a[16]||=e=>P.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(m(),l(`code`,Ge,v(P.value||`—`),1))]),c(`div`,Ke,[c(`label`,{class:`expansion-label`,for:q.value?`varrow-value-secret`:`varrow-value-plain`},[i(v(e(E)(`variableRowEditor.value`))+` `,1),p.editable?(m(),l(`button`,{key:0,type:`button`,class:`value-help-btn`,"aria-label":e(E)(`variableRowEditor.helpTitle`),onClick:a[17]||=re(e=>un.value?.toggle(e),[`prevent`,`stop`])},[...a[65]||=[c(`i`,{class:`ti ti-info-circle`},null,-1)]],8,Je)):b(``,!0)],8,qe),r(e(C),{ref_key:`valueHelp`,ref:un},{default:_(()=>[c(`div`,Ye,[c(`div`,Xe,v(e(E)(`variableRowEditor.helpTitle`)),1),c(`p`,Ze,[i(v(e(E)(`variableRowEditor.helpReference`))+` `,1),c(`code`,null,v(Kt))]),c(`p`,Qe,v(e(E)(`variableRowEditor.helpAutocomplete`)),1),c(`div`,$e,v(e(E)(`variableRowEditor.helpBuiltinsTitle`)),1),c(`ul`,et,[(m(!0),l(g,null,u(dn.value,e=>(m(),l(`li`,{key:e.ref},[c(`code`,null,v(e.ref),1),c(`span`,null,v(e.desc),1)]))),128))]),c(`p`,tt,v(e(E)(`variableRowEditor.helpPrePost`)),1)])]),_:1},512),p.editable?(m(),l(g,{key:0},[q.value?(m(),l(`div`,nt,[r(e(w),{id:`varrow-value-secret`,modelValue:N.value,"onUpdate:modelValue":a[18]||=e=>N.value=e,type:k.value?`text`:`password`,placeholder:e(E)(`variableRowEditor.valuePlaceholder`),class:`w-full`,disabled:Xt.value,onBlur:e(Q)},null,8,[`modelValue`,`type`,`placeholder`,`disabled`,`onBlur`]),c(`button`,{type:`button`,class:`secret-toggle`,disabled:p.disabled,onClick:a[19]||=e=>k.value=!k.value,tabindex:`-1`},[c(`i`,{class:d(k.value?`ti ti-eye-off`:`ti ti-eye`)},null,2)],8,rt)])):rn(N.value)&&!le.value?(m(),l(`span`,{key:1,class:`interpolation-badge`,title:N.value,onClick:a[20]||=e=>le.value=!0},[r(e(T),{severity:`secondary`,value:an(N.value)},null,8,[`value`]),a[66]||=c(`i`,{class:`ti ti-pencil interpolation-edit-icon`},null,-1)],8,it)):p.autocompleteEnabled?(m(),y(W,{key:2,"input-id":`varrow-value-plain`,modelValue:N.value,"onUpdate:modelValue":a[21]||=e=>N.value=e,placeholder:e(E)(`variableRowEditor.valuePlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:Xt.value,onSearch:a[22]||=e=>x(`autocomplete-search`,e),onFocus:a[23]||=e=>le.value=!0,onBlur:a[24]||=t=>{le.value=!1,e(Q)()},onPicked:a[25]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:3,id:`varrow-value-plain`,modelValue:N.value,"onUpdate:modelValue":a[26]||=e=>N.value=e,placeholder:e(E)(`variableRowEditor.valuePlaceholder`),class:`w-full`,disabled:Xt.value,onFocus:a[27]||=e=>le.value=!0,onBlur:a[28]||=t=>{le.value=!1,e(Q)()}},null,8,[`modelValue`,`placeholder`,`disabled`]))],64)):(m(),l(`span`,at,[N.value?(m(),l(`span`,ot,[q.value?(m(),l(`i`,{key:0,class:d([k.value?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),onClick:a[29]||=e=>k.value=!k.value},null,2)):b(``,!0),c(`i`,{class:d([de.value===`val`?`ti ti-check`:`ti ti-copy`,`action-icon`]),onClick:a[30]||=e=>j(`val`,P.value+N.value+F.value)},null,2)])):b(``,!0),rn(N.value)?(m(),y(e(T),{key:1,severity:`secondary`,value:an(N.value)},null,8,[`value`])):q.value?(m(),l(g,{key:2},[k.value?(m(),l(`span`,ct,v(N.value),1)):(m(),l(`span`,st,`***`))],64)):(m(),l(g,{key:3},[i(v(N.value),1)],64))]))]),c(`div`,lt,[c(`label`,ut,v(e(E)(`variableRowEditor.suffix`)),1),p.editable&&p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-suffix`,modelValue:F.value,"onUpdate:modelValue":a[31]||=e=>F.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[32]||=e=>x(`autocomplete-search`,e),onBlur:a[33]||=t=>e(Q)(),onPicked:a[34]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):p.editable?(m(),y(e(w),{key:1,id:`varrow-suffix`,modelValue:F.value,"onUpdate:modelValue":a[35]||=e=>F.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(m(),l(`code`,dt,v(F.value||`—`),1))])]),q.value?b(``,!0):(m(),l(`code`,ft,[P.value?(m(),l(`span`,pt,v(sn(P.value)),1)):b(``,!0),rn(N.value)?(m(),l(`span`,mt,[cn(N.value)==null?(m(),l(g,{key:1},[r(e(T),{severity:`secondary`,value:an(N.value),style:{"font-size":`0.7rem`}},null,8,[`value`]),a[67]||=c(`span`,{class:`prepost-unresolved`},`(?)`,-1)],64)):(m(),l(g,{key:0},[c(`span`,ht,v(cn(N.value)),1),p.canEditSource?(m(),l(`i`,{key:0,class:`ti ti-pencil edit-source-icon`,title:e(E)(`variablesTable.editParentTitle`),onClick:a[36]||=re(e=>x(`edit-source`),[`stop`])},null,8,gt)):b(``,!0)],64))])):(m(),l(`span`,_t,v(sn(N.value)||`…`),1)),F.value?(m(),l(`span`,vt,v(sn(F.value)),1)):b(``,!0)]))])):b(``,!0),p.showOverrides&&M.value?.trim()&&p.editable&&!en.value?(m(),l(`button`,{key:8,type:`button`,class:`add-section-btn`,onClick:tn},[a[68]||=c(`i`,{class:`ti ti-plus`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.addOverride`)),1)])):b(``,!0),p.showOverrides&&M.value?.trim()&&en.value?(m(),l(`div`,yt,[c(`div`,bt,[c(`div`,xt,[i(v(e(E)(`variableRowEditor.localOverride`))+` `,1),s(c(`i`,St,null,512),[[o,{value:e(E)(`variableRowEditor.localOverrideHint`),showDelay:0,hideDelay:0},void 0,{top:!0}]])]),p.editable&&J.value?(m(),y(e(ce),{key:0,icon:`ti ti-x`,variant:`text`,rounded:``,size:`small`,severity:`danger`,title:e(E)(`variableRowEditor.clearOverride`),disabled:p.disabled,onClick:pn},null,8,[`title`,`disabled`])):b(``,!0)]),c(`div`,Ct,[p.editable?(m(),l(g,{key:0},[c(`div`,wt,[c(`label`,Tt,v(e(E)(`variableRowEditor.prefix`)),1),p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-override-prefix`,modelValue:Y.value,"onUpdate:modelValue":a[37]||=e=>Y.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[38]||=e=>x(`autocomplete-search`,e),onBlur:a[39]||=e=>$(),onPicked:a[40]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:1,id:`varrow-override-prefix`,modelValue:Y.value,"onUpdate:modelValue":a[41]||=e=>Y.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`placeholder`,`disabled`]))]),c(`div`,Et,[c(`label`,{class:`expansion-label`,for:q.value?`varrow-override-value-secret`:`varrow-override-value-plain`},v(e(E)(`variableRowEditor.value`)),9,Dt),q.value?(m(),l(`div`,Ot,[r(e(w),{id:`varrow-override-value-secret`,modelValue:X.value,"onUpdate:modelValue":a[42]||=e=>X.value=e,type:A.value?`text`:`password`,placeholder:e(E)(`variableRowEditor.overrideValuePlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`type`,`placeholder`,`disabled`]),c(`button`,{type:`button`,class:`secret-toggle`,disabled:p.disabled,onClick:a[43]||=e=>A.value=!A.value,tabindex:`-1`},[c(`i`,{class:d(A.value?`ti ti-eye-off`:`ti ti-eye`)},null,2)],8,kt)])):rn(X.value)&&!ue.value?(m(),l(`span`,{key:1,class:`interpolation-badge`,title:X.value,onClick:a[44]||=e=>ue.value=!0},[r(e(T),{severity:`secondary`,value:an(X.value)},null,8,[`value`]),a[69]||=c(`i`,{class:`ti ti-pencil interpolation-edit-icon`},null,-1)],8,At)):p.autocompleteEnabled?(m(),y(W,{key:2,"input-id":`varrow-override-value-plain`,modelValue:X.value,"onUpdate:modelValue":a[45]||=e=>X.value=e,placeholder:e(E)(`variableRowEditor.overrideValuePlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[46]||=e=>x(`autocomplete-search`,e),onFocus:a[47]||=e=>ue.value=!0,onBlur:a[48]||=e=>{ue.value=!1,$()},onPicked:a[49]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:3,id:`varrow-override-value-plain`,modelValue:X.value,"onUpdate:modelValue":a[50]||=e=>X.value=e,placeholder:e(E)(`variableRowEditor.overrideValuePlaceholder`),class:`w-full`,disabled:p.disabled,onFocus:a[51]||=e=>ue.value=!0,onBlur:a[52]||=e=>{ue.value=!1,$()}},null,8,[`modelValue`,`placeholder`,`disabled`]))]),c(`div`,jt,[c(`label`,Mt,v(e(E)(`variableRowEditor.suffix`)),1),p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-override-suffix`,modelValue:Z.value,"onUpdate:modelValue":a[53]||=e=>Z.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[54]||=e=>x(`autocomplete-search`,e),onBlur:a[55]||=e=>$(),onPicked:a[56]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:1,id:`varrow-override-suffix`,modelValue:Z.value,"onUpdate:modelValue":a[57]||=e=>Z.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`placeholder`,`disabled`]))])],64)):(m(),l(`div`,Nt,[J.value?(m(),l(`span`,Pt,[c(`span`,Ft,[q.value||J.value.isSecret?(m(),l(`i`,{key:0,class:d([A.value?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),onClick:a[58]||=e=>A.value=!A.value},null,2)):b(``,!0),c(`i`,{class:d([de.value===`ovr`?`ti ti-check`:`ti ti-copy`,`action-icon`]),onClick:a[59]||=e=>j(`ovr`,J.value.pre+J.value.value+J.value.post)},null,2)]),q.value||J.value.isSecret?(m(),l(g,{key:0},[A.value?(m(),l(`code`,Lt,v(J.value.pre)+v(J.value.value)+v(J.value.post),1)):(m(),l(`span`,It,`***`))],64)):(m(),l(`code`,Rt,v(J.value.pre)+v(J.value.value)+v(J.value.post),1))])):(m(),l(`span`,zt,`—`))]))]),p.editable&&!q.value&&(Y.value||X.value||Z.value)?(m(),l(`code`,Bt,[Y.value?(m(),l(`span`,Vt,v(sn(Y.value)),1)):b(``,!0),rn(X.value)?(m(),l(`span`,Ht,[cn(X.value)==null?(m(),l(g,{key:1},[r(e(T),{severity:`secondary`,value:an(X.value),style:{"font-size":`0.7rem`}},null,8,[`value`]),a[70]||=c(`span`,{class:`prepost-unresolved`},`(?)`,-1)],64)):(m(),l(`span`,Ut,v(cn(X.value)),1))])):(m(),l(`span`,Wt,v(sn(X.value)||`…`),1)),Z.value?(m(),l(`span`,Gt,v(sn(Z.value)),1)):b(``,!0)])):b(``,!0)])):b(``,!0)],32)}}}),[[`__scopeId`,`data-v-88b44eb7`]]);function q(e){return e.tags?.length?[...e.tags].sort((e,t)=>e.localeCompare(t))[0]:null}function Jt(e,t){if(!e.key||!t.key)return Number(!e.key)-Number(!t.key);let n=q(e),r=q(t);return n===r?e.key.localeCompare(t.key):n===null?1:r===null?-1:n.localeCompare(r)}function Yt(e,t){return!t.length||!!e?.some(e=>t.includes(e))}var Xt=/\{\{environment\.([^}]+)\}\}/g;function Zt(e){let t=new Set;for(let n of e)for(let e of n.matchAll(Xt))t.add(e[1]);return[...t]}function Qt(e,t,n=[]){let r=new Set;for(let i of Zt(e))for(let e of t[i]??[])n.includes(e)||r.add(e);return[...r].sort((e,t)=>e.localeCompare(t))}function J(e,t){let n=e.filter(e=>t.includes(e));return n.length===e.length?e:n}var $t={class:`table-toolbar`},en={key:1,class:`overrides-filter`},tn={for:`overrides-filter`},Y={class:`text-center py-4 text-gray-500`},X={class:`row-key-cell`},Z={class:`row-key-line`},nn={class:`row-key`},rn=[`title`],an=[`title`],on={key:0,class:`row-tags`},sn={key:2,class:`resolved-from-line`},cn={class:`row-value`},ln=[`title`,`onClick`],un=[`title`,`onClick`],dn={key:1,class:`value-levels`},Q={class:`resolved-level`},fn={key:0,class:`secret-mask`},$=[`title`],pn={key:0,class:`secret-mask`},mn=[`title`],hn=[`title`],gn={key:6,class:`empty-value`},_n={key:0,class:`override-indicator`},vn=[`title`,`onClick`],yn=[`title`,`onClick`],bn={key:0,class:`override-value-masked`},xn=[`title`],Sn=[`title`],Cn={key:0,class:`parent-edit`},wn={class:`parent-edit__field`},Tn={class:`parent-edit__label`,for:`parent-edit-value`},En={class:`parent-edit__usages`},Dn={class:`parent-edit__usages-title`},On={key:0,class:`parent-edit__usages-loading`},kn={key:0,class:`parent-edit__usage-list`},An={class:`parent-edit__usage-env`},jn={key:0,class:`parent-edit__usage-svc`},Mn={key:1,class:`parent-edit__usages-empty`},Nn=40,Pn=200,Fn=24,In=D(te({__name:`VariablesTable`,props:{environmentId:{},resolvedEnv:{default:()=>({})},sources:{default:()=>({})},editable:{type:Boolean,default:!0},showOverrides:{type:Boolean,default:!1},showOverrideBadge:{type:Boolean,default:!1},showDelete:{type:Boolean,default:!0},showAddButton:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},autocompleteEnabled:{type:Boolean,default:!1},autocompleteSuggestions:{default:()=>[]},autocompleteMeta:{default:()=>({})},serviceBuiltins:{},scrollHeight:{default:`auto`},resolvedVariables:{default:()=>({})}},emits:[`autocomplete-search`,`variables-changed`],setup(n,{emit:te}){let h=be,x=/^\{\{environment\.([^{}]+)\}\}$/,S=Object.fromEntries(me.map(e=>[e.name,``])),C=n,D=te,{t:O}=ie(),j=fe(),pe=f(()=>Object.keys(C.sources).length>0),M=f(()=>Object.keys(C.resolvedEnv).length>0),N=o(`rootRef`),P=t(null),F=f(()=>C.scrollHeight===`auto`?P.value??`460px`:C.scrollHeight);function he(){if(C.scrollHeight!==`auto`)return;let e=N.value;if(!e)return;let t=(e.querySelector(`.r-datatable__container`)??e).getBoundingClientRect().top,n=window.innerHeight-t-Fn;P.value=`${Math.max(Pn,Math.round(n))}px`}let ge=null;ee(()=>{ne(he),window.addEventListener(`resize`,he),typeof ResizeObserver<`u`&&N.value&&(ge=new ResizeObserver(()=>he()),ge.observe(document.body))}),p(()=>{window.removeEventListener(`resize`,he),ge?.disconnect(),ge=null});let I=t(``),_e=t(!1),L=t([]),R=t({});async function z(){if(C.showOverrides)try{let e=await j.getOverrides(),t={};for(let[n,r]of Object.entries(e)){let e=r;t[n]={value:e.value.value,pre:e.value.pre,post:e.value.post,isSecret:e.value.isSecret}}R.value=t}catch{}}ee(z);let ye=f(()=>j.getById(C.environmentId));function B(e){return ye.value?.variables?.[e]}let V=f(()=>{let e=new Set;for(let t of j.environments)for(let n of Object.values(t.variables??{}))for(let t of n.tags??[])e.add(t);return[...e].sort((e,t)=>e.localeCompare(t))}),xe=f(()=>{let e={...Se.value};for(let t of Object.values(ye.value?.variables??{}))e[t.key]=t.tags??[];return e}),Se=f(()=>{let e=ye.value?.variables??{},t={};for(let[n,r]of Object.entries(C.resolvedVariables))n in e||(t[r.key]=r.tags??[]);return t});function Ce(e){let t=B(e);if(!t)return[];let n=R.value[e],r=[t.value?.value??``,t.value?.pre??``,t.value?.post??``];return n&&r.push(n.value,n.pre,n.post),Qt(r,{...xe.value,[t.key]:Se.value[t.key]??[]},t.tags??[])}function H(e){return[...B(e)?.tags??[],...Ce(e)]}let we=f(()=>{let e=new Set;for(let t of Object.keys(ye.value?.variables??{}))for(let n of H(t))e.add(n);return[...e].sort((e,t)=>e.localeCompare(t))});a(we,e=>{L.value=J(L.value,e)});let U=t([]),Te=f(()=>{let e=Object.keys(ye.value?.variables??{}).map(e=>({variableId:e})),t=new Set(e.map(e=>e.variableId)),n=U.value.filter(e=>!t.has(e)).map(e=>({variableId:e}));return[...e,...n]}),Ee=o(`tableRef`),W=t({}),G=t([]),K=t(new Set);function De(e){let t=new Set(K.value);t.has(e)?t.delete(e):t.add(e),K.value=t}let Oe=t(null);function ke(e,t){navigator.clipboard.writeText(t),Oe.value=e,setTimeout(()=>{Oe.value===e&&(Oe.value=null)},1500)}function Ae(e){let t=B(e);if(!t)return``;let n=t.value?.value??``;return Je(n)?Xe(n)??n:(t.value?.pre??``)+n+(t.value?.post??``)}let je=ae(),Me=t(null),Ne=t(!1),Pe=t(!1),Fe=t(!1),Ie=0,Le=t([]);async function Re(e){let t=C.sources[e]?.resolvedFrom,n=B(e)?.value?.value??``;if(!t||!n)return;let r=Ye(n),i=j.getById(t.environmentId),a=Object.entries(i?.variables??{}).find(([,e])=>e.key===r);if(!a){je.add({severity:`warn`,summary:O(`variablesTable.editParentNotFound`),life:4e3});return}let[o,s]=a;Me.value={key:r,environmentId:t.environmentId,environmentName:t.environmentName,variableId:o,value:s.value?.value??``,pre:s.value?.pre??``,post:s.value?.post??``,isSecret:s.value?.isSecret??!1,shareWithAi:s.value?.shareWithAi??!1,injectIntoAi:s.value?.injectIntoAi??!1,...s.tags?.length?{tags:s.tags}:{}},Le.value=[],Ne.value=!0,ze(r,t.environmentId)}async function ze(e,t){let n=++Ie;Fe.value=!0;try{let r=j.currentProjectId;if(!r)return;let i=await j.keyUsages(r,e,t);if(n!==Ie)return;Le.value=[...i.inheritedBy.map(e=>({kind:`inherits`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{}})),...i.definedIn.map(e=>({kind:`defines`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{}})),...i.referencedBy.map(e=>({kind:`references`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{},viaKey:e.key}))]}catch{n===Ie&&(Le.value=[])}finally{n===Ie&&(Fe.value=!1)}}async function Be(){let e=Me.value;if(e){Pe.value=!0;try{await j.upsertVariable(e.environmentId,e.variableId,{key:e.key,...e.tags?{tags:e.tags}:{},value:{value:e.value,pre:e.pre,post:e.post,isSecret:e.isSecret,shareWithAi:e.shareWithAi,injectIntoAi:e.injectIntoAi}}),Ne.value=!1,D(`variables-changed`)}catch(e){je.add({severity:`error`,summary:O(`common.error`),detail:e.message,life:4e3})}finally{Pe.value=!1}}}function Ve(e){let t=R.value[e];return t?t.pre+t.value+t.post:``}let He=f(()=>{let e=[...Te.value];if(_e.value&&(e=e.filter(e=>!!R.value[e.variableId])),L.value.length&&(e=e.filter(e=>U.value.includes(e.variableId)||Yt(H(e.variableId),L.value))),I.value.trim()){let t=I.value.toLowerCase();e=e.filter(e=>{let n=B(e.variableId);if(!n)return!1;if(n.key.toLowerCase().includes(t)||H(e.variableId).some(e=>e.toLowerCase().includes(t))||(n.value?.value??``).toLowerCase().includes(t))return!0;let r=R.value[e.variableId];return!!(r&&r.value.toLowerCase().includes(t))})}if(G.value.length>0)e.sort((e,t)=>{let n=G.value.indexOf(e.variableId),r=G.value.indexOf(t.variableId);return n===-1?1:r===-1?-1:n-r});else{let t=e=>({key:B(e)?.key??``,tags:H(e)});e.sort((e,n)=>Jt(t(e.variableId),t(n.variableId)))}return e});function Ue(e){let t=e.data.variableId;W.value[t]?(W.value={},G.value=[],We(t)):(G.value=He.value.map(e=>e.variableId),W.value={[t]:!0})}function We(e){ne(()=>{let t=Ee.value?.$el;if(!t)return;let n=He.value.findIndex(t=>t.variableId===e);n<0||t.querySelectorAll(`tbody tr[data-index]`)[n]?.scrollIntoView({block:`nearest`,behavior:`smooth`})})}function Ge(e){U.value=U.value.filter(t=>t!==e),W.value[e]&&(W.value={},G.value=[])}function Ke(e){U.value=U.value.filter(t=>t!==e)}function qe(){let e=de();U.value=[...U.value,e],G.value=[...Te.value.map(e=>e.variableId),e],ne(()=>{W.value={[e]:!0},ne(()=>{let e=document.querySelector(`.variables-expand-table .r-datatable__row-expansion:last-of-type`);e&&e.scrollIntoView({block:`nearest`,behavior:`smooth`})})})}function Je(e){return h.test(e)}function Ye(e){let t=e.match(h);return t?t[1].replace(/^(?:environment|service)\./,``):e}function Xe(e){let t=e.match(x);if(t)return C.resolvedEnv[t[1]]??null;let n=e.match(h);if(n){let e={...S,...C.serviceBuiltins};if(e[n[1]])return e[n[1]]}return null}function Ze(e){return e.length<=Nn?e:e.substring(0,Nn)+`…`}return(t,a)=>(m(),l(g,null,[c(`div`,{ref_key:`rootRef`,ref:N,class:`variables-table`},[c(`div`,$t,[r(e(w),{modelValue:I.value,"onUpdate:modelValue":a[0]||=e=>I.value=e,placeholder:`Search variables...`,class:`search-input`,size:`small`},null,8,[`modelValue`]),we.value.length?(m(),y(e(se),{key:0,modelValue:L.value,"onUpdate:modelValue":a[1]||=e=>L.value=e,options:we.value,placeholder:e(O)(`variablesTable.filterByTag`),display:`chip`,"max-selected-labels":2,"show-clear":``,size:`small`,class:`tag-filter`},null,8,[`modelValue`,`options`,`placeholder`])):b(``,!0),n.showOverrides?(m(),l(`div`,en,[r(e(le),{modelValue:_e.value,"onUpdate:modelValue":a[2]||=e=>_e.value=e,"input-id":`overrides-filter`},null,8,[`modelValue`]),c(`label`,tn,v(e(O)(`variablesTable.overriddenOnly`)),1)])):b(``,!0)]),r(e(ue),{ref_key:`tableRef`,ref:Ee,"expanded-rows":W.value,"onUpdate:expandedRows":a[6]||=e=>W.value=e,value:He.value,"data-key":`variableId`,size:`small`,class:`variables-expand-table`,scrollable:``,"scroll-height":F.value,onRowClick:Ue},{empty:_(()=>[c(`div`,Y,v(n.showAddButton?e(O)(`variablesTable.empty`):e(O)(`variablesTable.emptyReadonly`)),1)]),expansion:_(({data:t})=>[r(qt,{"environment-id":n.environmentId,"variable-id":t.variableId,overrides:R.value,editable:n.editable,"show-overrides":n.showOverrides,"show-delete":n.showDelete,"show-override-badge":n.showOverrideBadge,disabled:n.disabled,"resolved-env":n.resolvedEnv,"autocomplete-enabled":n.autocompleteEnabled,"autocomplete-suggestions":n.autocompleteSuggestions,"autocomplete-meta":n.autocompleteMeta,"service-builtins":{...e(S),...n.serviceBuiltins},"is-pending":U.value.includes(t.variableId),"known-tags":V.value,onDeleted:e=>Ge(t.variableId),onSaved:e=>Ke(t.variableId),onAutocompleteSearch:a[5]||=e=>D(`autocomplete-search`,e),onOverrideChanged:z,"can-edit-source":!!n.sources[t.variableId]?.resolvedFrom,onEditSource:e=>Re(t.variableId)},null,8,[`environment-id`,`variable-id`,`overrides`,`editable`,`show-overrides`,`show-delete`,`show-override-badge`,`disabled`,`resolved-env`,`autocomplete-enabled`,`autocomplete-suggestions`,`autocomplete-meta`,`service-builtins`,`is-pending`,`known-tags`,`onDeleted`,`onSaved`,`can-edit-source`,`onEditSource`])]),default:_(()=>[r(e(k),{expander:``,style:{width:`2.5rem`}}),r(e(k),{field:`variableId`,header:e(O)(`common.key`)},{body:_(({data:t})=>[c(`div`,X,[c(`span`,Z,[c(`code`,nn,v(B(t.variableId)?.key||`(new variable)`),1),n.sources[t.variableId]?.overriddenBy?(m(),l(`span`,{key:0,class:`overridden-badge overridden-badge--local`,title:e(O)(`variablesTable.localOverrideTooltip`,{env:n.sources[t.variableId].overriddenBy.environmentName})},[a[10]||=c(`i`,{class:`ti ti-device-desktop`},null,-1),i(` `+v(e(O)(`variablesTable.localOverride`)),1)],8,rn)):n.showOverrideBadge&&n.sources[t.variableId]?.overridden&&!Je(B(t.variableId)?.value?.value??``)?(m(),l(`span`,{key:1,class:`overridden-badge`,title:e(O)(`variablesTable.overrideTooltip`)},[a[11]||=c(`i`,{class:`ti ti-alert-triangle`},null,-1),i(` `+v(e(O)(`variablesTable.override`)),1)],8,an)):b(``,!0)]),H(t.variableId).length?(m(),l(`span`,on,[(m(!0),l(g,null,u(B(t.variableId)?.tags??[],t=>(m(),y(e(T),{key:t,severity:`secondary`,value:t,class:`row-tag`},null,8,[`value`]))),128)),(m(!0),l(g,null,u(Ce(t.variableId),t=>s((m(),y(e(T),{key:`inherited:`+t,severity:`secondary`,value:t,class:`row-tag row-tag--inherited`},null,8,[`value`])),[[e(A),e(O)(`variablesTable.inheritedTag`),void 0,{top:!0}]])),128))])):b(``,!0),pe.value&&n.sources[t.variableId]?(m(),y(ve,{key:1,"environment-id":n.sources[t.variableId].environmentId,class:`source-badge`},null,8,[`environment-id`])):b(``,!0),pe.value&&n.sources[t.variableId]?.resolvedFrom?(m(),l(`span`,sn,[a[12]||=c(`i`,{class:`ti ti-arrow-right resolved-from-arrow`},null,-1),r(ve,{"environment-id":n.sources[t.variableId].resolvedFrom.environmentId,class:`source-badge`},null,8,[`environment-id`])])):b(``,!0)])]),_:1},8,[`header`]),r(e(k),{header:e(O)(`common.value`)},{body:_(({data:t})=>[c(`span`,cn,[Ae(t.variableId)?(m(),l(`span`,{key:0,class:`value-actions`,onClick:a[3]||=re(()=>{},[`stop`])},[B(t.variableId)?.value?.isSecret?(m(),l(`i`,{key:0,class:d([K.value.has(t.variableId)?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),title:e(O)(`variablesTable.reveal`),onClick:e=>De(t.variableId)},null,10,ln)):b(``,!0),c(`i`,{class:d([Oe.value===t.variableId?`ti ti-check`:`ti ti-copy`,`action-icon`]),title:e(O)(`actions.copy`),onClick:e=>ke(t.variableId,Ae(t.variableId))},null,10,un)])):b(``,!0),Je(B(t.variableId)?.value?.value??``)&&Xe(B(t.variableId)?.value?.value??``)!=null?(m(),l(`span`,dn,[r(e(T),{severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``),class:`interpolation-hint-tag`},null,8,[`value`]),c(`span`,Q,[B(t.variableId)?.value?.isSecret&&!K.value.has(t.variableId)?(m(),l(`span`,fn,`***`)):(m(),l(`code`,{key:1,class:`resolved-final`,title:Xe(B(t.variableId)?.value?.value??``)},v(Ze(Xe(B(t.variableId)?.value?.value??``))),9,$))])])):Je(B(t.variableId)?.value?.value??``)&&M.value&&Xe(B(t.variableId)?.value?.value??``)==null?(m(),l(g,{key:2},[a[13]||=c(`i`,{class:`ti ti-alert-triangle unresolved-icon`},null,-1),r(e(T),{severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``)},null,8,[`value`]),a[14]||=c(`span`,{class:`unresolved-msg`},`Variable not found in this environment`,-1)],64)):Je(B(t.variableId)?.value?.value??``)?(m(),y(e(T),{key:3,severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``)},null,8,[`value`])):B(t.variableId)?.value?.isSecret?(m(),l(g,{key:4},[K.value.has(t.variableId)?(m(),l(`code`,{key:1,title:Ae(t.variableId)},v(Ze(Ae(t.variableId))),9,mn)):(m(),l(`span`,pn,`***`))],64)):B(t.variableId)?.value?.value||B(t.variableId)?.value?.pre||B(t.variableId)?.value?.post?(m(),l(`code`,{key:5,title:Ae(t.variableId)},v(Ze(Ae(t.variableId))),9,hn)):(m(),l(`span`,gn,`(empty)`))]),n.showOverrides&&!Je(B(t.variableId)?.value?.value??``)&&R.value[t.variableId]?(m(),l(`span`,_n,[a[15]||=c(`i`,{class:`ti ti-arrow-right`,style:{"font-size":`0.7rem`}},null,-1),c(`span`,{class:`value-actions`,onClick:a[4]||=re(()=>{},[`stop`])},[B(t.variableId)?.value?.isSecret||R.value[t.variableId].isSecret?(m(),l(`i`,{key:0,class:d([K.value.has(`ovr:`+t.variableId)?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),title:e(O)(`variablesTable.reveal`),onClick:e=>De(`ovr:`+t.variableId)},null,10,vn)):b(``,!0),c(`i`,{class:d([Oe.value===`ovr:`+t.variableId?`ti ti-check`:`ti ti-copy`,`action-icon`]),title:e(O)(`actions.copy`),onClick:e=>ke(`ovr:`+t.variableId,Ve(t.variableId))},null,10,yn)]),B(t.variableId)?.value?.isSecret||R.value[t.variableId].isSecret?(m(),l(g,{key:0},[K.value.has(`ovr:`+t.variableId)?(m(),l(`code`,{key:1,class:`override-value`,title:Ve(t.variableId)},v(Ze(Ve(t.variableId))),9,xn)):(m(),l(`span`,bn,`***`))],64)):(m(),l(`code`,{key:1,class:`override-value`,title:Ve(t.variableId)},v(Ze(Ve(t.variableId))),9,Sn))])):b(``,!0)]),_:1},8,[`header`])]),_:1},8,[`expanded-rows`,`value`,`scroll-height`]),n.showAddButton?(m(),y(e(ce),{key:0,type:`button`,label:e(O)(`variablesTable.addVariable`),icon:`ti ti-plus`,variant:`text`,disabled:n.disabled,class:`mt-3`,onClick:qe},null,8,[`label`,`disabled`])):b(``,!0)],512),r(e(E),{visible:Ne.value,"onUpdate:visible":a[9]||=e=>Ne.value=e,modal:``,header:e(O)(`variablesTable.editParentHeader`),style:{width:`38rem`,maxWidth:`95vw`}},{footer:_(()=>[r(e(ce),{label:e(O)(`actions.cancel`),variant:`text`,disabled:Pe.value,onClick:a[8]||=e=>Ne.value=!1},null,8,[`label`,`disabled`]),r(e(ce),{label:e(O)(`variablesTable.editParentConfirm`),severity:`warn`,loading:Pe.value,onClick:Be},null,8,[`label`,`loading`])]),default:_(()=>[Me.value?(m(),l(`div`,Cn,[r(e(oe),{severity:`warn`,class:`parent-edit__warning`},{default:_(()=>[i(v(e(O)(`variablesTable.editParentWarning`,{key:Me.value.key,env:Me.value.environmentName})),1)]),_:1}),c(`div`,wn,[c(`label`,Tn,v(e(O)(`common.value`)),1),r(e(w),{id:`parent-edit-value`,modelValue:Me.value.value,"onUpdate:modelValue":a[7]||=e=>Me.value.value=e,class:`w-full`,disabled:Pe.value},null,8,[`modelValue`,`disabled`])]),c(`div`,En,[c(`div`,Dn,[a[16]||=c(`i`,{class:`ti ti-sitemap`},null,-1),i(` `+v(e(O)(`variablesTable.editParentImpact`)),1)]),Fe.value?(m(),l(`div`,On,[a[17]||=c(`i`,{class:`ti ti-spin ti-loader-2`},null,-1),c(`span`,null,v(e(O)(`variablesTable.editParentLoading`)),1)])):(m(),l(g,{key:1},[Le.value.length?(m(),l(`ul`,kn,[(m(!0),l(g,null,u(Le.value,(t,n)=>(m(),l(`li`,{key:n},[r(e(T),{severity:t.kind===`references`?`info`:`secondary`,value:t.kind===`references`?t.viaKey:t.kind===`inherits`?e(O)(`variablesTable.editParentInherits`):e(O)(`variablesTable.editParentDefines`)},null,8,[`severity`,`value`]),c(`span`,An,v(t.environmentName),1),t.serviceName?(m(),l(`span`,jn,v(t.serviceName),1)):b(``,!0)]))),128))])):(m(),l(`div`,Mn,v(e(O)(`variablesTable.editParentNoUsage`)),1))],64))])])):b(``,!0)]),_:1},8,[`visible`,`header`])],64))}}),[[`__scopeId`,`data-v-1d1460fd`]]);function Ln(e,t){let n=j(),r=S(),i=P(),a=f(()=>{let t=n.getByRef({id:e(),orgId:r.activeOrgId});return t?t.serviceIds.map(e=>i.getById(e)).filter(e=>!!e):[]});return f(()=>{let e=M(a.value.map(e=>e.name)),n={};for(let r of a.value){let i=pe(r.name);i&&!e.has(i)&&Object.assign(n,N({name:r.name,id:r.id,ports:r.ports,localUrls:r.localUrls,url:r.url},t()))}return n})}function Rn(e){let t=F(),n=fe(),r=j(),i=S(),a=f(()=>{let r=e.environmentId()?n.getById(e.environmentId())?.agentId:void 0,i=e.agentId?.()??r;return i?t.getById(i):t.agents.find(e=>e.isLocal)??null}),{urlHost:o,serverHost:s}=I(()=>a.value?.config.id),c=Ln(e.projectId,()=>o.value);return{values:f(()=>{let t={};for(let e of me)t[e.name]=``;t[`runeya.HOST`]=s.value;let o=a.value?.status;o?.lanIp&&(t[`agent.HOST_LAN`]=o.lanIp),o?.os&&(t[`agent.OS`]=o.os),o?.home&&(t[`agent.HOME`]=o.home),a.value&&(t[`agent.NAME`]=a.value.config.name);let l=r.getByRef({id:e.projectId(),orgId:i.activeOrgId});l&&(t[`project.NAME`]=l.name);let u=e.environmentId()?n.getById(e.environmentId()):null;return u&&(t[`runeya.ENV_NAME`]=u.name),Object.assign(t,c.value),t}),agentEntry:a,urlHost:o}}function zn(e){let n=t([]),r=t({});function i(t){let i=e();if(!i)return;let a=t.toLowerCase(),o=Object.keys(i.env).filter(e=>e.toLowerCase().includes(a));n.value=o;let s=i.variables,c={};if(s)for(let e of o){let t=Object.values(s).find(t=>t.key===e);t&&(c[e]={key:e,isSecret:t.value?.isSecret??!1,pre:t.value?.pre??``,post:t.value?.post??``})}r.value=c}return{suggestions:n,meta:r,search:i}}export{ve as a,ye as i,Rn as n,In as r,zn as t};
|
|
1
|
+
import{B as e,C as t}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{Ct as n,D as r,E as i,Ht as a,Rt as o,Yt as s,_ as c,b as l,bt as u,ct as ee,en as d,g as f,it as p,k as te,mt as m,nn as h,o as g,qt as _,rn as v,tt as ne,v as y,y as b}from"./runtime-core.esm-bundler-DujKY9QV.js";import{C as x,w as re}from"./runtime-dom.esm-bundler-CyEVRK6B.js";import{n as ie}from"./vue-i18n-o7yraQpR.js";import{n as S}from"./project-launch.store-DBuxvZJr.js";import{C,J as w,P as ae,U as T,W as oe,Y as E,a as se,dt as ce,ft as D,i as O,k as le,n as ue,r as k,t as A}from"./src-B1nAsOcw.js";import{t as de}from"./uuid-B2pLMyOM.js";import{n as j,r as fe}from"./project.store-CXP-Oq1W.js";import{h as pe,l as M,t as me,u as N}from"./dist-CjS_rxe9.js";import{t as P}from"./service.store-oNOqRX_s.js";import{t as F}from"./agent.store-5ggNQfb3.js";import{H as he,U as ge}from"./index-Z4n9BqGD.js";import{t as I}from"./useServiceUrlHost-CzDrWXfO.js";import"./uuid-D2uso58z.js";import{t as _e}from"./FlagChip-DBj0fpJC.js";var L={key:0,class:`env-badge`},R={class:`env-badge__name`},ve=D(te({__name:`EnvironmentBadge`,props:{environmentId:{}},setup(e){let t=e,n=fe(),r=f(()=>n.getById(t.environmentId));function i(e){if(e)return e.startsWith(`#`)?e:`#${e}`}return(e,t)=>r.value?(m(),l(`span`,L,[c(`span`,{class:`env-badge__swatch`,style:h({backgroundColor:i(r.value.bgColor)||i(r.value.color)||`var(--r-primary)`})},null,4),c(`span`,R,v(r.value.name),1)])):b(``,!0)}}),[[`__scopeId`,`data-v-968d7caa`]]),z=150,ye=te({__name:`TagsInput`,props:{modelValue:{},options:{default:()=>[]},placeholder:{default:void 0},inputId:{default:void 0},disabled:{type:Boolean,default:!1}},emits:[`update:modelValue`,`change`],setup(n,{emit:r}){let i=n,a=r,o=t([]);function s(e){let t=e.query.trim().toLowerCase(),n=new Set(i.modelValue);o.value=i.options.filter(e=>!n.has(e)&&(!t||e.toLowerCase().includes(t)))}function c(e){a(`update:modelValue`,e),a(`change`,e)}function l(e){c(Array.isArray(e)?e.map(String):[])}function u(e){let t=e.trim();t&&!i.modelValue.includes(t)&&c([...i.modelValue,t])}function ee(e){let t=e.target;u(t.value),t.value=``,o.value=[]}function d(e){let t=e.target;t&&typeof t.value==`string`&&t.value.trim()&&setTimeout(()=>{u(t.value),t.value=``},z)}return(t,r)=>(m(),y(e(O),{"model-value":n.modelValue,multiple:``,suggestions:o.value,"complete-on-focus":!0,placeholder:n.placeholder,"input-id":n.inputId,disabled:n.disabled,"onUpdate:modelValue":l,onComplete:s,onKeydown:x(ee,[`enter`]),onBlur:d},null,8,[`model-value`,`suggestions`,`placeholder`,`input-id`,`disabled`]))}}),be=/^\{\{([^{}]+)\}\}$/,B=/\{\{([^}]+)\}\}/g,V=`environment.`;function xe(e,t){return e.startsWith(V)?t.resolvedEnv[e.slice(12)]||null:t.serviceBuiltins[e]||null}function Se(e,t){let n=e.match(be);return n?xe(n[1],t):null}function Ce(e,t){return e.replace(B,(e,n)=>xe(n,t)??e)}var H={class:`ref-group`},we={class:`ref-option`},U={key:0,class:`ti ti-lock ref-option-secret`},Te={key:1,class:`ref-option-preview`},Ee=40,W=D(te({__name:`VariableRefInput`,props:{modelValue:{},inputId:{},placeholder:{default:``},disabled:{type:Boolean,default:!1},envKeys:{default:()=>[]},meta:{default:()=>({})},resolvedEnv:{default:()=>({})},serviceBuiltins:{default:()=>({})}},emits:[`update:modelValue`,`search`,`focus`,`blur`,`picked`],setup(n,{emit:i}){let o=/\{\{([^}]*)$/,s=n,u=i,{t:ee}=ie(),d=t(``),f=t(``),p=t([]);function te(){let e=d.value.toLowerCase(),t=Object.keys(s.serviceBuiltins).filter(t=>t.toLowerCase().includes(e)).map(e=>`{{${e}}}`),n=s.envKeys.map(e=>`{{environment.${e}}}`);return[...t.length?[{label:ee(`variableRefInput.groupBuiltins`),items:t}]:[],...n.length?[{label:ee(`variableRefInput.groupEnvironment`),items:n}]:[]]}function h(){p.value=te()}a(()=>[s.envKeys,s.serviceBuiltins],h,{deep:!0});function g(e){let t=e.match(be);return t?t[1].replace(/^environment\./,``):e}function ne(e){let t=e.match(be);return!t||!t[1].startsWith(`environment.`)?!1:s.meta[t[1].slice(12)]?.isSecret??!1}function x(e){let t=e.match(be);if(!t)return null;let n=t[1];if(n.startsWith(`environment.`)){let e=s.meta[n.slice(12)];if(!e||e.isSecret)return null}let r=xe(n,{resolvedEnv:s.resolvedEnv,serviceBuiltins:s.serviceBuiltins});return r?re(r):null}function re(e){return e.length>Ee?`${e.slice(0,Ee)}…`:e}function S(e){if(f.value=e.query,C)C=!1,d.value=``;else{let t=e.query.match(o),n=t?t[1]:e.query;d.value=n.replace(/^(environment|service)\./,``).trim()}u(`search`,d.value),h()}let C=!1;function w(){C=!0,u(`focus`)}function ae(e){let t=f.value,n=t.lastIndexOf(`{{`);u(`update:modelValue`,n===-1?e:t.slice(0,n)+e),u(`picked`)}return(t,i)=>(m(),y(e(O),{"input-id":n.inputId,"model-value":n.modelValue,suggestions:p.value,"option-group-label":`label`,"option-group-children":`items`,placeholder:n.placeholder,class:`w-full`,"complete-on-focus":``,disabled:n.disabled,"onUpdate:modelValue":i[0]||=e=>u(`update:modelValue`,e),onComplete:S,onItemSelect:i[1]||=e=>ae(e.value),onFocus:w,onBlur:i[2]||=e=>u(`blur`)},{optiongroup:_(({option:e})=>[c(`span`,H,v(e.label),1)]),option:_(({option:t})=>[c(`span`,we,[r(e(T),{severity:`secondary`,value:g(t)},null,8,[`value`]),ne(t)?(m(),l(`i`,U)):x(t)?(m(),l(`span`,Te,v(x(t)),1)):b(``,!0)])]),_:1},8,[`input-id`,`model-value`,`suggestions`,`placeholder`,`disabled`]))}}),[[`__scopeId`,`data-v-2247bb09`]]);function G(e){let t=!1,n=!1;return async function r(){if(t){n=!0;return}t=!0;try{await e()}finally{t=!1,n&&(n=!1,await r())}}}var K={class:`key-row`},De={class:`expansion-field expansion-field--key`},Oe=[`for`],ke={key:2,class:`value-display`},Ae={key:0,class:`key-row-delete`},je={key:0,class:`flags-row`},Me={key:1,class:`expansion-field expansion-field--tags`},Ne={class:`expansion-label`,for:`varrow-tags-input`},Pe={key:1,class:`tags-display`},Fe={key:2,class:`not-secret-warning`},Ie={key:4,class:`expansion-field expansion-field--description`},Le={class:`expansion-label`},Re={key:5,class:`not-secret-warning`},ze={key:7,class:`expansion-section`},Be={class:`section-header`},Ve={class:`section-title`},He={class:`section-fields`},Ue={class:`expansion-field expansion-field--prepost`},We={class:`expansion-label`,for:`varrow-prefix`},Ge={key:2,class:`value-display`},Ke={class:`expansion-field expansion-field--value`},qe=[`for`],Je=[`aria-label`],Ye={class:`value-help`},Xe={class:`value-help__title`},Ze={class:`value-help__line`},Qe={class:`value-help__line value-help__line--muted`},$e={class:`value-help__subtitle`},et={class:`value-help__builtins`},tt={class:`value-help__line value-help__line--muted`},nt={key:0,class:`secret-input-wrap`},rt=[`disabled`],it=[`title`],at={key:1,class:`value-display value-display--with-actions`},ot={key:0,class:`value-actions`},st={key:0},ct={key:1},lt={class:`expansion-field expansion-field--prepost`},ut={class:`expansion-label`,for:`varrow-suffix`},dt={key:2,class:`value-display`},ft={key:0,class:`preview-value`},pt={key:0,class:`prepost-part prepost-part--pre`},mt={key:1,class:`prepost-part prepost-part--interpolation`},ht={class:`prepost-part--value prepost-resolved-inline`},gt=[`title`],_t={key:2,class:`prepost-part prepost-part--value`},vt={key:3,class:`prepost-part prepost-part--post`},yt={key:9,class:`expansion-section expansion-section--override`},bt={class:`section-header`},xt={class:`section-title`},St={class:`ti ti-info-circle section-title__info`},Ct={class:`section-fields`},wt={class:`expansion-field expansion-field--prepost`},Tt={class:`expansion-label`,for:`varrow-override-prefix`},Et={class:`expansion-field expansion-field--value`},Dt=[`for`],Ot={key:0,class:`secret-input-wrap`},kt=[`disabled`],At=[`title`],jt={class:`expansion-field expansion-field--prepost`},Mt={class:`expansion-label`,for:`varrow-override-suffix`},Nt={key:1,class:`override-view`},Pt={key:0,class:`value-display--with-actions`},Ft={class:`value-actions`},It={key:0,class:`override-value-masked`},Lt={key:1,class:`override-value`},Rt={key:1,class:`override-value`},zt={key:1,class:`override-empty`},Bt={key:0,class:`preview-value preview-value--override`},Vt={key:0,class:`prepost-part prepost-part--pre`},Ht={key:1,class:`prepost-part prepost-part--interpolation`},Ut={key:0,class:`prepost-part--value prepost-resolved-inline`},Wt={key:2,class:`prepost-part prepost-part--value`},Gt={key:3,class:`prepost-part prepost-part--post`},Kt=`{{environment.KEY}}`,qt=D(te({__name:`VariableRowEditor`,props:{environmentId:{},variableId:{},overrides:{},editable:{type:Boolean,default:!0},showOverrides:{type:Boolean,default:!1},canEditSource:{type:Boolean,default:!1},showDelete:{type:Boolean,default:!0},showOverrideBadge:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},resolvedEnv:{default:()=>({})},autocompleteEnabled:{type:Boolean,default:!1},autocompleteSuggestions:{default:()=>[]},autocompleteMeta:{default:()=>({})},serviceBuiltins:{default:()=>({})},isPending:{type:Boolean,default:!1},knownTags:{default:()=>[]}},emits:[`deleted`,`saved`,`autocomplete-search`,`override-changed`,`edit-source`],setup(p,{emit:te}){let h=p,x=te,S=fe(),oe=ae(),{t:E}=ie(),se=t(!1),D=t(!1),le=t(!1),ue=t(!1),k=t(!1),A=t(!1),de=t(null);function j(e,t){navigator.clipboard.writeText(t),de.value=e,setTimeout(()=>{de.value===e&&(de.value=null)},1500)}let pe=f(()=>S.getById(h.environmentId)?.variables?.[h.variableId]),M=t(``),N=t(``),P=t(``),F=t(``),I=t(!1),L=t(!1),R=t(!1),ve=t(!1),z=t(!1),B=t(``),V=t([]),xe=t(!1),H=t(!1),we=t(!1),U=f(()=>xe.value||!!B.value),Te=o(`descriptionEditor`);async function Ee(){xe.value=!0,await ne(),Te.value?.focus?.()}let qt=f(()=>rn(N.value)),q=f(()=>I.value&&!qt.value),Jt=f({get:()=>L.value||R.value,set:e=>{L.value=e}}),Yt=f(()=>R.value?E(`variableRowEditor.shareWithAiHintInjected`):q.value?E(`variableRowEditor.shareWithAiHint`):E(`variableRowEditor.shareWithAiHintPublic`)),Xt=f(()=>h.disabled||z.value);function Zt(){let e=pe.value;M.value=e?.key??``,N.value=e?.value?.value??``,P.value=e?.value?.pre??``,F.value=e?.value?.post??``,I.value=e?.value?.isSecret??!1,L.value=e?.value?.shareWithAi??!1,R.value=e?.value?.injectIntoAi??!1,ve.value=e?.value?.required??!1,z.value=e?.value?.overrideOnly??!1,xe.value=!1,H.value=!1,we.value=!1,B.value=e?.value?.description??``,V.value=[...e?.tags??[]]}function Qt(){z.value&&(N.value=``),Q()}ee(Zt),a(pe,(e,t)=>{!t&&e&&Zt()});let J=f(()=>h.overrides[h.variableId]??null),$t=f(()=>!J.value||H.value),en=f(()=>!h.editable||!!J.value||z.value||we.value);async function tn(){we.value=!0,await ne(),document.querySelector(`#varrow-override-value-secret, #varrow-override-value-plain`)?.focus()}let Y=t(``),X=t(``),Z=t(``);function nn(){let e=J.value;Y.value=e?.pre??``,X.value=e?.value??``,Z.value=e?.post??``}ee(nn),a(J,nn);function rn(e){return be.test(e)}function an(e){let t=e.match(be);return t?t[1].replace(/^environment\./,``):e}let on=f(()=>({resolvedEnv:h.resolvedEnv,serviceBuiltins:h.serviceBuiltins}));function sn(e){return Ce(e,on.value)}function cn(e){return Se(e,on.value)}function ln(e){let t=e.value;M.value=t,N.value=`{{environment.${t}}}`,I.value=!1;let n=h.autocompleteMeta?.[t];n&&(P.value=n.pre,F.value=n.post),Q()}let un=t(null),dn=f(()=>me.map(e=>({ref:`{{${e.name}}}`,desc:E(`builtins.${e.descriptionKey}`)}))),Q=G(async()=>{if(D.value)return;let e=M.value.trim();if(e){se.value=!0;try{await S.upsertVariable(h.environmentId,h.variableId,{key:e,...V.value.length?{tags:V.value}:{},value:{value:N.value,pre:P.value,post:F.value,isSecret:q.value,shareWithAi:L.value,injectIntoAi:R.value,required:ve.value,overrideOnly:z.value,description:B.value}}),h.isPending&&x(`saved`)}catch(e){oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.saveError`),life:4e3})}finally{se.value=!1}}});async function fn(){if(D.value=!0,h.isPending){x(`deleted`);return}se.value=!0;try{J.value&&await S.removeOverride(h.variableId),await S.removeVariable(h.environmentId,h.variableId),x(`deleted`)}catch(e){D.value=!1,oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.deleteError`),life:4e3})}finally{se.value=!1}}async function $(){let e=Y.value||X.value||Z.value;try{if(!e){J.value&&(await S.removeOverride(h.variableId),x(`override-changed`));return}await S.setOverride(h.variableId,{value:{value:X.value,pre:Y.value,post:Z.value}}),x(`override-changed`)}catch(e){oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.overrideError`),life:4e3})}}async function pn(){try{await S.removeOverride(h.variableId),x(`override-changed`)}catch(e){oe.add({severity:`error`,summary:E(`common.error`),detail:e.message??E(`variableRowEditor.clearOverrideError`),life:4e3})}}function mn(e){let t=e.relatedTarget;(!t||!e.currentTarget.contains(t))&&Q()}return(t,a)=>{let o=n(`tooltip`);return m(),l(`div`,{class:`expansion-form`,onFocusout:mn},[c(`div`,K,[c(`div`,De,[c(`label`,{class:`expansion-label`,for:p.editable&&p.autocompleteEnabled?`varrow-key-ac`:`varrow-key-input`},v(e(E)(`common.key`)),9,Oe),p.editable&&p.autocompleteEnabled?(m(),y(e(O),{key:0,"input-id":`varrow-key-ac`,modelValue:M.value,"onUpdate:modelValue":a[0]||=e=>M.value=e,suggestions:p.autocompleteSuggestions,placeholder:e(E)(`variableRowEditor.variableNamePlaceholder`),class:`w-full`,disabled:p.disabled,onComplete:a[1]||=e=>x(`autocomplete-search`,e.query),onItemSelect:ln,onBlur:e(Q)},null,8,[`modelValue`,`suggestions`,`placeholder`,`disabled`,`onBlur`])):p.editable?(m(),y(e(w),{key:1,id:`varrow-key-input`,modelValue:M.value,"onUpdate:modelValue":a[2]||=e=>M.value=e,placeholder:e(E)(`variableRowEditor.variableNamePlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(m(),l(`code`,ke,v(M.value),1))]),p.showDelete&&p.editable?(m(),l(`div`,Ae,[r(e(ce),{icon:`ti ti-trash`,severity:`danger`,variant:`text`,rounded:``,size:`small`,disabled:p.disabled||se.value,onClick:fn},null,8,[`disabled`])])):b(``,!0)]),p.editable?(m(),l(`div`,je,[qt.value?b(``,!0):(m(),y(_e,{key:0,modelValue:I.value,"onUpdate:modelValue":[a[3]||=e=>I.value=e,e(Q)],label:e(E)(`variableRowEditor.secret`),icon:`ti ti-lock`,hint:e(E)(`variableRowEditor.secretHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`])),r(_e,{modelValue:Jt.value,"onUpdate:modelValue":[a[4]||=e=>Jt.value=e,e(Q)],label:e(E)(`variableRowEditor.shareWithAi`),icon:`ti ti-eye`,hint:Yt.value,locked:R.value,disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`locked`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:R.value,"onUpdate:modelValue":[a[5]||=e=>R.value=e,e(Q)],label:e(E)(`variableRowEditor.injectIntoAi`),icon:`ti ti-login`,hint:e(E)(`variableRowEditor.injectIntoAiHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:ve.value,"onUpdate:modelValue":[a[6]||=e=>ve.value=e,e(Q)],label:e(E)(`variableRowEditor.required`),icon:`ti ti-asterisk`,hint:e(E)(`variableRowEditor.requiredHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`,`onUpdate:modelValue`]),r(_e,{modelValue:z.value,"onUpdate:modelValue":[a[7]||=e=>z.value=e,Qt],label:e(E)(`variableRowEditor.overrideOnly`),icon:`ti ti-device-desktop`,hint:e(E)(`variableRowEditor.overrideOnlyHint`),disabled:p.disabled},null,8,[`modelValue`,`label`,`hint`,`disabled`])])):b(``,!0),p.editable||V.value.length?(m(),l(`div`,Me,[c(`label`,Ne,v(e(E)(`variableRowEditor.tags`)),1),p.editable?(m(),y(ye,{key:0,modelValue:V.value,"onUpdate:modelValue":a[8]||=e=>V.value=e,"input-id":`varrow-tags-input`,options:p.knownTags,placeholder:e(E)(`variableRowEditor.tagsPlaceholder`),disabled:p.disabled,onChange:e(Q)},null,8,[`modelValue`,`options`,`placeholder`,`disabled`,`onChange`])):(m(),l(`div`,Pe,[(m(!0),l(g,null,u(V.value,t=>(m(),y(e(T),{key:t,severity:`secondary`,value:t},null,8,[`value`]))),128))]))])):b(``,!0),p.editable&&!I.value&&!rn(N.value)?(m(),l(`div`,Fe,[a[60]||=c(`i`,{class:`ti ti-info-circle`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.notSecretWarning`)),1)])):b(``,!0),p.editable&&!U.value?(m(),l(`button`,{key:3,type:`button`,class:`add-section-btn`,onClick:Ee},[a[61]||=c(`i`,{class:`ti ti-plus`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.addDescription`)),1)])):b(``,!0),U.value?(m(),l(`div`,Ie,[c(`label`,Le,v(e(E)(`variableRowEditor.description`)),1),r(e(ge),{ref_key:`descriptionEditor`,ref:Te,modelValue:B.value,"onUpdate:modelValue":a[9]||=e=>B.value=e,markdown:``,"min-height":`4rem`,"max-height":`14rem`,editable:p.editable&&!p.disabled,placeholder:e(E)(`variableRowEditor.descriptionPlaceholder`),onLinkClick:e(he)},null,8,[`modelValue`,`editable`,`placeholder`,`onLinkClick`])])):b(``,!0),p.editable&&z.value?(m(),l(`div`,Re,[a[62]||=c(`i`,{class:`ti ti-info-circle`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.overrideOnlyNotice`)),1)])):b(``,!0),$t.value?b(``,!0):(m(),l(`button`,{key:6,type:`button`,class:`add-section-btn`,onClick:a[10]||=e=>H.value=!0},[a[63]||=c(`i`,{class:`ti ti-chevron-right`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.showSharedValue`)),1)])),$t.value?(m(),l(`div`,ze,[c(`div`,Be,[c(`div`,Ve,v(e(E)(`variableRowEditor.value`)),1),J.value?(m(),l(`button`,{key:0,type:`button`,class:`add-section-btn`,onClick:a[11]||=e=>H.value=!1},[a[64]||=c(`i`,{class:`ti ti-chevron-up`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.hideSharedValue`)),1)])):b(``,!0)]),c(`div`,He,[c(`div`,Ue,[c(`label`,We,v(e(E)(`variableRowEditor.prefix`)),1),p.editable&&p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-prefix`,modelValue:P.value,"onUpdate:modelValue":a[12]||=e=>P.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[13]||=e=>x(`autocomplete-search`,e),onBlur:a[14]||=t=>e(Q)(),onPicked:a[15]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):p.editable?(m(),y(e(w),{key:1,id:`varrow-prefix`,modelValue:P.value,"onUpdate:modelValue":a[16]||=e=>P.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(m(),l(`code`,Ge,v(P.value||`—`),1))]),c(`div`,Ke,[c(`label`,{class:`expansion-label`,for:q.value?`varrow-value-secret`:`varrow-value-plain`},[i(v(e(E)(`variableRowEditor.value`))+` `,1),p.editable?(m(),l(`button`,{key:0,type:`button`,class:`value-help-btn`,"aria-label":e(E)(`variableRowEditor.helpTitle`),onClick:a[17]||=re(e=>un.value?.toggle(e),[`prevent`,`stop`])},[...a[65]||=[c(`i`,{class:`ti ti-info-circle`},null,-1)]],8,Je)):b(``,!0)],8,qe),r(e(C),{ref_key:`valueHelp`,ref:un},{default:_(()=>[c(`div`,Ye,[c(`div`,Xe,v(e(E)(`variableRowEditor.helpTitle`)),1),c(`p`,Ze,[i(v(e(E)(`variableRowEditor.helpReference`))+` `,1),c(`code`,null,v(Kt))]),c(`p`,Qe,v(e(E)(`variableRowEditor.helpAutocomplete`)),1),c(`div`,$e,v(e(E)(`variableRowEditor.helpBuiltinsTitle`)),1),c(`ul`,et,[(m(!0),l(g,null,u(dn.value,e=>(m(),l(`li`,{key:e.ref},[c(`code`,null,v(e.ref),1),c(`span`,null,v(e.desc),1)]))),128))]),c(`p`,tt,v(e(E)(`variableRowEditor.helpPrePost`)),1)])]),_:1},512),p.editable?(m(),l(g,{key:0},[q.value?(m(),l(`div`,nt,[r(e(w),{id:`varrow-value-secret`,modelValue:N.value,"onUpdate:modelValue":a[18]||=e=>N.value=e,type:k.value?`text`:`password`,placeholder:e(E)(`variableRowEditor.valuePlaceholder`),class:`w-full`,disabled:Xt.value,onBlur:e(Q)},null,8,[`modelValue`,`type`,`placeholder`,`disabled`,`onBlur`]),c(`button`,{type:`button`,class:`secret-toggle`,disabled:p.disabled,onClick:a[19]||=e=>k.value=!k.value,tabindex:`-1`},[c(`i`,{class:d(k.value?`ti ti-eye-off`:`ti ti-eye`)},null,2)],8,rt)])):rn(N.value)&&!le.value?(m(),l(`span`,{key:1,class:`interpolation-badge`,title:N.value,onClick:a[20]||=e=>le.value=!0},[r(e(T),{severity:`secondary`,value:an(N.value)},null,8,[`value`]),a[66]||=c(`i`,{class:`ti ti-pencil interpolation-edit-icon`},null,-1)],8,it)):p.autocompleteEnabled?(m(),y(W,{key:2,"input-id":`varrow-value-plain`,modelValue:N.value,"onUpdate:modelValue":a[21]||=e=>N.value=e,placeholder:e(E)(`variableRowEditor.valuePlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:Xt.value,onSearch:a[22]||=e=>x(`autocomplete-search`,e),onFocus:a[23]||=e=>le.value=!0,onBlur:a[24]||=t=>{le.value=!1,e(Q)()},onPicked:a[25]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:3,id:`varrow-value-plain`,modelValue:N.value,"onUpdate:modelValue":a[26]||=e=>N.value=e,placeholder:e(E)(`variableRowEditor.valuePlaceholder`),class:`w-full`,disabled:Xt.value,onFocus:a[27]||=e=>le.value=!0,onBlur:a[28]||=t=>{le.value=!1,e(Q)()}},null,8,[`modelValue`,`placeholder`,`disabled`]))],64)):(m(),l(`span`,at,[N.value?(m(),l(`span`,ot,[q.value?(m(),l(`i`,{key:0,class:d([k.value?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),onClick:a[29]||=e=>k.value=!k.value},null,2)):b(``,!0),c(`i`,{class:d([de.value===`val`?`ti ti-check`:`ti ti-copy`,`action-icon`]),onClick:a[30]||=e=>j(`val`,P.value+N.value+F.value)},null,2)])):b(``,!0),rn(N.value)?(m(),y(e(T),{key:1,severity:`secondary`,value:an(N.value)},null,8,[`value`])):q.value?(m(),l(g,{key:2},[k.value?(m(),l(`span`,ct,v(N.value),1)):(m(),l(`span`,st,`***`))],64)):(m(),l(g,{key:3},[i(v(N.value),1)],64))]))]),c(`div`,lt,[c(`label`,ut,v(e(E)(`variableRowEditor.suffix`)),1),p.editable&&p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-suffix`,modelValue:F.value,"onUpdate:modelValue":a[31]||=e=>F.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[32]||=e=>x(`autocomplete-search`,e),onBlur:a[33]||=t=>e(Q)(),onPicked:a[34]||=t=>e(Q)()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):p.editable?(m(),y(e(w),{key:1,id:`varrow-suffix`,modelValue:F.value,"onUpdate:modelValue":a[35]||=e=>F.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:e(Q)},null,8,[`modelValue`,`placeholder`,`disabled`,`onBlur`])):(m(),l(`code`,dt,v(F.value||`—`),1))])]),q.value?b(``,!0):(m(),l(`code`,ft,[P.value?(m(),l(`span`,pt,v(sn(P.value)),1)):b(``,!0),rn(N.value)?(m(),l(`span`,mt,[cn(N.value)==null?(m(),l(g,{key:1},[r(e(T),{severity:`secondary`,value:an(N.value),style:{"font-size":`0.7rem`}},null,8,[`value`]),a[67]||=c(`span`,{class:`prepost-unresolved`},`(?)`,-1)],64)):(m(),l(g,{key:0},[c(`span`,ht,v(cn(N.value)),1),p.canEditSource?(m(),l(`i`,{key:0,class:`ti ti-pencil edit-source-icon`,title:e(E)(`variablesTable.editParentTitle`),onClick:a[36]||=re(e=>x(`edit-source`),[`stop`])},null,8,gt)):b(``,!0)],64))])):(m(),l(`span`,_t,v(sn(N.value)||`…`),1)),F.value?(m(),l(`span`,vt,v(sn(F.value)),1)):b(``,!0)]))])):b(``,!0),p.showOverrides&&M.value?.trim()&&p.editable&&!en.value?(m(),l(`button`,{key:8,type:`button`,class:`add-section-btn`,onClick:tn},[a[68]||=c(`i`,{class:`ti ti-plus`},null,-1),c(`span`,null,v(e(E)(`variableRowEditor.addOverride`)),1)])):b(``,!0),p.showOverrides&&M.value?.trim()&&en.value?(m(),l(`div`,yt,[c(`div`,bt,[c(`div`,xt,[i(v(e(E)(`variableRowEditor.localOverride`))+` `,1),s(c(`i`,St,null,512),[[o,{value:e(E)(`variableRowEditor.localOverrideHint`),showDelay:0,hideDelay:0},void 0,{top:!0}]])]),p.editable&&J.value?(m(),y(e(ce),{key:0,icon:`ti ti-x`,variant:`text`,rounded:``,size:`small`,severity:`danger`,title:e(E)(`variableRowEditor.clearOverride`),disabled:p.disabled,onClick:pn},null,8,[`title`,`disabled`])):b(``,!0)]),c(`div`,Ct,[p.editable?(m(),l(g,{key:0},[c(`div`,wt,[c(`label`,Tt,v(e(E)(`variableRowEditor.prefix`)),1),p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-override-prefix`,modelValue:Y.value,"onUpdate:modelValue":a[37]||=e=>Y.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[38]||=e=>x(`autocomplete-search`,e),onBlur:a[39]||=e=>$(),onPicked:a[40]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:1,id:`varrow-override-prefix`,modelValue:Y.value,"onUpdate:modelValue":a[41]||=e=>Y.value=e,placeholder:e(E)(`variableRowEditor.prefixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`placeholder`,`disabled`]))]),c(`div`,Et,[c(`label`,{class:`expansion-label`,for:q.value?`varrow-override-value-secret`:`varrow-override-value-plain`},v(e(E)(`variableRowEditor.value`)),9,Dt),q.value?(m(),l(`div`,Ot,[r(e(w),{id:`varrow-override-value-secret`,modelValue:X.value,"onUpdate:modelValue":a[42]||=e=>X.value=e,type:A.value?`text`:`password`,placeholder:e(E)(`variableRowEditor.overrideValuePlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`type`,`placeholder`,`disabled`]),c(`button`,{type:`button`,class:`secret-toggle`,disabled:p.disabled,onClick:a[43]||=e=>A.value=!A.value,tabindex:`-1`},[c(`i`,{class:d(A.value?`ti ti-eye-off`:`ti ti-eye`)},null,2)],8,kt)])):rn(X.value)&&!ue.value?(m(),l(`span`,{key:1,class:`interpolation-badge`,title:X.value,onClick:a[44]||=e=>ue.value=!0},[r(e(T),{severity:`secondary`,value:an(X.value)},null,8,[`value`]),a[69]||=c(`i`,{class:`ti ti-pencil interpolation-edit-icon`},null,-1)],8,At)):p.autocompleteEnabled?(m(),y(W,{key:2,"input-id":`varrow-override-value-plain`,modelValue:X.value,"onUpdate:modelValue":a[45]||=e=>X.value=e,placeholder:e(E)(`variableRowEditor.overrideValuePlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[46]||=e=>x(`autocomplete-search`,e),onFocus:a[47]||=e=>ue.value=!0,onBlur:a[48]||=e=>{ue.value=!1,$()},onPicked:a[49]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:3,id:`varrow-override-value-plain`,modelValue:X.value,"onUpdate:modelValue":a[50]||=e=>X.value=e,placeholder:e(E)(`variableRowEditor.overrideValuePlaceholder`),class:`w-full`,disabled:p.disabled,onFocus:a[51]||=e=>ue.value=!0,onBlur:a[52]||=e=>{ue.value=!1,$()}},null,8,[`modelValue`,`placeholder`,`disabled`]))]),c(`div`,jt,[c(`label`,Mt,v(e(E)(`variableRowEditor.suffix`)),1),p.autocompleteEnabled?(m(),y(W,{key:0,"input-id":`varrow-override-suffix`,modelValue:Z.value,"onUpdate:modelValue":a[53]||=e=>Z.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),"env-keys":p.autocompleteSuggestions,meta:p.autocompleteMeta,"resolved-env":p.resolvedEnv,"service-builtins":p.serviceBuiltins,disabled:p.disabled,onSearch:a[54]||=e=>x(`autocomplete-search`,e),onBlur:a[55]||=e=>$(),onPicked:a[56]||=e=>$()},null,8,[`modelValue`,`placeholder`,`env-keys`,`meta`,`resolved-env`,`service-builtins`,`disabled`])):(m(),y(e(w),{key:1,id:`varrow-override-suffix`,modelValue:Z.value,"onUpdate:modelValue":a[57]||=e=>Z.value=e,placeholder:e(E)(`variableRowEditor.suffixPlaceholder`),class:`w-full`,disabled:p.disabled,onBlur:$},null,8,[`modelValue`,`placeholder`,`disabled`]))])],64)):(m(),l(`div`,Nt,[J.value?(m(),l(`span`,Pt,[c(`span`,Ft,[q.value||J.value.isSecret?(m(),l(`i`,{key:0,class:d([A.value?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),onClick:a[58]||=e=>A.value=!A.value},null,2)):b(``,!0),c(`i`,{class:d([de.value===`ovr`?`ti ti-check`:`ti ti-copy`,`action-icon`]),onClick:a[59]||=e=>j(`ovr`,J.value.pre+J.value.value+J.value.post)},null,2)]),q.value||J.value.isSecret?(m(),l(g,{key:0},[A.value?(m(),l(`code`,Lt,v(J.value.pre)+v(J.value.value)+v(J.value.post),1)):(m(),l(`span`,It,`***`))],64)):(m(),l(`code`,Rt,v(J.value.pre)+v(J.value.value)+v(J.value.post),1))])):(m(),l(`span`,zt,`—`))]))]),p.editable&&!q.value&&(Y.value||X.value||Z.value)?(m(),l(`code`,Bt,[Y.value?(m(),l(`span`,Vt,v(sn(Y.value)),1)):b(``,!0),rn(X.value)?(m(),l(`span`,Ht,[cn(X.value)==null?(m(),l(g,{key:1},[r(e(T),{severity:`secondary`,value:an(X.value),style:{"font-size":`0.7rem`}},null,8,[`value`]),a[70]||=c(`span`,{class:`prepost-unresolved`},`(?)`,-1)],64)):(m(),l(`span`,Ut,v(cn(X.value)),1))])):(m(),l(`span`,Wt,v(sn(X.value)||`…`),1)),Z.value?(m(),l(`span`,Gt,v(sn(Z.value)),1)):b(``,!0)])):b(``,!0)])):b(``,!0)],32)}}}),[[`__scopeId`,`data-v-88b44eb7`]]);function q(e){return e.tags?.length?[...e.tags].sort((e,t)=>e.localeCompare(t))[0]:null}function Jt(e,t){if(!e.key||!t.key)return Number(!e.key)-Number(!t.key);let n=q(e),r=q(t);return n===r?e.key.localeCompare(t.key):n===null?1:r===null?-1:n.localeCompare(r)}function Yt(e,t){return!t.length||!!e?.some(e=>t.includes(e))}var Xt=/\{\{environment\.([^}]+)\}\}/g;function Zt(e){let t=new Set;for(let n of e)for(let e of n.matchAll(Xt))t.add(e[1]);return[...t]}function Qt(e,t,n=[]){let r=new Set;for(let i of Zt(e))for(let e of t[i]??[])n.includes(e)||r.add(e);return[...r].sort((e,t)=>e.localeCompare(t))}function J(e,t){let n=e.filter(e=>t.includes(e));return n.length===e.length?e:n}var $t={class:`table-toolbar`},en={key:1,class:`overrides-filter`},tn={for:`overrides-filter`},Y={class:`text-center py-4 text-gray-500`},X={class:`row-key-cell`},Z={class:`row-key-line`},nn={class:`row-key`},rn=[`title`],an=[`title`],on={key:0,class:`row-tags`},sn={key:2,class:`resolved-from-line`},cn={class:`row-value`},ln=[`title`,`onClick`],un=[`title`,`onClick`],dn={key:1,class:`value-levels`},Q={class:`resolved-level`},fn={key:0,class:`secret-mask`},$=[`title`],pn={key:0,class:`secret-mask`},mn=[`title`],hn=[`title`],gn={key:6,class:`empty-value`},_n={key:0,class:`override-indicator`},vn=[`title`,`onClick`],yn=[`title`,`onClick`],bn={key:0,class:`override-value-masked`},xn=[`title`],Sn=[`title`],Cn={key:0,class:`parent-edit`},wn={class:`parent-edit__field`},Tn={class:`parent-edit__label`,for:`parent-edit-value`},En={class:`parent-edit__usages`},Dn={class:`parent-edit__usages-title`},On={key:0,class:`parent-edit__usages-loading`},kn={key:0,class:`parent-edit__usage-list`},An={class:`parent-edit__usage-env`},jn={key:0,class:`parent-edit__usage-svc`},Mn={key:1,class:`parent-edit__usages-empty`},Nn=40,Pn=200,Fn=24,In=D(te({__name:`VariablesTable`,props:{environmentId:{},resolvedEnv:{default:()=>({})},sources:{default:()=>({})},editable:{type:Boolean,default:!0},showOverrides:{type:Boolean,default:!1},showOverrideBadge:{type:Boolean,default:!1},showDelete:{type:Boolean,default:!0},showAddButton:{type:Boolean,default:!0},disabled:{type:Boolean,default:!1},autocompleteEnabled:{type:Boolean,default:!1},autocompleteSuggestions:{default:()=>[]},autocompleteMeta:{default:()=>({})},serviceBuiltins:{},scrollHeight:{default:`auto`},resolvedVariables:{default:()=>({})}},emits:[`autocomplete-search`,`variables-changed`],setup(n,{emit:te}){let h=be,x=/^\{\{environment\.([^{}]+)\}\}$/,S=Object.fromEntries(me.map(e=>[e.name,``])),C=n,D=te,{t:O}=ie(),j=fe(),pe=f(()=>Object.keys(C.sources).length>0),M=f(()=>Object.keys(C.resolvedEnv).length>0),N=o(`rootRef`),P=t(null),F=f(()=>C.scrollHeight===`auto`?P.value??`460px`:C.scrollHeight);function he(){if(C.scrollHeight!==`auto`)return;let e=N.value;if(!e)return;let t=(e.querySelector(`.r-datatable__container`)??e).getBoundingClientRect().top,n=window.innerHeight-t-Fn;P.value=`${Math.max(Pn,Math.round(n))}px`}let ge=null;ee(()=>{ne(he),window.addEventListener(`resize`,he),typeof ResizeObserver<`u`&&N.value&&(ge=new ResizeObserver(()=>he()),ge.observe(document.body))}),p(()=>{window.removeEventListener(`resize`,he),ge?.disconnect(),ge=null});let I=t(``),_e=t(!1),L=t([]),R=t({});async function z(){if(C.showOverrides)try{let e=await j.getOverrides(),t={};for(let[n,r]of Object.entries(e)){let e=r;t[n]={value:e.value.value,pre:e.value.pre,post:e.value.post,isSecret:e.value.isSecret}}R.value=t}catch{}}ee(z);let ye=f(()=>j.getById(C.environmentId));function B(e){return ye.value?.variables?.[e]}let V=f(()=>{let e=new Set;for(let t of j.environments)for(let n of Object.values(t.variables??{}))for(let t of n.tags??[])e.add(t);return[...e].sort((e,t)=>e.localeCompare(t))}),xe=f(()=>{let e={...Se.value};for(let t of Object.values(ye.value?.variables??{}))e[t.key]=t.tags??[];return e}),Se=f(()=>{let e=ye.value?.variables??{},t={};for(let[n,r]of Object.entries(C.resolvedVariables))n in e||(t[r.key]=r.tags??[]);return t});function Ce(e){let t=B(e);if(!t)return[];let n=R.value[e],r=[t.value?.value??``,t.value?.pre??``,t.value?.post??``];return n&&r.push(n.value,n.pre,n.post),Qt(r,{...xe.value,[t.key]:Se.value[t.key]??[]},t.tags??[])}function H(e){return[...B(e)?.tags??[],...Ce(e)]}let we=f(()=>{let e=new Set;for(let t of Object.keys(ye.value?.variables??{}))for(let n of H(t))e.add(n);return[...e].sort((e,t)=>e.localeCompare(t))});a(we,e=>{L.value=J(L.value,e)});let U=t([]),Te=f(()=>{let e=Object.keys(ye.value?.variables??{}).map(e=>({variableId:e})),t=new Set(e.map(e=>e.variableId)),n=U.value.filter(e=>!t.has(e)).map(e=>({variableId:e}));return[...e,...n]}),Ee=o(`tableRef`),W=t({}),G=t([]),K=t(new Set);function De(e){let t=new Set(K.value);t.has(e)?t.delete(e):t.add(e),K.value=t}let Oe=t(null);function ke(e,t){navigator.clipboard.writeText(t),Oe.value=e,setTimeout(()=>{Oe.value===e&&(Oe.value=null)},1500)}function Ae(e){let t=B(e);if(!t)return``;let n=t.value?.value??``;return Je(n)?Xe(n)??n:(t.value?.pre??``)+n+(t.value?.post??``)}let je=ae(),Me=t(null),Ne=t(!1),Pe=t(!1),Fe=t(!1),Ie=0,Le=t([]);async function Re(e){let t=C.sources[e]?.resolvedFrom,n=B(e)?.value?.value??``;if(!t||!n)return;let r=Ye(n),i=j.getById(t.environmentId),a=Object.entries(i?.variables??{}).find(([,e])=>e.key===r);if(!a){je.add({severity:`warn`,summary:O(`variablesTable.editParentNotFound`),life:4e3});return}let[o,s]=a;Me.value={key:r,environmentId:t.environmentId,environmentName:t.environmentName,variableId:o,value:s.value?.value??``,pre:s.value?.pre??``,post:s.value?.post??``,isSecret:s.value?.isSecret??!1,shareWithAi:s.value?.shareWithAi??!1,injectIntoAi:s.value?.injectIntoAi??!1,...s.tags?.length?{tags:s.tags}:{}},Le.value=[],Ne.value=!0,ze(r,t.environmentId)}async function ze(e,t){let n=++Ie;Fe.value=!0;try{let r=j.currentProjectId;if(!r)return;let i=await j.keyUsages(r,e,t);if(n!==Ie)return;Le.value=[...i.inheritedBy.map(e=>({kind:`inherits`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{}})),...i.definedIn.map(e=>({kind:`defines`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{}})),...i.referencedBy.map(e=>({kind:`references`,environmentName:e.environmentName,...e.serviceName?{serviceName:e.serviceName}:{},viaKey:e.key}))]}catch{n===Ie&&(Le.value=[])}finally{n===Ie&&(Fe.value=!1)}}async function Be(){let e=Me.value;if(e){Pe.value=!0;try{await j.upsertVariable(e.environmentId,e.variableId,{key:e.key,...e.tags?{tags:e.tags}:{},value:{value:e.value,pre:e.pre,post:e.post,isSecret:e.isSecret,shareWithAi:e.shareWithAi,injectIntoAi:e.injectIntoAi}}),Ne.value=!1,D(`variables-changed`)}catch(e){je.add({severity:`error`,summary:O(`common.error`),detail:e.message,life:4e3})}finally{Pe.value=!1}}}function Ve(e){let t=R.value[e];return t?t.pre+t.value+t.post:``}let He=f(()=>{let e=[...Te.value];if(_e.value&&(e=e.filter(e=>!!R.value[e.variableId])),L.value.length&&(e=e.filter(e=>U.value.includes(e.variableId)||Yt(H(e.variableId),L.value))),I.value.trim()){let t=I.value.toLowerCase();e=e.filter(e=>{let n=B(e.variableId);if(!n)return!1;if(n.key.toLowerCase().includes(t)||H(e.variableId).some(e=>e.toLowerCase().includes(t))||(n.value?.value??``).toLowerCase().includes(t))return!0;let r=R.value[e.variableId];return!!(r&&r.value.toLowerCase().includes(t))})}if(G.value.length>0)e.sort((e,t)=>{let n=G.value.indexOf(e.variableId),r=G.value.indexOf(t.variableId);return n===-1?1:r===-1?-1:n-r});else{let t=e=>({key:B(e)?.key??``,tags:H(e)});e.sort((e,n)=>Jt(t(e.variableId),t(n.variableId)))}return e});function Ue(e){let t=e.data.variableId;W.value[t]?(W.value={},G.value=[],We(t)):(G.value=He.value.map(e=>e.variableId),W.value={[t]:!0})}function We(e){ne(()=>{let t=Ee.value?.$el;if(!t)return;let n=He.value.findIndex(t=>t.variableId===e);n<0||t.querySelectorAll(`tbody tr[data-index]`)[n]?.scrollIntoView({block:`nearest`,behavior:`smooth`})})}function Ge(e){U.value=U.value.filter(t=>t!==e),W.value[e]&&(W.value={},G.value=[])}function Ke(e){U.value=U.value.filter(t=>t!==e)}function qe(){let e=de();U.value=[...U.value,e],G.value=[...Te.value.map(e=>e.variableId),e],ne(()=>{W.value={[e]:!0},ne(()=>{let e=document.querySelector(`.variables-expand-table .r-datatable__row-expansion:last-of-type`);e&&e.scrollIntoView({block:`nearest`,behavior:`smooth`})})})}function Je(e){return h.test(e)}function Ye(e){let t=e.match(h);return t?t[1].replace(/^(?:environment|service)\./,``):e}function Xe(e){let t=e.match(x);if(t)return C.resolvedEnv[t[1]]??null;let n=e.match(h);if(n){let e={...S,...C.serviceBuiltins};if(e[n[1]])return e[n[1]]}return null}function Ze(e){return e.length<=Nn?e:e.substring(0,Nn)+`…`}return(t,a)=>(m(),l(g,null,[c(`div`,{ref_key:`rootRef`,ref:N,class:`variables-table`},[c(`div`,$t,[r(e(w),{modelValue:I.value,"onUpdate:modelValue":a[0]||=e=>I.value=e,placeholder:`Search variables...`,class:`search-input`,size:`small`},null,8,[`modelValue`]),we.value.length?(m(),y(e(se),{key:0,modelValue:L.value,"onUpdate:modelValue":a[1]||=e=>L.value=e,options:we.value,placeholder:e(O)(`variablesTable.filterByTag`),display:`chip`,"max-selected-labels":2,"show-clear":``,size:`small`,class:`tag-filter`},null,8,[`modelValue`,`options`,`placeholder`])):b(``,!0),n.showOverrides?(m(),l(`div`,en,[r(e(le),{modelValue:_e.value,"onUpdate:modelValue":a[2]||=e=>_e.value=e,"input-id":`overrides-filter`},null,8,[`modelValue`]),c(`label`,tn,v(e(O)(`variablesTable.overriddenOnly`)),1)])):b(``,!0)]),r(e(ue),{ref_key:`tableRef`,ref:Ee,"expanded-rows":W.value,"onUpdate:expandedRows":a[6]||=e=>W.value=e,value:He.value,"data-key":`variableId`,size:`small`,class:`variables-expand-table`,scrollable:``,"scroll-height":F.value,onRowClick:Ue},{empty:_(()=>[c(`div`,Y,v(n.showAddButton?e(O)(`variablesTable.empty`):e(O)(`variablesTable.emptyReadonly`)),1)]),expansion:_(({data:t})=>[r(qt,{"environment-id":n.environmentId,"variable-id":t.variableId,overrides:R.value,editable:n.editable,"show-overrides":n.showOverrides,"show-delete":n.showDelete,"show-override-badge":n.showOverrideBadge,disabled:n.disabled,"resolved-env":n.resolvedEnv,"autocomplete-enabled":n.autocompleteEnabled,"autocomplete-suggestions":n.autocompleteSuggestions,"autocomplete-meta":n.autocompleteMeta,"service-builtins":{...e(S),...n.serviceBuiltins},"is-pending":U.value.includes(t.variableId),"known-tags":V.value,onDeleted:e=>Ge(t.variableId),onSaved:e=>Ke(t.variableId),onAutocompleteSearch:a[5]||=e=>D(`autocomplete-search`,e),onOverrideChanged:z,"can-edit-source":!!n.sources[t.variableId]?.resolvedFrom,onEditSource:e=>Re(t.variableId)},null,8,[`environment-id`,`variable-id`,`overrides`,`editable`,`show-overrides`,`show-delete`,`show-override-badge`,`disabled`,`resolved-env`,`autocomplete-enabled`,`autocomplete-suggestions`,`autocomplete-meta`,`service-builtins`,`is-pending`,`known-tags`,`onDeleted`,`onSaved`,`can-edit-source`,`onEditSource`])]),default:_(()=>[r(e(k),{expander:``,style:{width:`2.5rem`}}),r(e(k),{field:`variableId`,header:e(O)(`common.key`)},{body:_(({data:t})=>[c(`div`,X,[c(`span`,Z,[c(`code`,nn,v(B(t.variableId)?.key||`(new variable)`),1),n.sources[t.variableId]?.overriddenBy?(m(),l(`span`,{key:0,class:`overridden-badge overridden-badge--local`,title:e(O)(`variablesTable.localOverrideTooltip`,{env:n.sources[t.variableId].overriddenBy.environmentName})},[a[10]||=c(`i`,{class:`ti ti-device-desktop`},null,-1),i(` `+v(e(O)(`variablesTable.localOverride`)),1)],8,rn)):n.showOverrideBadge&&n.sources[t.variableId]?.overridden&&!Je(B(t.variableId)?.value?.value??``)?(m(),l(`span`,{key:1,class:`overridden-badge`,title:e(O)(`variablesTable.overrideTooltip`)},[a[11]||=c(`i`,{class:`ti ti-alert-triangle`},null,-1),i(` `+v(e(O)(`variablesTable.override`)),1)],8,an)):b(``,!0)]),H(t.variableId).length?(m(),l(`span`,on,[(m(!0),l(g,null,u(B(t.variableId)?.tags??[],t=>(m(),y(e(T),{key:t,severity:`secondary`,value:t,class:`row-tag`},null,8,[`value`]))),128)),(m(!0),l(g,null,u(Ce(t.variableId),t=>s((m(),y(e(T),{key:`inherited:`+t,severity:`secondary`,value:t,class:`row-tag row-tag--inherited`},null,8,[`value`])),[[e(A),e(O)(`variablesTable.inheritedTag`),void 0,{top:!0}]])),128))])):b(``,!0),pe.value&&n.sources[t.variableId]?(m(),y(ve,{key:1,"environment-id":n.sources[t.variableId].environmentId,class:`source-badge`},null,8,[`environment-id`])):b(``,!0),pe.value&&n.sources[t.variableId]?.resolvedFrom?(m(),l(`span`,sn,[a[12]||=c(`i`,{class:`ti ti-arrow-right resolved-from-arrow`},null,-1),r(ve,{"environment-id":n.sources[t.variableId].resolvedFrom.environmentId,class:`source-badge`},null,8,[`environment-id`])])):b(``,!0)])]),_:1},8,[`header`]),r(e(k),{header:e(O)(`common.value`)},{body:_(({data:t})=>[c(`span`,cn,[Ae(t.variableId)?(m(),l(`span`,{key:0,class:`value-actions`,onClick:a[3]||=re(()=>{},[`stop`])},[B(t.variableId)?.value?.isSecret?(m(),l(`i`,{key:0,class:d([K.value.has(t.variableId)?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),title:e(O)(`variablesTable.reveal`),onClick:e=>De(t.variableId)},null,10,ln)):b(``,!0),c(`i`,{class:d([Oe.value===t.variableId?`ti ti-check`:`ti ti-copy`,`action-icon`]),title:e(O)(`actions.copy`),onClick:e=>ke(t.variableId,Ae(t.variableId))},null,10,un)])):b(``,!0),Je(B(t.variableId)?.value?.value??``)&&Xe(B(t.variableId)?.value?.value??``)!=null?(m(),l(`span`,dn,[r(e(T),{severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``),class:`interpolation-hint-tag`},null,8,[`value`]),c(`span`,Q,[B(t.variableId)?.value?.isSecret&&!K.value.has(t.variableId)?(m(),l(`span`,fn,`***`)):(m(),l(`code`,{key:1,class:`resolved-final`,title:Xe(B(t.variableId)?.value?.value??``)},v(Ze(Xe(B(t.variableId)?.value?.value??``))),9,$))])])):Je(B(t.variableId)?.value?.value??``)&&M.value&&Xe(B(t.variableId)?.value?.value??``)==null?(m(),l(g,{key:2},[a[13]||=c(`i`,{class:`ti ti-alert-triangle unresolved-icon`},null,-1),r(e(T),{severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``)},null,8,[`value`]),a[14]||=c(`span`,{class:`unresolved-msg`},`Variable not found in this environment`,-1)],64)):Je(B(t.variableId)?.value?.value??``)?(m(),y(e(T),{key:3,severity:`secondary`,value:Ye(B(t.variableId)?.value?.value??``)},null,8,[`value`])):B(t.variableId)?.value?.isSecret?(m(),l(g,{key:4},[K.value.has(t.variableId)?(m(),l(`code`,{key:1,title:Ae(t.variableId)},v(Ze(Ae(t.variableId))),9,mn)):(m(),l(`span`,pn,`***`))],64)):B(t.variableId)?.value?.value||B(t.variableId)?.value?.pre||B(t.variableId)?.value?.post?(m(),l(`code`,{key:5,title:Ae(t.variableId)},v(Ze(Ae(t.variableId))),9,hn)):(m(),l(`span`,gn,`(empty)`))]),n.showOverrides&&!Je(B(t.variableId)?.value?.value??``)&&R.value[t.variableId]?(m(),l(`span`,_n,[a[15]||=c(`i`,{class:`ti ti-arrow-right`,style:{"font-size":`0.7rem`}},null,-1),c(`span`,{class:`value-actions`,onClick:a[4]||=re(()=>{},[`stop`])},[B(t.variableId)?.value?.isSecret||R.value[t.variableId].isSecret?(m(),l(`i`,{key:0,class:d([K.value.has(`ovr:`+t.variableId)?`ti ti-eye-off`:`ti ti-eye`,`action-icon`]),title:e(O)(`variablesTable.reveal`),onClick:e=>De(`ovr:`+t.variableId)},null,10,vn)):b(``,!0),c(`i`,{class:d([Oe.value===`ovr:`+t.variableId?`ti ti-check`:`ti ti-copy`,`action-icon`]),title:e(O)(`actions.copy`),onClick:e=>ke(`ovr:`+t.variableId,Ve(t.variableId))},null,10,yn)]),B(t.variableId)?.value?.isSecret||R.value[t.variableId].isSecret?(m(),l(g,{key:0},[K.value.has(`ovr:`+t.variableId)?(m(),l(`code`,{key:1,class:`override-value`,title:Ve(t.variableId)},v(Ze(Ve(t.variableId))),9,xn)):(m(),l(`span`,bn,`***`))],64)):(m(),l(`code`,{key:1,class:`override-value`,title:Ve(t.variableId)},v(Ze(Ve(t.variableId))),9,Sn))])):b(``,!0)]),_:1},8,[`header`])]),_:1},8,[`expanded-rows`,`value`,`scroll-height`]),n.showAddButton?(m(),y(e(ce),{key:0,type:`button`,label:e(O)(`variablesTable.addVariable`),icon:`ti ti-plus`,variant:`text`,disabled:n.disabled,class:`mt-3`,onClick:qe},null,8,[`label`,`disabled`])):b(``,!0)],512),r(e(E),{visible:Ne.value,"onUpdate:visible":a[9]||=e=>Ne.value=e,modal:``,header:e(O)(`variablesTable.editParentHeader`),style:{width:`38rem`,maxWidth:`95vw`}},{footer:_(()=>[r(e(ce),{label:e(O)(`actions.cancel`),variant:`text`,disabled:Pe.value,onClick:a[8]||=e=>Ne.value=!1},null,8,[`label`,`disabled`]),r(e(ce),{label:e(O)(`variablesTable.editParentConfirm`),severity:`warn`,loading:Pe.value,onClick:Be},null,8,[`label`,`loading`])]),default:_(()=>[Me.value?(m(),l(`div`,Cn,[r(e(oe),{severity:`warn`,class:`parent-edit__warning`},{default:_(()=>[i(v(e(O)(`variablesTable.editParentWarning`,{key:Me.value.key,env:Me.value.environmentName})),1)]),_:1}),c(`div`,wn,[c(`label`,Tn,v(e(O)(`common.value`)),1),r(e(w),{id:`parent-edit-value`,modelValue:Me.value.value,"onUpdate:modelValue":a[7]||=e=>Me.value.value=e,class:`w-full`,disabled:Pe.value},null,8,[`modelValue`,`disabled`])]),c(`div`,En,[c(`div`,Dn,[a[16]||=c(`i`,{class:`ti ti-sitemap`},null,-1),i(` `+v(e(O)(`variablesTable.editParentImpact`)),1)]),Fe.value?(m(),l(`div`,On,[a[17]||=c(`i`,{class:`ti ti-spin ti-loader-2`},null,-1),c(`span`,null,v(e(O)(`variablesTable.editParentLoading`)),1)])):(m(),l(g,{key:1},[Le.value.length?(m(),l(`ul`,kn,[(m(!0),l(g,null,u(Le.value,(t,n)=>(m(),l(`li`,{key:n},[r(e(T),{severity:t.kind===`references`?`info`:`secondary`,value:t.kind===`references`?t.viaKey:t.kind===`inherits`?e(O)(`variablesTable.editParentInherits`):e(O)(`variablesTable.editParentDefines`)},null,8,[`severity`,`value`]),c(`span`,An,v(t.environmentName),1),t.serviceName?(m(),l(`span`,jn,v(t.serviceName),1)):b(``,!0)]))),128))])):(m(),l(`div`,Mn,v(e(O)(`variablesTable.editParentNoUsage`)),1))],64))])])):b(``,!0)]),_:1},8,[`visible`,`header`])],64))}}),[[`__scopeId`,`data-v-1d1460fd`]]);function Ln(e,t){let n=j(),r=S(),i=P(),a=f(()=>{let t=n.getByRef({id:e(),orgId:r.activeOrgId});return t?t.serviceIds.map(e=>i.getById(e)).filter(e=>!!e):[]});return f(()=>{let e=M(a.value.map(e=>e.name)),n={};for(let r of a.value){let i=pe(r.name);i&&!e.has(i)&&Object.assign(n,N({name:r.name,id:r.id,ports:r.ports,localUrls:r.localUrls,url:r.url},t()))}return n})}function Rn(e){let t=F(),n=fe(),r=j(),i=S(),a=f(()=>{let r=e.environmentId()?n.getById(e.environmentId())?.agentId:void 0,i=e.agentId?.()??r;return i?t.getById(i):t.agents.find(e=>e.isLocal)??null}),{urlHost:o,serverHost:s}=I(()=>a.value?.config.id),c=Ln(e.projectId,()=>o.value);return{values:f(()=>{let t={};for(let e of me)t[e.name]=``;t[`runeya.HOST`]=s.value;let o=a.value?.status;o?.lanIp&&(t[`agent.HOST_LAN`]=o.lanIp),o?.os&&(t[`agent.OS`]=o.os),o?.home&&(t[`agent.HOME`]=o.home),a.value&&(t[`agent.NAME`]=a.value.config.name);let l=r.getByRef({id:e.projectId(),orgId:i.activeOrgId});l&&(t[`project.NAME`]=l.name);let u=e.environmentId()?n.getById(e.environmentId()):null;return u&&(t[`runeya.ENV_NAME`]=u.name),Object.assign(t,c.value),t}),agentEntry:a,urlHost:o}}function zn(e){let n=t([]),r=t({});function i(t){let i=e();if(!i)return;let a=t.toLowerCase(),o=Object.keys(i.env).filter(e=>e.toLowerCase().includes(a));n.value=o;let s=i.variables,c={};if(s)for(let e of o){let t=Object.values(s).find(t=>t.key===e);t&&(c[e]={key:e,isSecret:t.value?.isSecret??!1,pre:t.value?.pre??``,post:t.value?.post??``})}r.value=c}return{suggestions:n,meta:r,search:i}}export{ve as a,ye as i,Rn as n,In as r,zn as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{g as t}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n}from"./vue-i18n-o7yraQpR.js";import{r}from"./trpc-
|
|
1
|
+
import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{g as t}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n}from"./vue-i18n-o7yraQpR.js";import{r}from"./trpc-CFd5DIpB.js";import{n as i}from"./project.store-CXP-Oq1W.js";import{n as a}from"./cloud-auth-D_am4FlK.js";import{n as o,r as s}from"./cloud-session-CHtF1SMt.js";import{n as c}from"./cloud-client-CMfTrHgZ.js";var l=e({}),u=null;function d(){return u??=r.cloudSync.orgClouds.query().then(e=>{l.value=e}).catch(()=>{}),l}var f=e({}),p=null;function m(){return p??=r.cloudSync.orgLogos.query().then(e=>{f.value=e}).catch(()=>{}),f}async function h(e){if(e.length)try{await r.cloudSync.cacheOrgLogos.mutate({orgIds:e}),f.value=await r.cloudSync.orgLogos.query()}catch{}}function g(e,t){return`${(t??a()).replace(/\/+$/,``)}/api/org-logo/${encodeURIComponent(e)}`}function _(){let{t:l}=n(),u=i(),{accounts:d,orgAccounts:f,isLinked:p,refresh:m}=s(),g=e([]),_=e(!1),v=e(``),y=e({});async function b(){try{y.value=await r.cloudSync.orgNames.query()}catch{}}b();let x=t(()=>{let e=new Map;for(let t of u.projects){if(!t.orgId)continue;let n=f.value[t.orgId],r=e.get(t.orgId)??{orgId:t.orgId,name:``,projects:[],...n?{accountId:n}:{}};r.projects.push({projectId:t.id,name:t.name,local:!0}),e.set(t.orgId,r)}for(let t of g.value){let n=e.get(t.orgId)??{orgId:t.orgId,name:t.name,projects:[]};n.name=t.name,t.accountId&&(n.accountId=t.accountId),n.canDelete=t.canDelete;for(let e of t.projects)n.projects.some(t=>t.projectId===e.projectId)||n.projects.push(e);e.set(t.orgId,n)}for(let t of e.values())t.name||=y.value[t.orgId]??``,t.name||=l(`projectSwitcher.unknownOrg`,{id:t.orgId.slice(0,8)}),t.projects.sort((e,t)=>e.name.localeCompare(t.name));return[...e.values()]});async function S(){if(v.value=``,!p.value){g.value=[];return}_.value=!0;try{let e=new Set(u.projects.map(e=>e.id)),t;try{t=await o()}catch{throw Error(l(`projectSwitcher.orgsFailed`))}h(t.map(e=>e.id)),g.value=await Promise.all(t.map(async t=>{let n=await c.$fetch(`/project/list`,{method:`GET`,query:{organizationId:t.id},accountId:t.accountId});return{orgId:t.id,name:t.name,accountId:t.accountId,canDelete:n.data?.canDelete??!0,projects:(n.data?.projects??[]).map(t=>({projectId:t.projectId,name:t.name,local:e.has(t.projectId)}))}}))}catch(e){v.value=e instanceof Error?e.message:String(e)}finally{_.value=!1}}async function C(e,t,n){if(u.getByRef({id:t,orgId:e}))return;let i=d.value.find(e=>e.id===n),o=await r.cloudSync.trackProject.mutate({orgId:e,cloudUrl:i?.cloudUrl??a(),projectId:t,...n?{accountId:n}:{}});await w(e,t,o.state,o.pulled),await m()}async function w(e,t,n,r){if(!r&&n!==`live`)throw Object.assign(Error(T(n)),{syncState:n});for(let n=0;n<20;n++){if(await u.fetchAll(),u.getByRef({id:t,orgId:e}))return;await new Promise(e=>setTimeout(e,250))}throw Object.assign(Error(T(n)),{syncState:n})}function T(e){return l(e===`unauthenticated`?`projectSwitcher.syncPaused`:e===`outdated`?`projectSwitcher.syncOutdated`:e===`key-mismatch`?`projectSwitcher.syncKeyMismatch`:`projectSwitcher.pullTimeout`)}function E(e,t){let n=g.value.find(t=>t.orgId===e)?.projects.find(e=>e.projectId===t);n&&(n.local=!1)}return{orgGroups:x,loading:_,error:v,refreshCloud:S,pullProject:C,markUntracked:E}}export{m as i,g as n,d as r,_ as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as e}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n as t}from"./project-launch.store-
|
|
1
|
+
import{g as e}from"./runtime-core.esm-bundler-DujKY9QV.js";import{n as t}from"./project-launch.store-DBuxvZJr.js";import{n}from"./project.store-CXP-Oq1W.js";import{t as r}from"./open-project-org-BNDadG2_.js";import{r as i}from"./cloud-session-CHtF1SMt.js";function a(){let{user:a,currentAccount:o,loading:s,accountPending:c}=i(),l=n(),u=t(),d=e(()=>r(u,l)),f=e(()=>!!d.value&&o.value!==null),p=e(()=>f.value?d.value:``),m=e(()=>!!d.value&&!f.value&&(s.value||c.value)),h=e(()=>!!p.value||m.value);return{orgId:p,available:h,unavailability:e(()=>h.value?null:d.value?`not-member`:`local-project`),cloudUser:a}}export{a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{ct as t,g as n}from"./runtime-core.esm-bundler-DujKY9QV.js";import{r}from"./trpc-
|
|
1
|
+
import{C as e}from"./reactivity.esm-bundler-BQ9SB2vv.js";import{ct as t,g as n}from"./runtime-core.esm-bundler-DujKY9QV.js";import{r}from"./trpc-CFd5DIpB.js";import{_ as i}from"./dist-CjS_rxe9.js";import{t as a}from"./agent.store-5ggNQfb3.js";function o(o){let s=a(),c=n(()=>{let e=o?.();return e?s.getById(e):s.agents.find(e=>e.isLocal)??null}),l=e(`localhost`);return t(async()=>{try{l.value=(await r.settings.getNetwork.query()).host}catch{}}),{serverHost:l,urlHost:n(()=>i(l.value)||(c.value?.status.lanIp??`localhost`)),agent:c}}export{o as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./src-B1nAsOcw.js";
|
package/web/index.html
CHANGED
|
@@ -15,51 +15,51 @@
|
|
|
15
15
|
content="width=device-width, initial-scale=1.0, interactive-widget=resizes-content"
|
|
16
16
|
/>
|
|
17
17
|
<title>Runeya</title>
|
|
18
|
-
<script type="module" crossorigin src="/assets/index-
|
|
18
|
+
<script type="module" crossorigin src="/assets/index-Z4n9BqGD.js"></script>
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/assets/rolldown-runtime-Dd_uD5pT.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/assets/reactivity.esm-bundler-BQ9SB2vv.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="/assets/runtime-core.esm-bundler-DujKY9QV.js">
|
|
22
22
|
<link rel="modulepreload" crossorigin href="/assets/runtime-dom.esm-bundler-CyEVRK6B.js">
|
|
23
23
|
<link rel="modulepreload" crossorigin href="/assets/vue-i18n-o7yraQpR.js">
|
|
24
24
|
<link rel="modulepreload" crossorigin href="/assets/preload-helper-BZ1Pz5am.js">
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/auth-
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/trpc-
|
|
27
|
-
<link rel="modulepreload" crossorigin href="/assets/project-launch.store-
|
|
28
|
-
<link rel="modulepreload" crossorigin href="/assets/i18n-
|
|
25
|
+
<link rel="modulepreload" crossorigin href="/assets/auth-ArDkSMsT.js">
|
|
26
|
+
<link rel="modulepreload" crossorigin href="/assets/trpc-CFd5DIpB.js">
|
|
27
|
+
<link rel="modulepreload" crossorigin href="/assets/project-launch.store-DBuxvZJr.js">
|
|
28
|
+
<link rel="modulepreload" crossorigin href="/assets/i18n-f_6x1GJ8.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="/assets/useApi-s_02lHjl-DZYO2tHU.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/devtools-DCoWQoU_-D2vs4YXr.js">
|
|
31
31
|
<link rel="modulepreload" crossorigin href="/assets/vue-router--yRg_Dd_.js">
|
|
32
32
|
<link rel="modulepreload" crossorigin href="/assets/floating-ui.dom-DF3oyfHd.js">
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/src-
|
|
33
|
+
<link rel="modulepreload" crossorigin href="/assets/src-B1nAsOcw.js">
|
|
34
34
|
<link rel="modulepreload" crossorigin href="/assets/error-DpF7X5iu.js">
|
|
35
|
-
<link rel="modulepreload" crossorigin href="/assets/project.store-
|
|
35
|
+
<link rel="modulepreload" crossorigin href="/assets/project.store-CXP-Oq1W.js">
|
|
36
36
|
<link rel="modulepreload" crossorigin href="/assets/use-polling-CEkhIY_9.js">
|
|
37
37
|
<link rel="modulepreload" crossorigin href="/assets/useAiChatDrawer-D_ofn8Eo.js">
|
|
38
|
-
<link rel="modulepreload" crossorigin href="/assets/settings-scope-
|
|
38
|
+
<link rel="modulepreload" crossorigin href="/assets/settings-scope-EYddCMQs.js">
|
|
39
39
|
<link rel="modulepreload" crossorigin href="/assets/schemas-68I2iCLF.js">
|
|
40
|
-
<link rel="modulepreload" crossorigin href="/assets/dist-
|
|
41
|
-
<link rel="modulepreload" crossorigin href="/assets/service.store-
|
|
42
|
-
<link rel="modulepreload" crossorigin href="/assets/notification.store-
|
|
43
|
-
<link rel="modulepreload" crossorigin href="/assets/scenario.store-
|
|
40
|
+
<link rel="modulepreload" crossorigin href="/assets/dist-CjS_rxe9.js">
|
|
41
|
+
<link rel="modulepreload" crossorigin href="/assets/service.store-oNOqRX_s.js">
|
|
42
|
+
<link rel="modulepreload" crossorigin href="/assets/notification.store-C8qNYGB5.js">
|
|
43
|
+
<link rel="modulepreload" crossorigin href="/assets/scenario.store-B6TiJlpU.js">
|
|
44
44
|
<link rel="modulepreload" crossorigin href="/assets/app-mode-BVpTuh0i.js">
|
|
45
45
|
<link rel="modulepreload" crossorigin href="/assets/cloud-auth-D_am4FlK.js">
|
|
46
46
|
<link rel="modulepreload" crossorigin href="/assets/open-project-org-BNDadG2_.js">
|
|
47
|
-
<link rel="modulepreload" crossorigin href="/assets/cloud-session-
|
|
48
|
-
<link rel="modulepreload" crossorigin href="/assets/cloud-client-
|
|
49
|
-
<link rel="modulepreload" crossorigin href="/assets/useProjectCatalog-
|
|
47
|
+
<link rel="modulepreload" crossorigin href="/assets/cloud-session-CHtF1SMt.js">
|
|
48
|
+
<link rel="modulepreload" crossorigin href="/assets/cloud-client-CMfTrHgZ.js">
|
|
49
|
+
<link rel="modulepreload" crossorigin href="/assets/useProjectCatalog-DT8MiHr7.js">
|
|
50
50
|
<link rel="modulepreload" crossorigin href="/assets/editor.api-Bef3xeth.js">
|
|
51
51
|
<link rel="modulepreload" crossorigin href="/assets/toggleHighContrast-Dqz1Qao1.js">
|
|
52
52
|
<link rel="modulepreload" crossorigin href="/assets/register-BLGIM2pN.js">
|
|
53
|
-
<link rel="modulepreload" crossorigin href="/assets/agent.store-
|
|
54
|
-
<link rel="modulepreload" crossorigin href="/assets/AiChatModals-
|
|
53
|
+
<link rel="modulepreload" crossorigin href="/assets/agent.store-5ggNQfb3.js">
|
|
54
|
+
<link rel="modulepreload" crossorigin href="/assets/AiChatModals-Ccx5-MPb.js">
|
|
55
55
|
<link rel="modulepreload" crossorigin href="/assets/process-BWkHpZOM.js">
|
|
56
56
|
<link rel="modulepreload" crossorigin href="/assets/theme-BZCAxfJD.js">
|
|
57
|
-
<link rel="stylesheet" crossorigin href="/assets/src-
|
|
57
|
+
<link rel="stylesheet" crossorigin href="/assets/src-BR35jQnn.css">
|
|
58
58
|
<link rel="stylesheet" crossorigin href="/assets/scenario-DOeZsRCE.css">
|
|
59
59
|
<link rel="stylesheet" crossorigin href="/assets/editor-8AbsNvUX.css">
|
|
60
60
|
<link rel="stylesheet" crossorigin href="/assets/toggleHighContrast--ixms01u.css">
|
|
61
61
|
<link rel="stylesheet" crossorigin href="/assets/AiChatModals-DS5R3Oz1.css">
|
|
62
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
62
|
+
<link rel="stylesheet" crossorigin href="/assets/index-DiXnhxxp.css">
|
|
63
63
|
</head>
|
|
64
64
|
<body>
|
|
65
65
|
<div id="app"></div>
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
agentManager
|
|
3
|
-
} from "./chunk-TMX3NXMQ.js";
|
|
4
|
-
import "./chunk-NV7MBTNW.js";
|
|
5
|
-
import "./chunk-N4ZP7T6L.js";
|
|
6
|
-
import "./chunk-OZBSOSAS.js";
|
|
7
|
-
import "./chunk-JAMAGUGN.js";
|
|
8
|
-
import "./chunk-ETPXJSVC.js";
|
|
9
|
-
import "./chunk-EZ35ISYR.js";
|
|
10
|
-
export {
|
|
11
|
-
agentManager
|
|
12
|
-
};
|
|
13
|
-
//# sourceMappingURL=agent-manager-KDL4JWZN.js.map
|
package/chat-H5KZT3O6.js
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
chatRouter,
|
|
3
|
-
cliToken,
|
|
4
|
-
startClaudeCodeSession,
|
|
5
|
-
startCliSession,
|
|
6
|
-
startCodexSession
|
|
7
|
-
} from "./chunk-DVECWRFG.js";
|
|
8
|
-
import "./chunk-SGFGQ2EL.js";
|
|
9
|
-
import "./chunk-L3BEQ75K.js";
|
|
10
|
-
import "./chunk-SVKR7CYU.js";
|
|
11
|
-
import "./chunk-4HN2AGBV.js";
|
|
12
|
-
import "./chunk-V7WTXGEJ.js";
|
|
13
|
-
import "./chunk-TMX3NXMQ.js";
|
|
14
|
-
import "./chunk-NV7MBTNW.js";
|
|
15
|
-
import "./chunk-N4ZP7T6L.js";
|
|
16
|
-
import "./chunk-OZBSOSAS.js";
|
|
17
|
-
import "./chunk-JAMAGUGN.js";
|
|
18
|
-
import "./chunk-MD3VW4HQ.js";
|
|
19
|
-
import "./chunk-ETPXJSVC.js";
|
|
20
|
-
import "./chunk-EZ35ISYR.js";
|
|
21
|
-
export {
|
|
22
|
-
chatRouter,
|
|
23
|
-
cliToken,
|
|
24
|
-
startClaudeCodeSession,
|
|
25
|
-
startCliSession,
|
|
26
|
-
startCodexSession
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=chat-H5KZT3O6.js.map
|