@duplicati/ngclient 0.0.212 → 0.0.213

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 (46) hide show
  1. package/assets/sh.woff2 +0 -0
  2. package/{chunk-CNYY7AQK.js → chunk-3IZWJV72.js} +1 -1
  3. package/{chunk-HVFJYWAN.js → chunk-5REJ6F23.js} +1 -1
  4. package/chunk-7FDLOZXV.js +1 -0
  5. package/{chunk-NRQEZLYN.js → chunk-BLPTBPXV.js} +1 -1
  6. package/{chunk-VEXVMT3W.js → chunk-C5OIC3DB.js} +1 -1
  7. package/{chunk-QRABW3YV.js → chunk-CFJXIOSV.js} +1 -1
  8. package/{chunk-V2NDJVRA.js → chunk-CQYKOCGO.js} +1 -1
  9. package/{chunk-2JEQ7BV6.js → chunk-CW43F6WE.js} +1 -1
  10. package/{chunk-6HSYT4DG.js → chunk-DFVPFPMV.js} +1 -1
  11. package/{chunk-TVA237PQ.js → chunk-EGTYGTQI.js} +1 -1
  12. package/chunk-I625OICV.js +1 -0
  13. package/{chunk-36UMECQ6.js → chunk-IWDA6CMP.js} +1 -1
  14. package/{chunk-JTPUS6BT.js → chunk-J5TWEZOP.js} +1 -1
  15. package/chunk-J5VU6VA4.js +1 -0
  16. package/{chunk-WLU7TGVD.js → chunk-JLSU6WKG.js} +1 -1
  17. package/{chunk-7735MTTP.js → chunk-JMLM4A3C.js} +1 -1
  18. package/{chunk-5RK6PXUG.js → chunk-KMGGFCBZ.js} +1 -1
  19. package/{chunk-N5ZBB5VR.js → chunk-LQKECNBH.js} +1 -1
  20. package/{chunk-AOMXVXMB.js → chunk-NBKLLQQO.js} +1 -1
  21. package/chunk-PBYZZEYM.js +1 -0
  22. package/{chunk-6EOMDYWB.js → chunk-R5OX4JTJ.js} +1 -1
  23. package/{chunk-2A5USVIH.js → chunk-SGLY2D7Y.js} +1 -1
  24. package/{chunk-NK2B3YKP.js → chunk-T2X5J6MQ.js} +1 -1
  25. package/chunk-TGZAL6DJ.js +1 -0
  26. package/{chunk-STGN2W4U.js → chunk-TPHRU6NP.js} +1 -1
  27. package/{chunk-SHZXLIG5.js → chunk-U34FLIYL.js} +1 -1
  28. package/{chunk-WT5O6MNC.js → chunk-UE37PPYX.js} +1 -1
  29. package/{chunk-WPVSY5MT.js → chunk-V7UJAXBT.js} +1 -1
  30. package/chunk-VCIINZCU.js +1 -0
  31. package/{chunk-G6V7E6VM.js → chunk-WIE7KXIC.js} +1 -1
  32. package/{chunk-CJVAK3WV.js → chunk-XAYG4QT7.js} +1 -1
  33. package/{chunk-ST6HBZ55.js → chunk-YHVGLFWL.js} +1 -1
  34. package/{chunk-6DZ74HAA.js → chunk-YPWKWP5H.js} +1 -1
  35. package/{chunk-L26PO2OC.js → chunk-Z7CZCI7E.js} +1 -1
  36. package/{chunk-PHN2W7W7.js → chunk-ZJOUYWI2.js} +1 -1
  37. package/{chunk-52REVNJZ.js → chunk-ZK3S23CJ.js} +1 -1
  38. package/index.html +1 -1
  39. package/{main-SIS2YGAN.js → main-ZP6YWLCN.js} +1 -1
  40. package/package.json +1 -1
  41. package/chunk-2D2IMXRC.js +0 -1
  42. package/chunk-3AZTY4MH.js +0 -1
  43. package/chunk-5ENU22GJ.js +0 -1
  44. package/chunk-IJY7JGOL.js +0 -1
  45. package/chunk-SI4C7DCS.js +0 -1
  46. package/chunk-Y4EMWRGE.js +0 -1
@@ -1 +1 @@
1
- import{a as De}from"./chunk-GO22QPW4.js";import{a as Oe}from"./chunk-FMDSOHVR.js";import{a as fe}from"./chunk-AOMXVXMB.js";import{b as me}from"./chunk-Y4EMWRGE.js";import{a as Ee}from"./chunk-3AZTY4MH.js";import{a as Fe}from"./chunk-YMUS7QSB.js";import{b as Ce}from"./chunk-XZNYCTQB.js";import{a as pe}from"./chunk-R6TFME5I.js";import{c as se}from"./chunk-AZRNX5LU.js";import{B as A,H as ue,K as Se,P as de,Y as ge,c as ae,e as le,i as _e,k as re,s as ce,v as P,z as Te}from"./chunk-NCXKMSRH.js";import{d as x}from"./chunk-QAQMMCTH.js";import{e as oe}from"./chunk-KHZ5AXGT.js";import{$b as S,Bc as H,Cb as R,Db as a,Eb as l,F as Q,Fb as T,Jb as te,Kb as ne,Mb as D,Rc as Y,Sa as r,Tb as C,Ub as m,Vb as I,Wc as ie,Yb as v,Zb as c,_ as d,da as E,ea as O,gb as N,kc as G,nc as F,oc as w,pa as f,pc as V,ra as ee,sc as b,tc as y,uc as B,wb as g,xb as p}from"./chunk-UH2E7MMT.js";function Pe(o,t){o&1&&(a(0,"sh-icon",2),F(1,"x-bold"),l())}function Ae(o,t){o&1&&(a(0,"sh-icon",3),F(1,"list-bold"),l())}function he(o,t){if(o&1){let n=D();a(0,"button",1),c("click",function(){E(n);let i=S();return O(i.toggleNav())}),g(1,Pe,2,0,"sh-icon",2)(2,Ae,2,0,"sh-icon",3),l()}if(o&2){let n=S();r(),p(n.isNavOpen()?1:2)}}var $=class o{#e=d(Oe);isNavOpen=this.#e.isNavOpen;isMobile=this.#e.isMobile;toggleNav(){this.#e.toggleNav()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-mobile-menu-toggle"]],decls:1,vars:1,consts:[["shButton","",1,"small","toggle-sidebar","ghost"],["shButton","",1,"small","toggle-sidebar","ghost",3,"click"],[1,"cross"],[1,"burger"]],template:function(n,e){n&1&&g(0,he,3,1,"button",0),n&2&&p(e.isMobile()?0:-1)},dependencies:[A,P],styles:["[_nghost-%COMP%]{display:contents}.toggle-sidebar[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center}.toggle-sidebar[_ngcontent-%COMP%] .cross[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{opacity:1;transition:opacity 124ms linear;margin:0}.toggle-sidebar[_ngcontent-%COMP%] .cross.hidden[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger.hidden[_ngcontent-%COMP%]{opacity:0}"],changeDetection:0})};var Ne=()=>["/connect/logon"];function ve(o,t){o&1&&(C(0,0,1),T(1,"div",9),m())}function be(o,t){o&1&&(C(0,0,2),T(1,"div",10),m())}function ye(o,t){if(o&1){let n=D();a(0,"div",8),c("click",function(){E(n);let i=S();return O(i.resetAndRetry())}),C(1,0),g(2,ve,2,0)(3,be,2,0),m(),l()}if(o&2){let n=S();r(2),p(n.resetting()?2:3)}}function Be(o,t){o&1&&(a(0,"div",6),C(1,1),T(2,"div",11),m(),l()),o&2&&R("routerLink",H(1,Ne))}function ke(o,t){o&1&&(a(0,"div",6),C(1,2),T(2,"div",10),m(),l()),o&2&&R("routerLink",H(1,Ne))}function Le(o,t){if(o&1){let n=D();a(0,"div",7),C(1,3),a(2,"sh-icon",12),c("click",function(){E(n);let i=S();return O(i.cancel())}),l(),a(3,"div",13),c("click",function(){E(n);let i=S();return O(i.claim())}),l(),T(4,"div",14),m(),l()}}function Ge(o,t){if(o&1){let n=D();a(0,"div",8),c("click",function(){E(n);let i=S();return O(i.openConsole())}),C(1,4),T(2,"div",15),m(),l()}}var k=class o{#e=d(Ee);state=this.#e.state;resetting=f(!1);stateEffect=ee(()=>{let t=this.#e.state(),n=this.resetting();t==="registered"&&n&&(this.resetting.set(!1),this.#e.beginRemoteRegistration())});ngOnInit(){this.#e.refreshRemoteControlStatus()}claim(){let t=this.#e.claimUrl();t&&window.open(t,"_blank")}cancel(){this.#e.cancelRemoteRegistration()}resetAndRetry(){this.resetting.set(!0),this.#e.cancelRemoteRegistration()}openConsole(){this.#e.openConsole()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-remote-connectivity-status"]],decls:5,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF: Resetting ${"\uFFFD#1:1\uFFFD"}:START_TAG_DIV:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE: Click to connect ${"\uFFFD#1:2\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=v(t);let n;n=$localize` Connecting ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let e;e=$localize` Click to register ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let i;i=$localize`Cancel registration`;let s;s=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD#3\uFFFD"}:START_TAG_DIV:Click to claim${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:`,s=v(s);let u;return u=$localize` Connected ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`,[t,n,e,s,u,[1,"connectivity-status"],[1,"connectivity-status",3,"routerLink"],[1,"connectivity-status","claim"],[1,"connectivity-status",3,"click"],[1,"status","blinking"],[1,"status"],[1,"status","warning","blinking"],["shTooltip",i,3,"click"],[1,"claim",3,"click"],[1,"status","success","blinking"],[1,"status","success"]]},template:function(n,e){if(n&1&&g(0,ye,4,1,"div",5)(1,Be,3,2,"div",6)(2,ke,3,2,"div",6)(3,Le,5,0,"div",7)(4,Ge,3,0,"div",5),n&2){let i=e.state()==="unknown"||e.state()==="inactive"||e.state()==="registeringfaulted",s=e.state()==="registeringfaulted",u=e.state()==="registering",_=e.state()==="registered",M=e.state()==="connected"||e.state()==="disabled"||e.state()==="connecting";p(s?0:u?1:i?2:_?3:M?4:-1)}},dependencies:[oe,P,ge],styles:["[_nghost-%COMP%]{display:flex;align-items:center;padding:0 .75rem}@media only screen and (max-width:768px){[_nghost-%COMP%]{padding:0}}.hide-text[_nghost-%COMP%]{font-size:0}.in-menu[_nghost-%COMP%]{padding:.75rem;border-bottom:1px solid var(--base-4)}.connectivity-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.connectivity-status[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%]{display:flex;gap:.5rem;cursor:pointer}.connectivity-status.claim[_ngcontent-%COMP%]:hover{color:inherit}.connectivity-status.claim[_ngcontent-%COMP%] .claim[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]:hover{color:var(--error-8)}.status[_ngcontent-%COMP%]{width:.625rem;height:.625rem;border-radius:50%;background-color:var(--base-4)}.status.success[_ngcontent-%COMP%]{background-color:var(--success-8)}.status.warning[_ngcontent-%COMP%]{background-color:var(--warn-8)}.status.blinking[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking 1s infinite}@keyframes _ngcontent-%COMP%_blinking{0%{opacity:.2}50%{opacity:1}to{opacity:.2}}"],changeDetection:0})};var Me={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},xe=["mbps","gbps"],Ie=8,W=1024,U=W*1024,j=U*1024,Z=j*1024,Re=Z*1024,$e={B:1,KB:W,MB:U,GB:j,TB:Z,PB:Re},Ue=1e3,K=Ue*1e3,X=K*1e3,we=[{threshold:Re,unitPrefix:"PByte"},{threshold:Z,unitPrefix:"TByte"},{threshold:j,unitPrefix:"GByte"},{threshold:U,unitPrefix:"MByte"},{threshold:W,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],L=class o{#e=d(x);closed=ie();isSubmitting=f(!1);sizeOptions=f([...xe]);maxUpload=f(0);maxDownload=f(0);maxUploadUnit=f("mbps");maxDownloadUnit=f("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(t,n){let i=t*($e[n.toUpperCase()]||U)*Ie;return i===0?{value:0,unit:"mbps"}:i>=X?{value:parseFloat((i/X).toFixed(2)),unit:"gbps"}:{value:parseFloat((i/K).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(t,n){let e=0;switch(n){case"gbps":e=t*X;break;case"mbps":e=t*K;break}let i=e/Ie;if(i===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:s,unitPrefix:u}of we)if(i>=s)return{valueForApi:Math.round(i/s),unitPrefixForApi:u};return{valueForApi:Math.round(i),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:t=>{let n=t?.["max-upload-speed"],e=t?.["max-download-speed"];if(n&&n!==""){let i=n.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(i){let s=parseFloat(i[1]),u=i[2],_=this.convertToBitsPerSecondUnits(s,u);this.maxUpload.set(_.value),this.maxUploadUnit.set(_.unit)}else console.warn("Unexpected max-upload-speed format from API:",n),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let i=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(i){let s=parseFloat(i[1]),u=i[2],_=this.convertToBitsPerSecondUnits(s,u);this.maxDownload.set(_.value),this.maxDownloadUnit.set(_.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:t=>{console.error("Failed to get server settings:",t),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(t){if([".",","].includes(t.key))return t.preventDefault()}cleanupInputAfterPasting(t){t.preventDefault();let n=t.clipboardData?.getData("text/plain");if(!n)return;let e=n.replaceAll(/[\.,]/g,"");t.target.value=e}submit(){this.isSubmitting.set(!0);let t="",n="",e=this.maxUpload()??0,i=this.maxUploadUnit(),s=this.maxDownload()??0,u=this.maxDownloadUnit();if(e>0){let{valueForApi:_,unitPrefixForApi:M}=this.convertFromBitsPerSecondUnits(e,i),h=Me[M];h?t=`${_}${h}`:console.error(`Invalid unit prefix for API submission (upload): ${M}. Defaulting to empty string.`)}if(s){let{valueForApi:_,unitPrefixForApi:M}=this.convertFromBitsPerSecondUnits(s,u),h=Me[M];h?n=`${_}${h}`:console.error(`Invalid unit prefix for API submission (download): ${M}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":t,"max-download-speed":n}}).pipe(Q(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:_=>{console.error("Failed to submit throttle settings:",_)}})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let t;t=$localize`Throttle network speed`;let n;n=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let i;i=$localize`Max download speed`;let s;s=$localize`Cancel`;let u;return u=$localize` Update settings `,[t,n,e,i,s,u,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(n,e){n&1&&(a(0,"header")(1,"h3"),I(2,0),l(),a(3,"p"),I(4,1),l()(),a(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),I(9,2),l(),a(10,"sh-form-field")(11,"input",9),c("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),B("ngModelChange",function(s){return y(e.maxUpload,s)||(e.maxUpload=s),s}),l()(),a(12,"sh-select",10)(13,"input",11),B("ngModelChange",function(s){return y(e.maxUploadUnit,s)||(e.maxUploadUnit=s),s}),l()()(),a(14,"div",8)(15,"label"),I(16,3),l(),a(17,"sh-form-field")(18,"input",9),c("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),B("ngModelChange",function(s){return y(e.maxDownload,s)||(e.maxDownload=s),s}),l()(),a(19,"sh-select",10)(20,"input",11),B("ngModelChange",function(s){return y(e.maxDownloadUnit,s)||(e.maxDownloadUnit=s),s}),l()()()()(),a(21,"footer",12)(22,"button",13),c("click",function(){return e.closed.emit(!1)}),I(23,4),l(),a(24,"button",14),c("click",function(){return e.submit()}),I(25,5),l()()),n&2&&(r(11),b("ngModel",e.maxUpload),r(),R("isClearable",!1)("options",e.sizeOptions()),r(),b("ngModel",e.maxUploadUnit),r(5),b("ngModel",e.maxDownload),r(),R("isClearable",!1)("options",e.sizeOptions()),r(),b("ngModel",e.maxDownloadUnit),r(4),G("loading",e.isSubmitting()))},dependencies:[ce,ae,re,le,_e,ue,de,A],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function Ve(o,t){o&1&&T(0,"app-remote-connectivity-status")}function He(o,t){if(o&1){let n=D();a(0,"button",7),c("click",function(){E(n);let i=S(2);return O(i.abort())}),C(1,1),T(2,"sh-icon"),m(),l()}}function Ye(o,t){if(o&1){let n=D();a(0,"button",7),c("click",function(){E(n);let i=S(2);return O(i.stop())}),C(1,2),T(2,"sh-icon"),m(),l()}}function ze(o,t){if(o&1&&g(0,He,3,0,"button",14)(1,Ye,3,0,"button",14),o&2){let n=S();p(n.isStopping()?0:1)}}function Je(o,t){o&1&&(C(0,0,1),T(1,"sh-icon"),m())}function Xe(o,t){o&1&&(C(0,0,2),T(1,"sh-icon"),m())}function Ke(o,t){o&1&&T(0,"app-remote-connectivity-status",10)}function We(o,t){o&1&&T(0,"app-remote-connectivity-status",12)}function je(o,t){if(o&1){let n=D();a(0,"button",13),c("click",function(){E(n);let i=S();return O(i.isStopping()?i.abort():i.stop())}),a(1,"sh-icon"),F(2),l(),F(3),l()}if(o&2){let n=S();r(2),w(n.isStopping()?"skull":"stop"),r(),V(" ",n.isStopping()?"Abort":"Stop"," ")}}var q=class o{#e=d(x);#t=d(me);#n=d(Te);#s=d(Ce);#i=d(se);#a=d(pe);#l=d(Fe);clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=Y(()=>this.#s.serverState()?.ActiveTask?.Item1);isStopping=Y(()=>this.runningTask()==this.#o());#o=f(-1);isUsingRelay=this.#i.relayIsEnabled;hideConsoleConnectionStatus=this.#l.isConsoleConnectionStatusHidden;openThrottleSettingsDialog(){this.#n.open(L,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open(De,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let t=this.runningTask();t&&(this.#o.set(t),this.#e.postApiV1TaskByTaskidStop({taskid:t}).subscribe())}abort(){let t=this.runningTask();t&&this.#e.postApiV1TaskByTaskidAbort({taskid:t}).subscribe()}ngAfterViewInit(){let t=this.#i.relayIsEnabled()||!this.#a.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(t)}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-status-bar"]],decls:31,vars:10,consts:()=>{let t;t=$localize`${"\uFFFD*9:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*9:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*10:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Resume ${"\uFFFD/*10:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=v(t);let n;n=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let e;return e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[t,n,e,[1,"current-backup"],[1,"global-progress"],[1,"current-backup-actions"],[1,"desktop-actions"],["shButton","",3,"click"],[1,"mobile-actions"],["shButton","",1,"small","menu-mobile-toggle"],[1,"hide-text"],["menu",""],[1,"in-menu"],[3,"click"],["shButton",""]]},template:function(n,e){n&1&&(a(0,"div",3),T(1,"app-mobile-menu-toggle")(2,"app-backup-progress",4),a(3,"div",5)(4,"div",6),g(5,Ve,1,0,"app-remote-connectivity-status"),g(6,ze,2,1),a(7,"button",7),c("click",function(){return e.pauseResume()}),C(8,0),g(9,Je,2,0)(10,Xe,2,0),m(),l(),a(11,"button",7),c("click",function(){return e.openThrottleSettingsDialog()}),a(12,"sh-icon"),F(13,"speedometer"),l()()(),a(14,"div",8)(15,"sh-menu")(16,"button",9),g(17,Ke,1,0,"app-remote-connectivity-status",10),a(18,"sh-icon"),F(19,"dots-three-vertical-bold"),l()(),te(20,11),g(21,We,1,0,"app-remote-connectivity-status",12),g(22,je,4,2,"button"),a(23,"button",13),c("click",function(){return e.pauseResume()}),a(24,"sh-icon"),F(25),l(),F(26),l(),a(27,"button",13),c("click",function(){return e.openThrottleSettingsDialog()}),a(28,"sh-icon"),F(29,"speedometer"),l(),F(30," Throttle Settings "),l(),ne(),l()()()()),n&2&&(r(5),p(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?5:-1),r(),p(e.runningTask()?6:-1),r(),G("loading",e.isResuming()),r(2),p(e.clientIsRunning()?9:10),r(8),p(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?17:-1),r(4),p(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?21:-1),r(),p(e.runningTask()?22:-1),r(3),w(e.clientIsRunning()?"pause":"play"),r(),V(" ",e.clientIsRunning()?"Pause":"Resume"," "))},dependencies:[k,P,A,Se,$,fe],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}[_nghost-%COMP%]:has(sh-progress-bar){padding:1rem 1rem 1.5rem}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.global-progress[_ngcontent-%COMP%]{flex:1 0;min-width:18.75rem}.current-backup-actions[_ngcontent-%COMP%], .current-backup-actions[_ngcontent-%COMP%] .desktop-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}@media only screen and (max-width:768px){.current-backup-actions[_ngcontent-%COMP%] .desktop-actions[_ngcontent-%COMP%]{display:none}}.current-backup-actions[_ngcontent-%COMP%] .mobile-actions[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.current-backup-actions[_ngcontent-%COMP%] .mobile-actions[_ngcontent-%COMP%]{display:flex}}.current-backup-actions[_ngcontent-%COMP%] .menu-mobile-toggle[_ngcontent-%COMP%]{position:relative}.current-backup-actions[_ngcontent-%COMP%] .menu-mobile-toggle[_ngcontent-%COMP%] app-remote-connectivity-status[_ngcontent-%COMP%]{position:absolute;top:-.25rem;right:-.25rem}.menu-status-item[_ngcontent-%COMP%]{padding:.5rem 1rem;display:flex;flex-direction:column;gap:.25rem;border-bottom:1px solid var(--base-4);margin-bottom:.25rem}.menu-status-item[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;font-size:.875rem}"],changeDetection:0})};export{q as a};
1
+ import{a as De}from"./chunk-GO22QPW4.js";import{a as Oe}from"./chunk-FMDSOHVR.js";import{a as fe}from"./chunk-NBKLLQQO.js";import{b as me}from"./chunk-I625OICV.js";import{a as Ee}from"./chunk-7FDLOZXV.js";import{a as Fe}from"./chunk-YMUS7QSB.js";import{b as Ce}from"./chunk-XZNYCTQB.js";import{a as pe}from"./chunk-R6TFME5I.js";import{c as se}from"./chunk-AZRNX5LU.js";import{B as A,H as ue,K as Se,P as de,Y as ge,c as ae,e as le,i as _e,k as re,s as ce,v as P,z as Te}from"./chunk-NCXKMSRH.js";import{d as x}from"./chunk-QAQMMCTH.js";import{e as oe}from"./chunk-KHZ5AXGT.js";import{$b as S,Bc as H,Cb as R,Db as a,Eb as l,F as Q,Fb as T,Jb as te,Kb as ne,Mb as D,Rc as Y,Sa as r,Tb as C,Ub as m,Vb as I,Wc as ie,Yb as v,Zb as c,_ as d,da as E,ea as O,gb as N,kc as G,nc as F,oc as w,pa as f,pc as V,ra as ee,sc as b,tc as y,uc as B,wb as g,xb as p}from"./chunk-UH2E7MMT.js";function Pe(o,t){o&1&&(a(0,"sh-icon",2),F(1,"x-bold"),l())}function Ae(o,t){o&1&&(a(0,"sh-icon",3),F(1,"list-bold"),l())}function he(o,t){if(o&1){let n=D();a(0,"button",1),c("click",function(){E(n);let i=S();return O(i.toggleNav())}),g(1,Pe,2,0,"sh-icon",2)(2,Ae,2,0,"sh-icon",3),l()}if(o&2){let n=S();r(),p(n.isNavOpen()?1:2)}}var $=class o{#e=d(Oe);isNavOpen=this.#e.isNavOpen;isMobile=this.#e.isMobile;toggleNav(){this.#e.toggleNav()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-mobile-menu-toggle"]],decls:1,vars:1,consts:[["shButton","",1,"small","toggle-sidebar","ghost"],["shButton","",1,"small","toggle-sidebar","ghost",3,"click"],[1,"cross"],[1,"burger"]],template:function(n,e){n&1&&g(0,he,3,1,"button",0),n&2&&p(e.isMobile()?0:-1)},dependencies:[A,P],styles:["[_nghost-%COMP%]{display:contents}.toggle-sidebar[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center}.toggle-sidebar[_ngcontent-%COMP%] .cross[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger[_ngcontent-%COMP%]{opacity:1;transition:opacity 124ms linear;margin:0}.toggle-sidebar[_ngcontent-%COMP%] .cross.hidden[_ngcontent-%COMP%], .toggle-sidebar[_ngcontent-%COMP%] .burger.hidden[_ngcontent-%COMP%]{opacity:0}"],changeDetection:0})};var Ne=()=>["/connect/logon"];function ve(o,t){o&1&&(C(0,0,1),T(1,"div",9),m())}function be(o,t){o&1&&(C(0,0,2),T(1,"div",10),m())}function ye(o,t){if(o&1){let n=D();a(0,"div",8),c("click",function(){E(n);let i=S();return O(i.resetAndRetry())}),C(1,0),g(2,ve,2,0)(3,be,2,0),m(),l()}if(o&2){let n=S();r(2),p(n.resetting()?2:3)}}function Be(o,t){o&1&&(a(0,"div",6),C(1,1),T(2,"div",11),m(),l()),o&2&&R("routerLink",H(1,Ne))}function ke(o,t){o&1&&(a(0,"div",6),C(1,2),T(2,"div",10),m(),l()),o&2&&R("routerLink",H(1,Ne))}function Le(o,t){if(o&1){let n=D();a(0,"div",7),C(1,3),a(2,"sh-icon",12),c("click",function(){E(n);let i=S();return O(i.cancel())}),l(),a(3,"div",13),c("click",function(){E(n);let i=S();return O(i.claim())}),l(),T(4,"div",14),m(),l()}}function Ge(o,t){if(o&1){let n=D();a(0,"div",8),c("click",function(){E(n);let i=S();return O(i.openConsole())}),C(1,4),T(2,"div",15),m(),l()}}var k=class o{#e=d(Ee);state=this.#e.state;resetting=f(!1);stateEffect=ee(()=>{let t=this.#e.state(),n=this.resetting();t==="registered"&&n&&(this.resetting.set(!1),this.#e.beginRemoteRegistration())});ngOnInit(){this.#e.refreshRemoteControlStatus()}claim(){let t=this.#e.claimUrl();t&&window.open(t,"_blank")}cancel(){this.#e.cancelRemoteRegistration()}resetAndRetry(){this.resetting.set(!0),this.#e.cancelRemoteRegistration()}openConsole(){this.#e.openConsole()}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-remote-connectivity-status"]],decls:5,vars:1,consts:()=>{let t;t=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF: Resetting ${"\uFFFD#1:1\uFFFD"}:START_TAG_DIV:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE: Click to connect ${"\uFFFD#1:2\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=v(t);let n;n=$localize` Connecting ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let e;e=$localize` Click to register ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`;let i;i=$localize`Cancel registration`;let s;s=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:x-circle${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:${"\uFFFD#3\uFFFD"}:START_TAG_DIV:Click to claim${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:${"\uFFFD#4\uFFFD"}:START_TAG_DIV_1:${"[\uFFFD/#3\uFFFD|\uFFFD/#4\uFFFD]"}:CLOSE_TAG_DIV:`,s=v(s);let u;return u=$localize` Connected ${"\uFFFD#2\uFFFD"}:START_TAG_DIV:${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_DIV:`,[t,n,e,s,u,[1,"connectivity-status"],[1,"connectivity-status",3,"routerLink"],[1,"connectivity-status","claim"],[1,"connectivity-status",3,"click"],[1,"status","blinking"],[1,"status"],[1,"status","warning","blinking"],["shTooltip",i,3,"click"],[1,"claim",3,"click"],[1,"status","success","blinking"],[1,"status","success"]]},template:function(n,e){if(n&1&&g(0,ye,4,1,"div",5)(1,Be,3,2,"div",6)(2,ke,3,2,"div",6)(3,Le,5,0,"div",7)(4,Ge,3,0,"div",5),n&2){let i=e.state()==="unknown"||e.state()==="inactive"||e.state()==="registeringfaulted",s=e.state()==="registeringfaulted",u=e.state()==="registering",_=e.state()==="registered",M=e.state()==="connected"||e.state()==="disabled"||e.state()==="connecting";p(s?0:u?1:i?2:_?3:M?4:-1)}},dependencies:[oe,P,ge],styles:["[_nghost-%COMP%]{display:flex;align-items:center;padding:0 .75rem}@media only screen and (max-width:768px){[_nghost-%COMP%]{padding:0}}.hide-text[_nghost-%COMP%]{font-size:0}.in-menu[_nghost-%COMP%]{padding:.75rem;border-bottom:1px solid var(--base-4)}.connectivity-status[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;cursor:pointer}.connectivity-status[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%]{display:flex;gap:.5rem;cursor:pointer}.connectivity-status.claim[_ngcontent-%COMP%]:hover{color:inherit}.connectivity-status.claim[_ngcontent-%COMP%] .claim[_ngcontent-%COMP%]:hover{color:var(--primary-8)}.connectivity-status.claim[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]:hover{color:var(--error-8)}.status[_ngcontent-%COMP%]{width:.625rem;height:.625rem;border-radius:50%;background-color:var(--base-4)}.status.success[_ngcontent-%COMP%]{background-color:var(--success-8)}.status.warning[_ngcontent-%COMP%]{background-color:var(--warn-8)}.status.blinking[_ngcontent-%COMP%]{animation:_ngcontent-%COMP%_blinking 1s infinite}@keyframes _ngcontent-%COMP%_blinking{0%{opacity:.2}50%{opacity:1}to{opacity:.2}}"],changeDetection:0})};var Me={Byte:"B",KByte:"KB",MByte:"MB",GByte:"GB",TByte:"TB",PByte:"PB"},xe=["mbps","gbps"],Ie=8,W=1024,U=W*1024,j=U*1024,Z=j*1024,Re=Z*1024,$e={B:1,KB:W,MB:U,GB:j,TB:Z,PB:Re},Ue=1e3,K=Ue*1e3,X=K*1e3,we=[{threshold:Re,unitPrefix:"PByte"},{threshold:Z,unitPrefix:"TByte"},{threshold:j,unitPrefix:"GByte"},{threshold:U,unitPrefix:"MByte"},{threshold:W,unitPrefix:"KByte"},{threshold:1,unitPrefix:"Byte"}],L=class o{#e=d(x);closed=ie();isSubmitting=f(!1);sizeOptions=f([...xe]);maxUpload=f(0);maxDownload=f(0);maxUploadUnit=f("mbps");maxDownloadUnit=f("mbps");ngOnInit(){this.init()}convertToBitsPerSecondUnits(t,n){let i=t*($e[n.toUpperCase()]||U)*Ie;return i===0?{value:0,unit:"mbps"}:i>=X?{value:parseFloat((i/X).toFixed(2)),unit:"gbps"}:{value:parseFloat((i/K).toFixed(2)),unit:"mbps"}}convertFromBitsPerSecondUnits(t,n){let e=0;switch(n){case"gbps":e=t*X;break;case"mbps":e=t*K;break}let i=e/Ie;if(i===0)return{valueForApi:0,unitPrefixForApi:"Byte"};for(let{threshold:s,unitPrefix:u}of we)if(i>=s)return{valueForApi:Math.round(i/s),unitPrefixForApi:u};return{valueForApi:Math.round(i),unitPrefixForApi:"Byte"}}init(){this.#e.getApiV1Serversettings().subscribe({next:t=>{let n=t?.["max-upload-speed"],e=t?.["max-download-speed"];if(n&&n!==""){let i=n.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(i){let s=parseFloat(i[1]),u=i[2],_=this.convertToBitsPerSecondUnits(s,u);this.maxUpload.set(_.value),this.maxUploadUnit.set(_.unit)}else console.warn("Unexpected max-upload-speed format from API:",n),this.resetUpload()}else this.resetUpload();if(e&&e!==""){let i=e.match(/^(\d+(?:\.\d+)?)([A-Za-z]+)$/);if(i){let s=parseFloat(i[1]),u=i[2],_=this.convertToBitsPerSecondUnits(s,u);this.maxDownload.set(_.value),this.maxDownloadUnit.set(_.unit)}else console.warn("Unexpected max-download-speed format from API:",e),this.resetDownload()}else this.resetDownload()},error:t=>{console.error("Failed to get server settings:",t),this.resetDownload(),this.resetUpload()}})}resetDownload(){this.maxDownload.set(0),this.maxDownloadUnit.set("mbps")}resetUpload(){this.maxUpload.set(0),this.maxUploadUnit.set("mbps")}blockDecimalKeys(t){if([".",","].includes(t.key))return t.preventDefault()}cleanupInputAfterPasting(t){t.preventDefault();let n=t.clipboardData?.getData("text/plain");if(!n)return;let e=n.replaceAll(/[\.,]/g,"");t.target.value=e}submit(){this.isSubmitting.set(!0);let t="",n="",e=this.maxUpload()??0,i=this.maxUploadUnit(),s=this.maxDownload()??0,u=this.maxDownloadUnit();if(e>0){let{valueForApi:_,unitPrefixForApi:M}=this.convertFromBitsPerSecondUnits(e,i),h=Me[M];h?t=`${_}${h}`:console.error(`Invalid unit prefix for API submission (upload): ${M}. Defaulting to empty string.`)}if(s){let{valueForApi:_,unitPrefixForApi:M}=this.convertFromBitsPerSecondUnits(s,u),h=Me[M];h?n=`${_}${h}`:console.error(`Invalid unit prefix for API submission (download): ${M}. Defaulting to empty string.`)}this.#e.patchApiV1Serversettings({requestBody:{"max-upload-speed":t,"max-download-speed":n}}).pipe(Q(()=>this.isSubmitting.set(!1))).subscribe({next:()=>{this.closed.emit(!0)},error:_=>{console.error("Failed to submit throttle settings:",_)}})}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-throttle-settings-dialog"]],outputs:{closed:"closed"},decls:26,vars:10,consts:()=>{let t;t=$localize`Throttle network speed`;let n;n=$localize`We will round bits to the nearest byte value.`;let e;e=$localize`Max upload speed`;let i;i=$localize`Max download speed`;let s;s=$localize`Cancel`;let u;return u=$localize` Update settings `,[t,n,e,i,s,u,["content",""],[1,"column"],[1,"field-row"],["type","number",3,"paste","keydown","ngModelChange","ngModel"],[3,"isClearable","options"],["type","text",3,"ngModelChange","ngModel"],["footer",""],["shButton","",3,"click"],["shButton","",1,"raised","primary",3,"click"]]},template:function(n,e){n&1&&(a(0,"header")(1,"h3"),I(2,0),l(),a(3,"p"),I(4,1),l()(),a(5,"div",6)(6,"div",7)(7,"div",8)(8,"label"),I(9,2),l(),a(10,"sh-form-field")(11,"input",9),c("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),B("ngModelChange",function(s){return y(e.maxUpload,s)||(e.maxUpload=s),s}),l()(),a(12,"sh-select",10)(13,"input",11),B("ngModelChange",function(s){return y(e.maxUploadUnit,s)||(e.maxUploadUnit=s),s}),l()()(),a(14,"div",8)(15,"label"),I(16,3),l(),a(17,"sh-form-field")(18,"input",9),c("paste",function(s){return e.cleanupInputAfterPasting(s)})("keydown",function(s){return e.blockDecimalKeys(s)}),B("ngModelChange",function(s){return y(e.maxDownload,s)||(e.maxDownload=s),s}),l()(),a(19,"sh-select",10)(20,"input",11),B("ngModelChange",function(s){return y(e.maxDownloadUnit,s)||(e.maxDownloadUnit=s),s}),l()()()()(),a(21,"footer",12)(22,"button",13),c("click",function(){return e.closed.emit(!1)}),I(23,4),l(),a(24,"button",14),c("click",function(){return e.submit()}),I(25,5),l()()),n&2&&(r(11),b("ngModel",e.maxUpload),r(),R("isClearable",!1)("options",e.sizeOptions()),r(),b("ngModel",e.maxUploadUnit),r(5),b("ngModel",e.maxDownload),r(),R("isClearable",!1)("options",e.sizeOptions()),r(),b("ngModel",e.maxDownloadUnit),r(4),G("loading",e.isSubmitting()))},dependencies:[ce,ae,re,le,_e,ue,de,A],styles:['[_nghost-%COMP%]{display:block}h3[_ngcontent-%COMP%]{font:var(--title-30)}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:flex-start;padding:1rem;gap:.5rem;margin-bottom:1rem}.column[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1rem}.field-row[_ngcontent-%COMP%]{display:grid;grid-template-areas:"label label" "input select";grid-template-columns:1fr auto;align-items:center;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{grid-area:label}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%]{grid-area:input}.field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{grid-area:select}'],changeDetection:0})};function Ve(o,t){o&1&&T(0,"app-remote-connectivity-status")}function He(o,t){if(o&1){let n=D();a(0,"button",7),c("click",function(){E(n);let i=S(2);return O(i.abort())}),C(1,1),T(2,"sh-icon"),m(),l()}}function Ye(o,t){if(o&1){let n=D();a(0,"button",7),c("click",function(){E(n);let i=S(2);return O(i.stop())}),C(1,2),T(2,"sh-icon"),m(),l()}}function ze(o,t){if(o&1&&g(0,He,3,0,"button",14)(1,Ye,3,0,"button",14),o&2){let n=S();p(n.isStopping()?0:1)}}function Je(o,t){o&1&&(C(0,0,1),T(1,"sh-icon"),m())}function Xe(o,t){o&1&&(C(0,0,2),T(1,"sh-icon"),m())}function Ke(o,t){o&1&&T(0,"app-remote-connectivity-status",10)}function We(o,t){o&1&&T(0,"app-remote-connectivity-status",12)}function je(o,t){if(o&1){let n=D();a(0,"button",13),c("click",function(){E(n);let i=S();return O(i.isStopping()?i.abort():i.stop())}),a(1,"sh-icon"),F(2),l(),F(3),l()}if(o&2){let n=S();r(2),w(n.isStopping()?"skull":"stop"),r(),V(" ",n.isStopping()?"Abort":"Stop"," ")}}var q=class o{#e=d(x);#t=d(me);#n=d(Te);#s=d(Ce);#i=d(se);#a=d(pe);#l=d(Fe);clientIsRunning=this.#t.clientIsRunning;isResuming=this.#t.isResuming;runningTask=Y(()=>this.#s.serverState()?.ActiveTask?.Item1);isStopping=Y(()=>this.runningTask()==this.#o());#o=f(-1);isUsingRelay=this.#i.relayIsEnabled;hideConsoleConnectionStatus=this.#l.isConsoleConnectionStatusHidden;openThrottleSettingsDialog(){this.#n.open(L,{maxWidth:"550px",width:"100%"})}openPauseDialog(){this.#n.open(De,{maxWidth:"550px",width:"100%"})}pauseResume(){if(this.clientIsRunning()){this.openPauseDialog();return}this.#t.pauseResume().subscribe()}stop(){let t=this.runningTask();t&&(this.#o.set(t),this.#e.postApiV1TaskByTaskidStop({taskid:t}).subscribe())}abort(){let t=this.runningTask();t&&this.#e.postApiV1TaskByTaskidAbort({taskid:t}).subscribe()}ngAfterViewInit(){let t=this.#i.relayIsEnabled()||!this.#a.hasWebSocket()?"longpoll":"websocket";this.#t.setConnectionMethod(t)}static \u0275fac=function(n){return new(n||o)};static \u0275cmp=N({type:o,selectors:[["app-status-bar"]],decls:31,vars:10,consts:()=>{let t;t=$localize`${"\uFFFD*9:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:pause${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Pause ${"\uFFFD/*9:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*10:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:play${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Resume ${"\uFFFD/*10:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=v(t);let n;n=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:skull${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Abort `;let e;return e=$localize`${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:stop${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON: Stop `,[t,n,e,[1,"current-backup"],[1,"global-progress"],[1,"current-backup-actions"],[1,"desktop-actions"],["shButton","",3,"click"],[1,"mobile-actions"],["shButton","",1,"small","menu-mobile-toggle"],[1,"hide-text"],["menu",""],[1,"in-menu"],[3,"click"],["shButton",""]]},template:function(n,e){n&1&&(a(0,"div",3),T(1,"app-mobile-menu-toggle")(2,"app-backup-progress",4),a(3,"div",5)(4,"div",6),g(5,Ve,1,0,"app-remote-connectivity-status"),g(6,ze,2,1),a(7,"button",7),c("click",function(){return e.pauseResume()}),C(8,0),g(9,Je,2,0)(10,Xe,2,0),m(),l(),a(11,"button",7),c("click",function(){return e.openThrottleSettingsDialog()}),a(12,"sh-icon"),F(13,"speedometer"),l()()(),a(14,"div",8)(15,"sh-menu")(16,"button",9),g(17,Ke,1,0,"app-remote-connectivity-status",10),a(18,"sh-icon"),F(19,"dots-three-vertical-bold"),l()(),te(20,11),g(21,We,1,0,"app-remote-connectivity-status",12),g(22,je,4,2,"button"),a(23,"button",13),c("click",function(){return e.pauseResume()}),a(24,"sh-icon"),F(25),l(),F(26),l(),a(27,"button",13),c("click",function(){return e.openThrottleSettingsDialog()}),a(28,"sh-icon"),F(29,"speedometer"),l(),F(30," Throttle Settings "),l(),ne(),l()()()()),n&2&&(r(5),p(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?5:-1),r(),p(e.runningTask()?6:-1),r(),G("loading",e.isResuming()),r(2),p(e.clientIsRunning()?9:10),r(8),p(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?17:-1),r(4),p(!e.isUsingRelay()&&!e.hideConsoleConnectionStatus()?21:-1),r(),p(e.runningTask()?22:-1),r(3),w(e.clientIsRunning()?"pause":"play"),r(),V(" ",e.clientIsRunning()?"Pause":"Resume"," "))},dependencies:[k,P,A,Se,$,fe],styles:["[_nghost-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:1rem;min-height:3.875rem;border-bottom:1px solid var(--base-4);position:sticky;top:0;z-index:2000;background:var(--base-1)}[_nghost-%COMP%]:has(sh-progress-bar){padding:1rem 1rem 1.5rem}.current-backup[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;width:100%;gap:.5rem}.global-progress[_ngcontent-%COMP%]{flex:1 0;min-width:18.75rem}.current-backup-actions[_ngcontent-%COMP%], .current-backup-actions[_ngcontent-%COMP%] .desktop-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}@media only screen and (max-width:768px){.current-backup-actions[_ngcontent-%COMP%] .desktop-actions[_ngcontent-%COMP%]{display:none}}.current-backup-actions[_ngcontent-%COMP%] .mobile-actions[_ngcontent-%COMP%]{display:none}@media only screen and (max-width:768px){.current-backup-actions[_ngcontent-%COMP%] .mobile-actions[_ngcontent-%COMP%]{display:flex}}.current-backup-actions[_ngcontent-%COMP%] .menu-mobile-toggle[_ngcontent-%COMP%]{position:relative}.current-backup-actions[_ngcontent-%COMP%] .menu-mobile-toggle[_ngcontent-%COMP%] app-remote-connectivity-status[_ngcontent-%COMP%]{position:absolute;top:-.25rem;right:-.25rem}.menu-status-item[_ngcontent-%COMP%]{padding:.5rem 1rem;display:flex;flex-direction:column;gap:.25rem;border-bottom:1px solid var(--base-4);margin-bottom:.25rem}.menu-status-item[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem;font-size:.875rem}"],changeDetection:0})};export{q as a};
package/index.html CHANGED
@@ -124,5 +124,5 @@
124
124
  <body>
125
125
  <app-root></app-root>
126
126
  <div class="loading">Connecting ...</div>
127
- <link rel="modulepreload" href="chunk-3XCT4PYH.js"><link rel="modulepreload" href="chunk-JTPUS6BT.js"><link rel="modulepreload" href="chunk-KHFOQETZ.js"><link rel="modulepreload" href="chunk-Y4EMWRGE.js"><link rel="modulepreload" href="chunk-XCVBN7EK.js"><link rel="modulepreload" href="chunk-ADB5QRUO.js"><link rel="modulepreload" href="chunk-22PELS6R.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-MRSBKQQM.js"><link rel="modulepreload" href="chunk-35APLYI4.js"><script src="polyfills-7RKI4BGK.js" type="module"></script><script src="main-SIS2YGAN.js" type="module"></script></body>
127
+ <link rel="modulepreload" href="chunk-3XCT4PYH.js"><link rel="modulepreload" href="chunk-J5TWEZOP.js"><link rel="modulepreload" href="chunk-KHFOQETZ.js"><link rel="modulepreload" href="chunk-I625OICV.js"><link rel="modulepreload" href="chunk-XCVBN7EK.js"><link rel="modulepreload" href="chunk-ADB5QRUO.js"><link rel="modulepreload" href="chunk-22PELS6R.js"><link rel="modulepreload" href="chunk-6Q6SSTBK.js"><link rel="modulepreload" href="chunk-MRSBKQQM.js"><link rel="modulepreload" href="chunk-35APLYI4.js"><script src="polyfills-7RKI4BGK.js" type="module"></script><script src="main-ZP6YWLCN.js" type="module"></script></body>
128
128
  </html>
@@ -1 +1 @@
1
- import{b as Ie,c as ke}from"./chunk-3XCT4PYH.js";import{a as we}from"./chunk-JTPUS6BT.js";import{a as Ee}from"./chunk-KHFOQETZ.js";import{b as I}from"./chunk-Y4EMWRGE.js";import"./chunk-XCVBN7EK.js";import{a as Me}from"./chunk-ADB5QRUO.js";import{b as Te}from"./chunk-22PELS6R.js";import{a as V}from"./chunk-6Q6SSTBK.js";import{a as Se}from"./chunk-MRSBKQQM.js";import"./chunk-35APLYI4.js";import"./chunk-LU7TIW3P.js";import"./chunk-XZNYCTQB.js";import{a as H}from"./chunk-R6TFME5I.js";import{a as h,b as ye,c as v,d as Re,e as E}from"./chunk-AZRNX5LU.js";import{u as be,x as Ce}from"./chunk-NCXKMSRH.js";import{a as ge,e as ve}from"./chunk-QAQMMCTH.js";import{c as le,d as me,g as de,h as ue,i as he,j as fe}from"./chunk-KHZ5AXGT.js";import{a as ne}from"./chunk-L2QOWZDR.js";import{a as re,b as se,c as ie,e as ae,f as pe,g as ce}from"./chunk-BRL4YYWO.js";import{ha as te,ma as oe}from"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{A as B,F as J,Fb as Y,L as T,Mc as Z,N as K,Nc as ee,V as C,Y as _,_ as s,f as F,g as W,gb as Q,ha as q,ia as z,l as $,m as G,pa as d,q as w,ra as X,z as P}from"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";var k=class e{#e=s(h);#d=s(v);ngOnInit(){ye(),this.#d.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Q({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(t,n){t&1&&Y(0,"router-outlet")},dependencies:[le],encapsulation:2})};var Ae={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new _("ENVIRONMENT");var A=class e{#e=s(ve);isLoaded=d(!1);webmodules=d(null);preload(o=!1){let t=this.#e.getApiV1Webmodules().pipe(K(n=>this.webmodules.set(n)),J(()=>this.isLoaded.set(!0)));if(o)return t;t.subscribe()}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ue=()=>{let e=s(E);return e.token()?!0:e.checkProxyAuthed().pipe(T(o=>o?$(!0):e.refreshToken().pipe(w(()=>!0))))},je=()=>{let e=s(v),o=s(I),t=s(q),n=e.relayIsEnabled()?"longpoll":"websocket",i=[t.get(H).preload(!0),t.get(H).preloadFilterGroups(!0),t.get(A).preload(!0)];return e.configLoaded===null?P(i).pipe(w(()=>n)):e.configLoaded?.pipe(T(()=>P(i)))},Fe=()=>!0,Ne={path:"connect/:typeParam",loadComponent:()=>import("./chunk-2D2IMXRC.js")},We=()=>{let e=s(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},Oe=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-S3FBC24H.js")},{path:"logout",loadComponent:()=>import("./chunk-OZEGNE5W.js")},{path:"",canActivate:[Ue],children:[{path:"",canActivate:[je,Fe,We],children:[{path:"welcome",loadComponent:()=>import("./chunk-GE3DHZ5E.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-5FQ5SDPZ.js")},Ne]},{path:"",loadComponent:()=>import("./chunk-TVA237PQ.js"),children:[{path:"",loadComponent:()=>import("./chunk-2JEQ7BV6.js")},Ne,{path:"destinations",loadComponent:()=>import("./chunk-ST6HBZ55.js")},{path:"add-backup",loadComponent:()=>import("./chunk-V2NDJVRA.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-3PUCEFO5.js")},{path:"backup/import",loadComponent:()=>import("./chunk-WALKMFYR.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-L26PO2OC.js"),loadChildren:()=>import("./chunk-IJY7JGOL.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-L26PO2OC.js"),loadChildren:()=>import("./chunk-IJY7JGOL.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-SI4C7DCS.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-7735MTTP.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-N5ZBB5VR.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-G6V7E6VM.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-QRLREAIK.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-NK2B3YKP.js")},{path:"from-config",loadComponent:()=>import("./chunk-AMSFSVKQ.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-QRABW3YV.js"),loadChildren:()=>import("./chunk-5ENU22GJ.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-QRABW3YV.js"),loadChildren:()=>import("./chunk-5ENU22GJ.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-QRABW3YV.js"),loadChildren:()=>import("./chunk-5ENU22GJ.js")},{path:"status",loadComponent:()=>import("./chunk-6EOMDYWB.js")},{path:"settings",loadComponent:()=>import("./chunk-WPVSY5MT.js")},{path:"about",loadComponent:()=>import("./chunk-CJVAK3WV.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-VDHWNNO7.js")},{path:"changelog",loadComponent:()=>import("./chunk-APAWDC4O.js")},{path:"libraries",loadComponent:()=>import("./chunk-DTIGWCAE.js")},{path:"system-info",loadComponent:()=>import("./chunk-2NLWVJNK.js")},{path:"server-settings",loadComponent:()=>import("./chunk-VI7MBIGT.js")},{path:"logs",loadChildren:()=>import("./chunk-EU6N52DH.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-J6WVOYQ6.js")}]}]}]}]}]}];var xe=(e,o)=>{let t=s(E),n=s(me),i=s(h),p=s(f),m=i.getItem("locale"),a=s(Ce),g=Ie(m),r=ge.BASE||"",c=e.url===`${r}/api/v1/auth/login`,u=e.url===`${r}/api/v1/auth/logout`,S=e.url===`${r}/api/v1/auth/refresh`,y=e.url===`${r}/api/v1/progressstate`,x=e.url===`${r}/api/v1/remoteoperation/test`,M=e.url===`${r}/api/v1/filesystem/validate`,De=e.url.startsWith(`${r}/api/v2/`),L=t.token(),U=e,j=e.headers.has("custom-proxy-check")||L===Re;if(L&&e.url.startsWith(r+p.baseUrl)&&!j){let l=e.headers.set("Authorization",`Bearer ${L}`);m&&m!=="en-US"&&(l=l.set("X-Ui-Language",g)),U=e.clone({headers:l})}return o(U).pipe(w(l=>{if(l.type===4&&l.status===200&&De){let b=l.body;if(b?.Success===!1)throw{status:200,message:b?.Error??"Unknown error",error:{Error:b?.Error??"Unknown error"},requestBody:b}}return l}),B(l=>{let b=l.error?.Error||`Error Code: ${l.status}, Message: ${l.message}`;if(!j){let R=!0;if((y&&l.status===404||x||M)&&(R=!1),S&&l.status===401&&(R=!1,t.logout(),n.navigate(["/logout"])),!c&&!S&&!u&&l.status===401)return R=!1,t.refreshToken().pipe(T(()=>o(e.clone({headers:e.headers.set("Authorization",`Bearer ${t.token()}`)}))));R&&a.error(b)}return G(()=>({error:l,message:b}))}))};var N=class e{#e=s(z);showError(o){let t=this.#e.querySelector("body > .loading");if(!t)return;t.classList.add("has-error"),t.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let i=this.#e.createElement("div");i.classList.add("loading-error"),i.textContent=o||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),t.append(n,i,p)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var $e="1.0.0",Le=`portal-proxy-client-${V()}`,Ge=1,O=class e{#e=1e3;#d=s(f);#u=s(N);#o=d("disconnected");#h=d(this.#e);#a=d(!1);#n=d(!1);#p=d(null);#c=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#l=[];#r={};#t=null;#f=new TextDecoder("utf-8");#m=null;#y=X(()=>{let o=this.#a(),t=this.#h(),n=this.#p(),i=this.#c();if(!n||!i||!o||!t||t<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n,i)},t)});#i(o){this.#s||(this.#s=!0,this.#u.showError(o||"Unable to connect to the server."))}#g(){this.#s||(this.#s=!0)}utf8Atob(o){let t=Uint8Array.from(atob(o),i=>i.charCodeAt(0)),n=this.#f.decode(t);return n?JSON.parse(n):null}connectToMachineServer(o,t,n){let i=n?.reconnect??!1,p=this.wsState();(p==="disconnected"||p==="error"||i)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(t),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#a.set(!1),this.#p.set(null),this.#c.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#p.set(o),this.#c.set(t),this.#a.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=m=>{let a=JSON.parse(m.data);if(this.wsState()==="connect"){if(a.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${a.type}'`);return}let r={token:o,publicKey:"",clientVersion:$e,protocolVersion:Ge},c=this.createResponse(a,"authportal",r);this.#o.set("welcome"),this.#t?.send(c)}else if(this.wsState()==="welcome"){if(a.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${a.type}'`);return}var g=JSON.parse(a.payload??"");if(g.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#l.length>0;){let r=this.#l.pop();r&&this.#r[r.messageId]&&this.activateCommand(r)}}else if(this.wsState()==="authenticated"){if(a.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${a.type}'`);return}let r=this.#r[a.messageId];if(r){if(a.errorMessage)this.#i(a.errorMessage),r.reject(a.errorMessage);else{let c=JSON.parse(a.payload??"");c.statusCode>=400?this.#i(c.body||`Initial request failed with status code ${c.statusCode}`):this.#g(),c.body=c?.body==null?null:this.utf8Atob(c.body),r.resolve(c)}delete this.#r[a.messageId],window.clearTimeout(r.timer)}}})}disconnectFromMachineServer(o=null){o&&console.error(o),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(o,t,n){let i={from:Le,to:o.from,type:t,messageId:o.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(o,t,n,i,p,m,a,g=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(o,n),new Promise((r,c)=>{let u=V(),y={from:Le,to:t,type:"command",messageId:u,payload:JSON.stringify({method:i,path:p,body:m,headers:a})},x={resolve:r,reject:c,timer:window.setTimeout(()=>{let M=this.#r[u];M&&(delete this.#r[u],this.#i("The request timed out before receiving a response."),M.reject("Timeout"))},g)};this.#r[u]=x,this.#n()?this.activateCommand(y):this.#l.push(y)})}activateCommand(o){this.#t?.send(JSON.stringify(o))}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};function Be(e){if(typeof e!="string")return null;let t=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...t))}function Pe(e,o,t){let n=e.relayconfigState.config();if(n===null)return t(o);let i=Be(o.body),p={};o.headers.keys().forEach(r=>{p[r]=o.headers.get(r)??""});let m=o.headers.get("timeout"),a=m!==null?parseInt(m):e.defaultTimeout;o.url.startsWith("/api/v1/serverstate")&&o.url.includes("longpoll=true")&&(a=1e3*99);let g=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,n.machineServerUrl,o.method,o.url,i,p,a);return new F(r=>{g.then(c=>{let u=new re;p!=null&&Object.keys(p).forEach(y=>{u.set(y,p[y])});let S=new se({body:c.body,status:c.statusCode,statusText:"OK",headers:u});r.next(S),r.complete()}).catch(c=>{r.error(new ie({error:c??"Unknown error",status:0,statusText:c??"Unknown error"}))})})}var He=(e,o)=>{let t={relayconfigState:s(v),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(O)},n=t.relayconfigState.config();if(t.relayconfigState.configLoaded!==null&&n===null){let i=new W;return t.relayconfigState.configLoaded.subscribe(p=>{p&&Pe(t,e,o).subscribe(i)}),i}return Pe(t,e,o)};var Ve={providers:[Z(),ue(Oe,fe(),he(de)),ae(ce(),pe([He,xe])),h,{provide:f,useValue:Ae},{provide:ee,useValue:ke()},{provide:be,useValue:{alertVariant:"simple"}},we,I,Te,oe,Se,te,Me,Ee]};ne(k,Ve);
1
+ import{b as Ie,c as ke}from"./chunk-3XCT4PYH.js";import{a as we}from"./chunk-J5TWEZOP.js";import{a as Ee}from"./chunk-KHFOQETZ.js";import{b as I}from"./chunk-I625OICV.js";import"./chunk-XCVBN7EK.js";import{a as Me}from"./chunk-ADB5QRUO.js";import{b as Te}from"./chunk-22PELS6R.js";import{a as V}from"./chunk-6Q6SSTBK.js";import{a as Se}from"./chunk-MRSBKQQM.js";import"./chunk-35APLYI4.js";import"./chunk-LU7TIW3P.js";import"./chunk-XZNYCTQB.js";import{a as H}from"./chunk-R6TFME5I.js";import{a as h,b as ye,c as v,d as Re,e as E}from"./chunk-AZRNX5LU.js";import{u as be,x as Ce}from"./chunk-NCXKMSRH.js";import{a as ge,e as ve}from"./chunk-QAQMMCTH.js";import{c as le,d as me,g as de,h as ue,i as he,j as fe}from"./chunk-KHZ5AXGT.js";import{a as ne}from"./chunk-L2QOWZDR.js";import{a as re,b as se,c as ie,e as ae,f as pe,g as ce}from"./chunk-BRL4YYWO.js";import{ha as te,ma as oe}from"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{A as B,F as J,Fb as Y,L as T,Mc as Z,N as K,Nc as ee,V as C,Y as _,_ as s,f as F,g as W,gb as Q,ha as q,ia as z,l as $,m as G,pa as d,q as w,ra as X,z as P}from"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";var k=class e{#e=s(h);#d=s(v);ngOnInit(){ye(),this.#d.fetchConfig(),this.#e.clearAllNotCurrentVersion()}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=Q({type:e,selectors:[["app-root"]],decls:1,vars:0,template:function(t,n){t&1&&Y(0,"router-outlet")},dependencies:[le],encapsulation:2})};var Ae={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new _("ENVIRONMENT");var A=class e{#e=s(ve);isLoaded=d(!1);webmodules=d(null);preload(o=!1){let t=this.#e.getApiV1Webmodules().pipe(K(n=>this.webmodules.set(n)),J(()=>this.isLoaded.set(!0)));if(o)return t;t.subscribe()}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var Ue=()=>{let e=s(E);return e.token()?!0:e.checkProxyAuthed().pipe(T(o=>o?$(!0):e.refreshToken().pipe(w(()=>!0))))},je=()=>{let e=s(v),o=s(I),t=s(q),n=e.relayIsEnabled()?"longpoll":"websocket",i=[t.get(H).preload(!0),t.get(H).preloadFilterGroups(!0),t.get(A).preload(!0)];return e.configLoaded===null?P(i).pipe(w(()=>n)):e.configLoaded?.pipe(T(()=>P(i)))},Fe=()=>!0,Ne={path:"connect/:typeParam",loadComponent:()=>import("./chunk-PBYZZEYM.js")},We=()=>{let e=s(h);return!e.getItem("locale")&&navigator.language&&e.setItem("locale",navigator.language),!0},Oe=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-S3FBC24H.js")},{path:"logout",loadComponent:()=>import("./chunk-OZEGNE5W.js")},{path:"",canActivate:[Ue],children:[{path:"",canActivate:[je,Fe,We],children:[{path:"welcome",loadComponent:()=>import("./chunk-GE3DHZ5E.js"),children:[{path:"",redirectTo:"select",pathMatch:"full"},{path:"select",loadComponent:()=>import("./chunk-5FQ5SDPZ.js")},Ne]},{path:"",loadComponent:()=>import("./chunk-EGTYGTQI.js"),children:[{path:"",loadComponent:()=>import("./chunk-CW43F6WE.js")},Ne,{path:"destinations",loadComponent:()=>import("./chunk-YHVGLFWL.js")},{path:"add-backup",loadComponent:()=>import("./chunk-CQYKOCGO.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-3PUCEFO5.js")},{path:"backup/import",loadComponent:()=>import("./chunk-WALKMFYR.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-Z7CZCI7E.js"),loadChildren:()=>import("./chunk-J5VU6VA4.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-Z7CZCI7E.js"),loadChildren:()=>import("./chunk-J5VU6VA4.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-VCIINZCU.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-JMLM4A3C.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-LQKECNBH.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-WIE7KXIC.js")},{path:"backup/:id/delete",loadComponent:()=>import("./chunk-QRLREAIK.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-T2X5J6MQ.js")},{path:"from-config",loadComponent:()=>import("./chunk-AMSFSVKQ.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-CFJXIOSV.js"),loadChildren:()=>import("./chunk-TGZAL6DJ.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-CFJXIOSV.js"),loadChildren:()=>import("./chunk-TGZAL6DJ.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-CFJXIOSV.js"),loadChildren:()=>import("./chunk-TGZAL6DJ.js")},{path:"status",loadComponent:()=>import("./chunk-R5OX4JTJ.js")},{path:"settings",loadComponent:()=>import("./chunk-V7UJAXBT.js")},{path:"about",loadComponent:()=>import("./chunk-XAYG4QT7.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-VDHWNNO7.js")},{path:"changelog",loadComponent:()=>import("./chunk-APAWDC4O.js")},{path:"libraries",loadComponent:()=>import("./chunk-DTIGWCAE.js")},{path:"system-info",loadComponent:()=>import("./chunk-2NLWVJNK.js")},{path:"server-settings",loadComponent:()=>import("./chunk-VI7MBIGT.js")},{path:"logs",loadChildren:()=>import("./chunk-EU6N52DH.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-J6WVOYQ6.js")}]}]}]}]}]}];var xe=(e,o)=>{let t=s(E),n=s(me),i=s(h),p=s(f),m=i.getItem("locale"),a=s(Ce),g=Ie(m),r=ge.BASE||"",c=e.url===`${r}/api/v1/auth/login`,u=e.url===`${r}/api/v1/auth/logout`,S=e.url===`${r}/api/v1/auth/refresh`,y=e.url===`${r}/api/v1/progressstate`,x=e.url===`${r}/api/v1/remoteoperation/test`,M=e.url===`${r}/api/v1/filesystem/validate`,De=e.url.startsWith(`${r}/api/v2/`),L=t.token(),U=e,j=e.headers.has("custom-proxy-check")||L===Re;if(L&&e.url.startsWith(r+p.baseUrl)&&!j){let l=e.headers.set("Authorization",`Bearer ${L}`);m&&m!=="en-US"&&(l=l.set("X-Ui-Language",g)),U=e.clone({headers:l})}return o(U).pipe(w(l=>{if(l.type===4&&l.status===200&&De){let b=l.body;if(b?.Success===!1)throw{status:200,message:b?.Error??"Unknown error",error:{Error:b?.Error??"Unknown error"},requestBody:b}}return l}),B(l=>{let b=l.error?.Error||`Error Code: ${l.status}, Message: ${l.message}`;if(!j){let R=!0;if((y&&l.status===404||x||M)&&(R=!1),S&&l.status===401&&(R=!1,t.logout(),n.navigate(["/logout"])),!c&&!S&&!u&&l.status===401)return R=!1,t.refreshToken().pipe(T(()=>o(e.clone({headers:e.headers.set("Authorization",`Bearer ${t.token()}`)}))));R&&a.error(b)}return G(()=>({error:l,message:b}))}))};var N=class e{#e=s(z);showError(o){let t=this.#e.querySelector("body > .loading");if(!t)return;t.classList.add("has-error"),t.innerHTML="";let n=this.#e.createElement("div");n.classList.add("loading-title"),n.textContent="Unable to connect";let i=this.#e.createElement("div");i.classList.add("loading-error"),i.textContent=o||"Unknown error";let p=this.#e.createElement("button");p.type="button",p.classList.add("retry-button"),p.textContent="Retry",p.addEventListener("click",()=>{this.#e.defaultView?.location.reload()}),t.append(n,i,p)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};var $e="1.0.0",Le=`portal-proxy-client-${V()}`,Ge=1,O=class e{#e=1e3;#d=s(f);#u=s(N);#o=d("disconnected");#h=d(this.#e);#a=d(!1);#n=d(!1);#p=d(null);#c=d(null);#s=!1;isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#o.asReadonly();#l=[];#r={};#t=null;#f=new TextDecoder("utf-8");#m=null;#y=X(()=>{let o=this.#a(),t=this.#h(),n=this.#p(),i=this.#c();if(!n||!i||!o||!t||t<this.#e){this.#m&&window.clearInterval(this.#m);return}this.#m=window.setInterval(()=>{this.connectToMachineServer(n,i)},t)});#i(o){this.#s||(this.#s=!0,this.#u.showError(o||"Unable to connect to the server."))}#g(){this.#s||(this.#s=!0)}utf8Atob(o){let t=Uint8Array.from(atob(o),i=>i.charCodeAt(0)),n=this.#f.decode(t);return n?JSON.parse(n):null}connectToMachineServer(o,t,n){let i=n?.reconnect??!1,p=this.wsState();(p==="disconnected"||p==="error"||i)&&(this.#t?.close(),this.#t=null),!this.#t&&(this.#s=!1,this.#t=new WebSocket(t),this.#o.set("connecting"),this.#t.onopen=()=>{this.#o.set("connect"),this.#n.set(!0),this.#a.set(!1),this.#p.set(null),this.#c.set(null)},this.#t.onclose=()=>{this.#o.set("disconnected"),this.#n.set(!1),this.#p.set(o),this.#c.set(t),this.#a.set(!0)},this.#t.onerror=()=>{this.#o.set("error")},this.#t.onmessage=m=>{let a=JSON.parse(m.data);if(this.wsState()==="connect"){if(a.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${a.type}'`);return}let r={token:o,publicKey:"",clientVersion:$e,protocolVersion:Ge},c=this.createResponse(a,"authportal",r);this.#o.set("welcome"),this.#t?.send(c)}else if(this.wsState()==="welcome"){if(a.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${a.type}'`);return}var g=JSON.parse(a.payload??"");if(g.accepted===!1){this.#i("Authentication failed"),this.disconnectFromMachineServer("Authentication failed");return}for(this.#o.set("authenticated"),this.#n.set(!0);this.#l.length>0;){let r=this.#l.pop();r&&this.#r[r.messageId]&&this.activateCommand(r)}}else if(this.wsState()==="authenticated"){if(a.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${a.type}'`);return}let r=this.#r[a.messageId];if(r){if(a.errorMessage)this.#i(a.errorMessage),r.reject(a.errorMessage);else{let c=JSON.parse(a.payload??"");c.statusCode>=400?this.#i(c.body||`Initial request failed with status code ${c.statusCode}`):this.#g(),c.body=c?.body==null?null:this.utf8Atob(c.body),r.resolve(c)}delete this.#r[a.messageId],window.clearTimeout(r.timer)}}})}disconnectFromMachineServer(o=null){o&&console.error(o),this.#t?.close(),this.#t=null,this.#o.set("disconnected"),this.#n.set(!1)}createResponse(o,t,n){let i={from:Le,to:o.from,type:t,messageId:o.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(o,t,n,i,p,m,a,g=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(o,n),new Promise((r,c)=>{let u=V(),y={from:Le,to:t,type:"command",messageId:u,payload:JSON.stringify({method:i,path:p,body:m,headers:a})},x={resolve:r,reject:c,timer:window.setTimeout(()=>{let M=this.#r[u];M&&(delete this.#r[u],this.#i("The request timed out before receiving a response."),M.reject("Timeout"))},g)};this.#r[u]=x,this.#n()?this.activateCommand(y):this.#l.push(y)})}activateCommand(o){this.#t?.send(JSON.stringify(o))}static \u0275fac=function(t){return new(t||e)};static \u0275prov=C({token:e,factory:e.\u0275fac,providedIn:"root"})};function Be(e){if(typeof e!="string")return null;let t=new TextEncoder().encode(e);return window.btoa(String.fromCharCode(...t))}function Pe(e,o,t){let n=e.relayconfigState.config();if(n===null)return t(o);let i=Be(o.body),p={};o.headers.keys().forEach(r=>{p[r]=o.headers.get(r)??""});let m=o.headers.get("timeout"),a=m!==null?parseInt(m):e.defaultTimeout;o.url.startsWith("/api/v1/serverstate")&&o.url.includes("longpoll=true")&&(a=1e3*99);let g=e.relayWebsocket.sendCommand(n.accessToken,n.clientId,n.machineServerUrl,o.method,o.url,i,p,a);return new F(r=>{g.then(c=>{let u=new re;p!=null&&Object.keys(p).forEach(y=>{u.set(y,p[y])});let S=new se({body:c.body,status:c.statusCode,statusText:"OK",headers:u});r.next(S),r.complete()}).catch(c=>{r.error(new ie({error:c??"Unknown error",status:0,statusText:c??"Unknown error"}))})})}var He=(e,o)=>{let t={relayconfigState:s(v),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(O)},n=t.relayconfigState.config();if(t.relayconfigState.configLoaded!==null&&n===null){let i=new W;return t.relayconfigState.configLoaded.subscribe(p=>{p&&Pe(t,e,o).subscribe(i)}),i}return Pe(t,e,o)};var Ve={providers:[Z(),ue(Oe,fe(),he(de)),ae(ce(),pe([He,xe])),h,{provide:f,useValue:Ae},{provide:ee,useValue:ke()},{provide:be,useValue:{alertVariant:"simple"}},we,I,Te,oe,Se,te,Me,Ee]};ne(k,Ve);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@duplicati/ngclient",
3
- "version": "0.0.212",
3
+ "version": "0.0.213",
4
4
  "license": "MIT",
5
5
  "contributors": [
6
6
  "sp90",
package/chunk-2D2IMXRC.js DELETED
@@ -1 +0,0 @@
1
- import{a as Q}from"./chunk-3AZTY4MH.js";import{a as H}from"./chunk-EQNDYV43.js";import"./chunk-35APLYI4.js";import{a as q}from"./chunk-YMUS7QSB.js";import"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import{B as X,C as z,H as K,L as j,c as B,e as U,i as G,s as W,v as V,w as J}from"./chunk-NCXKMSRH.js";import"./chunk-QAQMMCTH.js";import{d as A,e as I}from"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{$b as s,Cb as y,Db as r,Eb as l,Fb as T,Fc as $,Mb as f,Rc as O,Sa as a,Tb as S,Ub as P,Vb as p,Xc as v,Yb as D,Zb as h,_ as E,da as m,ea as F,gb as b,mc as x,nc as d,pa as N,ra as M,sc as w,tc as L,uc as k,wb as c,xb as _}from"./chunk-UH2E7MMT.js";import"./chunk-7CGTOI24.js";var Y=(t,n,e,i,o)=>({"loading-state":t,"ready-to-add-link":n,"is-connected":e,"failed-to-connect":i,"is-registered":o});function Z(t,n){t&1&&p(0,0,1)}function ee(t,n){t&1&&p(0,0,2)}function te(t,n){if(t&1){let e=f();r(0,"button",10),h("click",function(){m(e);let o=s(2);return F(o.cancel())}),d(1,"Cancel registration"),l()}}function ne(t,n){if(t&1&&(r(0,"div",7)(1,"p"),S(2,0),c(3,Z,1,0)(4,ee,1,0),P(),l(),T(5,"sh-progress-bar",8),c(6,te,2,0,"button",9),l()),t&2){let e=s();a(3),_(e.state()==="unknown"?3:4),a(3),_((e.registeringCounter()??0)>=5&&e.state()==="registering"?6:-1)}}function ie(t,n){if(t&1){let e=f();r(0,"sh-form-field")(1,"label",11),p(2,1),l(),r(3,"input",12),k("ngModelChange",function(o){m(e);let C=s();return L(C.customRegisterUrl,o)||(C.customRegisterUrl=o),F(o)}),l()(),r(4,"div",13)(5,"button",14),d(6,"Go back"),l(),r(7,"button",15),h("click",function(){m(e);let o=s();return F(o.registerViaCustomUrl())}),p(8,2),l()()}if(t&2){let e=s();a(3),w("ngModel",e.customRegisterUrl),a(4),y("disabled",!e.customRegisterUrlValid())}}function oe(t,n){if(t&1){let e=f();r(0,"p"),p(1,3),l(),T(2,"sh-progress-bar",8),r(3,"button",10),h("click",function(){m(e);let o=s(2);return F(o.retryWhenFaulted())}),d(4,"Cancel"),l()}}function re(t,n){if(t&1){let e=f();r(0,"p"),p(1,4),l(),r(2,"button",10),h("click",function(){m(e);let o=s(2);return F(o.retryWhenFaulted())}),d(3,"Retry"),l()}}function le(t,n){if(t&1&&c(0,oe,5,0)(1,re,4,0),t&2){let e=s();_(e.claimUrl()!==null?0:1)}}function ae(t,n){t&1&&(S(0,5,1),T(1,"p"),P())}function se(t,n){t&1&&(S(0,5,2),T(1,"p"),P())}function ce(t,n){if(t&1){let e=f();r(0,"sh-alert",16),S(1,5),c(2,ae,2,0,"p")(3,se,2,0,"p"),P(),l(),r(4,"button",10),h("click",function(){m(e);let o=s();return F(o.retryWhenFaulted())}),d(5," Retry "),r(6,"sh-icon"),d(7,"arrow-arc-left"),l()()}if(t&2){let e=s();a(2),_(e.typeParam()==="link"?2:3)}}function _e(t,n){t&1&&(r(0,"h3"),d(1,"Successfully connected"),l(),r(2,"p"),d(3,"We're going to redirect you to the home page"),l())}var R=class t{#t=E(A);#i=E(H);#e=E(Q);#n=E(q);isOldOpen=N(!1);typeParam=v.required();state=this.#e.state;claimUrl=this.#e.claimUrl;registerUrl=this.#e.registerUrl;customRegisterUrl=this.#e.customRegisterUrl;additionalReportingUrl=O(()=>{let n=this.#n.serverSettings();return this.#e.state()==="inactive"?"":n&&n["additional-report-url"]||""});copiedReportingUrl=N(!1);customRegisterUrlValid=O(()=>{let n=this.customRegisterUrl(),e=/^(?:http(s)?:\/\/)?[\w.-]+(?:\.[\w\.-]+)+[\w\-\._~:/?#[\]@!\$&'\(\)\*\+,;=.]+$/;return!(n.length===0||!e.test(n))});registeringCounter=N(null);didTry=!1;triedFinishConnection=!1;stateEffect=M(()=>{let n=this.#e.registerUrl(),e=this.state(),i=this.typeParam(),o=this.registeringCounter();e==="inactive"&&i==="logon"&&n!==""&&(this.didTry||(this.#e.beginRemoteRegistration(),this.didTry=!0)),e==="registered"&&this.claimUrl()!==null&&(this.triedFinishConnection||(this.triedFinishConnection=!0,this.#o())),e==="registering"?(o===null&&this.registeringCounter.set(0),setTimeout(()=>{this.registeringCounter.set((o??0)+1)},1e3)):this.registeringCounter.set(null),(e==="connected"||e==="disabled"||e==="connecting")&&this.#n.setShownWelcomePage().subscribe(()=>{this.#t.navigate([""])})});ngOnInit(){this.#e.refreshRemoteControlStatus()}#o(){let n=this.#e.claimUrl();this.#i.open(`${n}?closeAfterConnection=true`,"_blank")}registerViaCustomUrl(){this.#e.beginRemoteRegistration(!0)}retryWhenFaulted(){this.#e.cancelRemoteRegistration(),this.customRegisterUrl.set(""),this.didTry=!1,this.triedFinishConnection=!1,this.typeParam()==="logon"&&this.#t.navigate(["/welcome/select"])}cancel(){this.#e.cancelRemoteRegistration()}register(){this.#e.beginRemoteRegistration()}disable(){this.#e.disableRemoteControl()}enable(){this.#e.enableRemoteControl()}delete(){this.#e.deleteRemoteControl()}copyReportingUrl(){let n=this.additionalReportingUrl();n&&(this.copiedReportingUrl.set(!0),setTimeout(()=>this.copiedReportingUrl.set(!1),2e3),navigator.clipboard.writeText(n))}static \u0275fac=function(e){return new(e||t)};static \u0275cmp=b({type:t,selectors:[["app-connect"]],inputs:{typeParam:[1,"typeParam"]},decls:6,vars:13,consts:()=>{let n;n=$localize`${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF: Loading... ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*4:2\uFFFD"}:START_BLOCK_ELSE: Connecting to console ${"\uFFFD/*4:2\uFFFD"}:CLOSE_BLOCK_ELSE:`;let e;e=$localize`Paste registration URL here`;let i;i=$localize` Connect machine to console `;let o;o=$localize`We're now connecting you to the console`;let C;C=$localize`Something failed during registration we're missing claimUrl, please try again`;let u;return u=$localize` Failed to register ${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_PARAGRAPH: Check if the connection link are correct, alternatively it could be your internet connection or the service might be down ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_PARAGRAPH:${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_PARAGRAPH: There might be a problem with your internet connection or the service might be down, please try again later ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_PARAGRAPH:${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,u=D(u),[n,e,i,o,C,u,[1,"main-card","type-b"],[1,"loader-content"],[1,"primary","indeterminate"],["shButton",""],["shButton","",3,"click"],["for","remoteControlRegisterUrl"],["type","text","id","remoteControlRegisterUrl","name","remoteControlRegisterUrl",3,"ngModelChange","ngModel"],[1,"nav-buttons"],["type","button","shButton","","routerLink","/welcome",1,"raised"],["type","button","shButton","",1,"raised","primary",3,"click","disabled"],[1,"error"]]},template:function(e,i){if(e&1&&(r(0,"sh-card",6),c(1,ne,7,2,"div",7),c(2,ie,9,2),c(3,le,2,1),c(4,ce,8,1),c(5,_e,4,0),l()),e&2){let o=i.state()==="unknown"||i.typeParam()!=="link"&&i.state()==="inactive"||i.state()==="registering",C=i.typeParam()==="link"&&i.state()==="inactive",u=i.state()==="connected"||i.state()==="disabled"||i.state()==="connecting",g=i.state()==="registeringfaulted";x($(7,Y,o,C,u,g,i.state()==="registered")),a(),_(o?1:-1),a(),_(C?2:-1),a(),_(i.state()==="registered"?3:-1),a(),_(g?4:-1),a(),_(u?5:-1)}},dependencies:[I,W,B,U,G,K,X,j,z,J,V],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;height:100%;min-height:100%;width:100%;flex:1 0;overflow:hidden;padding:2rem}@media only screen and (max-width:768px){[_nghost-%COMP%]{padding:1rem}}.main-card[_ngcontent-%COMP%]{width:100%;height:100%;max-width:31.25rem;max-height:min-content;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;gap:1rem;padding:2rem}.main-card.failed-to-connect[_ngcontent-%COMP%] sh-alert[_ngcontent-%COMP%]{width:100%}.main-card.failed-to-connect[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{width:100%}.main-card.is-registered[_ngcontent-%COMP%], .main-card.is-connected[_ngcontent-%COMP%]{align-items:center}.loader-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:.5rem;width:100%}.loader-content[_ngcontent-%COMP%] sh-progress-bar[_ngcontent-%COMP%]{--pb-b: var(--base-3);border:1px solid var(--pb-b)}.field-row[_ngcontent-%COMP%]{display:flex;gap:.5rem;width:100%}.field-row[_ngcontent-%COMP%] sh-form-field[_ngcontent-%COMP%], .field-row[_ngcontent-%COMP%] sh-select[_ngcontent-%COMP%]{flex:1 0}.reporting-url[_ngcontent-%COMP%]{cursor:pointer;-webkit-user-select:none;user-select:none;margin-top:.25rem}.state[_ngcontent-%COMP%]{position:fixed;top:1rem;right:1rem;margin:0;color:var(--base-7);font-size:.75rem}.old[_ngcontent-%COMP%]{display:flex;flex-direction:column;position:relative;gap:.5rem;padding:1rem;border:1px solid var(--base-4);background:var(--base-1);position:fixed;top:0;right:0;bottom:0;width:35rem;transform:translate(100%)}.old.open[_ngcontent-%COMP%]{transform:translate(0)}.old[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;gap:.5rem;cursor:pointer;position:absolute;background-color:var(--base-1);border:1px solid var(--base-4);border-width:.0625rem 0 .0625rem .0625rem;width:2rem;height:2.5rem;border-radius:var(--shape-2) 0 0 var(--shape-2);top:3.75rem;left:-2rem;-webkit-user-select:none;user-select:none}.old[_ngcontent-%COMP%] .toggle[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{font-size:1rem}.nav-buttons[_ngcontent-%COMP%]{display:flex;gap:.5rem;flex-direction:row}"],changeDetection:0})};export{R as default};
package/chunk-3AZTY4MH.js DELETED
@@ -1 +0,0 @@
1
- import{a as p}from"./chunk-EQNDYV43.js";import{a as h}from"./chunk-35APLYI4.js";import{a as d}from"./chunk-YMUS7QSB.js";import{a as f}from"./chunk-R6TFME5I.js";import{z as u}from"./chunk-NCXKMSRH.js";import{d as m}from"./chunk-QAQMMCTH.js";import{Rc as g,V as a,_ as s,pa as o,ra as c}from"./chunk-UH2E7MMT.js";var R=class n{#s=s(p);#o=s(u);#e=s(m);#r=s(f);#n=s(d);repeatRegisterTimer=null;state=o("unknown");claimUrl=o(null);registerUrl=o("");customRegisterUrl=o("");status=g(()=>{let e=this.state();return e==="connecting"?$localize`Console connection is enabled but not connected`:e==="connected"?$localize`Connected to console`:e==="registering"?$localize`Registering machine...`:e==="registeringfaulted"?$localize`Registration failed`:e==="registered"?$localize`Registered, waiting for accept`:e==="disabled"?$localize`Console connection is configured but not enabled`:e==="unknown"?$localize`...loading...`:$localize`Console connection is not set up`});sysInfoEffect=c(()=>{let e=this.#r.systemInfo();e&&this.registerUrl.set(e.RemoteControlRegistrationUrl??"")});#t(e){e.RegistrationUrl&&this.claimUrl.set(e.RegistrationUrl),e.IsConnected?this.state.set("connected"):e.IsEnabled?this.state.set("connecting"):e.CanEnable?this.state.set("disabled"):e.IsRegisteringFaulted?this.state.set("registeringfaulted"):e.IsRegistering?e.RegistrationUrl!=null&&e.RegistrationUrl.trim().length>0?this.state.set("registered"):this.state.set("registering"):this.state.set("inactive");let i=this.state();this.repeatRegisterTimer!==null&&(clearTimeout(this.repeatRegisterTimer),this.repeatRegisterTimer=null),i==="registering"&&(this.repeatRegisterTimer=setTimeout(()=>{this.#e.postApiV1RemotecontrolRegisterWait().subscribe({next:t=>this.#t(t),error:t=>this.#i(t)})},5e3)),(i==="connecting"||i==="registered")&&(this.repeatRegisterTimer=setTimeout(()=>{this.#e.getApiV1RemotecontrolStatus().subscribe({next:t=>this.#t(t),error:t=>this.#i(t)})},5e3)),e.IsRegistering&&e.CanEnable&&this.#e.deleteApiV1RemotecontrolRegister().subscribe({next:t=>this.#t(t)})}#i(e){this.#e.getApiV1RemotecontrolStatus().subscribe({next:i=>{this.#t(i)}})}refreshRemoteControlStatus(){this.#e.getApiV1RemotecontrolStatus().subscribe({next:e=>this.#t(e),error:e=>this.#i(e)})}beginRemoteRegistration(e=!1){this.state.set("registering"),this.#e.postApiV1RemotecontrolRegister({requestBody:{RegistrationUrl:e?this.customRegisterUrl():this.registerUrl()}}).subscribe({next:i=>this.#t(i),error:i=>this.#i(i)})}cancelRemoteRegistration(){this.#e.deleteApiV1RemotecontrolRegister().subscribe({next:e=>this.#t(e),error:e=>this.#i(e)})}enableRemoteControl(){this.#e.postApiV1RemotecontrolEnable().subscribe({next:e=>this.#t(e),error:e=>this.#i(e)})}disableRemoteControl(){this.#e.postApiV1RemotecontrolDisable().subscribe({next:e=>this.#t(e),error:e=>this.#i(e)})}deleteRemoteControl(){let e=this;this.#o.open(h,{data:{title:$localize`Confirm delete`,message:$localize`Are you sure you want to delete the console registration?`,confirmText:$localize`Delete registration`,cancelText:$localize`Cancel`},closed:i=>{i&&e.#e.deleteApiV1RemotecontrolRegistration().subscribe({next:t=>e.#t(t),error:t=>e.#i(t)})}})}openConsole(e="/app/machines",i){let t=this.#n.serverSettings(),b=this.#r.systemInfo(),r="https://app.duplicati.com",l=b?.RemoteControlDashboardUrl??"";if(l.length>0&&(r=l),t&&t["remote-control-dashboard-url"]&&(r=t["remote-control-dashboard-url"]),r=new URL(r).origin+e,i){let S=new URLSearchParams(i);r+=`?${S.toString()}`}this.#s.open(r,"_blank")}static \u0275fac=function(i){return new(i||n)};static \u0275prov=a({token:n,factory:n.\u0275fac,providedIn:"root"})};export{R as a};
package/chunk-5ENU22GJ.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-CNYY7AQK.js")},{path:"encryption",loadComponent:()=>import("./chunk-36UMECQ6.js")},{path:"select-files",loadComponent:()=>import("./chunk-WT5O6MNC.js")},{path:"options",loadComponent:()=>import("./chunk-HVFJYWAN.js")},{path:":taskid/progress",loadComponent:()=>import("./chunk-2A5USVIH.js")}],t=o;export{t as default};
package/chunk-IJY7JGOL.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-7CGTOI24.js";var o=[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-VEXVMT3W.js")},{path:"destination",loadComponent:()=>import("./chunk-5RK6PXUG.js")},{path:"source-data",loadComponent:()=>import("./chunk-PHN2W7W7.js")},{path:"schedule",loadComponent:()=>import("./chunk-WLU7TGVD.js")},{path:"options",loadComponent:()=>import("./chunk-STGN2W4U.js")}];export{o as default};
package/chunk-SI4C7DCS.js DELETED
@@ -1 +0,0 @@
1
- import{a as en}from"./chunk-52REVNJZ.js";import"./chunk-GO22QPW4.js";import"./chunk-FMDSOHVR.js";import"./chunk-AOMXVXMB.js";import{a as ee}from"./chunk-KHFOQETZ.js";import"./chunk-Y4EMWRGE.js";import{a as Ce}from"./chunk-XCVBN7EK.js";import"./chunk-ADB5QRUO.js";import"./chunk-22PELS6R.js";import"./chunk-6Q6SSTBK.js";import{a as Z}from"./chunk-MRSBKQQM.js";import"./chunk-3AZTY4MH.js";import"./chunk-EQNDYV43.js";import"./chunk-35APLYI4.js";import"./chunk-LU7TIW3P.js";import"./chunk-YMUS7QSB.js";import{b as Ze,c as ge}from"./chunk-ZXQSQRKN.js";import"./chunk-XZNYCTQB.js";import"./chunk-R6TFME5I.js";import"./chunk-AZRNX5LU.js";import{B as de,E as je,G as qe,L as pe,U as Qe,V as Ye,v as q}from"./chunk-NCXKMSRH.js";import{d as Ee}from"./chunk-QAQMMCTH.js";import{b as We,e as He}from"./chunk-KHZ5AXGT.js";import"./chunk-L2QOWZDR.js";import"./chunk-BRL4YYWO.js";import{ha as j,ka as ue}from"./chunk-BDQJFOCO.js";import"./chunk-FSHBOASN.js";import{$b as u,Ab as X,Bb as z,Cb as B,Db as a,Eb as o,F as ke,Fb as c,Gc as E,Hc as D,Ic as I,Jb as P,Jc as K,Kb as A,L as Ue,Mb as h,Rc as ce,Sa as _,Tb as L,Tc as Ve,Ub as m,Vb as s,Wb as d,Xb as p,Xc as Fe,Yb as y,Zb as b,_ as U,da as $,ea as f,gb as H,kc as Y,nc as C,oc as V,p as be,pa as R,pc as w,q as W,qc as we,rc as Ke,sc as Je,tc as Xe,uc as ze,vc as re,wb as g,wc as se,xb as T,xc as k,yb as J}from"./chunk-UH2E7MMT.js";import{a as le}from"./chunk-7CGTOI24.js";function on(i,t){i&1&&c(0,"sh-progress-bar",36)}function an(i,t){i&1&&c(0,"div",39)}function _n(i,t){i&1&&c(0,"div",39)}function ln(i,t){i&1&&c(0,"div",40)}function rn(i,t){i&1&&c(0,"div",41)}function sn(i,t){if(i&1&&(a(0,"details",50)(1,"summary"),L(2,15),c(3,"sh-icon"),a(4,"div",52),c(5,"sh-icon",44),o(),m(),o(),a(6,"div",53)(7,"p"),s(8,16),E(9,"date"),o(),a(10,"p"),s(11,17),E(12,"date"),o(),a(13,"p"),s(14,18),E(15,"durationFormat"),o(),a(16,"p"),s(17,19),o(),c(18,"sh-divider"),a(19,"p"),s(20,20),o(),a(21,"p"),s(22,21),o()()(),a(23,"details",50)(24,"summary"),L(25,22),c(26,"sh-icon"),a(27,"div",52),c(28,"sh-icon",44),o(),m(),o(),a(29,"div",53)(30,"p"),s(31,23),E(32,"date"),o(),a(33,"p"),s(34,24),E(35,"date"),o(),a(36,"p"),s(37,25),E(38,"durationFormat"),o(),c(39,"sh-divider"),a(40,"p"),s(41,26),E(42,"bytes"),o(),a(43,"p"),s(44,27),E(45,"bytes"),o(),a(46,"p"),s(47,28),E(48,"bytes"),o(),c(49,"sh-divider"),a(50,"p"),s(51,29),o(),a(52,"p"),s(53,30),o()()()),i&2){let e=u(2).$implicit;_(9),d(I(9,17,e.data==null||e.data.TestResults==null?null:e.data.TestResults.BeginTime,"medium")),p(8),_(3),d(I(12,20,e.data==null||e.data.TestResults==null?null:e.data.TestResults.EndTime,"medium")),p(11),_(3),d(D(15,23,e.data==null||e.data.TestResults==null?null:e.data.TestResults.Duration)),p(14),_(2),d(e.data==null||e.data.TestResults==null?null:e.data.TestResults.VerificationsActualLength),p(17),_(3),d(e.data==null||e.data.TestResults==null?null:e.data.TestResults.WarningsActualLength),p(20),_(2),d(e.data==null||e.data.TestResults==null?null:e.data.TestResults.ErrorsActualLength),p(22),_(10),d(I(32,25,e.data==null||e.data.CompactResults==null?null:e.data.CompactResults.BeginTime,"medium")),p(31),_(3),d(I(35,28,e.data==null||e.data.CompactResults==null?null:e.data.CompactResults.EndTime,"medium")),p(34),_(3),d(D(38,31,e.data==null||e.data.CompactResults==null?null:e.data.CompactResults.Duration)),p(37),_(4),d(e.data==null||e.data.CompactResults==null?null:e.data.CompactResults.DeletedFileCount)(K(42,33,e.data==null||e.data.CompactResults==null?null:e.data.CompactResults.DeletedFileSize,!0,!0)),p(41),_(3),d(e.data==null||e.data.CompactResults==null?null:e.data.CompactResults.DownloadedFileCount)(K(45,37,e.data==null||e.data.CompactResults==null?null:e.data.CompactResults.DownloadedFileSize,!0,!0)),p(44),_(3),d(e.data==null||e.data.CompactResults==null?null:e.data.CompactResults.UploadedFileCount)(K(48,41,e.data==null||e.data.CompactResults==null?null:e.data.CompactResults.UploadedFileSize,!0,!0)),p(47),_(3),d(e.data==null||e.data.CompactResults==null?null:e.data.CompactResults.WarningsActualLength),p(51),_(2),d(e.data==null||e.data.CompactResults==null?null:e.data.CompactResults.ErrorsActualLength),p(53)}}function cn(i,t){if(i&1&&(a(0,"code"),C(1),E(2,"json"),o()),i&2){let e=t.$implicit;_(),V(D(2,1,e))}}function Fn(i,t){if(i&1&&(a(0,"details",50)(1,"summary"),L(2,31),c(3,"sh-icon"),a(4,"div",52),c(5,"sh-icon",44),o(),m(),o(),a(6,"div",53),X(7,cn,3,3,"code",null,J),o()()),i&2){let e=u(2).$implicit;_(5),d(e.data.VerificationsActualLength),p(2),_(2),z(e.data.Verifications)}}function un(i,t){i&1&&(a(0,"sh-icon"),C(1,"check"),o())}function dn(i,t){i&1&&(a(0,"sh-icon"),C(1,"copy"),o())}function pn(i,t){i&1&&(P(0),L(1,32),c(2,"sh-icon"),m(),A())}function En(i,t){i&1&&(P(0),L(1,33),c(2,"sh-icon"),m(),A())}function Cn(i,t){i&1&&(P(0),L(1,34),c(2,"sh-icon"),m(),A())}function gn(i,t){if(i&1){let e=h();a(0,"button",57),b("click",function(){$(e),u();let l=k(0),r=u(3);return f(r.toggleWarningSuppression(l.MessageId))}),g(1,pn,3,0,"ng-container")(2,En,3,0,"ng-container")(3,Cn,3,0,"ng-container"),o()}if(i&2){u();let e=k(0),n=u(3),l=n.isWarningSuppressed(e.MessageId);B("disabled",n.isSuppressingWarning()),_(),T(n.isSuppressingWarning()?1:l?2:3)}}function Tn(i,t){if(i&1){let e=h();re(0),a(1,"div",54)(2,"code"),C(3),o(),a(4,"button",55),b("click",function(l){let r=$(e).$implicit,O=u(3);return f(O.copyToClipboard(l,r,r))}),C(5," Copy "),g(6,un,2,0,"sh-icon")(7,dn,2,0,"sh-icon"),o(),g(8,gn,4,2,"button",56),o()}if(i&2){let e=t.$implicit,n=u(3),l=se(n.parseWarning(e));_(3),V(e),_(3),T(n.copied()==e?6:7),_(2),T(l!=null&&l.MessageId?8:-1)}}function On(i,t){i&1&&(a(0,"p"),C(1,"No errors"),o())}function Sn(i,t){i&1&&(L(0,35,1),c(1,"sh-icon"),m())}function Ln(i,t){i&1&&(L(0,35,2),c(1,"sh-icon"),m())}function mn(i,t){if(i&1){let e=h();a(0,"div",54)(1,"code"),C(2),o(),a(3,"button",55),b("click",function(l){let r=$(e).$implicit,O=u(3);return f(O.copyToClipboard(l,r,r))}),L(4,35),g(5,Sn,2,0,"sh-icon")(6,Ln,2,0,"sh-icon"),m(),o()()}if(i&2){let e=t.$implicit,n=u(3);_(2),V(e),_(3),T(n.copied()==e?5:6)}}function Nn(i,t){i&1&&(a(0,"sh-icon"),C(1,"check"),o())}function Gn(i,t){i&1&&(a(0,"sh-icon"),C(1,"copy"),o())}function Pn(i,t){if(i&1){let e=h();a(0,"section",45)(1,"sh-toggle-card",46),P(2,47),a(3,"h3"),s(4,0),o(),A(),P(5,48),a(6,"p"),s(7,1),E(8,"date"),o(),a(9,"p"),s(10,2),E(11,"date"),o(),a(12,"p"),s(13,3),E(14,"durationFormat"),o(),A(),o(),a(15,"sh-toggle-card",46),P(16,47),a(17,"h3"),s(18,4),o(),A(),P(19,48),a(20,"p"),s(21,5),E(22,"bytes"),o(),a(23,"p"),s(24,6),E(25,"bytes"),o(),a(26,"p"),s(27,7),E(28,"bytes"),o(),a(29,"p"),s(30,8),E(31,"bytes"),o(),a(32,"p"),s(33,9),o(),a(34,"p"),s(35,10),o(),a(36,"p"),s(37,11),o(),A(),o(),a(38,"div",49),c(39,"sh-divider"),g(40,sn,54,45),g(41,Fn,9,1,"details",50),a(42,"details",51)(43,"summary"),L(44,12),c(45,"sh-icon"),a(46,"div",52),c(47,"sh-icon",44),o(),m(),o(),a(48,"div",53),X(49,Tn,9,4,"div",54,J),o()(),a(51,"details",51)(52,"summary"),L(53,13),c(54,"sh-icon"),a(55,"div",52),c(56,"sh-icon",44),o(),m(),o(),a(57,"div",53),g(58,On,2,0,"p"),X(59,mn,7,2,"div",54,J),o()(),c(61,"sh-divider"),a(62,"details")(63,"summary"),L(64,14),c(65,"sh-icon"),a(66,"div",52),c(67,"sh-icon",44),o(),m(),o(),a(68,"code")(69,"button",55),b("click",function(l){$(e);let r=u().$implicit,O=u();return f(O.copyToClipboard(l,O.stringify(r.data),"all"))}),C(70," Copy "),g(71,Nn,2,0,"sh-icon")(72,Gn,2,0,"sh-icon"),o(),C(73),E(74,"json"),o()()()()}if(i&2){let e=u().$implicit,n=u();_(),B("disableToggle",!0),_(7),d(I(8,25,e.data==null?null:e.data.BeginTime,"medium")),p(7),_(3),d(I(11,28,e.data==null?null:e.data.EndTime,"medium")),p(10),_(3),d(D(14,31,e.data==null?null:e.data.Duration)),p(13),_(),B("disableToggle",!0),_(7),d(e.data==null?null:e.data.ExaminedFiles)(K(22,33,e.data==null?null:e.data.SizeOfExaminedFiles,!0,!0)),p(21),_(3),d(e.data==null?null:e.data.OpenedFiles)(K(25,37,e.data==null?null:e.data.SizeOfOpenedFiles,!0,!0)),p(24),_(3),d(e.data==null?null:e.data.AddedFiles)(K(28,41,e.data==null?null:e.data.SizeOfAddedFiles,!0,!0)),p(27),_(3),d(e.data==null?null:e.data.ModifiedFiles)(K(31,45,e.data==null?null:e.data.SizeOfModifiedFiles,!0,!0)),p(30),_(2),d(e.data==null?null:e.data.DeletedFiles),p(33),_(2),d(e.data==null?null:e.data.TooLargeFiles),p(35),_(2),d(e.data==null?null:e.data.FilesWithError),p(37),_(3),T(e.data!=null&&e.data.TestResults?40:-1),_(),T((e.data==null?null:e.data.MainOperation)==="Test"?41:-1),_(),B("open",e.id===n.openEntry()&&n.openSection()==="warnings"),_(5),d(e.data==null?null:e.data.WarningsActualLength),p(44),_(2),z(e.data==null?null:e.data.Warnings),_(2),B("open",e.id===n.openEntry()&&n.openSection()==="errors"),_(5),d(e.data==null?null:e.data.ErrorsActualLength),p(53),_(2),T((e.data==null||e.data.Errors==null?null:e.data.Errors.length)===0?58:-1),_(),z(e.data==null?null:e.data.Errors),_(12),T(n.copied()=="all"?71:72),_(2),w(" ",D(74,49,e.data)," ")}}function An(i,t){if(i&1){let e=h();a(0,"article",37)(1,"header",38),b("click",function(){let l=$(e).$implicit,r=u();return f(r.toggleOpenEntry(l))}),g(2,an,1,0,"div",39)(3,_n,1,0,"div",39)(4,ln,1,0,"div",40)(5,rn,1,0,"div",41),a(6,"h3"),C(7),E(8,"date"),o(),a(9,"p"),C(10),o(),c(11,"div",42),a(12,"div",43)(13,"sh-icon",44),C(14,"caret-down"),o()()(),g(15,Pn,75,51,"section",45),o()}if(i&2){let e=t.$implicit,n=u(),l=(e.data==null?null:e.data.ParsedResult)||"Unknown";_(2),T(l=="Fatal"?2:l=="Error"?3:l=="Warning"?4:5),_(5),V(I(8,7,e.timestamp,"medium")),_(3),we(" ",e.data==null?null:e.data.MainOperation," ",n.getLocalizedSummary(e)," "),_(3),Y("open",e.id===n.openEntry()),_(2),T(e.id===n.openEntry()?15:-1)}}var Te=class i{#e=U(Ee);#n=U(Ce);#t=new Z;#i=new ee;backupId=Fe.required();isSuppressingWarning=R(!1);copied=R(null);backupResource=Ve({params:()=>({id:this.backupId()}),loader:({params:t})=>be(this.#e.getApiV1BackupById({id:t.id}))});suppressedWarningIds=ce(()=>{let t=this.backupResource.value();if(!t?.Backup?.Settings)return new Set;let e=t.Backup.Settings.find(n=>n.Name==="--suppress-warnings");return e?.Value?new Set(e.Value.split(",").map(n=>n.trim()).filter(Boolean)):new Set});openEntry=R(null);openSection=R(null);pagination=R({offset:0,pagesize:100});resource=ge({params:()=>le({id:this.backupId()},this.pagination()),stream:({params:t})=>this.#e.getApiV1BackupByIdLog({id:t.id,pagesize:100}).pipe(W(e=>e.map(n=>({id:n.ID,operationId:n.OperationID,timestamp:n.Timestamp*1e3,type:n.Type,data:JSON.parse(n.Message),exception:JSON.stringify(n.Exception)==="{}"?null:n.Exception}))))});getLocalizedSummary(t){let e=t.data?.ErrorsActualLength??0,n=t.data?.WarningsActualLength??0,l=[];if(t.data?.MainOperation=="Backup"){if(t.data?.Duration){let r=this.#i.transform(t.data?.Duration,!0);r.startsWith("0h ")&&(r=r.slice(3)),r.startsWith("0m ")&&(r=r.slice(3)),l.push($localize`took ${r}`)}t.data?.BackendStatistics?.BytesUploaded&&l.push($localize`uploaded ${this.#t.transform(t.data?.BackendStatistics?.BytesUploaded)}`),t.data?.BackendStatistics?.KnownFileSize&&l.push($localize`backup size ${this.#t.transform(t.data?.BackendStatistics?.KnownFileSize)}`)}return e!==0&&l.push($localize`:@@errorCount:${e} error${e===1?"":"s"}`),n!==0&&l.push($localize`:@@warningCount:${n} warning${n===1?"":"s"}`),l.length===0?"":`(${l.join(", ")})`}toggleOpenEntry(t){let e=t.id;if(this.openEntry()===e){this.openEntry.set(null),this.openSection.set(null);return}let n=t.data?.ErrorsActualLength??0,l=t.data?.WarningsActualLength??0;n>0?this.openSection.set("errors"):l>0?this.openSection.set("warnings"):this.openSection.set(null),this.openEntry.set(e)}parseWarning(t){let e=t.match(/^(.*?) - \[(.*?)-(.*?)-(.*?)\]: (.*)$/);if(!e)return null;let[,n,l,r,O,N]=e;return{Timestamp:n,LogLevel:l,Source:r,MessageId:O,Message:N}}isWarningSuppressed(t){return this.suppressedWarningIds().has(t)}toggleWarningSuppression(t){let e=this.backupId();!e||!t||(this.isSuppressingWarning.set(!0),this.#e.getApiV1BackupById({id:e}).pipe(Ue(n=>{let l=n.Backup?.Settings??[],r=l.findIndex(S=>S.Name==="--suppress-warnings"),O=this.isWarningSuppressed(t),N="";if(r>=0){let M=(l[r].Value??"").split(",").map(v=>v.trim()).filter(Boolean);O?M=M.filter(v=>v!==t):M.includes(t)||M.push(t),N=M.join(",")}else O||(N=t);let x=l.map(S=>({Name:S.Name,Value:S.Value,Filter:S.Filter}));return r>=0?N===""?x.splice(r,1):x[r]={Name:"--suppress-warnings",Value:N,Filter:null}:N!==""&&x.push({Name:"--suppress-warnings",Value:N,Filter:null}),this.#e.putApiV1BackupById({id:e,requestBody:{Backup:{Name:n.Backup?.Name,Description:n.Backup?.Description,DBPath:n.Backup?.DBPath,Tags:n.Backup?.Tags??[],TargetURL:n.Backup?.TargetURL,ConnectionStringID:n.Backup?.ConnectionStringID,Sources:n.Backup?.Sources??[],Settings:x,Filters:n.Backup?.Filters?.map(S=>({Expression:S.Expression,Include:S.Include,Order:S.Order})),Metadata:n.Backup?.Metadata??{},AdditionalTargetURLs:n.Backup?.AdditionalTargetURLs?.map(S=>({TargetUrl:S.TargetUrl,UrlKey:S.UrlKey,Mode:S.Mode,Interval:S.Interval,ConnectionStringID:S.ConnectionStringID,Options:S.Options}))},Schedule:n.Schedule?{Repeat:n.Schedule.Repeat,Time:n.Schedule.Time,AllowedDays:n.Schedule.AllowedDays}:void 0}})}),ke(()=>this.isSuppressingWarning.set(!1))).subscribe({next:()=>{this.#n.getBackups(!0),this.backupResource.reload()},error:n=>{console.error("Failed to toggle warning suppression:",n)}}))}copyToClipboard(t,e,n){t.stopPropagation(),navigator.clipboard.writeText(e),this.copied.set(n),setTimeout(()=>{this.copied.set(null)},2e3)}stringify(t){return JSON.stringify(t,null,2)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=H({type:i,selectors:[["app-general-log"]],inputs:{backupId:[1,"backupId"]},decls:3,vars:1,consts:()=>{let t;t=$localize`Time`;let e;e=$localize`Start: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let n;n=$localize`End: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let l;l=$localize`Duration: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let r;r=$localize`Source files`;let O;O=$localize` Evaluated: ${"\uFFFD0\uFFFD"}:INTERPOLATION: (${"\uFFFD1\uFFFD"}:INTERPOLATION_1:) `;let N;N=$localize`Opened: ${"\uFFFD0\uFFFD"}:INTERPOLATION: (${"\uFFFD1\uFFFD"}:INTERPOLATION_1:)`;let x;x=$localize`Added: ${"\uFFFD0\uFFFD"}:INTERPOLATION: (${"\uFFFD1\uFFFD"}:INTERPOLATION_1:)`;let S;S=$localize` Modified: ${"\uFFFD0\uFFFD"}:INTERPOLATION: (${"\uFFFD1\uFFFD"}:INTERPOLATION_1:) `;let M;M=$localize`Deleted: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let v;v=$localize`Too large: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let Q;Q=$localize`Files with error: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let G;G=$localize`${"\uFFFD#45\uFFFD"}:START_TAG_SH_ICON:warning-circle${"[\uFFFD/#45\uFFFD|\uFFFD/#47\uFFFD]"}:CLOSE_TAG_SH_ICON: Warnings ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#46\uFFFD"}:START_TAG_DIV:${"\uFFFD#47\uFFFD"}:START_TAG_SH_ICON_1:caret-down${"[\uFFFD/#45\uFFFD|\uFFFD/#47\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#46\uFFFD"}:CLOSE_TAG_DIV:`,G=y(G);let ne;ne=$localize`${"\uFFFD#54\uFFFD"}:START_TAG_SH_ICON:warning${"[\uFFFD/#54\uFFFD|\uFFFD/#56\uFFFD]"}:CLOSE_TAG_SH_ICON: Errors ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#55\uFFFD"}:START_TAG_DIV:${"\uFFFD#56\uFFFD"}:START_TAG_SH_ICON_1:caret-down${"[\uFFFD/#54\uFFFD|\uFFFD/#56\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#55\uFFFD"}:CLOSE_TAG_DIV:`,ne=y(ne);let te;te=$localize`${"\uFFFD#65\uFFFD"}:START_TAG_SH_ICON:notepad${"[\uFFFD/#65\uFFFD|\uFFFD/#67\uFFFD]"}:CLOSE_TAG_SH_ICON: Complete log ${"\uFFFD#66\uFFFD"}:START_TAG_DIV:${"\uFFFD#67\uFFFD"}:START_TAG_SH_ICON_1:caret-down${"[\uFFFD/#65\uFFFD|\uFFFD/#67\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#66\uFFFD"}:CLOSE_TAG_DIV:`,te=y(te);let ie;ie=$localize`${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:circle-half-tilt${"[\uFFFD/#3\uFFFD|\uFFFD/#5\uFFFD]"}:CLOSE_TAG_SH_ICON: Test phase ${"\uFFFD#4\uFFFD"}:START_TAG_DIV:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON_1:caret-down${"[\uFFFD/#3\uFFFD|\uFFFD/#5\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_DIV:`,ie=y(ie);let Le;Le=$localize`Start: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let me;me=$localize`End: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let Ne;Ne=$localize`Duration: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let Ge;Ge=$localize`Verifications: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let Pe;Pe=$localize`Warnings: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let Ae;Ae=$localize`Errors: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let oe;oe=$localize`${"\uFFFD#26\uFFFD"}:START_TAG_SH_ICON:file-archive${"[\uFFFD/#26\uFFFD|\uFFFD/#28\uFFFD]"}:CLOSE_TAG_SH_ICON: Compact phase ${"\uFFFD#27\uFFFD"}:START_TAG_DIV:${"\uFFFD#28\uFFFD"}:START_TAG_SH_ICON_1:caret-down${"[\uFFFD/#26\uFFFD|\uFFFD/#28\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#27\uFFFD"}:CLOSE_TAG_DIV:`,oe=y(oe);let Re;Re=$localize`Start: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let De;De=$localize`End: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let Ie;Ie=$localize`Duration: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let Me;Me=$localize` Deleted files: ${"\uFFFD0\uFFFD"}:INTERPOLATION: (${"\uFFFD1\uFFFD"}:INTERPOLATION_1:) `;let $e;$e=$localize` Downloaded files: ${"\uFFFD0\uFFFD"}:INTERPOLATION: (${"\uFFFD1\uFFFD"}:INTERPOLATION_1:) `;let fe;fe=$localize` Uploaded files: ${"\uFFFD0\uFFFD"}:INTERPOLATION: (${"\uFFFD1\uFFFD"}:INTERPOLATION_1:) `;let he;he=$localize`Warnings: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let xe;xe=$localize`Errors: ${"\uFFFD0\uFFFD"}:INTERPOLATION:`;let ae;ae=$localize`${"\uFFFD#3\uFFFD"}:START_TAG_SH_ICON:warning-circle${"[\uFFFD/#3\uFFFD|\uFFFD/#5\uFFFD]"}:CLOSE_TAG_SH_ICON: Verifications ${"\uFFFD0\uFFFD"}:INTERPOLATION: ${"\uFFFD#4\uFFFD"}:START_TAG_DIV:${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON_1:caret-down${"[\uFFFD/#3\uFFFD|\uFFFD/#5\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/#4\uFFFD"}:CLOSE_TAG_DIV:`,ae=y(ae);let ye;ye=$localize` Updating ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:spinner${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let ve;ve=$localize` Un-suppress ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:bell${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let Be;Be=$localize` Suppress ${"\uFFFD#2\uFFFD"}:START_TAG_SH_ICON:bell-slash${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SH_ICON:`;let _e;return _e=$localize` Copy ${"\uFFFD*5:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*5:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*6:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON:${"\uFFFD/*6:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,_e=y(_e),[t,e,n,l,r,O,N,x,S,M,v,Q,G,ne,te,ie,Le,me,Ne,Ge,Pe,Ae,oe,Re,De,Ie,Me,$e,fe,he,xe,ae,ye,ve,Be,_e,[1,"indeterminate","primary"],[1,"log-entry"],[3,"click"],[1,"status","error"],[1,"status","warn"],[1,"status"],[1,"spacer"],[1,"action"],[1,"toggle-indicator"],[1,"log-content"],[3,"disableToggle"],["title",""],["content",""],[1,"extra-info"],["name","details"],["name","details",3,"open"],[1,"actions"],[1,"content"],[1,"warning-item"],["shButton","",1,"small",3,"click"],["shButton","",1,"small",3,"disabled"],["shButton","",1,"small",3,"click","disabled"]]},template:function(e,n){e&1&&(g(0,on,1,0,"sh-progress-bar",36),X(1,An,16,10,"article",37,J)),e&2&&(T(n.resource.isLoading()?0:-1),_(),z(n.resource.value()))},dependencies:[Ye,qe,pe,de,q,Z,j,ee,ue],styles:["[_nghost-%COMP%]{display:block}.log-entry[_ngcontent-%COMP%]{display:flex;flex-direction:column;cursor:pointer}.log-entry[_ngcontent-%COMP%] header[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem;padding:1rem;border-bottom:1px solid var(--base-4);background-color:var(--base-1);cursor:pointer}.log-entry[_ngcontent-%COMP%] header[_ngcontent-%COMP%]:hover{background-color:var(--base-2)}.log-entry[_ngcontent-%COMP%] header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-30);margin:0}.log-entry[_ngcontent-%COMP%] header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.toggle-indicator[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;height:1.25rem;transition:transform 125ms linear}.toggle-indicator.open[_ngcontent-%COMP%]{transform:rotate(180deg)}details[_ngcontent-%COMP%]{display:flex;flex-direction:column}details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;gap:.5rem;padding:.75rem;border-radius:var(--shape-2);background-color:var(--base-2)}details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]:focus{outline:none}details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]:hover{background-color:var(--base-3)}details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%]::marker{font-size:0}details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;justify-content:flex-end;flex:1 0;gap:.5rem;-webkit-user-select:none;user-select:none}details[_ngcontent-%COMP%] summary[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;height:2rem;transition:transform 125ms linear}details[open][_ngcontent-%COMP%] summary[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{transform:rotate(180deg)}details[_ngcontent-%COMP%] .content[_ngcontent-%COMP%]{padding:.75rem 1rem 0;display:flex;flex-direction:column;gap:.75rem}details[_ngcontent-%COMP%] .content[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0}details[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{margin-top:.75rem;position:relative}details[_ngcontent-%COMP%] code[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{position:absolute;top:.75rem;right:.75rem}.extra-info[_ngcontent-%COMP%]{grid-column:1/-1;display:flex;flex-direction:column;gap:1rem}.extra-info[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;margin-bottom:.75rem}.extra-info[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{white-space:pre-wrap;padding:1rem;display:block;border-radius:var(--shape-2);background-color:var(--base-2)}.log-content[_ngcontent-%COMP%]{padding:1rem;display:grid;grid-template-columns:1fr 1fr;gap:1rem}.status[_ngcontent-%COMP%]{display:block;width:1rem;height:1rem;background-color:var(--success-8);border-radius:50%}.status.error[_ngcontent-%COMP%]{background-color:var(--error-8)}.status.warn[_ngcontent-%COMP%]{background-color:var(--warn-8)}.warning-item[_ngcontent-%COMP%]{display:flex;flex-direction:row;gap:.5rem;padding:.75rem;border-radius:var(--shape-2);background-color:var(--base-2)}.warning-item[_ngcontent-%COMP%] code[_ngcontent-%COMP%]{margin:0;white-space:pre-wrap;word-break:break-word}.warning-item[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{align-self:flex-start;white-space:nowrap}"],changeDetection:0})};function Rn(i,t){i&1&&c(0,"sh-progress-bar",1)}function Dn(i,t){i&1&&(L(0,0,1),c(1,"sh-icon"),m())}function In(i,t){i&1&&(L(0,0,2),c(1,"sh-icon"),m())}function Mn(i,t){if(i&1){let e=h();a(0,"section",6)(1,"button",7),b("click",function(){$(e);let l=u(),r=l.$implicit,O=l.$index,N=u();return f(N.copyToClipboard(r.data,O))}),L(2,0),g(3,Dn,2,0)(4,In,2,0),m(),o(),a(5,"code"),C(6),E(7,"json"),o()()}if(i&2){let e=u(),n=e.$implicit,l=e.$index,r=u();_(),Y("success",r.copiedFromIndex()===l),_(2),T(r.copiedFromIndex()===l?3:4),_(3),V(D(7,4,n.data))}}function $n(i,t){if(i&1){let e=h();a(0,"article",2)(1,"header",3),b("click",function(){let l=$(e).$implicit,r=u();return f(r.toggleOpenEntry(l.id))}),a(2,"h3"),C(3),E(4,"date"),o(),a(5,"div",4)(6,"sh-icon",5),C(7,"caret-down"),o()()(),g(8,Mn,8,6,"section",6),o()}if(i&2){let e=t.$implicit,n=u();_(3),Ke("",I(4,6,e.timestamp,"medium"),": ",e.operation," ",e.path),_(3),Y("open",e.id===n.openEntry()),_(2),T(e.id===n.openEntry()?8:-1)}}var Oe=class i{#e=U(Ee);backupId=Fe.required();openEntry=R(null);pagination=R({offset:0,pagesize:100});copiedFromIndex=R(null);resource=ge({params:()=>le({id:this.backupId()},this.pagination()),stream:({params:t})=>this.#e.getApiV1BackupByIdRemotelog({id:t.id,pagesize:100}).pipe(W(e=>e.map((n,l)=>({id:n.ID,operationId:n.OperationID,timestamp:n.Timestamp*1e3,operation:n.Operation,path:n.Path,data:typeof n.Data=="string"?JSON.parse(n.Data):null}))))});toggleOpenEntry(t){if(this.openEntry()===t){this.openEntry.set(null);return}this.openEntry.set(t)}copyToClipboard(t,e){let n=JSON.stringify(t,null,2);navigator.clipboard.writeText(n),this.copiedFromIndex.set(e),setTimeout(()=>{this.copiedFromIndex.set(null)},3e3)}static \u0275fac=function(e){return new(e||i)};static \u0275cmp=H({type:i,selectors:[["app-remote-log"]],inputs:{backupId:[1,"backupId"]},decls:3,vars:1,consts:()=>{let t;return t=$localize`${"\uFFFD*3:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copied ${"\uFFFD/*3:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*4:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SH_ICON:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SH_ICON: Copy to clipboard ${"\uFFFD/*4:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,t=y(t),[t,[1,"indeterminate","primary"],[1,"log-entry"],[3,"click"],[1,"actions"],[1,"toggle-indicator"],[1,"log-content"],["shButton","",1,"small",3,"click"]]},template:function(e,n){e&1&&(g(0,Rn,1,0,"sh-progress-bar",1),X(1,$n,9,9,"article",2,J)),e&2&&(T(n.resource.isLoading()?0:-1),_(),z(n.resource.value()))},dependencies:[pe,q,ue,j],styles:["[_nghost-%COMP%]{display:block}.log-entry[_ngcontent-%COMP%]{display:flex;flex-direction:column}.log-entry[_ngcontent-%COMP%] header[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:1rem;border-bottom:1px solid var(--base-4);background-color:var(--base-1);cursor:pointer}.log-entry[_ngcontent-%COMP%] header[_ngcontent-%COMP%]:hover{background-color:var(--base-2)}.log-entry[_ngcontent-%COMP%] header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-30);margin:0;-webkit-user-select:none;user-select:none}.log-entry[_ngcontent-%COMP%] header[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.toggle-indicator[_ngcontent-%COMP%]{display:inline-flex;align-items:center;justify-content:center;height:1.25rem;transition:transform 125ms linear}.toggle-indicator.open[_ngcontent-%COMP%]{transform:rotate(180deg)}.log-content[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:1rem;position:relative}.log-content[_ngcontent-%COMP%] button[_ngcontent-%COMP%]{position:absolute;top:2rem;right:2rem;background:transparent}code[_ngcontent-%COMP%]{white-space:pre-wrap;padding:1rem;display:block;border-radius:var(--shape-2);background-color:var(--base-2)}"],changeDetection:0})};function fn(i,t){if(i&1&&(C(0," - "),P(1),s(2,6),A(),C(3),E(4,"durationFormat")),i&2){u(2);let e=k(6);_(3),w(" ",D(4,1,e.Backup.Metadata==null?null:e.Backup.Metadata.LastBackupDuration)," ")}}function hn(i,t){i&1&&(P(0),s(1,7),A())}function xn(i,t){if(i&1&&(C(0),E(1,"bytes")),i&2){u(2);let e=k(6);w(" ",D(1,1,e.Backup.Metadata==null?null:e.Backup.Metadata.SourceFilesSize)," ")}}function yn(i,t){i&1&&(P(0),s(1,8),A())}function vn(i,t){if(i&1&&(C(0),E(1,"bytes")),i&2){u(2);let e=k(6);w(" ",D(1,1,e.Backup.Metadata==null?null:e.Backup.Metadata.TargetFilesSize)," ")}}function Bn(i,t){i&1&&(P(0),s(1,9),A())}function bn(i,t){if(i&1&&(a(0,"sh-chip",20),s(1,10),o()),i&2){u(2);let e=k(6);_(),d(e.Backup.Metadata==null?null:e.Backup.Metadata.BackupListCount),p(1)}}function kn(i,t){i&1&&(a(0,"sh-chip",21),s(1,11),o())}function Un(i,t){if(i&1&&(a(0,"div",14)(1,"div",19)(2,"h3"),C(3),a(4,"sh-icon"),C(5,"database"),o()(),a(6,"p")(7,"span"),s(8,3),o(),C(9),E(10,"date"),g(11,fn,5,3)(12,hn,2,0,"ng-container"),o(),a(13,"p")(14,"span"),s(15,4),o(),g(16,xn,2,3)(17,yn,2,0,"ng-container"),o(),a(18,"p")(19,"span"),s(20,5),o(),g(21,vn,2,3)(22,Bn,2,0,"ng-container"),o()(),g(23,bn,2,1,"sh-chip",20)(24,kn,2,0,"sh-chip",21),o()),i&2){let e=u(),n=k(6);_(3),w(" ",n.Backup.Name??e.MISSING_BACKUP_NAME," "),_(6),w(" ",I(10,6,n.Backup.Metadata==null?null:n.Backup.Metadata.LastBackupDate,"short")," "),_(2),T(n.Backup.Metadata!=null&&n.Backup.Metadata.LastBackupDuration?11:12),_(5),T(n.Backup.Metadata!=null&&n.Backup.Metadata.SourceFilesSize?16:17),_(5),T(n.Backup.Metadata!=null&&n.Backup.Metadata.TargetFilesSize?21:22),_(2),T(n.Backup.Metadata!=null&&n.Backup.Metadata.BackupListCount?23:24)}}function wn(i,t){if(i&1&&c(0,"app-general-log",18),i&2){let e=u();B("backupId",e.backupId())}}function Kn(i,t){if(i&1&&c(0,"app-remote-log",18),i&2){let e=u();B("backupId",e.backupId())}}var Se=class i{#e=U(We);#n=U(Ce);MISSING_BACKUP_NAME=$localize`Backup name missing`;activeTab=R("general");backupId=Ze(this.#e.params.pipe(W(t=>t.id)));backup=ce(()=>{let t=this.backupId();return t?this.#n.getBackupById(t):null});static \u0275fac=function(e){return new(e||i)};static \u0275cmp=H({type:i,selectors:[["app-log"]],decls:15,vars:5,consts:()=>{let t;t=$localize`${"\uFFFD#5\uFFFD"}:START_TAG_SH_ICON:arrow-left${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_SH_ICON: Back `;let e;e=$localize`General`;let n;n=$localize`Destination`;let l;l=$localize`Last successful backup:`;let r;r=$localize`Source:`;let O;O=$localize`Destination:`;let N;N=$localize`took`;let x;x=$localize`N/A`;let S;S=$localize`N/A`;let M;M=$localize`N/A`;let v;v=$localize`${"\uFFFD0\uFFFD"}:INTERPOLATION: Version`;let Q;return Q=$localize`No version yet`,[t,e,n,l,r,O,N,x,S,M,v,Q,[1,"back"],["type","button","shButton","","routerLink","/",1,"small"],[1,"backup"],[1,"primary",3,"valueChange","value"],["value","general"],["value","destination"],[3,"backupId"],[1,"text"],[1,"simple","success"],[1,"simple"]]},template:function(e,n){if(e&1){let l=h();c(0,"app-status-bar"),a(1,"section")(2,"div",12)(3,"button",13),L(4,0),c(5,"sh-icon"),m(),o()(),re(6),g(7,Un,25,9,"div",14),a(8,"sh-tabs",15),ze("valueChange",function(O){return $(l),Xe(n.activeTab,O)||(n.activeTab=O),f(O)}),a(9,"button",16),s(10,1),o(),a(11,"button",17),s(12,2),o()(),g(13,wn,1,1,"app-general-log",18),g(14,Kn,1,1,"app-remote-log",18),o()}if(e&2){_(6);let l=se(n.backup());_(),T(l?7:-1),_(),Je("value",n.activeTab),_(5),T(n.activeTab()==="general"?13:-1),_(),T(n.activeTab()==="destination"?14:-1)}},dependencies:[Qe,Te,Oe,He,en,q,de,je,Z,ee,j],styles:["[_nghost-%COMP%]{display:block}section[_ngcontent-%COMP%]{display:flex;flex-direction:column;padding:1rem 1.5rem;gap:1rem}sh-tabs[_ngcontent-%COMP%]{margin-bottom:1rem}.backup[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:space-between;padding:2rem;gap:1rem;border:1px solid var(--base-4);border-radius:var(--shape-3);box-shadow:var(--box-shadow-10)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;width:100%;max-width:40%}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.5rem}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] h3[_ngcontent-%COMP%] sh-icon[_ngcontent-%COMP%]{color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{font:var(--paragraph-30);color:var(--base-8)}.backup[_ngcontent-%COMP%] .text[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{color:var(--base-12)}"],changeDetection:0})};export{Se as default};
package/chunk-Y4EMWRGE.js DELETED
@@ -1 +0,0 @@
1
- import{a as B}from"./chunk-XCVBN7EK.js";import{a as z}from"./chunk-MRSBKQQM.js";import{a as R}from"./chunk-35APLYI4.js";import{b as _}from"./chunk-XZNYCTQB.js";import{a as $}from"./chunk-R6TFME5I.js";import{z as S}from"./chunk-NCXKMSRH.js";import{d as P}from"./chunk-QAQMMCTH.js";import{F as u,L as k,Rc as n,V as h,_ as l,l as d,pa as c,q as m,ra as f}from"./chunk-UH2E7MMT.js";import{a as s,b as r}from"./chunk-7CGTOI24.js";var F={Starting_Operation:$localize`Starting operation …`,Backup_Begin:$localize`Starting backup …`,Backup_PreBackupVerify:$localize`Verifying backend data …`,Backup_PostBackupTest:$localize`Verifying remote data …`,Backup_PreviousBackupFinalize:$localize`Completing previous backup …`,Backup_ProcessingFiles:$localize`Processing files to backup …`,Backup_Finalize:$localize`Completing backup …`,Backup_WaitForUpload:$localize`Waiting for upload to finish …`,Backup_Delete:$localize`Deleting unwanted files …`,Backup_Compact:$localize`Compacting remote data …`,Backup_VerificationUpload:$localize`Uploading verification file …`,Backup_PostBackupVerify:$localize`Verifying backend data …`,Backup_Lock:$localize`Locking remote data …`,Backup_Complete:$localize`Backup complete!`,Restore_Begin:$localize`Starting restore …`,Restore_RecreateDatabase:$localize`Rebuilding local database …`,Restore_PreRestoreVerify:$localize`Verifying remote data …`,Restore_CreateFileList:$localize`Building list of files to restore …`,Restore_CreateTargetFolders:$localize`Creating target folders …`,Restore_ScanForExistingFiles:$localize`Scanning existing files …`,Restore_ScanForLocalBlocks:$localize`Scanning for local blocks …`,Restore_PatchWithLocalBlocks:$localize`Patching files with local blocks …`,Restore_Download:$localize`Downloading files …`,Restore_PatchWithRemoteFiles:$localize`Patching files with remote data …`,Restore_VerifyRestoredFiles:$localize`Verifying restored files …`,Restore_Finaluze:$localize`Finalizing restore …`,Restore_Complete:$localize`Restore complete!`,Recreate_Begin:$localize`Starting database recreate …`,Recreate_Delete:$localize`Deleting old database …`,Recreate_Create:$localize`Creating new database …`,Recreate_Download:$localize`Downloading files …`,Recreate_Process:$localize`Processing files …`,Recreate_Complete:$localize`Database recreate complete!`,Verify_Begin:$localize`Starting verification …`,Verify_Download:$localize`Downloading files …`,Verify_Process:$localize`Processing files …`,Verify_Complete:$localize`Verification complete!`,BugReport_Begin:$localize`Starting bug report …`,BugReport_Gathering:$localize`Gathering information …`,BugReport_Complete:$localize`Bug report complete!`,List_Begin:$localize`Starting list …`,List_Download:$localize`Downloading files …`,List_Process:$localize`Processing files …`,List_Complete:$localize`List complete!`,Delete_Begin:$localize`Starting delete …`,Delete_Download:$localize`Downloading files …`,Delete_Process:$localize`Processing files …`,Delete_Complete:$localize`Delete complete!`,Compact_Begin:$localize`Starting compact …`,Compact_Download:$localize`Downloading files …`,Compact_Process:$localize`Processing files …`,Compact_Complete:$localize`Compact complete!`,Restore_DownloadingRemoteFiles:$localize`Downloading files …`,Restore_PostRestoreVerify:$localize`Verifying restored files …`,Recreate_Running:$localize`Recreating database …`,Vacuum_Running:$localize`Vacuuming database …`,Repair_Running:$localize`Repairing database …`,Verify_Running:$localize`Verifying files …`,BugReport_Running:$localize`Creating bug report …`,Delete_Listing:$localize`Listing remote files …`,Delete_Deleting:$localize`Deleting remote files …`,PurgeFiles_Begin:$localize`Listing remote files for purge …`,PurgeFiles_Process:$localize`Purging files …`,PurgeFiles_Compact:$localize`Compacting remote data …`,PurgeFiles_Complete:$localize`Purging files complete!`,ReadLockInfo_Running:$localize`Reading lock info …`,Error:$localize`Error!`};var C=class g{#i=l(z);#t=l(P);#o=l(B);#e=l(_);#c=l(S);#g=l($);#l=c(!1);#a=c(null);statusData=this.#a.asReadonly();lastState=null;serverState=n(()=>{let e=this.#e.serverState();return e?(e.ProposedSchedule=e.ProposedSchedule?.map(i=>r(s({},i),{backup:i.Item1?this.#o.getBackupById(i.Item1):null}))??null,this.lastState=e,e):this.lastState});hasProgressOnWebsocket=n(()=>this.#g.hasProgressSubscribeOption()&&this.#e.getConnectionMethod()==="websocket");clientIsRunning=n(()=>this.serverState()?.ProgramState==="Running");runningBackupId=n(()=>{let e=this.statusData();return!!(this.serverState()?.ActiveTask&&e?.task?.Status&&e?.task?.Status!=="Completed")?e?.BackupID??null:null});isResuming=c(!1);isFetching=this.#l.asReadonly();connectionStatus=this.#e.connectionStatus;pollingInterval;#m=f(()=>{let e=this.#e.serverState();e?.ActiveTask||this.#o.getBackups(!0),this.hasProgressOnWebsocket()&&(this.#e.subscribe("progress"),this.#e.subscribe("taskqueue")),e?.ActiveTask&&this.pollingInterval===void 0?this.startPollingProgress():e?.ActiveTask||this.stopPollingProgress()});#k=f(()=>{let e=this.#e.progressState(),i=this.#e.taskQueueState();if(e){let t=i?.find(o=>o.ID===e.TaskID)??null;this.#r(r(s({},e),{task:t}))}});setConnectionMethod(e){this.#e.setConnectionMethod(e)}startPollingProgress(){this.hasProgressOnWebsocket()?this.#e.subscribe("progress"):this.pollingInterval=setInterval(()=>{this.#s()},1e3)}stopPollingProgress(){clearInterval(this.pollingInterval)}fetchProgressState(){this.#s()}pauseResume(){return this.isResuming.set(!0),this.#t.postApiV1ServerstateResume().pipe(u(()=>this.isResuming.set(!1)))}resumeDialogCheck(e){if(!this.clientIsRunning()){this.#c.open(R,{data:{title:$localize`Server paused`,message:$localize`Server is currently paused. Do you want to resume now?`,confirmText:$localize`Resume`,cancelText:$localize`No, I'll resume later`},closed:i=>{i&&this.pauseResume().subscribe({next:()=>{e()}})}});return}e()}#s(){this.#l.set(!0),this.#t.getApiV1Progressstate().pipe(k(e=>{let i=e.TaskID??null;return i===null?d(e):this.#t.getApiV1TaskByTaskid({taskid:i}).pipe(m(t=>r(s({},e),{task:t??null})))}),u(()=>this.#l.set(!1))).subscribe({next:e=>{this.#r(e),this.serverState()?.ActiveTask==null&&this.stopPollingProgress()},error:e=>{e.status===404&&this.stopPollingProgress()}})}#r(e){let i=e.TaskID??null,t=e.BackupID??null;i!==null&&t!==null&&(e.backup=this.#o.getBackupById(t)),this.#a.set(r(s({},e),{progress:this.#p(e),statusText:this.#d(e),fileStatusText:this.#u(e),fileCountProgressText:this.#f(e),actionText:e.backup?.Backup?.Name??$localize`Running task`}))}#p(e){let i=-1;if(e.task&&e)if(e.Phase==="Backup_ProcessingFiles"||e.Phase==="Restore_DownloadingRemoteFiles")if(e.StillCounting)i=0;else{let t=e.CurrentFilecomplete?0:e.CurrentFileoffset,o=e.TotalFileCount-e.ProcessedFileCount,a=e.TotalFileSize-e.ProcessedFileSize-t;i=(e.ProcessedFileSize+t)/e.TotalFileSize,e.ProcessedFileCount===0?i=0:i>=.9&&(i=.9)}else e.Phase==="Backup_Finalize"||e.Phase==="Backup_WaitForUpload"?i=.9:e.Phase==="Backup_Delete"||e.Phase==="Backup_Compact"?i=.95:e.Phase==="Backup_VerificationUpload"||e.Phase==="Backup_PostBackupVerify"?i=.98:e.Phase==="Backup_Complete"?i=1:e.OverallProgress>0&&(i=e.OverallProgress);return i}#n(e){let i=(e.ActiveTransfers??[]).map(o=>o.BackendSpeed).reduce((o,a)=>(o??0)+(a??0),0)??-1,t=i<=0?e.BackendSpeed:i;return(t??-1)<0?"":` at ${this.#i.transform(t)}/s`}#u(e){let i=(["Backup_WaitForUpload","Backup_ProcessingFiles"].includes(e.Phase)?e?.BackendFileProgress:e.CurrentFileoffset)??0,t=(["Backup_WaitForUpload","Backup_ProcessingFiles"].includes(e.Phase)?e?.BackendFileSize:e.CurrentFilesize)??0;if(!e.CurrentFilename)return"";let o=e.CurrentFilename.length>42?"..."+e.CurrentFilename.slice(-42):e.CurrentFilename,a=(i/t*100).toFixed(1);return $localize`${o} | File processed: ${this.#i.transform(i)}/${this.#i.transform(t)} - ${a}%`}#f(e){return $localize`Files processed ${e.ProcessedFileCount}/${e.TotalFileCount}`}#d(e){let i="Running \u2026";if(e.task&&e){if(i=e.Phase?F[e.Phase]??e.Phase:"Running \u2026",e.TotalFileCount===0)return i;if(e.Phase==="Backup_ProcessingFiles"||e.Phase==="Restore_DownloadingRemoteFiles")if(e.StillCounting)i=`Counting (${e.TotalFileCount} files found, ${this.#i.transform(e.TotalFileSize)})`;else{let t=e.CurrentFilecomplete?0:e.CurrentFileoffset,o=e.TotalFileCount-e.ProcessedFileCount,a=e.TotalFileSize-e.ProcessedFileSize-t,b=e.Phase==="Restore_DownloadingRemoteFiles"?"Restoring: ":"",p=this.#n(e);e.Phase==="Backup_ProcessingFiles"&&o===0?i=`Completing upload ${p}`:e.BackendIsBlocking??!1?i=`Waiting for transfers ${p}`:i=`${b}${o} files (${this.#i.transform(a)}) to go ${p}`}else if(e.Phase==="Backup_WaitForUpload"){let t=this.#n(e);t!==""&&(i=`Waiting for upload to finish ${t}`)}}return i}static \u0275fac=function(i){return new(i||g)};static \u0275prov=h({token:g,factory:g.\u0275fac,providedIn:"root"})};export{F as a,C as b};