@duplicati/ngclient 0.0.5 → 0.0.6

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 (54) hide show
  1. package/{chunk-QTQWYR6H.js → chunk-22HCWJS5.js} +1 -1
  2. package/{chunk-RZUDMW24.js → chunk-24PLBY6C.js} +1 -1
  3. package/chunk-3MM4GLBS.js +1 -0
  4. package/{chunk-PJNE2N54.js → chunk-3MTW6FJP.js} +1 -1
  5. package/{chunk-RCES7NCR.js → chunk-4FK75Z4C.js} +1 -1
  6. package/{chunk-43IMNGQL.js → chunk-4MMHXTNF.js} +1 -1
  7. package/chunk-57M4MADC.js +1 -0
  8. package/{chunk-VAAR5GXC.js → chunk-6XUWDRDE.js} +1 -1
  9. package/{chunk-2WYEYW3N.js → chunk-77NTMJCT.js} +1 -1
  10. package/{chunk-IOM7KF2W.js → chunk-7X6SBNMU.js} +1 -1
  11. package/{chunk-VF6HT3GY.js → chunk-A66Z6362.js} +1 -1
  12. package/{chunk-J6KTHSHX.js → chunk-AC6VDRLC.js} +1 -1
  13. package/chunk-BNNZKRIC.js +1 -0
  14. package/{chunk-GAT3R5MA.js → chunk-CKPPU3GS.js} +1 -1
  15. package/chunk-DYANEO5K.js +1 -0
  16. package/chunk-GJTW7UUU.js +1 -0
  17. package/{chunk-F3A4UEZK.js → chunk-GMANGOGH.js} +1 -1
  18. package/{chunk-7POJIDMZ.js → chunk-I6QIKK6M.js} +1 -1
  19. package/{chunk-TGC6GY4N.js → chunk-IOWSWUHM.js} +1 -1
  20. package/{chunk-BHHWIMLQ.js → chunk-IQSBPGVL.js} +1 -1
  21. package/{chunk-OX435KV6.js → chunk-L47VTK2X.js} +1 -1
  22. package/{chunk-63RKHEAK.js → chunk-LVLU6MPQ.js} +1 -1
  23. package/{chunk-JRXXG6O7.js → chunk-N5US3SKW.js} +1 -1
  24. package/{chunk-2DCEAXBG.js → chunk-NIMPOFJV.js} +1 -1
  25. package/chunk-ORDBF5MR.js +8 -0
  26. package/{chunk-GBVLF3BS.js → chunk-PH6AAOK4.js} +1 -1
  27. package/{chunk-BOT7P6RM.js → chunk-PY5HJ5U2.js} +1 -1
  28. package/chunk-QQDSFTZV.js +1 -0
  29. package/{chunk-IMLDBH2T.js → chunk-RANWFSNY.js} +1 -1
  30. package/chunk-RLJJFBQ2.js +1 -0
  31. package/{chunk-LT6J7X37.js → chunk-S76TN27U.js} +1 -1
  32. package/{chunk-BFEHLVAY.js → chunk-UTPCUNNU.js} +1 -1
  33. package/{chunk-S2HNK7TK.js → chunk-VPEVWKGB.js} +1 -1
  34. package/chunk-VVUYO7E4.js +1 -0
  35. package/chunk-WLI4RZYL.js +1 -0
  36. package/{chunk-EIZWLO2R.js → chunk-X2NZ4CJ5.js} +1 -1
  37. package/{chunk-BRNQESTL.js → chunk-XU7PNEZO.js} +1 -1
  38. package/chunk-XYJYUMYL.js +1 -0
  39. package/{chunk-AYLGFKRR.js → chunk-YRXI477O.js} +1 -1
  40. package/{chunk-7PZ2UDVE.js → chunk-ZD3JEKWI.js} +1 -1
  41. package/index.html +1 -1
  42. package/{main-TLCKWB2W.js → main-5KJRELCN.js} +1 -1
  43. package/package.json +1 -1
  44. package/chunk-6HCEXB2Z.js +0 -1
  45. package/chunk-EJZT4TGZ.js +0 -1
  46. package/chunk-GY2VPOAT.js +0 -1
  47. package/chunk-HHIFLECY.js +0 -1
  48. package/chunk-LD5EWOQM.js +0 -1
  49. package/chunk-OP5BV4PG.js +0 -1
  50. package/chunk-RL2VWNJG.js +0 -8
  51. package/chunk-S2YPSAFD.js +0 -1
  52. package/chunk-UJYJZACJ.js +0 -1
  53. package/chunk-XBN37RRV.js +0 -1
  54. package/chunk-YC5LTBFM.js +0 -1
package/chunk-GY2VPOAT.js DELETED
@@ -1 +0,0 @@
1
- import{a as ze,b as ge}from"./chunk-LD5EWOQM.js";import{b as Se}from"./chunk-7PZ2UDVE.js";import{a as be,b as H,c as he,d as Y,e as Z,f as J,g as ue,i as X,j as _e,k as $e,l as ee,m as te,n as ne,o as I,q as ie}from"./chunk-IOM7KF2W.js";import{a as Ce}from"./chunk-63RKHEAK.js";import{a as oe,d as fe,f as _t,h as re,j as Le,m as ft,n as ae,q as we}from"./chunk-LT6J7X37.js";import{a as W,c as M}from"./chunk-JRXXG6O7.js";import{a as Ct}from"./chunk-GBVLF3BS.js";import{$ as z,Cb as j,Db as q,Eb as xe,F as lt,Fb as l,Gb as G,Hb as P,I as ye,Kb as Q,Mb as Re,N as st,Ob as Be,Qa as s,Sb as ct,T as Fe,Wa as S,Xa as U,Z as h,a as de,ac as K,b as Ae,bb as _,c as at,cb as $,db as d,fb as mt,hb as f,ib as b,ja as g,jb as w,ka as y,kb as D,lb as r,mb as o,mc as dt,nb as p,ob as k,pb as v,qb as Me,rb as F,sb as x,tb as m,vc as ut,wb as se,xb as E,yb as pt}from"./chunk-RL2VWNJG.js";var Ue=class t{fromString(n){if(!n)return null;let e=n.match(/(\d+)([smhDWMY])/);return e&&{value:parseInt(e[1]),unit:e[2]}}toString(n,e){return`${n}${e}`}static \u0275fac=function(e){return new(e||t)};static \u0275prov=Fe({token:t,factory:t.\u0275fac,providedIn:"root"})};var De=new I,Ve={file:{customFields:{path:{type:"file-tree",name:"path",shortDescription:"File path",longDescription:"The path to store the backup",formElement:t=>De.control(t??"")}}},ssh:{customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:t=>De.control(t??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:t=>De.control(t??"")},path:{type:"Path",name:"path",shortDescription:"File path on the server",longDescription:"File path on the server",formElement:t=>De.control(t??"")}},dynamicFields:["auth-username"]},s3:{customFields:{path:{type:"Path",name:"path",shortDescription:"File path on the server",longDescription:"File path on the server",formElement:t=>De.control(t??"")},bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:t=>De.control(t??"")}},dynamicFields:["use-ssl","s3-server-name","auth-username","auth-password"]},gcs:{dynamicFields:["gcs-location","gcs-storage-class","authid"]},googledrive:{oauthField:"path",dynamicFields:["path","authid"]}};function Pe(t,n){let e={},i={};return n.searchParams.forEach((a,c)=>{Ve[t].dynamicFields?.includes(c)?i[c]=decodeURIComponent(a):e[c]=decodeURIComponent(a)}),{advanced:e,dynamic:i}}function je(t){let n=t.map(([e,i])=>`${e}=${i?encodeURIComponent(i.toString()):""}`).join("&");return n?"?"+n:""}var Te={file:{to:t=>{let n=je([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.path}${n}`},from:(t,n,e)=>{let i=e.indexOf("file:///")===0,a=e.split(i?"///":"//")[1].substring(0,1)+n.hostname.substring(1);return de({destinationType:t,custom:{path:`${i?"/":""}${a}${n.pathname}`}},Pe(t,n))}},ssh:{to:t=>{let n=je([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.server}${t.custom.port?":"+t.custom.port:""}${t.custom.path.startsWith("/")?t.custom.path:"/"+t.custom.path}${n}`},from:(t,n,e)=>de({destinationType:t,custom:{server:n.hostname,port:n.port,path:n.pathname}},Pe(t,n))},s3:{to:t=>{let n=je([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${t.custom.bucket}${t.custom.path}${n}`},from:(t,n,e)=>de({destinationType:t,custom:{path:n.pathname,bucket:n.hostname}},Pe(t,n))},gcs:{to:t=>{let n=t.dynamic["gcs-location"]??"";delete t.dynamic["gcs-location"];let e=je([...Object.entries(t.advanced),...Object.entries(t.dynamic)]);return`${t.destinationType}://${n}${e}`},from:(t,n,e)=>{let{advanced:i,dynamic:a}=Pe(t,n);return{destinationType:t,advanced:i,dynamic:Ae(de({},a),{"gcs-location":n.hostname+n.pathname})}}},fallbackMapper:{to:t=>"",from:(t,n,e)=>de({destinationType:t},Pe(t,n))}};function Ee(t){let n=t.destinationType;return!n||!Te.hasOwnProperty(n)?Te.fallbackMapper.to(t)??"":Te[n].to(t)??""}function gt(t){let n=URL.canParse(t),e=t.split("://")[0],i="http://"+t.split("://")[1],a=new URL(i);if(!Te.hasOwnProperty(e))return Te.fallbackMapper.from(e,a);if(!n)throw new Error("Invalid target path");return Te[e].from(e,a,t)}var wt=/[a-zA-Z0-9_\-\+\.]/,qe=class t{generate(n,e=wt){let i=this;return Array.apply(null,{length:n}).map(()=>{let a;for(;;)if(a=String.fromCharCode(i.#e()),e.test(a))return a},this).join("")}#e(){if(window.crypto&&window.crypto.getRandomValues){let n=new Uint8Array(1);return window.crypto.getRandomValues(n),n[0]}else if(window.msCrypto&&window.msCrypto.getRandomValues){let n=new Uint8Array(1);return window.msCrypto.getRandomValues(n),n[0]}else return Math.floor(Math.random()*256)}static \u0275fac=function(e){return new(e||t)};static \u0275prov=Fe({token:t,factory:t.\u0275fac,providedIn:"root"})};function Ye(t,n,e="conditional"){return i=>{if(!i.parent)return null;let a=null;if(t(i.parent)&&(a=(Array.isArray(n)?n:[n]).find(A=>A(i)!==null)??null),e&&a){let c={};c[e]=a,a=c}return a}}function yt(){return t=>(t.parent&&Object.values(t.parent.controls).forEach(n=>{n!==t&&n.updateValueAndValidity()}),null)}var Dt=["formRef"];function Tt(t,n){if(t&1&&(r(0,"option",14),l(1),o()),t&2){let e=n.$implicit;d("value",e.Key),s(),G(e.DisplayName)}}function Et(t,n){t&1&&(r(0,"spk-icon"),l(1,"eye-slash"),o(),l(2," hide "))}function Nt(t,n){t&1&&(r(0,"spk-icon"),l(1,"eye"),o(),l(2," show "))}function Ot(t,n){t&1&&(r(0,"spk-icon",23),l(1,"check"),o())}function Vt(t,n){t&1&&(r(0,"spk-icon"),l(1,"copy"),o())}function Pt(t,n){if(t&1){let e=F();r(0,"button",22),x("click",function(){g(e);let a=m(3);return y(a.copyPassword())}),_(1,Ot,2,0,"spk-icon",23)(2,Vt,2,0,"spk-icon"),l(3),o()}if(t&2){let e=m(3);s(),f(e.copiedPassword()?1:2),s(2),P(" ",e.copiedPassword()?"Copied":"Copy"," password ")}}function It(t,n){if(t&1){let e=F();r(0,"div",15)(1,"spk-form-field")(2,"label",16),l(3,"Create a password"),o(),p(4,"input",17),o(),r(5,"spk-form-field"),p(6,"input",18),o(),r(7,"div",19)(8,"button",20),x("click",function(){g(e);let a=m(2);return y(a.showPassword.set(!a.showPassword()))}),_(9,Et,3,0)(10,Nt,3,0),o(),r(11,"button",20),x("click",function(){g(e);let a=m(2);return y(a.generatePassword())}),r(12,"spk-icon"),l(13,"password"),o(),l(14," Generate password "),o(),_(15,Pt,4,2,"button",21),o()()}if(t&2){let e=m(2);s(4),d("type",e.showPassword()?"text":"password"),s(2),d("type",e.showPassword()?"text":"password"),s(3),f(e.showPassword()?9:10),s(6),f(e.showCopyPassword()?15:-1)}}function Gt(t,n){if(t&1&&(r(0,"spk-select",10)(1,"label",11),l(2,"Encryption"),o(),p(3,"input",12),k(4,13),w(5,Tt,2,2,"option",14,b),v(),o(),_(7,It,16,4,"div",15)),t&2){let e,i=m();d("displayValue",i.displayFn((e=i.generalForm.value.encryption)!==null&&e!==void 0?e:"")),s(5),D(i.encryptionOptions()),s(2),f(i.encryptionFieldSignal()!=="none"?7:-1)}}var Ne=new I,xt=(t={name:"",description:"",encryption:"none",password:"",repeatPassword:""})=>Ne.group({name:Ne.control(t.name,[he.required]),description:Ne.control(t.description),encryption:Ne.control(t.encryption,[he.required,yt()]),password:Ne.control(t.password,[Ye(n=>n?.value.encryption!=="none",[he.required])]),repeatPassword:Ne.control(t.repeatPassword,[Ye(n=>n?.value.encryption!=="none",[he.required])])}),Je={Key:"none",DisplayName:"None"},Ze=class t{#e=h(M);#t=h(W);#n=h(qe);#i=h(R);#o=h(Ce);formRef=U.required("formRef");generalForm=this.#i.generalForm;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=S(!1);copiedPassword=S(!1);showCopyPassword=S(!1);ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.exit()}async copyPassword(){let n=this.generalForm.controls.password.value;await this.#r(n??""),this.copiedPassword.set(!0)}async#r(n){try{await navigator.clipboard.writeText(n)}catch{try{let i=document.createElement("textarea");i.value=n,document.body.appendChild(i),i.select(),document.execCommand("copy"),document.body.removeChild(i)}catch(i){console.error("Failed to copy text: ",i)}}}displayFn(n){let e=this.#o.systemInfo()?.EncryptionModules??[],i=[Je,...e].find(a=>a.Key===n);return i?`${i.DisplayName}`:""}generatePassword(){this.copiedPassword.set(!1);let n=this.#n.generate(16);this.generalForm.controls.password.setValue(n),this.generalForm.controls.repeatPassword.setValue(n),this.showCopyPassword.set(!0)}next(){this.#e.navigate(["destination"],{relativeTo:this.#t.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=z({type:t,selectors:[["app-general"]],viewQuery:function(e,i){e&1&&j(i.formRef,Dt,5),e&2&&q()},standalone:!0,features:[Q],decls:23,vars:4,consts:[["formRef",""],["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],["for","backupName"],["type","text","tabindex","1","placeholder","Your backup name","formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder","Your backup description","formControlName","description"],[1,"form-actions"],["spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],[3,"displayValue"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder","Encryption","formControlName","encryption"],["options",""],[3,"value"],[1,"passwords"],["for","password"],["id","password","tabindex","4","placeholder","Password","formControlName","password",3,"type"],["id","repeatPassword","tabindex","5","placeholder","Repeat password","formControlName","repeatPassword",3,"type"],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]],template:function(e,i){if(e&1){let a=F();r(0,"form",1,0),x("submit",function(){return g(a),y(i.next())}),r(2,"h3",2),l(3,"General backup settings"),o(),r(4,"spk-form-field")(5,"label",3),l(6,"Backup name"),o(),p(7,"input",4),o(),r(8,"spk-form-field")(9,"label",5),l(10,"Backup description"),o(),p(11,"textarea",6),o(),_(12,Gt,8,2),r(13,"div",7)(14,"button",8),x("click",function(){return g(a),y(i.exit())}),r(15,"spk-icon"),l(16,"arrow-left"),o(),l(17," Exit "),o(),r(18,"div")(19,"button",9)(20,"spk-icon"),l(21,"arrow-right"),o(),l(22," Continue "),o()()()()}e&2&&(d("formGroup",i.generalForm),s(12),f(i.isNew()?12:-1),s(6),$("spk-tooltip-primary",i.generalForm.valid&&i.encryptionFieldSignal()==="none"||i.copiedPassword()?void 0:"Remember to copy the password"),s(),d("disabled",i.generalForm.invalid||i.encryptionFieldSignal()!=="none"&&i.showCopyPassword()&&!i.copiedPassword()))},dependencies:[ie,J,te,ne,H,Y,Z,X,ee,re,ae,fe,oe],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-500)}"],changeDetection:0})};var At=["formRef"];function Mt(t,n){if(t&1&&(r(0,"option",9),l(1),o()),t&2){let e=n.$implicit;d("value",e),s(),G(e)}}function Rt(t,n){if(t&1&&(r(0,"option",9),l(1),o()),t&2){let e=n.$implicit;d("value",e),s(),G(e)}}function Bt(t,n){if(t&1){let e=F();r(0,"button",22),x("click",function(){let a=g(e).$implicit,c=m();return y(c.addNewOption(a))}),l(1),o()}if(t&2){let e=n.$implicit;s(),G(e.Name)}}function $t(t,n){t&1&&(r(0,"label",23),l(1,"Name"),o())}function Lt(t,n){t&1&&(r(0,"label",25),l(1,"Value"),o())}function zt(t,n){if(t&1){let e=F();r(0,"div",18)(1,"spk-form-field"),_(2,$t,2,0,"label",23),p(3,"input",24),o(),r(4,"spk-form-field"),_(5,Lt,2,0,"label",25),p(6,"input",26),o(),r(7,"button",27),x("click",function(){let a=g(e).$index,c=m();return y(c.optionsForm.controls.advancedOptions.removeAt(a))}),r(8,"spk-icon"),l(9,"x-circle"),o()()()}if(t&2){let e=n.$implicit,i=n.$index;d("formGroup",e),s(2),f(i===0?2:-1),s(3),f(i===0?5:-1)}}var me=new I,Ut=["Bytes","KB","MB","GB","TB","PB"],jt=["Local folder","Local drive","Remote drive","Cloud drive"],ht=(t={remoteVolumeSize:0,size:"GB",backupRetention:"Local folder",advancedOptions:[]})=>me.group({remoteVolumeSize:me.group({size:me.control(t.remoteVolumeSize),unit:me.control(t.size)}),backupRetention:me.control(t.backupRetention),advancedOptions:me.array([])}),et=(t,n)=>me.group({name:me.control(t),value:me.control(n)}),Xe=class t{#e=h(Ce);#t=h(R);#n=h(M);#i=h(W);formRef=U.required("formRef");optionsForm=this.#t.optionsForm;sizeOptions=S(Ut);rentationOptions=S(jt);selectionAdvancedOptions=Se(this.optionsForm.controls.advancedOptions.valueChanges.pipe(st([])));advancedOptions=S(this.#e.systemInfo()?.Options??[]);nonSelectedAdvancedOptions=K(()=>this.advancedOptions().filter(n=>this.selectionAdvancedOptions()?.findIndex(e=>e.name===n.Name)===-1));addNewOption(n){this.optionsForm.controls.advancedOptions.push(et(n.Name,n.DefaultValue))}displayFn(){let n=this.advancedOptions();return e=>{let i=n.find(a=>a.Name===e);return i?`${i.Name}`:""}}goBack(){this.#n.navigate(["schedule"],{relativeTo:this.#i.parent})}submit(){this.#t.submit()}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=z({type:t,selectors:[["app-options"]],viewQuery:function(e,i){e&1&&j(i.formRef,At,5),e&2&&q()},standalone:!0,features:[Q],decls:49,vars:2,consts:[["formRef",""],[3,"submit","formGroup"],[1,"title-30"],[1,"remote-volume-wrap"],["formGroupName","remoteVolumeSize",1,"row-inputs"],["for","size"],["type","number","id","size","formControlName","size"],["type","text","placeholder","Select an option...","formControlName","unit"],["options",""],[3,"value"],["href","#",1,"spk-primary"],["type","text","placeholder","Local folder or drive","formControlName","backupRetention"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small"],["menu",""],["spk-menu-item","","type","button"],["formArrayName","advancedOptions"],[1,"advanced-option",3,"formGroup"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["spk-menu-item","","type","button",3,"click"],["for","name"],["type","text","id","name","formControlName","name"],["for","value"],["type","text","id","value","formControlName","value"],["spk-button","","type","button",1,"icon",3,"click"]],template:function(e,i){if(e&1){let a=F();r(0,"form",1,0),x("submit",function(){return g(a),y(i.submit())}),r(2,"h3",2),l(3,"Options"),o(),r(4,"div",3)(5,"div",4)(6,"spk-form-field")(7,"label",5),l(8,"Remote volume size"),o(),p(9,"input",6),o(),r(10,"spk-select"),p(11,"input",7),k(12,8),w(13,Mt,2,2,"option",9,b),v(),o()(),r(15,"p"),l(16," The backups will be split up into multiple files called volumes. Here you can set the maximum size of the individual volume files. "),r(17,"a",10),l(18,"Read more"),o()()(),r(19,"spk-select")(20,"label",5),l(21,"Backup retention"),o(),p(22,"input",11),k(23,8),w(24,Rt,2,2,"option",9,b),v(),o(),r(26,"app-toggle-card",12),k(27,13),l(28," Advanced options "),r(29,"spk-menu")(30,"button",14),l(31," Add advanced option "),r(32,"spk-icon"),l(33,"plus"),o()(),k(34,15),w(35,Bt,2,1,"button",16,b),v(),o(),v(),k(37,17),w(38,zt,10,3,"div",18,b),v(),o(),r(40,"div",19)(41,"button",20),x("click",function(){return g(a),y(i.goBack())}),r(42,"spk-icon"),l(43,"arrow-left"),o(),l(44," Go back "),o(),r(45,"button",21)(46,"spk-icon"),l(47,"arrow-right"),o(),l(48," Submit "),o()()()}e&2&&(d("formGroup",i.optionsForm),s(13),D(i.sizeOptions()),s(11),D(i.rentationOptions()),s(2),d("disallowToggle",!0),s(9),D(i.nonSelectedAdvancedOptions()),s(3),D(i.optionsForm.controls.advancedOptions.controls))},dependencies:[ie,J,te,ne,H,ue,Y,Z,X,ee,_e,$e,Le,ae,fe,oe,re,ge],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.remote-volume-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.advanced-option[_ngcontent-%COMP%]{display:grid;gap:.5rem;grid-template-columns:1fr 1fr 40px;align-items:flex-end}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var qt=["formRef"];function Qt(t,n){if(t&1&&(r(0,"option",24),l(1),o()),t&2){let e=n.$implicit;d("value",e.key),s(),G(e.label)}}function Kt(t,n){if(t&1){let e=F();r(0,"div",11)(1,"spk-form-field")(2,"label",12),l(3,"Next time"),o(),r(4,"input",13,1),x("focus",function(){g(e);let a=xe(5);return y(a.showPicker())}),o(),r(6,"spk-icon",14),l(7,"clock"),o()(),r(8,"spk-form-field"),p(9,"label",15),r(10,"input",16,2),x("focus",function(){g(e);let a=xe(11);return y(a.showPicker())}),o(),r(12,"spk-icon",14),l(13,"calendar"),o()()(),k(14,17),r(15,"div",18)(16,"spk-form-field")(17,"label",19),l(18,"Run again every"),o(),p(19,"input",20),o(),r(20,"spk-select",21),p(21,"input",22),k(22,23),w(23,Qt,2,2,"option",24,b),v(),o()(),r(25,"app-toggle-card",25),k(26,26),l(27,"Allowed days"),v(),r(28,"div",27)(29,"spk-toggle",6),l(30," Monday "),p(31,"input",28),o(),r(32,"spk-toggle",6),l(33," Tuesday "),p(34,"input",29),o(),r(35,"spk-toggle",6),l(36," Wednesday "),p(37,"input",30),o(),r(38,"spk-toggle",6),l(39," Thursday "),p(40,"input",31),o(),r(41,"spk-toggle",6),l(42," Friday "),p(43,"input",32),o(),r(44,"spk-toggle",6),l(45," Saturday "),p(46,"input",33),o(),r(47,"spk-toggle",6),l(48," Sunday "),p(49,"input",34),o()()(),v()}if(t&2){let e=m();s(20),d("displayFn",e.displayFn),s(3),D(e.unitOptions),s(2),d("disallowToggle",!0)}}var O=new I,St=[{key:"s",label:"Seconds"},{key:"m",label:"Minutes"},{key:"h",label:"Hours"},{key:"D",label:"Days"},{key:"W",label:"Weeks"},{key:"M",label:"Months"},{key:"Y",label:"Years"}],kt=(t={autoRun:!1,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}})=>O.group({autoRun:O.control(t.autoRun),nextTime:O.group({time:O.control(t.nextTime.time),date:O.control(t.nextTime.date)}),runAgain:O.group({repeatValue:O.control(t.runAgain.repeatValue),repeatUnit:O.control(t.runAgain.repeatUnit),allowedDays:O.group({mon:O.control(t.runAgain.allowedDays.mon),tue:O.control(t.runAgain.allowedDays.tue),wed:O.control(t.runAgain.allowedDays.wed),thu:O.control(t.runAgain.allowedDays.thu),fri:O.control(t.runAgain.allowedDays.fri),sat:O.control(t.runAgain.allowedDays.sat),sun:O.control(t.runAgain.allowedDays.sun)})})}),tt=class t{#e=h(R);#t=h(M);#n=h(W);formRef=U.required("formRef");scheduleForm=this.#e.scheduleForm;scheduleFormSignal=this.#e.scheduleFormSignal;unitOptions=St;displayFn(n){let e=St.find(i=>i.key===n);return e?`${e.label}`:""}goBack(){this.#t.navigate(["source-data"],{relativeTo:this.#n.parent})}next(){this.#t.navigate(["options"],{relativeTo:this.#n.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=z({type:t,selectors:[["app-schedule"]],viewQuery:function(e,i){e&1&&j(i.formRef,qt,5),e&2&&q()},standalone:!0,features:[Q],decls:20,vars:2,consts:[["formRef",""],["timeRef",""],["dateRef",""],[3,"submit","formGroup"],[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox","formControlName","autoRun"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["formGroupName","nextTime",1,"row-inputs"],["for","time"],["type","time","id","time","formControlName","time",3,"focus"],["spkSuffix",""],["for","date"],["type","date","id","date","formControlName","date",3,"focus"],["formGroupName","runAgain"],[1,"row-inputs"],["for","repeatValue"],["type","number","id","repeatValue","formControlName","repeatValue"],[3,"displayFn"],["type","text","id","repeatUnit","formControlName","repeatUnit"],["options",""],[3,"value"],["formGroupName","allowedDays",3,"disallowToggle"],["title",""],[1,"days-wrap"],["type","checkbox","formControlName","mon"],["type","checkbox","formControlName","tue"],["type","checkbox","formControlName","wed"],["type","checkbox","formControlName","thu"],["type","checkbox","formControlName","fri"],["type","checkbox","formControlName","sat"],["type","checkbox","formControlName","sun"]],template:function(e,i){if(e&1){let a=F();r(0,"form",3,0),x("submit",function(){return g(a),y(i.next())}),r(2,"h3",4),l(3,"Schedule"),o(),r(4,"div",5)(5,"spk-toggle",6),l(6," Automatically run backups "),p(7,"input",7),o(),r(8,"p"),l(9,"If a date was missed, the job will run as soon as possible."),o()(),_(10,Kt,50,2),r(11,"div",8)(12,"button",9),x("click",function(){return g(a),y(i.goBack())}),r(13,"spk-icon"),l(14,"arrow-left"),o(),l(15," Go back "),o(),r(16,"button",10)(17,"spk-icon"),l(18,"arrow-right"),o(),l(19," Continue "),o()()()}if(e&2){let a;d("formGroup",i.scheduleForm),s(10),f((a=i.scheduleFormSignal())!=null&&a.autoRun?-1:10)}},dependencies:[ie,J,te,ne,H,ue,be,Y,Z,X,ee,_e,re,ae,we,oe,fe,ge],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};var Wt=["formRef"];function Ht(t,n){if(t&1&&(r(0,"option",21),l(1),o()),t&2){let e=n.$implicit;d("value",e),s(),G(e)}}function Yt(t,n){if(t&1&&(r(0,"div",14)(1,"spk-form-field"),p(2,"input",18),o(),r(3,"spk-select"),p(4,"input",19),k(5,20),w(6,Ht,2,2,"option",21,b),v(),o()()),t&2){let e=m(2);s(6),D(e.sizeOptions())}}function Zt(t,n){if(t&1){let e=F();r(0,"form",2,0),x("submit",function(){g(e);let a=m();return y(a.next())}),r(2,"h3",3),l(3,"Source Data"),o(),r(4,"app-file-tree",4)(5,"label",5),l(6,"Folder path"),o(),p(7,"input",6),o(),r(8,"app-toggle-card",7),k(9,8),l(10,"Exclude"),v(),r(11,"spk-toggle",9),l(12," Hidden files "),p(13,"input",10),o(),r(14,"spk-toggle",9),l(15," System files "),p(16,"input",11),o(),r(17,"spk-toggle",9),l(18," Temporary files "),p(19,"input",12),o(),r(20,"spk-toggle",13),x("click",function(){g(e);let a=m();return y(a.toggleFilesLargerThan())}),l(21," Files larger than "),o(),_(22,Yt,8,0,"div",14),o(),r(23,"div",15)(24,"button",16),x("click",function(){g(e);let a=m();return y(a.goBack())}),r(25,"spk-icon"),l(26,"arrow-left"),o(),l(27," Go back "),o(),r(28,"button",17)(29,"spk-icon"),l(30,"arrow-right"),o(),l(31," Continue "),o()()()}if(t&2){let e=m();d("formGroup",e.sourceDataForm),s(4),d("multiSelect",!0)("startingPath",e.getPath()),s(4),d("isActive",!0),s(12),mt("active",e.filesLargerThan()),s(2),f(e.filesLargerThan()?22:-1)}}var pe=new I,Jt=["Bytes","KB","MB","GB","TB","PB"],Xt=["Contains","Does not contain","Is greater than","Is less than"];var vt=(t={path:"",excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>pe.group({path:pe.control(t.path),excludes:pe.group({hidden:pe.control(t.excludes.hidden),system:pe.control(t.excludes.system),temporary:pe.control(t.excludes.temporary),filesLargerThan:pe.group({size:pe.control(null),unit:pe.control(null)})})}),nt=class t{#e=h(R);#t=h(M);#n=h(W);formRef=U.required("formRef");sourceDataForm=this.#e.sourceDataForm;sourceDataFormSignal=this.#e.sourceDataFormSignal;destinationIsLoaded=this.#e.destinationIsLoaded;filesLargerThan=K(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=S(Jt);expressionOptions=S(Xt);getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}goBack(){this.#t.navigate(["destination"],{relativeTo:this.#n.parent})}next(){this.#t.navigate(["schedule"],{relativeTo:this.#n.parent})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=z({type:t,selectors:[["app-source-data"]],viewQuery:function(e,i){e&1&&j(i.formRef,Wt,5),e&2&&q()},standalone:!0,features:[Q],decls:1,vars:1,consts:[["formRef",""],[3,"formGroup"],[3,"submit","formGroup"],[1,"title-30"],[3,"multiSelect","startingPath"],["for","path"],["type","text","id","path","tabindex","4","placeholder","Path","formControlName","path"],["formGroupName","excludes",3,"isActive"],["title",""],[1,"raised","primary"],["type","checkbox","placeholder","Hidden files","formControlName","hidden"],["type","checkbox","placeholder","System files","formControlName","system"],["type","checkbox","placeholder","Temporary files","formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["type","number","formControlName","size"],["type","text","formControlName","unit","placeholder","Select an option..."],["options",""],[3,"value"]],template:function(e,i){e&1&&_(0,Zt,32,7,"form",1),e&2&&f(i.destinationIsLoaded()?0:-1)},dependencies:[ie,J,te,ne,H,ue,be,Y,Z,X,ee,_e,re,oe,fe,ae,we,ze,ge],styles:["[_nghost-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.5rem}.filter-inputs[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:flex-end}.filter-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.filter-inputs[_ngcontent-%COMP%] .filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var L=new I,R=class t{#e=h(M);#t=h(Ce);#n=h(Ct);#i=h(Ue);destinationOptions=this.#t.backendModules;backupId=S(null);isSubmitting=S(!1);loadingBackup=S(!1);loadingDefaults=S(!0);destinationIsLoaded=S(!1);isNew=K(()=>this.backupId()==="new");backupDefaults=S(null);generalForm=xt();sourceDataForm=vt();scheduleForm=kt();destinationForm=Ft();optionsForm=ht();selectedAdvancedFormPair=S([]);notSelectedAdvancedFormPair=S([]);destinationFormPair=S({oauthField:null,custom:[],dynamic:[],advanced:[]});sourceDataFormSignal=Se(this.sourceDataForm.valueChanges);destinationFormSignal=Se(this.destinationForm.valueChanges);encryptionFieldSignal=Se(this.generalForm.controls.encryption.valueChanges);scheduleFormSignal=Se(this.scheduleForm.valueChanges);encryptionOptions=K(()=>{let n=this.#t.systemInfo()?.EncryptionModules??[];return[Je,...n]});init(n="new"){this.backupId.set(n),n!=="new"?this.getBackup(n):this.getDefaults()}submit(){this.isSubmitting.set(!0);let n=this.#m(),e=this.backupId();e==="new"||!e?this.#n.postApiV1Backups({requestBody:n}).pipe(ye(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{console.log("submitted res",i),this.exit()},error:i=>{console.error("submitted error",i)}}):this.#n.putApiV1BackupById({id:e,requestBody:n}).pipe(ye(()=>this.isSubmitting.set(!1))).subscribe({next:i=>{console.log("submitted res",i),this.exit()},error:i=>{console.error("submitted error",i)}})}exit(){this.#d(),this.#e.navigate(["/"])}getDefaults(){this.loadingDefaults.set(!0),this.#n.getApiV1Backupdefaults().pipe(lt(1),ye(()=>this.loadingDefaults.set(!1))).subscribe({next:n=>{this.#a(n.Schedule),this.#s(n.Backup),this.backupDefaults.set(n),this.destinationIsLoaded.set(!0)}})}getBackup(n){this.loadingBackup.set(!0),this.#n.getApiV1BackupById({id:n}).pipe(ye(()=>this.loadingBackup.set(!1))).subscribe({next:e=>{this.#a(e.Schedule??null),e.Backup&&(this.#l(e.Backup),this.#r(e.Backup),this.#o(e.Backup),this.#s(e.Backup)),this.destinationIsLoaded.set(!0)}})}#o(n){let e=n.Sources??"",i=n.Filters?.map(N=>`${N.Include?"":"-"}${N.Expression}`)??[],a=n.Settings?.find(N=>N.Name==="--exclude-files-attributes")?.Value??"",c=n.Settings?.find(N=>N.Name==="--skip-files-larger-than")??null,A=c?.Value.replace(/[0-9]/g,"")??null,B=c?.Value.replace(/[^0-9]/g,"")??null,le={path:[...e,...i].join("\0"),excludes:{hiddenFiles:a.includes("hidden"),systemFiles:a.includes("system"),tempFiles:a.includes("temporary"),filesLargerThan:A&&B?{size:parseInt(B),unit:A.toUpperCase()}:null}};this.sourceDataForm.patchValue(le)}#r(n){let e=n.TargetURL?gt(n.TargetURL):null;e&&this.addDestinationFormGroup(e.destinationType,{custom:e.custom,dynamic:e.dynamic,advanced:e.advanced})}#l(n){let e=n.Settings?.find(a=>a.Name==="encryption-module"),i=e?.Value&&e.Value.length?e.Value:"none";this.generalForm.patchValue({name:n.Name??"",description:n.Description??"",encryption:i})}#a(n){if(!n){this.scheduleForm.patchValue({autoRun:!0});return}let e=this.#i.fromString(n.Repeat)??null,a={nextTime:this.#c(n.Time),runAgain:{repeatValue:e?.value??1,repeatUnit:e?.unit??"D",allowedDays:{mon:n.AllowedDays?.includes("mon")??!1,tue:n.AllowedDays?.includes("tue")??!1,wed:n.AllowedDays?.includes("wed")??!1,thu:n.AllowedDays?.includes("thu")??!1,fri:n.AllowedDays?.includes("fri")??!1,sat:n.AllowedDays?.includes("sat")??!1,sun:n.AllowedDays?.includes("sun")??!1}}};this.scheduleForm.patchValue(a)}#s(n){let e=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than"];n.Settings?.forEach(i=>{if(i.Name==="encryption-module")return this.generalForm.controls.encryption.setValue(i.Value??"None");i.Name&&e.includes(i.Name)||i.Name&&i.Value&&this.optionsForm.controls.advancedOptions.push(et(i.Name,i.Value))})}mapPub(){this.#m()}#m(){let n=this.generalForm.value,e=this.optionsForm.value,i=this.scheduleForm.value,a=this.sourceDataForm.value,A=this.destinationForm.value.destinations?.length?this.#p(this.destinationForm.controls.destinations):[],B=null;i.runAgain?.repeatUnit&&i.runAgain?.repeatValue&&(B=this.#i.toString(i.runAgain.repeatValue,i.runAgain.repeatUnit));let le=i.runAgain?.allowedDays?Object.entries(i.runAgain?.allowedDays).filter(([C,T])=>T).map(([C,T])=>C):[],N=a.path?.split("\0")??[],Ie=e.advancedOptions?.map(C=>({Name:C.name??null,Value:C.value&&C.value.length?C.value.toString():null}))??[],ve=[n.encryption==="none"?{Name:"--no-encryption",Value:"True"}:{Name:"encryption-module",Value:n.encryption??null},...Ie.filter(C=>C.Name&&C.Value)],V=Object.entries(a.excludes??{}).filter(([C,T])=>T&&C!=="filesLargerThan").map(([C])=>C),u=a.excludes?.filesLargerThan;return V.length&&ve.push({Name:"--exclude-files-attributes",Value:V.join(",")}),u&&u.size!==null&&u.unit!==null&&ve.push({Name:"--skip-files-larger-than",Value:`${u.size}${u.unit}`}),{Backup:{Name:n.name,Description:n.description,TargetURL:A[0]??null,Sources:N.filter(C=>!C.startsWith("-")),Settings:ve,Filters:N.filter(C=>C.startsWith("-")).map((C,T)=>({Order:T,Include:!1,Expression:C.slice(1)}))},Schedule:i.autoRun?null:{Repeat:B,Time:i.nextTime?.date?new Date(`${i.nextTime.date}T${i.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:le}}}#p(n){return n.controls.map(e=>{if(!e.controls.advanced)return Ee(e.value);let i=Object.keys(e.controls.advanced.controls).filter(a=>e.controls.advanced.controls[a].dirty);return Ee(Ae(de({},e.value),{advanced:i.reduce((a,c)=>(a[c]=e.controls.advanced.controls[c].value,a),{})}))})}#c(n){if(!n||n?.indexOf("T")===-1)return{time:n??"13:00"};let e=new Date(n),i={time:`${(""+e.getHours()).padStart(2,"0")}:${(""+e.getMinutes()).padStart(2,"0")}`};return n.indexOf("T")!==-1&&(i.date=e.toISOString().split("T")[0]),i}addDestinationFormGroup(n,e){let i=this.destinationOptions().find(V=>V.Key===n);if(!i||!i.Options)return;let a=Ve.hasOwnProperty(n)&&Ve[n],c=a&&a.customFields?a.customFields:{},A=a&&a.dynamicFields?a.dynamicFields:[],B=a&&a.advancedFields?a.advancedFields:[],le=a&&a.oauthField?a.oauthField:null;this.destinationFormPair.set({oauthField:le,custom:[],dynamic:[],advanced:[]}),this.selectedAdvancedFormPair.set([]);let N=L.group({}),Ie=L.group({}),He=L.group({});if(c)for(n in c){let ve=c[n],{formElement:V}=ve,u=at(ve,["formElement"]);N.addControl(n,V(e?.custom[n])),this.destinationFormPair.update(C=>(C.custom.push(u),C))}for(let V=0;V<i.Options.length;V++){let u=i.Options[V];if(u.Deprecated)continue;let C=A.includes(u.Name),T=C?Ie:He;this.destinationFormPair.update(Oe=>(Oe[C?"dynamic":"advanced"].push({name:u.Name,type:u.Type,shortDescription:u.ShortDescription??void 0,longDescription:u.LongDescription??void 0,options:u.ValidValues}),Oe));let ce=(C?e?.dynamic[u.Name]:e?.advanced[u.Name])??u.DefaultValue;if(u.Type==="String"||u.Type==="Password"||u.Type==="Enumeration"||u.Type==="Path"){T.addControl(u.Name,L.control(ce));continue}if(u.Type==="Size"){let Oe=ce.replace(/[0-9]/g,""),rt=ce.replace(/[^0-9]/g,"");T.addControl(u.Name,L.group({size:L.control(rt?parseInt(rt):50),unit:L.control(Oe?Oe.toUpperCase():"MB")}))}if(u.Type==="Integer"){T.addControl(u.Name,L.control(ce?parseInt(ce):0));continue}if(u.Type==="Boolean"){T.addControl(u.Name,L.control(ce==="true"));continue}if(u.Type==="Flags"){T.addControl(u.Name,L.control(ce??""));continue}u.Type==="Timespan"&&T.addControl(u.Name,L.control(ce,[he.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]))}this.destinationForm.controls.destinations.length!==0&&this.destinationForm.controls.destinations.removeAt(0),this.destinationFormPair.update(V=>({oauthField:V.oauthField,custom:V.custom,dynamic:V.dynamic.sort((u,C)=>A.indexOf(u.name)-A.indexOf(C.name)),advanced:V.advanced.sort((u,C)=>{let T=B.indexOf(u.name),Ge=B.indexOf(C.name);return T===-1&&Ge!==-1?1:T!==-1&&Ge===-1?-1:T-Ge})})),this.notSelectedAdvancedFormPair.set(this.destinationFormPair().advanced),this.destinationForm.controls.destinations.push(bt({key:i.Key,customGroup:N,dynamicGroup:Ie,advancedGroup:He}))}#d(){this.generalForm.reset(),this.sourceDataForm.reset(),this.scheduleForm.reset(),this.destinationForm.reset(),this.optionsForm.reset()}static \u0275fac=function(e){return new(e||t)};static \u0275prov=Fe({token:t,factory:t.\u0275fac,providedIn:"root"})};var en=["formRef"],tn=(t,n,e)=>({destination:t,index:n,formGroupName:"custom",oauthField:e}),ot=t=>({$implicit:t}),nn=(t,n,e)=>({destination:t,index:n,formGroupName:"dynamic",oauthField:e}),on=(t,n,e)=>({destination:t,index:n,formGroupName:"advanced",oauthField:e});function rn(t,n){if(t&1){let e=F();r(0,"p",9),x("click",function(){g(e);let a=m(2);return y(a.removeDestinationFormGroup(a.destinationCount()-1))}),l(1," Wanna select another destination? "),r(2,"span",10),l(3,"Click here"),o()()}}function an(t,n){if(t&1){let e=F();r(0,"div",11)(1,"div",12),x("click",function(){g(e);let a=m(2);return y(a.addDestinationFormGroup("file"))}),r(2,"h3"),l(3,"File system"),o(),r(4,"p"),l(5,"Store backups on your local file system."),o()(),r(6,"div",12),x("click",function(){g(e);let a=m(2);return y(a.addDestinationFormGroup("gcs"))}),r(7,"h3"),l(8,"Google Cloud Storage"),o(),r(9,"p"),l(10,"Store backups in Google Cloud Storage."),o()(),r(11,"div",12),x("click",function(){g(e);let a=m(2);return y(a.addDestinationFormGroup("s3"))}),r(12,"h3"),l(13,"S3 compatible bucket"),o(),r(14,"p"),l(15,"Store backups in any S3 compatible bucket."),o()(),r(16,"div",12),x("click",function(){g(e);let a=m(2);return y(a.addDestinationFormGroup("ssh"))}),r(17,"h3"),l(18,"SSH"),o(),r(19,"p"),l(20,"Store backups in SSH."),o()()(),r(21,"p"),l(22,"More destinations are coming soon."),o()}}function ln(t,n){t&1&&Me(0)}function sn(t,n){if(t&1&&_(0,ln,1,0,"ng-container",15),t&2){let e=n.$implicit,i=n.$index;m(2);let a=xe(6),c=m(2);d("ngTemplateOutlet",a)("ngTemplateOutletContext",Re(6,ot,Be(2,tn,e,i,c.destinationFormPair().oauthField)))}}function mn(t,n){if(t&1&&(k(0),w(1,sn,1,8,"ng-container",null,b),v()),t&2){let e=m(3);s(),D(e.destinationFormPair().custom)}}function pn(t,n){t&1&&Me(0)}function cn(t,n){if(t&1&&_(0,pn,1,0,"ng-container",15),t&2){let e=n.$implicit,i=n.$index;m(2);let a=xe(6),c=m(2);d("ngTemplateOutlet",a)("ngTemplateOutletContext",Re(6,ot,Be(2,nn,e,i,c.destinationFormPair().oauthField)))}}function dn(t,n){if(t&1&&(k(0),w(1,cn,1,8,"ng-container",null,b),v()),t&2){let e=m(3);s(),D(e.destinationFormPair().dynamic)}}function un(t,n){if(t&1){let e=F();r(0,"button",20),x("click",function(){let a=g(e).$implicit,c=m(4);return y(c.addAdvancedFormPair(a))}),l(1),o()}if(t&2){let e=n.$implicit;s(),P(" ",e.name," ")}}function _n(t,n){t&1&&Me(0)}function fn(t,n){if(t&1&&_(0,_n,1,0,"ng-container",15),t&2){let e=n.$implicit,i=n.$index;m(2);let a=xe(6),c=m(2);d("ngTemplateOutlet",a)("ngTemplateOutletContext",Re(6,ot,Be(2,on,e,i,c.destinationFormPair().oauthField)))}}function Cn(t,n){if(t&1&&(r(0,"app-toggle-card",14),k(1,16),l(2," Advanced options "),r(3,"spk-menu")(4,"button",17),l(5," Add advanced option "),r(6,"spk-icon"),l(7,"plus"),o()(),k(8,18),w(9,un,2,1,"button",19,b),v(),o(),v(),k(11),w(12,fn,1,8,"ng-container",null,b),v(),o()),t&2){let e=m(3);d("disallowToggle",!0),s(9),D(e.notSelectedAdvancedFormPair()),s(3),D(e.selectedAdvancedFormPair())}}function gn(t,n){if(t&1&&(r(0,"spk-icon",27),l(1," question "),o()),t&2){let e=m(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function yn(t,n){if(t&1&&(r(0,"app-file-tree",22)(1,"label",26),l(2),_(3,gn,2,1,"spk-icon",27),o(),p(4,"input",28),o()),t&2){let e,i=m().$implicit,a=m(3);d("startingPath",a.getFormFieldValue(i.index,i.formGroupName,i.destination.name)),s(),pt("for","destination-",i.formGroupName,"-",i.formGroupName,"-",i.index,""),s(),P(" ",(e=i.destination.shortDescription)!==null&&e!==void 0?e:i.destination.name," "),s(),f(i.destination.longDescription?3:-1),s(),E("id","destination-",i.formGroupName,"-",i.index,""),se("formControlName",i.destination.name)}}function xn(t,n){if(t&1&&(r(0,"spk-icon",27),l(1," question "),o()),t&2){let e=m(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function hn(t,n){t&1&&(r(0,"spk-icon",29),l(1,"link"),o())}function Sn(t,n){t&1&&(r(0,"spk-icon",29),l(1,"textbox"),o())}function kn(t,n){if(t&1&&(r(0,"spk-form-field")(1,"label",26),l(2),_(3,xn,2,1,"spk-icon",27),o(),p(4,"input",28),_(5,hn,2,0,"spk-icon",29)(6,Sn,2,0,"spk-icon",29),o()),t&2){let e,i=m().$implicit;s(),E("for","destination-",i.formGroupName,"-",i.index,""),s(),P(" ",(e=i.destination.shortDescription)!==null&&e!==void 0?e:i.destination.name," "),s(),f(i.destination.longDescription?3:-1),s(),E("id","destination-",i.formGroupName,"-",i.index,""),se("formControlName",i.destination.name),s(),f(i.destination.type==="Path"?5:6)}}function vn(t,n){if(t&1){let e=F();r(0,"spk-icon",32),x("click",function(){g(e);let a=m(2).$implicit;return y(a.destination.showPassword=!a.destination.showPassword)}),l(1," eye "),o()}}function Fn(t,n){if(t&1){let e=F();r(0,"spk-icon",32),x("click",function(){g(e);let a=m(2).$implicit;return y(a.destination.showPassword=!a.destination.showPassword)}),l(1," eye-slash "),o()}}function bn(t,n){if(t&1&&(r(0,"spk-form-field")(1,"label",26),l(2),o(),p(3,"input",30),r(4,"spk-icon",29),l(5,"password"),o(),_(6,vn,2,0,"spk-icon",31)(7,Fn,2,0,"spk-icon",31),o()),t&2){let e,i=m().$implicit;s(),E("for","destination-",i.formGroupName,"-",i.index,""),s(),P(" ",(e=i.destination.shortDescription)!==null&&e!==void 0?e:i.destination.name," "),s(),E("id","destination-",i.formGroupName,"-",i.index,""),se("formControlName",i.destination.name),d("type",i.destination.showPassword?"text":"password"),s(3),f(i.destination.showPassword?6:7)}}function wn(t,n){if(t&1&&(r(0,"spk-icon",27),l(1," question "),o()),t&2){let e=m(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function Dn(t,n){if(t&1&&(r(0,"option",35),l(1),o()),t&2){let e=n.$implicit;d("value",e),s(),G(e)}}function Tn(t,n){if(t&1&&(r(0,"spk-select")(1,"label",26),l(2),_(3,wn,2,1,"spk-icon",27),o(),p(4,"input",33),k(5,34),w(6,Dn,2,2,"option",35,b),v(),o()),t&2){let e,i=m().$implicit;s(),E("for","destination-",i.formGroupName,"-",i.index,""),s(),P(" ",(e=i.destination.shortDescription)!==null&&e!==void 0?e:i.destination.name," "),s(),f(i.destination.longDescription?3:-1),s(),E("id","destination-",i.formGroupName,"-",i.index,""),se("formControlName",i.destination.name),s(2),D(i.destination.options)}}function En(t,n){if(t&1&&(r(0,"spk-icon",27),l(1," question "),o()),t&2){let e=m(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function Nn(t,n){if(t&1&&(r(0,"option",35),l(1),o()),t&2){let e=n.$implicit;d("value",e),s(),G(e)}}function On(t,n){if(t&1&&(r(0,"div",23)(1,"label",26),l(2),_(3,En,2,1,"spk-icon",27),o(),r(4,"div",36)(5,"spk-form-field"),p(6,"input",37),r(7,"spk-icon",29),l(8,"resize"),o()(),r(9,"spk-select"),p(10,"label")(11,"input",38),k(12,34),w(13,Nn,2,2,"option",35,b),v(),o()()()),t&2){let e,i=m().$implicit,a=m(3);d("formGroupName",i.destination.name),s(),E("for","destination-",i.formGroupName,"-",i.index,""),s(),P(" ",(e=i.destination.shortDescription)!==null&&e!==void 0?e:i.destination.name," "),s(),f(i.destination.longDescription?3:-1),s(3),E("id","destination-",i.formGroupName,"-",i.index,""),s(7),D(a.sizeOptions())}}function Vn(t,n){if(t&1&&(r(0,"spk-icon",27),l(1," question "),o()),t&2){let e=m(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function Pn(t,n){if(t&1&&(r(0,"spk-form-field")(1,"label",26),l(2),_(3,Vn,2,1,"spk-icon",27),o(),p(4,"input",39),r(5,"spk-icon",29),l(6,"numpad"),o()()),t&2){let e,i=m().$implicit;s(),E("for","destination-",i.formGroupName,"-",i.index,""),s(),P(" ",(e=i.destination.shortDescription)!==null&&e!==void 0?e:i.destination.name," "),s(),f(i.destination.longDescription?3:-1),s(),E("id","destination-",i.formGroupName,"-",i.index,""),se("formControlName",i.destination.name)}}function In(t,n){if(t&1&&(r(0,"spk-icon",27),l(1," question "),o()),t&2){let e=m(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function Gn(t,n){if(t&1&&(r(0,"spk-toggle",24)(1,"label",26),l(2),_(3,In,2,1,"spk-icon",27),o(),p(4,"input",40),o()),t&2){let e,i=m().$implicit;s(),E("for","destination-",i.formGroupName,"-",i.index,""),s(),P(" ",(e=i.destination.shortDescription)!==null&&e!==void 0?e:i.destination.name," "),s(),f(i.destination.longDescription?3:-1),s(),E("id","destination-",i.formGroupName,"-",i.index,""),se("formControlName",i.destination.name)}}function An(t,n){if(t&1&&(r(0,"spk-icon",27),l(1," question "),o()),t&2){let e=m(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function Mn(t,n){t&1&&(r(0,"spk-option",42),l(1,"None"),o()),t&2&&d("value","None")}function Rn(t,n){if(t&1&&(r(0,"spk-option",35),l(1),p(2,"spk-checkbox",43),o()),t&2){let e=m().$implicit;d("value",e),s(),P(" ",e," ")}}function Bn(t,n){if(t&1&&_(0,Mn,2,1,"spk-option",42)(1,Rn,3,2,"spk-option",35),t&2){let e=n.$implicit;f(e==="None"?0:1)}}function $n(t,n){if(t&1&&(r(0,"spk-select",25)(1,"label",26),l(2),_(3,An,2,1,"spk-icon",27),o(),p(4,"input",41),k(5,34),w(6,Bn,2,1,null,null,b),v(),o()),t&2){let e,i=m().$implicit;d("selectMultiple",!0),s(),E("for","destination-",i.formGroupName,"-",i.index,""),s(),P(" ",(e=i.destination.shortDescription)!==null&&e!==void 0?e:i.destination.name," "),s(),f(i.destination.longDescription?3:-1),s(),se("formControlName",i.destination.name),s(2),D(i.destination.options)}}function Ln(t,n){if(t&1&&(r(0,"spk-icon",27),l(1," question "),o()),t&2){let e=m(2).$implicit;$("spk-tooltip-primary",e.destination.longDescription)}}function zn(t,n){if(t&1&&(r(0,"spk-form-field")(1,"label",26),l(2),_(3,Ln,2,1,"spk-icon",27),o(),p(4,"input",28)(5,"span",44),o()),t&2){let e,i=m().$implicit;s(),E("for","destination-",i.formGroupName,"-",i.index,""),s(),P(" ",(e=i.destination.shortDescription)!==null&&e!==void 0?e:i.destination.name," "),s(),f(i.destination.longDescription?3:-1),s(),E("id","destination-",i.formGroupName,"-",i.index,""),se("formControlName",i.destination.name)}}function Un(t,n){if(t&1&&(k(0,21),_(1,yn,5,11,"app-file-tree",22)(2,kn,7,10,"spk-form-field")(3,bn,8,10,"spk-form-field")(4,Tn,8,9,"spk-select")(5,On,15,9,"div",23)(6,Pn,7,9,"spk-form-field")(7,Gn,5,9,"spk-toggle",24)(8,$n,8,7,"spk-select",25)(9,zn,6,9,"spk-form-field"),v()),t&2){let e=n.$implicit;d("formGroupName",e.formGroupName),s(),f(e.destination.type==="file-tree"?1:e.destination.type==="String"||e.destination.type==="Path"?2:e.destination.type==="Password"?3:e.destination.type==="Enumeration"?4:e.destination.type==="Size"?5:e.destination.type==="Integer"?6:e.destination.type==="Boolean"?7:e.destination.type==="Flags"?8:e.destination.type==="Timespan"?9:-1)}}function jn(t,n){if(t&1&&(k(0,5)(1,13),_(2,mn,3,0,"ng-container")(3,dn,3,0,"ng-container")(4,Cn,14,1,"app-toggle-card",14)(5,Un,10,2,"ng-template",null,1,ct),v()()),t&2){let e=m(2);s(2),f(e.destinationFormPair().custom.length?2:-1),s(),f(e.destinationFormPair().dynamic.length?3:-1),s(),f(e.destinationFormPair().advanced.length?4:-1)}}function qn(t,n){if(t&1){let e=F();r(0,"form",3,0),x("submit",function(){g(e);let a=m();return y(a.next())}),r(2,"header")(3,"h3",4),l(4,"Backup destination"),o(),_(5,rn,4,0,"p"),o(),_(6,an,23,0)(7,jn,7,3,"ng-container",5),r(8,"div",6)(9,"button",7),x("click",function(){g(e);let a=m();return y(a.goBack())}),r(10,"spk-icon"),l(11,"arrow-left"),o(),l(12," Go back "),o(),r(13,"button",8)(14,"spk-icon"),l(15,"arrow-right"),o(),l(16," Continue "),o()()()}if(t&2){let e,i=m();d("formGroup",i.destinationForm),s(5),f(i.destinationCount()>0?5:-1),s(),f(i.destinationCount()===0?6:-1),s(),f(!((e=i.destinationFormSignal())==null||e.destinations==null)&&e.destinations.length?7:-1)}}var Qn=["Bytes","KB","MB","GB","TB","PB"],We=new I,Ft=(t={destinations:[]})=>We.group({destinations:We.array(t.destinations)}),bt=({key:t,customGroup:n,dynamicGroup:e,advancedGroup:i})=>We.group({destinationType:We.control(t),custom:n,dynamic:e,advanced:i}),it=class t{#e=h(M);#t=h(W);#n=h(Ce);#i=h(ut);#o=h(R);formRef=U.required("formRef");sysIsLoaded=this.#n.isLoaded;destinationIsLoaded=this.#o.destinationIsLoaded;destinationForm=this.#o.destinationForm;destinationFormPair=this.#o.destinationFormPair;selectedAdvancedFormPair=this.#o.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#o.notSelectedAdvancedFormPair;destinationOptions=this.#o.destinationOptions;destinationFormSignal=this.#o.destinationFormSignal;destinationCount=K(()=>this.destinationFormSignal()?.destinations?.length??0);sizeOptions=S(Qn);getFormFieldValue(n,e,i){return((this.destinationForm.controls.destinations.controls?.[n]).controls?.[e]).controls[i].value}addDestinationFormGroup(n){this.#o.addDestinationFormGroup(n)}addAdvancedFormPair(n){this.selectedAdvancedFormPair.update(e=>(e.push(n),e)),this.notSelectedAdvancedFormPair.update(e=>(e=e.filter(i=>i.name!==n.name),e))}targetUrl=K(()=>{let n=this.destinationFormSignal()?.destinations?.[0];return n?Ee(n):""});mapToTargetUrl(n){return Ee(n.value)}removeDestinationFormGroup(n){this.destinationForm.controls.destinations.removeAt(n)}displayFn(n){let e=this.destinationOptions().find(i=>i.Key===n);return e?`${e.DisplayName}`:""}goBack(){this.#e.navigate(["general"],{relativeTo:this.#t.parent})}next(){this.#e.navigate(["source-data"],{relativeTo:this.#t.parent})}#r=S("https://duplicati-oauth-handler.appspot.com/").asReadonly();#l=S(Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).asReadonly();#a=S(!1);#s=S(null);keyCreation(){}oauthStartTokenCreation(n){this.#a.set(!0);let e=450,i=600,a=this.#r()+"?type="+n+"&token="+this.#l(),c=screen.width/2-e/2,A=screen.height/2-i/2,B=window.open(a,"_blank","height="+i+",width="+e+",menubar=0,status=0,titlebar=0,toolbar=0,left="+c+",top="+A);B?.addEventListener("blur",le=>{console.log("event blur",le)}),B?.addEventListener("beforeunload",le=>{console.log("event beforeunload",le),this.#i.get(this.#r()+"fetch?callback=JSON_CALLBACK",{params:{token:this.#l()}}).pipe(ye(()=>this.#a.set(!1))).subscribe({next:N=>{console.log("res",N),N?.authid&&this.#s.set(N.authid)}})})}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=z({type:t,selectors:[["app-destination"]],viewQuery:function(e,i){e&1&&j(i.formRef,en,5),e&2&&q()},standalone:!0,features:[Q],decls:1,vars:1,consts:[["formRef",""],["fieldTemplate",""],[3,"formGroup"],[3,"submit","formGroup"],[1,"title-30"],["formArrayName","destinations"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile",3,"click"],["formGroupName","0"],[3,"disallowToggle"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],["title",""],["spk-button","","type","button",1,"outlined","small"],["menu",""],["spk-menu-item","","type","button"],["spk-menu-item","","type","button",3,"click"],[3,"formGroupName"],[3,"startingPath"],[1,"form-column",3,"formGroupName"],[1,"primary","raised"],[1,"primary",3,"selectMultiple"],[3,"for"],["spk-tooltip-right",""],["type","text",3,"id","formControlName"],["spkPrefix",""],[3,"type","id","formControlName"],["spkSuffix","",1,"clickable"],["spkSuffix","",1,"clickable",3,"click"],["type","search",3,"id","formControlName"],["options",""],[3,"value"],[1,"form-row"],["type","number","formControlName","size",3,"id"],["type","search","formControlName","unit"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],["type","text","id","text",3,"formControlName"],["deselect","",3,"value"],[1,"raised","primary"],["spkError",""]],template:function(e,i){e&1&&_(0,qn,17,4,"form",2),e&2&&f(i.destinationOptions().length&&i.sysIsLoaded()&&i.destinationIsLoaded()?0:-1)},dependencies:[ie,J,te,ne,H,ue,be,Y,Z,X,ee,_e,$e,dt,re,ae,Le,_t,ft,oe,we,ge,ze],styles:["[_nghost-%COMP%]{display:block}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 1fr;gap:.5rem;align-items:flex-end}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-500)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1);background-color:var(--base-level-20);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}"],changeDetection:0})};export{Ft as a,bt as b,it as c,xt as d,Je as e,Ze as f,ht as g,et as h,Xe as i,kt as j,tt as k,vt as l,nt as m,R as n};
package/chunk-HHIFLECY.js DELETED
@@ -1 +0,0 @@
1
- import{a,b}from"./chunk-43IMNGQL.js";import"./chunk-J6KTHSHX.js";import"./chunk-LD5EWOQM.js";import"./chunk-7PZ2UDVE.js";import"./chunk-IOM7KF2W.js";import"./chunk-LT6J7X37.js";import"./chunk-JRXXG6O7.js";import"./chunk-BOT7P6RM.js";import"./chunk-GBVLF3BS.js";import"./chunk-RL2VWNJG.js";export{a as createRestoreOptionsForm,b as default};
package/chunk-LD5EWOQM.js DELETED
@@ -1 +0,0 @@
1
- import{p as se}from"./chunk-IOM7KF2W.js";import{a as I,c as re,h as ae,i as ce,q as de}from"./chunk-LT6J7X37.js";import{a as pe}from"./chunk-GBVLF3BS.js";import{$ as O,A as X,Cb as K,Db as ie,Eb as Q,Fb as h,Hb as U,I as W,Kb as B,Mb as D,Nb as ne,Qa as d,Sb as oe,Wa as v,Xa as H,Ya as Z,Z as Y,a as _,ac as V,b as C,bb as m,cc as E,db as $,eb as z,fb as g,hb as T,ja as k,jb as ee,ka as w,kb as te,lb as r,mb as a,mc as le,qb as q,rb as N,sb as P,tb as p,ua as R,ub as A,va as f,vb as x}from"./chunk-RL2VWNJG.js";var Ce=["treeContainer"],ve=["formRef"],Te=[[["label"]],[["label"]],[["input"]]],Pe=["label","label","input"],be=(n,e)=>e.id,xe=n=>({children:n,level:0}),ue=n=>({$implicit:n}),ye=(n,e)=>({children:n,level:e});function Se(n,e){if(n&1){let t=N();r(0,"spk-button-group")(1,"button",8),P("click",function(){k(t);let o=p();return w(o.pathDiscoveryMethod.set("browse"))}),h(2," Browser path "),a(),r(3,"button",8),P("click",function(){k(t);let o=p();return w(o.pathDiscoveryMethod.set("path"))}),h(4," Manually type path "),a()()}if(n&2){let t=p();d(),g("active",t.pathDiscoveryMethod()==="browse"),d(2),g("active",t.pathDiscoveryMethod()==="path")}}function ke(n,e){n&1&&(r(0,"spk-icon",11),h(1,"folder-open"),a())}function we(n,e){n&1&&(r(0,"spk-icon"),h(1,"file"),a())}function Fe(n,e){n&1&&(r(0,"spk-icon",11),h(1,"folder"),a())}function Me(n,e){if(n&1&&m(0,ke,2,0,"spk-icon",11)(1,we,2,0,"spk-icon")(2,Fe,2,0,"spk-icon",11),n&2){let t=p(2).$implicit;T(t.children.length?0:t.cls==="file"?1:2)}}function Ee(n,e){n&1&&(r(0,"spk-icon",11),h(1,"desktop-tower"),a())}function Oe(n,e){n&1&&q(0)}function Ne(n,e){if(n&1&&m(0,Oe,1,0,"ng-container",6),n&2){let t=p(2).$implicit,i=p().$implicit;p();let o=Q(6);$("ngTemplateOutlet",o)("ngTemplateOutletContext",D(5,ue,ne(2,ye,t.children,i.level+1)))}}function Ae(n,e){if(n&1){let t=N();r(0,"div",9,3),P("click",function(o){k(t);let s=p().$implicit,l=p(2);return w(s.id!=="/"&&l.toggleNode(o,s.id,s))}),r(2,"div",10),m(3,Me,3,1)(4,Ee,2,0,"spk-icon",11),a(),r(5,"div",12),P("click",function(o){k(t);let s=p().$implicit,l=p(2);return w(s.id!=="/"&&l.toggleSelectedNode(o,s))}),h(6),a()(),m(7,Ne,1,7,"ng-container")}if(n&2){let t=p().$implicit;g("active",t.isSelected)("open",t.children.length)("usually-hidden",t.hidden),d(3),T(t.id!=="/"?3:4),d(3),U(" ",t.text," "),d(),T(t.children.length>0?7:-1)}}function Be(n,e){if(n&1&&m(0,Ae,8,9),n&2){let t=e.$implicit,i=p(2);T(t.hidden&&i.showHiddenFiles()||!t.hidden?0:-1)}}function De(n,e){if(n&1&&(r(0,"spk-list"),ee(1,Be,1,1,null,null,be),a()),n&2){let t=e.$implicit;z("padding-left",t.level*.5,"rem"),d(),te(t.children)}}function Ve(n,e){n&1&&q(0)}var G=class n{#t=Y(pe);multiSelect=f(!1);disabled=f(!1);showFiles=f(!1);startingPath=f(null);rootPath=f(void 0);backupSettings=f(null);includes=R();excludes=R();treeContainerRef=H("treeContainer");formRef=H("formRef");pathDiscoveryMethod=v("browse");isLoading=v(!1);showHiddenFiles=v(!1);currentPath=v("/");#e=v(null);treeSearchQuery=v("");treeNodes=v([]);isByBackupSettings=V(()=>this.rootPath()&&this.backupSettings()?.id&&this.backupSettings()?.time);searchableTreeNodes=V(()=>{let e=this.treeSearchQuery();return e?this.treeNodes().filter(t=>t.text?.toLowerCase().includes(e.toLowerCase())):this.treeNodes()});treeStructure=V(()=>{let e=this.searchableTreeNodes(),t=new Map,i=this.rootPath(),o=i?{id:i,resolvedpath:i,text:i?.replaceAll("/",""),parentPath:"",children:[],isSelected:!1,cls:"folder"}:{id:"/",resolvedpath:"/",text:"Computer",parentPath:"",children:[],isSelected:!1};t.set("/",o);for(let s of e){let u=s.id.replace(i??"","").split("/").filter(Boolean),c="",y=o;for(let b of u){if(c+="/"+b,!t.has(c)){let F={id:s.id,isSelected:s.isSelected,parentPath:c,resolvedpath:s.id?.startsWith("%")?s.resolvedpath+"/":c,hidden:s.hidden,text:s.text,cls:s.cls,children:[]};t.set(c,F),y.children.push(F)}y=t.get(c)}}return[o]});pathDiscoveryMethodEffect=E(()=>{let e=this.pathDiscoveryMethod(),t=this.#e();if(e==="browse"&&t)if(this.multiSelect()){let i=t.value.split("\0");this.treeNodes.update(o=>o.map(s=>C(_({},s),{isSelected:typeof s.id=="string"&&i.includes(s.id)})))}else this.treeNodes.update(i=>i.map(o=>C(_({},o),{isSelected:o.id===t.value})))},{allowSignalWrites:!0});#a(){let e=this.treeContainerRef()?.nativeElement.querySelectorAll(".active");e&&e.length>0&&e[0].scrollIntoView({behavior:"smooth",block:"center"})}currentPathEffect=E(()=>{let e=this.#e();e&&(e.value=this.currentPath(),e.dispatchEvent(new Event("input")))},{allowSignalWrites:!0});selectedPathsEffect=E(()=>{if(this.multiSelect()){let e=this.treeNodes().filter(l=>l.isSelected),t=this.treeNodes().filter(l=>!l.isSelected&&e.some(u=>l.id?.startsWith(u.id))),i=e.filter(l=>!e.some(u=>l.id!==u.id&&l.id?.startsWith(u.id))).map(l=>l.id),o=t.filter(l=>!t.some(u=>l.id!==u.id&&l.id?.startsWith(u.id))).map(l=>`-${l.id}`);this.excludes.emit(o);let s=[...i,...o];this.currentPath.set(s.join("\0"))}else{let e=this.treeNodes().find(i=>i.isSelected),t=e?.resolvedpath;this.currentPath.set(e?.id??"")}},{allowSignalWrites:!0});inputValueChangeAbortController=null;inputRefEffect=E(()=>{let e=this.formRef()?.nativeElement?.querySelector("input");e&&(this.#o(e),this.inputValueChangeAbortController&&this.inputValueChangeAbortController.abort(),this.inputValueChangeAbortController=new AbortController,e.addEventListener("inputValueChanged",t=>{this.currentPath.set(t.detail.value)},{signal:this.inputValueChangeAbortController.signal}),this.#e.set(e),e.autocomplete="off")},{allowSignalWrites:!0});ngOnInit(){let e=this.startingPath();e?(this.currentPath.set(e),this.#r(e)):this.#n(null,this.rootPath())}toggleSelectedNode(e,t){e.stopPropagation(),this.multiSelect()?this.treeNodes.update(i=>i.map(o=>o.id?.startsWith(t.id)?C(_({},o),{isSelected:!t.isSelected}):o)):this.treeNodes.update(i=>i.map(o=>o.id===t.id?C(_({},o),{isSelected:!t.isSelected}):C(_({},o),{isSelected:!1})))}toggleNode(e,t,i=null){e.stopPropagation(),i?.children.length?this.treeNodes.update(o=>o.filter(s=>!s.id?.startsWith(i.id)||s.id===i.id)):this.#n(i,t)}#o(e){return Object.defineProperty(e,"value",{configurable:!0,get(){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").get.call(this)},set(t){return Object.getOwnPropertyDescriptor(HTMLInputElement.prototype,"value").set.call(this,t),this.dispatchEvent(new CustomEvent("inputValueChanged",{bubbles:!0,cancelable:!0,detail:{value:t}})),t}}),e}#l(e){return this.#t.postApiV1Filesystem({showHidden:!0,requestBody:{path:e},onlyFolders:!this.showFiles()})}#s(e){let t=this.backupSettings(),i={id:t.id,time:t.time,prefixOnly:!1,folderContents:!0};return e&&(i.filter="@"+e),this.#t.getApiV1BackupByIdFiles(i)}#i(e){return this.isByBackupSettings()?this.#s(e):this.#l(e)}#r(e){let t=e.split("\0").filter(l=>l.startsWith("-")).map(l=>l.slice(1,-1)),i=e.split("\0").filter(l=>!l.startsWith("-")).filter(Boolean),o=i.map(l=>l.split("/").filter(Boolean)),s=[this.rootPath()??"/"];o.forEach(l=>{l.forEach((u,c)=>{let y="/"+l.slice(0,c+1).join("/");s.includes(y)||s.push(y)})}),this.isLoading.set(!0),X([...s.map(l=>this.#i(l))]).pipe(W(()=>this.isLoading.set(!1))).subscribe({next:l=>{this.treeNodes.update(u=>{let c=l.flatMap(b=>b.map(F=>{let M=F.id,j=M&&M.split("/").filter(Boolean).slice(0,-1).join("/"),L="/"+(M&&M.split("/").filter(Boolean).join("/")),he=i.findIndex(S=>this.multiSelect()?L.startsWith(S):L===S)>-1,me=i.findIndex(S=>S===M)>-1,ge=t.findIndex(S=>S===L)>-1;return C(_({},F),{parentPath:j.startsWith("%")?j:"/"+j,isSelected:he&&!ge||me})}));return[...new Map([...u,...c].map(b=>[b.resolvedpath??b.id,b])).values()]})}})}#n(e=null,t="/"){this.isLoading.set(!0),this.#i(t).pipe(W(()=>this.isLoading.set(!1))).subscribe({next:i=>{let o=this.isByBackupSettings()?i.Files.map(s=>({text:s.Path.split("/").filter(l=>l!=="").pop(),id:s.Path,cls:s.Path.endsWith("/")?"folder":"file",leaf:e!==null,resolvedpath:s.Path,hidden:!1})):i;this.treeNodes.update(s=>{let l=o.map(c=>C(_({},c),{parentPath:t,isSelected:(this.multiSelect()&&e?.isSelected)??!1}));return[...new Map([...s,...l].map(c=>[c.resolvedpath??c.id,c])).values()]})}})}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["app-file-tree"]],viewQuery:function(t,i){t&1&&(K(i.treeContainerRef,Ce,5),K(i.formRef,ve,5)),t&2&&ie(2)},hostVars:2,hostBindings:function(t,i){t&2&&g("disabled",i.disabled())},inputs:{multiSelect:[1,"multiSelect"],disabled:[1,"disabled"],showFiles:[1,"showFiles"],startingPath:[1,"startingPath"],rootPath:[1,"rootPath"],backupSettings:[1,"backupSettings"]},outputs:{includes:"includes",excludes:"excludes"},standalone:!0,features:[B],ngContentSelectors:Pe,decls:15,vars:14,consts:[["treeContainer",""],["recursiveTree",""],["formRef",""],["treeNode",""],[1,"section"],[1,"browse-files"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"primary","raised","browse-files-toggle",3,"click"],["type","button",3,"click"],["spk-action-item","",3,"click"],[1,"icon"],[1,"spk-primary"],[1,"text",3,"click"]],template:function(t,i){if(t&1){let o=N();A(Te),m(0,Se,5,4,"spk-button-group"),r(1,"div",4),x(2,0,["ngProjectAs","label",5,["label"]]),r(3,"div",5,0),m(5,De,3,2,"ng-template",null,1,oe)(7,Ve,1,0,"ng-container",6),a(),r(8,"spk-toggle",7),P("click",function(){return k(o),w(i.showHiddenFiles.set(!i.showHiddenFiles()))}),h(9),a()(),r(10,"div",null,2)(12,"spk-form-field"),x(13,1,["ngProjectAs","label",5,["label"]]),x(14,2,["ngProjectAs","input",5,["input"]]),a()()}if(t&2){let o=Q(6);T(i.multiSelect()?-1:0),d(),g("hidden",i.pathDiscoveryMethod()!=="browse"),d(6),$("ngTemplateOutlet",o)("ngTemplateOutletContext",D(12,ue,D(10,xe,i.treeStructure()))),d(),g("active",i.showHiddenFiles()),d(),U(" Show hidden ",i.showFiles()?"files":"folders"," "),d(3),g("hidden",i.pathDiscoveryMethod()!=="path")}},dependencies:[re,de,I,ae,ce,le,se],styles:['[_nghost-%COMP%]{display:flex;flex-direction:column;gap:1rem}.disabled[_nghost-%COMP%]{opacity:.5;-webkit-user-select:none;user-select:none;pointer-events:none;position:relative}.disabled[_nghost-%COMP%]:before{content:"";position:absolute;inset:0;background:transparent}.section[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.browse-files[_ngcontent-%COMP%]{display:flex;gap:.5rem;padding:.5rem 1rem;height:12.5rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);overflow:auto;resize:vertical}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%]{--list-active-bg: var(--base-level-30);gap:0;padding:0;height:min-content;min-width:min-content}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [spk-action-item][_ngcontent-%COMP%]{padding:0;gap:.25rem}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [spk-action-item].usually-hidden[_ngcontent-%COMP%]{opacity:.6}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [spk-action-item][_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{flex:1 0;height:100%;width:max-content;display:flex;align-items:center}.browse-files[_ngcontent-%COMP%] spk-list[_ngcontent-%COMP%] [spk-action-item][_ngcontent-%COMP%] .icon[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;display:flex;align-items:center;justify-content:center;cursor:pointer}.browse-files-toggle[_ngcontent-%COMP%]{color:var(--base-level-60R)}.hidden[_ngcontent-%COMP%]{display:none}'],changeDetection:0})};var Ie=[[["","title",""]],"*"],je=["[title]","*"];function Le(n,e){n&1&&h(0,"Title")}function We(n,e){n&1&&(r(0,"spk-icon"),h(1,"caret-down"),a())}var J=class n{isActive=Z(!1);disallowToggle=f(!1);ngOnInit(){this.disallowToggle()&&this.isActive.set(!0)}toggle(){this.isActive.set(!this.isActive())}static \u0275fac=function(t){return new(t||n)};static \u0275cmp=O({type:n,selectors:[["app-toggle-card"]],hostVars:2,hostBindings:function(t,i){t&2&&g("active",i.isActive())},inputs:{isActive:[1,"isActive"],disallowToggle:[1,"disallowToggle"]},outputs:{isActive:"isActiveChange"},standalone:!0,features:[B],ngContentSelectors:je,decls:6,vars:1,consts:[[3,"click"],[1,"content"]],template:function(t,i){t&1&&(A(Ie),r(0,"h3",0),P("click",function(){return i.disallowToggle()||i.toggle()}),x(1,0,null,Le,1,0),m(3,We,2,0,"spk-icon"),a(),r(4,"div",1),x(5,1),a()),t&2&&(d(3),T(i.disallowToggle()?-1:3))},dependencies:[I],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;border-radius:var(--shape-3);background-color:var(--base-level-20)}.active[_nghost-%COMP%] .content[_ngcontent-%COMP%]{max-height:1000px;transition:max-height 1s linear;padding:0 1rem 1rem}.active[_nghost-%COMP%] spk-icon[_ngcontent-%COMP%]{transform:rotate(180deg)}[_nghost-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;font:var(--paragraph-10);padding:1rem;cursor:pointer;-webkit-user-select:none;user-select:none}[_nghost-%COMP%] spk-icon[_ngcontent-%COMP%]{transform:rotate(0);transform-origin:center;transition:transform .2s ease}.content[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem;padding:0 1rem;overflow:hidden;max-height:0;transition:max-height .25s linear,padding .25s linear}"],changeDetection:0})};export{G as a,J as b};
package/chunk-OP5BV4PG.js DELETED
@@ -1 +0,0 @@
1
- import{l as a,m as b}from"./chunk-GY2VPOAT.js";import"./chunk-LD5EWOQM.js";import"./chunk-7PZ2UDVE.js";import"./chunk-IOM7KF2W.js";import"./chunk-63RKHEAK.js";import"./chunk-LT6J7X37.js";import"./chunk-JRXXG6O7.js";import"./chunk-BOT7P6RM.js";import"./chunk-GBVLF3BS.js";import"./chunk-RL2VWNJG.js";export{a as createSourceDataForm,b as default};