@duplicati/ngclient 0.0.99 → 0.0.100

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.
@@ -0,0 +1,8 @@
1
+ import{a as zt,b as jt}from"./chunk-LBZ753XE.js";import{a as rt}from"./chunk-XH2A67YP.js";import{a as Be}from"./chunk-ISRMJKPG.js";import{a as Dt,b as Xt}from"./chunk-DNHLTHLR.js";import{a as B}from"./chunk-3V622MYY.js";import{a as tt}from"./chunk-WCLOWI5G.js";import{a as Ve}from"./chunk-PX6A6XCQ.js";import{b as Bt}from"./chunk-RHW5QVAY.js";import{b as Ge,c as ue,d as de,e as _e,f as Ae,g as nt,h as Kt,i as Pe,j as Le,m as ot,n as Ne,o as Ue,p as Ht,q as ke,r as Y,s as it,t as Oe}from"./chunk-JJQARMUD.js";import{b as ye,d as le}from"./chunk-I3TLRILF.js";import{A as et,a as pe,b as Je,d as Lt,e as Ut,g as we,l as ce,o as Vt,p as Ze,t as me,z as be}from"./chunk-XQKR67WI.js";import{b as ve}from"./chunk-CEOO3F5U.js";import{c as Gt}from"./chunk-K3CYM6ID.js";import{i as bt}from"./chunk-M7VDIUGU.js";import{$b as Mt,D as Xe,Db as h,Eb as T,Fb as I,Gb as gt,Hb as Ct,Ib as Ie,Jb as P,Kb as c,Na as l,Nb as se,Pb as Rt,Q as he,Qb as V,Ua as Te,Vb as De,W as M,Wb as Ee,Xb as oe,Yb as g,Za as ae,Zb as St,_b as H,ba as E,bc as It,ca as y,cb as F,cc as xt,dc as vt,ec as ft,fc as ht,ga as $t,gc as Tt,ic as wt,jc as je,kb as m,lc as We,mb as Me,na as _t,oa as Ft,p as He,pb as f,pc as qe,qb as ee,ra as N,rb as te,sb as ne,tb as s,ub as a,vb as u,wb as X,xb as z,xc as L,yb as ze,yc as Ye,zb as x}from"./chunk-XGARKXE4.js";import{a as A,c as Ot}from"./chunk-7CGTOI24.js";var at=class e{fromString(n){if(!n)return null;let t=n.match(/(\d+)([smhDWMY])/);return t&&{value:parseInt(t[1]),unit:t[2]}}toString(n,t){return`${n}${t}`}static \u0275fac=function(t){return new(t||e)};static \u0275prov=he({token:e,factory:e.\u0275fac,providedIn:"root"})};var Fe=class e{#n=M(ve);s3Providers=B(this.getS3Config("Providers"));s3Regions=B(this.getS3Config("Regions"));s3RegionHosts=B(this.getS3Config("RegionHosts"));s3StorageClasses=B(this.getS3Config("StorageClasses"));storjSatellites=B(this.getStorjConfig("Satellites"));storjAuthenticationMethods=B(this.getStorjConfig("AuthenticationMethods"));openstackProviders=B(this.getOpenstackConfig("Providers"));openstackVersions=B(this.getOpenstackConfig("Versions"));gcsLocations=B(this.getGcsConfig("Locations"));gcsStorageClasses=B(this.getGcsConfig("StorageClasses"));getS3Config(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"s3-getconfig",requestBody:{"s3-config":n}}).pipe(He(t=>this.#e(t)))}createS3IamUser(n,t){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"CanCreateUser","s3-username":n,"s3-password":t}})}createS3PolicyIAM(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"s3-iamconfig",requestBody:{"s3-operation":"GetPolicyDoc",path:n}})}getStorjConfig(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"storj-getconfig",requestBody:{"storj-config":n}}).pipe(He(t=>this.#e(t)))}getOpenstackConfig(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"openstack-getconfig",requestBody:{"openstack-config":n}}).pipe(He(t=>this.#e(t)))}getGcsConfig(n){return this.#n.postApiV1WebmoduleByModulekey({modulekey:"gcs-getconfig",requestBody:{"gcs-config":n}}).pipe(He(t=>this.#e(t)))}#e(n){return(n.Result&&typeof n.Result=="object"&&Object.entries(n.Result).map(([t,o])=>({key:t,value:o})))??[]}static \u0275fac=function(t){return new(t||e)};static \u0275prov=he({token:e,factory:e.\u0275fac,providedIn:"root"})};function Re(e){return e==null?"":":"+e.toString()}function W(e){return e==null?"":e.startsWith("/")?e:"/"+e}function k(e,n){let t={},o={},i=Ce.find(r=>r.key===e);return n.searchParams.forEach((r,p)=>{i?.dynamicFields?.some(S=>S===p||S?.name===p)?o[p]=decodeURIComponent(r):t[p]=decodeURIComponent(r)}),{advanced:t,dynamic:o}}function O(e,n=!1){let t=e.map(([i,r])=>`${i}=${r?encodeURIComponent(r.toString()):""}`).join("&");return t?(n?"":"?")+t:""}function st(e){let n=e.destinationType,t=Ce.find(o=>o.customKey===n||o.key===n);if(!t)throw new Error("Invalid destination type");return t?.mapper.to(e)??""}function Et(e){let n=URL.canParse(e),t=e.split("://")[0],o=e.split("://")[1],i="http://"+o;if(o.startsWith("%")&&t==="file")return Ce.find(r=>r.customKey===t||r.key===t)?.mapper.from(t,new URL("http://localhost"),e);try{let r=new URL(i);return Ce.find(p=>p.customKey===t||p.key===t)?.mapper.from(t,r,e)}catch(r){console.error("Error while parsing target path",r)}if(!n)throw new Error("Invalid target path");return null}var d=new Y,Ce=[{key:"file",displayName:"File system",description:"Store backups on your local file system.",customFields:{path:{type:"FolderTree",name:"path",shortDescription:"File path",longDescription:"The path to store the backup",formElement:e=>d.control(e??"")}},mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${e.custom.path}${n}`},from:(e,n,t)=>{let i=t.startsWith("file:///")?t.split("file:///")[1]:t.split("file://")[1],r=i.startsWith("%"),_=i.slice(1).startsWith(":\\")||r?i:"/"+i;return A({destinationType:e,custom:{path:_}},k(e,n))}}},{key:"ssh",displayName:"SSH",description:"Store backups in SSH.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"The server to connect to",formElement:e=>d.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"The port to connect to",formElement:e=>d.control(e??"",[de.required,de.max(65535)])},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>d.control(e??"")}},dynamicFields:["auth-username"],advancedFields:[{type:"FileTree",name:"ssh-keyfile",accepts:".key,",shortDescription:"This is a path to a private key file locally on the machine",longDescription:"This is a path to a private key file locally on the machine"}],mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Re(t)+W(i)+n}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},k(e,n))}},{key:"s3",displayName:"S3 compatible bucket",description:"Store backups in any S3 compatible bucket.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:e=>d.control(e??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>d.control(e??"")}},dynamicFields:[{name:"s3-server-name",shortDescription:"Server",type:"NonValidatedSelectableString",loadOptions:e=>e.get(Fe).s3Providers},"use-ssl","auth-username","auth-password"],advancedFields:[{name:"s3-client",type:"Enumeration",options:["aws","minio"]},{name:"s3-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(Fe).s3StorageClasses}],mapper:{to:e=>{let{bucket:n,path:t}=e.custom,o=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n+W(t)+o}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.pathname,bucket:n.hostname}},k(e,n))}},{key:"gcs",displayName:"Google Cloud Storage",description:"Store backups in Google Cloud Storage.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:e=>d.control(e??"")}},dynamicFields:[{name:"gcs-location",type:"NonValidatedSelectableString",loadOptions:e=>e.get(Fe).gcsLocations},{name:"gcs-storage-class",type:"NonValidatedSelectableString",loadOptions:e=>e.get(Fe).gcsStorageClasses},"authid"],mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${e.custom.path}${n}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"googledrive",displayName:"Google Drive",description:"Store backups in Google Drive.",oauthField:"authid",customFields:{path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>d.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"pcloud",displayName:"pCloud",description:"Store backups in pCloud.",oauthField:"authid",customFields:{server:{type:"Enumeration",name:"server",loadOptions:()=>N([{key:"pCloud Global",value:"api.pcloud.com"},{key:"pCloud Europe",value:"eapi.pcloud.com"}]),shortDescription:"Server",longDescription:"Server",formElement:e=>d.control(e??"")},path:{type:"Path",name:"path",shortDescription:"Folder path",longDescription:"Folder path",formElement:e=>d.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{server:t,path:o}=e.custom;return`${e.destinationType}://${t+W(o)+n}`},from:(e,n,t)=>{let o=n.pathname.replace(/^\//,"");return A({destinationType:e,custom:{server:n.hostname,path:o}},k(e,n))}}},{key:"azure",displayName:"Azure Blob Storage",description:"Store backups in Azure Blob Storage.",customFields:{path:{type:"String",name:"path",shortDescription:"Container name",longDescription:"Container name",formElement:e=>d.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"onedrivev2",displayName:"OneDrive",description:"Store backups in OneDrive.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>d.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"od4b",displayName:"OneDrive Business",description:"Store backups in OneDrive Business.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>d.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>d.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>d.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Re(t)+W(i)+n}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},k(e,n))}},{key:"mssp",displayName:"Microsoft SharePoint",description:"Store backups in Microsoft SharePoint.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>d.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>d.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>d.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Account name"},{name:"auth-password",shortDescription:"Access key"}],mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Re(t)+W(i)+n}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},k(e,n))}},{key:"sharepoint",displayName:"Microsoft SharePoint v2",description:"Store backups in Microsoft SharePoint.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>d.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"dropbox",displayName:"Dropbox",description:"Store backups in Dropbox.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>d.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"box",displayName:"Box.com",description:"Store backups in Box.com.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>d.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"jottacloud",displayName:"Jottacloud",description:"Store backups in Jottacloud.",oauthField:"authid",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>d.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"b2",displayName:"B2 Cloud Storage",description:"Store backups in B2 Cloud Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:e=>d.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:e=>d.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Application ID"},{name:"auth-password",shortDescription:"Application Key"}],mapper:{to:e=>{let{bucket:n,path:t}=e.custom,o=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n+W(t)+o}`},from:(e,n,t)=>A({destinationType:e,custom:{bucket:n.hostname,path:decodeURIComponent(n.pathname)}},k(e,n))}},{key:"e2",displayName:"IDrive e2",description:"Store backups in IDrive e2.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket name",longDescription:"Bucket name",formElement:e=>d.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path in the bucket",longDescription:"Path in the bucket",formElement:e=>d.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Access ID"},{name:"auth-password",shortDescription:"Access Secret"}],mapper:{to:e=>{let{bucket:n,path:t}=e.custom,o=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n+W(t)+o}`},from:(e,n,t)=>A({destinationType:e,custom:{bucket:n.hostname,path:n.pathname}},k(e,n))}},{key:"mega",displayName:"Mega.nz",description:"Store backups in Mega.nz.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>d.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"msgroup",displayName:"Microsoft Office 365 Group",description:"Store backups in Microsoft Office 365 Group.",oauthField:"authid",customFields:{groupEmail:{type:"Email",name:"groupEmail",shortDescription:"Group email",longDescription:"Group email",formElement:e=>d.control(e??"",[de.email])},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>d.control(e??"")}},dynamicFields:["authid"],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]);return`${e.destinationType}://${n}${t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.hostname+n.pathname}},k(e,n))}},{key:"cloudfiles",displayName:"Rackspace CloudFiles",description:"Store backups in Rackspace CloudFiles.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>d.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>d.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>d.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{port:t,server:o,path:i}=e.custom;return`${e.destinationType}://${o+Re(t)+W(i)+n}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},k(e,n))}},{key:"rclone",displayName:"Rclone",description:"Store backups in Rclone.",dynamicFields:[{name:"rclone-local-repository",shortDescription:"Local repository",defaultValue:""},{name:"rclone-remote-repository",shortDescription:"Remote repository",defaultValue:""},{name:"rclone-remote-path",shortDescription:"Path on remote repository",defaultValue:""}],mapper:{to:e=>{let n=e.dynamic["rclone-remote-repository"],t=e.dynamic["rclone-remote-path"],o=Object.entries(e.dynamic).filter(([r])=>!["rclone-remote-repository","rclone-remote-path"].includes(r)),i=O([...Object.entries(e.advanced),...o]);return`${e.destinationType}://${n}/${t+i}`},from:(e,n,t)=>{let{advanced:o,dynamic:i}=k(e,n);return A({destinationType:e,dynamic:A({"rclone-remote-repository":n.hostname,"rclone-remote-path":n.pathname},i)},o)}}},{key:"openstack",displayName:"OpenStack Object Storage",description:"Store backups in OpenStack Object Storage.",customFields:{bucket:{type:"String",name:"bucket",shortDescription:"Bucket",longDescription:"Bucket",formElement:e=>d.control(e??"")}},dynamicFields:[{name:"openstack-authuri",shortDescription:"Auth URI",type:"Enumeration",loadOptions:e=>e.get(Fe).openstackProviders},{name:"openstack-version",shortDescription:"Version",type:"Enumeration",loadOptions:e=>e.get(Fe).openstackVersions},{name:"openstack-domain-name",shortDescription:"Domain name"},{name:"openstack-tenant-name",shortDescription:"Tenant name"},{name:"openstack-region",shortDescription:"Region"}],mapper:{to:e=>{let n=O([...Object.entries(e.advanced),...Object.entries(e.dynamic)]),{bucket:t}=e.custom;return`${e.destinationType}://${t+n}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.pathname,bucket:n.hostname}},k(e,n))}},{key:"webdav",displayName:"WebDAV",description:"Store backups in WebDAV.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>d.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>d.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>d.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"},{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let{port:n,server:t,path:o}=e.custom,i=e.dynamic["use-ssl"],r=O([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([p])=>p!=="use-ssl")]);return`${e.destinationType}${i?"s":""}://${t+Re(n)+W(o)+r}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},k(e,n))}},{key:"aftp",displayName:"FTP",description:"Store backups in FTP.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>d.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>d.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>d.control(e??"")}},dynamicFields:[{name:"auth-username",shortDescription:"Username"},{name:"auth-password",shortDescription:"Password"}],mapper:{to:e=>{let{port:n,server:t,path:o}=e.custom,i=O([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([r])=>r!=="use-ssl")]);return`${e.destinationType}://${t+Re(n)+W(o)+i}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},k(e,n))}},{key:"sia",displayName:"Sia Decentrilized Cloud",description:"Store backups in Sia Decentrilized Cloud.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>d.control(e??"")}},dynamicFields:["sia-targetpath","sia-password","sia-redundancy"],mapper:{to:e=>{let n=e.custom.server,t=e.dynamic["sia-targetpath"],o=O([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([i])=>i!=="sia-targetpath")]);return`${e.destinationType}://${n+W(t)+o}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.pathname}},k(e,n))}},{key:"cos",displayName:"Tencent COS",description:"Store backups in Tencent COS.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>d.control(e??"")}},dynamicFields:[{name:"cos-bucket",shortDescription:"Bucket",order:1},{name:"cos-region",shortDescription:"Region",order:2},{name:"cos-app-id",shortDescription:"COS App Id",order:3},{name:"cos-secret-id",shortDescription:"COS Secret Id",order:4},{name:"cos-secret-key",shortDescription:"COS Secret Key",order:5}],mapper:{to:e=>{let n=e.custom.path,t=O([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([o])=>o!=="cos-targetpath")]);return`${e.destinationType}://${n+t}`},from:(e,n,t)=>A({destinationType:e,custom:{path:n.pathname}},k(e,n))}},{key:"tahoe",displayName:"Tahoe LAFS",description:"Store backups in Tahoe LAFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>d.control(e??"")},port:{type:"Integer",name:"port",shortDescription:"Port",longDescription:"Port",formElement:e=>d.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>d.control(e??"")},username:{type:"String",name:"username",shortDescription:"Username",longDescription:"Username",formElement:e=>d.control(e??"")},password:{type:"Password",name:"password",shortDescription:"Password",longDescription:"Password",formElement:e=>d.control(e??"")}},dynamicFields:[{name:"use-ssl",shortDescription:"Use SSL"}],mapper:{to:e=>{let{port:n,server:t,path:o,username:i,password:r}=e.custom,p={"auth-username":i,"auth-password":r},_=e.dynamic["use-ssl"],S=O([...Object.entries(e.advanced),...Object.entries(e.dynamic).filter(([$])=>$!=="use-ssl"),...Object.entries(p)]);return`${e.destinationType}${_?"s":""}://${t+Re(n)+W(o)+S}`},from:(e,n,t)=>A({destinationType:e,custom:{server:n.hostname,port:n.port,path:n.pathname}},k(e,n))}},{key:"cifs",displayName:"CIFS",description:"Store backups in CIFS.",customFields:{server:{type:"String",name:"server",shortDescription:"Server",longDescription:"Server",formElement:e=>d.control(e??"")},share:{type:"String",name:"share",shortDescription:"Share Name",longDescription:"Share Name",formElement:e=>d.control(e??"")},path:{type:"String",name:"path",shortDescription:"Path on server",longDescription:"Path on server",formElement:e=>d.control(e??"")}},dynamicFields:["transport","auth-username","auth-password","auth-domain"],mapper:{to:e=>{let{share:n,server:t,path:o,username:i,password:r}=e.custom,p={"auth-username":i,"auth-password":r},_=new Map([...Object.entries(p),...Object.entries(e.advanced),...Object.entries(e.dynamic)]),S=O(Array.from(_));return`${e.destinationType}://${t+W(n)+W(o)+S}`},from:(e,n,t)=>{let o=n.pathname.split("/")[1],i=n.pathname.split("/").slice(2).join("/");return A({destinationType:e,custom:{server:n.hostname,share:o,path:i}},k(e,n))}}},{key:"filen",displayName:"Filen.io",description:"Store backups in Filen.io.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on Filen",longDescription:"Path on Filen",formElement:e=>d.control(e??"")}},dynamicFields:["auth-username","auth-password"],mapper:{to:e=>{let{path:n,username:t,password:o}=e.custom,i={"auth-username":t,"auth-password":o},r=new Map([...Object.entries(i),...Object.entries(e.advanced),...Object.entries(e.dynamic)]),p=O(Array.from(r));return`${e.destinationType}://${n+p}`},from:(e,n,t)=>{let o=n.hostname??"";return n.pathname&&o!==""&&n.pathname[0]!="/"&&(o+="/"),o+=n.pathname,A({destinationType:e,custom:{path:o}},k(e,n))}}},{key:"filejump",displayName:"Filejump",description:"Store backups in Filejump.",customFields:{path:{type:"String",name:"path",shortDescription:"Path on Filejump",longDescription:"Path on Filejump",formElement:e=>d.control(e??"")}},dynamicFields:[{type:"Password",name:"api-token",shortDescription:"API Token",longDescription:"Filejump API Token",formElement:e=>d.control(e??"")}],mapper:{to:e=>{let{path:n,username:t,password:o,apitoken:i}=e.custom,r=(i||"").trim()===""?{"auth-username":t,"auth-password":o}:{"api-token":i},p=new Map([...Object.entries(r),...Object.entries(e.advanced),...Object.entries(e.dynamic)]),_=O(Array.from(p));return`${e.destinationType}://${n+_}`},from:(e,n,t)=>{let o=n.hostname??"";return n.pathname&&o!==""&&n.pathname[0]!="/"&&(o+="/"),o+=n.pathname,A({destinationType:e,custom:{path:o}},k(e,n))}}},{key:"storj",customKey:"storjAccessGrant",displayName:"Storj Access Grant",description:"Store backups in Storj Access Grant.",dynamicFields:[{name:"storj-shared-access",shortDescription:"Access Grant"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server"}],mapper:{to:e=>`storj://storj.io/config?storj-auth-method=Access%20grant&storj-satellite=us1.storj.io%3A7777&storj-api-key&storj-secret&${O([...Object.entries(e.advanced),...Object.entries(e.dynamic)],!0)}`,from:(e,n,t)=>A({destinationType:e},k(e,n))}},{key:"storj",customKey:"storjApiKey",displayName:"Storj API Key",description:"Store backups in Storj API Key.",dynamicFields:[{name:"storj-satellite",shortDescription:"Satellite",type:"Enumeration",loadOptions:e=>e.get(Fe).storjSatellites},{name:"storj-api-key",shortDescription:"API Key"},{name:"storj-secret",shortDescription:"Secret"},{name:"storj-bucket",shortDescription:"Bucket"},{name:"storj-folder",shortDescription:"Path on server"}],mapper:{to:e=>`storj://storj.io/config?storj-auth-method=API%20key&${O([...Object.entries(e.advanced),...Object.entries(e.dynamic)],!0)}`,from:(e,n,t)=>A({destinationType:e},k(e,n))}}];var Wt=/[a-zA-Z0-9_\-\+\.!@#$%^&*?_~()-]/,lt=class e{generate(n,t=Wt){let o;do o=this.generatePassword(n,t);while(this.calculatePasswordStrength(o)<5);return o}generatePassword(n,t=Wt){return Array.apply(null,{length:n}).map(()=>{let o;for(;;)if(o=String.fromCharCode(Bt()),t.test(o))return o},this).join("")}calculatePasswordStrength(n){let t=1;return n.length>=8&&t++,n.match(/[a-z]/)&&n.match(/[A-Z]/)&&t++,n.match(/\d+/)&&t++,n.match(/.[!,@,#,$,%,^,&,*,?,_,~,(,),-]/)&&t++,Math.min(t,5)}static \u0275fac=function(t){return new(t||e)};static \u0275prov=he({token:e,factory:e.\u0275fac,providedIn:"root"})};var on=["formRef"];function rn(e,n){if(e&1&&g(0),e&2){let t=n.$implicit;H(" ",t.DisplayName," ")}}function an(e,n){if(e&1&&u(0,"spk-progress-bar",37),e&2){let t=c(3);Me("error",t.calculatePasswordStrength()===1)("warn",t.calculatePasswordStrength()===2)("primary",t.calculatePasswordStrength()===4)("success",t.calculatePasswordStrength()===5),m("value",t.calculatePasswordStrength()*(100/5))}}function sn(e,n){e&1&&(s(0,"span",32),I(1,9),a())}function ln(e,n){e&1&&(h(0,7,1),u(1,"spk-icon"),T())}function pn(e,n){e&1&&(h(0,7,2),u(1,"spk-icon"),T())}function cn(e,n){e&1&&(h(0,10,1),u(1,"spk-icon",39),T())}function mn(e,n){e&1&&(h(0,10,2),u(1,"spk-icon"),T())}function un(e,n){if(e&1){let t=x();s(0,"button",38),P("click",function(){E(t);let i=c(3);return y(i.copyPassword())}),h(1,10),F(2,cn,2,0)(3,mn,2,0),T(),a()}if(e&2){let t=c(3);l(2),f(t.copiedPassword()?2:3)}}function dn(e,n){e&1&&(s(0,"spk-alert",36),I(1,11),a())}function _n(e,n){if(e&1){let t=x();s(0,"div",27)(1,"spk-form-field")(2,"label",28),h(3,6),u(4,"sup"),T(),a(),u(5,"input",29),a(),F(6,an,1,9,"spk-progress-bar",30),s(7,"spk-form-field"),u(8,"input",31),F(9,sn,2,0,"span",32),a(),s(10,"div",33)(11,"button",34),P("click",function(){E(t);let i=c(2);return y(i.showPassword.set(!i.showPassword()))}),h(12,7),F(13,ln,2,0)(14,pn,2,0),T(),a(),s(15,"button",34),P("click",function(){E(t);let i=c(2);return y(i.generatePassword())}),h(16,8),u(17,"spk-icon"),T(),a(),F(18,un,4,1,"button",35),a(),F(19,dn,2,0,"spk-alert",36),a()}if(e&2){let t=c(2);l(5),m("type",t.showPassword()?"text":"password"),l(),f(t.generalForm.value.password?6:-1),l(2),m("type",t.showPassword()?"text":"password"),l(),f(t.generalForm.value.repeatPassword&&t.generalForm.value.repeatPassword!==t.generalForm.value.password?9:-1),l(4),f(t.showPassword()?13:14),l(5),f(t.showCopyPassword()?18:-1),l(),f(t.generalForm.value.password&&t.generalForm.value.password===t.generalForm.value.repeatPassword?19:-1)}}function Fn(e,n){if(e&1&&(s(0,"spk-select",24)(1,"label",25),I(2,5),a(),u(3,"input",26),F(4,rn,1,1,"ng-template"),a(),F(5,_n,20,7,"div",27)),e&2){let t=c();m("options",t.encryptionOptions())("isClearable",!1),l(5),f(t.encryptionFieldSignal()!==""?5:-1)}}function gn(e,n){if(e&1&&(s(0,"button",22),h(1,12),u(2,"spk-icon"),T(),a()),e&2){let t=c();m("disabled",t.generalForm.invalid)}}function Cn(e,n){if(e&1&&(s(0,"spk-tooltip",23)(1,"button",22),h(2,13),u(3,"spk-icon"),T(),a()()),e&2){let t=c();m("disabled",!(t.showCopyPassword()&&!t.copiedPassword())),l(),m("disabled",t.generalForm.invalid||t.showCopyPassword()&&!t.copiedPassword())}}var Ke=new Y,qt=(e={name:"",description:"",encryption:"",password:"",repeatPassword:""})=>Ke.group({name:Ke.control(e.name,[de.required]),description:Ke.control(e.description),encryption:Ke.control(e.encryption,[Xt()]),password:Ke.control(e.password,[Dt(n=>n?.value.encryption!=="",[de.required])]),repeatPassword:Ke.control(e.repeatPassword,[Dt(n=>n?.value.encryption!=="",[de.required])])}),At={Key:"",DisplayName:"None"},yt=class e{#n=M(le);#e=M(ye);#o=M(lt);#i=M(ge);#t=M(tt);formRef=Te.required("formRef");generalForm=this.#i.generalForm;generalFormSignal=this.#i.generalFormSignal;encryptionFieldSignal=this.#i.encryptionFieldSignal;encryptionOptions=this.#i.encryptionOptions;isNew=this.#i.isNew;showPassword=N(!1);copiedPassword=N(!1);showCopyPassword=N(!1);encryptionEffect=Ye(()=>{this.encryptionFieldSignal()===""&&(this.copiedPassword.set(!1),this.showCopyPassword.set(!1))});calculatePasswordStrength=L(()=>{let t=this.generalFormSignal()?.password??"";return this.#o.calculatePasswordStrength(t)});ngOnInit(){this.formRef().nativeElement.focus()}exit(){this.#i.exit()}async copyPassword(){let n=this.generalForm.controls.password.value;await this.#r(n??""),this.copiedPassword.set(!0)}async#r(n){try{await navigator.clipboard.writeText(n)}catch{try{let o=document.createElement("textarea");o.value=n,document.body.appendChild(o),o.select(),document.execCommand("copy"),document.body.removeChild(o)}catch(o){console.error("Failed to copy text: ",o)}}}displayFn(){let n=this.#t.systemInfo()?.EncryptionModules??[];return t=>{let o=[At,...n].find(i=>i.Key===t);return o?`${o.DisplayName}`:""}}generatePassword(){this.copiedPassword.set(!1);let n=this.#o.generate(16);this.generalForm.controls.password.setValue(n),this.generalForm.controls.repeatPassword.setValue(n),this.showCopyPassword.set(!0)}next(){this.#n.navigate(["destination"],{relativeTo:this.#e.parent})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ae({type:e,selectors:[["app-general"]],viewQuery:function(t,o){t&1&&De(o.formRef,on,5),t&2&&Ee()},decls:20,vars:3,consts:()=>{let n;n=$localize`Your backup name`;let t;t=$localize`Your backup description`;let o;o=$localize`General backup settings`;let i;i=$localize` Backup name ${"\uFFFD#7\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#7\uFFFD"}:CLOSE_SUPERSCRIPT:`;let r;r=$localize`Backup description`;let p;p=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Exit `;let _;_=$localize`Encryption`;let S;S=$localize`Encryption`;let $;$=$localize`Password`;let U;U=$localize`Repeat password`;let v;v=$localize` Create a password ${"\uFFFD#4\uFFFD"}:START_SUPERSCRIPT:*${"\uFFFD/#4\uFFFD"}:CLOSE_SUPERSCRIPT:`;let w;w=$localize`${"\uFFFD*13:1\uFFFD"}:START_BLOCK_IF:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye-slash${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: hide ${"\uFFFD/*13:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*14:2\uFFFD"}:START_BLOCK_ELSE:${"[\uFFFD#1:1\uFFFD|\uFFFD#1:2\uFFFD]"}:START_TAG_SPK_ICON:eye${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: show ${"\uFFFD/*14:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,w=Ie(w);let K;K=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:password${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Generate password `;let J;J=$localize`Passwords do not match`;let q;q=$localize`${"\uFFFD*2:1\uFFFD"}:START_BLOCK_IF:${"\uFFFD#1:1\uFFFD"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copied password ${"\uFFFD/*2:1\uFFFD"}:CLOSE_BLOCK_IF:${"\uFFFD*3:2\uFFFD"}:START_BLOCK_ELSE:${"\uFFFD#1:2\uFFFD"}:START_TAG_SPK_ICON_1:copy${"[\uFFFD/#1:1\uFFFD|\uFFFD/#1:2\uFFFD]"}:CLOSE_TAG_SPK_ICON: Copy password ${"\uFFFD/*3:2\uFFFD"}:CLOSE_BLOCK_ELSE:`,q=Ie(q);let C;C=$localize` Tip: Be sure to save your password. If you loose it you will lose access to your backups. `;let D;D=$localize` Continue ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let G;return G=$localize` Continue ${"\uFFFD#3\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#3\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],o,i,r,p,S,v,w,K,J,q,C,D,G,["autocomplete","off",3,"submit","formGroup"],[1,"title-30"],["for","backupName"],["type","text","tabindex","1","placeholder",n,"formControlName","name"],["for","backupDescription"],["id","backupDescription","tabindex","2","placeholder",t,"formControlName","description"],[1,"form-actions"],["type","button","spk-button","",3,"click"],["spk-button","","type","submit",1,"raised","primary",3,"disabled"],["message","Remember to copy the password",1,"primary",3,"disabled"],["value","Key","label","DisplayName",3,"options","isClearable"],["for","encryption"],["type","text","id","encryption","tabindex","3","placeholder",_,"formControlName","encryption"],[1,"passwords"],["for","password"],["id","password","tabindex","4","autocomplete","off","placeholder",$,"formControlName","password",3,"type"],[1,"raised",3,"error","warn","primary","success","value"],["id","repeatPassword","tabindex","5","autocomplete","off","placeholder",U,"formControlName","repeatPassword",3,"type"],["error",""],[1,"password-actions"],["spk-button","","type","button",1,"small",3,"click"],["spk-button","","type","button",1,"small","copy"],["type","primary"],[1,"raised",3,"value"],["spk-button","","type","button",1,"small","copy",3,"click"],[1,"spk-success"]]},template:function(t,o){if(t&1){let i=x();s(0,"form",14,0),P("submit",function(){return E(i),y(o.next())}),s(2,"h3",15),I(3,1),a(),s(4,"spk-form-field")(5,"label",16),h(6,2),u(7,"sup"),T(),a(),u(8,"input",17),a(),s(9,"spk-form-field")(10,"label",18),I(11,3),a(),u(12,"textarea",19),a(),F(13,Fn,6,3),s(14,"div",20)(15,"button",21),P("click",function(){return E(i),y(o.exit())}),h(16,4),u(17,"spk-icon"),T(),a(),F(18,gn,3,1,"button",22)(19,Cn,4,2,"spk-tooltip",23),a()()}t&2&&(m("formGroup",o.generalForm),l(13),f(o.isNew()?13:-1),l(5),f(o.encryptionFieldSignal()===""?18:19))},dependencies:[Oe,Pe,ue,_e,Ae,Ne,ke,ce,me,we,pe,Ze,Je,et],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}sup[_ngcontent-%COMP%]{padding:0 .125rem;color:var(--error-500)}.passwords[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}.password-actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;align-items:center}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.copy[_ngcontent-%COMP%] spk-icon.spk-success[_ngcontent-%COMP%]{color:var(--success-500)}"],changeDetection:0})};var Sn=["formRef"];function fn(e,n){if(e&1){let t=x();s(0,"div",26)(1,"spk-form-field")(2,"label",27),I(3,8),a(),s(4,"input",28,1),P("focus",function(){E(t);let i=oe(5);return y(i.showPicker())}),a(),s(6,"spk-icon",29),g(7,"clock"),a()(),s(8,"spk-form-field"),u(9,"label",30),s(10,"input",31,2),P("focus",function(){E(t);let i=oe(11);return y(i.showPicker())}),a(),s(12,"spk-icon",29),g(13,"calendar"),a()()(),X(14,32),s(15,"div",33)(16,"spk-form-field")(17,"label",34),I(18,9),a(),u(19,"input",35),a(),s(20,"spk-select",36),u(21,"input",37),a()(),s(22,"app-toggle-card",38),X(23,39),I(24,10),z(),s(25,"div",40)(26,"spk-toggle",21),h(27,11),u(28,"input",41),T(),a(),s(29,"spk-toggle",21),h(30,12),u(31,"input",42),T(),a(),s(32,"spk-toggle",21),h(33,13),u(34,"input",43),T(),a(),s(35,"spk-toggle",21),h(36,14),u(37,"input",44),T(),a(),s(38,"spk-toggle",21),h(39,15),u(40,"input",45),T(),a(),s(41,"spk-toggle",21),h(42,16),u(43,"input",46),T(),a(),s(44,"spk-toggle",21),h(45,17),u(46,"input",47),T(),a()()(),z()}if(e&2){let t=c();l(20),m("options",t.unitOptions)("isClearable",!1),l(2),m("disallowToggle",!0)}}var j=new Y,Qt=[{key:"s",label:$localize`Seconds`},{key:"m",label:$localize`Minutes`},{key:"h",label:$localize`Hours`},{key:"D",label:$localize`Days`},{key:"W",label:$localize`Weeks`},{key:"M",label:$localize`Months`},{key:"Y",label:$localize`Years`}],Yt=(e={autoRun:!0,nextTime:{time:"13:00",date:new Date().toISOString().split("T")[0]},runAgain:{repeatValue:1,repeatUnit:"D",allowedDays:{mon:!1,tue:!1,wed:!1,thu:!1,fri:!1,sat:!1,sun:!1}}})=>j.group({autoRun:j.control(e.autoRun),nextTime:j.group({time:j.control(e.nextTime.time),date:j.control(e.nextTime.date)}),runAgain:j.group({repeatValue:j.control(e.runAgain.repeatValue),repeatUnit:j.control(e.runAgain.repeatUnit),allowedDays:j.group({mon:j.control(e.runAgain.allowedDays.mon),tue:j.control(e.runAgain.allowedDays.tue),wed:j.control(e.runAgain.allowedDays.wed),thu:j.control(e.runAgain.allowedDays.thu),fri:j.control(e.runAgain.allowedDays.fri),sat:j.control(e.runAgain.allowedDays.sat),sun:j.control(e.runAgain.allowedDays.sun)})})}),Pt=class e{#n=M(ge);#e=M(le);#o=M(ye);formRef=Te.required("formRef");scheduleForm=this.#n.scheduleForm;scheduleFormSignal=this.#n.scheduleFormSignal;unitOptions=Qt;displayFn(n){let t=Qt.find(o=>o.key===n);return t?`${t.label}`:""}goBack(){this.#e.navigate(["source-data"],{relativeTo:this.#o.parent})}next(){this.#e.navigate(["options"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ae({type:e,selectors:[["app-schedule"]],viewQuery:function(t,o){t&1&&De(o.formRef,Sn,5),t&2&&Ee()},decls:18,vars:2,consts:()=>{let n;n=$localize`Schedule`;let t;t=$localize` Automatically run backups ${"\uFFFD#7\uFFFD\uFFFD/#7\uFFFD"}:TAG_INPUT:`;let o;o=$localize`If a date was missed, the job will run as soon as possible.`;let i;i=$localize`${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let r;r=$localize`${"\uFFFD#17\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#17\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let p;p=$localize`Next time`;let _;_=$localize`Run again every`;let S;S=$localize`Allowed days`;let $;$=$localize` Monday ${"\uFFFD#28\uFFFD\uFFFD/#28\uFFFD"}:TAG_INPUT:`;let U;U=$localize` Tuesday ${"\uFFFD#31\uFFFD\uFFFD/#31\uFFFD"}:TAG_INPUT:`;let v;v=$localize` Wednesday ${"\uFFFD#34\uFFFD\uFFFD/#34\uFFFD"}:TAG_INPUT:`;let w;w=$localize` Thursday ${"\uFFFD#37\uFFFD\uFFFD/#37\uFFFD"}:TAG_INPUT:`;let K;K=$localize` Friday ${"\uFFFD#40\uFFFD\uFFFD/#40\uFFFD"}:TAG_INPUT:`;let J;J=$localize` Saturday ${"\uFFFD#43\uFFFD\uFFFD/#43\uFFFD"}:TAG_INPUT:`;let q;return q=$localize` Sunday ${"\uFFFD#46\uFFFD\uFFFD/#46\uFFFD"}:TAG_INPUT:`,[["formRef",""],["timeRef",""],["dateRef",""],n,t,o,i,r,p,_,S,$,U,v,w,K,J,q,[3,"submit","formGroup"],[1,"title-30"],[1,"toggle-wrap"],[1,"raised","primary"],["type","checkbox","formControlName","autoRun"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],["formGroupName","nextTime",1,"row-inputs"],["for","time"],["type","time","id","time","formControlName","time",3,"focus"],["suffix",""],["for","date"],["type","date","id","date","formControlName","date",3,"focus"],["formGroupName","runAgain"],[1,"row-inputs"],["for","repeatValue"],["type","number","id","repeatValue","formControlName","repeatValue"],["value","key","label","label",3,"options","isClearable"],["type","text","id","repeatUnit","formControlName","repeatUnit"],["formGroupName","allowedDays",3,"disallowToggle"],["title",""],[1,"days-wrap"],["type","checkbox","formControlName","mon"],["type","checkbox","formControlName","tue"],["type","checkbox","formControlName","wed"],["type","checkbox","formControlName","thu"],["type","checkbox","formControlName","fri"],["type","checkbox","formControlName","sat"],["type","checkbox","formControlName","sun"]]},template:function(t,o){if(t&1){let i=x();s(0,"form",18,0),P("submit",function(){return E(i),y(o.next())}),s(2,"h3",19),I(3,3),a(),s(4,"div",20)(5,"spk-toggle",21),h(6,4),u(7,"input",22),T(),a(),s(8,"p"),I(9,5),a()(),F(10,fn,47,3),s(11,"div",23)(12,"button",24),P("click",function(){return E(i),y(o.goBack())}),h(13,6),u(14,"spk-icon"),T(),a(),s(15,"button",25),h(16,7),u(17,"spk-icon"),T(),a()()()}if(t&2){let i;m("formGroup",o.scheduleForm),l(10),f((i=o.scheduleFormSignal())!=null&&i.autoRun?10:-1)}},dependencies:[Oe,Pe,ue,Le,Ge,_e,Ae,Ne,ke,Ue,ce,be,pe,we,me,Be],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.toggle-wrap[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.25rem}.row-inputs[_ngcontent-%COMP%]{display:flex;align-items:flex-end;gap:.5rem}.row-inputs[_ngcontent-%COMP%] > *[_ngcontent-%COMP%]{flex:1 0}.days-wrap[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}"],changeDetection:0})};function hn(e,n){if(e&1){let t=x();s(0,"spk-select",0)(1,"input",4),P("ngModelChange",function(i){E(t);let r=c(2);return y(r.updateStateExpression(i))}),a()()}if(e&2){let t,o=c(2);m("options",o.fileGroupOptions())("isClearable",!1),l(),m("ngModel",(t=o.pathState())==null?null:t.expression)}}function Tn(e,n){if(e&1){let t=x();s(0,"spk-form-field")(1,"input",4),P("ngModelChange",function(i){E(t);let r=c(2);return y(r.updateStateExpression(i))}),a()()}if(e&2){let t,o=c(2);l(),m("ngModel",(t=o.pathState())==null?null:t.expression)}}function Dn(e,n){if(e&1){let t=x();s(0,"spk-select",0)(1,"input",1),P("ngModelChange",function(i){E(t);let r=c();return y(r.updateStateType(i))}),a()(),F(2,hn,2,3,"spk-select",0)(3,Tn,2,1,"spk-form-field"),s(4,"div",2),P("click",function(){E(t);let i=c();return y(i.removeFilter())}),s(5,"spk-icon",3),g(6,"x-circle"),a()()}if(e&2){let t,o,i=c();m("options",i.expressionOptions())("isClearable",!1),l(),m("ngModel",(t=i.pathState())==null?null:t.type),l(),f(((o=i.pathState())==null?null:o.type)==="-FileGroup"||((o=i.pathState())==null?null:o.type)==="+FileGroup"?2:3)}}var Jt=[{key:"Excludes folders where name contains",value:"-FolderNameIncludes"},{key:"Excludes folder",value:"-Folder"},{key:"Excludes files where name contains",value:"-FileNameIncludes"},{key:"Excludes file extension",value:"-Extension"},{key:"Excludes files where name matches regex",value:"-Regex"},{key:"Includes files where name matches regex",value:"+Regex"},{key:"Excludes file group",value:"-FileGroup"},{key:"Includes expression",value:"+Expression"},{key:"Excludes expression",value:"-Expression"},{key:"None",value:"-Unknown"}],En=[{key:"Applications",value:"Applications"},{key:"CacheFiles",value:"Cache Files"},{key:"TemporaryFiles",value:"Temporary Files"},{key:"OperatingSystem",value:"Operating System"},{key:"SystemFiles",value:"System Files"},{key:"DefaultExcludes",value:"Standard Excludes"}],mt=class e{path=Ft.required();osType=Ft();pathChange=_t();remove=_t();expressionOptions=N(Jt);fileGroupOptions=N(En);pathState=N(null);typeState=L(()=>{let n=this.pathState();return n?n.type:null});pathEffect=Ye(()=>{let n=this.path(),t=n.slice(1),o=n.startsWith("-")?"-":"+",i=this.osType()==="Windows",r=i?"\\":"/",p=t.startsWith("%");return t===""?this.pathState.set({type:"-Unknown",path:"___none___",expression:""}):p&&t.endsWith(r)||i&&t.slice(2).startsWith("\\")&&t.endsWith("\\")||t.startsWith(r)&&t.endsWith(r)?this.pathState.set({type:`${o}Folder`,path:t,expression:t}):t.startsWith("*")&&t.endsWith(`*${r}`)?this.pathState.set({type:`${o}FolderNameIncludes`,path:t,expression:t.slice(1,-2)}):t.startsWith("[.*")&&t.endsWith(`[^\\${r}]*]`)?this.pathState.set({type:`${o}FileNameIncludes`,path:t,expression:t.slice(3,-7)}):t.startsWith("{")&&t.endsWith("}")?this.pathState.set({type:`${o}FileGroup`,path:t,expression:t.slice(1,-1)}):t.startsWith("[")&&t.endsWith("]")?this.pathState.set({type:`${o}Regex`,path:t,expression:t.slice(1,-1)}):t.startsWith("*.")?this.pathState.set({type:`${o}Extension`,path:t,expression:t.slice(2)}):this.pathState.set({type:`${o}Expression`,path:t,expression:t})});updateStateType(n){this.pathState.update(t=>(t.type=n,t.path=this.#e(t),t)),this.#n()}updateStateExpression(n){this.pathState.update(t=>(t.expression=n,t.path=this.#e(t),t)),this.#n()}#n(){setTimeout(()=>this.pathChange.emit(this.pathState().path))}#e(n){let t=n.type.slice(0,1),o=n.type.slice(1),i=this.osType()==="Windows",r=i?"\\":"/",_=i&&!n.expression.startsWith("%")?n.expression.slice(2):n.expression,S=n.path.startsWith("%");if(o==="Unknown")return`${t}${n.expression}`;if(o==="Folder"){let $=S||_.startsWith(r),U=_.endsWith(r);return U&&$?`${t}${n.expression}`:U?`${t}${n.expression}${r}`:$?`${t}${r}${n.expression}`:`${t}${r}${n.expression}${r}`}return o==="FolderNameIncludes"?`${t}*${n.expression}*${r}`:o==="FileNameIncludes"?`${t}[.*${n.expression}[^\\${r}]*]`:o==="FileGroup"?`${t}{${n.expression}}`:o==="Regex"?`${t}[${n.expression}]`:o==="Extension"?`${t}*.${n.expression}`:`${t}${n.expression}`}removeFilter(){this.remove.emit()}displayFn(n){let t=Jt.find(o=>o.value===n);return t?t.key:""}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ae({type:e,selectors:[["app-filter"]],inputs:{path:[1,"path"],osType:[1,"osType"]},outputs:{pathChange:"pathChange",remove:"remove"},decls:1,vars:1,consts:()=>{let n;return n=$localize`Select an option...`,[["value","value","label","key",3,"options","isClearable"],["type","text","placeholder",n,3,"ngModelChange","ngModel"],[1,"filter-removal",3,"click"],[1,"spk-primary"],["type","text",3,"ngModelChange","ngModel"]]},template:function(t,o){t&1&&F(0,Dn,7,4),t&2&&f(o.pathState()?0:-1)},dependencies:[it,ue,_e,Kt,pe,ce,me],styles:["[_nghost-%COMP%]{display:grid;grid-template-columns:13.125rem 1fr 1.875rem;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] spk-select[_ngcontent-%COMP%]{--miw: initial}[_nghost-%COMP%] spk-form-field[_ngcontent-%COMP%]{min-width:110px}[_nghost-%COMP%] spk-form-field[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{min-width:110px}[_nghost-%COMP%] .filter-removal[_ngcontent-%COMP%]{cursor:pointer;display:flex;align-items:center;justify-content:center;height:2.5rem;flex:0 0}"],changeDetection:0})};var yn=["formRef"];function An(e,n){if(e&1){let t=x();s(0,"app-filter",42),P("pathChange",function(i){let r=E(t).$index,p=c(2);return y(p.patchPathAt(i,r))})("remove",function(){let i=E(t).$index,r=c(2);return y(r.removePathAt(i))}),a()}if(e&2){let t,o=n.$implicit,i=c(2);m("path",o)("osType",(t=i.osType())!==null&&t!==void 0?t:"")}}function Pn(e,n){if(e&1&&te(0,An,1,2,"app-filter",41,ee),e&2){let t=c();ne(t.pathArray())}}function Nn(e,n){if(e&1&&(s(0,"div",40)(1,"spk-form-field"),u(2,"input",43),a(),s(3,"spk-select",44),u(4,"input",45),a()()),e&2){let t=c();l(3),m("options",t.sizeOptions())("isClearable",!1)}}var Se=new Y,kn=["Bytes","KB","MB","GB","TB","PB"],Zt=(e={path:"",filters:[],excludes:{hidden:!1,system:!1,temporary:!1,filesLargerThan:null}})=>Se.group({path:Se.control(e.path),excludes:Se.group({hidden:Se.control(e.excludes.hidden),system:Se.control(e.excludes.system),temporary:Se.control(e.excludes.temporary),filesLargerThan:Se.group({size:Se.control(null),unit:Se.control(null)})})}),Nt=class e{#n=M(ge);#e=M(le);#o=M(ye);formRef=Te.required("formRef");sourceDataForm=this.#n.sourceDataForm;sourceDataFormSignal=this.#n.sourceDataFormSignal;newPathCtrl=new nt("");filesLargerThan=L(()=>this.sourceDataFormSignal()?.excludes?.filesLargerThan?.size!==null);sizeOptions=N(kn);osType=this.#n.osType;pathSignal=B(this.sourceDataForm.controls.path.valueChanges);pathArray=L(()=>this.pathSignal()?.split("\0").filter(n=>n.startsWith("-")||n.startsWith("+")||n==="___none___")??[]);addFilter(n="-*"){let t=this.sourceDataForm.controls.path.value;this.sourceDataForm.controls.path.setValue(`${t}\0${n}`)}patchPathAt(n,t){let i=this.sourceDataForm.controls.path.value.split("\0").filter(p=>!p.startsWith("-")&&!p.startsWith("+")).join("\0"),r=this.pathArray().map((p,_)=>_===t?`${n}`:`${p}`).join("\0");this.sourceDataForm.controls.path.setValue(`${i}\0${r}`)}removePathAt(n){let o=this.sourceDataForm.controls.path.value.split("\0").filter(r=>!r.startsWith("-")&&!r.startsWith("+")).join("\0"),i=this.pathArray().filter((r,p)=>p!==n).join("\0");this.sourceDataForm.controls.path.setValue(`${o}\0${i}`)}getPath(){return this.sourceDataForm.value.path??null}toggleFilesLargerThan(){this.sourceDataForm.controls.excludes.value.filesLargerThan?.size===null?this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:50,unit:"MB"}):this.sourceDataForm.controls.excludes.controls.filesLargerThan.setValue({size:null,unit:null})}addNewPath(){let n=this.sourceDataForm.controls.path.value,t=this.newPathCtrl.value;this.sourceDataForm.controls.path.setValue(`${n}\0${t}`),this.newPathCtrl.setValue("")}goBack(){this.#e.navigate(["destination"],{relativeTo:this.#o.parent})}next(){this.#e.navigate(["schedule"],{relativeTo:this.#o.parent})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ae({type:e,selectors:[["app-source-data"]],viewQuery:function(t,o){t&1&&De(o.formRef,yn,5),t&2&&Ee()},decls:55,vars:12,consts:()=>{let n;n=$localize`Path`;let t;t=$localize`Add a direct path`;let o;o=$localize`Hidden files`;let i;i=$localize`System files`;let r;r=$localize`Temporary files`;let p;p=$localize`Source Data`;let _;_=$localize`Folder path`;let S;S=$localize`${"\uFFFD#12\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let $;$=$localize`${"\uFFFD#15\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#15\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let U;U=$localize`Source Data`;let v;v=$localize`Add Path`;let w;w=$localize`Add a path directly from your machine.`;let K;K=$localize`Filters`;let J;J=$localize`Customize your filters.`;let q;q=$localize`Add filter`;let C;C=$localize`Exclude`;let D;D=$localize`Choose if there’s any files you want to exclude.`;let G;G=$localize` Hidden files ${"\uFFFD#45\uFFFD\uFFFD/#45\uFFFD"}:TAG_INPUT:`;let R;R=$localize` System files ${"\uFFFD#48\uFFFD\uFFFD/#48\uFFFD"}:TAG_INPUT:`;let Q;Q=$localize` Temporary files ${"\uFFFD#51\uFFFD\uFFFD/#51\uFFFD"}:TAG_INPUT:`;let ie;ie=$localize` Files larger than `;let Z;return Z=$localize`Select an option...`,[["formRef",""],p,_,S,$,U,v,w,K,J,q,C,D,G,R,Q,ie,[3,"submit","formGroup"],[1,"left"],[1,"title-30"],[1,"fill",3,"multiSelect","startingPath","showFiles"],["for","path"],["type","text","id","path","tabindex","4","placeholder",n,"formControlName","path"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[1,"right"],[3,"disallowToggle"],["title",""],["description",""],[1,"row-inputs"],["type","text","placeholder",t,3,"formControl"],["spk-button","","type","button",1,"raised","primary",3,"click"],["type","button","spk-button","","action","",3,"click"],["formGroupName","excludes",3,"disallowToggle"],[1,"raised","primary"],["type","checkbox","placeholder",o,"formControlName","hidden"],["type","checkbox","placeholder",i,"formControlName","system"],["type","checkbox","placeholder",r,"formControlName","temporary"],[1,"raised","primary",3,"click"],["formGroupName","filesLargerThan",1,"row-inputs"],[3,"path","osType"],[3,"pathChange","remove","path","osType"],["type","number","formControlName","size"],[3,"options","isClearable"],["type","text","formControlName","unit","placeholder",Z]]},template:function(t,o){if(t&1){let i=x();s(0,"form",17,0),P("submit",function(){return E(i),y(o.next())}),s(2,"div",18)(3,"h3",19),I(4,1),a(),s(5,"app-file-tree",20)(6,"label",21),I(7,2),a(),u(8,"input",22),a(),s(9,"div",23)(10,"button",24),P("click",function(){return E(i),y(o.goBack())}),h(11,3),u(12,"spk-icon"),T(),a(),s(13,"button",25),h(14,4),u(15,"spk-icon"),T(),a()()(),s(16,"div",26)(17,"h3",19),I(18,5),a(),s(19,"app-toggle-card",27),X(20,28),I(21,6),z(),s(22,"p",29),I(23,7),a(),s(24,"div",30)(25,"spk-form-field"),u(26,"input",31),a(),s(27,"button",32),P("click",function(){return E(i),y(o.addNewPath())}),s(28,"spk-icon"),g(29,"plus"),a()()()(),s(30,"app-toggle-card",27),X(31,28),I(32,8),z(),s(33,"p",29),I(34,9),a(),s(35,"button",33),P("click",function(){return E(i),y(o.addFilter())}),I(36,10),a(),F(37,Pn,2,0),a(),s(38,"app-toggle-card",34),X(39,28),I(40,11),z(),s(41,"p",29),I(42,12),a(),s(43,"spk-toggle",35),h(44,13),u(45,"input",36),T(),a(),s(46,"spk-toggle",35),h(47,14),u(48,"input",37),T(),a(),s(49,"spk-toggle",35),h(50,15),u(51,"input",38),T(),a(),s(52,"spk-toggle",39),P("click",function(){return E(i),y(o.toggleFilesLargerThan())}),I(53,16),a(),F(54,Nn,5,2,"div",40),a()()()}if(t&2){let i;m("formGroup",o.sourceDataForm),l(5),m("multiSelect",!0)("startingPath",o.getPath())("showFiles",!0),l(14),m("disallowToggle",!0),l(7),m("formControl",o.newPathCtrl),l(4),m("disallowToggle",!0),l(7),f((i=o.pathSignal())!=null&&i.length?37:-1),l(),m("disallowToggle",!0),l(14),Me("active",o.filesLargerThan()),l(2),f(o.filesLargerThan()?54:-1)}},dependencies:[it,Pe,ue,Le,Ge,_e,Ae,Oe,ot,Ne,ke,Ue,ce,pe,we,be,me,rt,Be,mt],styles:["[_nghost-%COMP%]{display:flex;flex-direction:column;width:100%;flex:1 0;overflow:hidden}form[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;flex:1 0;overflow:hidden}.right[_ngcontent-%COMP%], .left[_ngcontent-%COMP%]{flex:1 0;display:flex;flex-direction:column;gap:1.5rem}.left[_ngcontent-%COMP%]{padding:2.5rem;overflow:hidden;border-right:1px solid var(--base-level-40)}.right[_ngcontent-%COMP%]{padding:2.5rem 1.5rem;overflow:auto}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.row-inputs[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr min-content;gap:.5rem}"],changeDetection:0})};var en="1W:1D,4W:1W,12M:1M",fe=new Y,ge=class e{#n=M(le);#e=M(tt);#o=M(ve);#i=M(at);generalForm=qt();sourceDataForm=Zt();scheduleForm=Yt();destinationForm=tn();settings=N([]);optionsFields={remoteVolumeSize:N("50MB"),backupRetention:N("all"),backupRetentionTime:N(""),backupRetentionVersions:N(0),backupRetentionCustom:N("")};isDraft=N(!1);backupId=N(null);isSubmitting=N(!1);finishedLoading=N(!1);backupDefaults=N(null);isNew=L(()=>this.backupId()==="new");osType=L(()=>this.#e.systemInfo()?.OSType);selectedOptions=N([]);selectedAdvancedFormPair=N([]);destinationFormPair=N({oauthField:null,custom:[],dynamic:[],advanced:[]});notSelectedAdvancedFormPair=L(()=>{let n=this.destinationFormPair()?.advanced??[],t=this.selectedAdvancedFormPair()??[];return n.filter(o=>t.findIndex(i=>i.name===o.name)===-1)});selectedHttpOptions=N([]);notSelectedHttpOptions=L(()=>{let n=this.httpOptions(),t=this.selectedHttpOptions()??[];return n.filter(o=>t.findIndex(i=>i.name===o.name)===-1)});sourceDataFormSignal=B(this.sourceDataForm.valueChanges);destinationFormSignal=B(this.destinationForm.valueChanges);generalFormSignal=B(this.generalForm.valueChanges);encryptionFieldSignal=B(this.generalForm.controls.encryption.valueChanges);scheduleFormSignal=B(this.scheduleForm.valueChanges);destinationOptions=L(()=>this.#e.backendModules()??[]);httpOptions=L(()=>this.#e.systemInfo()?.GenericModules?.find(n=>n.Key==="http-options")?.Options?.map(this.#t)??[]);advancedOptions=L(()=>this.#e.systemInfo()?.Options?.map(this.#t)??[]);#t(n){return{name:n.Name,type:n.Type,shortDescription:n.ShortDescription??void 0,longDescription:n.LongDescription??void 0,options:n.ValidValues}}encryptionOptions=L(()=>{let n=this.#e.systemInfo()?.EncryptionModules??[];return[At,...n]});nonSelectedOptions=L(()=>this.advancedOptions().sort((n,t)=>n?.name&&t?.name?n?.name.localeCompare(t?.name):0).filter(n=>this.selectedOptions()?.findIndex(t=>t.name===n.name)===-1));addAdvancedFormPairByName(n,t,o){let i=this.notSelectedAdvancedFormPair().find(r=>r.name===n);i&&this.addAdvancedFormPair(i,t,o)}addHttpOptionByName(n,t,o){let i=this.notSelectedHttpOptions().find(r=>r.name===n);i&&this.addHttpOption(i,t,o)}addAdvancedFormPair(n,t,o){let i=this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced,r=o??n.defaultValue;this.createFormField(i,n,r),this.selectedAdvancedFormPair.set([...this.selectedAdvancedFormPair(),n])}addHttpOption(n,t,o){let i=this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced,r=o??n.defaultValue;this.createFormField(i,n,r),this.selectedHttpOptions.set([...this.selectedHttpOptions(),n])}removeAdvancedFormPair(n,t){this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced.removeControl(n.name),this.selectedAdvancedFormPair().findIndex(i=>i.name===n.name)!==-1?this.selectedAdvancedFormPair.update(i=>(i=i.filter(r=>r.name!==n.name),i)):this.selectedHttpOptions.update(i=>(i=i.filter(r=>r.name!==n.name),i))}removeHttpOption(n,t){this.destinationForm.controls.destinations.controls.at(t)?.controls.advanced.removeControl(n.name),this.selectedHttpOptions.update(o=>(o=o.filter(i=>i.name!==n.name),o))}submit(){this.isSubmitting.set(!0);let n=this.#l(),t=this.backupId();t==="new"||!t||this.isDraft()?this.#o.postApiV1Backups({requestBody:n}).pipe(Xe(()=>this.isSubmitting.set(!1))).subscribe({next:o=>{this.exit()},error:o=>{}}):this.#o.putApiV1BackupById({id:t,requestBody:n}).pipe(Xe(()=>this.isSubmitting.set(!1))).subscribe({next:o=>{this.exit()},error:o=>{}})}exit(){this.#c(),this.#n.navigate(["/"])}updateFieldsFromTargetUrl(n){this.#r(),setTimeout(()=>{this.#s(n)})}#r(){this.destinationFormPair.set({oauthField:null,custom:[],dynamic:[],advanced:[]}),this.selectedAdvancedFormPair.set([]),this.selectedHttpOptions.set([]),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset()}mapSourceDataToForm(n){let t=n.Sources??"",o=n.Filters?.map(_=>`${_.Include?"":"-"}${_.Expression}`)??[],i=n.Settings?.find(_=>_.Name==="--exclude-files-attributes")?.Value??"",r=n.Settings?.find(_=>_.Name==="--skip-files-larger-than")??null,p={path:[...t,...o].join("\0"),excludes:{hiddenFiles:i.includes("hidden"),systemFiles:i.includes("system"),tempFiles:i.includes("temporary"),filesLargerThan:r?.Value?.toUpperCase()??null}};this.sourceDataForm.patchValue(p)}mapDestinationToForm(n){let t=n.TargetURL?Et(n.TargetURL):null;t&&this.addDestinationFormGroup(t.destinationType,{custom:t.custom,dynamic:t.dynamic,advanced:t.advanced},!0)}#s(n){let t=Et(n);t&&this.addDestinationFormGroup(t.destinationType,{custom:t.custom,dynamic:t.dynamic,advanced:t.advanced},!0)}mapGeneralToForm(n){let t=n.Settings?.find(r=>r.Name==="encryption-module"),o=t?.Value&&t.Value.length?t.Value:"",i={name:n.Name??"",description:n.Description??""};o&&o!==""&&(i.encryption=o),this.generalForm.patchValue(i)}mapScheduleToForm(n){if(!n){this.scheduleForm.patchValue({autoRun:!1});return}let t=this.#i.fromString(n.Repeat)??null,i={nextTime:this.#p(n.Time),runAgain:{repeatValue:t?.value??1,repeatUnit:t?.unit??"D",allowedDays:{mon:n.AllowedDays?.includes("mon")??!1,tue:n.AllowedDays?.includes("tue")??!1,wed:n.AllowedDays?.includes("wed")??!1,thu:n.AllowedDays?.includes("thu")??!1,fri:n.AllowedDays?.includes("fri")??!1,sat:n.AllowedDays?.includes("sat")??!1,sun:n.AllowedDays?.includes("sun")??!1}}};this.scheduleForm.patchValue(i)}mapOptionsToForms(n){let t=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","dblock-size","keep-time","keep-versions","retention-policy"],o=n.Settings?.filter(p=>!t.includes(p.Name)),i=n.Settings?.filter(p=>t.includes(p.Name));this.settings.set(o??[]),o?.forEach(p=>{if(p.Name==="encryption-module")return this.generalForm.controls.encryption.setValue(p.Value??"")});var r="all";i?.forEach(p=>{if(console.log("x",p.Name),p.Name==="dblock-size"&&this.optionsFields.remoteVolumeSize.set(p.Value??"50MB"),p.Name==="keep-time")return r="time",this.optionsFields.backupRetentionTime.set(p.Value??"");if(p.Name==="keep-versions")return r="versions",this.optionsFields.backupRetentionVersions.set(p.Value?parseInt(p.Value):null);if(p.Name==="retention-policy")if(p.Value===en)r="smart";else return r="custom",this.optionsFields.backupRetentionCustom.set(p.Value??"")}),this.optionsFields.backupRetention.set(r)}getCurrentTargetUrl(){return this.#a(this.destinationForm.controls.destinations)}#l(){let n=this.generalForm.value,t=this.scheduleForm.value,o=this.sourceDataForm.value,r=this.destinationForm.value.destinations?.length?this.#a(this.destinationForm.controls.destinations):[],p=null;t.runAgain?.repeatUnit&&t.runAgain?.repeatValue&&(p=this.#i.toString(t.runAgain.repeatValue,t.runAgain.repeatUnit));let _=t.runAgain?.allowedDays?Object.entries(t.runAgain?.allowedDays).filter(([w,K])=>K).map(([w,K])=>w):[],S=o.path?.split("\0")??[],$=this.mapFormsToSettings(),U=Object.entries(o.excludes??{}).filter(([w,K])=>K&&w!=="filesLargerThan").map(([w])=>w),v=o.excludes?.filesLargerThan;return U.length&&$.push({Name:"--exclude-files-attributes",Value:U.join(",")}),v&&v.size!==null&&v.unit!==null&&$.push({Name:"--skip-files-larger-than",Value:`${v.size}${v.unit}`}),{Backup:{Name:n.name,Description:n.description,TargetURL:r[0]??null,Sources:S.filter(w=>!w.startsWith("-")),Settings:$,Filters:S.filter(w=>w.startsWith("-")).map((w,K)=>({Order:K,Include:!1,Expression:w.slice(1)}))},Schedule:t.autoRun?{Repeat:p,Time:t.nextTime?.date?new Date(`${t.nextTime.date}T${t.nextTime?.time||"00:00:00"}`).toISOString():null,AllowedDays:_}:null}}mapFormsToSettings(n=[]){let t=this.generalForm.value,o=["--no-encryption","--exclude-files-attributes","--skip-files-larger-than","keep-time","keep-versions","retention-policy","dblock-size"],i=[{Name:"--no-encryption",Value:"True"}];t.encryption!==""&&(i=[{Name:"encryption-module",Value:t.encryption??null},{Name:"passphrase",Value:t.password??null}]);let r=[{Name:"dblock-size",Value:this.optionsFields.remoteVolumeSize()}];switch(this.optionsFields.backupRetention()){case"time":r.push({Name:"keep-time",Value:this.optionsFields.backupRetentionTime()});break;case"versions":r.push({Name:"keep-versions",Value:this.optionsFields.backupRetentionVersions()?.toString()??""});break;case"custom":r.push({Name:"retention-policy",Value:this.optionsFields.backupRetentionCustom()});break;case"smart":r.push({Name:"retention-policy",Value:en});break}let p=[...n,...o],_=this.settings().filter(S=>!p.includes(S.Name)).map(S=>{let $=S.Value;return typeof S.Value=="number"&&($=S.Value.toString()),typeof S.Value=="boolean"&&($=S.Value?"True":"False"),{Name:S.Name,Value:$}});return[...i,...r,..._]}#a(n){return n.controls.map(t=>st(t.value))}#p(n){if(!n||n?.indexOf("T")===-1)return{time:n??"13:00"};let t=new Date(n),o={time:`${(""+t.getHours()).padStart(2,"0")}:${(""+t.getMinutes()).padStart(2,"0")}`};return n.indexOf("T")!==-1&&(o.date=t.toISOString().split("T")[0]),o}createFormField(n,t,o){if(t.type==="String"||t.type==="FileTree"||t.type==="FolderTree"||t.type==="Password"||t.type==="Enumeration"||t.type==="NonValidatedSelectableString"||t.type==="Path"){n.addControl(t.name,fe.control(o));return}if(t.type==="Size"){n.addControl(t.name,fe.control(o));return}if(t.type==="Integer"){n.addControl(t.name,fe.control(o?parseInt(o):0));return}if(t.type==="Boolean"){n.addControl(t.name,fe.control(o==="true"||o==="True"));return}if(t.type==="Flags"){n.addControl(t.name,fe.control(o??""));return}if(t.type==="Timespan"||t.type==="DateTime"){n.addControl(t.name,fe.control(o,[de.pattern(/([-+]?\d{1,3}[smhDWMY])+/)]));return}}addDestinationFormGroup(n,t,o=!1){let i=Ce.find(C=>C.customKey===n||C.key===n),r=i?.key,p=this.destinationOptions().find(C=>C.Key===r),_=this.httpOptions();if(!p||!p.Options)return;let S=i&&i.oauthField?i.oauthField:null,$=i&&i.customFields?i.customFields:{},U=i&&i.dynamicFields?i.dynamicFields:[],v=i&&i.advancedFields?i.advancedFields:[],w=i&&i.ignoredAdvancedFields?i.ignoredAdvancedFields:[];this.destinationFormPair.set({oauthField:S,custom:[],dynamic:[],advanced:[]});let K=fe.group({}),J=fe.group({}),q=fe.group({});$&&Object.entries($).forEach(([C,D],G)=>{let ie=D,{formElement:R}=ie,Q=Ot(ie,["formElement"]);K.addControl(C,R(t?.custom[C])),this.destinationFormPair.update(Z=>(Z.custom.push(A({order:900+G},Q)),Z))});for(let C=0;C<p.Options.length;C++){let D=p.Options[C];if(D.Deprecated)continue;let G=U.find(R=>R===D.Name||R.name===D.Name);if(G){let R=G&&typeof G!="string",Q=R?G?.defaultValue??D.DefaultValue:D.DefaultValue,ie={name:D.Name,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,order:900+C},Z=R?A(A({},ie),G):ie,Qe=t?.dynamic[D.Name]??Q??D.DefaultValue;this.createFormField(J,Z,Qe),this.destinationFormPair.update(xe=>(xe.dynamic.push(Z),xe))}else{if(w.find(re=>re===D.Name))continue;let Q=v.find(re=>re===D.Name||re.name===D.Name),ie=Q&&typeof Q!="string",Z=t?.advanced[D.Name],b=Z??D.DefaultValue,Qe={name:D.Name,type:D.Type,shortDescription:D.ShortDescription??void 0,longDescription:D.LongDescription??void 0,options:D.ValidValues,defaultValue:b,order:900+C},xe=ie?A(A({},Qe),Q):Qe;o&&Z&&(this.createFormField(q,xe,b),this.selectedAdvancedFormPair.update(re=>(re.push(xe),re))),this.destinationFormPair.update(re=>(re.advanced.push(xe),re))}}for(let C=0;C<_.length;C++){let D=_[C],G=t?.advanced[D.name],R=G??D.defaultValue;o&&G&&(this.createFormField(q,D,R),this.selectedHttpOptions.update(Q=>(Q.push(D),Q)))}this.destinationFormPair.update(C=>({oauthField:C.oauthField,custom:C.custom.sort((D,G)=>D.order-G.order),dynamic:C.dynamic.sort((D,G)=>D.order-G.order),advanced:C.advanced.sort((D,G)=>D.order-G.order)})),this.destinationForm.controls.destinations.push(nn({key:i?.customKey??n,customGroup:K,dynamicGroup:J,advancedGroup:q}))}#c(){this.generalForm.reset(),this.destinationForm.controls.destinations.clear(),this.destinationForm.reset(),this.sourceDataForm.reset(),this.scheduleForm.reset(),this.optionsFields.remoteVolumeSize.set("50MB"),this.optionsFields.backupRetention.set("all"),this.settings.set([])}static \u0275fac=function(t){return new(t||e)};static \u0275prov=he({token:e,factory:e.\u0275fac,providedIn:"root"})};var On=["formRef"],$n=(e,n,t,o)=>({index:e,formView:n,formGroupName:"custom",destinationType:t,oauthField:o}),dt=e=>({$implicit:e}),Rn=(e,n,t,o)=>({index:e,formView:n,formGroupName:"dynamic",destinationType:t,oauthField:o}),Mn=(e,n,t,o)=>({index:e,formView:n,formGroupName:"advanced",destinationType:t,oauthField:o}),In=(e,n,t,o)=>({index:e,formView:n,formGroupName:"advanced",asHttpOptions:!0,destinationType:t,oauthField:o}),xn=()=>({maxWidth:"700px",width:"100%"});function vn(e,n){e&1&&(h(0,5,2),u(1,"spk-icon"),T())}function wn(e,n){e&1&&I(0,5,3)}function bn(e,n){if(e&1){let t=x();h(0,5,1),s(1,"button",21),P("click",function(){E(t);let i=c();return y(i.testDestination())}),F(2,vn,2,0)(3,wn,1,0),a(),T()}if(e&2){let t=c();l(),Me("success",t.successfulTest()),l(),f(t.successfulTest()?2:3)}}function Gn(e,n){if(e&1){let t=x();s(0,"p",27),P("click",function(){E(t);let i=c();return y(i.removeDestinationFormGroup(i.destinationCount()-1))}),h(1,8),u(2,"span",28),T(),a()}}function Ln(e,n){if(e&1){let t=x();s(0,"div",34),P("click",function(){let i=E(t).$implicit,r=c(2);return y(r.addDestinationFormGroup(i.key))}),s(1,"h3"),g(2),a(),s(3,"p"),g(4),a()()}if(e&2){let t=n.$implicit;l(2),St(t.displayName),l(2),St(t.description)}}function Un(e,n){if(e&1){let t=x();s(0,"button",35,1),P("click",function(){let i=E(t).$implicit,r=c(2);return y(r.addDestinationFormGroup(i.key))}),g(2),a()}if(e&2){let t=n.$implicit;l(2),H(" ",t.displayName," ")}}function Vn(e,n){if(e&1&&(s(0,"div",29),te(1,Ln,5,2,"div",30,ee),a(),s(3,"spk-menu",31)(4,"button",32),I(5,9),a(),X(6,20),te(7,Un,3,1,"button",33,ee),z(),a()),e&2){let t=c();l(),ne(t.destinationTypeOptionsFocused()),l(2),m("searchable",!0),l(4),ne(t.destinationTypeOptionsNotFocused())}}function Bn(e,n){e&1&&ze(0)}function Kn(e,n){if(e&1&&F(0,Bn,1,0,"ng-container",40),e&2){let t,o=n.$implicit,i=n.$index;c();let r=oe(29),p=c();m("ngTemplateOutlet",r)("ngTemplateOutletContext",je(7,dt,We(2,$n,i,o,(t=p.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,p.destinationFormPair().oauthField)))}}function Hn(e,n){e&1&&ze(0)}function Xn(e,n){if(e&1&&F(0,Hn,1,0,"ng-container",40),e&2){let t,o=n.$implicit,i=n.$index;c();let r=oe(29),p=c();m("ngTemplateOutlet",r)("ngTemplateOutletContext",je(7,dt,We(2,Rn,i,o,(t=p.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,p.destinationFormPair().oauthField)))}}function zn(e,n){if(e&1){let t=x();h(0,10,1),s(1,"button",35,1),P("click",function(){let i=E(t).$implicit,r=c(2);return y(r.addAdvancedFormPair(i,0))}),a(),T()}if(e&2){let t=n.$implicit;l(),gt(t.name),Ct(0)}}function jn(e,n){e&1&&ze(0)}function Wn(e,n){if(e&1&&F(0,jn,1,0,"ng-container",40),e&2){let t,o=n.$implicit,i=n.$index;c();let r=oe(29),p=c();m("ngTemplateOutlet",r)("ngTemplateOutletContext",je(7,dt,We(2,Mn,i,o,(t=p.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,p.destinationFormPair().oauthField)))}}function qn(e,n){if(e&1){let t=x();h(0,11,1),s(1,"button",35,1),P("click",function(){let i=E(t).$implicit,r=c(2);return y(r.addHttpOption(i,0))}),a(),T()}if(e&2){let t=n.$implicit;l(),gt(t.name),Ct(0)}}function Qn(e,n){e&1&&ze(0)}function Yn(e,n){if(e&1&&F(0,Qn,1,0,"ng-container",40),e&2){let t,o=n.$implicit,i=n.$index;c();let r=oe(29),p=c();m("ngTemplateOutlet",r)("ngTemplateOutletContext",je(7,dt,We(2,In,i,o,(t=p.destinationFormSignal())==null||t.destinations==null||t.destinations[0]==null?null:t.destinations[0].destinationType,p.destinationFormPair().oauthField)))}}function Jn(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),g(2,"question"),a()()),e&2){let t=c(2).$implicit;m("message",t.formView.longDescription)}}function Zn(e,n){if(e&1&&(s(0,"app-file-tree",43)(1,"label",47),g(2),F(3,Jn,3,1,"spk-tooltip",48),a(),u(4,"input",49),a()),e&2){let t,o=c().$implicit,i=c(2);m("startingPath",i.getFormFieldValue(0,o.formGroupName,o.formView.name))("accepts",o.formView.accepts)("showFiles",!0)("hideShortcuts",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),f(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),se("formControlName",o.formView.name)}}function eo(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),g(2,"question"),a()()),e&2){let t=c(2).$implicit;m("message",t.formView.longDescription)}}function to(e,n){if(e&1&&(s(0,"app-file-tree",44)(1,"label",47),g(2),F(3,eo,3,1,"spk-tooltip",48),a(),u(4,"input",49),a()),e&2){let t,o=c().$implicit,i=c(2);m("hideShortcuts",!0)("startingPath",i.getFormFieldValue(0,o.formGroupName,o.formView.name)),l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),f(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),se("formControlName",o.formView.name)}}function no(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),g(2,"question"),a()()),e&2){let t=c(2).$implicit;m("message",t.formView.longDescription)}}function oo(e,n){e&1&&(s(0,"spk-icon",51),g(1,"link"),a())}function io(e,n){e&1&&(s(0,"spk-icon",51),g(1,"envelope"),a())}function ro(e,n){e&1&&(s(0,"spk-icon",51),g(1,"textbox"),a())}function ao(e,n){if(e&1&&(s(0,"spk-form-field")(1,"label",47),g(2),F(3,no,3,1,"spk-tooltip",48),a(),u(4,"input",50),F(5,oo,2,0,"spk-icon",51)(6,io,2,0,"spk-icon",51)(7,ro,2,0,"spk-icon",51),a()),e&2){let t,o=c().$implicit;l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),f(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),se("formControlName",o.formView.name),m("type",o.formView.type==="Email"?"email":"text"),l(),f(o.formView.type==="Path"?5:o.formView.type==="Email"?6:7)}}function so(e,n){if(e&1){let t=x();s(0,"span",55),P("click",function(){E(t);let i=c(2).$implicit,r=c(2);return y(r.oauthStartTokenCreation(i.destinationType))}),g(1,"AuthID"),a()}}function lo(e,n){e&1&&(s(0,"spk-icon",51),g(1,"password"),a())}function po(e,n){if(e&1){let t=x();s(0,"spk-icon",56),P("click",function(){E(t);let i=c(2).$implicit;return y(i.formView.showPassword=!i.formView.showPassword)}),g(1," eye "),a()}}function co(e,n){if(e&1){let t=x();s(0,"spk-icon",56),P("click",function(){E(t);let i=c(2).$implicit;return y(i.formView.showPassword=!i.formView.showPassword)}),g(1," eye-slash "),a()}}function mo(e,n){if(e&1&&(s(0,"spk-form-field")(1,"label",47),g(2),a(),u(3,"input",52),F(4,so,2,0,"span",53)(5,lo,2,0,"spk-icon",51)(6,po,2,0,"spk-icon",54)(7,co,2,0,"spk-icon",54),a()),e&2){let t,o=c().$implicit;l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),se("formControlName",o.formView.name),m("type",o.formView.showPassword?"text":"password"),l(),f(o.oauthField===o.formView.name?4:5),l(2),f(o.formView.showPassword?6:7)}}function uo(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),g(2,"question"),a()()),e&2){let t=c(3).$implicit;m("message",t.formView.longDescription)}}function _o(e,n){if(e&1&&g(0),e&2){let t=n.$implicit;H(" ",t," ")}}function Fo(e,n){if(e&1&&(s(0,"spk-select",57)(1,"label",47),g(2),F(3,uo,3,1,"spk-tooltip",48),a(),u(4,"input",49),a(),F(5,_o,1,1,"ng-template",null,3,qe)),e&2){let t,o=oe(6);c();let i=Tt(0),r=c().$implicit;m("options",i)("isClearable",!1)("optionTemplate",o),l(),V("for","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),l(),H(" ",(t=r.formView.shortDescription)!==null&&t!==void 0?t:r.formView.name," "),l(),f(r.formView.longDescription?3:-1),l(),V("id","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),se("formControlName",r.formView.name)}}function go(e,n){if(e&1&&(ft(0),F(1,Fo,7,14)),e&2){let t=c().$implicit,o=ht(t.formView.loadOptions?t.formView.loadOptions(c(2).injector)():t.formView.options);l(),f(o?1:-1)}}function Co(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),g(2,"question"),a()()),e&2){let t=c(3).$implicit;m("message",t.formView.longDescription)}}function So(e,n){if(e&1&&g(0),e&2){let t=n.$implicit;Mt(" ",t.key," ",t.value?"("+t.value+")":""," ")}}function fo(e,n){if(e&1&&(s(0,"spk-select",59)(1,"label",47),g(2),F(3,Co,3,1,"spk-tooltip",48),a(),u(4,"input",49),a(),F(5,So,1,2,"ng-template",null,4,qe)),e&2){let t,o=oe(6);c();let i=Tt(0),r=c().$implicit;m("options",i)("asFreeText",!0)("inlineSearch",!0)("optionTemplate",o),l(),V("for","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),l(),H(" ",(t=r.formView.shortDescription)!==null&&t!==void 0?t:r.formView.name," "),l(),f(r.formView.longDescription?3:-1),l(),V("id","destination-",r.formGroupName,"-",r.index,"-",r.asHttpOptions?"http":"other",""),se("formControlName",r.formView.name)}}function ho(e,n){e&1&&u(0,"spk-progress-bar",58)}function To(e,n){if(e&1&&(ft(0),F(1,fo,7,15)(2,ho,1,0,"spk-progress-bar",58)),e&2){let t=c().$implicit,o=ht(t.formView.loadOptions?t.formView.loadOptions(c(2).injector)():t.formView.options);l(),f(o?1:2)}}function Do(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),g(2,"question"),a()()),e&2){let t=c(2).$implicit;m("message",t.formView.longDescription)}}function Eo(e,n){if(e&1&&(s(0,"app-size",45)(1,"label",47),g(2),F(3,Do,3,1,"spk-tooltip",48),a()()),e&2){let t,o=c().$implicit;m("inputType",o.Name)("formControlName",o.formView.name)("customId",`destination-{{ item.formGroupName }}-{{ item.index }}-{{
2
+ item.asHttpOptions ? 'http' : 'other'
3
+ }}`),l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),f(o.formView.longDescription?3:-1)}}function yo(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),g(2,"question"),a()()),e&2){let t=c(2).$implicit;m("message",t.formView.longDescription)}}function Ao(e,n){if(e&1&&(s(0,"spk-form-field")(1,"label",47),g(2),F(3,yo,3,1,"spk-tooltip",48),a(),u(4,"input",60),s(5,"spk-icon",51),g(6,"numpad"),a()()),e&2){let t,o=c().$implicit;l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),f(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),se("formControlName",o.formView.name)}}function Po(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),g(2,"question"),a()()),e&2){let t=c(2).$implicit;m("message",t.formView.longDescription)}}function No(e,n){if(e&1&&(s(0,"spk-toggle",46)(1,"label",47),g(2),F(3,Po,3,1,"spk-tooltip",48),a(),u(4,"input",61),a()),e&2){let t,o=c().$implicit;l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),f(o.formView.longDescription?3:-1),l(),V("id","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),se("formControlName",o.formView.name)}}function ko(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),g(2,"question"),a()()),e&2){let t=c(2).$implicit;m("message",t.formView.longDescription)}}function Oo(e,n){if(e&1&&g(0),e&2){let t=n.$implicit;H(" ",t," ")}}function $o(e,n){if(e&1&&(s(0,"spk-select",62)(1,"label",47),g(2),F(3,ko,3,1,"spk-tooltip",48),a(),u(4,"input",63),a(),F(5,Oo,1,1,"ng-template",null,4,qe)),e&2){let t,o=oe(6),i=c().$implicit;m("options",i.formView.options)("selectMultiple",!0)("optionTemplate",o),l(),Rt("for","destination-",i.formGroupName,"-",i.index,""),l(),H(" ",(t=i.formView.shortDescription)!==null&&t!==void 0?t:i.formView.name," "),l(),f(i.formView.longDescription?3:-1),l(),se("formControlName",i.formView.name)}}function Ro(e,n){if(e&1&&(s(0,"spk-tooltip",48)(1,"spk-icon"),g(2,"question"),a()()),e&2){let t=c(2).$implicit;m("message",t.formView.longDescription)}}function Mo(e,n){if(e&1&&(s(0,"app-timespan",45)(1,"label",47),g(2),F(3,Ro,3,1,"spk-tooltip",48),a()()),e&2){let t,o=c().$implicit;m("inputType",o.formView.name)("formControlName",o.formView.name)("customId","destination-"+o.formGroupName+"-"+o.index+"-"+(o.asHttpOptions?"http":"other")),l(),V("for","destination-",o.formGroupName,"-",o.index,"-",o.asHttpOptions?"http":"other",""),l(),H(" ",(t=o.formView.shortDescription)!==null&&t!==void 0?t:o.formView.name," "),l(),f(o.formView.longDescription?3:-1)}}function Io(e,n){if(e&1){let t=x();s(0,"button",64),P("click",function(){E(t);let i=c().$implicit,r=c(2);return y(r.removeFormView(i.formView,0))}),s(1,"spk-icon"),g(2,"x-circle"),a()()}}function xo(e,n){if(e&1&&(s(0,"div",41),X(1,42),F(2,Zn,5,17,"app-file-tree",43)(3,to,5,13,"app-file-tree",44)(4,ao,8,13,"spk-form-field")(5,mo,8,13,"spk-form-field")(6,go,2,2)(7,To,3,2)(8,Eo,4,9,"app-size",45)(9,Ao,7,11,"spk-form-field")(10,No,5,11,"spk-toggle",46)(11,$o,7,9)(12,Mo,4,9,"app-timespan",45),z(),F(13,Io,3,0,"button",32),a()),e&2){let t=n.$implicit;Me("single-field",t.formGroupName!=="advanced"),l(),m("formGroupName",t.formGroupName),l(),f(t.formView.type==="FileTree"?2:t.formView.type==="FolderTree"?3:t.formView.type==="String"||t.formView.type==="Path"||t.formView.type==="Email"?4:t.formView.type==="Password"?5:t.formView.type==="Enumeration"?6:t.formView.type==="NonValidatedSelectableString"?7:t.formView.type==="Size"?8:t.formView.type==="Integer"?9:t.formView.type==="Boolean"?10:t.formView.type==="Flags"?11:t.formView.type==="Timespan"||t.formView.type==="DateTime"?12:-1),l(11),f(t.formGroupName==="advanced"?13:-1)}}function vo(e,n){if(e&1&&(X(0,22)(1,36),te(2,Kn,1,9,"ng-container",null,ee),te(4,Xn,1,9,"ng-container",null,ee),s(6,"app-toggle-card",37),X(7,38),h(8,10),s(9,"spk-menu",31)(10,"button",39),u(11,"spk-icon"),a(),X(12,20),te(13,zn,3,1,"button",33,ee),z(),a(),T(),z(),te(15,Wn,1,9,"ng-container",null,ee),a(),s(17,"app-toggle-card",37),X(18,38),h(19,11),s(20,"spk-menu",31)(21,"button",39),u(22,"spk-icon"),a(),X(23,20),te(24,qn,3,1,"button",33,ee),z(),a(),T(),z(),te(26,Yn,1,9,"ng-container",null,ee),a(),F(28,xo,14,5,"ng-template",null,2,qe),z()()),e&2){let t=c();l(2),ne(t.destinationFormPair().custom),l(2),ne(t.destinationFormPair().dynamic),l(2),m("disallowToggle",!0),l(3),m("searchable",!0),l(),m("disabled",t.notSelectedAdvancedFormPair().length===0),l(3),ne(t.notSelectedAdvancedFormPair()),l(2),ne(t.selectedAdvancedFormPair()),l(2),m("disallowToggle",!0),l(3),m("searchable",!0),l(),m("disabled",t.notSelectedHttpOptions().length===0),l(3),ne(t.notSelectedHttpOptions()),l(2),ne(t.selectedHttpOptions())}}function wo(e,n){if(e&1){let t=x();s(0,"spk-dialog",65),vt("isOpenChange",function(i){E(t);let r=c();return xt(r.targetUrlDialogOpen,i)||(r.targetUrlDialogOpen=i),y(i)}),s(1,"header",66)(2,"h2"),I(3,12),a(),s(4,"spk-alert",67),I(5,13),a()(),s(6,"div",68)(7,"spk-form-field"),u(8,"textarea",69),a()(),s(9,"footer",70)(10,"button",24),P("click",function(){E(t);let i=c();return y(i.closeTargetUrlDialog(!1))}),g(11,"Cancel"),a(),s(12,"button",71),P("click",function(){E(t);let i=c();return y(i.closeTargetUrlDialog(!0))}),h(13,14),u(14,"spk-icon"),T(),a()()()}if(e&2){let t=c();It("isOpen",t.targetUrlDialogOpen),m("options",wt(3,xn)),l(8),m("formControl",t.targetUrlCtrl)}}var ut=new Y,tn=(e={destinations:[]})=>ut.group({destinations:ut.array(e.destinations)}),nn=({key:e,customGroup:n,dynamicGroup:t,advancedGroup:o})=>ut.group({destinationType:ut.control(e),custom:n,dynamic:t,advanced:o}),kt=class e{#n=M(le);#e=M(ye);#o=M(Gt);#i=M(ve);#t=M(ge);#r=M(Ut);injector=M($t);formRef=Te.required("formRef");destinationForm=this.#t.destinationForm;destinationFormPair=this.#t.destinationFormPair;selectedAdvancedFormPair=this.#t.selectedAdvancedFormPair;notSelectedAdvancedFormPair=this.#t.notSelectedAdvancedFormPair;selectedHttpOptions=this.#t.selectedHttpOptions;notSelectedHttpOptions=this.#t.notSelectedHttpOptions;destinationOptions=this.#t.destinationOptions;destinationFormSignal=this.#t.destinationFormSignal;destinationCount=L(()=>this.destinationFormSignal()?.destinations?.length??0);successfulTest=N(!1);destinationTypeOptionsInFocus=N(["file","ssh","s3","gcs","googledrive","azure"]);destinationTypeOptions=N(Ce.map(n=>({key:n.customKey??n.key,customKey:n.customKey??null,displayName:n.displayName,description:n.description})));destinationTypeOptionsFocused=L(()=>{let n=this.destinationTypeOptionsInFocus(),t=this.destinationTypeOptions();return n.map(o=>t.find(i=>i.key===o))});destinationTypeOptionsNotFocused=L(()=>{let n=this.destinationTypeOptionsInFocus();return this.destinationTypeOptions().filter(o=>!n.includes(o.key))});getFormFieldValue(n,t,o){return((this.destinationForm.controls.destinations.controls?.[n]).controls?.[t]).controls[o].value}addDestinationFormGroup(n){this.#t.addDestinationFormGroup(n)}addAdvancedFormPair(n,t){this.#t.addAdvancedFormPair(n,t)}removeFormView(n,t){this.#t.removeAdvancedFormPair(n,t)}addHttpOption(n,t){this.#t.addHttpOption(n,t)}targetUrl=L(()=>this.#t.getCurrentTargetUrl()[0]);targetUrlCtrl=new nt;targetUrlInitial=N(null);targetUrlDialogOpen=N(!1);openTargetUrlDialog(){let t=this.#t.getCurrentTargetUrl()[0];this.targetUrlCtrl.setValue(t),this.targetUrlInitial.set(t),this.targetUrlDialogOpen.set(!0)}closeTargetUrlDialog(n=!1){this.targetUrlDialogOpen.set(!1);let t=this.targetUrlCtrl.value,o=this.targetUrlInitial();!n||t===o||this.#t.updateFieldsFromTargetUrl(this.targetUrlCtrl.value)}testDestination(n=0){let o=this.#t.getCurrentTargetUrl()[n];o&&this.#i.postApiV1RemoteoperationTest({requestBody:{path:o}}).subscribe({next:()=>{this.successfulTest.set(!0),setTimeout(()=>{this.successfulTest.set(!1)},3e3)},error:i=>{let r=i.error.error.Error;if(this.successfulTest.set(!1),r==="missing-folder"){this.#r.open(Ve,{data:{title:$localize`Create folder`,message:$localize`The remote destination folder does not exist, do you want to create it?`},closed:p=>{p&&this.#i.postApiV1RemoteoperationCreate({requestBody:{path:o}}).subscribe()}});return}if(r.startsWith("incorrect-cert:")){let p=r.split("incorrect-cert:")[1];this.#r.open(Ve,{maxWidth:"500px",data:{title:$localize`Trust the certificate`,message:$localize`The server is using a certificate that is not trusted.
4
+ If this is a self-signed certificate, you can choose to trust this certificate.
5
+ The server reported the certificate hash: ${p}`,confirmText:"Trust the certificate",cancelText:"Cancel"},closed:_=>{_&&this.#t.addHttpOptionByName("accept-specified-ssl-hash",p)}});return}if(r.startsWith("incorrect-host-key:")){let p=r.split('incorrect-host-key:"')[1].split('",')[0],_=r.split('accepted-host-key:"')[1].split('",')[0];_?this.#r.open(Ve,{maxWidth:"500px",data:{title:$localize`The host key has changed`,message:$localize`The host key has changed, please check with the server administrator if this is correct,
6
+ otherwise you could be the victim of a MAN-IN-THE-MIDDLE attack.
7
+ Do you want to REPLACE your CURRENT host key ${_}
8
+ with the REPORTED host key: ${p}?`,confirmText:$localize`Approve`,cancelText:$localize`Cancel`},closed:S=>{S&&this.#t.addAdvancedFormPairByName("ssh-fingerprint",n,p)}}):this.#r.open(Ve,{maxWidth:"500px",data:{title:$localize`Approve host key?`,message:$localize`No certificate was specified, please verify that the reported host key is correct: ${p}`,confirmText:"Approve",cancelText:"Cancel"},closed:S=>{S&&this.#t.addAdvancedFormPairByName("ssh-fingerprint",n,p)}});return}this.#r.open(Ve,{maxWidth:"500px",data:{title:$localize`Test connection failed`,message:r,cancelText:"OK"},closed:p=>{}})}})}mapToTargetUrl(n){return st(n.value)}removeDestinationFormGroup(n){this.destinationForm.controls.destinations.removeAt(n)}displayFn(n){let t=this.destinationOptions().find(o=>o.Key===n);return t?`${t.DisplayName}`:""}goBack(){this.#n.navigate(["general"],{relativeTo:this.#e.parent})}next(){this.#n.navigate(["source-data"],{relativeTo:this.#e.parent})}#s=N("https://duplicati-oauth-handler.appspot.com/").asReadonly();#l=N(Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)).asReadonly();#a=N(!1);#p=N(null);keyCreation(){}oauthStartTokenCreation(n){this.#a.set(!0);let t=450,o=600,i=this.#s()+"?type="+n+"&token="+this.#l(),r=screen.width/2-t/2,p=screen.height/2-o/2,_=window.open(i,"_blank","height="+o+",width="+t+",menubar=0,status=0,titlebar=0,toolbar=0,left="+r+",top="+p);_?.addEventListener("blur",S=>{console.log("event blur",S)}),_?.addEventListener("beforeunload",S=>{console.log("event beforeunload",S),this.#o.get(this.#s()+"fetch?callback=JSON_CALLBACK",{params:{token:this.#l()}}).pipe(Xe(()=>this.#a.set(!1))).subscribe({next:$=>{console.log("res",$),$?.authid&&this.#p.set($.authid)}})})}static \u0275fac=function(t){return new(t||e)};static \u0275cmp=ae({type:e,selectors:[["app-destination"]],viewQuery:function(t,o){t&1&&De(o.formRef,On,5),t&2&&Ee()},decls:24,vars:6,consts:()=>{let n;n=$localize` Backup destination ${"\uFFFD#5\uFFFD"}:START_TAG_DIV:${"\uFFFD*6:1\uFFFD"}:START_BLOCK_IF_1:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON:${"\uFFFD*2:2\uFFFD"}:START_BLOCK_IF: Connected ${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:check${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD*3:3\uFFFD"}:START_BLOCK_ELSE: Test destination ${"\uFFFD/*3:3\uFFFD"}:CLOSE_BLOCK_ELSE:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"[\uFFFD/*2:2\uFFFD|\uFFFD/*6:1\uFFFD]"}:CLOSE_BLOCK_IF:${"\uFFFD#7\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#8\uFFFD"}:START_TAG_BUTTON_1:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:dots-three-vertical${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#10\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD#11\uFFFD"}:START_TAG_BUTTON_2:${"[\uFFFD#1:2\uFFFD|\uFFFD#9\uFFFD|\uFFFD#12\uFFFD]"}:START_TAG_SPK_ICON:link${"[\uFFFD/#1:2\uFFFD|\uFFFD/#9\uFFFD|\uFFFD/#12\uFFFD]"}:CLOSE_TAG_SPK_ICON: Edit target URL ${"[\uFFFD/#1:1\uFFFD|\uFFFD/#8\uFFFD|\uFFFD/#11\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/#10\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#7\uFFFD"}:CLOSE_TAG_SPK_MENU:${"\uFFFD/#5\uFFFD"}:CLOSE_TAG_DIV:`,n=Ie(n);let t;t=$localize`${"\uFFFD#19\uFFFD"}:START_TAG_SPK_ICON:arrow-left${"\uFFFD/#19\uFFFD"}:CLOSE_TAG_SPK_ICON: Go back `;let o;o=$localize`${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:arrow-right${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON: Continue `;let i;i=$localize` Want to select another destination? ${"\uFFFD#2\uFFFD"}:START_TAG_SPAN:Click here${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPAN:`;let r;r=$localize`Other destinations`;let p;p=$localize` Advanced options ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#10\uFFFD"}:START_TAG_BUTTON: Add advanced option ${"\uFFFD#11\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#11\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#12\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*14:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#10\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*14:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#12\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_MENU:`,p=Ie(p);let _;_=$localize` Http options ${"\uFFFD#20\uFFFD"}:START_TAG_SPK_MENU:${"\uFFFD#21\uFFFD"}:START_TAG_BUTTON: Add http option ${"\uFFFD#22\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#22\uFFFD"}:CLOSE_TAG_SPK_ICON:${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD#23\uFFFD"}:START_TAG_NG_CONTAINER:${"\uFFFD*25:1\uFFFD"}:START_BLOCK_FOR:${"\uFFFD#1:1\uFFFD"}:START_TAG_BUTTON_1: ${"\uFFFD0:1\uFFFD"}:INTERPOLATION: ${"[\uFFFD/#21\uFFFD|\uFFFD/#1:1\uFFFD]"}:CLOSE_TAG_BUTTON:${"\uFFFD/*25:1\uFFFD"}:CLOSE_BLOCK_FOR:${"\uFFFD/#23\uFFFD"}:CLOSE_TAG_NG_CONTAINER:${"\uFFFD/#20\uFFFD"}:CLOSE_TAG_SPK_MENU:`,_=Ie(_);let S;S=$localize`Edit target URL`;let $;$=$localize` Be careful, this will overwrite everything you have in your destination. `;let U;return U=$localize` Override target URL ${"\uFFFD#14\uFFFD"}:START_TAG_SPK_ICON:swap${"\uFFFD/#14\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["formRef",""],["option",""],["fieldTemplate",""],["enumOptionTemplate",""],["optionTemplate",""],n,t,o,i,r,p,_,S,$,U,[3,"submit","formGroup"],[1,"title-30"],[1,"actions"],["spk-button","","type","button",1,"small",3,"success"],["spk-button","","type","button",1,"small"],["menu",""],["spk-button","","type","button",1,"small",3,"click"],["formArrayName","destinations"],[1,"form-actions"],["spk-button","","type","button",3,"click"],["spk-button","","type","submit",1,"raised","primary"],[3,"isOpen","options"],[3,"click"],[1,"spk-primary"],[1,"most-common-destinations"],[1,"tile"],[3,"searchable"],["spk-button","","type","button",1,"outlined"],["type","button"],[1,"tile",3,"click"],["type","button",3,"click"],["formGroupName","0"],[3,"disallowToggle"],["title",""],["spk-button","","type","button",1,"outlined","small",3,"disabled"],[4,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"field-row"],[3,"formGroupName"],[3,"startingPath","accepts","showFiles","hideShortcuts","showHiddenNodes","selectFiles"],[3,"hideShortcuts","startingPath"],[3,"inputType","formControlName","customId"],[1,"primary","raised"],[3,"for"],[1,"primary",3,"message"],["type","text",3,"id","formControlName"],[3,"type","id","formControlName"],["prefix",""],["autocomplete","off",3,"type","id","formControlName"],["prefix","",1,"link"],["suffix","",1,"clickable"],["prefix","",1,"link",3,"click"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[1,"indeterminate","primary"],["label","key","value","value",3,"options","asFreeText","inlineSearch","optionTemplate"],["type","number",3,"id","formControlName"],["type","checkbox",3,"id","formControlName"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"formControlName"],["spk-button","","type","button",1,"outlined",3,"click"],[3,"isOpenChange","isOpen","options"],["header",""],[1,"warning"],["content",""],["id","targetUrl","autocomplete","off",3,"formControl"],["footer",""],["spk-button","","type","submit",1,"raised","primary",3,"click"]]},template:function(t,o){if(t&1){let i=x();s(0,"form",15,0),P("submit",function(){return E(i),y(o.next())}),s(2,"header")(3,"h3",16),h(4,5),s(5,"div",17),F(6,bn,4,3,"button",18),s(7,"spk-menu")(8,"button",19),u(9,"spk-icon"),a(),X(10,20),s(11,"button",21),P("click",function(){return E(i),y(o.openTargetUrlDialog())}),u(12,"spk-icon"),a(),z(),a()(),T(),a(),F(13,Gn,3,0,"p"),a(),F(14,Vn,9,1)(15,vo,30,6,"ng-container",22),s(16,"div",23)(17,"button",24),P("click",function(){return E(i),y(o.goBack())}),h(18,6),u(19,"spk-icon"),T(),a(),s(20,"button",25),h(21,7),u(22,"spk-icon"),T(),a()()(),F(23,wo,15,4,"spk-dialog",26)}if(t&2){let i;m("formGroup",o.destinationForm),l(6),f(o.destinationCount()>0?6:-1),l(7),f(o.destinationCount()>0?13:-1),l(),f(o.destinationCount()===0?14:-1),l(),f(!((i=o.destinationFormSignal())==null||i.destinations==null)&&i.destinations.length?15:-1),l(8),f(o.targetUrlDialogOpen()?23:-1)}},dependencies:[Oe,Pe,ue,Le,Ge,_e,Ae,ot,Ne,ke,Ue,Ht,bt,ce,Vt,pe,be,et,Lt,Je,me,Ze,jt,Be,rt,zt],styles:["[_nghost-%COMP%]{display:block;width:100%;max-width:32.5rem;padding:2.5rem}header[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem}header[_ngcontent-%COMP%] h2[_ngcontent-%COMP%], header[_ngcontent-%COMP%] spk-alert[_ngcontent-%COMP%]{width:100%}header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:.5rem}header[_ngcontent-%COMP%] p[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline}header[_ngcontent-%COMP%] .actions[_ngcontent-%COMP%]{display:flex;gap:.5rem}pre[_ngcontent-%COMP%]{white-space:pre-wrap}.field-row[_ngcontent-%COMP%]{display:grid;align-items:flex-end;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row.single-field[_ngcontent-%COMP%]{display:block}form[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:1.5rem;padding-bottom:1.5rem}.form-actions[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.form-column[_ngcontent-%COMP%]{display:flex;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:2fr 1fr;gap:.5rem;align-items:flex-end}.clickable[_ngcontent-%COMP%]{cursor:pointer;color:var(--primary-500)}.most-common-destinations[_ngcontent-%COMP%]{display:grid;grid-template-columns:1fr 1fr;gap:1rem}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:.5rem;padding:1rem;border:1px solid var(--base-level-40);border-radius:var(--shape-3);box-shadow:var(--shadow-1);background-color:var(--base-level-20);cursor:pointer}.most-common-destinations[_ngcontent-%COMP%] .tile[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font:var(--paragraph-10);margin:0}[prefix].link[_ngcontent-%COMP%]{cursor:pointer;text-decoration:underline;color:var(--primary-500)}textarea[_ngcontent-%COMP%] ~ grammarly-extension[_ngcontent-%COMP%]{display:none}spk-select[_ngcontent-%COMP%]{--miw: p2r(120)}"],changeDetection:0})};export{st as a,Ce as b,tn as c,nn as d,kt as e,qt as f,At as g,yt as h,Yt as i,Pt as j,Zt as k,Nt as l,ge as m};
@@ -0,0 +1 @@
1
+ import{a as le,b as pe}from"./chunk-LBZ753XE.js";import{a as re}from"./chunk-XH2A67YP.js";import{a as Q}from"./chunk-WCLOWI5G.js";import{b as Y,c as ee,e as te,h as ie,j as ne,s as oe}from"./chunk-JJQARMUD.js";import{A as J,a as q,g as U,l as W,o as X,t as j,y as H,z as Z}from"./chunk-XQKR67WI.js";import{Db as $,Eb as P,Fb as K,Jb as f,Kb as s,Na as l,Pb as g,W as R,Wa as G,Xb as E,Yb as m,Za as z,Zb as L,_b as F,ba as d,bc as v,ca as u,cb as C,cc as D,dc as b,kb as _,oa as k,pb as S,pc as A,qb as V,ra as h,rb as O,sb as y,tb as p,ub as a,vb as M,wb as N,xb as I,xc as B,zb as x}from"./chunk-XGARKXE4.js";import{a as T,b as w}from"./chunk-7CGTOI24.js";function se(n,o){if(n&1){let e=x();p(0,"button",14),f("click",function(){d(e);let t=s();return u(t.addFreeTextSetting())}),$(1,5),M(2,"spk-icon"),P(),a()}}function me(n,o){if(n&1){let e=x();p(0,"button",16,0),f("click",function(){let t=d(e).$implicit,r=s(2);return u(r.addSetting(t))}),m(2),a()}if(n&2){let e=o.$implicit;l(2),L(e.name)}}function _e(n,o){if(n&1&&(p(0,"h3",7),m(1),a(),O(2,me,3,1,"button",15,V)),n&2){let e=o.$implicit;l(),L(e.displayName),l(),y(e.options)}}function ce(n,o){n&1&&(p(0,"div",12),m(1,"Add a setting above to get started."),a())}function de(n,o){if(n&1){let e=x();p(0,"div",17)(1,"label"),m(2),a(),p(3,"div",23)(4,"spk-form-field")(5,"input",24),f("ngModelChange",function(t){d(e);let r=s().$implicit,c=s();return u(c.updateFreeTextSettingName(r,t))}),a(),p(6,"spk-icon",25),m(7,"rectangle-dashed"),a()(),p(8,"spk-form-field")(9,"input",24),f("ngModelChange",function(t){d(e);let r=s().$implicit,c=s();return u(c.updateSettingValue(r,t))}),a(),p(10,"spk-icon",25),m(11,"textbox"),a()()()()}if(n&2){let e=s().$implicit;l(2),F(" ",e.FormView.shortDescription," "),l(3),_("ngModel",e.Name),l(4),_("ngModel",e.Value())}}function ue(n,o){if(n&1&&(p(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=s(2).$implicit;_("message",e.FormView.longDescription)}}function ge(n,o){if(n&1){let e=x();p(0,"app-file-tree",18)(1,"label",26),m(2),C(3,ue,3,1,"spk-tooltip",27),a(),p(4,"input",28),f("ngModelChange",function(t){d(e);let r=s().$implicit,c=s();return u(c.updateSettingValue(r,t))}),a()()}if(n&2){let e=s(),i=e.$implicit,t=e.$index;_("startingPath",i.Value())("accepts",i.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),g("for","destination-",i.Name,"-",t,""),l(),F(" ",i.FormView.shortDescription," "),l(),S(i.FormView.longDescription?3:-1),l(),g("id","destination-",i.Name,"-",t,""),_("ngModel",i.Value())}}function Ce(n,o){if(n&1&&(p(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=s(2).$implicit;_("message",e.FormView.longDescription)}}function xe(n,o){if(n&1){let e=x();p(0,"app-file-tree",19)(1,"label",26),m(2),C(3,Ce,3,1,"spk-tooltip",27),a(),p(4,"input",28),f("ngModelChange",function(t){d(e);let r=s().$implicit,c=s();return u(c.updateSettingValue(r,t))}),a()()}if(n&2){let e=s(),i=e.$implicit,t=e.$index;_("startingPath",i.Value()),l(),g("for","destination-",i.Name,"-",t,""),l(),F(" ",i.FormView.shortDescription," "),l(),S(i.FormView.longDescription?3:-1),l(),g("id","destination-",i.Name,"-",t,""),_("ngModel",i.Value())}}function fe(n,o){if(n&1&&(p(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=s(2).$implicit;_("message",e.FormView.longDescription)}}function Se(n,o){n&1&&(p(0,"spk-icon",25),m(1,"link"),a())}function Fe(n,o){n&1&&(p(0,"spk-icon",25),m(1,"textbox"),a())}function Te(n,o){if(n&1){let e=x();p(0,"spk-form-field")(1,"label",26),m(2),C(3,fe,3,1,"spk-tooltip",27),a(),p(4,"input",28),f("ngModelChange",function(t){d(e);let r=s().$implicit,c=s();return u(c.updateSettingValue(r,t))}),a(),C(5,Se,2,0,"spk-icon",25)(6,Fe,2,0,"spk-icon",25),a()}if(n&2){let e=s(),i=e.$implicit,t=e.$index;l(),g("for","destination-",i.Name,"-",t,""),l(),F(" ",i.FormView.shortDescription," "),l(),S(i.FormView.longDescription?3:-1),l(),g("id","destination-",i.Name,"-",t,""),_("ngModel",i.Value()),l(),S(i.FormView.type==="Path"?5:6)}}function we(n,o){if(n&1){let e=x();p(0,"spk-icon",31),f("click",function(){d(e);let t=s(2).$implicit;return u(t.showPassword=!t.showPassword)}),m(1," eye "),a()}}function Ve(n,o){if(n&1){let e=x();p(0,"spk-icon",31),f("click",function(){d(e);let t=s(2).$implicit;return u(t.showPassword=!t.showPassword)}),m(1," eye-slash "),a()}}function Oe(n,o){if(n&1){let e=x();p(0,"spk-form-field")(1,"label",26),m(2),a(),p(3,"input",29),f("ngModelChange",function(t){d(e);let r=s().$implicit,c=s();return u(c.updateSettingValue(r,t))}),a(),p(4,"spk-icon",25),m(5,"password"),a(),C(6,we,2,0,"spk-icon",30)(7,Ve,2,0,"spk-icon",30),a()}if(n&2){let e=s(),i=e.$implicit,t=e.$index;l(),g("for","destination-",i.Name,"-",t,""),l(),F(" ",i.FormView.shortDescription," "),l(),g("id","destination-",i.Name,"-",t,""),_("type",i.showPassword?"text":"password")("ngModel",i.Value()),l(3),S(i.showPassword?6:7)}}function ye(n,o){if(n&1&&(p(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=s(2).$implicit;_("message",e.FormView.longDescription)}}function Ie(n,o){if(n&1&&m(0),n&2){let e=o.$implicit;F(" ",e," ")}}function ke(n,o){if(n&1){let e=x();p(0,"spk-select",32)(1,"label",26),m(2),C(3,ye,3,1,"spk-tooltip",27),a(),p(4,"input",28),f("ngModelChange",function(t){d(e);let r=s().$implicit,c=s();return u(c.updateSettingValue(r,t))}),a()(),C(5,Ie,1,1,"ng-template",null,1,A)}if(n&2){let e=E(6),i=s(),t=i.$implicit,r=i.$index;_("options",t.FormView.options)("isClearable",!1)("optionTemplate",e),l(),g("for","destination-",t.Name,"-",r,""),l(),F(" ",t.FormView.shortDescription," "),l(),S(t.FormView.longDescription?3:-1),l(),g("id","destination-",t.Name,"-",r,""),_("ngModel",t.Value())}}function he(n,o){if(n&1&&(p(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=s(2).$implicit;_("message",e.FormView.longDescription)}}function Me(n,o){if(n&1){let e=x();p(0,"app-size",33),b("ngModelChange",function(t){d(e);let r=s().$implicit;return D(r.Value,t)||(r.Value=t),u(t)}),p(1,"label",26),m(2),C(3,he,3,1,"spk-tooltip",27),a()()}if(n&2){let e,i=s(),t=i.$implicit,r=i.$index;_("inputType",t.Name),v("ngModel",t.Value),_("customId","destination-{{ item.Name }}-{{ $index }}"),l(),g("for","destination-",t.Name,"-",r,""),l(),F(" ",(e=t.FormView.shortDescription)!==null&&e!==void 0?e:t.FormView.name," "),l(),S(t.FormView.longDescription?3:-1)}}function Ne(n,o){if(n&1&&(p(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=s(2).$implicit;_("message",e.FormView.longDescription)}}function $e(n,o){if(n&1){let e=x();p(0,"spk-form-field")(1,"label",26),m(2),C(3,Ne,3,1,"spk-tooltip",27),a(),p(4,"input",34),f("ngModelChange",function(t){d(e);let r=s().$implicit,c=s();return u(c.updateSettingValue(r,t))}),a(),p(5,"spk-icon",25),m(6,"numpad"),a()()}if(n&2){let e=s(),i=e.$implicit,t=e.$index;l(),g("for","destination-",i.Name,"-",t,""),l(),F(" ",i.FormView.shortDescription," "),l(),S(i.FormView.longDescription?3:-1),l(),g("id","destination-",i.Name,"-",t,""),_("ngModel",i.Value())}}function Pe(n,o){if(n&1&&(p(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=s(2).$implicit;_("message",e.FormView.longDescription)}}function Ee(n,o){if(n&1){let e=x();p(0,"spk-toggle",21)(1,"label",26),m(2),C(3,Pe,3,1,"spk-tooltip",27),a(),p(4,"input",35),f("ngModelChange",function(t){d(e);let r=s().$implicit,c=s();return u(c.updateSettingValue(r,t))}),a()()}if(n&2){let e=s(),i=e.$implicit,t=e.$index;l(),g("for","destination-",i.Name,"-",t,""),l(),F(" ",i.FormView.shortDescription," "),l(),S(i.FormView.longDescription?3:-1),l(),g("id","destination-",i.Name,"-",t,""),_("ngModel",i.Value())}}function Le(n,o){if(n&1&&(p(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=s(2).$implicit;_("message",e.FormView.longDescription)}}function ve(n,o){if(n&1&&m(0),n&2){let e=o.$implicit;F(" ",e," ")}}function De(n,o){if(n&1){let e=x();p(0,"spk-select",36)(1,"label",26),m(2),C(3,Le,3,1,"spk-tooltip",27),a(),p(4,"input",37),f("ngModelChange",function(t){d(e);let r=s().$implicit,c=s();return u(c.updateSettingValue(r,t))}),a()(),C(5,ve,1,1,"ng-template",null,2,A)}if(n&2){let e=E(6),i=s(),t=i.$implicit,r=i.$index;_("options",t.FormView.options)("selectMultiple",!0)("optionTemplate",e),l(),g("for","destination-",t.Name,"-",r,""),l(),F(" ",t.FormView.shortDescription," "),l(),S(t.FormView.longDescription?3:-1),l(),_("ngModel",t.Value())}}function be(n,o){if(n&1&&(p(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=s(2).$implicit;_("message",e.FormView.longDescription)}}function Ae(n,o){if(n&1){let e=x();p(0,"app-timespan",33),b("ngModelChange",function(t){d(e);let r=s().$implicit;return D(r.Value,t)||(r.Value=t),u(t)}),p(1,"label",26),m(2),C(3,be,3,1,"spk-tooltip",27),a()()}if(n&2){let e,i=s(),t=i.$implicit,r=i.$index;_("inputType",t.Name),v("ngModel",t.Value),_("customId","destination-{{ item.Name }}-{{ $index }}"),l(),g("for","destination-",t.Name,"-",r,""),l(),F(" ",(e=t.FormView.shortDescription)!==null&&e!==void 0?e:t.FormView.name," "),l(),S(t.FormView.longDescription?3:-1)}}function Be(n,o){if(n&1){let e=x();p(0,"div",13),C(1,de,12,3,"div",17)(2,ge,5,14,"app-file-tree",18)(3,xe,5,10,"app-file-tree",19)(4,Te,7,10,"spk-form-field")(5,Oe,8,10,"spk-form-field")(6,ke,7,12)(7,Me,4,8,"app-size",20)(8,$e,7,9,"spk-form-field")(9,Ee,5,9,"spk-toggle",21)(10,De,7,9)(11,Ae,4,8,"app-timespan",20),p(12,"button",22),f("click",function(){let t=d(e).$implicit,r=s();return u(r.removeSetting(t))}),p(13,"spk-icon"),m(14,"x-bold"),a()()()}if(n&2){let e=o.$implicit;l(),S(e.FormView.type==="FreeText"?1:e.FormView.type==="FileTree"?2:e.FormView.type==="FolderTree"?3:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"?4:e.FormView.type==="Password"?5:e.FormView.type==="Enumeration"?6:e.FormView.type==="Size"?7:e.FormView.type==="Integer"?8:e.FormView.type==="Boolean"?9:e.FormView.type==="Flags"?10:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?11:-1)}}var ae=class n{#e=R(Q);options=G.required();hiddenOptions=k([]);hasFreeTextSettings=k(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=B(()=>{let o=this.hiddenOptions();return this.options().map(i=>{let t=this.allOptions().find(r=>r.name===i.Name);if(t&&!o.includes(t.name)){let r=i.Value??"";t.type==="Boolean"&&(r=r&&r.toLowerCase()==="true"||!1),t.type==="Integer"&&(r=parseInt(r)||0);let c=h(r);return w(T({},i),{Value:c,FormView:t})}else if(this.hasFreeTextSettings())return w(T({},i),{Value:h(i.Value),FormView:{name:i.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(i=>i!==null)});nonSelectedOptionsGrouped=B(()=>{let o=this.options().map(i=>i.Name),e=this.hiddenOptions();return this.allOptionsGrouped().map(i=>w(T({},i),{options:i.options.filter(t=>!o.includes(t.name)&&!e.includes(t.name))})).filter(i=>i.options.length>0)});addFreeTextSetting(){this.hasFreeTextSettings()&&this.options.update(o=>[...o,{Filter:null,Name:"",Value:""}])}addSetting(o){this.options.update(e=>{let i=o.defaultValue??"";return o.type==="Boolean"&&(i=i.toLowerCase()==="true"||!1),o.type==="Integer"&&(i=parseInt(i)||0),[...e,{Name:o.name,Value:i}]})}updateSettingValue(o,e){this.options.update(i=>{let t=[...i],r=t.findIndex(c=>c.Name===o.Name);return o.FormView.type==="Boolean"?(t[r].Value=e?"True":"False",t):o.FormView.type==="Integer"?(t[r].Value=e.toString(),t):(t[r].Value=e,t)})}updateFreeTextSettingName(o,e){this.options.update(i=>{let t=[...i],r=t.findIndex(c=>c.Name===o.Name);return t[r].Name=e,t})}removeSetting(o){this.options.update(e=>e.filter(i=>i.Name!==o.Name))}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=z({type:n,selectors:[["app-options-list"]],inputs:{options:[1,"options"],hiddenOptions:[1,"hiddenOptions"],hasFreeTextSettings:[1,"hasFreeTextSettings"]},outputs:{options:"optionsChange"},decls:16,vars:4,consts:()=>{let o;o=$localize`Advanced options`;let e;e=$localize` Add advanced option ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let i;return i=$localize` New custom option ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:pen${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["option",""],["enumOptionTemplate",""],["optionTemplate",""],o,e,i,[3,"disallowToggle"],["title",""],[1,"actions"],["spk-button","","type","button",1,"outlined","small"],[3,"searchable"],["menu",""],[1,"placeholder"],[1,"field-row"],["spk-button","","type","button",1,"outlined","small",3,"click"],["type","button"],["type","button",3,"click"],[1,"form-column"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],["spk-button","","type","button",1,"outlined","remove-btn",3,"click"],[1,"form-row"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[3,"for"],[1,"primary",3,"message"],["type","text",3,"ngModelChange","id","ngModel"],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["suffix","",1,"clickable"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[3,"ngModelChange","inputType","ngModel","customId"],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"ngModelChange","ngModel"]]},template:function(e,i){e&1&&(p(0,"spk-toggle-card",6),N(1,7)(2),K(3,3),I(),p(4,"div",8),C(5,se,3,0,"button",9),p(6,"spk-menu",10)(7,"button",9),$(8,4),M(9,"spk-icon"),P(),a(),N(10,11),O(11,_e,4,1,null,null,V),I(),a()(),I(),C(13,ce,2,0,"div",12),O(14,Be,15,1,"div",13,V),a()),e&2&&(_("disallowToggle",!0),l(5),S(i.hasFreeTextSettings()?5:-1),l(),_("searchable",!0),l(5),y(i.nonSelectedOptionsGrouped()),l(2),S(i.selectedSettings().length===0?13:-1),l(),y(i.selectedSettings()))},dependencies:[oe,ee,ne,Y,te,ie,re,H,W,U,X,J,q,j,Z,le,pe],styles:["[_nghost-%COMP%]{display:block}spk-select[_ngcontent-%COMP%]{--miw: p2r(120)}spk-toggle[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.placeholder[_ngcontent-%COMP%]{color:var(--base-level-60R);text-align:center;padding:2rem 1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-end}.form-column[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}"],changeDetection:0})};export{ae as a};
@@ -1 +1 @@
1
- import{e as a,f as b}from"./chunk-22CSSCKZ.js";import"./chunk-ISRMJKPG.js";import"./chunk-3V622MYY.js";import"./chunk-XH2A67YP.js";import"./chunk-WCLOWI5G.js";import"./chunk-ZP273LXY.js";import"./chunk-D5WIWFNP.js";import"./chunk-WSLU6K4D.js";import"./chunk-UJZB6UQE.js";import"./chunk-RHW5QVAY.js";import"./chunk-JJQARMUD.js";import"./chunk-3UJUWE5B.js";import"./chunk-I3TLRILF.js";import"./chunk-2SGDSXNW.js";import"./chunk-XQKR67WI.js";import"./chunk-CEOO3F5U.js";import"./chunk-K3CYM6ID.js";import"./chunk-M7VDIUGU.js";import"./chunk-XGARKXE4.js";import"./chunk-7CGTOI24.js";export{a as createRestoreSelectFilesForm,b as default};
1
+ import{e as a,f as b}from"./chunk-BA7NYTFR.js";import"./chunk-XH2A67YP.js";import"./chunk-ISRMJKPG.js";import"./chunk-3V622MYY.js";import"./chunk-WCLOWI5G.js";import"./chunk-ZP273LXY.js";import"./chunk-D5WIWFNP.js";import"./chunk-WSLU6K4D.js";import"./chunk-UJZB6UQE.js";import"./chunk-RHW5QVAY.js";import"./chunk-JJQARMUD.js";import"./chunk-3UJUWE5B.js";import"./chunk-I3TLRILF.js";import"./chunk-2SGDSXNW.js";import"./chunk-XQKR67WI.js";import"./chunk-CEOO3F5U.js";import"./chunk-K3CYM6ID.js";import"./chunk-M7VDIUGU.js";import"./chunk-XGARKXE4.js";import"./chunk-7CGTOI24.js";export{a as createRestoreSelectFilesForm,b as default};
package/index.html CHANGED
@@ -36,5 +36,5 @@
36
36
  <body>
37
37
  <app-root></app-root>
38
38
  <div class="loading">Loading ...</div>
39
- <link rel="modulepreload" href="chunk-DJWNLIDJ.js"><link rel="modulepreload" href="chunk-WCLOWI5G.js"><link rel="modulepreload" href="chunk-KABJYPCP.js"><link rel="modulepreload" href="chunk-UXWTPWS6.js"><link rel="modulepreload" href="chunk-ZP273LXY.js"><link rel="modulepreload" href="chunk-D5WIWFNP.js"><link rel="modulepreload" href="chunk-WSLU6K4D.js"><link rel="modulepreload" href="chunk-UJZB6UQE.js"><link rel="modulepreload" href="chunk-RHW5QVAY.js"><link rel="modulepreload" href="chunk-3UJUWE5B.js"><script src="polyfills-BZ5XXHZK.js" type="module"></script><script src="main-73DNRGWN.js" type="module"></script></body>
39
+ <link rel="modulepreload" href="chunk-DJWNLIDJ.js"><link rel="modulepreload" href="chunk-WCLOWI5G.js"><link rel="modulepreload" href="chunk-KABJYPCP.js"><link rel="modulepreload" href="chunk-UXWTPWS6.js"><link rel="modulepreload" href="chunk-ZP273LXY.js"><link rel="modulepreload" href="chunk-D5WIWFNP.js"><link rel="modulepreload" href="chunk-WSLU6K4D.js"><link rel="modulepreload" href="chunk-UJZB6UQE.js"><link rel="modulepreload" href="chunk-RHW5QVAY.js"><link rel="modulepreload" href="chunk-3UJUWE5B.js"><script src="polyfills-BZ5XXHZK.js" type="module"></script><script src="main-ZJBIDZ3R.js" type="module"></script></body>
40
40
  </html>
@@ -1 +1 @@
1
- import{b as fe,c as ge}from"./chunk-DJWNLIDJ.js";import{a as x}from"./chunk-WCLOWI5G.js";import{a as me}from"./chunk-KABJYPCP.js";import{a as he}from"./chunk-UXWTPWS6.js";import{a as k}from"./chunk-ZP273LXY.js";import{a as pe}from"./chunk-D5WIWFNP.js";import"./chunk-WSLU6K4D.js";import"./chunk-UJZB6UQE.js";import{a as N}from"./chunk-RHW5QVAY.js";import{a as y,b,c as le,d as w}from"./chunk-3UJUWE5B.js";import{c as ne,d as re,g as se,h as ie}from"./chunk-I3TLRILF.js";import{a as oe}from"./chunk-2SGDSXNW.js";import{c as ce}from"./chunk-XQKR67WI.js";import{d as ae}from"./chunk-CEOO3F5U.js";import{a as Q,b as Y,d as Z,e as ee,f as te}from"./chunk-K3CYM6ID.js";import{a as ue}from"./chunk-O6GWHO26.js";import{j as q,l as X}from"./chunk-M7VDIUGU.js";import{b as de}from"./chunk-BWYJMRKB.js";import{D as R,J as F,L as S,N as U,Q as T,T as G,W as s,Za as B,d as H,g as V,ga as J,l as j,m as W,p as A,ra as d,rc as K,sc as _,vb as $,x as O,y as D,yc as z}from"./chunk-XGARKXE4.js";import"./chunk-7CGTOI24.js";var I=class o{#o=s(y);#s=s(b);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=B({type:o,selectors:[["app-root"]],decls:1,vars:0,template:function(t,n){t&1&&$(0,"router-outlet")},dependencies:[ne],encapsulation:2})};var be={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new G("ENVIRONMENT");var M=class o{#o=s(ae);isLoaded=d(!1);webmodules=d(null);preload(e=!1){let t=this.#o.getApiV1Webmodules().pipe(U(n=>this.webmodules.set(n)),R(()=>this.isLoaded.set(!0)));if(e)return t;t.subscribe()}static \u0275fac=function(t){return new(t||o)};static \u0275prov=T({token:o,factory:o.\u0275fac,providedIn:"root"})};var Ie=()=>{let o=s(w);return o.token()?!0:o.checkProxyAuthed().pipe(S(e=>e?j(!0):o.refreshToken().pipe(A(()=>!0))))},Me=()=>{let o=s(b),e=s(k),t=s(J),n=o.relayIsEnabled()?"longpoll":"websocket",i=[t.get(x).preload(!0),t.get(x).preloadFilterGroups(!0),t.get(M).preload(!0)];return o.configLoaded===null?O(i).pipe(A(()=>n)):o.configLoaded?.pipe(S(()=>O(i)))},ve=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-PFAU4FFV.js")},{path:"logout",loadComponent:()=>import("./chunk-NFME267J.js")},{path:"",canActivate:[Ie],children:[{path:"",canActivate:[Me],loadComponent:()=>import("./chunk-ASEBN4DE.js"),children:[{path:"",loadComponent:()=>import("./chunk-FRXAEGHW.js")},{path:"add-backup",loadComponent:()=>import("./chunk-OH33D663.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-YPSSTA3J.js")},{path:"backup/import",loadComponent:()=>import("./chunk-MYK7A3PZ.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-EQCQL7A4.js"),loadChildren:()=>import("./chunk-AMJ2CM2Q.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-EQCQL7A4.js"),loadChildren:()=>import("./chunk-AMJ2CM2Q.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-DRBDCRHV.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-EKIFJPZJ.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-LU4LP7JL.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-ZHAXIU33.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-3NDOYD25.js")},{path:"from-config",loadComponent:()=>import("./chunk-E2LHQGCK.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-47OESBLR.js"),loadChildren:()=>import("./chunk-2ZK7AAG4.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-47OESBLR.js"),loadChildren:()=>import("./chunk-2ZK7AAG4.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-47OESBLR.js"),loadChildren:()=>import("./chunk-2ZK7AAG4.js")},{path:"settings",loadComponent:()=>import("./chunk-XITZBHPE.js")},{path:"about",loadComponent:()=>import("./chunk-EO2PLY2Q.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-FDMBNUIK.js")},{path:"changelog",loadComponent:()=>import("./chunk-4FF7PF7J.js")},{path:"libraries",loadComponent:()=>import("./chunk-3IZBE2NA.js")},{path:"system-info",loadComponent:()=>import("./chunk-BKWTKAB4.js")},{path:"logs",loadChildren:()=>import("./chunk-54SNAQYD.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-VRGLHRK2.js")}]}]}]}]}];var L=null,Ce=(o,e)=>{let t=s(w),n=s(re),i=s(y),c=s(f),r=i.getItem("locale"),u=s(ce),a=fe(r),p=o.url==="/api/v1/auth/login",m=o.url==="/api/v1/auth/refresh",v=o.url==="/api/v1/progressstate",g=o.url==="/api/v1/remoteoperation/test",h=t.token(),C=o,P=o.headers.has("custom-proxy-check")||h===le;if(h&&o.url.startsWith(c.baseUrl)&&!P){let l=o.headers.set("Authorization",`Bearer ${h}`);r&&r!=="en-US"&&(l=l.set("X-Ui-Language",a)),C=o.clone({headers:l})}return e(C).pipe(D(l=>{if(!P&&(v&&l.status===404||g||u.error(l.message),m&&l.status===401&&(t.logout(),n.navigate(["/logout"])),!p&&!m&&l.status===401))return L??=t.refreshToken().pipe(F()),L.pipe(S(()=>e(o.clone({headers:o.headers.set("Authorization",`Bearer ${t.token()}`)}))),R(()=>L=null));let ke=`Error Code: ${l.status}, Message: ${l.message}`;return W(()=>({error:l,message:ke}))}))};var Ee="1.0.0",Se=`portal-proxy-client-${N()}`,Ae=1,E=class o{#o=1e3;#s=s(f);#t=d("disconnected");#l=d(this.#o);#i=d(!1);#n=d(!1);#a=d(null);isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#t.asReadonly();#p=[];#r={};#e=null;#m=new TextDecoder("utf-8");#c=null;#d=z(()=>{let e=this.#i(),t=this.#l(),n=this.#a();if(!n||!e||!t||t<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},t)});utf8Atob(e){let t=Uint8Array.from(atob(e),i=>i.charCodeAt(0)),n=this.#m.decode(t);return n?JSON.parse(n):null}connectToMachineServer(e,t){let n=t?.reconnect??!1,i=this.wsState();(i==="disconnected"||i==="error"||n)&&(this.#e?.close(),this.#e=null),!this.#e&&(this.#e=new WebSocket(this.#s.machineServerUrl),this.#t.set("connecting"),this.#e.onopen=()=>{this.#t.set("connect"),this.#n.set(!0),this.#i.set(!1),this.#a.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#n.set(!1),this.#a.set(e),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=c=>{let r=JSON.parse(c.data);if(this.wsState()==="connect"){if(r.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${r.type}'`);return}let a={token:e,publicKey:"",clientVersion:Ee,protocolVersion:Ae},p=this.createResponse(r,"authportal",a);this.#t.set("welcome"),this.#e?.send(p)}else if(this.wsState()==="welcome"){if(r.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${r.type}'`);return}var u=JSON.parse(r.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let a=this.#p.pop();a&&this.#r[a.messageId]&&this.activateCommand(a)}}else if(this.wsState()==="authenticated"){if(r.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${r.type}'`);return}let a=this.#r[r.messageId];if(a){if(r.errorMessage){a.reject(r.errorMessage);return}else{let p=JSON.parse(r.payload??"");p.body=p?.body==null?null:this.utf8Atob(p.body),a.resolve(p)}delete this.#r[r.messageId],window.clearTimeout(a.timer)}}})}disconnectFromMachineServer(e=null){e&&console.error(e),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(e,t,n){let i={from:Se,to:e.from,type:t,messageId:e.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(e,t,n,i,c,r,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(e),new Promise((a,p)=>{let m=N(),g={from:Se,to:t,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,body:c,headers:r})},h={resolve:a,reject:p,timer:window.setTimeout(()=>{let C=this.#r[m];C&&(delete this.#r[m],C.reject("Timeout"))},u)};this.#r[m]=h,this.#n()?this.activateCommand(g):this.#p.push(g)})}activateCommand(e){this.#e?.send(JSON.stringify(e))}static \u0275fac=function(t){return new(t||o)};static \u0275prov=T({token:o,factory:o.\u0275fac,providedIn:"root"})};function Oe(o){if(typeof o!="string")return null;let t=new TextEncoder().encode(o);return window.btoa(String.fromCharCode(...t))}function Re(o,e,t){let n=o.relayconfigState.config();if(n===null)return t(e);let i=Oe(e.body),c={};e.headers.keys().forEach(p=>{c[p]=e.headers.get(p)??""});let r=e.headers.get("timeout"),u=r!==null?parseInt(r):o.defaultTimeout;e.url.startsWith("/api/v1/serverstate")&&e.url.includes("longpoll=true")&&(u=1e3*99);let a=o.relayWebsocket.sendCommand(n.accessToken,n.clientId,e.method,e.url,i,c,u);return new H(p=>{a.then(m=>{let v=new Q;c!=null&&Object.keys(c).forEach(h=>{v.set(h,c[h])});let g=new Y({body:m.body,status:m.code,statusText:"OK",headers:v});p.next(g),p.complete()})})}var Te=(o,e)=>{let t={relayconfigState:s(b),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(E)},n=t.relayconfigState.config();if(t.relayconfigState.configLoaded!==null&&n===null){let i=new V;return t.relayconfigState.configLoaded.subscribe(c=>{c&&Re(t,o,e).subscribe(i)}),i}return Re(t,o,e)};var we={providers:[K(),se(ve,ie()),Z(te(),ee([Te,Ce])),y,{provide:f,useValue:be},{provide:_,useValue:ge()},me,k,de,X,pe,q,ue,he]};oe(I,we);
1
+ import{b as fe,c as ge}from"./chunk-DJWNLIDJ.js";import{a as x}from"./chunk-WCLOWI5G.js";import{a as me}from"./chunk-KABJYPCP.js";import{a as he}from"./chunk-UXWTPWS6.js";import{a as k}from"./chunk-ZP273LXY.js";import{a as pe}from"./chunk-D5WIWFNP.js";import"./chunk-WSLU6K4D.js";import"./chunk-UJZB6UQE.js";import{a as N}from"./chunk-RHW5QVAY.js";import{a as y,b,c as le,d as w}from"./chunk-3UJUWE5B.js";import{c as ne,d as re,g as se,h as ie}from"./chunk-I3TLRILF.js";import{a as oe}from"./chunk-2SGDSXNW.js";import{c as ce}from"./chunk-XQKR67WI.js";import{d as ae}from"./chunk-CEOO3F5U.js";import{a as Q,b as Y,d as Z,e as ee,f as te}from"./chunk-K3CYM6ID.js";import{a as ue}from"./chunk-O6GWHO26.js";import{j as q,l as X}from"./chunk-M7VDIUGU.js";import{b as de}from"./chunk-BWYJMRKB.js";import{D as R,J as F,L as S,N as U,Q as T,T as G,W as s,Za as B,d as H,g as V,ga as J,l as j,m as W,p as A,ra as d,rc as K,sc as _,vb as $,x as O,y as D,yc as z}from"./chunk-XGARKXE4.js";import"./chunk-7CGTOI24.js";var I=class o{#o=s(y);#s=s(b);ngOnInit(){this.#s.fetchConfig(),this.#o.clearAllNotCurrentVersion()}static \u0275fac=function(t){return new(t||o)};static \u0275cmp=B({type:o,selectors:[["app-root"]],decls:1,vars:0,template:function(t,n){t&1&&$(0,"router-outlet")},dependencies:[ne],encapsulation:2})};var be={production:!0,baseUrl:"/api",machineServerUrl:"${WS_URL}",defaultTimeout:3e4};var f=new G("ENVIRONMENT");var M=class o{#o=s(ae);isLoaded=d(!1);webmodules=d(null);preload(e=!1){let t=this.#o.getApiV1Webmodules().pipe(U(n=>this.webmodules.set(n)),R(()=>this.isLoaded.set(!0)));if(e)return t;t.subscribe()}static \u0275fac=function(t){return new(t||o)};static \u0275prov=T({token:o,factory:o.\u0275fac,providedIn:"root"})};var Ie=()=>{let o=s(w);return o.token()?!0:o.checkProxyAuthed().pipe(S(e=>e?j(!0):o.refreshToken().pipe(A(()=>!0))))},Me=()=>{let o=s(b),e=s(k),t=s(J),n=o.relayIsEnabled()?"longpoll":"websocket",i=[t.get(x).preload(!0),t.get(x).preloadFilterGroups(!0),t.get(M).preload(!0)];return o.configLoaded===null?O(i).pipe(A(()=>n)):o.configLoaded?.pipe(S(()=>O(i)))},ve=[{path:"",children:[{path:"login",canActivate:[],loadComponent:()=>import("./chunk-PFAU4FFV.js")},{path:"logout",loadComponent:()=>import("./chunk-NFME267J.js")},{path:"",canActivate:[Ie],children:[{path:"",canActivate:[Me],loadComponent:()=>import("./chunk-ASEBN4DE.js"),children:[{path:"",loadComponent:()=>import("./chunk-FRXAEGHW.js")},{path:"add-backup",loadComponent:()=>import("./chunk-OH33D663.js")},{path:"backup/:id/export",loadComponent:()=>import("./chunk-YPSSTA3J.js")},{path:"backup/import",loadComponent:()=>import("./chunk-MYK7A3PZ.js")},{path:"backup-draft/:id",loadComponent:()=>import("./chunk-LVHLXMSY.js"),loadChildren:()=>import("./chunk-ACN637D7.js")},{path:"backup/:id",loadComponent:()=>import("./chunk-LVHLXMSY.js"),loadChildren:()=>import("./chunk-ACN637D7.js")},{path:"backup/:id/log",loadComponent:()=>import("./chunk-DRBDCRHV.js")},{path:"backup/:id/database",loadComponent:()=>import("./chunk-EKIFJPZJ.js")},{path:"backup/:id/commandline",loadComponent:()=>import("./chunk-MIASAENR.js")},{path:"backup/:id/commandline/:runId",loadComponent:()=>import("./chunk-ZHAXIU33.js")},{path:"restore",children:[{path:"",loadComponent:()=>import("./chunk-3NDOYD25.js")},{path:"from-config",loadComponent:()=>import("./chunk-E2LHQGCK.js")}]},{path:"restore-from-files",loadComponent:()=>import("./chunk-RQSCZC6C.js"),loadChildren:()=>import("./chunk-643UNOPE.js")},{path:"restore-draft/:id",loadComponent:()=>import("./chunk-RQSCZC6C.js"),loadChildren:()=>import("./chunk-643UNOPE.js")},{path:"restore/:id",loadComponent:()=>import("./chunk-RQSCZC6C.js"),loadChildren:()=>import("./chunk-643UNOPE.js")},{path:"settings",loadComponent:()=>import("./chunk-PPKU3R4J.js")},{path:"about",loadComponent:()=>import("./chunk-EO2PLY2Q.js"),children:[{path:"",redirectTo:"general",pathMatch:"full"},{path:"general",loadComponent:()=>import("./chunk-FDMBNUIK.js")},{path:"changelog",loadComponent:()=>import("./chunk-4FF7PF7J.js")},{path:"libraries",loadComponent:()=>import("./chunk-3IZBE2NA.js")},{path:"system-info",loadComponent:()=>import("./chunk-BKWTKAB4.js")},{path:"logs",loadChildren:()=>import("./chunk-54SNAQYD.js")},{path:"crashlogs",loadComponent:()=>import("./chunk-VRGLHRK2.js")}]}]}]}]}];var L=null,Ce=(o,e)=>{let t=s(w),n=s(re),i=s(y),c=s(f),r=i.getItem("locale"),u=s(ce),a=fe(r),p=o.url==="/api/v1/auth/login",m=o.url==="/api/v1/auth/refresh",v=o.url==="/api/v1/progressstate",g=o.url==="/api/v1/remoteoperation/test",h=t.token(),C=o,P=o.headers.has("custom-proxy-check")||h===le;if(h&&o.url.startsWith(c.baseUrl)&&!P){let l=o.headers.set("Authorization",`Bearer ${h}`);r&&r!=="en-US"&&(l=l.set("X-Ui-Language",a)),C=o.clone({headers:l})}return e(C).pipe(D(l=>{if(!P&&(v&&l.status===404||g||u.error(l.message),m&&l.status===401&&(t.logout(),n.navigate(["/logout"])),!p&&!m&&l.status===401))return L??=t.refreshToken().pipe(F()),L.pipe(S(()=>e(o.clone({headers:o.headers.set("Authorization",`Bearer ${t.token()}`)}))),R(()=>L=null));let ke=`Error Code: ${l.status}, Message: ${l.message}`;return W(()=>({error:l,message:ke}))}))};var Ee="1.0.0",Se=`portal-proxy-client-${N()}`,Ae=1,E=class o{#o=1e3;#s=s(f);#t=d("disconnected");#l=d(this.#o);#i=d(!1);#n=d(!1);#a=d(null);isConnectedToMachineServer=this.#n.asReadonly();wsState=this.#t.asReadonly();#p=[];#r={};#e=null;#m=new TextDecoder("utf-8");#c=null;#d=z(()=>{let e=this.#i(),t=this.#l(),n=this.#a();if(!n||!e||!t||t<this.#o){this.#c&&window.clearInterval(this.#c);return}this.#c=window.setInterval(()=>{this.connectToMachineServer(n)},t)});utf8Atob(e){let t=Uint8Array.from(atob(e),i=>i.charCodeAt(0)),n=this.#m.decode(t);return n?JSON.parse(n):null}connectToMachineServer(e,t){let n=t?.reconnect??!1,i=this.wsState();(i==="disconnected"||i==="error"||n)&&(this.#e?.close(),this.#e=null),!this.#e&&(this.#e=new WebSocket(this.#s.machineServerUrl),this.#t.set("connecting"),this.#e.onopen=()=>{this.#t.set("connect"),this.#n.set(!0),this.#i.set(!1),this.#a.set(null)},this.#e.onclose=()=>{this.#t.set("disconnected"),this.#n.set(!1),this.#a.set(e),this.#i.set(!0)},this.#e.onerror=()=>{this.#t.set("error")},this.#e.onmessage=c=>{let r=JSON.parse(c.data);if(this.wsState()==="connect"){if(r.type!=="welcome"){this.disconnectFromMachineServer(`Unexpected message type, expected 'welcome' but got '${r.type}'`);return}let a={token:e,publicKey:"",clientVersion:Ee,protocolVersion:Ae},p=this.createResponse(r,"authportal",a);this.#t.set("welcome"),this.#e?.send(p)}else if(this.wsState()==="welcome"){if(r.type!=="authportal"){this.disconnectFromMachineServer(`Unexpected message type, expected 'authportal' but got '${r.type}'`);return}var u=JSON.parse(r.payload??"");if(u.accepted===!1){this.disconnectFromMachineServer("Authentication failed");return}for(this.#t.set("authenticated"),this.#n.set(!0);this.#p.length>0;){let a=this.#p.pop();a&&this.#r[a.messageId]&&this.activateCommand(a)}}else if(this.wsState()==="authenticated"){if(r.type!=="command"){console.warn(`Unexpected message type, expected 'command' but got '${r.type}'`);return}let a=this.#r[r.messageId];if(a){if(r.errorMessage){a.reject(r.errorMessage);return}else{let p=JSON.parse(r.payload??"");p.body=p?.body==null?null:this.utf8Atob(p.body),a.resolve(p)}delete this.#r[r.messageId],window.clearTimeout(a.timer)}}})}disconnectFromMachineServer(e=null){e&&console.error(e),this.#e?.close(),this.#e=null,this.#t.set("disconnected"),this.#n.set(!1)}createResponse(e,t,n){let i={from:Se,to:e.from,type:t,messageId:e.messageId,payload:JSON.stringify(n)};return JSON.stringify(i)}sendCommand(e,t,n,i,c,r,u=5e3){return(this.wsState()==="disconnected"||this.wsState()==="error")&&this.connectToMachineServer(e),new Promise((a,p)=>{let m=N(),g={from:Se,to:t,type:"command",messageId:m,payload:JSON.stringify({method:n,path:i,body:c,headers:r})},h={resolve:a,reject:p,timer:window.setTimeout(()=>{let C=this.#r[m];C&&(delete this.#r[m],C.reject("Timeout"))},u)};this.#r[m]=h,this.#n()?this.activateCommand(g):this.#p.push(g)})}activateCommand(e){this.#e?.send(JSON.stringify(e))}static \u0275fac=function(t){return new(t||o)};static \u0275prov=T({token:o,factory:o.\u0275fac,providedIn:"root"})};function Oe(o){if(typeof o!="string")return null;let t=new TextEncoder().encode(o);return window.btoa(String.fromCharCode(...t))}function Re(o,e,t){let n=o.relayconfigState.config();if(n===null)return t(e);let i=Oe(e.body),c={};e.headers.keys().forEach(p=>{c[p]=e.headers.get(p)??""});let r=e.headers.get("timeout"),u=r!==null?parseInt(r):o.defaultTimeout;e.url.startsWith("/api/v1/serverstate")&&e.url.includes("longpoll=true")&&(u=1e3*99);let a=o.relayWebsocket.sendCommand(n.accessToken,n.clientId,e.method,e.url,i,c,u);return new H(p=>{a.then(m=>{let v=new Q;c!=null&&Object.keys(c).forEach(h=>{v.set(h,c[h])});let g=new Y({body:m.body,status:m.code,statusText:"OK",headers:v});p.next(g),p.complete()})})}var Te=(o,e)=>{let t={relayconfigState:s(b),defaultTimeout:s(f).defaultTimeout,relayWebsocket:s(E)},n=t.relayconfigState.config();if(t.relayconfigState.configLoaded!==null&&n===null){let i=new V;return t.relayconfigState.configLoaded.subscribe(c=>{c&&Re(t,o,e).subscribe(i)}),i}return Re(t,o,e)};var we={providers:[K(),se(ve,ie()),Z(te(),ee([Te,Ce])),y,{provide:f,useValue:be},{provide:_,useValue:ge()},me,k,de,X,pe,q,ue,he]};oe(I,we);
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.0.99",
2
+ "version": "0.0.100",
3
3
  "name": "@duplicati/ngclient",
4
4
  "license": "MIT",
5
5
  "contributors": [
package/chunk-23KHTRDM.js DELETED
@@ -1 +0,0 @@
1
- import{a as ge}from"./chunk-XH2A67YP.js";import{a as _e}from"./chunk-WCLOWI5G.js";import{a as q,b as ue,c as v,e as N,h as b,j as E,s as $}from"./chunk-JJQARMUD.js";import{A as de,a as ae,g as se,l as k,o as pe,t as P,y as me,z as ce}from"./chunk-XQKR67WI.js";import{$b as le,Db as J,Eb as Q,Fb as re,Jb as x,Kb as p,Lb as j,Mb as V,Na as l,Pb as C,W as ne,Wa as oe,Xb as ee,Yb as m,Za as I,Zb as te,_b as S,ba as u,bc as F,ca as g,cb as _,cc as O,dc as w,hc as U,jb as B,kb as c,lb as z,oa as h,pb as T,pc as ie,qb as R,ra as y,rb as G,sb as W,tb as s,ub as a,vb as Y,wb as Z,xb as K,xc as M,yc as L,zb as f}from"./chunk-XGARKXE4.js";import{a as D,b as A}from"./chunk-7CGTOI24.js";var Te=[[["label"]],[["","prefix",""]],[["","suffix",""]]],ye=["label","[prefix]","[suffix]"];function he(n,o){if(n&1&&m(0),n&2){let e=o.$implicit,t=p();le("",e.label,"",t.hasPerSecond()?"/s":"","")}}var Fe=[{value:"bytes",label:"Bytes"},{value:"KB",label:"KB"},{value:"MB",label:"MB"},{value:"GB",label:"GB"},{value:"TB",label:"TB"},{value:"PB",label:"PB"}],Oe=["throttle-upload","throttle-download"],X=class n{customId=h();inputType=h();timespan=y(0);unit=y("MB");sizeOptions=y(Fe);readonly=y(!1);hasPerSecond=M(()=>{let o=this.inputType();return o&&Oe.includes(o)});onChange=()=>{};onTouched=()=>{};onChangeEffect=L(()=>{this.onChange(this.getValue())});writeValue(o){if(o){let e=o.match(/^(\d+)(bytes|kb|mb|gb|tb|pb|b)$/i);e?(this.timespan.set(parseInt(e[1],10)),this.unit.set(e[2].toUpperCase())):(this.timespan.set(0),this.unit.set("MB"))}else this.timespan.set(0),this.unit.set("MB")}registerOnChange(o){this.onChange=o}registerOnTouched(o){this.onTouched=o}setDisabledState(o){this.readonly.set(o)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=I({type:n,selectors:[["app-size"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[U([{provide:q,useExisting:n,multi:!0}])],ngContentSelectors:ye,decls:9,vars:10,consts:[[1,"label"],["type","number",3,"ngModelChange","id","ngModel","disabled"],["value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]],template:function(e,t){e&1&&(j(Te),s(0,"div",0),V(1,0,["ngProjectAs","label",5,["label"]]),a(),s(2,"spk-form-field")(3,"input",1),w("ngModelChange",function(r){return O(t.timespan,r)||(t.timespan=r),r}),a(),V(4,1),V(5,2),a(),s(6,"spk-select",2)(7,"input",3),w("ngModelChange",function(r){return O(t.unit,r)||(t.unit=r),r}),a(),_(8,he,1,2,"ng-template"),a()),e&2&&(l(2),B("readonly",t.readonly()||void 0),l(),c("id",t.customId()),F("ngModel",t.timespan),c("disabled",t.readonly()),l(3),z("--miw",0),c("options",t.sizeOptions())("readonly",t.readonly())("isClearable",!1),l(),F("ngModel",t.unit))},dependencies:[P,k,$,v,E,N,b],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] spk-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] spk-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};var we=[[["label"]],[["","prefix",""]],[["","suffix",""]]],Ve=["label","[prefix]","[suffix]"];function Me(n,o){if(n&1&&m(0),n&2){let e=o.$implicit;S(" ",e.label," ")}}var Ie=[{value:"s",label:$localize`Seconds`},{value:"m",label:$localize`Minutes`},{value:"h",label:$localize`Hours`}],ke=[{value:"y",label:$localize`Years`},{value:"m",label:$localize`Months`},{value:"w",label:$localize`Weeks`},{value:"d",label:$localize`Days`}];var H=class n{customId=h();inputType=h();timespan=y(0);#e="d";unit=y("d");isShortTime=M(()=>this.inputType()==="timespan");timeOptions=M(()=>this.isShortTime()?Ie:ke);readonly=y(!1);onChange=()=>{};onTouched=()=>{};onChangeEffect=L(()=>{this.onChange(this.getValue())});inputTypeEffect=L(()=>{let o=this.timeOptions(),e=this.isShortTime()?"s":"d";this.#e=e,this.unit.set(e)});writeValue(o){let e=this.isShortTime();if(o){let t=e?/(\d+)([smh])/i:/^(\d+)([ymwd])$/i,i=o.match(t);i?(this.timespan.set(parseInt(i[1],10)),this.unit.set(i[2])):(this.timespan.set(0),this.unit.set(this.#e))}else this.timespan.set(0),this.unit.set(this.#e)}registerOnChange(o){this.onChange=o}registerOnTouched(o){this.onTouched=o}setDisabledState(o){this.readonly.set(o)}getValue(){return`${this.timespan()}${this.unit()}`}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=I({type:n,selectors:[["app-timespan"]],inputs:{customId:[1,"customId"],inputType:[1,"inputType"]},features:[U([{provide:q,useExisting:n,multi:!0}])],ngContentSelectors:Ve,decls:8,vars:10,consts:()=>{let o;return o=$localize`Select an item...`,[["type","number",3,"ngModelChange","id","ngModel","disabled"],["placeholder",o,"value","value","label","label",3,"options","readonly","isClearable"],["type","text",3,"ngModelChange","ngModel"]]},template:function(e,t){e&1&&(j(we),V(0,0,["ngProjectAs","label",5,["label"]]),s(1,"spk-form-field")(2,"input",0),w("ngModelChange",function(r){return O(t.timespan,r)||(t.timespan=r),r}),a(),V(3,1),V(4,2),a(),s(5,"spk-select",1)(6,"input",2),w("ngModelChange",function(r){return O(t.unit,r)||(t.unit=r),r}),a(),_(7,Me,1,1,"ng-template"),a()),e&2&&(l(),B("readonly",t.readonly()||void 0),l(),c("id",t.customId()),F("ngModel",t.timespan),c("disabled",t.readonly()),l(3),z("--miw",0),c("options",t.timeOptions())("readonly",t.readonly())("isClearable",!1),l(),F("ngModel",t.unit))},dependencies:[P,k,$,v,E,N,b],styles:['[_nghost-%COMP%]{display:grid;grid-template-areas:"label label" "input unit";grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}[_nghost-%COMP%] .label[_ngcontent-%COMP%]{grid-area:label;grid-column:1/-1}[_nghost-%COMP%] spk-form-field[_ngcontent-%COMP%]{grid-area:input}[_nghost-%COMP%] spk-select[_ngcontent-%COMP%]{grid-area:unit}'],changeDetection:0})};function Pe(n,o){if(n&1){let e=f();s(0,"button",14),x("click",function(){u(e);let i=p();return g(i.addFreeTextSetting())}),J(1,5),Y(2,"spk-icon"),Q(),a()}}function ve(n,o){if(n&1){let e=f();s(0,"button",16,0),x("click",function(){let i=u(e).$implicit,r=p(2);return g(r.addSetting(i))}),m(2),a()}if(n&2){let e=o.$implicit;l(2),te(e.name)}}function Ne(n,o){if(n&1&&(s(0,"h3",7),m(1),a(),G(2,ve,3,1,"button",15,R)),n&2){let e=o.$implicit;l(),te(e.displayName),l(),W(e.options)}}function be(n,o){n&1&&(s(0,"div",12),m(1,"Add a setting above to get started."),a())}function Ee(n,o){if(n&1){let e=f();s(0,"div",17)(1,"label"),m(2),a(),s(3,"div",23)(4,"spk-form-field")(5,"input",24),x("ngModelChange",function(i){u(e);let r=p().$implicit,d=p();return g(d.updateFreeTextSettingName(r,i))}),a(),s(6,"spk-icon",25),m(7,"rectangle-dashed"),a()(),s(8,"spk-form-field")(9,"input",24),x("ngModelChange",function(i){u(e);let r=p().$implicit,d=p();return g(d.updateSettingValue(r,i))}),a(),s(10,"spk-icon",25),m(11,"textbox"),a()()()()}if(n&2){let e=p().$implicit;l(2),S(" ",e.FormView.shortDescription," "),l(3),c("ngModel",e.Name),l(4),c("ngModel",e.Value())}}function $e(n,o){if(n&1&&(s(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=p(2).$implicit;c("message",e.FormView.longDescription)}}function Le(n,o){if(n&1){let e=f();s(0,"app-file-tree",18)(1,"label",26),m(2),_(3,$e,3,1,"spk-tooltip",27),a(),s(4,"input",28),x("ngModelChange",function(i){u(e);let r=p().$implicit,d=p();return g(d.updateSettingValue(r,i))}),a()()}if(n&2){let e=p(),t=e.$implicit,i=e.$index;c("startingPath",t.Value())("accepts",t.FormView.accepts)("showFiles",!0)("showHiddenNodes",!0)("selectFiles",!0),l(),C("for","destination-",t.Name,"-",i,""),l(),S(" ",t.FormView.shortDescription," "),l(),T(t.FormView.longDescription?3:-1),l(),C("id","destination-",t.Name,"-",i,""),c("ngModel",t.Value())}}function De(n,o){if(n&1&&(s(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=p(2).$implicit;c("message",e.FormView.longDescription)}}function Ae(n,o){if(n&1){let e=f();s(0,"app-file-tree",19)(1,"label",26),m(2),_(3,De,3,1,"spk-tooltip",27),a(),s(4,"input",28),x("ngModelChange",function(i){u(e);let r=p().$implicit,d=p();return g(d.updateSettingValue(r,i))}),a()()}if(n&2){let e=p(),t=e.$implicit,i=e.$index;c("startingPath",t.Value()),l(),C("for","destination-",t.Name,"-",i,""),l(),S(" ",t.FormView.shortDescription," "),l(),T(t.FormView.longDescription?3:-1),l(),C("id","destination-",t.Name,"-",i,""),c("ngModel",t.Value())}}function Be(n,o){if(n&1&&(s(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=p(2).$implicit;c("message",e.FormView.longDescription)}}function ze(n,o){n&1&&(s(0,"spk-icon",25),m(1,"link"),a())}function Re(n,o){n&1&&(s(0,"spk-icon",25),m(1,"textbox"),a())}function Ge(n,o){if(n&1){let e=f();s(0,"spk-form-field")(1,"label",26),m(2),_(3,Be,3,1,"spk-tooltip",27),a(),s(4,"input",28),x("ngModelChange",function(i){u(e);let r=p().$implicit,d=p();return g(d.updateSettingValue(r,i))}),a(),_(5,ze,2,0,"spk-icon",25)(6,Re,2,0,"spk-icon",25),a()}if(n&2){let e=p(),t=e.$implicit,i=e.$index;l(),C("for","destination-",t.Name,"-",i,""),l(),S(" ",t.FormView.shortDescription," "),l(),T(t.FormView.longDescription?3:-1),l(),C("id","destination-",t.Name,"-",i,""),c("ngModel",t.Value()),l(),T(t.FormView.type==="Path"?5:6)}}function We(n,o){if(n&1){let e=f();s(0,"spk-icon",31),x("click",function(){u(e);let i=p(2).$implicit;return g(i.showPassword=!i.showPassword)}),m(1," eye "),a()}}function Ke(n,o){if(n&1){let e=f();s(0,"spk-icon",31),x("click",function(){u(e);let i=p(2).$implicit;return g(i.showPassword=!i.showPassword)}),m(1," eye-slash "),a()}}function je(n,o){if(n&1){let e=f();s(0,"spk-form-field")(1,"label",26),m(2),a(),s(3,"input",29),x("ngModelChange",function(i){u(e);let r=p().$implicit,d=p();return g(d.updateSettingValue(r,i))}),a(),s(4,"spk-icon",25),m(5,"password"),a(),_(6,We,2,0,"spk-icon",30)(7,Ke,2,0,"spk-icon",30),a()}if(n&2){let e=p(),t=e.$implicit,i=e.$index;l(),C("for","destination-",t.Name,"-",i,""),l(),S(" ",t.FormView.shortDescription," "),l(),C("id","destination-",t.Name,"-",i,""),c("type",t.showPassword?"text":"password")("ngModel",t.Value()),l(3),T(t.showPassword?6:7)}}function Ue(n,o){if(n&1&&(s(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=p(2).$implicit;c("message",e.FormView.longDescription)}}function qe(n,o){if(n&1&&m(0),n&2){let e=o.$implicit;S(" ",e," ")}}function Xe(n,o){if(n&1){let e=f();s(0,"spk-select",32)(1,"label",26),m(2),_(3,Ue,3,1,"spk-tooltip",27),a(),s(4,"input",28),x("ngModelChange",function(i){u(e);let r=p().$implicit,d=p();return g(d.updateSettingValue(r,i))}),a()(),_(5,qe,1,1,"ng-template",null,1,ie)}if(n&2){let e=ee(6),t=p(),i=t.$implicit,r=t.$index;c("options",i.FormView.options)("isClearable",!1)("optionTemplate",e),l(),C("for","destination-",i.Name,"-",r,""),l(),S(" ",i.FormView.shortDescription," "),l(),T(i.FormView.longDescription?3:-1),l(),C("id","destination-",i.Name,"-",r,""),c("ngModel",i.Value())}}function He(n,o){if(n&1&&(s(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=p(2).$implicit;c("message",e.FormView.longDescription)}}function Ye(n,o){if(n&1){let e=f();s(0,"app-size",33),w("ngModelChange",function(i){u(e);let r=p().$implicit;return O(r.Value,i)||(r.Value=i),g(i)}),s(1,"label",26),m(2),_(3,He,3,1,"spk-tooltip",27),a()()}if(n&2){let e,t=p(),i=t.$implicit,r=t.$index;c("inputType",i.Name),F("ngModel",i.Value),c("customId","destination-{{ item.Name }}-{{ $index }}"),l(),C("for","destination-",i.Name,"-",r,""),l(),S(" ",(e=i.FormView.shortDescription)!==null&&e!==void 0?e:i.FormView.name," "),l(),T(i.FormView.longDescription?3:-1)}}function Ze(n,o){if(n&1&&(s(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=p(2).$implicit;c("message",e.FormView.longDescription)}}function Je(n,o){if(n&1){let e=f();s(0,"spk-form-field")(1,"label",26),m(2),_(3,Ze,3,1,"spk-tooltip",27),a(),s(4,"input",34),x("ngModelChange",function(i){u(e);let r=p().$implicit,d=p();return g(d.updateSettingValue(r,i))}),a(),s(5,"spk-icon",25),m(6,"numpad"),a()()}if(n&2){let e=p(),t=e.$implicit,i=e.$index;l(),C("for","destination-",t.Name,"-",i,""),l(),S(" ",t.FormView.shortDescription," "),l(),T(t.FormView.longDescription?3:-1),l(),C("id","destination-",t.Name,"-",i,""),c("ngModel",t.Value())}}function Qe(n,o){if(n&1&&(s(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=p(2).$implicit;c("message",e.FormView.longDescription)}}function et(n,o){if(n&1){let e=f();s(0,"spk-toggle",21)(1,"label",26),m(2),_(3,Qe,3,1,"spk-tooltip",27),a(),s(4,"input",35),x("ngModelChange",function(i){u(e);let r=p().$implicit,d=p();return g(d.updateSettingValue(r,i))}),a()()}if(n&2){let e=p(),t=e.$implicit,i=e.$index;l(),C("for","destination-",t.Name,"-",i,""),l(),S(" ",t.FormView.shortDescription," "),l(),T(t.FormView.longDescription?3:-1),l(),C("id","destination-",t.Name,"-",i,""),c("ngModel",t.Value())}}function tt(n,o){if(n&1&&(s(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=p(2).$implicit;c("message",e.FormView.longDescription)}}function it(n,o){if(n&1&&m(0),n&2){let e=o.$implicit;S(" ",e," ")}}function nt(n,o){if(n&1){let e=f();s(0,"spk-select",36)(1,"label",26),m(2),_(3,tt,3,1,"spk-tooltip",27),a(),s(4,"input",37),x("ngModelChange",function(i){u(e);let r=p().$implicit,d=p();return g(d.updateSettingValue(r,i))}),a()(),_(5,it,1,1,"ng-template",null,2,ie)}if(n&2){let e=ee(6),t=p(),i=t.$implicit,r=t.$index;c("options",i.FormView.options)("selectMultiple",!0)("optionTemplate",e),l(),C("for","destination-",i.Name,"-",r,""),l(),S(" ",i.FormView.shortDescription," "),l(),T(i.FormView.longDescription?3:-1),l(),c("ngModel",i.Value())}}function ot(n,o){if(n&1&&(s(0,"spk-tooltip",27)(1,"spk-icon"),m(2,"question"),a()()),n&2){let e=p(2).$implicit;c("message",e.FormView.longDescription)}}function rt(n,o){if(n&1){let e=f();s(0,"app-timespan",33),w("ngModelChange",function(i){u(e);let r=p().$implicit;return O(r.Value,i)||(r.Value=i),g(i)}),s(1,"label",26),m(2),_(3,ot,3,1,"spk-tooltip",27),a()()}if(n&2){let e,t=p(),i=t.$implicit,r=t.$index;c("inputType",i.Name),F("ngModel",i.Value),c("customId","destination-{{ item.Name }}-{{ $index }}"),l(),C("for","destination-",i.Name,"-",r,""),l(),S(" ",(e=i.FormView.shortDescription)!==null&&e!==void 0?e:i.FormView.name," "),l(),T(i.FormView.longDescription?3:-1)}}function lt(n,o){if(n&1){let e=f();s(0,"div",13),_(1,Ee,12,3,"div",17)(2,Le,5,14,"app-file-tree",18)(3,Ae,5,10,"app-file-tree",19)(4,Ge,7,10,"spk-form-field")(5,je,8,10,"spk-form-field")(6,Xe,7,12)(7,Ye,4,8,"app-size",20)(8,Je,7,9,"spk-form-field")(9,et,5,9,"spk-toggle",21)(10,nt,7,9)(11,rt,4,8,"app-timespan",20),s(12,"button",22),x("click",function(){let i=u(e).$implicit,r=p();return g(r.removeSetting(i))}),s(13,"spk-icon"),m(14,"x-bold"),a()()()}if(n&2){let e=o.$implicit;l(),T(e.FormView.type==="FreeText"?1:e.FormView.type==="FileTree"?2:e.FormView.type==="FolderTree"?3:e.FormView.type==="String"||e.FormView.type==="Path"||e.FormView.type==="Decimal"?4:e.FormView.type==="Password"?5:e.FormView.type==="Enumeration"?6:e.FormView.type==="Size"?7:e.FormView.type==="Integer"?8:e.FormView.type==="Boolean"?9:e.FormView.type==="Flags"?10:e.FormView.type==="Timespan"||e.FormView.type==="DateTime"?11:-1)}}var Se=class n{#e=ne(_e);options=oe.required();hiddenOptions=h([]);hasFreeTextSettings=h(!1);allOptionsGrouped=this.#e.allOptionsGrouped;allOptions=this.#e.allOptions;selectedSettings=M(()=>{let o=this.hiddenOptions();return this.options().map(t=>{let i=this.allOptions().find(r=>r.name===t.Name);if(i&&!o.includes(i.name)){let r=t.Value??"";i.type==="Boolean"&&(r=r&&r.toLowerCase()==="true"||!1),i.type==="Integer"&&(r=parseInt(r)||0);let d=y(r);return A(D({},t),{Value:d,FormView:i})}else if(this.hasFreeTextSettings())return A(D({},t),{Value:y(t.Value),FormView:{name:t.Name,type:"FreeText",shortDescription:"Custom settings argument",longDescription:"Custom settings argument"}});return null}).filter(t=>t!==null)});nonSelectedOptionsGrouped=M(()=>{let o=this.options().map(t=>t.Name),e=this.hiddenOptions();return this.allOptionsGrouped().map(t=>A(D({},t),{options:t.options.filter(i=>!o.includes(i.name)&&!e.includes(i.name))})).filter(t=>t.options.length>0)});addFreeTextSetting(){this.hasFreeTextSettings()&&this.options.update(o=>[...o,{Filter:null,Name:"",Value:""}])}addSetting(o){this.options.update(e=>{let t=o.defaultValue??"";return o.type==="Boolean"&&(t=t.toLowerCase()==="true"||!1),o.type==="Integer"&&(t=parseInt(t)||0),[...e,{Name:o.name,Value:t}]})}updateSettingValue(o,e){this.options.update(t=>{let i=[...t],r=i.findIndex(d=>d.Name===o.Name);return o.FormView.type==="Boolean"?(i[r].Value=e?"True":"False",i):o.FormView.type==="Integer"?(i[r].Value=e.toString(),i):(i[r].Value=e,i)})}updateFreeTextSettingName(o,e){this.options.update(t=>{let i=[...t],r=i.findIndex(d=>d.Name===o.Name);return i[r].Name=e,i})}removeSetting(o){this.options.update(e=>e.filter(t=>t.Name!==o.Name))}static \u0275fac=function(e){return new(e||n)};static \u0275cmp=I({type:n,selectors:[["app-options-list"]],inputs:{options:[1,"options"],hiddenOptions:[1,"hiddenOptions"],hasFreeTextSettings:[1,"hasFreeTextSettings"]},outputs:{options:"optionsChange"},decls:16,vars:4,consts:()=>{let o;o=$localize`Advanced options`;let e;e=$localize` Add advanced option ${"\uFFFD#9\uFFFD"}:START_TAG_SPK_ICON:plus${"\uFFFD/#9\uFFFD"}:CLOSE_TAG_SPK_ICON:`;let t;return t=$localize` New custom option ${"\uFFFD#2\uFFFD"}:START_TAG_SPK_ICON:pen${"\uFFFD/#2\uFFFD"}:CLOSE_TAG_SPK_ICON:`,[["option",""],["enumOptionTemplate",""],["optionTemplate",""],o,e,t,[3,"disallowToggle"],["title",""],[1,"actions"],["spk-button","","type","button",1,"outlined","small"],[3,"searchable"],["menu",""],[1,"placeholder"],[1,"field-row"],["spk-button","","type","button",1,"outlined","small",3,"click"],["type","button"],["type","button",3,"click"],[1,"form-column"],[3,"startingPath","accepts","showFiles","showHiddenNodes","selectFiles"],[3,"startingPath"],[3,"inputType","ngModel","customId"],[1,"primary","raised"],["spk-button","","type","button",1,"outlined","remove-btn",3,"click"],[1,"form-row"],["type","text",3,"ngModelChange","ngModel"],["prefix",""],[3,"for"],[1,"primary",3,"message"],["type","text",3,"ngModelChange","id","ngModel"],["autocomplete","off",3,"ngModelChange","type","id","ngModel"],["suffix","",1,"clickable"],["suffix","",1,"clickable",3,"click"],[3,"options","isClearable","optionTemplate"],[3,"ngModelChange","inputType","ngModel","customId"],["type","number",3,"ngModelChange","id","ngModel"],["type","checkbox",3,"ngModelChange","id","ngModel"],[1,"primary","raised",3,"options","selectMultiple","optionTemplate"],["type","text","id","text",3,"ngModelChange","ngModel"]]},template:function(e,t){e&1&&(s(0,"spk-toggle-card",6),Z(1,7)(2),re(3,3),K(),s(4,"div",8),_(5,Pe,3,0,"button",9),s(6,"spk-menu",10)(7,"button",9),J(8,4),Y(9,"spk-icon"),Q(),a(),Z(10,11),G(11,Ne,4,1,null,null,R),K(),a()(),K(),_(13,be,2,0,"div",12),G(14,lt,15,1,"div",13,R),a()),e&2&&(c("disallowToggle",!0),l(5),T(t.hasFreeTextSettings()?5:-1),l(),c("searchable",!0),l(5),W(t.nonSelectedOptionsGrouped()),l(2),T(t.selectedSettings().length===0?13:-1),l(),W(t.selectedSettings()))},dependencies:[$,v,E,ue,N,b,ge,me,k,se,pe,de,ae,P,ce,X,H],styles:["[_nghost-%COMP%]{display:block}spk-select[_ngcontent-%COMP%]{--miw: p2r(120)}spk-toggle[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.placeholder[_ngcontent-%COMP%]{color:var(--base-level-60R);text-align:center;padding:2rem 1rem}.field-row[_ngcontent-%COMP%]{display:grid;align-items:center;grid-template-columns:1fr 2.5rem;gap:.5rem}.field-row[_ngcontent-%COMP%] .remove-btn[_ngcontent-%COMP%]{align-self:flex-end}.form-column[_ngcontent-%COMP%]{display:flex;gap:.25rem;flex-direction:column}.form-column[_ngcontent-%COMP%] label[_ngcontent-%COMP%]{display:flex;align-items:center;gap:.25rem}.form-column[_ngcontent-%COMP%] spk-icon[_ngcontent-%COMP%]{font-size:1rem}.form-row[_ngcontent-%COMP%]{display:grid;grid-template-columns:3fr 1fr;gap:.5rem;align-items:flex-end}.actions[_ngcontent-%COMP%]{display:flex;gap:.5rem;justify-content:flex-end}"],changeDetection:0})};export{X as a,H as b,Se as c};
package/chunk-2ZK7AAG4.js DELETED
@@ -1 +0,0 @@
1
- import"./chunk-7CGTOI24.js";var t=[{path:"",redirectTo:"select-files",pathMatch:"full"},{path:"destination",loadComponent:()=>import("./chunk-QRVYPTC6.js")},{path:"encryption",loadComponent:()=>import("./chunk-GNTO7EKM.js")},{path:"select-files",loadComponent:()=>import("./chunk-H6IX2D2G.js")},{path:"options",loadComponent:()=>import("./chunk-7NPADQLG.js")}],o=t;export{o as default};