orcaq 1.1.8 → 1.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{Cqk0ImDE.js → -WSV_TU1.js} +1 -1
  3. package/.output/public/_nuxt/0U50G6dt.js +1 -0
  4. package/.output/public/_nuxt/{mcYTISF7.js → 0yW2dL-K.js} +1 -1
  5. package/.output/public/_nuxt/{CXQ2zrsE.js → 1V1SIDI5.js} +1 -1
  6. package/.output/public/_nuxt/{Bu6ybm3Z.js → 24W1ftax.js} +1 -1
  7. package/.output/public/_nuxt/339BCoyy.js +1 -0
  8. package/.output/public/_nuxt/{XjywAggc.js → 9PqzQzi0.js} +1 -1
  9. package/.output/public/_nuxt/{DG9CsZCx.js → 9Skr9Ccw.js} +1 -1
  10. package/.output/public/_nuxt/{D8egDyEO.js → 9eKRx5AF.js} +1 -1
  11. package/.output/public/_nuxt/{FmHWbXNk.js → 9vfu7pKH.js} +1 -1
  12. package/.output/public/_nuxt/B79M7zD1.js +1 -0
  13. package/.output/public/_nuxt/{BsCPQnkm.js → BDw-ivE-.js} +1 -1
  14. package/.output/public/_nuxt/{DgxTwFGe.js → BFOjhnLA.js} +2 -2
  15. package/.output/public/_nuxt/{BWTTrGtY.js → BFYNB1ok.js} +2 -2
  16. package/.output/public/_nuxt/BFlFdtcI.js +12 -0
  17. package/.output/public/_nuxt/{BXMKgn-J.js → BIBdWmGh.js} +1 -1
  18. package/.output/public/_nuxt/{_uLivI44.js → BIDVPCgr.js} +1 -1
  19. package/.output/public/_nuxt/{BuTCm7Bo.js → BJMwGHo7.js} +1 -1
  20. package/.output/public/_nuxt/{BHr4_sbs.js → BKh6DDUh.js} +1 -1
  21. package/.output/public/_nuxt/{5450EsIE.js → BLDVl9Iw.js} +1 -1
  22. package/.output/public/_nuxt/{Cd_fVKDw.js → BNgGNFV2.js} +1 -1
  23. package/.output/public/_nuxt/BP-G5cXp.js +1 -0
  24. package/.output/public/_nuxt/{DkX74xDd.js → BS966b0P.js} +1 -1
  25. package/.output/public/_nuxt/{BQm1mt0O.js → B_Oy26qU.js} +1 -1
  26. package/.output/public/_nuxt/Bdou58NY.js +1 -0
  27. package/.output/public/_nuxt/Bg0K-n53.js +18 -0
  28. package/.output/public/_nuxt/{BO3FEgXG.js → BjfaOtB-.js} +1 -1
  29. package/.output/public/_nuxt/{BalNYDR1.js → BlngscFe.js} +1 -1
  30. package/.output/public/_nuxt/{DHXwq7wT.js → BsXv3P9A.js} +1 -1
  31. package/.output/public/_nuxt/{C-e53AuW.js → Buh85F8i.js} +1 -1
  32. package/.output/public/_nuxt/{CU5cwnUW.js → Bvi2huT8.js} +1 -1
  33. package/.output/public/_nuxt/{LxqkguPP.js → BxlUlYz1.js} +1 -1
  34. package/.output/public/_nuxt/ByJGqBjE.js +1 -0
  35. package/.output/public/_nuxt/{DCewvWOu.js → C-M7J4rh.js} +1 -1
  36. package/.output/public/_nuxt/{D_kY6P5P.js → C04-ICJx.js} +1 -1
  37. package/.output/public/_nuxt/{f6XRRKUb.js → C2Czrs1u.js} +1 -1
  38. package/.output/public/_nuxt/{CuXTA7ZW.js → C5Feel6b.js} +1 -1
  39. package/.output/public/_nuxt/CAVSZeVY.js +1 -0
  40. package/.output/public/_nuxt/{7iCr9_qw.js → CAcViJl9.js} +3 -3
  41. package/.output/public/_nuxt/CBge6eLY.js +1 -0
  42. package/.output/public/_nuxt/{BK-6CJ0A.js → CC8wYgAN.js} +1 -1
  43. package/.output/public/_nuxt/{WGDY9i_Q.js → CEIpXOz0.js} +1 -1
  44. package/.output/public/_nuxt/CI85gLx4.js +1 -0
  45. package/.output/public/_nuxt/{Dpkaavgs.js → CJeCcjmd.js} +1 -1
  46. package/.output/public/_nuxt/{CMDq7o88.js → CJuYfiL1.js} +1 -1
  47. package/.output/public/_nuxt/CNErkSjF.js +1 -0
  48. package/.output/public/_nuxt/COII6plA.js +31 -0
  49. package/.output/public/_nuxt/{R04uZjs6.js → CRCn6mdA.js} +1 -1
  50. package/.output/public/_nuxt/{tc7vkD0J.js → CUtdecax.js} +2 -2
  51. package/.output/public/_nuxt/{Dtry_3Qa.js → CYm7TuhP.js} +1 -1
  52. package/.output/public/_nuxt/{CMnjMfEQ.js → CbkolJXg.js} +1 -1
  53. package/.output/public/_nuxt/{CMI-3q_e.js → CeA2-eDW.js} +1 -1
  54. package/.output/public/_nuxt/CgY96xS_.js +1 -0
  55. package/.output/public/_nuxt/{JxgekUqn.js → Ch9kUYU-.js} +1 -1
  56. package/.output/public/_nuxt/{CCC5u9Ni.js → Ch_iEFHi.js} +1 -1
  57. package/.output/public/_nuxt/{DZ4xLzJg.js → Co6sZiuo.js} +1 -1
  58. package/.output/public/_nuxt/Cu7zvuYQ.js +1 -0
  59. package/.output/public/_nuxt/CwcaMelw.js +1 -0
  60. package/.output/public/_nuxt/CxFAImHj.js +1 -0
  61. package/.output/public/_nuxt/{jtwYTq7X.js → D-yya4MN.js} +32 -32
  62. package/.output/public/_nuxt/{D4DMGxvZ.js → D0NZRXnm.js} +1 -1
  63. package/.output/public/_nuxt/{vP25tZUh.js → D6XDbGbI.js} +1 -1
  64. package/.output/public/_nuxt/{BNh4NY7v.js → D8JEzGOU.js} +1 -1
  65. package/.output/public/_nuxt/{C874itvn.js → D8wbEppA.js} +1 -1
  66. package/.output/public/_nuxt/D9h-2lVu.js +1 -0
  67. package/.output/public/_nuxt/{D5Oboajo.js → DANeHzIE.js} +1 -1
  68. package/.output/public/_nuxt/{CyKRjZZo.js → DBku6oAz.js} +1 -1
  69. package/.output/public/_nuxt/{DJXrgohw.js → DDXEeq1n.js} +2 -2
  70. package/.output/public/_nuxt/DESxUB7o.js +1 -0
  71. package/.output/public/_nuxt/{CAjVwGyz.js → DHG-KJyJ.js} +1 -1
  72. package/.output/public/_nuxt/DHXbNYui.js +1 -0
  73. package/.output/public/_nuxt/{Dopm1f4X.js → DI0LPDTd.js} +1 -1
  74. package/.output/public/_nuxt/{BmfnP4qD.js → DKSZP8GP.js} +1 -1
  75. package/.output/public/_nuxt/DL1qmlP8.js +1 -0
  76. package/.output/public/_nuxt/{BMVgfiQu.js → DN4-koTG.js} +1 -1
  77. package/.output/public/_nuxt/{BRzWRTTF.js → DO1jmufl.js} +1 -1
  78. package/.output/public/_nuxt/{DpsqSAMo.js → DOuNj3Jn.js} +1 -1
  79. package/.output/public/_nuxt/DPUO8R7l.js +1 -0
  80. package/.output/public/_nuxt/{C0jXhwNq.js → DahDvheq.js} +1 -1
  81. package/.output/public/_nuxt/{BRCvv3op.js → DbHH7dzg.js} +1 -1
  82. package/.output/public/_nuxt/{C6teO48Y.js → DbehhcO7.js} +76 -76
  83. package/.output/public/_nuxt/{CQFANjzf.js → DeTqfKUd.js} +1 -1
  84. package/.output/public/_nuxt/{B6N_D8QI.js → Df85byjM.js} +1 -1
  85. package/.output/public/_nuxt/{B0gkARnK.js → DizXDCtS.js} +1 -1
  86. package/.output/public/_nuxt/{WZQ8mcv9.js → DjKlFOO8.js} +1 -1
  87. package/.output/public/_nuxt/{CCCJ2fw7.js → DjLd7E2v.js} +1 -1
  88. package/.output/public/_nuxt/{DXVrM3CN.js → DnBjpGBx.js} +1 -1
  89. package/.output/public/_nuxt/DnQ4Mwo_.js +1 -0
  90. package/.output/public/_nuxt/{Cw1HIv3s.js → DqYakCiF.js} +1 -1
  91. package/.output/public/_nuxt/{DBSV6YXN.js → DqunUhPG.js} +1 -1
  92. package/.output/public/_nuxt/{CFi6G8Aj.js → Dr1ZFb1n.js} +2 -2
  93. package/.output/public/_nuxt/Dsis422h.js +1 -0
  94. package/.output/public/_nuxt/{DwPmcz47.js → Du_4PNZI.js} +1 -1
  95. package/.output/public/_nuxt/{7H5y5euK.js → DvTZ16yM.js} +1 -1
  96. package/.output/public/_nuxt/{CyEOtFwE.js → Dvt9REJL.js} +1 -1
  97. package/.output/public/_nuxt/{DQRyK9Io.js → DxMpy-ot.js} +1 -1
  98. package/.output/public/_nuxt/{BRWis86L.js → DyLnyCs4.js} +1 -1
  99. package/.output/public/_nuxt/{DmnufEYq.js → FakvzamF.js} +1 -1
  100. package/.output/public/_nuxt/LcPL138_.js +1 -0
  101. package/.output/public/_nuxt/{CXbrqQhC.js → P7T0pdFZ.js} +1 -1
  102. package/.output/public/_nuxt/{LU_a7qLd.js → Rhi-lAfN.js} +1 -1
  103. package/.output/public/_nuxt/S7ftI9sn.js +1 -0
  104. package/.output/public/_nuxt/T01BrTsW.js +1 -0
  105. package/.output/public/_nuxt/WqpfmT0s.js +1 -0
  106. package/.output/public/_nuxt/XhSVj1eQ.js +16 -0
  107. package/.output/public/_nuxt/{vEHvfalB.js → _fXjN5Pd.js} +1 -1
  108. package/.output/public/_nuxt/agpUpIJe.js +1 -0
  109. package/.output/public/_nuxt/builds/latest.json +1 -1
  110. package/.output/public/_nuxt/builds/meta/39c2c89f-bb28-470e-b95a-b7776149dc9f.json +1 -0
  111. package/.output/public/_nuxt/{CvbYm0uB.js → dDyWVWO8.js} +1 -1
  112. package/.output/public/_nuxt/entry.BeX6Jkel.css +1 -0
  113. package/.output/public/_nuxt/{DrkGD_bQ.js → f6qCSD-K.js} +1 -1
  114. package/.output/public/_nuxt/{zndqWf9s.js → goG5gpyv.js} +1 -1
  115. package/.output/public/_nuxt/{soHTUlpn.js → hbGkF-4Z.js} +1 -1
  116. package/.output/public/_nuxt/{CKlMKmo6.js → jDSo3fNb.js} +1 -1
  117. package/.output/public/_nuxt/{BzNEuLKx.js → k4d17TZz.js} +1 -1
  118. package/.output/public/_nuxt/m4Dxzyfa.js +2 -0
  119. package/.output/public/_nuxt/{BJvJ0Hlu.js → ndyknmtb.js} +4 -4
  120. package/.output/public/_nuxt/{C6K-C4_d.js → vIV0z0PD.js} +1 -1
  121. package/.output/public/_nuxt/{BzqjH2-H.js → wTs8ybMd.js} +1 -1
  122. package/.output/public/_nuxt/{BYaoWfSN.js → ymlmmOzU.js} +1 -1
  123. package/.output/server/chunks/_/tables.factory.mjs +133 -43
  124. package/.output/server/chunks/_/tables.factory.mjs.map +1 -1
  125. package/.output/server/chunks/build/client.manifest.mjs +837 -788
  126. package/.output/server/chunks/build/client.manifest.mjs.map +1 -1
  127. package/.output/server/chunks/nitro/nitro.mjs +697 -669
  128. package/.output/server/package.json +1 -1
  129. package/package.json +1 -1
  130. package/.output/public/_nuxt/-7uW7YTy.js +0 -1
  131. package/.output/public/_nuxt/6mVUr42b.js +0 -1
  132. package/.output/public/_nuxt/B21nC2NZ.js +0 -1
  133. package/.output/public/_nuxt/B232GDut.js +0 -2
  134. package/.output/public/_nuxt/B7C8fo37.js +0 -1
  135. package/.output/public/_nuxt/BC82eJHt.js +0 -1
  136. package/.output/public/_nuxt/Bn6_QGSK.js +0 -1
  137. package/.output/public/_nuxt/BuzCyLCh.js +0 -1
  138. package/.output/public/_nuxt/BzNNFvTW.js +0 -1
  139. package/.output/public/_nuxt/C8ZJ2pm_.js +0 -1
  140. package/.output/public/_nuxt/CA3O4M9L.js +0 -1
  141. package/.output/public/_nuxt/CZXyfpHW.js +0 -1
  142. package/.output/public/_nuxt/CZgTP5wX.js +0 -1
  143. package/.output/public/_nuxt/CeXnSKvd.js +0 -1
  144. package/.output/public/_nuxt/Chw5tFzx.js +0 -1
  145. package/.output/public/_nuxt/CkLSGVwV.js +0 -1
  146. package/.output/public/_nuxt/Cv9v5fHN.js +0 -1
  147. package/.output/public/_nuxt/D5GonnbJ.js +0 -1
  148. package/.output/public/_nuxt/DH2V7e8U.js +0 -1
  149. package/.output/public/_nuxt/DZIoL4RO.js +0 -1
  150. package/.output/public/_nuxt/DyjsVMbv.js +0 -1
  151. package/.output/public/_nuxt/KoGK2wLb.js +0 -1
  152. package/.output/public/_nuxt/Q8x88Gcd.js +0 -1
  153. package/.output/public/_nuxt/So0hX8V0.js +0 -31
  154. package/.output/public/_nuxt/builds/meta/30582efd-125a-4f88-bd89-20a7b2ba8697.json +0 -1
  155. package/.output/public/_nuxt/eQskTKIU.js +0 -1
  156. package/.output/public/_nuxt/ecWNT6PZ.js +0 -1
  157. package/.output/public/_nuxt/entry.BcHy7sxf.css +0 -1
  158. package/.output/public/_nuxt/mcfKrWU-.js +0 -1
@@ -1 +1 @@
1
- import{ar as m,D as a,A as f,as as ie,W as le,X as r,at as N,r as E,au as G,av as y,aw as B,ax as T,a as ce,c as v,a8 as ue,am as O,ay as de,az as he,aA as D}from"./C6teO48Y.js";const Se=[{type:a.POSTGRES,name:"PostgreSQL",icon:m(f,{name:"logos:postgresql"}),isSupport:!0,description:"Relational SQL workflows"},{type:a.MYSQL,name:"MySQL",icon:m(f,{name:"logos:mysql"}),isSupport:!0,isBeta:!0,description:"Relational SQL workflows"},{type:a.MARIADB,name:"MariaDB",icon:m(f,{name:"logos:mariadb-icon"}),isSupport:!0,isBeta:!0,description:"Relational SQL workflows"},{type:a.ORACLE,name:"Oracle",icon:m(f,{name:"simple-icons:oracle",class:"text-red-500"}),isSupport:!1,unsupportedLabel:"Coming soon",description:"Relational SQL workflows"},{type:a.SQLITE3,name:"SQLite",icon:m(f,{name:"file-icons:sqlite"}),isSupport:!0,isBeta:!0,description:"Local file, Cloudflare D1, Turso"},{type:a.REDIS,name:"Redis",icon:m(f,{name:"logos:redis"}),isSupport:!0,isBeta:!0,description:"Browser, workbench, analysis"},{type:a.MSSQL,name:"SQL Server",icon:m(f,{name:"simple-icons:microsoftsqlserver"}),isSupport:!1,unsupportedLabel:"Coming soon"},{type:a.SNOWFLAKE,name:"Snowflake",icon:m(f,{name:"simple-icons:snowflake"}),isSupport:!1,unsupportedLabel:"Coming soon"}],ve={[a.MYSQL2]:a.MYSQL,[a.BETTER_SQLITE3]:a.SQLITE3},pe={[a.POSTGRES]:"5432",[a.MYSQL]:"3306",[a.MARIADB]:"3306",[a.MYSQL2]:"3306",[a.REDIS]:"6379",[a.MSSQL]:"1433",[a.ORACLE]:"1521",[a.BETTER_SQLITE3]:"0",[a.SQLITE3]:"0",[a.SNOWFLAKE]:"443"},Te=t=>{const u=ve[t]??t;return Se.find(d=>d.type===u)},Ae=t=>t!==!1&&t!=="false"&&t!=="0",Re=(t,u)=>t.type===a.SQLITE3&&!u;function me(t){const u=ie({type:t.type,method:t.method,providerKind:"providerKind"in t?t.providerKind:void 0,managedSqlite:"managedSqlite"in t?t.managedSqlite:void 0}),d=le({type:t.type,method:t.method,providerKind:u,managedSqlite:"managedSqlite"in t?t.managedSqlite:void 0});return t.method===r.MANAGED?{...t,providerKind:u,family:d}:{...t,providerKind:u,family:d}}const fe={healthCheck:t=>$fetch("/api/managment-connection/health-check",{method:"POST",body:me(t)})},Ee=new Set([r.STRING,r.FORM]),_=t=>t?t===a.SQLITE3?[r.FILE,r.MANAGED]:[r.STRING,r.FORM]:[],R=()=>({provider:T.CLOUDFLARE_D1,accountId:"",databaseId:"",databaseName:"",apiToken:"",url:"",authToken:"",branchName:""}),Y=t=>t===T.TURSO?D.TURSO:D.CLOUDFLARE_D1,ge=t=>t===a.ORACLE?"serviceName":"database",Le=t=>{switch(t){case a.POSTGRES:return"postgresql";case a.MARIADB:return"mariadb";case a.ORACLE:return"oracledb";case a.REDIS:return"redis";case a.SNOWFLAKE:return"snowflake";case a.MYSQL:case a.MYSQL2:return"mysql";default:return""}},be=t=>{const u=t.replace(/\\/g,"/");return`sqlite3://${u.startsWith("/")?"":"/"}${u}`},Ie=t=>{const u=t.split(/[\\/]/).pop()||"";return u.replace(/\.(sqlite3?|db3?)$/i,"")||u};function we(t){const u=N(t.open),d=N(t.editingConnection),$=N(t.workspaceId),b=E(1),c=E(a.POSTGRES),g=E("my-abc-db"),l=E(r.STRING),I=E(""),e=G({host:"",port:"",username:"",password:"",database:"",serviceName:"",filePath:"",sslEnabled:!1,sslMode:B.DISABLE,sslCA:"",sslCert:"",sslKey:"",sslRejectUnauthorized:!0,sshEnabled:!1,sshHost:"",sshPort:22,sshUsername:"",sshAuthMethod:y.PASSWORD,sshPassword:"",sshPrivateKey:"",sshStoreInKeychain:!0,sshUseKey:!1}),i=G(R()),w=E([]),h=E("idle"),p=E(""),j=ce(),W=v(()=>_(c.value)),C=v(()=>ue()),z=v(()=>l.value===r.FILE),K=v(()=>{var n;return c.value===a.SQLITE3&&C.value&&typeof window<"u"&&typeof((n=window.electronAPI)==null?void 0:n.window.pickSqliteFile)=="function"}),A=v(()=>ge(c.value)==="serviceName"),H=v(()=>A.value?"Service Name":"Database"),x=v(()=>A.value?"ORCLPDB1":"my_database"),M=v(()=>Ee.has(l.value)),L=n=>n&&pe[n]||"",V=()=>{const n=j.tags.find(o=>o.name==="dev");return n?[n.id]:[]},X=()=>{if(!(!e.sslEnabled||!M.value))return{mode:e.sslMode,ca:e.sslCA,cert:e.sslCert,key:e.sslKey,rejectUnauthorized:e.sslRejectUnauthorized}},J=()=>{if(!(!e.sshEnabled||!M.value))return{enabled:!0,host:e.sshHost,port:e.sshPort,username:e.sshUsername,authMethod:e.sshUseKey?y.KEY:y.PASSWORD,password:e.sshPassword,privateKey:e.sshPrivateKey,storeInKeychain:e.sshStoreInKeychain,useSshKey:e.sshUseKey}},k=()=>{const n={host:e.host,port:e.port||L(c.value),username:e.username,password:e.password,ssl:X(),ssh:J()};return A.value?n.serviceName=e.serviceName:n.database=e.database,n},q=()=>i.provider===T.TURSO?{provider:T.TURSO,url:i.url,authToken:i.authToken,branchName:i.branchName}:{provider:T.CLOUDFLARE_D1,accountId:i.accountId,databaseId:i.databaseId,databaseName:i.databaseName,apiToken:i.apiToken},Z=()=>{const n=Le(c.value),o=e.port||L(c.value),s=A.value?e.serviceName:e.database;if(!n||!e.host||!e.username||!s)return;const P=e.password?`${e.username}:${e.password}`:e.username;return`${n}://${P}@${e.host}${o?`:${o}`:""}/${s}`},ee=()=>{const n=c.value;if(!n)throw new Error("Database type is required.");return l.value===r.STRING?{type:n,method:r.STRING,stringConnection:I.value}:l.value===r.FILE?{type:a.SQLITE3,method:r.FILE,filePath:e.filePath}:l.value===r.MANAGED?{type:a.SQLITE3,method:r.MANAGED,providerKind:Y(i.provider),managedSqlite:q()}:{type:n,method:r.FORM,...k()}},Q=()=>{b.value=1,c.value=a.POSTGRES,g.value="my-abc-db",l.value=r.STRING,I.value="",e.host="",e.port=L(a.POSTGRES),e.username="",e.password="",e.database="",e.serviceName="",e.filePath="",e.sslEnabled=!1,e.sslMode=B.DISABLE,e.sslCA="",e.sslCert="",e.sslKey="",e.sslRejectUnauthorized=!0,e.sshEnabled=!1,e.sshHost="",e.sshPort=22,e.sshUsername="",e.sshAuthMethod=y.PASSWORD,e.sshPassword="",e.sshPrivateKey="",e.sshStoreInKeychain=!0,e.sshUseKey=!1,Object.assign(i,R()),w.value=V(),h.value="idle",p.value=""},se=()=>{b.value===1&&c.value&&(b.value=2)},ae=()=>{b.value=1,h.value="idle",p.value=""},F=async()=>{var n;if(l.value===r.FILE&&!C.value)return h.value="error",p.value="SQLite file connections are available only in the desktop app.",!1;h.value="testing",p.value="";try{const o=await fe.healthCheck(ee());return o.isConnectedSuccess?(h.value="success",p.value="",!0):(h.value="error",p.value=o.message||"Connection failed. Please check your details and try again.",!1)}catch(o){return h.value="error",p.value=((n=o==null?void 0:o.data)==null?void 0:n.message)||(o==null?void 0:o.message)||"Connection failed. Please check your details and try again.",!1}},te=async()=>{var P,U;const o=!!!d.value;if(o&&!await F())return;const s={workspaceId:$.value,id:((P=d.value)==null?void 0:P.id)||he(),name:g.value,type:c.value,method:l.value,createdAt:((U=d.value)==null?void 0:U.createdAt)||de().toISOString(),tagIds:[...w.value]};if(l.value===r.STRING)s.connectionString=I.value;else if(l.value===r.FILE)s.filePath=e.filePath,s.connectionString=be(e.filePath),s.providerKind=D.SQLITE_FILE;else if(l.value===r.MANAGED)s.providerKind=Y(i.provider),s.managedSqlite=q();else{const S=k();s.host=S.host,s.port=S.port,s.username=S.username,s.password=S.password,s.database=S.database,s.serviceName=S.serviceName,s.ssl=S.ssl,s.ssh=S.ssh,s.connectionString=Z()}o?t.onAddNew(s):t.onUpdate(s),t.onClose()},ne=()=>{switch(c.value){case a.POSTGRES:return"postgresql://username:password@localhost:5432/database";case a.MYSQL:case a.MYSQL2:return"mysql://username:password@localhost:3306/database";case a.MARIADB:return"mariadb://username:password@localhost:3306/database";case a.ORACLE:return"oracledb://username:password@localhost:1521/ORCLPDB1";case a.REDIS:return"redis://username:password@localhost:6379";case a.SNOWFLAKE:return"snowflake://username:password@account.snowflakecomputing.com:443/database";case a.SQLITE3:return"/Users/you/data/app.sqlite";default:return""}},oe=async()=>{var o;if(!K.value)return;const n=await((o=window.electronAPI)==null?void 0:o.window.pickSqliteFile());n&&(e.filePath=n,!d.value&&g.value==="my-abc-db"&&(g.value=Ie(n)),h.value="idle")},re=v(()=>g.value?l.value===r.STRING?!!I.value:l.value===r.FILE?C.value&&!!e.filePath:l.value===r.MANAGED?i.provider===T.TURSO?!!(i.url&&i.authToken):!!(i.accountId&&i.databaseId&&i.apiToken):A.value?!!(e.host&&(e.port||L(c.value))&&e.username&&e.password&&e.serviceName):!!(e.host&&(e.port||L(c.value))&&e.username&&e.database):!1);return O(c,n=>{const o=_(n);o.length>0&&!o.includes(l.value)&&(l.value=o[0]),n===a.SQLITE3?(e.host="",e.port="",e.username="",e.password="",e.database="",e.serviceName="",e.sslEnabled=!1,e.sshEnabled=!1):(e.filePath="",Object.assign(i,R()),n!==a.ORACLE&&(e.serviceName=""),d.value||(e.port=L(n))),h.value="idle"}),O(l,n=>{n!==r.FILE&&(e.filePath=""),n!==r.MANAGED&&Object.assign(i,R()),h.value="idle"}),O(u,n=>{var o;if(n)if(d.value){const s=d.value;g.value=s.name,c.value=s.type,l.value=s.method,I.value=s.connectionString||"",e.host=s.host||"",e.port=s.port||"",e.username=s.username||"",e.password=s.password||"",e.database=s.database||"",e.serviceName=s.serviceName||"",e.filePath=s.filePath||"",Object.assign(i,{...R(),...s.managedSqlite??{}}),e.sslEnabled=!!s.ssl,s.ssl&&(e.sslMode=s.ssl.mode,e.sslCA=s.ssl.ca||"",e.sslCert=s.ssl.cert||"",e.sslKey=s.ssl.key||"",e.sslRejectUnauthorized=s.ssl.rejectUnauthorized??!0),e.sshEnabled=!!((o=s.ssh)!=null&&o.enabled),s.ssh&&(e.sshHost=s.ssh.host||"",e.sshPort=s.ssh.port||22,e.sshUsername=s.ssh.username||"",e.sshAuthMethod=s.ssh.authMethod||y.PASSWORD,e.sshPassword=s.ssh.password||"",e.sshPrivateKey=s.ssh.privateKey||"",e.sshStoreInKeychain=s.ssh.storeInKeychain??!0,e.sshUseKey=s.ssh.useSshKey??s.ssh.authMethod===y.KEY),w.value=[...s.tagIds??[]],b.value=2}else Q()},{immediate:!0}),{step:b,dbType:c,connectionName:g,connectionMethod:l,connectionString:I,formData:e,managedSqlite:i,tagIds:w,testStatus:h,testErrorMessage:p,handleNext:se,handleBack:ae,handleTestConnection:F,handleCreateConnection:te,getDefaultPort:()=>L(c.value),getConnectionPlaceholder:ne,availableConnectionMethods:W,structuredTargetLabel:H,structuredTargetPlaceholder:x,canUseNetworkOptions:M,canPickSqliteFile:K,isFileMethod:z,isFormValid:re,pickSqliteFile:oe,resetForm:Q}}export{Re as a,Se as d,Te as g,Ae as i,we as u};
1
+ import{ar as m,D as a,_ as f,as as ie,W as le,X as r,at as N,r as E,au as G,av as y,aw as B,ax as T,h as ce,i as v,a8 as ue,am as O,ay as de,az as he,aA as D}from"./DbehhcO7.js";const Se=[{type:a.POSTGRES,name:"PostgreSQL",icon:m(f,{name:"logos:postgresql"}),isSupport:!0,description:"Relational SQL workflows"},{type:a.MYSQL,name:"MySQL",icon:m(f,{name:"logos:mysql"}),isSupport:!0,isBeta:!0,description:"Relational SQL workflows"},{type:a.MARIADB,name:"MariaDB",icon:m(f,{name:"logos:mariadb-icon"}),isSupport:!0,isBeta:!0,description:"Relational SQL workflows"},{type:a.ORACLE,name:"Oracle",icon:m(f,{name:"simple-icons:oracle",class:"text-red-500"}),isSupport:!1,unsupportedLabel:"Coming soon",description:"Relational SQL workflows"},{type:a.SQLITE3,name:"SQLite",icon:m(f,{name:"file-icons:sqlite"}),isSupport:!0,isBeta:!0,description:"Local file, Cloudflare D1, Turso"},{type:a.REDIS,name:"Redis",icon:m(f,{name:"logos:redis"}),isSupport:!0,isBeta:!0,description:"Browser, workbench, analysis"},{type:a.MSSQL,name:"SQL Server",icon:m(f,{name:"simple-icons:microsoftsqlserver"}),isSupport:!1,unsupportedLabel:"Coming soon"},{type:a.SNOWFLAKE,name:"Snowflake",icon:m(f,{name:"simple-icons:snowflake"}),isSupport:!1,unsupportedLabel:"Coming soon"}],ve={[a.MYSQL2]:a.MYSQL,[a.BETTER_SQLITE3]:a.SQLITE3},pe={[a.POSTGRES]:"5432",[a.MYSQL]:"3306",[a.MARIADB]:"3306",[a.MYSQL2]:"3306",[a.REDIS]:"6379",[a.MSSQL]:"1433",[a.ORACLE]:"1521",[a.BETTER_SQLITE3]:"0",[a.SQLITE3]:"0",[a.SNOWFLAKE]:"443"},Te=t=>{const u=ve[t]??t;return Se.find(d=>d.type===u)},Re=t=>t!==!1&&t!=="false"&&t!=="0",we=(t,u)=>t.type===a.SQLITE3&&!u;function me(t){const u=ie({type:t.type,method:t.method,providerKind:"providerKind"in t?t.providerKind:void 0,managedSqlite:"managedSqlite"in t?t.managedSqlite:void 0}),d=le({type:t.type,method:t.method,providerKind:u,managedSqlite:"managedSqlite"in t?t.managedSqlite:void 0});return t.method===r.MANAGED?{...t,providerKind:u,family:d}:{...t,providerKind:u,family:d}}const fe={healthCheck:t=>$fetch("/api/managment-connection/health-check",{method:"POST",body:me(t)})},Ee=new Set([r.STRING,r.FORM]),_=t=>t?t===a.SQLITE3?[r.FILE,r.MANAGED]:[r.STRING,r.FORM]:[],w=()=>({provider:T.CLOUDFLARE_D1,accountId:"",databaseId:"",databaseName:"",apiToken:"",url:"",authToken:"",branchName:""}),Y=t=>t===T.TURSO?D.TURSO:D.CLOUDFLARE_D1,ge=t=>t===a.ORACLE?"serviceName":"database",Le=t=>{switch(t){case a.POSTGRES:return"postgresql";case a.MARIADB:return"mariadb";case a.ORACLE:return"oracledb";case a.REDIS:return"redis";case a.SNOWFLAKE:return"snowflake";case a.MYSQL:case a.MYSQL2:return"mysql";default:return""}},be=t=>{const u=t.replace(/\\/g,"/");return`sqlite3://${u.startsWith("/")?"":"/"}${u}`},Ie=t=>{const u=t.split(/[\\/]/).pop()||"";return u.replace(/\.(sqlite3?|db3?)$/i,"")||u};function Ae(t){const u=N(t.open),d=N(t.editingConnection),$=N(t.workspaceId),b=E(1),c=E(a.POSTGRES),g=E("my-abc-db"),l=E(r.STRING),I=E(""),e=G({host:"",port:"",username:"",password:"",database:"",serviceName:"",filePath:"",sslEnabled:!1,sslMode:B.DISABLE,sslCA:"",sslCert:"",sslKey:"",sslRejectUnauthorized:!0,sshEnabled:!1,sshHost:"",sshPort:22,sshUsername:"",sshAuthMethod:y.PASSWORD,sshPassword:"",sshPrivateKey:"",sshStoreInKeychain:!0,sshUseKey:!1}),i=G(w()),A=E([]),h=E("idle"),p=E(""),j=ce(),W=v(()=>_(c.value)),C=v(()=>ue()),z=v(()=>l.value===r.FILE),K=v(()=>{var n;return c.value===a.SQLITE3&&C.value&&typeof window<"u"&&typeof((n=window.electronAPI)==null?void 0:n.window.pickSqliteFile)=="function"}),R=v(()=>ge(c.value)==="serviceName"),H=v(()=>R.value?"Service Name":"Database"),x=v(()=>R.value?"ORCLPDB1":"my_database"),M=v(()=>Ee.has(l.value)),L=n=>n&&pe[n]||"",V=()=>{const n=j.tags.find(o=>o.name==="dev");return n?[n.id]:[]},X=()=>{if(!(!e.sslEnabled||!M.value))return{mode:e.sslMode,ca:e.sslCA,cert:e.sslCert,key:e.sslKey,rejectUnauthorized:e.sslRejectUnauthorized}},J=()=>{if(!(!e.sshEnabled||!M.value))return{enabled:!0,host:e.sshHost,port:e.sshPort,username:e.sshUsername,authMethod:e.sshUseKey?y.KEY:y.PASSWORD,password:e.sshPassword,privateKey:e.sshPrivateKey,storeInKeychain:e.sshStoreInKeychain,useSshKey:e.sshUseKey}},k=()=>{const n={host:e.host,port:e.port||L(c.value),username:e.username,password:e.password,ssl:X(),ssh:J()};return R.value?n.serviceName=e.serviceName:n.database=e.database,n},q=()=>i.provider===T.TURSO?{provider:T.TURSO,url:i.url,authToken:i.authToken,branchName:i.branchName}:{provider:T.CLOUDFLARE_D1,accountId:i.accountId,databaseId:i.databaseId,databaseName:i.databaseName,apiToken:i.apiToken},Z=()=>{const n=Le(c.value),o=e.port||L(c.value),s=R.value?e.serviceName:e.database;if(!n||!e.host||!e.username||!s)return;const P=e.password?`${e.username}:${e.password}`:e.username;return`${n}://${P}@${e.host}${o?`:${o}`:""}/${s}`},ee=()=>{const n=c.value;if(!n)throw new Error("Database type is required.");return l.value===r.STRING?{type:n,method:r.STRING,stringConnection:I.value}:l.value===r.FILE?{type:a.SQLITE3,method:r.FILE,filePath:e.filePath}:l.value===r.MANAGED?{type:a.SQLITE3,method:r.MANAGED,providerKind:Y(i.provider),managedSqlite:q()}:{type:n,method:r.FORM,...k()}},Q=()=>{b.value=1,c.value=a.POSTGRES,g.value="my-abc-db",l.value=r.STRING,I.value="",e.host="",e.port=L(a.POSTGRES),e.username="",e.password="",e.database="",e.serviceName="",e.filePath="",e.sslEnabled=!1,e.sslMode=B.DISABLE,e.sslCA="",e.sslCert="",e.sslKey="",e.sslRejectUnauthorized=!0,e.sshEnabled=!1,e.sshHost="",e.sshPort=22,e.sshUsername="",e.sshAuthMethod=y.PASSWORD,e.sshPassword="",e.sshPrivateKey="",e.sshStoreInKeychain=!0,e.sshUseKey=!1,Object.assign(i,w()),A.value=V(),h.value="idle",p.value=""},se=()=>{b.value===1&&c.value&&(b.value=2)},ae=()=>{b.value=1,h.value="idle",p.value=""},F=async()=>{var n;if(l.value===r.FILE&&!C.value)return h.value="error",p.value="SQLite file connections are available only in the desktop app.",!1;h.value="testing",p.value="";try{const o=await fe.healthCheck(ee());return o.isConnectedSuccess?(h.value="success",p.value="",!0):(h.value="error",p.value=o.message||"Connection failed. Please check your details and try again.",!1)}catch(o){return h.value="error",p.value=((n=o==null?void 0:o.data)==null?void 0:n.message)||(o==null?void 0:o.message)||"Connection failed. Please check your details and try again.",!1}},te=async()=>{var P,U;const o=!!!d.value;if(o&&!await F())return;const s={workspaceId:$.value,id:((P=d.value)==null?void 0:P.id)||he(),name:g.value,type:c.value,method:l.value,createdAt:((U=d.value)==null?void 0:U.createdAt)||de().toISOString(),tagIds:[...A.value]};if(l.value===r.STRING)s.connectionString=I.value;else if(l.value===r.FILE)s.filePath=e.filePath,s.connectionString=be(e.filePath),s.providerKind=D.SQLITE_FILE;else if(l.value===r.MANAGED)s.providerKind=Y(i.provider),s.managedSqlite=q();else{const S=k();s.host=S.host,s.port=S.port,s.username=S.username,s.password=S.password,s.database=S.database,s.serviceName=S.serviceName,s.ssl=S.ssl,s.ssh=S.ssh,s.connectionString=Z()}o?t.onAddNew(s):t.onUpdate(s),t.onClose()},ne=()=>{switch(c.value){case a.POSTGRES:return"postgresql://username:password@localhost:5432/database";case a.MYSQL:case a.MYSQL2:return"mysql://username:password@localhost:3306/database";case a.MARIADB:return"mariadb://username:password@localhost:3306/database";case a.ORACLE:return"oracledb://username:password@localhost:1521/ORCLPDB1";case a.REDIS:return"redis://username:password@localhost:6379";case a.SNOWFLAKE:return"snowflake://username:password@account.snowflakecomputing.com:443/database";case a.SQLITE3:return"/Users/you/data/app.sqlite";default:return""}},oe=async()=>{var o;if(!K.value)return;const n=await((o=window.electronAPI)==null?void 0:o.window.pickSqliteFile());n&&(e.filePath=n,!d.value&&g.value==="my-abc-db"&&(g.value=Ie(n)),h.value="idle")},re=v(()=>g.value?l.value===r.STRING?!!I.value:l.value===r.FILE?C.value&&!!e.filePath:l.value===r.MANAGED?i.provider===T.TURSO?!!(i.url&&i.authToken):!!(i.accountId&&i.databaseId&&i.apiToken):R.value?!!(e.host&&(e.port||L(c.value))&&e.username&&e.password&&e.serviceName):!!(e.host&&(e.port||L(c.value))&&e.username&&e.database):!1);return O(c,n=>{const o=_(n);o.length>0&&!o.includes(l.value)&&(l.value=o[0]),n===a.SQLITE3?(e.host="",e.port="",e.username="",e.password="",e.database="",e.serviceName="",e.sslEnabled=!1,e.sshEnabled=!1):(e.filePath="",Object.assign(i,w()),n!==a.ORACLE&&(e.serviceName=""),d.value||(e.port=L(n))),h.value="idle"}),O(l,n=>{n!==r.FILE&&(e.filePath=""),n!==r.MANAGED&&Object.assign(i,w()),h.value="idle"}),O(u,n=>{var o;if(n)if(d.value){const s=d.value;g.value=s.name,c.value=s.type,l.value=s.method,I.value=s.connectionString||"",e.host=s.host||"",e.port=s.port||"",e.username=s.username||"",e.password=s.password||"",e.database=s.database||"",e.serviceName=s.serviceName||"",e.filePath=s.filePath||"",Object.assign(i,{...w(),...s.managedSqlite??{}}),e.sslEnabled=!!s.ssl,s.ssl&&(e.sslMode=s.ssl.mode,e.sslCA=s.ssl.ca||"",e.sslCert=s.ssl.cert||"",e.sslKey=s.ssl.key||"",e.sslRejectUnauthorized=s.ssl.rejectUnauthorized??!0),e.sshEnabled=!!((o=s.ssh)!=null&&o.enabled),s.ssh&&(e.sshHost=s.ssh.host||"",e.sshPort=s.ssh.port||22,e.sshUsername=s.ssh.username||"",e.sshAuthMethod=s.ssh.authMethod||y.PASSWORD,e.sshPassword=s.ssh.password||"",e.sshPrivateKey=s.ssh.privateKey||"",e.sshStoreInKeychain=s.ssh.storeInKeychain??!0,e.sshUseKey=s.ssh.useSshKey??s.ssh.authMethod===y.KEY),A.value=[...s.tagIds??[]],b.value=2}else Q()},{immediate:!0}),{step:b,dbType:c,connectionName:g,connectionMethod:l,connectionString:I,formData:e,managedSqlite:i,tagIds:A,testStatus:h,testErrorMessage:p,handleNext:se,handleBack:ae,handleTestConnection:F,handleCreateConnection:te,getDefaultPort:()=>L(c.value),getConnectionPlaceholder:ne,availableConnectionMethods:W,structuredTargetLabel:H,structuredTargetPlaceholder:x,canUseNetworkOptions:M,canPickSqliteFile:K,isFileMethod:z,isFormValid:re,pickSqliteFile:oe,resetForm:Q}}export{we as a,Se as d,Te as g,Re as i,Ae as u};
@@ -1 +1 @@
1
- import{aC as re,d as Q,ak as Ee,al as Ie,bV as dt,a0 as qe,r as H,c as Y,am as Ce,aa as ft,k as ee,o as J,w as te,E as de,g as P,M as Fe,ab as _e,dv as pt,an as mt,aD as vt,dw as ht,a3 as gt,bJ as Ae,e as yt,l as zt,p as Re,j as Te}from"./C6teO48Y.js";const fe=typeof document<"u";function b(e,t="Assertion failed!"){if(!e)throw console.error(t),new Error(t)}function Oe(e,t=document){var a;if(!fe)return null;if(t instanceof HTMLElement&&((a=t==null?void 0:t.dataset)==null?void 0:a.panelGroupId)===e)return t;const n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function ye(e,t=document){if(!fe)return null;const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function Ve(e,t,n=document){return fe?se(e,n).findIndex(l=>l.getAttribute("data-panel-resize-handle-id")===t)??null:null}function se(e,t=document){return fe?Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`)):[]}function St(e,t,n,a=document){var p,m;const r=ye(t,a),l=se(e,a),o=r?l.indexOf(r):-1,i=((p=n[o])==null?void 0:p.id)??null,c=((m=n[o+1])==null?void 0:m.id)??null;return[i,c]}function Ke(e){return e.type==="keydown"}function je(e){return e.type.startsWith("mouse")}function Xe(e){return e.type.startsWith("touch")}function ze(e){if(je(e))return{x:e.clientX,y:e.clientY};if(Xe(e)){const t=e.touches[0];if(t&&t.clientX&&t.clientY)return{x:t.clientX,y:t.clientY}}return{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY}}function We(e,t){const n=e==="horizontal",{x:a,y:r}=ze(t);return n?a:r}function bt(e,t,n,a,r){const l=n==="horizontal",o=ye(t,r);b(o);const i=o.getAttribute("data-panel-group-id");b(i);const{initialCursorPosition:c}=a,p=We(n,e),m=Oe(i,r);b(m);const u=m.getBoundingClientRect(),v=l?u.width:u.height;return(p-c)/v*100}function xt(e,t,n,a,r,l){if(Ke(e)){const o=n==="horizontal";let i=0;e.shiftKey?i=100:i=r??10;let c=0;switch(e.key){case"ArrowDown":c=o?0:i;break;case"ArrowLeft":c=o?-i:0;break;case"ArrowRight":c=o?i:0;break;case"ArrowUp":c=o?0:-i;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return a==null?0:bt(e,t,n,a,l)}function wt({layout:e,panelsArray:t,pivotIndices:n}){let a=0,r=100,l=0,o=0;const i=n[0];b(i!=null),t.forEach((u,v)=>{const{constraints:h}=u,{maxSize:g=100,minSize:w=0}=h;v===i?(a=w,r=g):(l+=w,o+=g)});const c=Math.min(r,100-l),p=Math.max(a,100-o),m=e[i];return{valueMax:c,valueMin:p,valueNow:m}}function Et({panelDataArray:e}){const t=Array.from({length:e.length}),n=e.map(l=>l.constraints);let a=0,r=100;for(let l=0;l<e.length;l++){const o=n[l];b(o);const{defaultSize:i}=o;i!=null&&(a++,t[l]=i,r-=i)}for(let l=0;l<e.length;l++){const o=n[l];b(o);const{defaultSize:i}=o;if(i!=null)continue;const c=e.length-a,p=r/c;a++,t[l]=p,r-=p}return t}function le(e,t,n){t.forEach((a,r)=>{const l=e[r];b(l);const{callbacks:o,constraints:i,id:c}=l,{collapsedSize:p=0,collapsible:m}=i,u=n[c];if(u==null||a!==u){n[c]=a;const{onCollapse:v,onExpand:h,onResize:g}=o;g&&g(a,u),m&&(v||h)&&(h&&(u==null||u===p)&&a!==p&&h(),v&&(u==null||u!==p)&&a===p&&v())}})}function Pt(e,t=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}const Le=10;function ue(e,t,n=Le){e=Number.parseFloat(e.toFixed(n)),t=Number.parseFloat(t.toFixed(n));const a=e-t;return a===0?0:a>0?1:-1}function D(e,t,n){return ue(e,t,n)===0}function Z({panelConstraints:e,panelIndex:t,size:n}){const a=e[t];b(a!=null);const{collapsedSize:r=0,collapsible:l,maxSize:o=100,minSize:i=0}=a;if(ue(n,i)<0)if(l){const c=(r+i)/2;ue(n,c)<0?n=r:n=i}else n=i;return n=Math.min(o,n),n=Number.parseFloat(n.toFixed(Le)),n}function ve(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function oe({delta:e,layout:t,panelConstraints:n,pivotIndices:a,trigger:r}){if(D(e,0))return t;const l=[...t],[o,i]=a;b(o!=null),b(i!=null);let c=0;if(r==="keyboard"){{const m=e<0?i:o,u=n[m];if(b(u),u.collapsible){const v=t[m];b(v!=null);const h=n[m];b(h);const{collapsedSize:g=0,minSize:w=0}=h;if(D(v,g)){const d=w-v;ue(d,Math.abs(e))>0&&(e=e<0?0-d:d)}}}{const m=e<0?o:i,u=n[m];b(u);const{collapsible:v}=u;if(v){const h=t[m];b(h!=null);const g=n[m];b(g);const{collapsedSize:w=0,minSize:d=0}=g;if(D(h,d)){const x=h-w;ue(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}}{const m=e<0?1:-1;let u=e<0?i:o,v=0;for(;;){const g=t[u];b(g!=null);const d=Z({panelConstraints:n,panelIndex:u,size:100})-g;if(v+=d,u+=m,u<0||u>=n.length)break}const h=Math.min(Math.abs(e),Math.abs(v));e=e<0?0-h:h}{let u=e<0?o:i;for(;u>=0&&u<n.length;){const v=Math.abs(e)-Math.abs(c),h=t[u];b(h!=null);const g=h-v,w=Z({panelConstraints:n,panelIndex:u,size:g});if(!D(h,w)&&(c+=h-w,l[u]=w,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?u--:u++}}if(D(c,0))return t;{const m=e<0?i:o,u=t[m];b(u!=null);const v=u+c,h=Z({panelConstraints:n,panelIndex:m,size:v});if(l[m]=h,!D(h,v)){let g=v-h,d=e<0?i:o;for(;d>=0&&d<n.length;){const x=l[d];b(x!=null);const N=x+g,R=Z({panelConstraints:n,panelIndex:d,size:N});if(D(x,R)||(g-=R-x,l[d]=R),D(g,0))break;e>0?d--:d++}}}const p=l.reduce((m,u)=>u+m,0);return D(p,100)?l:t}function Ue(e,t,n){const a=Ve(e,t,n);return a!=null?[a,a+1]:[-1,-1]}function It(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Ct(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Ge(e),b:Ge(t)};let a;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),a=e;b(a);const r={a:Be(Ne(n.a)),b:Be(Ne(n.b))};if(r.a===r.b){const l=a.childNodes,o={a:n.a.at(-1),b:n.b.at(-1)};let i=l.length;for(;i--;){const c=l[i];if(c===o.a)return 1;if(c===o.b)return-1}}return Math.sign(r.a-r.b)}const _t=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function At(e){const t=getComputedStyle(Je(e)).display;return t==="flex"||t==="inline-flex"}function Rt(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||At(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||_t.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Ne(e){let t=e.length;for(;t--;){const n=e[t];if(b(n),Rt(n))return n}return null}function Be(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ge(e){const t=[];for(;e;)t.push(e),e=Je(e);return t}function Je(e){var t;return e.parentNode instanceof DocumentFragment&&((t=e.parentNode)==null?void 0:t.host)||e.parentNode}const Ye=1,Ze=2,Qe=4,et=8;function Lt(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}const kt=Lt()==="coarse",j=[];let Se=!1;const V=new Map,be=new Map,ce=new Set;function Mt(e,t,n,a,r,l){const{ownerDocument:o}=t,i={direction:n,element:t,hitAreaMargins:a,nonce:r,setResizeHandlerState:l},c=V.get(o)??0;return V.set(o,c+1),ce.add(i),ge(),function(){be.delete(e),ce.delete(i);const m=V.get(o)??1;V.set(o,m-1),ge(),nt(),m===1&&V.delete(o)}}function he(e){const{target:t}=e,{x:n,y:a}=ze(e);Se=!0,ke({target:t,x:n,y:a}),ge(),j.length>0&&(Me("down",e),e.preventDefault())}function T(e){const{x:t,y:n}=ze(e);if(!Se){const{target:a}=e;ke({target:a,x:t,y:n})}Me("move",e),tt(),j.length>0&&e.preventDefault()}function O(e){const{target:t}=e,{x:n,y:a}=ze(e);be.clear(),Se=!1,j.length>0&&e.preventDefault(),Me("up",e),ke({target:t,x:n,y:a}),tt(),ge()}function ke({target:e,x:t,y:n}){j.splice(0);let a=null;e instanceof HTMLElement&&(a=e),ce.forEach(r=>{const{element:l,hitAreaMargins:o}=r,i=l.getBoundingClientRect(),{bottom:c,left:p,right:m,top:u}=i,v=kt?o.coarse:o.fine;if(t>=p-v&&t<=m+v&&n>=u-v&&n<=c+v){if(a!==null&&l!==a&&!l.contains(a)&&!a.contains(l)&&Ct(a,l)>0){let g=a,w=!1;for(;g&&!g.contains(l);){if(It(g.getBoundingClientRect(),i)){w=!0;break}g=g.parentElement}if(w)return}j.push(r)}})}function xe(e,t){be.set(e,t)}function tt(){let e=!1,t=!1,n;j.forEach(r=>{const{direction:l,nonce:o}=r;l.value==="horizontal"?e=!0:t=!0,n=o.value});let a=0;be.forEach(r=>{a|=r}),e&&t?we("intersection",a,n):e?we("horizontal",a,n):t?we("vertical",a,n):nt()}function ge(){V.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",O),n.removeEventListener("mousedown",he),n.removeEventListener("mouseleave",T),n.removeEventListener("mousemove",T),n.removeEventListener("touchmove",T),n.removeEventListener("touchstart",he)}),window.removeEventListener("mouseup",O),window.removeEventListener("touchcancel",O),window.removeEventListener("touchend",O),ce.size>0&&(Se?(j.length>0&&V.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",O),n.addEventListener("mouseleave",T),n.addEventListener("mousemove",T),n.addEventListener("touchmove",T,{passive:!1}))}),window.addEventListener("mouseup",O),window.addEventListener("touchcancel",O),window.addEventListener("touchend",O)):V.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("mousedown",he),n.addEventListener("mousemove",T),n.addEventListener("touchmove",T,{passive:!1}),n.addEventListener("touchstart",he))}))}function Me(e,t){ce.forEach(n=>{const{setResizeHandlerState:a}=n,r=j.includes(n);a(e,r,t)})}let Pe=null,K=null;function $t(e,t){if(t){const n=(t&Ye)!==0,a=(t&Ze)!==0,r=(t&Qe)!==0,l=(t&et)!==0;if(n)return r?"se-resize":l?"ne-resize":"e-resize";if(a)return r?"sw-resize":l?"nw-resize":"w-resize";if(r)return"s-resize";if(l)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function nt(){K!==null&&(document.head.removeChild(K),Pe=null,K=null)}function we(e,t,n){const a=$t(e,t);Pe!==a&&(Pe=a,K===null&&(K=document.createElement("style"),n&&(K.nonce=n),document.head.appendChild(K)),K.innerHTML=`*{cursor: ${a}!important;}`)}function Dt({defaultSize:e,dragState:t,layout:n,panelData:a,panelIndex:r,precision:l=3}){const o=n[r];let i;return o==null?i=e!==void 0?e.toPrecision(l):"1":a.length===1?i="1":i=o.toPrecision(l),{flexBasis:0,flexGrow:i,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function Nt({layout:e,panelConstraints:t}){const n=[...e],a=n.reduce((l,o)=>l+o,0);if(n.length!==t.length)throw new Error(`Invalid ${t.length} panel layout: ${n.map(l=>`${l}%`).join(", ")}`);if(!D(a,100)){console.warn(`WARNING: Invalid layout total size: ${n.map(l=>`${l}%`).join(", ")}. Layout normalization will be applied.`);for(let l=0;l<t.length;l++){const o=n[l];b(o!=null);const i=100/a*o;n[l]=i}}let r=0;for(let l=0;l<t.length;l++){const o=n[l];b(o!=null);const i=Z({panelConstraints:t,panelIndex:l,size:o});o!==i&&(r+=o-i,n[l]=i)}if(!D(r,0))for(let l=0;l<t.length;l++){const o=n[l];b(o!=null);const i=o+r,c=Z({panelConstraints:t,panelIndex:l,size:i});if(o!==c&&(r-=c-o,n[l]=c,D(r,0)))break}return n}function Bt({eagerValuesRef:e,groupId:t,layout:n,panelDataArray:a,panelGroupElement:r,setLayout:l}){re(o=>{const i=r.value;if(!i)return;const c=se(t,i);for(let p=0;p<a.length-1;p++){const{valueMax:m,valueMin:u,valueNow:v}=wt({layout:n.value,panelsArray:a,pivotIndices:[p,p+1]}),h=c[p];if(h!=null){const g=a[p];b(g),h.setAttribute("aria-controls",g.id),h.setAttribute("aria-valuemax",`${Math.round(m)}`),h.setAttribute("aria-valuemin",`${Math.round(u)}`),h.setAttribute("aria-valuenow",v!=null?`${Math.round(v)}`:"")}}o(()=>{c.forEach(p=>{p.removeAttribute("aria-controls"),p.removeAttribute("aria-valuemax"),p.removeAttribute("aria-valuemin"),p.removeAttribute("aria-valuenow")})})}),re(o=>{const i=r.value;if(!i)return;const c=e.value;b(c);const{panelDataArray:p}=c,m=Oe(t,i);b(m!=null,`No group found for id "${t}"`);const u=se(t,i);b(u);const v=u.map(h=>{const g=h.getAttribute("data-panel-resize-handle-id");b(g);const[w,d]=St(t,g,p,i);if(w==null||d==null)return()=>{};const x=N=>{if(!N.defaultPrevented)switch(N.key){case"Enter":{N.preventDefault();const R=p.findIndex(L=>L.id===w);if(R>=0){const L=p[R];b(L);const C=n.value[R],{collapsedSize:B=0,collapsible:q,minSize:I=0}=L.constraints;if(C!=null&&q){const $=oe({delta:D(C,B)?I-B:B-C,layout:n.value,panelConstraints:p.map(ne=>ne.constraints),pivotIndices:Ue(t,g,i),trigger:"keyboard"});n.value!==$&&l($)}}break}}};return h.addEventListener("keydown",x),()=>{h.removeEventListener("keydown",x)}});o(()=>{v.forEach(h=>h())})})}function He(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new TypeError("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function at(e){return`reka:${e}`}function lt(e){return e.map(t=>{const{constraints:n,id:a,idIsFromProps:r,order:l}=t;return r?a:l?`${l}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function ot(e,t){try{const n=at(e),a=t.getItem(n);if(a){const r=JSON.parse(a);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function Gt(e,t,n){const a=ot(e,n)??{},r=lt(t);return a[r]??null}function Ht(e,t,n,a,r){const l=at(e),o=lt(t),i=ot(e,r)??{};i[o]={expandToSizes:Object.fromEntries(n.entries()),layout:a};try{r.setItem(l,JSON.stringify(i))}catch(c){console.error(c)}}const qt=100,ie={getItem:e=>(He(ie),ie.getItem(e)),setItem:(e,t)=>{He(ie),ie.setItem(e,t)}},[it,Ft]=ft("PanelGroup");var Tt=Q({__name:"SplitterGroup",props:{id:{type:[String,null],required:!1},autoSaveId:{type:[String,null],required:!1,default:null},direction:{type:String,required:!0},keyboardResizeBy:{type:[Number,null],required:!1,default:10},storage:{type:Object,required:!1,default:()=>ie},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["layout"],setup(e,{emit:t}){const n=e,a=t,r={},{direction:l}=Ee(n),o=Ie(n.id,"reka-splitter-group"),i=dt(),{forwardRef:c,currentElement:p}=qe(),m=H(null),u=H([]),v=H({}),h=H(new Map),g=H(0),w=Y(()=>({autoSaveId:n.autoSaveId,direction:n.direction,dragState:m.value,id:o,keyboardResizeBy:n.keyboardResizeBy,storage:n.storage})),d=H({layout:u.value,panelDataArray:[],panelDataArrayChanged:!1}),x=s=>u.value=s;Bt({eagerValuesRef:d,groupId:o,layout:u,panelDataArray:d.value.panelDataArray,setLayout:x,panelGroupElement:p}),re(()=>{const{panelDataArray:s}=d.value,{autoSaveId:z}=n;if(z){if(u.value.length===0||u.value.length!==s.length)return;let f=r[z];f||(f=Pt(Ht,qt),r[z]=f);const y=[...s],E=new Map(h.value);f(z,y,E,u.value,n.storage)}});function N(s,z){const{panelDataArray:f}=d.value,y=X(f,s);return Dt({defaultSize:z,dragState:m.value,layout:u.value,panelData:f,panelIndex:y})}function R(s){const{panelDataArray:z}=d.value;z.push(s),z.sort((f,y)=>{const E=f.order,S=y.order;return E==null&&S==null?0:E==null?-1:S==null?1:E-S}),d.value.panelDataArrayChanged=!0}Ce(()=>d.value.panelDataArrayChanged,()=>{if(d.value.panelDataArrayChanged){d.value.panelDataArrayChanged=!1;const{autoSaveId:s,storage:z}=w.value,{layout:f,panelDataArray:y}=d.value;let E=null;if(s){const A=Gt(s,y,z);A&&(h.value=new Map(Object.entries(A.expandToSizes)),E=A.layout)}E===null&&(E=Et({panelDataArray:y}));const S=Nt({layout:E,panelConstraints:y.map(A=>A.constraints)});pt(f,S)||(x(S),d.value.layout=S,a("layout",S),le(y,S,v.value))}});function L(s){return function(f){f.preventDefault();const y=p.value;if(!y)return()=>null;const{direction:E,dragState:S,id:A,keyboardResizeBy:G}=w.value,{layout:k,panelDataArray:_}=d.value,{initialLayout:U}=S??{},F=Ue(A,s,y);let M=xt(f,s,E,S,G,y);if(M===0)return;const $e=E==="horizontal";i.value==="rtl"&&$e&&(M=-M);const ut=_.map(ct=>ct.constraints),ae=oe({delta:M,layout:U??k,panelConstraints:ut,pivotIndices:F,trigger:Ke(f)?"keyboard":"mouse-or-touch"}),De=!ve(k,ae);(je(f)||Xe(f))&&g.value!==M&&(g.value=M,De?xe(s,0):$e?xe(s,M<0?Ye:Ze):xe(s,M<0?Qe:et)),De&&(x(ae),d.value.layout=ae,a("layout",ae),le(_,ae,v.value))}}function C(s,z){const{layout:f,panelDataArray:y}=d.value,E=y.map(U=>U.constraints),{panelSize:S,pivotIndices:A}=W(y,s,f);b(S!=null);const k=X(y,s)===y.length-1?S-z:z-S,_=oe({delta:k,layout:f,panelConstraints:E,pivotIndices:A,trigger:"imperative-api"});ve(f,_)||(x(_),d.value.layout=_,a("layout",_),le(y,_,v.value))}function B(s,z){const{layout:f,panelDataArray:y}=d.value,E=X(y,s);y[E]=s,d.value.panelDataArrayChanged=!0;const{collapsedSize:S=0,collapsible:A}=z,{collapsedSize:G=0,collapsible:k,maxSize:_=100,minSize:U=0}=s.constraints,{panelSize:F}=W(y,s,f);F!==null&&(A&&k&&F===S?S!==G&&C(s,G):F<U?C(s,U):F>_&&C(s,_))}function q(s,z){const{direction:f}=w.value,{layout:y}=d.value;if(!p.value)return;const E=ye(s,p.value);b(E);const S=We(f,z);m.value={dragHandleId:s,dragHandleRect:E.getBoundingClientRect(),initialCursorPosition:S,initialLayout:y}}function I(){m.value=null}function $(s){const{panelDataArray:z}=d.value,f=X(z,s);f>=0&&(z.splice(f,1),delete v.value[s.id],d.value.panelDataArrayChanged=!0)}function ne(s){const{layout:z,panelDataArray:f}=d.value;if(s.constraints.collapsible){const y=f.map(G=>G.constraints),{collapsedSize:E=0,panelSize:S,pivotIndices:A}=W(f,s,z);if(b(S!=null,`Panel size not found for panel "${s.id}"`),S!==E){h.value.set(s.id,S);const k=X(f,s)===f.length-1?S-E:E-S,_=oe({delta:k,layout:z,panelConstraints:y,pivotIndices:A,trigger:"imperative-api"});ve(z,_)||(x(_),d.value.layout=_,a("layout",_),le(f,_,v.value))}}}function pe(s){const{layout:z,panelDataArray:f}=d.value;if(s.constraints.collapsible){const y=f.map(k=>k.constraints),{collapsedSize:E=0,panelSize:S,minSize:A=0,pivotIndices:G}=W(f,s,z);if(S===E){const k=h.value.get(s.id),_=k!=null&&k>=A?k:A,F=X(f,s)===f.length-1?S-_:_-S,M=oe({delta:F,layout:z,panelConstraints:y,pivotIndices:G,trigger:"imperative-api"});ve(z,M)||(x(M),d.value.layout=M,a("layout",M),le(f,M,v.value))}}}function me(s){const{layout:z,panelDataArray:f}=d.value,{panelSize:y}=W(f,s,z);return b(y!=null,`Panel size not found for panel "${s.id}"`),y}function rt(s){const{layout:z,panelDataArray:f}=d.value,{collapsedSize:y=0,collapsible:E,panelSize:S}=W(f,s,z);return E?S===void 0?s.constraints.defaultSize===s.constraints.collapsedSize:S===y:!1}function st(s){const{layout:z,panelDataArray:f}=d.value,{collapsedSize:y=0,collapsible:E,panelSize:S}=W(f,s,z);return b(S!=null,`Panel size not found for panel "${s.id}"`),!E||S>y}Ft({direction:l,dragState:m.value,groupId:o,reevaluatePanelConstraints:B,registerPanel:R,registerResizeHandle:L,resizePanel:C,startDragging:q,stopDragging:I,unregisterPanel:$,panelGroupElement:p,collapsePanel:ne,expandPanel:pe,isPanelCollapsed:rt,isPanelExpanded:st,getPanelSize:me,getPanelStyle:N});function X(s,z){return s.findIndex(f=>f===z||f.id===z.id)}function W(s,z,f){const y=X(s,z),S=y===s.length-1?[y-1,y]:[y,y+1],A=f[y];return{...z.constraints,panelSize:A,pivotIndices:S}}return(s,z)=>(J(),ee(P(_e),{ref:P(c),as:s.as,"as-child":s.asChild,style:Fe({display:"flex",flexDirection:P(l)==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"}),"data-panel-group":"","data-orientation":P(l),"data-panel-group-id":P(o)},{default:te(()=>[de(s.$slots,"default",{layout:u.value})]),_:3},8,["as","as-child","style","data-orientation","data-panel-group-id"]))}}),Ot=Tt,Vt=Q({__name:"SplitterPanel",props:{collapsedSize:{type:Number,required:!1},collapsible:{type:Boolean,required:!1},defaultSize:{type:Number,required:!1},id:{type:String,required:!1},maxSize:{type:Number,required:!1},minSize:{type:Number,required:!1},order:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["collapse","expand","resize"],setup(e,{expose:t,emit:n}){const a=e,r=n,l=it();if(l===null)throw new Error("SplitterPanel components must be rendered within a SplitterGroup container");const{collapsePanel:o,expandPanel:i,getPanelSize:c,getPanelStyle:p,isPanelCollapsed:m,resizePanel:u,groupId:v,reevaluatePanelConstraints:h,registerPanel:g,unregisterPanel:w}=l,d=Ie(a.id,"reka-splitter-panel"),x=Y(()=>({callbacks:{onCollapse:()=>r("collapse"),onExpand:()=>r("expand"),onResize:(...I)=>r("resize",...I)},constraints:{collapsedSize:a.collapsedSize&&Number.parseFloat(a.collapsedSize.toFixed(Le)),collapsible:a.collapsible,defaultSize:a.defaultSize,maxSize:a.maxSize,minSize:a.minSize},id:d,idIsFromProps:a.id!==void 0,order:a.order}));Ce(()=>x.value.constraints,(I,$)=>{($.collapsedSize!==I.collapsedSize||$.collapsible!==I.collapsible||$.maxSize!==I.maxSize||$.minSize!==I.minSize)&&h(x.value,$)},{deep:!0}),mt(()=>{g(x.value)}),vt(()=>{w(x.value)});const N=Y(()=>p(x.value,a.defaultSize)),R=Y(()=>m(x.value)),L=Y(()=>!R.value);function C(){o(x.value)}function B(){i(x.value)}function q(I){u(x.value,I)}return t({collapse:C,expand:B,getSize(){return c(x.value)},resize:q,isCollapsed:R,isExpanded:L}),(I,$)=>(J(),ee(P(_e),{id:P(d),style:Fe(N.value),as:I.as,"as-child":I.asChild,"data-panel":"","data-panel-collapsible":I.collapsible||void 0,"data-panel-group-id":P(v),"data-panel-id":P(d),"data-panel-size":Number.parseFloat(`${N.value.flexGrow}`).toFixed(1),"data-state":I.collapsible?R.value?"collapsed":"expanded":void 0},{default:te(()=>[de(I.$slots,"default",{isCollapsed:R.value,isExpanded:L.value,expand:B,collapse:C,resize:q})]),_:3},8,["id","style","as","as-child","data-panel-collapsible","data-panel-group-id","data-panel-id","data-panel-size","data-state"]))}}),Kt=Vt;function jt({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:a}){re(r=>{const l=a.value;if(e.value||n.value===null||l===null)return;const o=ye(t,l);if(o==null)return;const i=c=>{var p;if(!c.defaultPrevented)switch(c.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{c.preventDefault(),(p=n.value)==null||p.call(n,c);break}case"F6":{c.preventDefault();const m=o.getAttribute("data-panel-group-id");b(m);const u=se(m,l),v=Ve(m,t,l);b(v!==null);const h=c.shiftKey?v>0?v-1:u.length-1:v+1<u.length?v+1:0;u[h].focus();break}}};o.addEventListener("keydown",i),r(()=>{o.removeEventListener("keydown",i)})})}var Xt=Q({__name:"SplitterResizeHandle",props:{id:{type:String,required:!1},hitAreaMargins:{type:Object,required:!1},tabindex:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["dragging"],setup(e,{emit:t}){const n=e,a=t,{forwardRef:r,currentElement:l}=qe(),{disabled:o}=Ee(n),i=it();if(i===null)throw new Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:c,groupId:p,registerResizeHandle:m,startDragging:u,stopDragging:v,panelGroupElement:h}=i,g=Ie(n.id,"reka-splitter-resize-handle"),w=H("inactive"),d=H(!1),x=H(null),{nonce:N}=Ee(n),R=ht(N);return Ce(o,()=>{fe&&(o.value?x.value=null:x.value=m(g))},{immediate:!0}),re(L=>{var q,I;if(o.value||x.value===null)return;const C=l.value;if(!C)return;b(C);const B=($,ne,pe)=>{var me;if(ne)switch($){case"down":{w.value="drag",u(g,pe),a("dragging",!0);break}case"move":{w.value!=="drag"&&(w.value="hover"),(me=x.value)==null||me.call(x,pe);break}case"up":{w.value="hover",v(),a("dragging",!1);break}}else w.value="inactive"};L(Mt(g,C,c,{coarse:((q=n.hitAreaMargins)==null?void 0:q.coarse)??15,fine:((I=n.hitAreaMargins)==null?void 0:I.fine)??5},R,B))}),jt({disabled:o,resizeHandler:x,handleId:g,panelGroupElement:h}),(L,C)=>(J(),ee(P(_e),{id:P(g),ref:P(r),style:{touchAction:"none",userSelect:"none"},as:L.as,"as-child":L.asChild,role:"separator","data-resize-handle":"",tabindex:L.tabindex,"data-state":w.value,"data-disabled":P(o)?"":void 0,"data-orientation":P(c),"data-panel-group-id":P(p),"data-resize-handle-active":w.value==="drag"?"pointer":d.value?"keyboard":void 0,"data-resize-handle-state":w.value,"data-panel-resize-handle-enabled":!P(o),"data-panel-resize-handle-id":P(g),onBlur:C[0]||(C[0]=B=>d.value=!1),onFocus:C[1]||(C[1]=B=>d.value=!1)},{default:te(()=>[de(L.$slots,"default")]),_:3},8,["id","as","as-child","tabindex","data-state","data-disabled","data-orientation","data-panel-group-id","data-resize-handle-active","data-resize-handle-state","data-panel-resize-handle-enabled","data-panel-resize-handle-id"]))}}),Wt=Xt;const Ut={key:0,class:"bg-border z-10 flex h-7 w-1 min-w-1 items-center justify-center rounded-md border"},Yt=Q({__name:"ResizableHandle",props:{id:{},hitAreaMargins:{},tabindex:{},disabled:{type:Boolean},nonce:{},asChild:{type:Boolean},as:{},class:{},withHandle:{type:Boolean}},emits:["dragging"],setup(e,{emit:t}){const n=e,a=t,r=gt(n,"class","withHandle"),l=Ae(r,a);return(o,i)=>(J(),ee(P(Wt),Re({"data-slot":"resizable-handle"},P(l),{class:P(Te)("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:left-0 data-[orientation=vertical]:after:h-1 data-[orientation=vertical]:after:w-full data-[orientation=vertical]:after:-translate-y-1/2 data-[orientation=vertical]:after:translate-x-0 [&[data-orientation=vertical]>div]:rotate-90",n.class)}),{default:te(()=>[n.withHandle?(J(),yt("div",Ut)):zt("",!0)]),_:1},16,["class"]))}}),Zt=Q({__name:"ResizablePanel",props:{collapsedSize:{},collapsible:{type:Boolean},defaultSize:{},id:{},maxSize:{},minSize:{},order:{},asChild:{type:Boolean},as:{}},emits:["collapse","expand","resize"],setup(e,{expose:t,emit:n}){const a=e,r=n,l=H(),o=Ae(a,r);return t(l),(i,c)=>(J(),ee(P(Kt),Re({"data-slot":"resizable-panel"},P(o),{ref_key:"panelRef",ref:l}),{default:te(()=>[de(i.$slots,"default")]),_:3},16))}}),Qt=Q({__name:"ResizablePanelGroup",props:{id:{},autoSaveId:{},direction:{},keyboardResizeBy:{},storage:{},asChild:{type:Boolean},as:{},class:{}},emits:["layout"],setup(e,{emit:t}){const n=e,a=t,r=Y(()=>{const{class:o,...i}=n;return i}),l=Ae(r,a);return(o,i)=>(J(),ee(P(Ot),Re({"data-slot":"resizable-panel-group"},P(l),{class:P(Te)("flex h-full w-full data-[orientation=vertical]:flex-col",n.class)}),{default:te(()=>[de(o.$slots,"default")]),_:3},16,["class"]))}});export{Qt as _,Zt as a,Yt as b};
1
+ import{aC as re,d as Q,ak as Ee,al as Ie,bV as dt,a0 as qe,r as H,i as Y,am as Ce,aa as ft,q as ee,o as J,w as te,E as de,u as P,M as Fe,ab as _e,dv as pt,an as mt,aD as vt,dw as ht,a3 as gt,bJ as Ae,c as yt,b as zt,s as Re,p as Te}from"./DbehhcO7.js";const fe=typeof document<"u";function b(e,t="Assertion failed!"){if(!e)throw console.error(t),new Error(t)}function Oe(e,t=document){var a;if(!fe)return null;if(t instanceof HTMLElement&&((a=t==null?void 0:t.dataset)==null?void 0:a.panelGroupId)===e)return t;const n=t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`);return n||null}function ye(e,t=document){if(!fe)return null;const n=t.querySelector(`[data-panel-resize-handle-id="${e}"]`);return n||null}function Ve(e,t,n=document){return fe?se(e,n).findIndex(l=>l.getAttribute("data-panel-resize-handle-id")===t)??null:null}function se(e,t=document){return fe?Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`)):[]}function St(e,t,n,a=document){var p,m;const r=ye(t,a),l=se(e,a),o=r?l.indexOf(r):-1,i=((p=n[o])==null?void 0:p.id)??null,c=((m=n[o+1])==null?void 0:m.id)??null;return[i,c]}function Ke(e){return e.type==="keydown"}function je(e){return e.type.startsWith("mouse")}function Xe(e){return e.type.startsWith("touch")}function ze(e){if(je(e))return{x:e.clientX,y:e.clientY};if(Xe(e)){const t=e.touches[0];if(t&&t.clientX&&t.clientY)return{x:t.clientX,y:t.clientY}}return{x:Number.POSITIVE_INFINITY,y:Number.POSITIVE_INFINITY}}function We(e,t){const n=e==="horizontal",{x:a,y:r}=ze(t);return n?a:r}function bt(e,t,n,a,r){const l=n==="horizontal",o=ye(t,r);b(o);const i=o.getAttribute("data-panel-group-id");b(i);const{initialCursorPosition:c}=a,p=We(n,e),m=Oe(i,r);b(m);const u=m.getBoundingClientRect(),v=l?u.width:u.height;return(p-c)/v*100}function xt(e,t,n,a,r,l){if(Ke(e)){const o=n==="horizontal";let i=0;e.shiftKey?i=100:i=r??10;let c=0;switch(e.key){case"ArrowDown":c=o?0:i;break;case"ArrowLeft":c=o?-i:0;break;case"ArrowRight":c=o?i:0;break;case"ArrowUp":c=o?0:-i;break;case"End":c=100;break;case"Home":c=-100;break}return c}else return a==null?0:bt(e,t,n,a,l)}function wt({layout:e,panelsArray:t,pivotIndices:n}){let a=0,r=100,l=0,o=0;const i=n[0];b(i!=null),t.forEach((u,v)=>{const{constraints:h}=u,{maxSize:g=100,minSize:w=0}=h;v===i?(a=w,r=g):(l+=w,o+=g)});const c=Math.min(r,100-l),p=Math.max(a,100-o),m=e[i];return{valueMax:c,valueMin:p,valueNow:m}}function Et({panelDataArray:e}){const t=Array.from({length:e.length}),n=e.map(l=>l.constraints);let a=0,r=100;for(let l=0;l<e.length;l++){const o=n[l];b(o);const{defaultSize:i}=o;i!=null&&(a++,t[l]=i,r-=i)}for(let l=0;l<e.length;l++){const o=n[l];b(o);const{defaultSize:i}=o;if(i!=null)continue;const c=e.length-a,p=r/c;a++,t[l]=p,r-=p}return t}function le(e,t,n){t.forEach((a,r)=>{const l=e[r];b(l);const{callbacks:o,constraints:i,id:c}=l,{collapsedSize:p=0,collapsible:m}=i,u=n[c];if(u==null||a!==u){n[c]=a;const{onCollapse:v,onExpand:h,onResize:g}=o;g&&g(a,u),m&&(v||h)&&(h&&(u==null||u===p)&&a!==p&&h(),v&&(u==null||u!==p)&&a===p&&v())}})}function Pt(e,t=10){let n=null;return(...r)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{e(...r)},t)}}const Le=10;function ue(e,t,n=Le){e=Number.parseFloat(e.toFixed(n)),t=Number.parseFloat(t.toFixed(n));const a=e-t;return a===0?0:a>0?1:-1}function D(e,t,n){return ue(e,t,n)===0}function Z({panelConstraints:e,panelIndex:t,size:n}){const a=e[t];b(a!=null);const{collapsedSize:r=0,collapsible:l,maxSize:o=100,minSize:i=0}=a;if(ue(n,i)<0)if(l){const c=(r+i)/2;ue(n,c)<0?n=r:n=i}else n=i;return n=Math.min(o,n),n=Number.parseFloat(n.toFixed(Le)),n}function ve(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function oe({delta:e,layout:t,panelConstraints:n,pivotIndices:a,trigger:r}){if(D(e,0))return t;const l=[...t],[o,i]=a;b(o!=null),b(i!=null);let c=0;if(r==="keyboard"){{const m=e<0?i:o,u=n[m];if(b(u),u.collapsible){const v=t[m];b(v!=null);const h=n[m];b(h);const{collapsedSize:g=0,minSize:w=0}=h;if(D(v,g)){const d=w-v;ue(d,Math.abs(e))>0&&(e=e<0?0-d:d)}}}{const m=e<0?o:i,u=n[m];b(u);const{collapsible:v}=u;if(v){const h=t[m];b(h!=null);const g=n[m];b(g);const{collapsedSize:w=0,minSize:d=0}=g;if(D(h,d)){const x=h-w;ue(x,Math.abs(e))>0&&(e=e<0?0-x:x)}}}}{const m=e<0?1:-1;let u=e<0?i:o,v=0;for(;;){const g=t[u];b(g!=null);const d=Z({panelConstraints:n,panelIndex:u,size:100})-g;if(v+=d,u+=m,u<0||u>=n.length)break}const h=Math.min(Math.abs(e),Math.abs(v));e=e<0?0-h:h}{let u=e<0?o:i;for(;u>=0&&u<n.length;){const v=Math.abs(e)-Math.abs(c),h=t[u];b(h!=null);const g=h-v,w=Z({panelConstraints:n,panelIndex:u,size:g});if(!D(h,w)&&(c+=h-w,l[u]=w,c.toPrecision(3).localeCompare(Math.abs(e).toPrecision(3),void 0,{numeric:!0})>=0))break;e<0?u--:u++}}if(D(c,0))return t;{const m=e<0?i:o,u=t[m];b(u!=null);const v=u+c,h=Z({panelConstraints:n,panelIndex:m,size:v});if(l[m]=h,!D(h,v)){let g=v-h,d=e<0?i:o;for(;d>=0&&d<n.length;){const x=l[d];b(x!=null);const N=x+g,R=Z({panelConstraints:n,panelIndex:d,size:N});if(D(x,R)||(g-=R-x,l[d]=R),D(g,0))break;e>0?d--:d++}}}const p=l.reduce((m,u)=>u+m,0);return D(p,100)?l:t}function Ue(e,t,n){const a=Ve(e,t,n);return a!=null?[a,a+1]:[-1,-1]}function It(e,t,n){return e.x<t.x+t.width&&e.x+e.width>t.x&&e.y<t.y+t.height&&e.y+e.height>t.y}function Ct(e,t){if(e===t)throw new Error("Cannot compare node with itself");const n={a:Ge(e),b:Ge(t)};let a;for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),a=e;b(a);const r={a:Be(Ne(n.a)),b:Be(Ne(n.b))};if(r.a===r.b){const l=a.childNodes,o={a:n.a.at(-1),b:n.b.at(-1)};let i=l.length;for(;i--;){const c=l[i];if(c===o.a)return 1;if(c===o.b)return-1}}return Math.sign(r.a-r.b)}const _t=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function At(e){const t=getComputedStyle(Je(e)).display;return t==="flex"||t==="inline-flex"}function Rt(e){const t=getComputedStyle(e);return!!(t.position==="fixed"||t.zIndex!=="auto"&&(t.position!=="static"||At(e))||+t.opacity<1||"transform"in t&&t.transform!=="none"||"webkitTransform"in t&&t.webkitTransform!=="none"||"mixBlendMode"in t&&t.mixBlendMode!=="normal"||"filter"in t&&t.filter!=="none"||"webkitFilter"in t&&t.webkitFilter!=="none"||"isolation"in t&&t.isolation==="isolate"||_t.test(t.willChange)||t.webkitOverflowScrolling==="touch")}function Ne(e){let t=e.length;for(;t--;){const n=e[t];if(b(n),Rt(n))return n}return null}function Be(e){return e&&Number(getComputedStyle(e).zIndex)||0}function Ge(e){const t=[];for(;e;)t.push(e),e=Je(e);return t}function Je(e){var t;return e.parentNode instanceof DocumentFragment&&((t=e.parentNode)==null?void 0:t.host)||e.parentNode}const Ye=1,Ze=2,Qe=4,et=8;function Lt(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}const kt=Lt()==="coarse",j=[];let Se=!1;const V=new Map,be=new Map,ce=new Set;function Mt(e,t,n,a,r,l){const{ownerDocument:o}=t,i={direction:n,element:t,hitAreaMargins:a,nonce:r,setResizeHandlerState:l},c=V.get(o)??0;return V.set(o,c+1),ce.add(i),ge(),function(){be.delete(e),ce.delete(i);const m=V.get(o)??1;V.set(o,m-1),ge(),nt(),m===1&&V.delete(o)}}function he(e){const{target:t}=e,{x:n,y:a}=ze(e);Se=!0,ke({target:t,x:n,y:a}),ge(),j.length>0&&(Me("down",e),e.preventDefault())}function T(e){const{x:t,y:n}=ze(e);if(!Se){const{target:a}=e;ke({target:a,x:t,y:n})}Me("move",e),tt(),j.length>0&&e.preventDefault()}function O(e){const{target:t}=e,{x:n,y:a}=ze(e);be.clear(),Se=!1,j.length>0&&e.preventDefault(),Me("up",e),ke({target:t,x:n,y:a}),tt(),ge()}function ke({target:e,x:t,y:n}){j.splice(0);let a=null;e instanceof HTMLElement&&(a=e),ce.forEach(r=>{const{element:l,hitAreaMargins:o}=r,i=l.getBoundingClientRect(),{bottom:c,left:p,right:m,top:u}=i,v=kt?o.coarse:o.fine;if(t>=p-v&&t<=m+v&&n>=u-v&&n<=c+v){if(a!==null&&l!==a&&!l.contains(a)&&!a.contains(l)&&Ct(a,l)>0){let g=a,w=!1;for(;g&&!g.contains(l);){if(It(g.getBoundingClientRect(),i)){w=!0;break}g=g.parentElement}if(w)return}j.push(r)}})}function xe(e,t){be.set(e,t)}function tt(){let e=!1,t=!1,n;j.forEach(r=>{const{direction:l,nonce:o}=r;l.value==="horizontal"?e=!0:t=!0,n=o.value});let a=0;be.forEach(r=>{a|=r}),e&&t?we("intersection",a,n):e?we("horizontal",a,n):t?we("vertical",a,n):nt()}function ge(){V.forEach((e,t)=>{const{body:n}=t;n.removeEventListener("contextmenu",O),n.removeEventListener("mousedown",he),n.removeEventListener("mouseleave",T),n.removeEventListener("mousemove",T),n.removeEventListener("touchmove",T),n.removeEventListener("touchstart",he)}),window.removeEventListener("mouseup",O),window.removeEventListener("touchcancel",O),window.removeEventListener("touchend",O),ce.size>0&&(Se?(j.length>0&&V.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("contextmenu",O),n.addEventListener("mouseleave",T),n.addEventListener("mousemove",T),n.addEventListener("touchmove",T,{passive:!1}))}),window.addEventListener("mouseup",O),window.addEventListener("touchcancel",O),window.addEventListener("touchend",O)):V.forEach((e,t)=>{const{body:n}=t;e>0&&(n.addEventListener("mousedown",he),n.addEventListener("mousemove",T),n.addEventListener("touchmove",T,{passive:!1}),n.addEventListener("touchstart",he))}))}function Me(e,t){ce.forEach(n=>{const{setResizeHandlerState:a}=n,r=j.includes(n);a(e,r,t)})}let Pe=null,K=null;function $t(e,t){if(t){const n=(t&Ye)!==0,a=(t&Ze)!==0,r=(t&Qe)!==0,l=(t&et)!==0;if(n)return r?"se-resize":l?"ne-resize":"e-resize";if(a)return r?"sw-resize":l?"nw-resize":"w-resize";if(r)return"s-resize";if(l)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function nt(){K!==null&&(document.head.removeChild(K),Pe=null,K=null)}function we(e,t,n){const a=$t(e,t);Pe!==a&&(Pe=a,K===null&&(K=document.createElement("style"),n&&(K.nonce=n),document.head.appendChild(K)),K.innerHTML=`*{cursor: ${a}!important;}`)}function Dt({defaultSize:e,dragState:t,layout:n,panelData:a,panelIndex:r,precision:l=3}){const o=n[r];let i;return o==null?i=e!==void 0?e.toPrecision(l):"1":a.length===1?i="1":i=o.toPrecision(l),{flexBasis:0,flexGrow:i,flexShrink:1,overflow:"hidden",pointerEvents:t!==null?"none":void 0}}function Nt({layout:e,panelConstraints:t}){const n=[...e],a=n.reduce((l,o)=>l+o,0);if(n.length!==t.length)throw new Error(`Invalid ${t.length} panel layout: ${n.map(l=>`${l}%`).join(", ")}`);if(!D(a,100)){console.warn(`WARNING: Invalid layout total size: ${n.map(l=>`${l}%`).join(", ")}. Layout normalization will be applied.`);for(let l=0;l<t.length;l++){const o=n[l];b(o!=null);const i=100/a*o;n[l]=i}}let r=0;for(let l=0;l<t.length;l++){const o=n[l];b(o!=null);const i=Z({panelConstraints:t,panelIndex:l,size:o});o!==i&&(r+=o-i,n[l]=i)}if(!D(r,0))for(let l=0;l<t.length;l++){const o=n[l];b(o!=null);const i=o+r,c=Z({panelConstraints:t,panelIndex:l,size:i});if(o!==c&&(r-=c-o,n[l]=c,D(r,0)))break}return n}function Bt({eagerValuesRef:e,groupId:t,layout:n,panelDataArray:a,panelGroupElement:r,setLayout:l}){re(o=>{const i=r.value;if(!i)return;const c=se(t,i);for(let p=0;p<a.length-1;p++){const{valueMax:m,valueMin:u,valueNow:v}=wt({layout:n.value,panelsArray:a,pivotIndices:[p,p+1]}),h=c[p];if(h!=null){const g=a[p];b(g),h.setAttribute("aria-controls",g.id),h.setAttribute("aria-valuemax",`${Math.round(m)}`),h.setAttribute("aria-valuemin",`${Math.round(u)}`),h.setAttribute("aria-valuenow",v!=null?`${Math.round(v)}`:"")}}o(()=>{c.forEach(p=>{p.removeAttribute("aria-controls"),p.removeAttribute("aria-valuemax"),p.removeAttribute("aria-valuemin"),p.removeAttribute("aria-valuenow")})})}),re(o=>{const i=r.value;if(!i)return;const c=e.value;b(c);const{panelDataArray:p}=c,m=Oe(t,i);b(m!=null,`No group found for id "${t}"`);const u=se(t,i);b(u);const v=u.map(h=>{const g=h.getAttribute("data-panel-resize-handle-id");b(g);const[w,d]=St(t,g,p,i);if(w==null||d==null)return()=>{};const x=N=>{if(!N.defaultPrevented)switch(N.key){case"Enter":{N.preventDefault();const R=p.findIndex(L=>L.id===w);if(R>=0){const L=p[R];b(L);const C=n.value[R],{collapsedSize:B=0,collapsible:q,minSize:I=0}=L.constraints;if(C!=null&&q){const $=oe({delta:D(C,B)?I-B:B-C,layout:n.value,panelConstraints:p.map(ne=>ne.constraints),pivotIndices:Ue(t,g,i),trigger:"keyboard"});n.value!==$&&l($)}}break}}};return h.addEventListener("keydown",x),()=>{h.removeEventListener("keydown",x)}});o(()=>{v.forEach(h=>h())})})}function He(e){try{if(typeof localStorage<"u")e.getItem=t=>localStorage.getItem(t),e.setItem=(t,n)=>{localStorage.setItem(t,n)};else throw new TypeError("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function at(e){return`reka:${e}`}function lt(e){return e.map(t=>{const{constraints:n,id:a,idIsFromProps:r,order:l}=t;return r?a:l?`${l}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((t,n)=>t.localeCompare(n)).join(",")}function ot(e,t){try{const n=at(e),a=t.getItem(n);if(a){const r=JSON.parse(a);if(typeof r=="object"&&r!=null)return r}}catch{}return null}function Gt(e,t,n){const a=ot(e,n)??{},r=lt(t);return a[r]??null}function Ht(e,t,n,a,r){const l=at(e),o=lt(t),i=ot(e,r)??{};i[o]={expandToSizes:Object.fromEntries(n.entries()),layout:a};try{r.setItem(l,JSON.stringify(i))}catch(c){console.error(c)}}const qt=100,ie={getItem:e=>(He(ie),ie.getItem(e)),setItem:(e,t)=>{He(ie),ie.setItem(e,t)}},[it,Ft]=ft("PanelGroup");var Tt=Q({__name:"SplitterGroup",props:{id:{type:[String,null],required:!1},autoSaveId:{type:[String,null],required:!1,default:null},direction:{type:String,required:!0},keyboardResizeBy:{type:[Number,null],required:!1,default:10},storage:{type:Object,required:!1,default:()=>ie},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["layout"],setup(e,{emit:t}){const n=e,a=t,r={},{direction:l}=Ee(n),o=Ie(n.id,"reka-splitter-group"),i=dt(),{forwardRef:c,currentElement:p}=qe(),m=H(null),u=H([]),v=H({}),h=H(new Map),g=H(0),w=Y(()=>({autoSaveId:n.autoSaveId,direction:n.direction,dragState:m.value,id:o,keyboardResizeBy:n.keyboardResizeBy,storage:n.storage})),d=H({layout:u.value,panelDataArray:[],panelDataArrayChanged:!1}),x=s=>u.value=s;Bt({eagerValuesRef:d,groupId:o,layout:u,panelDataArray:d.value.panelDataArray,setLayout:x,panelGroupElement:p}),re(()=>{const{panelDataArray:s}=d.value,{autoSaveId:z}=n;if(z){if(u.value.length===0||u.value.length!==s.length)return;let f=r[z];f||(f=Pt(Ht,qt),r[z]=f);const y=[...s],E=new Map(h.value);f(z,y,E,u.value,n.storage)}});function N(s,z){const{panelDataArray:f}=d.value,y=X(f,s);return Dt({defaultSize:z,dragState:m.value,layout:u.value,panelData:f,panelIndex:y})}function R(s){const{panelDataArray:z}=d.value;z.push(s),z.sort((f,y)=>{const E=f.order,S=y.order;return E==null&&S==null?0:E==null?-1:S==null?1:E-S}),d.value.panelDataArrayChanged=!0}Ce(()=>d.value.panelDataArrayChanged,()=>{if(d.value.panelDataArrayChanged){d.value.panelDataArrayChanged=!1;const{autoSaveId:s,storage:z}=w.value,{layout:f,panelDataArray:y}=d.value;let E=null;if(s){const A=Gt(s,y,z);A&&(h.value=new Map(Object.entries(A.expandToSizes)),E=A.layout)}E===null&&(E=Et({panelDataArray:y}));const S=Nt({layout:E,panelConstraints:y.map(A=>A.constraints)});pt(f,S)||(x(S),d.value.layout=S,a("layout",S),le(y,S,v.value))}});function L(s){return function(f){f.preventDefault();const y=p.value;if(!y)return()=>null;const{direction:E,dragState:S,id:A,keyboardResizeBy:G}=w.value,{layout:k,panelDataArray:_}=d.value,{initialLayout:U}=S??{},F=Ue(A,s,y);let M=xt(f,s,E,S,G,y);if(M===0)return;const $e=E==="horizontal";i.value==="rtl"&&$e&&(M=-M);const ut=_.map(ct=>ct.constraints),ae=oe({delta:M,layout:U??k,panelConstraints:ut,pivotIndices:F,trigger:Ke(f)?"keyboard":"mouse-or-touch"}),De=!ve(k,ae);(je(f)||Xe(f))&&g.value!==M&&(g.value=M,De?xe(s,0):$e?xe(s,M<0?Ye:Ze):xe(s,M<0?Qe:et)),De&&(x(ae),d.value.layout=ae,a("layout",ae),le(_,ae,v.value))}}function C(s,z){const{layout:f,panelDataArray:y}=d.value,E=y.map(U=>U.constraints),{panelSize:S,pivotIndices:A}=W(y,s,f);b(S!=null);const k=X(y,s)===y.length-1?S-z:z-S,_=oe({delta:k,layout:f,panelConstraints:E,pivotIndices:A,trigger:"imperative-api"});ve(f,_)||(x(_),d.value.layout=_,a("layout",_),le(y,_,v.value))}function B(s,z){const{layout:f,panelDataArray:y}=d.value,E=X(y,s);y[E]=s,d.value.panelDataArrayChanged=!0;const{collapsedSize:S=0,collapsible:A}=z,{collapsedSize:G=0,collapsible:k,maxSize:_=100,minSize:U=0}=s.constraints,{panelSize:F}=W(y,s,f);F!==null&&(A&&k&&F===S?S!==G&&C(s,G):F<U?C(s,U):F>_&&C(s,_))}function q(s,z){const{direction:f}=w.value,{layout:y}=d.value;if(!p.value)return;const E=ye(s,p.value);b(E);const S=We(f,z);m.value={dragHandleId:s,dragHandleRect:E.getBoundingClientRect(),initialCursorPosition:S,initialLayout:y}}function I(){m.value=null}function $(s){const{panelDataArray:z}=d.value,f=X(z,s);f>=0&&(z.splice(f,1),delete v.value[s.id],d.value.panelDataArrayChanged=!0)}function ne(s){const{layout:z,panelDataArray:f}=d.value;if(s.constraints.collapsible){const y=f.map(G=>G.constraints),{collapsedSize:E=0,panelSize:S,pivotIndices:A}=W(f,s,z);if(b(S!=null,`Panel size not found for panel "${s.id}"`),S!==E){h.value.set(s.id,S);const k=X(f,s)===f.length-1?S-E:E-S,_=oe({delta:k,layout:z,panelConstraints:y,pivotIndices:A,trigger:"imperative-api"});ve(z,_)||(x(_),d.value.layout=_,a("layout",_),le(f,_,v.value))}}}function pe(s){const{layout:z,panelDataArray:f}=d.value;if(s.constraints.collapsible){const y=f.map(k=>k.constraints),{collapsedSize:E=0,panelSize:S,minSize:A=0,pivotIndices:G}=W(f,s,z);if(S===E){const k=h.value.get(s.id),_=k!=null&&k>=A?k:A,F=X(f,s)===f.length-1?S-_:_-S,M=oe({delta:F,layout:z,panelConstraints:y,pivotIndices:G,trigger:"imperative-api"});ve(z,M)||(x(M),d.value.layout=M,a("layout",M),le(f,M,v.value))}}}function me(s){const{layout:z,panelDataArray:f}=d.value,{panelSize:y}=W(f,s,z);return b(y!=null,`Panel size not found for panel "${s.id}"`),y}function rt(s){const{layout:z,panelDataArray:f}=d.value,{collapsedSize:y=0,collapsible:E,panelSize:S}=W(f,s,z);return E?S===void 0?s.constraints.defaultSize===s.constraints.collapsedSize:S===y:!1}function st(s){const{layout:z,panelDataArray:f}=d.value,{collapsedSize:y=0,collapsible:E,panelSize:S}=W(f,s,z);return b(S!=null,`Panel size not found for panel "${s.id}"`),!E||S>y}Ft({direction:l,dragState:m.value,groupId:o,reevaluatePanelConstraints:B,registerPanel:R,registerResizeHandle:L,resizePanel:C,startDragging:q,stopDragging:I,unregisterPanel:$,panelGroupElement:p,collapsePanel:ne,expandPanel:pe,isPanelCollapsed:rt,isPanelExpanded:st,getPanelSize:me,getPanelStyle:N});function X(s,z){return s.findIndex(f=>f===z||f.id===z.id)}function W(s,z,f){const y=X(s,z),S=y===s.length-1?[y-1,y]:[y,y+1],A=f[y];return{...z.constraints,panelSize:A,pivotIndices:S}}return(s,z)=>(J(),ee(P(_e),{ref:P(c),as:s.as,"as-child":s.asChild,style:Fe({display:"flex",flexDirection:P(l)==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"}),"data-panel-group":"","data-orientation":P(l),"data-panel-group-id":P(o)},{default:te(()=>[de(s.$slots,"default",{layout:u.value})]),_:3},8,["as","as-child","style","data-orientation","data-panel-group-id"]))}}),Ot=Tt,Vt=Q({__name:"SplitterPanel",props:{collapsedSize:{type:Number,required:!1},collapsible:{type:Boolean,required:!1},defaultSize:{type:Number,required:!1},id:{type:String,required:!1},maxSize:{type:Number,required:!1},minSize:{type:Number,required:!1},order:{type:Number,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["collapse","expand","resize"],setup(e,{expose:t,emit:n}){const a=e,r=n,l=it();if(l===null)throw new Error("SplitterPanel components must be rendered within a SplitterGroup container");const{collapsePanel:o,expandPanel:i,getPanelSize:c,getPanelStyle:p,isPanelCollapsed:m,resizePanel:u,groupId:v,reevaluatePanelConstraints:h,registerPanel:g,unregisterPanel:w}=l,d=Ie(a.id,"reka-splitter-panel"),x=Y(()=>({callbacks:{onCollapse:()=>r("collapse"),onExpand:()=>r("expand"),onResize:(...I)=>r("resize",...I)},constraints:{collapsedSize:a.collapsedSize&&Number.parseFloat(a.collapsedSize.toFixed(Le)),collapsible:a.collapsible,defaultSize:a.defaultSize,maxSize:a.maxSize,minSize:a.minSize},id:d,idIsFromProps:a.id!==void 0,order:a.order}));Ce(()=>x.value.constraints,(I,$)=>{($.collapsedSize!==I.collapsedSize||$.collapsible!==I.collapsible||$.maxSize!==I.maxSize||$.minSize!==I.minSize)&&h(x.value,$)},{deep:!0}),mt(()=>{g(x.value)}),vt(()=>{w(x.value)});const N=Y(()=>p(x.value,a.defaultSize)),R=Y(()=>m(x.value)),L=Y(()=>!R.value);function C(){o(x.value)}function B(){i(x.value)}function q(I){u(x.value,I)}return t({collapse:C,expand:B,getSize(){return c(x.value)},resize:q,isCollapsed:R,isExpanded:L}),(I,$)=>(J(),ee(P(_e),{id:P(d),style:Fe(N.value),as:I.as,"as-child":I.asChild,"data-panel":"","data-panel-collapsible":I.collapsible||void 0,"data-panel-group-id":P(v),"data-panel-id":P(d),"data-panel-size":Number.parseFloat(`${N.value.flexGrow}`).toFixed(1),"data-state":I.collapsible?R.value?"collapsed":"expanded":void 0},{default:te(()=>[de(I.$slots,"default",{isCollapsed:R.value,isExpanded:L.value,expand:B,collapse:C,resize:q})]),_:3},8,["id","style","as","as-child","data-panel-collapsible","data-panel-group-id","data-panel-id","data-panel-size","data-state"]))}}),Kt=Vt;function jt({disabled:e,handleId:t,resizeHandler:n,panelGroupElement:a}){re(r=>{const l=a.value;if(e.value||n.value===null||l===null)return;const o=ye(t,l);if(o==null)return;const i=c=>{var p;if(!c.defaultPrevented)switch(c.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{c.preventDefault(),(p=n.value)==null||p.call(n,c);break}case"F6":{c.preventDefault();const m=o.getAttribute("data-panel-group-id");b(m);const u=se(m,l),v=Ve(m,t,l);b(v!==null);const h=c.shiftKey?v>0?v-1:u.length-1:v+1<u.length?v+1:0;u[h].focus();break}}};o.addEventListener("keydown",i),r(()=>{o.removeEventListener("keydown",i)})})}var Xt=Q({__name:"SplitterResizeHandle",props:{id:{type:String,required:!1},hitAreaMargins:{type:Object,required:!1},tabindex:{type:Number,required:!1,default:0},disabled:{type:Boolean,required:!1},nonce:{type:String,required:!1},asChild:{type:Boolean,required:!1},as:{type:null,required:!1}},emits:["dragging"],setup(e,{emit:t}){const n=e,a=t,{forwardRef:r,currentElement:l}=qe(),{disabled:o}=Ee(n),i=it();if(i===null)throw new Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:c,groupId:p,registerResizeHandle:m,startDragging:u,stopDragging:v,panelGroupElement:h}=i,g=Ie(n.id,"reka-splitter-resize-handle"),w=H("inactive"),d=H(!1),x=H(null),{nonce:N}=Ee(n),R=ht(N);return Ce(o,()=>{fe&&(o.value?x.value=null:x.value=m(g))},{immediate:!0}),re(L=>{var q,I;if(o.value||x.value===null)return;const C=l.value;if(!C)return;b(C);const B=($,ne,pe)=>{var me;if(ne)switch($){case"down":{w.value="drag",u(g,pe),a("dragging",!0);break}case"move":{w.value!=="drag"&&(w.value="hover"),(me=x.value)==null||me.call(x,pe);break}case"up":{w.value="hover",v(),a("dragging",!1);break}}else w.value="inactive"};L(Mt(g,C,c,{coarse:((q=n.hitAreaMargins)==null?void 0:q.coarse)??15,fine:((I=n.hitAreaMargins)==null?void 0:I.fine)??5},R,B))}),jt({disabled:o,resizeHandler:x,handleId:g,panelGroupElement:h}),(L,C)=>(J(),ee(P(_e),{id:P(g),ref:P(r),style:{touchAction:"none",userSelect:"none"},as:L.as,"as-child":L.asChild,role:"separator","data-resize-handle":"",tabindex:L.tabindex,"data-state":w.value,"data-disabled":P(o)?"":void 0,"data-orientation":P(c),"data-panel-group-id":P(p),"data-resize-handle-active":w.value==="drag"?"pointer":d.value?"keyboard":void 0,"data-resize-handle-state":w.value,"data-panel-resize-handle-enabled":!P(o),"data-panel-resize-handle-id":P(g),onBlur:C[0]||(C[0]=B=>d.value=!1),onFocus:C[1]||(C[1]=B=>d.value=!1)},{default:te(()=>[de(L.$slots,"default")]),_:3},8,["id","as","as-child","tabindex","data-state","data-disabled","data-orientation","data-panel-group-id","data-resize-handle-active","data-resize-handle-state","data-panel-resize-handle-enabled","data-panel-resize-handle-id"]))}}),Wt=Xt;const Ut={key:0,class:"bg-border z-10 flex h-7 w-1 min-w-1 items-center justify-center rounded-md border"},Yt=Q({__name:"ResizableHandle",props:{id:{},hitAreaMargins:{},tabindex:{},disabled:{type:Boolean},nonce:{},asChild:{type:Boolean},as:{},class:{},withHandle:{type:Boolean}},emits:["dragging"],setup(e,{emit:t}){const n=e,a=t,r=gt(n,"class","withHandle"),l=Ae(r,a);return(o,i)=>(J(),ee(P(Wt),Re({"data-slot":"resizable-handle"},P(l),{class:P(Te)("bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[orientation=vertical]:h-px data-[orientation=vertical]:w-full data-[orientation=vertical]:after:left-0 data-[orientation=vertical]:after:h-1 data-[orientation=vertical]:after:w-full data-[orientation=vertical]:after:-translate-y-1/2 data-[orientation=vertical]:after:translate-x-0 [&[data-orientation=vertical]>div]:rotate-90",n.class)}),{default:te(()=>[n.withHandle?(J(),yt("div",Ut)):zt("",!0)]),_:1},16,["class"]))}}),Zt=Q({__name:"ResizablePanel",props:{collapsedSize:{},collapsible:{type:Boolean},defaultSize:{},id:{},maxSize:{},minSize:{},order:{},asChild:{type:Boolean},as:{}},emits:["collapse","expand","resize"],setup(e,{expose:t,emit:n}){const a=e,r=n,l=H(),o=Ae(a,r);return t(l),(i,c)=>(J(),ee(P(Kt),Re({"data-slot":"resizable-panel"},P(o),{ref_key:"panelRef",ref:l}),{default:te(()=>[de(i.$slots,"default")]),_:3},16))}}),Qt=Q({__name:"ResizablePanelGroup",props:{id:{},autoSaveId:{},direction:{},keyboardResizeBy:{},storage:{},asChild:{type:Boolean},as:{},class:{}},emits:["layout"],setup(e,{emit:t}){const n=e,a=t,r=Y(()=>{const{class:o,...i}=n;return i}),l=Ae(r,a);return(o,i)=>(J(),ee(P(Ot),Re({"data-slot":"resizable-panel-group"},P(l),{class:P(Te)("flex h-full w-full data-[orientation=vertical]:flex-col",n.class)}),{default:te(()=>[de(o.$slots,"default")]),_:3},16,["class"]))}});export{Qt as _,Zt as a,Yt as b};
@@ -1,4 +1,4 @@
1
- import{g as Ge}from"./BsCPQnkm.js";import{s as ze}from"./BO3FEgXG.js";import{_ as f,b as Xe,a as Je,s as Ze,g as et,q as tt,t as st,c as Ne,l as qe,A as it,E as rt,p as nt,r as at,u as lt}from"./BJvJ0Hlu.js";import"./C6teO48Y.js";var Ae=function(){var e=f(function(P,i,r,l){for(r=r||{},l=P.length;l--;r[P[l]]=i);return r},"o"),a=[1,3],u=[1,4],o=[1,5],m=[1,6],c=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],p=[1,22],R=[2,7],h=[1,26],d=[1,27],b=[1,28],k=[1,29],A=[1,33],C=[1,34],V=[1,35],v=[1,36],x=[1,37],L=[1,38],w=[1,24],D=[1,31],O=[1,32],M=[1,30],g=[1,39],_=[1,40],y=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],$=[1,61],X=[89,90],Ce=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ee=[27,29],Ve=[1,70],ve=[1,71],xe=[1,72],Le=[1,73],we=[1,74],De=[1,75],Oe=[1,76],ee=[1,83],U=[1,80],te=[1,84],se=[1,85],ie=[1,86],re=[1,87],ne=[1,88],ae=[1,89],le=[1,90],ce=[1,91],oe=[1,92],pe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],Me=[1,101],Fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],N=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],he=[1,116],ue=[1,117],fe=[1,114],me=[1,115],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:f(function(i,r,l,s,E,t,de){var n=t.length-1;switch(E){case 4:this.$=t[n].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[n].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[n-3],t[n-4]);break;case 22:s.addRequirement(t[n-5],t[n-6]),s.setClass([t[n-5]],t[n-3]);break;case 23:s.setNewReqId(t[n-2]);break;case 24:s.setNewReqText(t[n-2]);break;case 25:s.setNewReqRisk(t[n-2]);break;case 26:s.setNewReqVerifyMethod(t[n-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[n-3]);break;case 43:s.addElement(t[n-5]),s.setClass([t[n-5]],t[n-3]);break;case 44:s.setNewElementType(t[n-2]);break;case 45:s.setNewElementDocRef(t[n-2]);break;case 48:s.addRelationship(t[n-2],t[n],t[n-4]);break;case 49:s.addRelationship(t[n-2],t[n-4],t[n]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[n-2],s.defineClass(t[n-1],t[n]);break;case 58:s.setClass(t[n-1],t[n]);break;case 59:s.setClass([t[n-2]],t[n]);break;case 60:case 62:this.$=[t[n]];break;case 61:case 63:this.$=t[n-2].concat([t[n]]);break;case 64:this.$=t[n-2],s.setCssStyle(t[n-1],t[n]);break;case 65:this.$=[t[n]];break;case 66:t[n-2].push(t[n]),this.$=t[n-2];break;case 68:this.$=t[n-1]+t[n];break}},"anonymous"),table:[{3:1,4:2,6:a,9:u,11:o,13:m},{1:[3]},{3:8,4:2,5:[1,7],6:a,9:u,11:o,13:m},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(c,[2,6]),{3:12,4:2,6:a,9:u,11:o,13:m},{1:[2,2]},{4:17,5:p,7:13,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},e(c,[2,4]),e(c,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:p,7:42,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:43,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:44,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:45,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:46,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:47,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:48,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:49,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:50,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(y,[2,17]),e(y,[2,18]),e(y,[2,19]),e(y,[2,20]),{30:60,33:62,75:$,89:g,90:_},{30:63,33:62,75:$,89:g,90:_},{30:64,33:62,75:$,89:g,90:_},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ce,[2,81]),e(Ce,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(Ee,[2,79]),e(Ee,[2,80]),{27:[1,67],29:[1,68]},e(Ee,[2,85]),e(Ee,[2,86]),{62:69,65:Ve,66:ve,67:xe,68:Le,69:we,70:De,71:Oe},{62:77,65:Ve,66:ve,67:xe,68:Le,69:we,70:De,71:Oe},{30:78,33:62,75:$,89:g,90:_},{73:79,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,60]),e(pe,[2,62]),{73:93,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},{30:94,33:62,75:$,76:U,89:g,90:_},{5:[1,95]},{30:96,33:62,75:$,89:g,90:_},{5:[1,97]},{30:98,33:62,75:$,89:g,90:_},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(y,[2,59],{76:U}),e(y,[2,64],{76:Me}),{33:103,75:[1,102],89:g,90:_},e(Fe,[2,65],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),e(N,[2,67]),e(N,[2,69]),e(N,[2,70]),e(N,[2,71]),e(N,[2,72]),e(N,[2,73]),e(N,[2,74]),e(N,[2,75]),e(N,[2,76]),e(N,[2,77]),e(N,[2,78]),e(y,[2,57],{76:Me}),e(y,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:he,40:ue,56:113,57:fe,59:me},{27:[1,118],76:U},{33:119,89:g,90:_},{33:120,89:g,90:_},{75:ee,78:121,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,61]),e(pe,[2,63]),e(N,[2,68]),e(y,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(y,[2,28]),{5:[1,127]},e(y,[2,42]),{32:[1,128]},{32:[1,129]},{5:he,40:ue,56:130,57:fe,59:me},e(y,[2,47]),{5:[1,131]},e(y,[2,48]),e(y,[2,49]),e(Fe,[2,66],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),{33:132,89:g,90:_},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(y,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(y,[2,46]),{5:he,40:ue,56:152,57:fe,59:me},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(y,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(y,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:he,40:ue,56:163,57:fe,59:me},{5:he,40:ue,56:164,57:fe,59:me},e(y,[2,23]),e(y,[2,24]),e(y,[2,25]),e(y,[2,26]),e(y,[2,44]),e(y,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:f(function(i,r){if(r.recoverable)this.trace(i);else{var l=new Error(i);throw l.hash=r,l}},"parseError"),parse:f(function(i){var r=this,l=[0],s=[],E=[null],t=[],de=this.table,n="",ye=0,Pe=0,He=2,$e=1,Ke=t.slice.call(arguments,1),S=Object.create(this.lexer),G={yy:{}};for(var be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,be)&&(G.yy[be]=this.yy[be]);S.setInput(i,G.yy),G.yy.lexer=S,G.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var Ie=S.yylloc;t.push(Ie);var We=S.options&&S.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(T){l.length=l.length-2*T,E.length=E.length-T,t.length=t.length-T}f(je,"popStack");function Ue(){var T;return T=s.pop()||S.lex()||$e,typeof T!="number"&&(T instanceof Array&&(s=T,T=s.pop()),T=r.symbols_[T]||T),T}f(Ue,"lex");for(var I,z,q,Te,J={},ge,F,Ye,_e;;){if(z=l[l.length-1],this.defaultActions[z]?q=this.defaultActions[z]:((I===null||typeof I>"u")&&(I=Ue()),q=de[z]&&de[z][I]),typeof q>"u"||!q.length||!q[0]){var ke="";_e=[];for(ge in de[z])this.terminals_[ge]&&ge>He&&_e.push("'"+this.terminals_[ge]+"'");S.showPosition?ke="Parse error on line "+(ye+1)+`:
1
+ import{g as Ge}from"./BDw-ivE-.js";import{s as ze}from"./BjfaOtB-.js";import{_ as f,b as Xe,a as Je,s as Ze,g as et,q as tt,t as st,c as Ne,l as qe,A as it,E as rt,p as nt,r as at,u as lt}from"./ndyknmtb.js";import"./DbehhcO7.js";var Ae=function(){var e=f(function(P,i,r,l){for(r=r||{},l=P.length;l--;r[P[l]]=i);return r},"o"),a=[1,3],u=[1,4],o=[1,5],m=[1,6],c=[5,6,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],p=[1,22],R=[2,7],h=[1,26],d=[1,27],b=[1,28],k=[1,29],A=[1,33],C=[1,34],V=[1,35],v=[1,36],x=[1,37],L=[1,38],w=[1,24],D=[1,31],O=[1,32],M=[1,30],g=[1,39],_=[1,40],y=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,77,89,90],$=[1,61],X=[89,90],Ce=[5,8,9,11,13,21,22,23,24,27,29,41,42,43,44,45,46,54,61,63,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Ee=[27,29],Ve=[1,70],ve=[1,71],xe=[1,72],Le=[1,73],we=[1,74],De=[1,75],Oe=[1,76],ee=[1,83],U=[1,80],te=[1,84],se=[1,85],ie=[1,86],re=[1,87],ne=[1,88],ae=[1,89],le=[1,90],ce=[1,91],oe=[1,92],pe=[5,8,9,11,13,21,22,23,24,27,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],Y=[63,64],Me=[1,101],Fe=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,76,77,89,90],N=[5,8,9,11,13,21,22,23,24,41,42,43,44,45,46,54,72,74,75,76,77,80,81,82,83,84,85,86,87,88,89,90],B=[1,110],Q=[1,106],H=[1,107],K=[1,108],W=[1,109],j=[1,111],he=[1,116],ue=[1,117],fe=[1,114],me=[1,115],Se={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,directive:4,NEWLINE:5,RD:6,diagram:7,EOF:8,acc_title:9,acc_title_value:10,acc_descr:11,acc_descr_value:12,acc_descr_multiline_value:13,requirementDef:14,elementDef:15,relationshipDef:16,direction:17,styleStatement:18,classDefStatement:19,classStatement:20,direction_tb:21,direction_bt:22,direction_rl:23,direction_lr:24,requirementType:25,requirementName:26,STRUCT_START:27,requirementBody:28,STYLE_SEPARATOR:29,idList:30,ID:31,COLONSEP:32,id:33,TEXT:34,text:35,RISK:36,riskLevel:37,VERIFYMTHD:38,verifyType:39,STRUCT_STOP:40,REQUIREMENT:41,FUNCTIONAL_REQUIREMENT:42,INTERFACE_REQUIREMENT:43,PERFORMANCE_REQUIREMENT:44,PHYSICAL_REQUIREMENT:45,DESIGN_CONSTRAINT:46,LOW_RISK:47,MED_RISK:48,HIGH_RISK:49,VERIFY_ANALYSIS:50,VERIFY_DEMONSTRATION:51,VERIFY_INSPECTION:52,VERIFY_TEST:53,ELEMENT:54,elementName:55,elementBody:56,TYPE:57,type:58,DOCREF:59,ref:60,END_ARROW_L:61,relationship:62,LINE:63,END_ARROW_R:64,CONTAINS:65,COPIES:66,DERIVES:67,SATISFIES:68,VERIFIES:69,REFINES:70,TRACES:71,CLASSDEF:72,stylesOpt:73,CLASS:74,ALPHA:75,COMMA:76,STYLE:77,style:78,styleComponent:79,NUM:80,COLON:81,UNIT:82,SPACE:83,BRKT:84,PCT:85,MINUS:86,LABEL:87,SEMICOLON:88,unqString:89,qString:90,$accept:0,$end:1},terminals_:{2:"error",5:"NEWLINE",6:"RD",8:"EOF",9:"acc_title",10:"acc_title_value",11:"acc_descr",12:"acc_descr_value",13:"acc_descr_multiline_value",21:"direction_tb",22:"direction_bt",23:"direction_rl",24:"direction_lr",27:"STRUCT_START",29:"STYLE_SEPARATOR",31:"ID",32:"COLONSEP",34:"TEXT",36:"RISK",38:"VERIFYMTHD",40:"STRUCT_STOP",41:"REQUIREMENT",42:"FUNCTIONAL_REQUIREMENT",43:"INTERFACE_REQUIREMENT",44:"PERFORMANCE_REQUIREMENT",45:"PHYSICAL_REQUIREMENT",46:"DESIGN_CONSTRAINT",47:"LOW_RISK",48:"MED_RISK",49:"HIGH_RISK",50:"VERIFY_ANALYSIS",51:"VERIFY_DEMONSTRATION",52:"VERIFY_INSPECTION",53:"VERIFY_TEST",54:"ELEMENT",57:"TYPE",59:"DOCREF",61:"END_ARROW_L",63:"LINE",64:"END_ARROW_R",65:"CONTAINS",66:"COPIES",67:"DERIVES",68:"SATISFIES",69:"VERIFIES",70:"REFINES",71:"TRACES",72:"CLASSDEF",74:"CLASS",75:"ALPHA",76:"COMMA",77:"STYLE",80:"NUM",81:"COLON",82:"UNIT",83:"SPACE",84:"BRKT",85:"PCT",86:"MINUS",87:"LABEL",88:"SEMICOLON",89:"unqString",90:"qString"},productions_:[0,[3,3],[3,2],[3,4],[4,2],[4,2],[4,1],[7,0],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[17,1],[17,1],[17,1],[17,1],[14,5],[14,7],[28,5],[28,5],[28,5],[28,5],[28,2],[28,1],[25,1],[25,1],[25,1],[25,1],[25,1],[25,1],[37,1],[37,1],[37,1],[39,1],[39,1],[39,1],[39,1],[15,5],[15,7],[56,5],[56,5],[56,2],[56,1],[16,5],[16,5],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[62,1],[19,3],[20,3],[20,3],[30,1],[30,3],[30,1],[30,3],[18,3],[73,1],[73,3],[78,1],[78,2],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[79,1],[26,1],[26,1],[33,1],[33,1],[35,1],[35,1],[55,1],[55,1],[58,1],[58,1],[60,1],[60,1]],performAction:f(function(i,r,l,s,E,t,de){var n=t.length-1;switch(E){case 4:this.$=t[n].trim(),s.setAccTitle(this.$);break;case 5:case 6:this.$=t[n].trim(),s.setAccDescription(this.$);break;case 7:this.$=[];break;case 17:s.setDirection("TB");break;case 18:s.setDirection("BT");break;case 19:s.setDirection("RL");break;case 20:s.setDirection("LR");break;case 21:s.addRequirement(t[n-3],t[n-4]);break;case 22:s.addRequirement(t[n-5],t[n-6]),s.setClass([t[n-5]],t[n-3]);break;case 23:s.setNewReqId(t[n-2]);break;case 24:s.setNewReqText(t[n-2]);break;case 25:s.setNewReqRisk(t[n-2]);break;case 26:s.setNewReqVerifyMethod(t[n-2]);break;case 29:this.$=s.RequirementType.REQUIREMENT;break;case 30:this.$=s.RequirementType.FUNCTIONAL_REQUIREMENT;break;case 31:this.$=s.RequirementType.INTERFACE_REQUIREMENT;break;case 32:this.$=s.RequirementType.PERFORMANCE_REQUIREMENT;break;case 33:this.$=s.RequirementType.PHYSICAL_REQUIREMENT;break;case 34:this.$=s.RequirementType.DESIGN_CONSTRAINT;break;case 35:this.$=s.RiskLevel.LOW_RISK;break;case 36:this.$=s.RiskLevel.MED_RISK;break;case 37:this.$=s.RiskLevel.HIGH_RISK;break;case 38:this.$=s.VerifyType.VERIFY_ANALYSIS;break;case 39:this.$=s.VerifyType.VERIFY_DEMONSTRATION;break;case 40:this.$=s.VerifyType.VERIFY_INSPECTION;break;case 41:this.$=s.VerifyType.VERIFY_TEST;break;case 42:s.addElement(t[n-3]);break;case 43:s.addElement(t[n-5]),s.setClass([t[n-5]],t[n-3]);break;case 44:s.setNewElementType(t[n-2]);break;case 45:s.setNewElementDocRef(t[n-2]);break;case 48:s.addRelationship(t[n-2],t[n],t[n-4]);break;case 49:s.addRelationship(t[n-2],t[n-4],t[n]);break;case 50:this.$=s.Relationships.CONTAINS;break;case 51:this.$=s.Relationships.COPIES;break;case 52:this.$=s.Relationships.DERIVES;break;case 53:this.$=s.Relationships.SATISFIES;break;case 54:this.$=s.Relationships.VERIFIES;break;case 55:this.$=s.Relationships.REFINES;break;case 56:this.$=s.Relationships.TRACES;break;case 57:this.$=t[n-2],s.defineClass(t[n-1],t[n]);break;case 58:s.setClass(t[n-1],t[n]);break;case 59:s.setClass([t[n-2]],t[n]);break;case 60:case 62:this.$=[t[n]];break;case 61:case 63:this.$=t[n-2].concat([t[n]]);break;case 64:this.$=t[n-2],s.setCssStyle(t[n-1],t[n]);break;case 65:this.$=[t[n]];break;case 66:t[n-2].push(t[n]),this.$=t[n-2];break;case 68:this.$=t[n-1]+t[n];break}},"anonymous"),table:[{3:1,4:2,6:a,9:u,11:o,13:m},{1:[3]},{3:8,4:2,5:[1,7],6:a,9:u,11:o,13:m},{5:[1,9]},{10:[1,10]},{12:[1,11]},e(c,[2,6]),{3:12,4:2,6:a,9:u,11:o,13:m},{1:[2,2]},{4:17,5:p,7:13,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},e(c,[2,4]),e(c,[2,5]),{1:[2,1]},{8:[1,41]},{4:17,5:p,7:42,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:43,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:44,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:45,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:46,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:47,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:48,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:49,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{4:17,5:p,7:50,8:R,9:u,11:o,13:m,14:14,15:15,16:16,17:18,18:19,19:20,20:21,21:h,22:d,23:b,24:k,25:23,33:25,41:A,42:C,43:V,44:v,45:x,46:L,54:w,72:D,74:O,77:M,89:g,90:_},{26:51,89:[1,52],90:[1,53]},{55:54,89:[1,55],90:[1,56]},{29:[1,59],61:[1,57],63:[1,58]},e(y,[2,17]),e(y,[2,18]),e(y,[2,19]),e(y,[2,20]),{30:60,33:62,75:$,89:g,90:_},{30:63,33:62,75:$,89:g,90:_},{30:64,33:62,75:$,89:g,90:_},e(X,[2,29]),e(X,[2,30]),e(X,[2,31]),e(X,[2,32]),e(X,[2,33]),e(X,[2,34]),e(Ce,[2,81]),e(Ce,[2,82]),{1:[2,3]},{8:[2,8]},{8:[2,9]},{8:[2,10]},{8:[2,11]},{8:[2,12]},{8:[2,13]},{8:[2,14]},{8:[2,15]},{8:[2,16]},{27:[1,65],29:[1,66]},e(Ee,[2,79]),e(Ee,[2,80]),{27:[1,67],29:[1,68]},e(Ee,[2,85]),e(Ee,[2,86]),{62:69,65:Ve,66:ve,67:xe,68:Le,69:we,70:De,71:Oe},{62:77,65:Ve,66:ve,67:xe,68:Le,69:we,70:De,71:Oe},{30:78,33:62,75:$,89:g,90:_},{73:79,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,60]),e(pe,[2,62]),{73:93,75:ee,76:U,78:81,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},{30:94,33:62,75:$,76:U,89:g,90:_},{5:[1,95]},{30:96,33:62,75:$,89:g,90:_},{5:[1,97]},{30:98,33:62,75:$,89:g,90:_},{63:[1,99]},e(Y,[2,50]),e(Y,[2,51]),e(Y,[2,52]),e(Y,[2,53]),e(Y,[2,54]),e(Y,[2,55]),e(Y,[2,56]),{64:[1,100]},e(y,[2,59],{76:U}),e(y,[2,64],{76:Me}),{33:103,75:[1,102],89:g,90:_},e(Fe,[2,65],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),e(N,[2,67]),e(N,[2,69]),e(N,[2,70]),e(N,[2,71]),e(N,[2,72]),e(N,[2,73]),e(N,[2,74]),e(N,[2,75]),e(N,[2,76]),e(N,[2,77]),e(N,[2,78]),e(y,[2,57],{76:Me}),e(y,[2,58],{76:U}),{5:B,28:105,31:Q,34:H,36:K,38:W,40:j},{27:[1,112],76:U},{5:he,40:ue,56:113,57:fe,59:me},{27:[1,118],76:U},{33:119,89:g,90:_},{33:120,89:g,90:_},{75:ee,78:121,79:82,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe},e(pe,[2,61]),e(pe,[2,63]),e(N,[2,68]),e(y,[2,21]),{32:[1,122]},{32:[1,123]},{32:[1,124]},{32:[1,125]},{5:B,28:126,31:Q,34:H,36:K,38:W,40:j},e(y,[2,28]),{5:[1,127]},e(y,[2,42]),{32:[1,128]},{32:[1,129]},{5:he,40:ue,56:130,57:fe,59:me},e(y,[2,47]),{5:[1,131]},e(y,[2,48]),e(y,[2,49]),e(Fe,[2,66],{79:104,75:ee,80:te,81:se,82:ie,83:re,84:ne,85:ae,86:le,87:ce,88:oe}),{33:132,89:g,90:_},{35:133,89:[1,134],90:[1,135]},{37:136,47:[1,137],48:[1,138],49:[1,139]},{39:140,50:[1,141],51:[1,142],52:[1,143],53:[1,144]},e(y,[2,27]),{5:B,28:145,31:Q,34:H,36:K,38:W,40:j},{58:146,89:[1,147],90:[1,148]},{60:149,89:[1,150],90:[1,151]},e(y,[2,46]),{5:he,40:ue,56:152,57:fe,59:me},{5:[1,153]},{5:[1,154]},{5:[2,83]},{5:[2,84]},{5:[1,155]},{5:[2,35]},{5:[2,36]},{5:[2,37]},{5:[1,156]},{5:[2,38]},{5:[2,39]},{5:[2,40]},{5:[2,41]},e(y,[2,22]),{5:[1,157]},{5:[2,87]},{5:[2,88]},{5:[1,158]},{5:[2,89]},{5:[2,90]},e(y,[2,43]),{5:B,28:159,31:Q,34:H,36:K,38:W,40:j},{5:B,28:160,31:Q,34:H,36:K,38:W,40:j},{5:B,28:161,31:Q,34:H,36:K,38:W,40:j},{5:B,28:162,31:Q,34:H,36:K,38:W,40:j},{5:he,40:ue,56:163,57:fe,59:me},{5:he,40:ue,56:164,57:fe,59:me},e(y,[2,23]),e(y,[2,24]),e(y,[2,25]),e(y,[2,26]),e(y,[2,44]),e(y,[2,45])],defaultActions:{8:[2,2],12:[2,1],41:[2,3],42:[2,8],43:[2,9],44:[2,10],45:[2,11],46:[2,12],47:[2,13],48:[2,14],49:[2,15],50:[2,16],134:[2,83],135:[2,84],137:[2,35],138:[2,36],139:[2,37],141:[2,38],142:[2,39],143:[2,40],144:[2,41],147:[2,87],148:[2,88],150:[2,89],151:[2,90]},parseError:f(function(i,r){if(r.recoverable)this.trace(i);else{var l=new Error(i);throw l.hash=r,l}},"parseError"),parse:f(function(i){var r=this,l=[0],s=[],E=[null],t=[],de=this.table,n="",ye=0,Pe=0,He=2,$e=1,Ke=t.slice.call(arguments,1),S=Object.create(this.lexer),G={yy:{}};for(var be in this.yy)Object.prototype.hasOwnProperty.call(this.yy,be)&&(G.yy[be]=this.yy[be]);S.setInput(i,G.yy),G.yy.lexer=S,G.yy.parser=this,typeof S.yylloc>"u"&&(S.yylloc={});var Ie=S.yylloc;t.push(Ie);var We=S.options&&S.options.ranges;typeof G.yy.parseError=="function"?this.parseError=G.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function je(T){l.length=l.length-2*T,E.length=E.length-T,t.length=t.length-T}f(je,"popStack");function Ue(){var T;return T=s.pop()||S.lex()||$e,typeof T!="number"&&(T instanceof Array&&(s=T,T=s.pop()),T=r.symbols_[T]||T),T}f(Ue,"lex");for(var I,z,q,Te,J={},ge,F,Ye,_e;;){if(z=l[l.length-1],this.defaultActions[z]?q=this.defaultActions[z]:((I===null||typeof I>"u")&&(I=Ue()),q=de[z]&&de[z][I]),typeof q>"u"||!q.length||!q[0]){var ke="";_e=[];for(ge in de[z])this.terminals_[ge]&&ge>He&&_e.push("'"+this.terminals_[ge]+"'");S.showPosition?ke="Parse error on line "+(ye+1)+`:
2
2
  `+S.showPosition()+`
3
3
  Expecting `+_e.join(", ")+", got '"+(this.terminals_[I]||I)+"'":ke="Parse error on line "+(ye+1)+": Unexpected "+(I==$e?"end of input":"'"+(this.terminals_[I]||I)+"'"),this.parseError(ke,{text:S.match,token:this.terminals_[I]||I,line:S.yylineno,loc:Ie,expected:_e})}if(q[0]instanceof Array&&q.length>1)throw new Error("Parse Error: multiple actions possible at state: "+z+", token: "+I);switch(q[0]){case 1:l.push(I),E.push(S.yytext),t.push(S.yylloc),l.push(q[1]),I=null,Pe=S.yyleng,n=S.yytext,ye=S.yylineno,Ie=S.yylloc;break;case 2:if(F=this.productions_[q[1]][1],J.$=E[E.length-F],J._$={first_line:t[t.length-(F||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(F||1)].first_column,last_column:t[t.length-1].last_column},We&&(J._$.range=[t[t.length-(F||1)].range[0],t[t.length-1].range[1]]),Te=this.performAction.apply(J,[n,Pe,ye,G.yy,q[1],E,t].concat(Ke)),typeof Te<"u")return Te;F&&(l=l.slice(0,-1*F*2),E=E.slice(0,-1*F),t=t.slice(0,-1*F)),l.push(this.productions_[q[1]][0]),E.push(J.$),t.push(J._$),Ye=de[l[l.length-2]][l[l.length-1]],l.push(Ye);break;case 3:return!0}}return!0},"parse")},Qe=function(){var P={EOF:1,parseError:f(function(r,l){if(this.yy.parser)this.yy.parser.parseError(r,l);else throw new Error(r)},"parseError"),setInput:f(function(i,r){return this.yy=r||this.yy||{},this._input=i,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var i=this._input[0];this.yytext+=i,this.yyleng++,this.offset++,this.match+=i,this.matched+=i;var r=i.match(/(?:\r\n?|\n).*/g);return r?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),i},"input"),unput:f(function(i){var r=i.length,l=i.split(/(?:\r\n?|\n)/g);this._input=i+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-r),this.offset-=r;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===s.length?this.yylloc.first_column:0)+s[s.length-l.length].length-l[0].length:this.yylloc.first_column-r},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-r]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(i){this.unput(this.match.slice(i))},"less"),pastInput:f(function(){var i=this.matched.substr(0,this.matched.length-this.match.length);return(i.length>20?"...":"")+i.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var i=this.match;return i.length<20&&(i+=this._input.substr(0,20-i.length)),(i.substr(0,20)+(i.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var i=this.pastInput(),r=new Array(i.length+1).join("-");return i+this.upcomingInput()+`
@@ -0,0 +1 @@
1
+ import{_ as e}from"./BFOjhnLA.js";import{d as r,Z as m,i as n,q as c,u as o,o as p}from"./DbehhcO7.js";import"./9Skr9Ccw.js";import"./CxFAImHj.js";import"./DxMpy-ot.js";import"./agpUpIJe.js";import"./DqunUhPG.js";import"./DL1qmlP8.js";import"./BKh6DDUh.js";import"./BJMwGHo7.js";import"./DBku6oAz.js";const R=r({__name:"[name]",setup(s){const t=m(),i=n(()=>t.params.connectionId),a=n(()=>t.params.name);return(u,_)=>(p(),c(o(e),{"connection-id":o(i),"initial-tab":o(a)},null,8,["connection-id","initial-tab"]))}});export{R as default};
@@ -1 +1 @@
1
- import{_ as a,d as o}from"./BJvJ0Hlu.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g};
1
+ import{_ as a,d as o}from"./ndyknmtb.js";var d=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{d as g};
@@ -1,7 +1,7 @@
1
- import{_ as At}from"./DH2V7e8U.js";import{d as G,e as P,m as a,t as h,F as Q,s as X,o as d,k as E,w as i,z as k,bi as de,f as s,A as se,l as F,N as ae,n as me,r as I,am as Z,g as e,bj as ee,_ as He,i as oe,h as Je,bS as We,x as Qe,B as Ge,bf as qt,cE as Ke,bm as Xe,cF as zt,c as g,bk as Ye,bO as Vt,bP as Ot,bQ as Nt,bR as Mt,bH as Ut,bT as jt,bU as Ht,M as Jt,cG as Wt,bs as Qt,H as ye,G as Ze,a6 as et,bz as Gt,V as Kt,a$ as Xt,D as Yt,ae as Zt,Q as Le,aE as Ae,bA as eo,bB as to,bC as oo}from"./C6teO48Y.js";import{_ as tt,a as ot}from"./DQRyK9Io.js";import{_ as st}from"./BC82eJHt.js";import{g as so,a as at}from"./DBSV6YXN.js";import{_ as ao}from"./Cv9v5fHN.js";import{u as no}from"./CyKRjZZo.js";const lo={class:"rounded-lg border bg-muted/20 p-4"},ro={class:"space-y-4"},io={class:"text-sm font-medium"},uo={class:"mt-1 text-xs text-muted-foreground"},co={class:"text-xs text-muted-foreground"},mo={class:"mt-2 flex flex-wrap gap-2"},po={class:"mt-1 text-sm text-muted-foreground"},fo={class:"mt-1 text-sm font-medium"},qe=G({__name:"BackupProfileCard",props:{title:{},description:{},formats:{},toolHint:{},targetName:{},formatsLabel:{default:"Supported Files"}},setup(p){return(l,t)=>{const o=de;return d(),P("div",lo,[a("div",ro,[a("div",null,[a("p",io,h(l.title),1),a("p",uo,h(l.description),1)]),a("div",null,[a("p",co,h(l.formatsLabel),1),a("div",mo,[(d(!0),P(Q,null,X(l.formats,u=>(d(),E(o,{key:u.format,variant:"outline",class:"font-normal"},{default:i(()=>[k(h(u.extension),1)]),_:2},1024))),128))])]),a("div",null,[t[0]||(t[0]=a("p",{class:"text-xs text-muted-foreground"},"Runtime Tools",-1)),a("p",po,h(l.toolHint),1)]),a("div",null,[t[1]||(t[1]=a("p",{class:"text-xs text-muted-foreground"},"Target",-1)),a("p",fo,h(l.targetName),1)])])])}}}),vo={class:"text-muted-foreground"},go={class:"space-y-2 text-xs"},_o={class:"mt-4 pt-2 border-t border-border/40 flex flex-wrap items-center gap-3"},bo=`brew install postgresql # macOS
1
+ import{_ as qt}from"./CxFAImHj.js";import{d as G,c as P,e as a,t as h,F as Q,x as X,o as d,q as E,w as i,f as k,bi as de,a as s,_ as se,b as F,N as ae,n as me,r as I,am as Z,u as e,bj as ee,k as He,l as oe,m as Je,bS as We,z as Qe,B as Ge,bf as zt,cE as Ke,bm as Xe,cF as At,i as g,bk as Ye,bO as Vt,bP as Ot,bQ as Nt,bR as Mt,bH as Ut,bT as jt,bU as Ht,M as Jt,cG as Wt,bs as Qt,H as ye,G as Ze,a6 as et,bz as Gt,V as Kt,a$ as Xt,D as Yt,ae as Zt,Q as Le,aE as qe,bA as eo,bB as to,bC as oo}from"./DbehhcO7.js";import{_ as tt,a as ot}from"./DxMpy-ot.js";import{_ as st}from"./agpUpIJe.js";import{g as so,a as at}from"./DqunUhPG.js";import{_ as ao}from"./DL1qmlP8.js";import{u as no}from"./DBku6oAz.js";const lo={class:"rounded-lg border bg-muted/20 p-4"},ro={class:"space-y-4"},io={class:"text-sm font-medium"},uo={class:"mt-1 text-xs text-muted-foreground"},co={class:"text-xs text-muted-foreground"},mo={class:"mt-2 flex flex-wrap gap-2"},po={class:"mt-1 text-sm text-muted-foreground"},fo={class:"mt-1 text-sm font-medium"},ze=G({__name:"BackupProfileCard",props:{title:{},description:{},formats:{},toolHint:{},targetName:{},formatsLabel:{default:"Supported Files"}},setup(p){return(l,t)=>{const o=de;return d(),P("div",lo,[a("div",ro,[a("div",null,[a("p",io,h(l.title),1),a("p",uo,h(l.description),1)]),a("div",null,[a("p",co,h(l.formatsLabel),1),a("div",mo,[(d(!0),P(Q,null,X(l.formats,u=>(d(),E(o,{key:u.format,variant:"outline",class:"font-normal"},{default:i(()=>[k(h(u.extension),1)]),_:2},1024))),128))])]),a("div",null,[t[0]||(t[0]=a("p",{class:"text-xs text-muted-foreground"},"Runtime Tools",-1)),a("p",po,h(l.toolHint),1)]),a("div",null,[t[1]||(t[1]=a("p",{class:"text-xs text-muted-foreground"},"Target",-1)),a("p",fo,h(l.targetName),1)])])])}}}),vo={class:"text-muted-foreground"},go={class:"space-y-2 text-xs"},_o={class:"mt-4 pt-2 border-t border-border/40 flex flex-wrap items-center gap-3"},bo=`brew install postgresql # macOS
2
2
  apt-get install postgresql-client # Linux
3
3
  # Windows: Download from https://www.postgresql.org/download/windows/`,ho=`brew install mysql # macOS
4
4
  apt-get install mysql-client # Linux
5
5
  # Windows: Download from https://dev.mysql.com/downloads/`,yo=`brew install sqlite # macOS
6
6
  apt-get install sqlite3 # Linux
7
- # Windows: Download from https://www.sqlite.org/download.html`,xo=G({__name:"BackupRestoreUnsupportedAlert",props:{supportMessage:{},connectionType:{},isLoading:{type:Boolean}},emits:["reload"],setup(p,{emit:l}){const t=l;return(o,u)=>{const m=se,y=st,b=ao,r=ae,f=ot,x=tt;return d(),E(x,null,{default:i(()=>[s(y,{class:"flex items-center font-medium gap-1"},{default:i(()=>[s(m,{name:"hugeicons:alert-circle",class:"size-4"}),u[1]||(u[1]=k(" Native Tools Required"))]),_:1}),s(f,{class:"space-y-3"},{default:i(()=>[a("p",vo,h(o.supportMessage),1),a("div",go,[u[2]||(u[2]=a("p",{class:"font-medium"},"Installation instructions:",-1)),o.connectionType==="postgres"?(d(),E(b,{key:0,code:bo,language:"bash"})):o.connectionType==="mysql"||o.connectionType==="mariadb"?(d(),E(b,{key:1,code:ho,language:"bash"})):o.connectionType==="sqlite3"?(d(),E(b,{key:2,code:yo,language:"bash"})):F("",!0)]),a("div",_o,[s(r,{size:"sm",variant:"outline",class:"cursor-pointer transition-all duration-300 hover:bg-accent hover:text-accent-foreground active:scale-95 group",disabled:o.isLoading,onClick:u[0]||(u[0]=_=>t("reload"))},{default:i(()=>[s(m,{name:"hugeicons:refresh",class:me(["size-4 mr-2 shrink-0",o.isLoading?"animate-spin":"transition-transform duration-500 group-hover:rotate-180"])},null,8,["class"]),k(" "+h(o.isLoading?"Checking...":"Check Again"),1)]),_:1},8,["disabled"]),u[3]||(u[3]=a("span",{class:"text-[11px] text-muted-foreground"}," Installed the tools? Click check again to re-detect capabilities and enable Backup & Restore. ",-1))])]),_:1})]),_:1})}}}),ko={class:"space-y-4"},wo={class:"space-y-2"},$o={class:"grid gap-2 sm:grid-cols-2"},Co=["onClick"],So={class:"flex items-center justify-between gap-2"},Po={class:"text-sm font-medium"},To={class:"mt-1 text-xs text-muted-foreground"},Do={class:"space-y-2"},Bo={key:0,class:"space-y-2"},Eo={key:0,class:"flex flex-wrap gap-2 max-h-32 overflow-y-auto p-2 border rounded-md"},Io={key:1,class:"text-xs text-destructive"},Fo={key:2,class:"text-xs text-muted-foreground"},Ro={key:3,class:"text-xs text-muted-foreground"},ze="plain",Lo=G({__name:"ExportOptionsForm",props:{schemas:{},schemaLoading:{type:Boolean},schemaError:{},loading:{type:Boolean},disabled:{type:Boolean},formatOptions:{},defaultFormat:{},toolHint:{}},emits:["submit"],setup(p,{emit:l}){var f;const t=p,o=l,u=I("full"),m=I(t.defaultFormat||((f=t.formatOptions[0])==null?void 0:f.format)||ze),y=I([]);Z([()=>t.formatOptions,()=>t.defaultFormat],([x,_])=>{var w;x.some(D=>D.format===m.value)||(m.value=((w=x[0])==null?void 0:w.format)||_||ze)},{immediate:!0});const b=[{value:"full",label:"Full (schema + data)"},{value:"schema-only",label:"Schema only (no data)"},{value:"data-only",label:"Data only (no schema)"}],r=()=>{const x={format:m.value,scope:u.value};x.schemas=y.value.length>0?y.value:t.schemas,o("submit",x)};return(x,_)=>{const w=We,D=Je,v=Ge,T=Qe,B=He,R=se,A=ae;return d(),P("div",ko,[a("div",wo,[s(e(ee),null,{default:i(()=>_[1]||(_[1]=[k("Backup Format")])),_:1}),a("div",$o,[(d(!0),P(Q,null,X(x.formatOptions,C=>(d(),P("button",{key:C.format,type:"button",class:me(["rounded-lg border p-3 text-left transition-colors",e(m)===C.format?"border-primary bg-primary/5":"hover:border-primary/40 hover:bg-muted/20"]),onClick:H=>m.value=C.format},[a("div",So,[a("p",Po,h(C.label),1),s(e(de),{variant:"secondary",class:"font-normal"},{default:i(()=>[k(h(C.extension),1)]),_:2},1024)]),a("p",To," Runtime uses "+h(t.toolHint||"Native database tools")+". ",1)],10,Co))),128))])]),a("div",Do,[s(e(ee),null,{default:i(()=>_[2]||(_[2]=[k("Export Scope")])),_:1}),s(B,{modelValue:e(u),"onUpdate:modelValue":_[0]||(_[0]=C=>oe(u)?u.value=C:null),size:"xs"},{default:i(()=>[s(D,null,{default:i(()=>[s(w,{placeholder:"Select scope"})]),_:1}),s(T,null,{default:i(()=>[(d(),P(Q,null,X(b,C=>s(v,{key:C.value,value:C.value},{default:i(()=>[k(h(C.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["modelValue"])]),x.schemaLoading||x.schemaError||x.schemas.length>0?(d(),P("div",Bo,[s(e(ee),null,{default:i(()=>_[3]||(_[3]=[k("Schemas (optional)")])),_:1}),x.schemas.length>0?(d(),P("div",Eo,[(d(!0),P(Q,null,X(x.schemas,C=>(d(),E(e(de),{key:C,variant:e(y).includes(C)?"default":"outline",class:"cursor-pointer",onClick:()=>e(y).includes(C)?y.value=e(y).filter(H=>H!==C):e(y).push(C)},{default:i(()=>[k(h(C),1)]),_:2},1032,["variant","onClick"]))),128))])):F("",!0),x.schemaError?(d(),P("p",Io,h(x.schemaError),1)):x.schemaLoading?(d(),P("p",Fo," Loading schemas... ")):(d(),P("p",Ro,h(e(y).length?`${e(y).length} selected`:"All visible schemas"),1))])):F("",!0),s(A,{class:"w-full",disabled:x.loading||x.disabled,onClick:r},{default:i(()=>[x.loading?(d(),E(R,{key:0,name:"hugeicons:loading-03",class:"size-4 mr-2 animate-spin"})):(d(),E(R,{key:1,name:"lucide:download",class:"size-4 mr-2"})),k(" "+h(x.loading?"Creating Backup...":"Create Backup"),1)]),_:1},8,["disabled"])])}}}),Ao={class:"relative mt-2 cursor-pointer rounded-lg border-2 border-dashed p-6 text-center transition-colors hover:border-primary/50"},qo=["accept"],zo={key:0,class:"text-muted-foreground pointer-events-none"},Vo={class:"text-xs mt-1"},Oo={key:1,class:"flex items-center justify-center gap-3"},No={class:"text-left"},Mo={class:"text-sm font-medium"},Uo={class:"text-xs text-muted-foreground"},jo=G({__name:"ImportFileDropzone",props:{selectedFile:{},accept:{},extensionSummary:{}},emits:["change","clear"],setup(p){const l=t=>t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`;return(t,o)=>{const u=ee,m=se,y=ae;return d(),P("div",null,[s(u,{class:"text-sm font-medium"},{default:i(()=>o[2]||(o[2]=[k("Backup File")])),_:1}),a("div",Ao,[a("input",{type:"file",accept:t.accept,class:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",onChange:o[0]||(o[0]=b=>t.$emit("change",b))},null,40,qo),t.selectedFile?(d(),P("div",Oo,[s(m,{name:"hugeicons:file-01",class:"size-8 text-primary"}),a("div",No,[a("p",Mo,h(t.selectedFile.name),1),a("p",Uo,h(l(t.selectedFile.size)),1)]),s(y,{variant:"ghost",size:"icon",class:"ml-2 relative z-10",type:"button",onClick:o[1]||(o[1]=qt(b=>t.$emit("clear"),["stop"]))},{default:i(()=>[s(m,{name:"hugeicons:x-close",class:"size-4"})]),_:1})])):(d(),P("div",zo,[s(m,{name:"hugeicons:upload-cloud-01",class:"size-10 mx-auto mb-2 opacity-50"}),o[3]||(o[3]=a("p",{class:"text-sm font-medium"},"Click to select a file",-1)),a("p",Vo,"Supports "+h(t.extensionSummary)+" backups",1)]))])])}}}),Ho={class:"space-y-3"},Jo={class:"grid grid-cols-2 gap-4"},Wo=G({__name:"ImportOptionsForm",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(p){const l=Ke(p,"modelValue"),t=(u,m)=>{l.value[u]=m},o=[{key:"clean",label:"Drop Objects First",id:"import-clean"},{key:"dataOnly",label:"Data Only",id:"import-data-only"},{key:"schemaOnly",label:"Schema Only",id:"import-schema-only"},{key:"exitOnError",label:"Exit on Error",id:"import-exit-on-error"}];return(u,m)=>{const y=ee,b=Xe;return d(),P("div",Ho,[s(y,{class:"text-sm font-medium"},{default:i(()=>m[0]||(m[0]=[k("Options")])),_:1}),a("div",Jo,[(d(),P(Q,null,X(o,r=>a("div",{key:r.key,class:"flex items-center space-x-2"},[s(b,{id:r.id,"model-value":l.value[r.key],"onUpdate:modelValue":f=>t(r.key,f)},null,8,["id","model-value","onUpdate:modelValue"]),s(y,{for:r.id,class:"text-sm"},{default:i(()=>[k(h(r.label),1)]),_:2},1032,["for"])])),64))])])}}}),Qo={class:"space-y-3 rounded-lg border border-dashed p-3"},Go={class:"flex items-start justify-between gap-3"},Ko={class:"space-y-1"},Xo={key:0,class:"text-xs text-muted-foreground"},Yo={key:0,class:"space-y-2"},Zo={key:1,class:"flex items-start justify-between gap-3 rounded-md bg-muted/40 px-3 py-2"},es={key:2,class:"text-xs text-muted-foreground"},ts={key:3,class:"grid gap-3 md:grid-cols-[180px_minmax(0,1fr)]"},os={class:"space-y-1"},ss={class:"space-y-1"},Ve=G({__name:"NativeToolSelector",props:zt({title:{},description:{},detectedPaths:{},toolChoices:{},disabled:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const l=p,t=Ke(p,"modelValue"),o=g(()=>l.detectedPaths.length>0),u=g(()=>t.value.useCustomPath||!o.value),m=g(()=>l.detectedPaths.length===1?"1 executable found":`${l.detectedPaths.length} executables found`),y=g(()=>{switch(t.value.customTool||l.toolChoices[0]){case"pg_dump":return"/Applications/Postgres.app/.../bin/pg_dump";case"pg_restore":return"/Applications/Postgres.app/.../bin/pg_restore";case"psql":return"/Applications/Postgres.app/.../bin/psql";case"mysqldump":return"/opt/homebrew/Cellar/mysql/.../bin/mysqldump";case"mysqlpump":return"/opt/homebrew/Cellar/mysql/.../bin/mysqlpump";case"mysql":return"/opt/homebrew/Cellar/mysql/.../bin/mysql";case"sqlite3":return"/usr/local/bin/sqlite3";default:return"/usr/local/bin/native-tool"}}),b=_=>{t.value.selectedPath=_},r=_=>{t.value.customTool=_},f=_=>{t.value.useCustomPath=o.value?_:!0},x=_=>`${_.tool} • ${_.path}`;return(_,w)=>{const D=ee,v=de,T=We,B=Je,R=Ge,A=Qe,C=He,H=Xe,S=Ye;return d(),P("div",Qo,[a("div",Go,[a("div",Ko,[s(D,{class:"text-sm font-medium"},{default:i(()=>[k(h(_.title),1)]),_:1}),_.description?(d(),P("p",Xo,h(_.description),1)):F("",!0)]),e(o)?(d(),E(v,{key:0,variant:"secondary",class:"shrink-0"},{default:i(()=>[k(h(e(m)),1)]),_:1})):F("",!0)]),e(o)&&!t.value.useCustomPath?(d(),P("div",Yo,[s(D,{class:"text-xs font-medium text-muted-foreground"},{default:i(()=>w[4]||(w[4]=[k(" Detected Executable ")])),_:1}),s(C,{"model-value":t.value.selectedPath,disabled:_.disabled,size:"xs","onUpdate:modelValue":w[0]||(w[0]=$=>b(String($)))},{default:i(()=>[s(B,null,{default:i(()=>[s(T,{placeholder:"Choose a native tool"})]),_:1}),s(A,null,{default:i(()=>[(d(!0),P(Q,null,X(_.detectedPaths,$=>(d(),E(R,{key:$.path,value:$.path},{default:i(()=>[k(h(x($)),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value","disabled"])])):F("",!0),e(o)?(d(),P("div",Zo,[w[5]||(w[5]=a("div",{class:"space-y-1"},[a("p",{class:"text-sm font-medium"},"Use custom executable path"),a("p",{class:"text-xs text-muted-foreground"}," Point HeraQ to a specific binary when you need a different version. ")],-1)),s(H,{"model-value":t.value.useCustomPath,disabled:_.disabled,"onUpdate:modelValue":w[1]||(w[1]=$=>f(!!$))},null,8,["model-value","disabled"])])):(d(),P("p",es," No executable was detected automatically. Enter the full path to the driver you want to run. ")),e(u)?(d(),P("div",ts,[a("div",os,[s(D,{class:"text-xs font-medium text-muted-foreground"},{default:i(()=>w[6]||(w[6]=[k(" Tool ")])),_:1}),s(C,{"model-value":t.value.customTool||_.toolChoices[0],disabled:_.disabled,size:"sm","onUpdate:modelValue":w[2]||(w[2]=$=>r(String($)))},{default:i(()=>[s(B,null,{default:i(()=>[s(T,{placeholder:"Choose a tool"})]),_:1}),s(A,null,{default:i(()=>[(d(!0),P(Q,null,X(_.toolChoices,$=>(d(),E(R,{key:$,value:$},{default:i(()=>[k(h($),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value","disabled"])]),a("div",ss,[s(D,{class:"text-xs font-medium text-muted-foreground"},{default:i(()=>w[7]||(w[7]=[k(" Executable Path ")])),_:1}),s(S,{modelValue:t.value.customPath,"onUpdate:modelValue":w[3]||(w[3]=$=>t.value.customPath=$),disabled:_.disabled,placeholder:e(y),class:"h-8!",autocomplete:"off",spellcheck:"false"},null,8,["modelValue","disabled","placeholder"]),w[8]||(w[8]=a("p",{class:"text-xs text-muted-foreground"}," Enter the absolute path to the binary you want HeraQ to execute. ",-1))])])):F("",!0)])}}}),as={class:"space-y-3 py-1"},xe="restore backup",ns=G({__name:"RestoreConfirmDialog",props:{open:{type:Boolean}},emits:["confirm","cancel"],setup(p,{emit:l}){const t=p,o=l,u=I("");Z(()=>t.open,b=>{b&&(u.value="")});const m=g(()=>u.value===xe),y=()=>{m.value&&o("confirm")};return(b,r)=>{const f=se,x=Nt,_=Mt,w=Ot,D=ee,v=Ye,T=ae,B=jt,R=Ht,A=Vt;return d(),E(A,{open:b.open,"onUpdate:open":r[2]||(r[2]=C=>!C&&b.$emit("cancel"))},{default:i(()=>[s(R,{class:"max-w-sm"},{default:i(()=>[s(w,null,{default:i(()=>[s(x,{class:"flex items-center gap-2 text-destructive"},{default:i(()=>[s(f,{name:"hugeicons:alert-02",class:"size-5"}),r[3]||(r[3]=k(" Confirm Restore "))]),_:1}),s(_,null,{default:i(()=>r[4]||(r[4]=[k(" This will overwrite existing data in the target database. This action cannot be undone. ")])),_:1})]),_:1}),a("div",as,[s(D,{for:"restore-confirm-input"},{default:i(()=>[r[5]||(r[5]=k(" Type ")),a("code",{class:"rounded bg-muted px-1 py-0.5 text-xs font-mono"},h(xe)),r[6]||(r[6]=k(" to continue: "))]),_:1}),s(v,{id:"restore-confirm-input",modelValue:e(u),"onUpdate:modelValue":r[0]||(r[0]=C=>oe(u)?u.value=C:null),placeholder:xe,autocomplete:"off",onKeydown:Ut(y,["enter"])},null,8,["modelValue"])]),s(B,null,{default:i(()=>[s(T,{variant:"outline",onClick:r[1]||(r[1]=C=>b.$emit("cancel"))},{default:i(()=>r[7]||(r[7]=[k("Cancel")])),_:1}),s(T,{variant:"destructive",disabled:!e(m),onClick:y},{default:i(()=>r[8]||(r[8]=[k(" Restore ")])),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"])}}}),ls={class:"rounded-lg border bg-muted/30 p-4"},rs={class:"flex items-center justify-between gap-4"},is={class:"text-sm font-medium"},us={class:"text-xs text-muted-foreground"},cs={class:"flex shrink-0 items-center gap-2"},ds={class:"text-sm font-medium"},ms={class:"mt-3 h-2 overflow-hidden rounded-full bg-border/60"},Oe=G({__name:"TransferProgressCard",props:{tool:{},stage:{},statusMessage:{},progress:{},isRunning:{type:Boolean},progressClass:{default:"bg-primary"},actionLabel:{default:void 0},actionDisabled:{type:Boolean,default:!1}},emits:["action"],setup(p,{emit:l}){const t=l;return(o,u)=>{const m=se,y=ae;return d(),P("div",ls,[a("div",rs,[a("div",null,[a("p",is,h(o.tool)+" · "+h(o.stage),1),a("p",us,h(o.statusMessage||"Preparing job..."),1)]),a("div",cs,[o.actionLabel?(d(),E(y,{key:0,type:"button",variant:"outline",size:"sm",disabled:o.actionDisabled,onClick:u[0]||(u[0]=b=>t("action"))},{default:i(()=>[s(m,{name:"lucide:folder-open",class:"size-4 mr-2"}),k(" "+h(o.actionLabel),1)]),_:1},8,["disabled"])):F("",!0),a("span",ds,h(o.progress)+"%",1)])]),a("div",ms,[a("div",{class:me(["h-full rounded-full transition-all duration-300",o.progressClass]),style:Jt({width:`${Math.max(o.progress,o.isRunning?8:0)}%`})},null,6)])])}}});function Ne(p){return!!(p&&(p.status==="completed"||p.status==="error"))}const nt=()=>{const p=I(null),l=I(null),t=I(null),o=I(!1);let u=null,m=null;const y=v=>{u==null||u(v),u=null,m=null},b=v=>{m==null||m(v),u=null,m=null},r=async()=>{if(!t.value)throw new Error("Backup job status URL is missing.");if(o.value){if(p.value)return p.value;throw new Error("Backup job refresh is already in progress.")}o.value=!0;try{const v=await $fetch(t.value);return p.value=v,v.status==="error"&&(l.value=v.error||v.message),Ne(v)&&(f(),y(v)),v}catch(v){const T=v instanceof Error?v:new Error("Failed to refresh backup job status.");throw l.value=T.message,f(),b(T),T}finally{o.value=!1}},{pause:f,resume:x,isActive:_}=Wt(()=>{r()},1e3,{immediate:!1,immediateCallback:!1}),w=async v=>{t.value=v,l.value=null;const T=await r();return Ne(T)?T:(x(),await new Promise((B,R)=>{u=B,m=R}))},D=()=>{f(),t.value=null,p.value=null,l.value=null,o.value=!1,u=null,m=null};return Qt(()=>{f()}),{job:p,error:l,isRefreshing:o,isPolling:_,progress:g(()=>{var v;return((v=p.value)==null?void 0:v.progress)??0}),message:g(()=>{var v;return((v=p.value)==null?void 0:v.message)??null}),stage:g(()=>{var v;return((v=p.value)==null?void 0:v.stage)??"queued"}),status:g(()=>{var v;return((v=p.value)==null?void 0:v.status)??"queued"}),isRunning:g(()=>{var v,T;return((v=p.value)==null?void 0:v.status)==="queued"||((T=p.value)==null?void 0:T.status)==="running"}),monitorJob:w,refresh:r,reset:D}},ps=p=>(p||"database").trim().replace(/[\\/:*?"<>|]+/g,"-").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"database",fs=()=>new Date().toISOString().replace(/[:.]/g,"-"),vs=(p,l)=>`${p.replace(/[\\/]$/,"")}/${l}`,Me=p=>!Number.isFinite(p)||p<=0?"0.0s":`${(p/1e3).toFixed(1)}s`,gs=(p,l)=>{const t=I(null),o=I(null),u=nt(),{downloadStream:m,isDownloading:y,downloadedBytes:b}=no(),r=g(()=>u.isRunning.value||y.value),f=g(()=>o.value||y.value?100:u.progress.value),x=g(()=>o.value?`Backup is ready. ${ye(o.value.size)} generated in ${Me(o.value.duration)}.`:y.value?`Saving backup artifact (${ye(b.value)})...`:u.message.value),_=g(()=>u.job.value),w=async(T,B)=>{var H,S,$,M,z,W;if(!p.value)return t.value="No database connection provided",!1;const{options:R,runtime:A,promptForSaveLocation:C}=B;if(l!=null&&l.value&&!l.value.exportAvailable&&!((H=A==null?void 0:A.executablePath)!=null&&H.trim()))return t.value=l.value.exportMessage,!1;t.value=null,o.value=null;try{let L=((S=B.saveDirectoryPath)==null?void 0:S.trim())||void 0,V=(($=B.saveFilePath)==null?void 0:$.trim())||void 0;const K=`${ps(T)}_backup_${fs()}${D((M=p.value)==null?void 0:M.type,R.format)}`;if(!L&&!V&&C&&((z=window.electronAPI)!=null&&z.window.pickDirectory)){const q=await window.electronAPI.window.pickDirectory();if(!q)return t.value="No save location was selected.",!1;L=q}!V&&L&&(V=vs(L,K));const J=await $fetch("/api/database-export/export-database",{method:"POST",body:{...Ze(p.value),databaseName:T,options:R,runtime:A}}),j=await u.monitorJob(J.statusUrl);if(j.status==="error")return t.value=j.error||j.message,!1;if(!j.downloadUrl||!j.downloadFileName)return t.value="Export finished but no download artifact was returned.",!1;const te=await m({url:j.downloadUrl,method:"GET",filename:V?K:j.downloadFileName||K,saveFilePath:V,openPath:L,successTitle:"Backup is ready",getSuccessDescription:q=>`${ye(q)} generated in ${Me(j.duration||0)}.`});return te.success?(o.value={fileName:V?K:j.downloadFileName,duration:j.duration||0,size:te.size||0,saveDirectoryPath:L,saveFilePath:V},!0):(t.value=((W=te.error)==null?void 0:W.message)||"Download failed.",!1)}catch(L){return t.value=L instanceof Error?L.message:"Export failed. Check the connection and backup configuration.",console.error("Export error:",L),!1}},D=(T,B)=>so(T,B);return{isExporting:r,progress:f,error:t,lastExport:o,currentJob:_,statusMessage:x,exportDatabase:w,reset:()=>{u.reset(),t.value=null,o.value=null}}},_s=(p,l)=>{const t=nt(),o=g(()=>t.isRunning.value),u=g(()=>t.progress.value),m=g(()=>t.message.value),y=g(()=>t.job.value),b=I(null),r=I(null),f=I(null),x=I(null),_=I({clean:!1,dataOnly:!1,schemaOnly:!1,exitOnError:!0}),w=g(()=>{var S;return(S=p.value)==null?void 0:S.type}),D=g(()=>{var S;return((S=l.value)==null?void 0:S.formatOptions)||[]}),v=g(()=>at(w.value)),T=g(()=>{var S;return((S=l.value)==null?void 0:S.acceptExtensions)||D.value.map($=>$.extension).join(" / ")||".sql"}),B=()=>{f.value=null,x.value&&(x.value.value="")};return{isImporting:o,progress:u,statusMessage:m,currentJob:y,error:b,success:r,selectedFile:f,fileInputRef:x,options:_,extensionSummary:T,clearSelectedFile:B,openFilePicker:()=>{var S;(S=x.value)==null||S.click()},onFileSelect:S=>{var W;const $=S.target;if(!((W=$.files)!=null&&W.length))return;const M=$.files[0];if(!D.value.some(L=>M.name.toLowerCase().endsWith(L.extension.toLowerCase()))){B(),b.value=`Unsupported file type. Use ${T.value} for ${v.value}.`,r.value=null;return}f.value=M,b.value=null,r.value=null},importDatabase:async S=>{var $,M;if(!(!f.value||!p.value)){if(l.value&&!l.value.importAvailable&&!(($=S==null?void 0:S.executablePath)!=null&&$.trim())){b.value=l.value.importMessage,r.value=null;return}b.value=null,r.value=null;try{const z=new FormData;z.append("file",f.value);const W=Ze(p.value);Object.entries(W).forEach(([K,J])=>{J!==void 0&&z.append(K,typeof J=="object"?JSON.stringify(J):String(J))}),z.append("options",JSON.stringify(_.value)),(M=S==null?void 0:S.executablePath)!=null&&M.trim()&&z.append("runtime",JSON.stringify(S));const L=await $fetch("/api/database-import/import-database",{method:"POST",body:z}),V=await t.monitorJob(L.statusUrl);if(V.status==="completed"){r.value=V.message||"Database imported successfully",B();return}b.value=V.error||V.message||"Import failed"}catch(z){b.value=z instanceof Error?z.message:"Import failed. Check the backup file and connection compatibility.",console.error("Import error:",z)}}},reset:()=>{t.reset(),b.value=null,r.value=null,B()}}},bs=p=>{const l=I(null),t=I(!1),o=I(null);let u=0;const m=async()=>{const y=p.value,b=++u;if(!y){l.value=null,o.value=null,t.value=!1;return}t.value=!0,o.value=null;try{const r=await $fetch("/api/database-backup/capability",{query:{type:y,discoverAll:et()}});if(b!==u)return;l.value=r}catch(r){if(b!==u)return;l.value=null,o.value=r instanceof Error?r.message:"Unable to detect native backup tools."}finally{b===u&&(t.value=!1)}};return Z(p,()=>{m()},{immediate:!0}),{capability:l,isLoading:t,error:o,refresh:m}};function Ue(){return{useCustomPath:!1,selectedPath:"",customPath:"",customTool:""}}const je=(p,l,t)=>{const o=I(Ue()),u=g(()=>{const r=new Set(l.value);return p.value.filter(f=>r.size===0||r.has(f.tool))}),m=g(()=>u.value.find(r=>r.path===o.value.selectedPath)||null);Z([u,l,t],([r,f,x])=>{var _;if(!x){o.value=Ue();return}if(f.includes(o.value.customTool)||(o.value.customTool=f[0]||""),r.some(w=>w.path===o.value.selectedPath)||(o.value.selectedPath=((_=r[0])==null?void 0:_.path)||""),!r.length){o.value.useCustomPath=!0;return}o.value.useCustomPath&&!o.value.customPath.trim()&&(o.value.useCustomPath=!1)},{immediate:!0});const y=g(()=>{if(t.value){if(o.value.useCustomPath){const r=o.value.customPath.trim(),f=o.value.customTool;return!r||!f?void 0:{tool:f,executablePath:r}}if(m.value)return{tool:m.value.tool,executablePath:m.value.path}}}),b=g(()=>!t.value||!!y.value);return{selection:o,filteredToolPaths:u,runtimeSelection:y,canSubmit:b}},hs={class:"flex flex-col h-full gap-3 overflow-hidden p-3"},ys={class:"font-medium text-foreground"},xs={class:"text-muted-foreground/60"},ks={class:"flex items-center justify-between gap-2"},ws={class:"text-xs text-muted-foreground"},$s={class:"relative flex-1 overflow-y-auto rounded-lg border bg-background p-4"},Cs={class:"space-y-4"},Ss={class:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between"},Ps={class:"mt-1 text-sm text-muted-foreground"},Ts={class:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]"},Ds={class:"rounded-lg border p-4 space-y-4"},Bs={class:"space-y-4"},Es={class:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between"},Is={class:"mt-1 text-sm text-muted-foreground"},Fs={class:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]"},Rs={class:"rounded-lg border p-4 space-y-4"},Ls={class:"text-muted-foreground text-xs inline-flex items-center gap-0.5"},As={class:"text-destructive gap-0.5 items-center inline-flex"},Hs=G({__name:"BackupRestoreContainer",props:{connectionId:{},initialTab:{}},setup(p){const l=p,{workspaceId:t}=Gt(),o=Kt(),u=Xt(),m=g(()=>{if(l.connectionId)return o.connections.find(n=>n.id===l.connectionId)}),y=g(()=>{var n;return(n=m.value)==null?void 0:n.type}),b=g(()=>{var n,c;return((n=m.value)==null?void 0:n.database)||((c=m.value)==null?void 0:c.name)||"database"}),r=g(()=>at(y.value)),{capability:f,isLoading:x,error:_,refresh:w}=bs(y),D=I(!1),v=g(()=>et()),T=async()=>{D.value=!0;try{await w()}finally{D.value=!1}},B=g(()=>{var n;return((n=f.value)==null?void 0:n.supported)??!1}),R=g(()=>{var n;return((n=f.value)==null?void 0:n.exportAvailable)??!1}),A=g(()=>{var n;return((n=f.value)==null?void 0:n.importAvailable)??!1}),C=g(()=>B.value&&(R.value||v.value)),H=g(()=>B.value&&(A.value||v.value)),S=g(()=>_.value?_.value:f.value?f.value.supportMessage:y.value?`Checking ${r.value} native tools...`:"Select a connection to open database tools."),$=g(()=>{var n;return((n=f.value)==null?void 0:n.toolHint)||"Native database tools"}),M=g(()=>{var n;return((n=f.value)==null?void 0:n.formatOptions)||[]}),z=g(()=>{var n;return((n=f.value)==null?void 0:n.acceptExtensions)||".sql"}),W=g(()=>M.value.map(n=>n.extension).join(" / ")||".sql"),L=g(()=>{var n,c;return x.value||!B.value||R.value&&A.value?null:[R.value?null:(n=f.value)==null?void 0:n.exportMessage,A.value?null:(c=f.value)==null?void 0:c.importMessage].filter(Boolean).join(" ")}),V=g(()=>{var c;if(!l.connectionId)return[];const n=t.value||((c=m.value)==null?void 0:c.workspaceId);return(u.schemas[l.connectionId]||[]).filter(U=>U.connectionId===l.connectionId&&(!n||U.workspaceId===n)).map(U=>U.name)}),K=g(()=>u.loading[l.connectionId]||!1),J=I(null),j=async()=>{const n=m.value,c=t.value||(n==null?void 0:n.workspaceId);if(!l.connectionId||!c||!n)return;if((u.schemas[l.connectionId]||[]).some(O=>O.connectionId===l.connectionId&&O.workspaceId===c)){J.value=null;return}try{J.value=null,await u.fetchSchemas({connectionId:l.connectionId,workspaceId:c,connection:n})}catch(O){J.value=O instanceof Error?O.message:"Failed to load schemas."}};Z([m,()=>t.value],()=>{j()},{immediate:!0});const te=[{id:"export",tabLabel:"Create Backup",subtitle:"Generate native backup artifacts for the current connection.",icon:"hugeicons:download-01"},{id:"import",tabLabel:"Restore Backup",subtitle:"Apply a native backup artifact back into this connection.",icon:"hugeicons:upload-01"}],q=I(l.initialTab),lt=g(()=>te.find(n=>n.id===q.value));Z(()=>l.initialTab,n=>{q.value=n}),Z([q,C,H],([n,c,U])=>{if(n==="export"&&!c&&U){q.value="import";return}n==="import"&&!U&&c&&(q.value="export")},{immediate:!0});const rt=n=>{q.value=n},{isExporting:ne,progress:it,error:ke,lastExport:we,currentJob:pe,statusMessage:ut,exportDatabase:ct,reset:dt}=gs(m,f),$e=(n=[],c=[])=>[...new Set([...n,...c])],Ce=g(()=>{var n,c;return $e(((n=f.value)==null?void 0:n.availableExportTools)||[],((c=f.value)==null?void 0:c.missingExportTools)||[])}),mt=g(()=>{var n;return((n=f.value)==null?void 0:n.availableExportToolPaths)||[]}),{selection:fe,filteredToolPaths:pt,runtimeSelection:ft,canSubmit:vt}=je(mt,Ce,v),gt=async()=>{var c,U;const n=(c=we.value)==null?void 0:c.saveDirectoryPath;!n||!((U=window.electronAPI)!=null&&U.window.openPath)||await window.electronAPI.window.openPath(n)},_t=async n=>{await ct(b.value,{options:n,runtime:ft.value,promptForSaveLocation:v.value,saveDirectoryPath:void 0})},{isImporting:Y,progress:bt,statusMessage:ht,currentJob:ve,error:Se,success:Pe,selectedFile:ue,options:ge,extensionSummary:yt,onFileSelect:xt,clearSelectedFile:kt,importDatabase:wt,reset:$t}=_s(m,f),Ct=g(()=>{var n,c;return $e(((n=f.value)==null?void 0:n.availableImportTools)||[],((c=f.value)==null?void 0:c.missingImportTools)||[])}),_e=g(()=>{var n;return y.value!==Yt.POSTGRES||!((n=ue.value)!=null&&n.name)?Ct.value:[ue.value.name.toLowerCase().endsWith(".dump")?"pg_restore":"psql"]}),St=g(()=>{var n;return(((n=f.value)==null?void 0:n.availableImportToolPaths)||[]).filter(c=>_e.value.includes(c.tool))}),{selection:be,filteredToolPaths:Pt,runtimeSelection:Tt,canSubmit:Dt}=je(St,_e,v),ce=I(!1),Bt=()=>{ce.value=!0},Et=async()=>{ce.value=!1,await wt(Tt.value)},It=()=>{ce.value=!1};return(n,c)=>{var Te,De,Be,Ee,Ie,Fe,Re;const U=At,O=se,Ft=oo,Rt=to,Lt=eo,le=st,re=ot,ie=tt,he=ae;return d(),P("div",hs,[s(ns,{open:e(ce),onConfirm:Et,onCancel:It},null,8,["open"]),s(U,{icon:"hugeicons:database-import",title:"Backup & Restore"},{context:i(()=>[a("span",ys,h(e(b)),1),a("span",xs,"· "+h(e(r)),1)]),_:1}),a("div",ks,[s(Lt,{modelValue:e(q),"onUpdate:modelValue":c[0]||(c[0]=N=>oe(q)?q.value=N:null),class:"min-w-0 flex-1 gap-0"},{default:i(()=>[s(Rt,{size:"sm",class:"max-w-full justify-start! overflow-x-auto"},{default:i(()=>[(d(),P(Q,null,X(te,N=>s(Ft,{size:"xs",key:N.id,value:N.id,class:"min-w-fit shrink-0 cursor-pointer rounded-sm",disabled:e(x)||(N.id==="export"?!e(C):!e(H)),onClick:qs=>rt(N.id)},{default:i(()=>[s(O,{name:N.icon,class:"shrink-0 size-3.5"},null,8,["name"]),k(" "+h(N.tabLabel),1)]),_:2},1032,["value","disabled","onClick"])),64))]),_:1})]),_:1},8,["modelValue"]),a("div",ws,h((Te=e(lt))==null?void 0:Te.subtitle),1)]),a("div",$s,[e(x)&&!e(D)?(d(),E(Zt,{key:0,visible:""})):F("",!0),(!e(x)||e(D))&&e(_)?(d(),E(ie,{key:1,variant:"destructive"},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[4]||(c[4]=[k("Capability Check Failed")])),_:1}),s(re,null,{default:i(()=>[k(h(e(S)),1)]),_:1})]),_:1})):(!e(x)||e(D))&&!e(B)?(d(),E(xo,{key:2,"support-message":e(S),"connection-type":e(y),"is-loading":e(D),onReload:T},null,8,["support-message","connection-type","is-loading"])):!e(x)&&!e(D)?(d(),P(Q,{key:3},[e(L)?(d(),E(ie,{key:0},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[5]||(c[5]=[k("Partial Native Tool Support")])),_:1}),s(re,null,{default:i(()=>[k(h(e(L)),1)]),_:1})]),_:1})):F("",!0),Le(a("div",Cs,[a("div",Ss,[a("div",null,[c[6]||(c[6]=a("h3",{class:"text-base font-medium"},"Create Backup",-1)),a("p",Ps," Export "+h(e(b))+" using "+h(e($))+". ",1)])]),e(ke)?(d(),E(ie,{key:0,variant:"destructive"},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[7]||(c[7]=[k("Backup Failed")])),_:1}),s(re,null,{default:i(()=>[k(h(e(ke)),1)]),_:1}),s(he,{size:"sm",variant:"outline",class:"mt-2",onClick:e(dt)},{default:i(()=>c[8]||(c[8]=[k(" Try Again ")])),_:1},8,["onClick"])]),_:1})):F("",!0),e(ne)||e(pe)?(d(),E(Oe,{key:1,tool:((De=e(pe))==null?void 0:De.tool)||e($),stage:((Be=e(pe))==null?void 0:Be.stage)||"queued","status-message":e(ut)||"",progress:e(it),"is-running":e(ne),"action-label":(Ee=e(we))!=null&&Ee.saveDirectoryPath&&!e(ne)?"Open":void 0,onAction:gt},null,8,["tool","stage","status-message","progress","is-running","action-label"])):F("",!0),a("div",Ts,[a("div",Ds,[e(v)?(d(),E(Ve,{key:0,modelValue:e(fe),"onUpdate:modelValue":c[1]||(c[1]=N=>oe(fe)?fe.value=N:null),title:"Backup Driver",description:"Choose the exact executable OrcaQ should run for this backup job.","detected-paths":e(pt),"tool-choices":e(Ce),disabled:e(ne)},null,8,["modelValue","detected-paths","tool-choices","disabled"])):F("",!0),s(Lo,{schemas:e(V),"schema-loading":e(K),"schema-error":e(J),loading:e(ne),disabled:e(v)&&!e(vt),"format-options":e(M),"default-format":(Ie=e(f))==null?void 0:Ie.defaultExportFormat,"tool-hint":e($),onSubmit:_t},null,8,["schemas","schema-loading","schema-error","loading","disabled","format-options","default-format","tool-hint"])]),s(qe,{title:"Backup Profile",description:"Exports run on the local runtime host and stream the artifact directly into a downloadable file.",formats:e(M),"tool-hint":e($),"target-name":e(b),"formats-label":"Supported Files"},null,8,["formats","tool-hint","target-name"])])],512),[[Ae,e(q)==="export"]]),Le(a("div",Bs,[a("div",Es,[a("div",null,[c[9]||(c[9]=a("h3",{class:"text-base font-medium"},"Restore Backup",-1)),a("p",Is," Restore a "+h(e(W))+" backup into "+h(e(b))+". ",1)])]),e(Se)?(d(),E(ie,{key:0,variant:"destructive"},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[10]||(c[10]=[k("Import Failed")])),_:1}),s(re,null,{default:i(()=>[k(h(e(Se)),1)]),_:1}),s(he,{size:"sm",variant:"outline",class:"mt-2",onClick:e($t)},{default:i(()=>c[11]||(c[11]=[k(" Try Again ")])),_:1},8,["onClick"])]),_:1})):F("",!0),e(Pe)?(d(),E(ie,{key:1},{default:i(()=>[s(O,{name:"hugeicons:checkmark-circle-02",class:"size-4 text-green-500"}),s(le,null,{default:i(()=>c[12]||(c[12]=[k("Import Complete")])),_:1}),s(re,null,{default:i(()=>[k(h(e(Pe)),1)]),_:1})]),_:1})):F("",!0),e(Y)||e(ve)?(d(),E(Oe,{key:2,tool:((Fe=e(ve))==null?void 0:Fe.tool)||e($),stage:((Re=e(ve))==null?void 0:Re.stage)||"queued","status-message":e(ht)||"",progress:e(bt),"is-running":e(Y),"progress-class":"bg-emerald-500"},null,8,["tool","stage","status-message","progress","is-running"])):F("",!0),a("div",Fs,[a("div",Rs,[s(jo,{"selected-file":e(ue),accept:e(z),"extension-summary":e(yt),onChange:e(xt),onClear:e(kt)},null,8,["selected-file","accept","extension-summary","onChange","onClear"]),e(v)?(d(),E(Ve,{key:0,modelValue:e(be),"onUpdate:modelValue":c[2]||(c[2]=N=>oe(be)?be.value=N:null),title:"Restore Driver",description:"Choose the executable HeraQ should use to restore this backup artifact.","detected-paths":e(Pt),"tool-choices":e(_e),disabled:e(Y)},null,8,["modelValue","detected-paths","tool-choices","disabled"])):F("",!0),s(Wo,{modelValue:e(ge),"onUpdate:modelValue":c[3]||(c[3]=N=>oe(ge)?ge.value=N:null)},null,8,["modelValue"]),s(he,{class:"w-full",disabled:!e(ue)||e(Y)||e(v)&&!e(Dt),onClick:Bt},{default:i(()=>[s(O,{name:e(Y)?"hugeicons:loading-03":"hugeicons:upload-01",class:me(["size-4 mr-2",e(Y)&&"animate-spin"])},null,8,["name","class"]),k(" "+h(e(Y)?"Restoring...":"Restore Backup"),1)]),_:1},8,["disabled"]),a("p",Ls,[a("polyline",As,[s(O,{name:"hugeicons:alert-circle",class:"size-4 text-destructive"}),c[13]||(c[13]=k(" Warning: "))]),c[14]||(c[14]=k(" Importing a database can overwrite existing data. Make sure you have a backup before proceeding. "))])]),s(qe,{title:"Restore Profile",description:"Use a backup file produced for the same database family and runtime toolchain.",formats:e(M),"tool-hint":e($),"target-name":e(b),"formats-label":"Accepted Files"},null,8,["formats","tool-hint","target-name"])])],512),[[Ae,e(q)==="import"]])],64)):F("",!0)])])}}});export{Hs as _};
7
+ # Windows: Download from https://www.sqlite.org/download.html`,xo=G({__name:"BackupRestoreUnsupportedAlert",props:{supportMessage:{},connectionType:{},isLoading:{type:Boolean}},emits:["reload"],setup(p,{emit:l}){const t=l;return(o,u)=>{const m=se,y=st,b=ao,r=ae,f=ot,x=tt;return d(),E(x,null,{default:i(()=>[s(y,{class:"flex items-center font-medium gap-1"},{default:i(()=>[s(m,{name:"hugeicons:alert-circle",class:"size-4"}),u[1]||(u[1]=k(" Native Tools Required"))]),_:1}),s(f,{class:"space-y-3"},{default:i(()=>[a("p",vo,h(o.supportMessage),1),a("div",go,[u[2]||(u[2]=a("p",{class:"font-medium"},"Installation instructions:",-1)),o.connectionType==="postgres"?(d(),E(b,{key:0,code:bo,language:"bash"})):o.connectionType==="mysql"||o.connectionType==="mariadb"?(d(),E(b,{key:1,code:ho,language:"bash"})):o.connectionType==="sqlite3"?(d(),E(b,{key:2,code:yo,language:"bash"})):F("",!0)]),a("div",_o,[s(r,{size:"sm",variant:"outline",class:"cursor-pointer transition-all duration-300 hover:bg-accent hover:text-accent-foreground active:scale-95 group",disabled:o.isLoading,onClick:u[0]||(u[0]=_=>t("reload"))},{default:i(()=>[s(m,{name:"hugeicons:refresh",class:me(["size-4 mr-2 shrink-0",o.isLoading?"animate-spin":"transition-transform duration-500 group-hover:rotate-180"])},null,8,["class"]),k(" "+h(o.isLoading?"Checking...":"Check Again"),1)]),_:1},8,["disabled"]),u[3]||(u[3]=a("span",{class:"text-[11px] text-muted-foreground"}," Installed the tools? Click check again to re-detect capabilities and enable Backup & Restore. ",-1))])]),_:1})]),_:1})}}}),ko={class:"space-y-4"},wo={class:"space-y-2"},$o={class:"grid gap-2 sm:grid-cols-2"},Co=["onClick"],So={class:"flex items-center justify-between gap-2"},Po={class:"text-sm font-medium"},To={class:"mt-1 text-xs text-muted-foreground"},Do={class:"space-y-2"},Bo={key:0,class:"space-y-2"},Eo={key:0,class:"flex flex-wrap gap-2 max-h-32 overflow-y-auto p-2 border rounded-md"},Io={key:1,class:"text-xs text-destructive"},Fo={key:2,class:"text-xs text-muted-foreground"},Ro={key:3,class:"text-xs text-muted-foreground"},Ae="plain",Lo=G({__name:"ExportOptionsForm",props:{schemas:{},schemaLoading:{type:Boolean},schemaError:{},loading:{type:Boolean},disabled:{type:Boolean},formatOptions:{},defaultFormat:{},toolHint:{}},emits:["submit"],setup(p,{emit:l}){var f;const t=p,o=l,u=I("full"),m=I(t.defaultFormat||((f=t.formatOptions[0])==null?void 0:f.format)||Ae),y=I([]);Z([()=>t.formatOptions,()=>t.defaultFormat],([x,_])=>{var w;x.some(D=>D.format===m.value)||(m.value=((w=x[0])==null?void 0:w.format)||_||Ae)},{immediate:!0});const b=[{value:"full",label:"Full (schema + data)"},{value:"schema-only",label:"Schema only (no data)"},{value:"data-only",label:"Data only (no schema)"}],r=()=>{const x={format:m.value,scope:u.value};x.schemas=y.value.length>0?y.value:t.schemas,o("submit",x)};return(x,_)=>{const w=We,D=Je,v=Ge,T=Qe,B=He,R=se,q=ae;return d(),P("div",ko,[a("div",wo,[s(e(ee),null,{default:i(()=>_[1]||(_[1]=[k("Backup Format")])),_:1}),a("div",$o,[(d(!0),P(Q,null,X(x.formatOptions,C=>(d(),P("button",{key:C.format,type:"button",class:me(["rounded-lg border p-3 text-left transition-colors",e(m)===C.format?"border-primary bg-primary/5":"hover:border-primary/40 hover:bg-muted/20"]),onClick:H=>m.value=C.format},[a("div",So,[a("p",Po,h(C.label),1),s(e(de),{variant:"secondary",class:"font-normal"},{default:i(()=>[k(h(C.extension),1)]),_:2},1024)]),a("p",To," Runtime uses "+h(t.toolHint||"Native database tools")+". ",1)],10,Co))),128))])]),a("div",Do,[s(e(ee),null,{default:i(()=>_[2]||(_[2]=[k("Export Scope")])),_:1}),s(B,{modelValue:e(u),"onUpdate:modelValue":_[0]||(_[0]=C=>oe(u)?u.value=C:null),size:"xs"},{default:i(()=>[s(D,null,{default:i(()=>[s(w,{placeholder:"Select scope"})]),_:1}),s(T,null,{default:i(()=>[(d(),P(Q,null,X(b,C=>s(v,{key:C.value,value:C.value},{default:i(()=>[k(h(C.label),1)]),_:2},1032,["value"])),64))]),_:1})]),_:1},8,["modelValue"])]),x.schemaLoading||x.schemaError||x.schemas.length>0?(d(),P("div",Bo,[s(e(ee),null,{default:i(()=>_[3]||(_[3]=[k("Schemas (optional)")])),_:1}),x.schemas.length>0?(d(),P("div",Eo,[(d(!0),P(Q,null,X(x.schemas,C=>(d(),E(e(de),{key:C,variant:e(y).includes(C)?"default":"outline",class:"cursor-pointer",onClick:()=>e(y).includes(C)?y.value=e(y).filter(H=>H!==C):e(y).push(C)},{default:i(()=>[k(h(C),1)]),_:2},1032,["variant","onClick"]))),128))])):F("",!0),x.schemaError?(d(),P("p",Io,h(x.schemaError),1)):x.schemaLoading?(d(),P("p",Fo," Loading schemas... ")):(d(),P("p",Ro,h(e(y).length?`${e(y).length} selected`:"All visible schemas"),1))])):F("",!0),s(q,{class:"w-full",disabled:x.loading||x.disabled,onClick:r},{default:i(()=>[x.loading?(d(),E(R,{key:0,name:"hugeicons:loading-03",class:"size-4 mr-2 animate-spin"})):(d(),E(R,{key:1,name:"lucide:download",class:"size-4 mr-2"})),k(" "+h(x.loading?"Creating Backup...":"Create Backup"),1)]),_:1},8,["disabled"])])}}}),qo={class:"relative mt-2 cursor-pointer rounded-lg border-2 border-dashed p-6 text-center transition-colors hover:border-primary/50"},zo=["accept"],Ao={key:0,class:"text-muted-foreground pointer-events-none"},Vo={class:"text-xs mt-1"},Oo={key:1,class:"flex items-center justify-center gap-3"},No={class:"text-left"},Mo={class:"text-sm font-medium"},Uo={class:"text-xs text-muted-foreground"},jo=G({__name:"ImportFileDropzone",props:{selectedFile:{},accept:{},extensionSummary:{}},emits:["change","clear"],setup(p){const l=t=>t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:`${(t/1048576).toFixed(1)} MB`;return(t,o)=>{const u=ee,m=se,y=ae;return d(),P("div",null,[s(u,{class:"text-sm font-medium"},{default:i(()=>o[2]||(o[2]=[k("Backup File")])),_:1}),a("div",qo,[a("input",{type:"file",accept:t.accept,class:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",onChange:o[0]||(o[0]=b=>t.$emit("change",b))},null,40,zo),t.selectedFile?(d(),P("div",Oo,[s(m,{name:"hugeicons:file-01",class:"size-8 text-primary"}),a("div",No,[a("p",Mo,h(t.selectedFile.name),1),a("p",Uo,h(l(t.selectedFile.size)),1)]),s(y,{variant:"ghost",size:"icon",class:"ml-2 relative z-10",type:"button",onClick:o[1]||(o[1]=zt(b=>t.$emit("clear"),["stop"]))},{default:i(()=>[s(m,{name:"hugeicons:x-close",class:"size-4"})]),_:1})])):(d(),P("div",Ao,[s(m,{name:"hugeicons:upload-cloud-01",class:"size-10 mx-auto mb-2 opacity-50"}),o[3]||(o[3]=a("p",{class:"text-sm font-medium"},"Click to select a file",-1)),a("p",Vo,"Supports "+h(t.extensionSummary)+" backups",1)]))])])}}}),Ho={class:"space-y-3"},Jo={class:"grid grid-cols-2 gap-4"},Wo=G({__name:"ImportOptionsForm",props:{modelValue:{required:!0},modelModifiers:{}},emits:["update:modelValue"],setup(p){const l=Ke(p,"modelValue"),t=(u,m)=>{l.value[u]=m},o=[{key:"clean",label:"Drop Objects First",id:"import-clean"},{key:"dataOnly",label:"Data Only",id:"import-data-only"},{key:"schemaOnly",label:"Schema Only",id:"import-schema-only"},{key:"exitOnError",label:"Exit on Error",id:"import-exit-on-error"}];return(u,m)=>{const y=ee,b=Xe;return d(),P("div",Ho,[s(y,{class:"text-sm font-medium"},{default:i(()=>m[0]||(m[0]=[k("Options")])),_:1}),a("div",Jo,[(d(),P(Q,null,X(o,r=>a("div",{key:r.key,class:"flex items-center space-x-2"},[s(b,{id:r.id,"model-value":l.value[r.key],"onUpdate:modelValue":f=>t(r.key,f)},null,8,["id","model-value","onUpdate:modelValue"]),s(y,{for:r.id,class:"text-sm"},{default:i(()=>[k(h(r.label),1)]),_:2},1032,["for"])])),64))])])}}}),Qo={class:"space-y-3 rounded-lg border border-dashed p-3"},Go={class:"flex items-start justify-between gap-3"},Ko={class:"space-y-1"},Xo={key:0,class:"text-xs text-muted-foreground"},Yo={key:0,class:"space-y-2"},Zo={key:1,class:"flex items-start justify-between gap-3 rounded-md bg-muted/40 px-3 py-2"},es={key:2,class:"text-xs text-muted-foreground"},ts={key:3,class:"grid gap-3 md:grid-cols-[180px_minmax(0,1fr)]"},os={class:"space-y-1"},ss={class:"space-y-1"},Ve=G({__name:"NativeToolSelector",props:At({title:{},description:{},detectedPaths:{},toolChoices:{},disabled:{type:Boolean}},{modelValue:{required:!0},modelModifiers:{}}),emits:["update:modelValue"],setup(p){const l=p,t=Ke(p,"modelValue"),o=g(()=>l.detectedPaths.length>0),u=g(()=>t.value.useCustomPath||!o.value),m=g(()=>l.detectedPaths.length===1?"1 executable found":`${l.detectedPaths.length} executables found`),y=g(()=>{switch(t.value.customTool||l.toolChoices[0]){case"pg_dump":return"/Applications/Postgres.app/.../bin/pg_dump";case"pg_restore":return"/Applications/Postgres.app/.../bin/pg_restore";case"psql":return"/Applications/Postgres.app/.../bin/psql";case"mysqldump":return"/opt/homebrew/Cellar/mysql/.../bin/mysqldump";case"mysqlpump":return"/opt/homebrew/Cellar/mysql/.../bin/mysqlpump";case"mysql":return"/opt/homebrew/Cellar/mysql/.../bin/mysql";case"sqlite3":return"/usr/local/bin/sqlite3";default:return"/usr/local/bin/native-tool"}}),b=_=>{t.value.selectedPath=_},r=_=>{t.value.customTool=_},f=_=>{t.value.useCustomPath=o.value?_:!0},x=_=>`${_.tool} • ${_.path}`;return(_,w)=>{const D=ee,v=de,T=We,B=Je,R=Ge,q=Qe,C=He,H=Xe,S=Ye;return d(),P("div",Qo,[a("div",Go,[a("div",Ko,[s(D,{class:"text-sm font-medium"},{default:i(()=>[k(h(_.title),1)]),_:1}),_.description?(d(),P("p",Xo,h(_.description),1)):F("",!0)]),e(o)?(d(),E(v,{key:0,variant:"secondary",class:"shrink-0"},{default:i(()=>[k(h(e(m)),1)]),_:1})):F("",!0)]),e(o)&&!t.value.useCustomPath?(d(),P("div",Yo,[s(D,{class:"text-xs font-medium text-muted-foreground"},{default:i(()=>w[4]||(w[4]=[k(" Detected Executable ")])),_:1}),s(C,{"model-value":t.value.selectedPath,disabled:_.disabled,size:"xs","onUpdate:modelValue":w[0]||(w[0]=$=>b(String($)))},{default:i(()=>[s(B,null,{default:i(()=>[s(T,{placeholder:"Choose a native tool"})]),_:1}),s(q,null,{default:i(()=>[(d(!0),P(Q,null,X(_.detectedPaths,$=>(d(),E(R,{key:$.path,value:$.path},{default:i(()=>[k(h(x($)),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value","disabled"])])):F("",!0),e(o)?(d(),P("div",Zo,[w[5]||(w[5]=a("div",{class:"space-y-1"},[a("p",{class:"text-sm font-medium"},"Use custom executable path"),a("p",{class:"text-xs text-muted-foreground"}," Point HeraQ to a specific binary when you need a different version. ")],-1)),s(H,{"model-value":t.value.useCustomPath,disabled:_.disabled,"onUpdate:modelValue":w[1]||(w[1]=$=>f(!!$))},null,8,["model-value","disabled"])])):(d(),P("p",es," No executable was detected automatically. Enter the full path to the driver you want to run. ")),e(u)?(d(),P("div",ts,[a("div",os,[s(D,{class:"text-xs font-medium text-muted-foreground"},{default:i(()=>w[6]||(w[6]=[k(" Tool ")])),_:1}),s(C,{"model-value":t.value.customTool||_.toolChoices[0],disabled:_.disabled,size:"sm","onUpdate:modelValue":w[2]||(w[2]=$=>r(String($)))},{default:i(()=>[s(B,null,{default:i(()=>[s(T,{placeholder:"Choose a tool"})]),_:1}),s(q,null,{default:i(()=>[(d(!0),P(Q,null,X(_.toolChoices,$=>(d(),E(R,{key:$,value:$},{default:i(()=>[k(h($),1)]),_:2},1032,["value"]))),128))]),_:1})]),_:1},8,["model-value","disabled"])]),a("div",ss,[s(D,{class:"text-xs font-medium text-muted-foreground"},{default:i(()=>w[7]||(w[7]=[k(" Executable Path ")])),_:1}),s(S,{modelValue:t.value.customPath,"onUpdate:modelValue":w[3]||(w[3]=$=>t.value.customPath=$),disabled:_.disabled,placeholder:e(y),class:"h-8!",autocomplete:"off",spellcheck:"false"},null,8,["modelValue","disabled","placeholder"]),w[8]||(w[8]=a("p",{class:"text-xs text-muted-foreground"}," Enter the absolute path to the binary you want HeraQ to execute. ",-1))])])):F("",!0)])}}}),as={class:"space-y-3 py-1"},xe="restore backup",ns=G({__name:"RestoreConfirmDialog",props:{open:{type:Boolean}},emits:["confirm","cancel"],setup(p,{emit:l}){const t=p,o=l,u=I("");Z(()=>t.open,b=>{b&&(u.value="")});const m=g(()=>u.value===xe),y=()=>{m.value&&o("confirm")};return(b,r)=>{const f=se,x=Nt,_=Mt,w=Ot,D=ee,v=Ye,T=ae,B=jt,R=Ht,q=Vt;return d(),E(q,{open:b.open,"onUpdate:open":r[2]||(r[2]=C=>!C&&b.$emit("cancel"))},{default:i(()=>[s(R,{class:"max-w-sm"},{default:i(()=>[s(w,null,{default:i(()=>[s(x,{class:"flex items-center gap-2 text-destructive"},{default:i(()=>[s(f,{name:"hugeicons:alert-02",class:"size-5"}),r[3]||(r[3]=k(" Confirm Restore "))]),_:1}),s(_,null,{default:i(()=>r[4]||(r[4]=[k(" This will overwrite existing data in the target database. This action cannot be undone. ")])),_:1})]),_:1}),a("div",as,[s(D,{for:"restore-confirm-input"},{default:i(()=>[r[5]||(r[5]=k(" Type ")),a("code",{class:"rounded bg-muted px-1 py-0.5 text-xs font-mono"},h(xe)),r[6]||(r[6]=k(" to continue: "))]),_:1}),s(v,{id:"restore-confirm-input",modelValue:e(u),"onUpdate:modelValue":r[0]||(r[0]=C=>oe(u)?u.value=C:null),placeholder:xe,autocomplete:"off",onKeydown:Ut(y,["enter"])},null,8,["modelValue"])]),s(B,null,{default:i(()=>[s(T,{variant:"outline",onClick:r[1]||(r[1]=C=>b.$emit("cancel"))},{default:i(()=>r[7]||(r[7]=[k("Cancel")])),_:1}),s(T,{variant:"destructive",disabled:!e(m),onClick:y},{default:i(()=>r[8]||(r[8]=[k(" Restore ")])),_:1},8,["disabled"])]),_:1})]),_:1})]),_:1},8,["open"])}}}),ls={class:"rounded-lg border bg-muted/30 p-4"},rs={class:"flex items-center justify-between gap-4"},is={class:"text-sm font-medium"},us={class:"text-xs text-muted-foreground"},cs={class:"flex shrink-0 items-center gap-2"},ds={class:"text-sm font-medium"},ms={class:"mt-3 h-2 overflow-hidden rounded-full bg-border/60"},Oe=G({__name:"TransferProgressCard",props:{tool:{},stage:{},statusMessage:{},progress:{},isRunning:{type:Boolean},progressClass:{default:"bg-primary"},actionLabel:{default:void 0},actionDisabled:{type:Boolean,default:!1}},emits:["action"],setup(p,{emit:l}){const t=l;return(o,u)=>{const m=se,y=ae;return d(),P("div",ls,[a("div",rs,[a("div",null,[a("p",is,h(o.tool)+" · "+h(o.stage),1),a("p",us,h(o.statusMessage||"Preparing job..."),1)]),a("div",cs,[o.actionLabel?(d(),E(y,{key:0,type:"button",variant:"outline",size:"sm",disabled:o.actionDisabled,onClick:u[0]||(u[0]=b=>t("action"))},{default:i(()=>[s(m,{name:"lucide:folder-open",class:"size-4 mr-2"}),k(" "+h(o.actionLabel),1)]),_:1},8,["disabled"])):F("",!0),a("span",ds,h(o.progress)+"%",1)])]),a("div",ms,[a("div",{class:me(["h-full rounded-full transition-all duration-300",o.progressClass]),style:Jt({width:`${Math.max(o.progress,o.isRunning?8:0)}%`})},null,6)])])}}});function Ne(p){return!!(p&&(p.status==="completed"||p.status==="error"))}const nt=()=>{const p=I(null),l=I(null),t=I(null),o=I(!1);let u=null,m=null;const y=v=>{u==null||u(v),u=null,m=null},b=v=>{m==null||m(v),u=null,m=null},r=async()=>{if(!t.value)throw new Error("Backup job status URL is missing.");if(o.value){if(p.value)return p.value;throw new Error("Backup job refresh is already in progress.")}o.value=!0;try{const v=await $fetch(t.value);return p.value=v,v.status==="error"&&(l.value=v.error||v.message),Ne(v)&&(f(),y(v)),v}catch(v){const T=v instanceof Error?v:new Error("Failed to refresh backup job status.");throw l.value=T.message,f(),b(T),T}finally{o.value=!1}},{pause:f,resume:x,isActive:_}=Wt(()=>{r()},1e3,{immediate:!1,immediateCallback:!1}),w=async v=>{t.value=v,l.value=null;const T=await r();return Ne(T)?T:(x(),await new Promise((B,R)=>{u=B,m=R}))},D=()=>{f(),t.value=null,p.value=null,l.value=null,o.value=!1,u=null,m=null};return Qt(()=>{f()}),{job:p,error:l,isRefreshing:o,isPolling:_,progress:g(()=>{var v;return((v=p.value)==null?void 0:v.progress)??0}),message:g(()=>{var v;return((v=p.value)==null?void 0:v.message)??null}),stage:g(()=>{var v;return((v=p.value)==null?void 0:v.stage)??"queued"}),status:g(()=>{var v;return((v=p.value)==null?void 0:v.status)??"queued"}),isRunning:g(()=>{var v,T;return((v=p.value)==null?void 0:v.status)==="queued"||((T=p.value)==null?void 0:T.status)==="running"}),monitorJob:w,refresh:r,reset:D}},ps=p=>(p||"database").trim().replace(/[\\/:*?"<>|]+/g,"-").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")||"database",fs=()=>new Date().toISOString().replace(/[:.]/g,"-"),vs=(p,l)=>`${p.replace(/[\\/]$/,"")}/${l}`,Me=p=>!Number.isFinite(p)||p<=0?"0.0s":`${(p/1e3).toFixed(1)}s`,gs=(p,l)=>{const t=I(null),o=I(null),u=nt(),{downloadStream:m,isDownloading:y,downloadedBytes:b}=no(),r=g(()=>u.isRunning.value||y.value),f=g(()=>o.value||y.value?100:u.progress.value),x=g(()=>o.value?`Backup is ready. ${ye(o.value.size)} generated in ${Me(o.value.duration)}.`:y.value?`Saving backup artifact (${ye(b.value)})...`:u.message.value),_=g(()=>u.job.value),w=async(T,B)=>{var H,S,$,M,A,W;if(!p.value)return t.value="No database connection provided",!1;const{options:R,runtime:q,promptForSaveLocation:C}=B;if(l!=null&&l.value&&!l.value.exportAvailable&&!((H=q==null?void 0:q.executablePath)!=null&&H.trim()))return t.value=l.value.exportMessage,!1;t.value=null,o.value=null;try{let L=((S=B.saveDirectoryPath)==null?void 0:S.trim())||void 0,V=(($=B.saveFilePath)==null?void 0:$.trim())||void 0;const K=`${ps(T)}_backup_${fs()}${D((M=p.value)==null?void 0:M.type,R.format)}`;if(!L&&!V&&C&&((A=window.electronAPI)!=null&&A.window.pickDirectory)){const z=await window.electronAPI.window.pickDirectory();if(!z)return t.value="No save location was selected.",!1;L=z}!V&&L&&(V=vs(L,K));const J=await $fetch("/api/database-export/export-database",{method:"POST",body:{...Ze(p.value),databaseName:T,options:R,runtime:q}}),j=await u.monitorJob(J.statusUrl);if(j.status==="error")return t.value=j.error||j.message,!1;if(!j.downloadUrl||!j.downloadFileName)return t.value="Export finished but no download artifact was returned.",!1;const te=await m({url:j.downloadUrl,method:"GET",filename:V?K:j.downloadFileName||K,saveFilePath:V,openPath:L,successTitle:"Backup is ready",getSuccessDescription:z=>`${ye(z)} generated in ${Me(j.duration||0)}.`});return te.success?(o.value={fileName:V?K:j.downloadFileName,duration:j.duration||0,size:te.size||0,saveDirectoryPath:L,saveFilePath:V},!0):(t.value=((W=te.error)==null?void 0:W.message)||"Download failed.",!1)}catch(L){return t.value=L instanceof Error?L.message:"Export failed. Check the connection and backup configuration.",console.error("Export error:",L),!1}},D=(T,B)=>so(T,B);return{isExporting:r,progress:f,error:t,lastExport:o,currentJob:_,statusMessage:x,exportDatabase:w,reset:()=>{u.reset(),t.value=null,o.value=null}}},_s=(p,l)=>{const t=nt(),o=g(()=>t.isRunning.value),u=g(()=>t.progress.value),m=g(()=>t.message.value),y=g(()=>t.job.value),b=I(null),r=I(null),f=I(null),x=I(null),_=I({clean:!1,dataOnly:!1,schemaOnly:!1,exitOnError:!0}),w=g(()=>{var S;return(S=p.value)==null?void 0:S.type}),D=g(()=>{var S;return((S=l.value)==null?void 0:S.formatOptions)||[]}),v=g(()=>at(w.value)),T=g(()=>{var S;return((S=l.value)==null?void 0:S.acceptExtensions)||D.value.map($=>$.extension).join(" / ")||".sql"}),B=()=>{f.value=null,x.value&&(x.value.value="")};return{isImporting:o,progress:u,statusMessage:m,currentJob:y,error:b,success:r,selectedFile:f,fileInputRef:x,options:_,extensionSummary:T,clearSelectedFile:B,openFilePicker:()=>{var S;(S=x.value)==null||S.click()},onFileSelect:S=>{var W;const $=S.target;if(!((W=$.files)!=null&&W.length))return;const M=$.files[0];if(!D.value.some(L=>M.name.toLowerCase().endsWith(L.extension.toLowerCase()))){B(),b.value=`Unsupported file type. Use ${T.value} for ${v.value}.`,r.value=null;return}f.value=M,b.value=null,r.value=null},importDatabase:async S=>{var $,M;if(!(!f.value||!p.value)){if(l.value&&!l.value.importAvailable&&!(($=S==null?void 0:S.executablePath)!=null&&$.trim())){b.value=l.value.importMessage,r.value=null;return}b.value=null,r.value=null;try{const A=new FormData;A.append("file",f.value);const W=Ze(p.value);Object.entries(W).forEach(([K,J])=>{J!==void 0&&A.append(K,typeof J=="object"?JSON.stringify(J):String(J))}),A.append("options",JSON.stringify(_.value)),(M=S==null?void 0:S.executablePath)!=null&&M.trim()&&A.append("runtime",JSON.stringify(S));const L=await $fetch("/api/database-import/import-database",{method:"POST",body:A}),V=await t.monitorJob(L.statusUrl);if(V.status==="completed"){r.value=V.message||"Database imported successfully",B();return}b.value=V.error||V.message||"Import failed"}catch(A){b.value=A instanceof Error?A.message:"Import failed. Check the backup file and connection compatibility.",console.error("Import error:",A)}}},reset:()=>{t.reset(),b.value=null,r.value=null,B()}}},bs=p=>{const l=I(null),t=I(!1),o=I(null);let u=0;const m=async()=>{const y=p.value,b=++u;if(!y){l.value=null,o.value=null,t.value=!1;return}t.value=!0,o.value=null;try{const r=await $fetch("/api/database-backup/capability",{query:{type:y,discoverAll:et()}});if(b!==u)return;l.value=r}catch(r){if(b!==u)return;l.value=null,o.value=r instanceof Error?r.message:"Unable to detect native backup tools."}finally{b===u&&(t.value=!1)}};return Z(p,()=>{m()},{immediate:!0}),{capability:l,isLoading:t,error:o,refresh:m}};function Ue(){return{useCustomPath:!1,selectedPath:"",customPath:"",customTool:""}}const je=(p,l,t)=>{const o=I(Ue()),u=g(()=>{const r=new Set(l.value);return p.value.filter(f=>r.size===0||r.has(f.tool))}),m=g(()=>u.value.find(r=>r.path===o.value.selectedPath)||null);Z([u,l,t],([r,f,x])=>{var _;if(!x){o.value=Ue();return}if(f.includes(o.value.customTool)||(o.value.customTool=f[0]||""),r.some(w=>w.path===o.value.selectedPath)||(o.value.selectedPath=((_=r[0])==null?void 0:_.path)||""),!r.length){o.value.useCustomPath=!0;return}o.value.useCustomPath&&!o.value.customPath.trim()&&(o.value.useCustomPath=!1)},{immediate:!0});const y=g(()=>{if(t.value){if(o.value.useCustomPath){const r=o.value.customPath.trim(),f=o.value.customTool;return!r||!f?void 0:{tool:f,executablePath:r}}if(m.value)return{tool:m.value.tool,executablePath:m.value.path}}}),b=g(()=>!t.value||!!y.value);return{selection:o,filteredToolPaths:u,runtimeSelection:y,canSubmit:b}},hs={class:"flex flex-col h-full gap-3 overflow-hidden p-3"},ys={class:"font-medium text-foreground"},xs={class:"text-muted-foreground/60"},ks={class:"flex items-center justify-between gap-2"},ws={class:"text-xs text-muted-foreground"},$s={class:"relative flex-1 overflow-y-auto rounded-lg border bg-background p-4"},Cs={class:"space-y-4"},Ss={class:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between"},Ps={class:"mt-1 text-sm text-muted-foreground"},Ts={class:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]"},Ds={class:"rounded-lg border p-4 space-y-4"},Bs={class:"space-y-4"},Es={class:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between"},Is={class:"mt-1 text-sm text-muted-foreground"},Fs={class:"grid gap-4 xl:grid-cols-[minmax(0,1fr)_280px]"},Rs={class:"rounded-lg border p-4 space-y-4"},Ls={class:"text-muted-foreground text-xs inline-flex items-center gap-0.5"},qs={class:"text-destructive gap-0.5 items-center inline-flex"},Hs=G({__name:"BackupRestoreContainer",props:{connectionId:{},initialTab:{}},setup(p){const l=p,{workspaceId:t}=Gt(),o=Kt(),u=Xt(),m=g(()=>{if(l.connectionId)return o.connections.find(n=>n.id===l.connectionId)}),y=g(()=>{var n;return(n=m.value)==null?void 0:n.type}),b=g(()=>{var n,c;return((n=m.value)==null?void 0:n.database)||((c=m.value)==null?void 0:c.name)||"database"}),r=g(()=>at(y.value)),{capability:f,isLoading:x,error:_,refresh:w}=bs(y),D=I(!1),v=g(()=>et()),T=async()=>{D.value=!0;try{await w()}finally{D.value=!1}},B=g(()=>{var n;return((n=f.value)==null?void 0:n.supported)??!1}),R=g(()=>{var n;return((n=f.value)==null?void 0:n.exportAvailable)??!1}),q=g(()=>{var n;return((n=f.value)==null?void 0:n.importAvailable)??!1}),C=g(()=>B.value&&(R.value||v.value)),H=g(()=>B.value&&(q.value||v.value)),S=g(()=>_.value?_.value:f.value?f.value.supportMessage:y.value?`Checking ${r.value} native tools...`:"Select a connection to open database tools."),$=g(()=>{var n;return((n=f.value)==null?void 0:n.toolHint)||"Native database tools"}),M=g(()=>{var n;return((n=f.value)==null?void 0:n.formatOptions)||[]}),A=g(()=>{var n;return((n=f.value)==null?void 0:n.acceptExtensions)||".sql"}),W=g(()=>M.value.map(n=>n.extension).join(" / ")||".sql"),L=g(()=>{var n,c;return x.value||!B.value||R.value&&q.value?null:[R.value?null:(n=f.value)==null?void 0:n.exportMessage,q.value?null:(c=f.value)==null?void 0:c.importMessage].filter(Boolean).join(" ")}),V=g(()=>{var c;if(!l.connectionId)return[];const n=t.value||((c=m.value)==null?void 0:c.workspaceId);return(u.schemas[l.connectionId]||[]).filter(U=>U.connectionId===l.connectionId&&(!n||U.workspaceId===n)).map(U=>U.name)}),K=g(()=>u.loading[l.connectionId]||!1),J=I(null),j=async()=>{const n=m.value,c=t.value||(n==null?void 0:n.workspaceId);if(!l.connectionId||!c||!n)return;if((u.schemas[l.connectionId]||[]).some(O=>O.connectionId===l.connectionId&&O.workspaceId===c)){J.value=null;return}try{J.value=null,await u.fetchSchemas({connectionId:l.connectionId,workspaceId:c,connection:n})}catch(O){J.value=O instanceof Error?O.message:"Failed to load schemas."}};Z([m,()=>t.value],()=>{j()},{immediate:!0});const te=[{id:"export",tabLabel:"Create Backup",subtitle:"Generate native backup artifacts for the current connection.",icon:"hugeicons:download-01"},{id:"import",tabLabel:"Restore Backup",subtitle:"Apply a native backup artifact back into this connection.",icon:"hugeicons:upload-01"}],z=I(l.initialTab),lt=g(()=>te.find(n=>n.id===z.value));Z(()=>l.initialTab,n=>{z.value=n}),Z([z,C,H],([n,c,U])=>{if(n==="export"&&!c&&U){z.value="import";return}n==="import"&&!U&&c&&(z.value="export")},{immediate:!0});const rt=n=>{z.value=n},{isExporting:ne,progress:it,error:ke,lastExport:we,currentJob:pe,statusMessage:ut,exportDatabase:ct,reset:dt}=gs(m,f),$e=(n=[],c=[])=>[...new Set([...n,...c])],Ce=g(()=>{var n,c;return $e(((n=f.value)==null?void 0:n.availableExportTools)||[],((c=f.value)==null?void 0:c.missingExportTools)||[])}),mt=g(()=>{var n;return((n=f.value)==null?void 0:n.availableExportToolPaths)||[]}),{selection:fe,filteredToolPaths:pt,runtimeSelection:ft,canSubmit:vt}=je(mt,Ce,v),gt=async()=>{var c,U;const n=(c=we.value)==null?void 0:c.saveDirectoryPath;!n||!((U=window.electronAPI)!=null&&U.window.openPath)||await window.electronAPI.window.openPath(n)},_t=async n=>{await ct(b.value,{options:n,runtime:ft.value,promptForSaveLocation:v.value,saveDirectoryPath:void 0})},{isImporting:Y,progress:bt,statusMessage:ht,currentJob:ve,error:Se,success:Pe,selectedFile:ue,options:ge,extensionSummary:yt,onFileSelect:xt,clearSelectedFile:kt,importDatabase:wt,reset:$t}=_s(m,f),Ct=g(()=>{var n,c;return $e(((n=f.value)==null?void 0:n.availableImportTools)||[],((c=f.value)==null?void 0:c.missingImportTools)||[])}),_e=g(()=>{var n;return y.value!==Yt.POSTGRES||!((n=ue.value)!=null&&n.name)?Ct.value:[ue.value.name.toLowerCase().endsWith(".dump")?"pg_restore":"psql"]}),St=g(()=>{var n;return(((n=f.value)==null?void 0:n.availableImportToolPaths)||[]).filter(c=>_e.value.includes(c.tool))}),{selection:be,filteredToolPaths:Pt,runtimeSelection:Tt,canSubmit:Dt}=je(St,_e,v),ce=I(!1),Bt=()=>{ce.value=!0},Et=async()=>{ce.value=!1,await wt(Tt.value)},It=()=>{ce.value=!1};return(n,c)=>{var Te,De,Be,Ee,Ie,Fe,Re;const U=qt,O=se,Ft=oo,Rt=to,Lt=eo,le=st,re=ot,ie=tt,he=ae;return d(),P("div",hs,[s(ns,{open:e(ce),onConfirm:Et,onCancel:It},null,8,["open"]),s(U,{icon:"hugeicons:database-import",title:"Backup & Restore"},{context:i(()=>[a("span",ys,h(e(b)),1),a("span",xs,"· "+h(e(r)),1)]),_:1}),a("div",ks,[s(Lt,{modelValue:e(z),"onUpdate:modelValue":c[0]||(c[0]=N=>oe(z)?z.value=N:null),class:"min-w-0 flex-1 gap-0"},{default:i(()=>[s(Rt,{size:"sm",class:"max-w-full justify-start! overflow-x-auto"},{default:i(()=>[(d(),P(Q,null,X(te,N=>s(Ft,{size:"xs",key:N.id,value:N.id,class:"min-w-fit shrink-0 cursor-pointer rounded-sm",disabled:e(x)||(N.id==="export"?!e(C):!e(H)),onClick:zs=>rt(N.id)},{default:i(()=>[s(O,{name:N.icon,class:"shrink-0 size-3.5"},null,8,["name"]),k(" "+h(N.tabLabel),1)]),_:2},1032,["value","disabled","onClick"])),64))]),_:1})]),_:1},8,["modelValue"]),a("div",ws,h((Te=e(lt))==null?void 0:Te.subtitle),1)]),a("div",$s,[e(x)&&!e(D)?(d(),E(Zt,{key:0,visible:""})):F("",!0),(!e(x)||e(D))&&e(_)?(d(),E(ie,{key:1,variant:"destructive"},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[4]||(c[4]=[k("Capability Check Failed")])),_:1}),s(re,null,{default:i(()=>[k(h(e(S)),1)]),_:1})]),_:1})):(!e(x)||e(D))&&!e(B)?(d(),E(xo,{key:2,"support-message":e(S),"connection-type":e(y),"is-loading":e(D),onReload:T},null,8,["support-message","connection-type","is-loading"])):!e(x)&&!e(D)?(d(),P(Q,{key:3},[e(L)?(d(),E(ie,{key:0},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[5]||(c[5]=[k("Partial Native Tool Support")])),_:1}),s(re,null,{default:i(()=>[k(h(e(L)),1)]),_:1})]),_:1})):F("",!0),Le(a("div",Cs,[a("div",Ss,[a("div",null,[c[6]||(c[6]=a("h3",{class:"text-base font-medium"},"Create Backup",-1)),a("p",Ps," Export "+h(e(b))+" using "+h(e($))+". ",1)])]),e(ke)?(d(),E(ie,{key:0,variant:"destructive"},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[7]||(c[7]=[k("Backup Failed")])),_:1}),s(re,null,{default:i(()=>[k(h(e(ke)),1)]),_:1}),s(he,{size:"sm",variant:"outline",class:"mt-2",onClick:e(dt)},{default:i(()=>c[8]||(c[8]=[k(" Try Again ")])),_:1},8,["onClick"])]),_:1})):F("",!0),e(ne)||e(pe)?(d(),E(Oe,{key:1,tool:((De=e(pe))==null?void 0:De.tool)||e($),stage:((Be=e(pe))==null?void 0:Be.stage)||"queued","status-message":e(ut)||"",progress:e(it),"is-running":e(ne),"action-label":(Ee=e(we))!=null&&Ee.saveDirectoryPath&&!e(ne)?"Open":void 0,onAction:gt},null,8,["tool","stage","status-message","progress","is-running","action-label"])):F("",!0),a("div",Ts,[a("div",Ds,[e(v)?(d(),E(Ve,{key:0,modelValue:e(fe),"onUpdate:modelValue":c[1]||(c[1]=N=>oe(fe)?fe.value=N:null),title:"Backup Driver",description:"Choose the exact executable OrcaQ should run for this backup job.","detected-paths":e(pt),"tool-choices":e(Ce),disabled:e(ne)},null,8,["modelValue","detected-paths","tool-choices","disabled"])):F("",!0),s(Lo,{schemas:e(V),"schema-loading":e(K),"schema-error":e(J),loading:e(ne),disabled:e(v)&&!e(vt),"format-options":e(M),"default-format":(Ie=e(f))==null?void 0:Ie.defaultExportFormat,"tool-hint":e($),onSubmit:_t},null,8,["schemas","schema-loading","schema-error","loading","disabled","format-options","default-format","tool-hint"])]),s(ze,{title:"Backup Profile",description:"Exports run on the local runtime host and stream the artifact directly into a downloadable file.",formats:e(M),"tool-hint":e($),"target-name":e(b),"formats-label":"Supported Files"},null,8,["formats","tool-hint","target-name"])])],512),[[qe,e(z)==="export"]]),Le(a("div",Bs,[a("div",Es,[a("div",null,[c[9]||(c[9]=a("h3",{class:"text-base font-medium"},"Restore Backup",-1)),a("p",Is," Restore a "+h(e(W))+" backup into "+h(e(b))+". ",1)])]),e(Se)?(d(),E(ie,{key:0,variant:"destructive"},{default:i(()=>[s(O,{name:"hugeicons:alert-circle",class:"size-4"}),s(le,null,{default:i(()=>c[10]||(c[10]=[k("Import Failed")])),_:1}),s(re,null,{default:i(()=>[k(h(e(Se)),1)]),_:1}),s(he,{size:"sm",variant:"outline",class:"mt-2",onClick:e($t)},{default:i(()=>c[11]||(c[11]=[k(" Try Again ")])),_:1},8,["onClick"])]),_:1})):F("",!0),e(Pe)?(d(),E(ie,{key:1},{default:i(()=>[s(O,{name:"hugeicons:checkmark-circle-02",class:"size-4 text-green-500"}),s(le,null,{default:i(()=>c[12]||(c[12]=[k("Import Complete")])),_:1}),s(re,null,{default:i(()=>[k(h(e(Pe)),1)]),_:1})]),_:1})):F("",!0),e(Y)||e(ve)?(d(),E(Oe,{key:2,tool:((Fe=e(ve))==null?void 0:Fe.tool)||e($),stage:((Re=e(ve))==null?void 0:Re.stage)||"queued","status-message":e(ht)||"",progress:e(bt),"is-running":e(Y),"progress-class":"bg-emerald-500"},null,8,["tool","stage","status-message","progress","is-running"])):F("",!0),a("div",Fs,[a("div",Rs,[s(jo,{"selected-file":e(ue),accept:e(A),"extension-summary":e(yt),onChange:e(xt),onClear:e(kt)},null,8,["selected-file","accept","extension-summary","onChange","onClear"]),e(v)?(d(),E(Ve,{key:0,modelValue:e(be),"onUpdate:modelValue":c[2]||(c[2]=N=>oe(be)?be.value=N:null),title:"Restore Driver",description:"Choose the executable HeraQ should use to restore this backup artifact.","detected-paths":e(Pt),"tool-choices":e(_e),disabled:e(Y)},null,8,["modelValue","detected-paths","tool-choices","disabled"])):F("",!0),s(Wo,{modelValue:e(ge),"onUpdate:modelValue":c[3]||(c[3]=N=>oe(ge)?ge.value=N:null)},null,8,["modelValue"]),s(he,{class:"w-full",disabled:!e(ue)||e(Y)||e(v)&&!e(Dt),onClick:Bt},{default:i(()=>[s(O,{name:e(Y)?"hugeicons:loading-03":"hugeicons:upload-01",class:me(["size-4 mr-2",e(Y)&&"animate-spin"])},null,8,["name","class"]),k(" "+h(e(Y)?"Restoring...":"Restore Backup"),1)]),_:1},8,["disabled"]),a("p",Ls,[a("polyline",qs,[s(O,{name:"hugeicons:alert-circle",class:"size-4 text-destructive"}),c[13]||(c[13]=k(" Warning: "))]),c[14]||(c[14]=k(" Importing a database can overwrite existing data. Make sure you have a backup before proceeding. "))])]),s(ze,{title:"Restore Profile",description:"Use a backup file produced for the same database family and runtime toolchain.",formats:e(M),"tool-hint":e($),"target-name":e(b),"formats-label":"Accepted Files"},null,8,["formats","tool-hint","target-name"])])],512),[[qe,e(z)==="import"]])],64)):F("",!0)])])}}});export{Hs as _};