From 42e4d8c7ba3d7734859fd257c83191e7c42dda63 Mon Sep 17 00:00:00 2001 From: Donald Zou Date: Sat, 9 Nov 2024 00:40:42 +0800 Subject: [PATCH] build --- ...{configuration-BvSurJ6F.js => configuration-vZnfxuPU.js} | 2 +- ...e-ByIwj5e4.js => configurationBackupRestore-CerUpwbQ.js} | 2 +- ...rationList-TvNdRf4q.js => configurationList-BAuTfbU-.js} | 2 +- .../assets/{dayjs.min-Lw24H7b2.js => dayjs.min-D8jwq_wn.js} | 2 +- ...guration-BCmwxoLx.js => deleteConfiguration-BU0tzWgI.js} | 2 +- ...figuration-hI0uF3Oq.js => editConfiguration-kC_NwN06.js} | 2 +- .../dist/assets/{index-C8JLgmcN.js => index-C0bjwRB-.js} | 2 +- .../dist/assets/{index-BPNEscAR.js => index-DOaPWS1X.js} | 4 ++-- .../{localeText-DX813vQA.js => localeText-CaAXeE0W.js} | 2 +- .../assets/{message-Cw7_G39b.js => message-ChztDIV3.js} | 2 +- ...nfiguration-Ccc7iqeY.js => newConfiguration-R-olohWo.js} | 2 +- .../dist/assets/{osmap-DFqkfaU2.js => osmap-BRB1j1wE.js} | 2 +- ...onFile-phV9SBBy.js => peerConfigurationFile-BRKM9nlG.js} | 2 +- .../app/dist/assets/peerConfigurationFile-CNB9RKjb.css | 1 + .../app/dist/assets/peerConfigurationFile-fak3wop9.css | 1 - .../{peerCreate-C7F1RHXB.js => peerCreate-B_n86hyd.js} | 2 +- .../assets/{peerJobs-Cnl9B8_O.js => peerJobs-BbNYdlYw.js} | 2 +- ...obsAllModal-BuV_jZ_r.js => peerJobsAllModal-CkJIs1TM.js} | 2 +- ...sLogsModal-oNsuA1Dm.js => peerJobsLogsModal-ZNMKiJ-k.js} | 2 +- .../assets/{peerList-CMo3vsiC.js => peerList-C2NQGcke.js} | 6 +++--- .../{peerQRCode-BbWkgVDW.js => peerQRCode-DEHFJvZX.js} | 2 +- .../{peerSettings-BNzBnZYL.js => peerSettings-Bgrsto1V.js} | 2 +- ...LinkModal-Bqogws3W.js => peerShareLinkModal-6b5Bdaqt.js} | 2 +- .../app/dist/assets/{ping-DUh82NQw.js => ping-BB-b6WHn.js} | 2 +- ...uration-N3JQhUVT.js => restoreConfiguration-DN55Pnc_.js} | 2 +- ...edulePeerJob-UvgbczqH.js => schedulePeerJob-Bfwzc6gk.js} | 2 +- .../{selectPeers-BBMqr9bY.js => selectPeers-B6Dm7IFO.js} | 2 +- .../assets/{settings-ReVwIZ3m.js => settings-B22cgeoY.js} | 2 +- .../dist/assets/{setup-CE_Ispds.js => setup-DUH8iz4Z.js} | 2 +- .../dist/assets/{share-Ddnyobqg.js => share-BU0DtM5p.js} | 2 +- .../dist/assets/{signin-D6BnWOQO.js => signin-M3EwqtyC.js} | 2 +- .../app/dist/assets/{totp-B2bG5DyX.js => totp-BZU5dK65.js} | 2 +- .../{traceroute-D1nMpdIh.js => traceroute-BGkng5o-.js} | 2 +- ...ue-datepicker-D9reu0Fg.js => vue-datepicker-D91GxXPq.js} | 2 +- src/static/app/dist/index.html | 2 +- .../configurationComponents/peerConfigurationFile.vue | 3 +-- 36 files changed, 38 insertions(+), 39 deletions(-) rename src/static/app/dist/assets/{configuration-BvSurJ6F.js => configuration-vZnfxuPU.js} (86%) rename src/static/app/dist/assets/{configurationBackupRestore-ByIwj5e4.js => configurationBackupRestore-CerUpwbQ.js} (97%) rename src/static/app/dist/assets/{configurationList-TvNdRf4q.js => configurationList-BAuTfbU-.js} (97%) rename src/static/app/dist/assets/{dayjs.min-Lw24H7b2.js => dayjs.min-D8jwq_wn.js} (99%) rename src/static/app/dist/assets/{deleteConfiguration-BCmwxoLx.js => deleteConfiguration-BU0tzWgI.js} (98%) rename src/static/app/dist/assets/{editConfiguration-hI0uF3Oq.js => editConfiguration-kC_NwN06.js} (98%) rename src/static/app/dist/assets/{index-C8JLgmcN.js => index-C0bjwRB-.js} (97%) rename src/static/app/dist/assets/{index-BPNEscAR.js => index-DOaPWS1X.js} (99%) rename src/static/app/dist/assets/{localeText-DX813vQA.js => localeText-CaAXeE0W.js} (72%) rename src/static/app/dist/assets/{message-Cw7_G39b.js => message-ChztDIV3.js} (81%) rename src/static/app/dist/assets/{newConfiguration-Ccc7iqeY.js => newConfiguration-R-olohWo.js} (98%) rename src/static/app/dist/assets/{osmap-DFqkfaU2.js => osmap-BRB1j1wE.js} (99%) rename src/static/app/dist/assets/{peerConfigurationFile-phV9SBBy.js => peerConfigurationFile-BRKM9nlG.js} (53%) create mode 100644 src/static/app/dist/assets/peerConfigurationFile-CNB9RKjb.css delete mode 100644 src/static/app/dist/assets/peerConfigurationFile-fak3wop9.css rename src/static/app/dist/assets/{peerCreate-C7F1RHXB.js => peerCreate-B_n86hyd.js} (99%) rename src/static/app/dist/assets/{peerJobs-Cnl9B8_O.js => peerJobs-BbNYdlYw.js} (90%) rename src/static/app/dist/assets/{peerJobsAllModal-BuV_jZ_r.js => peerJobsAllModal-CkJIs1TM.js} (89%) rename src/static/app/dist/assets/{peerJobsLogsModal-oNsuA1Dm.js => peerJobsLogsModal-ZNMKiJ-k.js} (96%) rename src/static/app/dist/assets/{peerList-CMo3vsiC.js => peerList-C2NQGcke.js} (99%) rename src/static/app/dist/assets/{peerQRCode-BbWkgVDW.js => peerQRCode-DEHFJvZX.js} (88%) rename src/static/app/dist/assets/{peerSettings-BNzBnZYL.js => peerSettings-Bgrsto1V.js} (98%) rename src/static/app/dist/assets/{peerShareLinkModal-Bqogws3W.js => peerShareLinkModal-6b5Bdaqt.js} (95%) rename src/static/app/dist/assets/{ping-DUh82NQw.js => ping-BB-b6WHn.js} (98%) rename src/static/app/dist/assets/{restoreConfiguration-N3JQhUVT.js => restoreConfiguration-DN55Pnc_.js} (99%) rename src/static/app/dist/assets/{schedulePeerJob-UvgbczqH.js => schedulePeerJob-Bfwzc6gk.js} (96%) rename src/static/app/dist/assets/{selectPeers-BBMqr9bY.js => selectPeers-B6Dm7IFO.js} (97%) rename src/static/app/dist/assets/{settings-ReVwIZ3m.js => settings-B22cgeoY.js} (99%) rename src/static/app/dist/assets/{setup-CE_Ispds.js => setup-DUH8iz4Z.js} (96%) rename src/static/app/dist/assets/{share-Ddnyobqg.js => share-BU0DtM5p.js} (95%) rename src/static/app/dist/assets/{signin-D6BnWOQO.js => signin-M3EwqtyC.js} (98%) rename src/static/app/dist/assets/{totp-B2bG5DyX.js => totp-BZU5dK65.js} (96%) rename src/static/app/dist/assets/{traceroute-D1nMpdIh.js => traceroute-BGkng5o-.js} (96%) rename src/static/app/dist/assets/{vue-datepicker-D9reu0Fg.js => vue-datepicker-D91GxXPq.js} (99%) diff --git a/src/static/app/dist/assets/configuration-BvSurJ6F.js b/src/static/app/dist/assets/configuration-vZnfxuPU.js similarity index 86% rename from src/static/app/dist/assets/configuration-BvSurJ6F.js rename to src/static/app/dist/assets/configuration-vZnfxuPU.js index f44088a..59c8fc5 100644 --- a/src/static/app/dist/assets/configuration-BvSurJ6F.js +++ b/src/static/app/dist/assets/configuration-vZnfxuPU.js @@ -1 +1 @@ -import{_ as r,c as i,d as o,w as e,j as l,a as t,T as _,i as a,l as d,S as u}from"./index-BPNEscAR.js";const m={name:"configuration"},p={class:"mt-md-5 mt-3 text-body"};function f(x,h,k,w,$,v){const n=l("RouterView");return t(),i("div",p,[o(n,null,{default:e(({Component:s,route:c})=>[o(_,{name:"fade2",mode:"out-in"},{default:e(()=>[(t(),a(u,null,{default:e(()=>[(t(),a(d(s),{key:c.path}))]),_:2},1024))]),_:2},1024)]),_:1})])}const B=r(m,[["render",f]]);export{B as default}; +import{_ as r,c as i,d as o,w as e,j as l,a as t,T as _,i as a,l as d,S as u}from"./index-DOaPWS1X.js";const m={name:"configuration"},p={class:"mt-md-5 mt-3 text-body"};function f(x,h,k,w,$,v){const n=l("RouterView");return t(),i("div",p,[o(n,null,{default:e(({Component:s,route:c})=>[o(_,{name:"fade2",mode:"out-in"},{default:e(()=>[(t(),a(u,null,{default:e(()=>[(t(),a(d(s),{key:c.path}))]),_:2},1024))]),_:2},1024)]),_:1})])}const B=r(m,[["render",f]]);export{B as default}; diff --git a/src/static/app/dist/assets/configurationBackupRestore-ByIwj5e4.js b/src/static/app/dist/assets/configurationBackupRestore-CerUpwbQ.js similarity index 97% rename from src/static/app/dist/assets/configurationBackupRestore-ByIwj5e4.js rename to src/static/app/dist/assets/configurationBackupRestore-CerUpwbQ.js index 4bf6383..98f6ac8 100644 --- a/src/static/app/dist/assets/configurationBackupRestore-ByIwj5e4.js +++ b/src/static/app/dist/assets/configurationBackupRestore-CerUpwbQ.js @@ -1 +1 @@ -import{_ as Y,u as S,r as p,$ as R,D as L,x as F,a as r,c as d,b as e,d as a,w as C,e as _,T as B,t as $,f as w,B as P,n as N,q as D,o as T,g as M,F as V,h as H,i as W,k as j}from"./index-BPNEscAR.js";import{d as z}from"./dayjs.min-Lw24H7b2.js";import{L as n}from"./localeText-DX813vQA.js";const A={class:"card my-0 rounded-3"},G={class:"card-body position-relative"},I={key:0,class:"position-absolute w-100 h-100 confirmationContainer start-0 top-0 rounded-3 d-flex p-2"},q={class:"m-auto"},E={class:"d-flex gap-2 align-items-center justify-content-center"},J=["disabled"],K=["disabled"],O={key:0,class:"position-absolute w-100 h-100 confirmationContainer start-0 top-0 rounded-3 d-flex p-2"},Q={class:"m-auto"},U={class:"d-flex gap-2 align-items-center justify-content-center"},X=["disabled"],Z=["disabled"],ee={class:"d-flex gap-3"},se={class:"d-flex flex-column"},te={class:"text-muted"},ae={class:"d-flex flex-column"},oe={class:"text-muted"},ne={class:"d-flex gap-2 align-items-center ms-auto"},le={class:"card rounded-3"},ie={key:0,class:"card-body"},re=["value"],de={class:"d-flex"},ue={__name:"backup",props:["b","delay"],emits:["refresh","refreshPeersList"],setup(c,{emit:y}){S(g=>({"6919ade8":h.value}));const u=c,i=p(!1),l=p(!1),k=R(),v=y,b=L(),o=p(!1),t=()=>{o.value=!0,D("/api/deleteWireguardConfigurationBackup",{configurationName:k.params.id,backupFileName:u.b.filename},g=>{o.value=!1,g.status?(v("refresh"),b.newMessage("Server","Backup deleted","success")):b.newMessage("Server","Backup failed to delete","danger")})},m=()=>{o.value=!0,D("/api/restoreWireguardConfigurationBackup",{configurationName:k.params.id,backupFileName:u.b.filename},g=>{o.value=!1,l.value=!1,g.status?(v("refresh"),b.newMessage("Server","Backup restored with "+u.b.filename,"success")):b.newMessage("Server","Backup failed to restore","danger")})},h=F(()=>u.delay+"s"),x=p(!1);return(g,s)=>(r(),d("div",A,[e("div",G,[a(B,{name:"zoomReversed"},{default:C(()=>[i.value?(r(),d("div",I,[e("div",q,[e("h5",null,[a(n,{t:"Are you sure to delete this backup?"})]),e("div",E,[e("button",{class:"btn btn-danger rounded-3",disabled:o.value,onClick:s[0]||(s[0]=f=>t())},[a(n,{t:"Yes"})],8,J),e("button",{onClick:s[1]||(s[1]=f=>i.value=!1),disabled:o.value,class:"btn bg-secondary-subtle text-secondary-emphasis border-secondary-subtle rounded-3"},[a(n,{t:"No"})],8,K)])])])):_("",!0)]),_:1}),a(B,{name:"zoomReversed"},{default:C(()=>[l.value?(r(),d("div",O,[e("div",Q,[e("h5",null,[a(n,{t:"Are you sure to restore this backup?"})]),e("div",U,[e("button",{disabled:o.value,onClick:s[2]||(s[2]=f=>m()),class:"btn btn-success rounded-3"},[a(n,{t:"Yes"})],8,X),e("button",{onClick:s[3]||(s[3]=f=>l.value=!1),disabled:o.value,class:"btn bg-secondary-subtle text-secondary-emphasis border-secondary-subtle rounded-3"},[a(n,{t:"No"})],8,Z)])])])):_("",!0)]),_:1}),e("div",ee,[e("div",se,[e("small",te,[a(n,{t:"Backup"})]),e("samp",null,$(c.b.filename),1)]),e("div",ae,[e("small",oe,[a(n,{t:"Backup Date"})]),w(" "+$(P(z)(c.b.backupDate,"YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss")),1)]),e("div",ne,[e("button",{onClick:s[4]||(s[4]=f=>l.value=!0),class:"btn bg-warning-subtle text-warning-emphasis border-warning-subtle rounded-3 btn-sm"},s[7]||(s[7]=[e("i",{class:"bi bi-clock-history"},null,-1)])),e("button",{onClick:s[5]||(s[5]=f=>i.value=!0),class:"btn bg-danger-subtle text-danger-emphasis border-danger-subtle rounded-3 btn-sm"},s[8]||(s[8]=[e("i",{class:"bi bi-trash-fill"},null,-1)]))])]),s[12]||(s[12]=e("hr",null,null,-1)),e("div",le,[e("a",{role:"button",class:N(["card-header d-flex text-decoration-none align-items-center",{"border-bottom-0":!x.value}]),style:{cursor:"pointer"},onClick:s[6]||(s[6]=f=>x.value=!x.value)},[e("small",null,[s[9]||(s[9]=w(".conf ")),a(n,{t:"File"})]),s[10]||(s[10]=e("i",{class:"bi bi-chevron-down ms-auto"},null,-1))],2),x.value?(r(),d("div",ie,[e("textarea",{class:"form-control rounded-3",value:c.b.content,disabled:"",style:{height:"300px","font-family":"var(--bs-font-monospace),sans-serif !important"}},null,8,re)])):_("",!0)]),s[13]||(s[13]=e("hr",null,null,-1)),e("div",de,[e("span",null,[s[11]||(s[11]=e("i",{class:"bi bi-database me-1"},null,-1)),a(n,{t:"Database File"})]),e("i",{class:N(["bi ms-auto",[c.b.database?"text-success bi-check-circle-fill":"text-danger bi-x-circle-fill"]])},null,2)])])]))}},ce=Y(ue,[["__scopeId","data-v-a575be12"]]),be={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll",ref:"editConfigurationContainer"},me={class:"d-flex h-100 w-100"},fe={class:"modal-dialog-centered dashboardModal w-100 h-100 overflow-x-scroll flex-column gap-3 mx-3"},pe={class:"my-5 d-flex gap-3 flex-column position-relative"},ve={class:"title"},ge={class:"d-flex mb-3"},ke={class:"mb-0"},xe={class:"position-relative d-flex flex-column gap-3"},_e={class:"text-center title",key:"spinner"},ye={class:"card my-0 rounded-3",key:"noBackups"},he={class:"card-body text-center text-muted"},Ce={__name:"configurationBackupRestore",emits:["close","refreshPeersList"],setup(c,{emit:y}){const u=R(),i=p([]),l=p(!0),k=y;T(()=>{v()});const v=()=>{l.value=!0,M("/api/getWireguardConfigurationBackup",{configurationName:u.params.id},o=>{i.value=o.data,l.value=!1})},b=()=>{M("/api/createWireguardConfigurationBackup",{configurationName:u.params.id},o=>{i.value=o.data,l.value=!1})};return(o,t)=>(r(),d("div",be,[e("div",me,[e("div",fe,[e("div",pe,[e("div",ve,[e("div",ge,[e("h4",ke,[a(n,{t:"Backup & Restore"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=m=>o.$emit("close"))})]),e("button",{onClick:t[1]||(t[1]=m=>b()),class:"btn bg-primary-subtle text-primary-emphasis border-primary-subtle rounded-3 w-100"},[t[4]||(t[4]=e("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),a(n,{t:"Create Backup"})])]),e("div",xe,[a(j,{name:"list1"},{default:C(()=>[l.value&&i.value.length===0?(r(),d("div",_e,t[5]||(t[5]=[e("div",{class:"spinner-border"},null,-1)]))):!l.value&&i.value.length===0?(r(),d("div",ye,[e("div",he,[t[6]||(t[6]=e("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),a(n,{t:"No backup yet, click the button above to create backup."})])])):_("",!0),(r(!0),d(V,null,H(i.value,m=>(r(),W(ce,{onRefresh:t[2]||(t[2]=h=>v()),onRefreshPeersList:t[3]||(t[3]=h=>k("refreshPeersList")),b:m,key:m.filename},null,8,["b"]))),128))]),_:1})])])])])],512))}},Ne=Y(Ce,[["__scopeId","data-v-1f718118"]]);export{Ne as default}; +import{_ as Y,u as S,r as p,$ as R,D as L,x as F,a as r,c as d,b as e,d as a,w as C,e as _,T as B,t as $,f as w,B as P,n as N,q as D,o as T,g as M,F as V,h as H,i as W,k as j}from"./index-DOaPWS1X.js";import{d as z}from"./dayjs.min-D8jwq_wn.js";import{L as n}from"./localeText-CaAXeE0W.js";const A={class:"card my-0 rounded-3"},G={class:"card-body position-relative"},I={key:0,class:"position-absolute w-100 h-100 confirmationContainer start-0 top-0 rounded-3 d-flex p-2"},q={class:"m-auto"},E={class:"d-flex gap-2 align-items-center justify-content-center"},J=["disabled"],K=["disabled"],O={key:0,class:"position-absolute w-100 h-100 confirmationContainer start-0 top-0 rounded-3 d-flex p-2"},Q={class:"m-auto"},U={class:"d-flex gap-2 align-items-center justify-content-center"},X=["disabled"],Z=["disabled"],ee={class:"d-flex gap-3"},se={class:"d-flex flex-column"},te={class:"text-muted"},ae={class:"d-flex flex-column"},oe={class:"text-muted"},ne={class:"d-flex gap-2 align-items-center ms-auto"},le={class:"card rounded-3"},ie={key:0,class:"card-body"},re=["value"],de={class:"d-flex"},ue={__name:"backup",props:["b","delay"],emits:["refresh","refreshPeersList"],setup(c,{emit:y}){S(g=>({"6919ade8":h.value}));const u=c,i=p(!1),l=p(!1),k=R(),v=y,b=L(),o=p(!1),t=()=>{o.value=!0,D("/api/deleteWireguardConfigurationBackup",{configurationName:k.params.id,backupFileName:u.b.filename},g=>{o.value=!1,g.status?(v("refresh"),b.newMessage("Server","Backup deleted","success")):b.newMessage("Server","Backup failed to delete","danger")})},m=()=>{o.value=!0,D("/api/restoreWireguardConfigurationBackup",{configurationName:k.params.id,backupFileName:u.b.filename},g=>{o.value=!1,l.value=!1,g.status?(v("refresh"),b.newMessage("Server","Backup restored with "+u.b.filename,"success")):b.newMessage("Server","Backup failed to restore","danger")})},h=F(()=>u.delay+"s"),x=p(!1);return(g,s)=>(r(),d("div",A,[e("div",G,[a(B,{name:"zoomReversed"},{default:C(()=>[i.value?(r(),d("div",I,[e("div",q,[e("h5",null,[a(n,{t:"Are you sure to delete this backup?"})]),e("div",E,[e("button",{class:"btn btn-danger rounded-3",disabled:o.value,onClick:s[0]||(s[0]=f=>t())},[a(n,{t:"Yes"})],8,J),e("button",{onClick:s[1]||(s[1]=f=>i.value=!1),disabled:o.value,class:"btn bg-secondary-subtle text-secondary-emphasis border-secondary-subtle rounded-3"},[a(n,{t:"No"})],8,K)])])])):_("",!0)]),_:1}),a(B,{name:"zoomReversed"},{default:C(()=>[l.value?(r(),d("div",O,[e("div",Q,[e("h5",null,[a(n,{t:"Are you sure to restore this backup?"})]),e("div",U,[e("button",{disabled:o.value,onClick:s[2]||(s[2]=f=>m()),class:"btn btn-success rounded-3"},[a(n,{t:"Yes"})],8,X),e("button",{onClick:s[3]||(s[3]=f=>l.value=!1),disabled:o.value,class:"btn bg-secondary-subtle text-secondary-emphasis border-secondary-subtle rounded-3"},[a(n,{t:"No"})],8,Z)])])])):_("",!0)]),_:1}),e("div",ee,[e("div",se,[e("small",te,[a(n,{t:"Backup"})]),e("samp",null,$(c.b.filename),1)]),e("div",ae,[e("small",oe,[a(n,{t:"Backup Date"})]),w(" "+$(P(z)(c.b.backupDate,"YYYYMMDDHHmmss").format("YYYY-MM-DD HH:mm:ss")),1)]),e("div",ne,[e("button",{onClick:s[4]||(s[4]=f=>l.value=!0),class:"btn bg-warning-subtle text-warning-emphasis border-warning-subtle rounded-3 btn-sm"},s[7]||(s[7]=[e("i",{class:"bi bi-clock-history"},null,-1)])),e("button",{onClick:s[5]||(s[5]=f=>i.value=!0),class:"btn bg-danger-subtle text-danger-emphasis border-danger-subtle rounded-3 btn-sm"},s[8]||(s[8]=[e("i",{class:"bi bi-trash-fill"},null,-1)]))])]),s[12]||(s[12]=e("hr",null,null,-1)),e("div",le,[e("a",{role:"button",class:N(["card-header d-flex text-decoration-none align-items-center",{"border-bottom-0":!x.value}]),style:{cursor:"pointer"},onClick:s[6]||(s[6]=f=>x.value=!x.value)},[e("small",null,[s[9]||(s[9]=w(".conf ")),a(n,{t:"File"})]),s[10]||(s[10]=e("i",{class:"bi bi-chevron-down ms-auto"},null,-1))],2),x.value?(r(),d("div",ie,[e("textarea",{class:"form-control rounded-3",value:c.b.content,disabled:"",style:{height:"300px","font-family":"var(--bs-font-monospace),sans-serif !important"}},null,8,re)])):_("",!0)]),s[13]||(s[13]=e("hr",null,null,-1)),e("div",de,[e("span",null,[s[11]||(s[11]=e("i",{class:"bi bi-database me-1"},null,-1)),a(n,{t:"Database File"})]),e("i",{class:N(["bi ms-auto",[c.b.database?"text-success bi-check-circle-fill":"text-danger bi-x-circle-fill"]])},null,2)])])]))}},ce=Y(ue,[["__scopeId","data-v-a575be12"]]),be={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll",ref:"editConfigurationContainer"},me={class:"d-flex h-100 w-100"},fe={class:"modal-dialog-centered dashboardModal w-100 h-100 overflow-x-scroll flex-column gap-3 mx-3"},pe={class:"my-5 d-flex gap-3 flex-column position-relative"},ve={class:"title"},ge={class:"d-flex mb-3"},ke={class:"mb-0"},xe={class:"position-relative d-flex flex-column gap-3"},_e={class:"text-center title",key:"spinner"},ye={class:"card my-0 rounded-3",key:"noBackups"},he={class:"card-body text-center text-muted"},Ce={__name:"configurationBackupRestore",emits:["close","refreshPeersList"],setup(c,{emit:y}){const u=R(),i=p([]),l=p(!0),k=y;T(()=>{v()});const v=()=>{l.value=!0,M("/api/getWireguardConfigurationBackup",{configurationName:u.params.id},o=>{i.value=o.data,l.value=!1})},b=()=>{M("/api/createWireguardConfigurationBackup",{configurationName:u.params.id},o=>{i.value=o.data,l.value=!1})};return(o,t)=>(r(),d("div",be,[e("div",me,[e("div",fe,[e("div",pe,[e("div",ve,[e("div",ge,[e("h4",ke,[a(n,{t:"Backup & Restore"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=m=>o.$emit("close"))})]),e("button",{onClick:t[1]||(t[1]=m=>b()),class:"btn bg-primary-subtle text-primary-emphasis border-primary-subtle rounded-3 w-100"},[t[4]||(t[4]=e("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),a(n,{t:"Create Backup"})])]),e("div",xe,[a(j,{name:"list1"},{default:C(()=>[l.value&&i.value.length===0?(r(),d("div",_e,t[5]||(t[5]=[e("div",{class:"spinner-border"},null,-1)]))):!l.value&&i.value.length===0?(r(),d("div",ye,[e("div",he,[t[6]||(t[6]=e("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),a(n,{t:"No backup yet, click the button above to create backup."})])])):_("",!0),(r(!0),d(V,null,H(i.value,m=>(r(),W(ce,{onRefresh:t[2]||(t[2]=h=>v()),onRefreshPeersList:t[3]||(t[3]=h=>k("refreshPeersList")),b:m,key:m.filename},null,8,["b"]))),128))]),_:1})])])])])],512))}},Ne=Y(Ce,[["__scopeId","data-v-1f718118"]]);export{Ne as default}; diff --git a/src/static/app/dist/assets/configurationList-TvNdRf4q.js b/src/static/app/dist/assets/configurationList-BAuTfbU-.js similarity index 97% rename from src/static/app/dist/assets/configurationList-TvNdRf4q.js rename to src/static/app/dist/assets/configurationList-BAuTfbU-.js index 17e8ad7..5f7ca28 100644 --- a/src/static/app/dist/assets/configurationList-TvNdRf4q.js +++ b/src/static/app/dist/assets/configurationList-BAuTfbU-.js @@ -1 +1 @@ -import{_ as x,D as L,g as N,a,c as l,d as i,w as m,b as t,n as C,t as r,f,i as c,e as h,m as P,v as D,u as B,j as d,W as U,k as G,F as V,h as I}from"./index-BPNEscAR.js";import{L as w}from"./localeText-DX813vQA.js";const _={name:"configurationCard",components:{LocaleText:w},props:{c:{Name:String,Status:Boolean,PublicKey:String,PrivateKey:String},delay:String},data(){return{configurationToggling:!1}},setup(){return{dashboardConfigurationStore:L()}},methods:{toggle(){this.configurationToggling=!0,N("/api/toggleWireguardConfiguration/",{configurationName:this.c.Name},s=>{s.status?this.dashboardConfigurationStore.newMessage("Server",`${this.c.Name} ${s.data?"is on":"is off"}`):this.dashboardConfigurationStore.newMessage("Server",s.message,"danger"),this.c.Status=s.data,this.configurationToggling=!1})}}},y=()=>{B(s=>({"1d5189b2":s.delay}))},S=_.setup;_.setup=S?(s,o)=>(y(),S(s,o)):y;const K={class:"card conf_card rounded-3 shadow text-decoration-none"},R={class:"mb-0"},F={class:"card-title mb-0"},W={class:"card-footer d-flex gap-2 flex-column"},O={class:"row"},M={class:"col-6 col-md-3"},j={class:"text-primary-emphasis col-6 col-md-3"},z={class:"text-success-emphasis col-6 col-md-3"},E={class:"text-md-end col-6 col-md-3"},Y={class:"d-flex align-items-center gap-2"},q={class:"text-muted"},A={style:{"word-break":"keep-all"}},H={class:"mb-0 d-block d-lg-inline-block"},J={style:{"line-break":"anywhere"}},Q={class:"form-check form-switch ms-auto"},X=["for"],Z={key:4,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},$=["disabled","id"];function tt(s,o,e,v,k,p){const u=d("RouterLink"),n=d("LocaleText");return a(),l("div",K,[i(u,{to:"/configuration/"+e.c.Name+"/peers",class:"card-body d-flex align-items-center gap-3 flex-wrap text-decoration-none"},{default:m(()=>[t("h6",R,[t("span",{class:C(["dot",{active:e.c.Status}])},null,2)]),t("h6",F,[t("samp",null,r(e.c.Name),1)]),o[2]||(o[2]=t("h6",{class:"mb-0 ms-auto"},[t("i",{class:"bi bi-chevron-right"})],-1))]),_:1},8,["to"]),t("div",W,[t("div",O,[t("small",M,[o[3]||(o[3]=t("i",{class:"bi bi-arrow-down-up me-2"},null,-1)),f(r(e.c.DataUsage.Total>0?e.c.DataUsage.Total.toFixed(4):0)+" GB ",1)]),t("small",j,[o[4]||(o[4]=t("i",{class:"bi bi-arrow-down me-2"},null,-1)),f(r(e.c.DataUsage.Receive>0?e.c.DataUsage.Receive.toFixed(4):0)+" GB ",1)]),t("small",z,[o[5]||(o[5]=t("i",{class:"bi bi-arrow-up me-2"},null,-1)),f(r(e.c.DataUsage.Sent>0?e.c.DataUsage.Sent.toFixed(4):0)+" GB ",1)]),t("small",E,[t("span",{class:C(["dot me-2",{active:e.c.ConnectedPeers>0}])},null,2),f(" "+r(e.c.ConnectedPeers)+" / "+r(e.c.TotalPeers)+" ",1),i(n,{t:"Peers"})])]),t("div",Y,[t("small",q,[t("strong",A,[i(n,{t:"Public Key"})])]),t("small",H,[t("samp",J,r(e.c.PublicKey),1)]),t("div",Q,[t("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+e.c.PrivateKey},[!e.c.Status&&this.configurationToggling?(a(),c(n,{key:0,t:"Turning Off..."})):e.c.Status&&this.configurationToggling?(a(),c(n,{key:1,t:"Turning On..."})):e.c.Status&&!this.configurationToggling?(a(),c(n,{key:2,t:"On"})):!e.c.Status&&!this.configurationToggling?(a(),c(n,{key:3,t:"Off"})):h("",!0),this.configurationToggling?(a(),l("span",Z)):h("",!0)],8,X),P(t("input",{class:"form-check-input",style:{cursor:"pointer"},disabled:this.configurationToggling,type:"checkbox",role:"switch",id:"switch"+e.c.PrivateKey,onChange:o[0]||(o[0]=g=>this.toggle()),"onUpdate:modelValue":o[1]||(o[1]=g=>e.c.Status=g)},null,40,$),[[D,e.c.Status]])])])])])}const et=x(_,[["render",tt],["__scopeId","data-v-a85a04a5"]]),ot={name:"configurationList",components:{LocaleText:w,ConfigurationCard:et},async setup(){return{wireguardConfigurationsStore:U()}},data(){return{configurationLoaded:!1}},async mounted(){await this.wireguardConfigurationsStore.getConfigurations(),this.configurationLoaded=!0,this.wireguardConfigurationsStore.ConfigurationListInterval=setInterval(()=>{this.wireguardConfigurationsStore.getConfigurations()},1e4)},beforeUnmount(){clearInterval(this.wireguardConfigurationsStore.ConfigurationListInterval)}},st={class:"mt-md-5 mt-3"},at={class:"container-md"},nt={class:"d-flex mb-4 configurationListTitle align-items-center gap-3"},it={class:"text-body d-flex"},rt={class:"text-muted",key:"noConfiguration"};function ct(s,o,e,v,k,p){const u=d("LocaleText"),n=d("RouterLink"),g=d("ConfigurationCard");return a(),l("div",st,[t("div",at,[t("div",nt,[t("h2",it,[t("span",null,[i(u,{t:"WireGuard Configurations"})])]),i(n,{to:"/new_configuration",class:"btn btn-dark btn-brand rounded-3 p-2 shadow ms-auto rounded-3"},{default:m(()=>o[0]||(o[0]=[t("h2",{class:"mb-0",style:{"line-height":"0"}},[t("i",{class:"bi bi-plus-circle"})],-1)])),_:1}),i(n,{to:"/restore_configuration",class:"btn btn-dark btn-brand p-2 shadow ms-2",style:{"border-radius":"100%"}},{default:m(()=>o[1]||(o[1]=[t("h2",{class:"mb-0",style:{"line-height":"0"}},[t("i",{class:"bi bi-clock-history"})],-1)])),_:1})]),i(G,{name:"fade",tag:"div",class:"d-flex flex-column gap-3 mb-4"},{default:m(()=>[this.configurationLoaded&&this.wireguardConfigurationsStore.Configurations.length===0?(a(),l("p",rt,[i(u,{t:"You don't have any WireGuard configurations yet. Please check the configuration folder or change it in Settings. By default the folder is /etc/wireguard."})])):this.configurationLoaded?(a(!0),l(V,{key:1},I(this.wireguardConfigurationsStore.Configurations,(b,T)=>(a(),c(g,{delay:T*.05+"s",key:b.Name,c:b},null,8,["delay","c"]))),128)):h("",!0)]),_:1})])])}const ut=x(ot,[["render",ct],["__scopeId","data-v-16b5ab33"]]);export{ut as default}; +import{_ as x,D as L,g as N,a,c as l,d as i,w as m,b as t,n as C,t as r,f,i as c,e as h,m as P,v as D,u as B,j as d,W as U,k as G,F as V,h as I}from"./index-DOaPWS1X.js";import{L as w}from"./localeText-CaAXeE0W.js";const _={name:"configurationCard",components:{LocaleText:w},props:{c:{Name:String,Status:Boolean,PublicKey:String,PrivateKey:String},delay:String},data(){return{configurationToggling:!1}},setup(){return{dashboardConfigurationStore:L()}},methods:{toggle(){this.configurationToggling=!0,N("/api/toggleWireguardConfiguration/",{configurationName:this.c.Name},s=>{s.status?this.dashboardConfigurationStore.newMessage("Server",`${this.c.Name} ${s.data?"is on":"is off"}`):this.dashboardConfigurationStore.newMessage("Server",s.message,"danger"),this.c.Status=s.data,this.configurationToggling=!1})}}},y=()=>{B(s=>({"1d5189b2":s.delay}))},S=_.setup;_.setup=S?(s,o)=>(y(),S(s,o)):y;const K={class:"card conf_card rounded-3 shadow text-decoration-none"},R={class:"mb-0"},F={class:"card-title mb-0"},W={class:"card-footer d-flex gap-2 flex-column"},O={class:"row"},M={class:"col-6 col-md-3"},j={class:"text-primary-emphasis col-6 col-md-3"},z={class:"text-success-emphasis col-6 col-md-3"},E={class:"text-md-end col-6 col-md-3"},Y={class:"d-flex align-items-center gap-2"},q={class:"text-muted"},A={style:{"word-break":"keep-all"}},H={class:"mb-0 d-block d-lg-inline-block"},J={style:{"line-break":"anywhere"}},Q={class:"form-check form-switch ms-auto"},X=["for"],Z={key:4,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},$=["disabled","id"];function tt(s,o,e,v,k,p){const u=d("RouterLink"),n=d("LocaleText");return a(),l("div",K,[i(u,{to:"/configuration/"+e.c.Name+"/peers",class:"card-body d-flex align-items-center gap-3 flex-wrap text-decoration-none"},{default:m(()=>[t("h6",R,[t("span",{class:C(["dot",{active:e.c.Status}])},null,2)]),t("h6",F,[t("samp",null,r(e.c.Name),1)]),o[2]||(o[2]=t("h6",{class:"mb-0 ms-auto"},[t("i",{class:"bi bi-chevron-right"})],-1))]),_:1},8,["to"]),t("div",W,[t("div",O,[t("small",M,[o[3]||(o[3]=t("i",{class:"bi bi-arrow-down-up me-2"},null,-1)),f(r(e.c.DataUsage.Total>0?e.c.DataUsage.Total.toFixed(4):0)+" GB ",1)]),t("small",j,[o[4]||(o[4]=t("i",{class:"bi bi-arrow-down me-2"},null,-1)),f(r(e.c.DataUsage.Receive>0?e.c.DataUsage.Receive.toFixed(4):0)+" GB ",1)]),t("small",z,[o[5]||(o[5]=t("i",{class:"bi bi-arrow-up me-2"},null,-1)),f(r(e.c.DataUsage.Sent>0?e.c.DataUsage.Sent.toFixed(4):0)+" GB ",1)]),t("small",E,[t("span",{class:C(["dot me-2",{active:e.c.ConnectedPeers>0}])},null,2),f(" "+r(e.c.ConnectedPeers)+" / "+r(e.c.TotalPeers)+" ",1),i(n,{t:"Peers"})])]),t("div",Y,[t("small",q,[t("strong",A,[i(n,{t:"Public Key"})])]),t("small",H,[t("samp",J,r(e.c.PublicKey),1)]),t("div",Q,[t("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+e.c.PrivateKey},[!e.c.Status&&this.configurationToggling?(a(),c(n,{key:0,t:"Turning Off..."})):e.c.Status&&this.configurationToggling?(a(),c(n,{key:1,t:"Turning On..."})):e.c.Status&&!this.configurationToggling?(a(),c(n,{key:2,t:"On"})):!e.c.Status&&!this.configurationToggling?(a(),c(n,{key:3,t:"Off"})):h("",!0),this.configurationToggling?(a(),l("span",Z)):h("",!0)],8,X),P(t("input",{class:"form-check-input",style:{cursor:"pointer"},disabled:this.configurationToggling,type:"checkbox",role:"switch",id:"switch"+e.c.PrivateKey,onChange:o[0]||(o[0]=g=>this.toggle()),"onUpdate:modelValue":o[1]||(o[1]=g=>e.c.Status=g)},null,40,$),[[D,e.c.Status]])])])])])}const et=x(_,[["render",tt],["__scopeId","data-v-a85a04a5"]]),ot={name:"configurationList",components:{LocaleText:w,ConfigurationCard:et},async setup(){return{wireguardConfigurationsStore:U()}},data(){return{configurationLoaded:!1}},async mounted(){await this.wireguardConfigurationsStore.getConfigurations(),this.configurationLoaded=!0,this.wireguardConfigurationsStore.ConfigurationListInterval=setInterval(()=>{this.wireguardConfigurationsStore.getConfigurations()},1e4)},beforeUnmount(){clearInterval(this.wireguardConfigurationsStore.ConfigurationListInterval)}},st={class:"mt-md-5 mt-3"},at={class:"container-md"},nt={class:"d-flex mb-4 configurationListTitle align-items-center gap-3"},it={class:"text-body d-flex"},rt={class:"text-muted",key:"noConfiguration"};function ct(s,o,e,v,k,p){const u=d("LocaleText"),n=d("RouterLink"),g=d("ConfigurationCard");return a(),l("div",st,[t("div",at,[t("div",nt,[t("h2",it,[t("span",null,[i(u,{t:"WireGuard Configurations"})])]),i(n,{to:"/new_configuration",class:"btn btn-dark btn-brand rounded-3 p-2 shadow ms-auto rounded-3"},{default:m(()=>o[0]||(o[0]=[t("h2",{class:"mb-0",style:{"line-height":"0"}},[t("i",{class:"bi bi-plus-circle"})],-1)])),_:1}),i(n,{to:"/restore_configuration",class:"btn btn-dark btn-brand p-2 shadow ms-2",style:{"border-radius":"100%"}},{default:m(()=>o[1]||(o[1]=[t("h2",{class:"mb-0",style:{"line-height":"0"}},[t("i",{class:"bi bi-clock-history"})],-1)])),_:1})]),i(G,{name:"fade",tag:"div",class:"d-flex flex-column gap-3 mb-4"},{default:m(()=>[this.configurationLoaded&&this.wireguardConfigurationsStore.Configurations.length===0?(a(),l("p",rt,[i(u,{t:"You don't have any WireGuard configurations yet. Please check the configuration folder or change it in Settings. By default the folder is /etc/wireguard."})])):this.configurationLoaded?(a(!0),l(V,{key:1},I(this.wireguardConfigurationsStore.Configurations,(b,T)=>(a(),c(g,{delay:T*.05+"s",key:b.Name,c:b},null,8,["delay","c"]))),128)):h("",!0)]),_:1})])])}const ut=x(ot,[["render",ct],["__scopeId","data-v-16b5ab33"]]);export{ut as default}; diff --git a/src/static/app/dist/assets/dayjs.min-Lw24H7b2.js b/src/static/app/dist/assets/dayjs.min-D8jwq_wn.js similarity index 99% rename from src/static/app/dist/assets/dayjs.min-Lw24H7b2.js rename to src/static/app/dist/assets/dayjs.min-D8jwq_wn.js index 072939e..2ab4556 100644 --- a/src/static/app/dist/assets/dayjs.min-Lw24H7b2.js +++ b/src/static/app/dist/assets/dayjs.min-D8jwq_wn.js @@ -1 +1 @@ -import{Y as Q,Z as K}from"./index-BPNEscAR.js";var E={exports:{}};(function(V,X){(function(W,k){V.exports=k()})(Q,function(){var W=1e3,k=6e4,N=36e5,A="millisecond",S="second",w="minute",O="hour",M="day",T="week",m="month",U="quarter",v="year",_="date",Z="Invalid Date",q=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,B=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,G={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(s){var n=["th","st","nd","rd"],t=s%100;return"["+s+(n[(t-20)%10]||n[t]||n[0])+"]"}},I=function(s,n,t){var r=String(s);return!r||r.length>=n?s:""+Array(n+1-r.length).join(t)+s},P={s:I,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+I(r,2,"0")+":"+I(e,2,"0")},m:function s(n,t){if(n.date()1)return s(u[0])}else{var o=n.name;D[o]=n,e=o}return!r&&e&&(x=e),e||!r&&x},f=function(s,n){if(F(s))return s.clone();var t=typeof n=="object"?n:{};return t.date=s,t.args=arguments,new C(t)},a=P;a.l=j,a.i=F,a.w=function(s,n){return f(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var C=function(){function s(t){this.$L=j(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[J]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,i=r.utc;if(e===null)return new Date(NaN);if(a.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var u=e.match(q);if(u){var o=u[2]-1||0,c=(u[7]||"0").substring(0,3);return i?new Date(Date.UTC(u[1],o,u[3]||1,u[4]||0,u[5]||0,u[6]||0,c)):new Date(u[1],o,u[3]||1,u[4]||0,u[5]||0,u[6]||0,c)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return a},n.isValid=function(){return this.$d.toString()!==Z},n.isSame=function(t,r){var e=f(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return f(t)=n?s:""+Array(n+1-r.length).join(t)+s},P={s:I,z:function(s){var n=-s.utcOffset(),t=Math.abs(n),r=Math.floor(t/60),e=t%60;return(n<=0?"+":"-")+I(r,2,"0")+":"+I(e,2,"0")},m:function s(n,t){if(n.date()1)return s(u[0])}else{var o=n.name;D[o]=n,e=o}return!r&&e&&(x=e),e||!r&&x},f=function(s,n){if(F(s))return s.clone();var t=typeof n=="object"?n:{};return t.date=s,t.args=arguments,new C(t)},a=P;a.l=j,a.i=F,a.w=function(s,n){return f(s,{locale:n.$L,utc:n.$u,x:n.$x,$offset:n.$offset})};var C=function(){function s(t){this.$L=j(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[J]=!0}var n=s.prototype;return n.parse=function(t){this.$d=function(r){var e=r.date,i=r.utc;if(e===null)return new Date(NaN);if(a.u(e))return new Date;if(e instanceof Date)return new Date(e);if(typeof e=="string"&&!/Z$/i.test(e)){var u=e.match(q);if(u){var o=u[2]-1||0,c=(u[7]||"0").substring(0,3);return i?new Date(Date.UTC(u[1],o,u[3]||1,u[4]||0,u[5]||0,u[6]||0,c)):new Date(u[1],o,u[3]||1,u[4]||0,u[5]||0,u[6]||0,c)}}return new Date(e)}(t),this.init()},n.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},n.$utils=function(){return a},n.isValid=function(){return this.$d.toString()!==Z},n.isSame=function(t,r){var e=f(t);return this.startOf(r)<=e&&e<=this.endOf(r)},n.isAfter=function(t,r){return f(t){clearInterval(p.Peers.RefreshInterval),r.value=!0,M("/api/deleteWireguardConfiguration",{Name:i},n=>{n.status?(h.push("/"),p.newMessage("Server","Configuration deleted","success")):r.value=!1})},u=c(!0),d=c([]),f=()=>{u.value=!0,T("/api/getWireguardConfigurationBackup",{configurationName:i},n=>{d.value=n.data,u.value=!1})};_(()=>{f()});const C=k;return(n,e)=>(l(),b("div",I,[t("div",R,[t("div",S,[t("div",V,[t("div",A,[t("h5",L,[o(s,{t:"Are you sure to delete this configuration?"})]),t("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=a=>n.$emit("close"))})]),t("div",P,[t("p",W,[o(s,{t:"Once you deleted this configuration:"})]),t("ul",null,[t("li",null,[o(s,{t:"All connected peers will get disconnected"})]),t("li",null,[o(s,{t:"Both configuration file (.conf) and database table related to this configuration will get deleted"})])]),t("div",{class:D(["alert",[u.value?"alert-secondary":d.value.length>0?"alert-success":"alert-danger"]])},[u.value?(l(),b("div",q,[e[5]||(e[5]=t("i",{class:"bi bi-search me-2"},null,-1)),o(s,{t:"Checking backups..."})])):d.value.length>0?(l(),b("div",z,[e[6]||(e[6]=t("i",{class:"bi bi-check-circle-fill me-2"},null,-1)),o(s,{t:"This configuration have "+d.value.length+" backups"},null,8,["t"])])):(l(),b("div",E,[e[9]||(e[9]=t("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),o(s,{t:"This configuration have no backup"}),t("a",{role:"button",onClick:e[1]||(e[1]=a=>C("backup")),class:"ms-auto btn btn-sm btn-primary rounded-3"},[e[7]||(e[7]=t("i",{class:"bi bi-clock-history me-2"},null,-1)),o(s,{t:"Backup"})]),t("a",{role:"button",onClick:e[2]||(e[2]=a=>f()),class:"btn btn-sm btn-primary rounded-3"},e[8]||(e[8]=[t("i",{class:"bi bi-arrow-clockwise"},null,-1)]))]))],2),e[11]||(e[11]=t("hr",null,null,-1)),t("p",null,[o(s,{t:"If you're sure, please type in the configuration name below and click Delete"})]),$(t("input",{class:"form-control rounded-3 mb-3",placeholder:m(i),"onUpdate:modelValue":e[3]||(e[3]=a=>g.value=a),type:"text"},null,8,G),[[N,g.value]]),t("button",{class:"btn btn-danger w-100",onClick:e[4]||(e[4]=a=>y()),disabled:g.value!==m(i)||r.value},[e[10]||(e[10]=t("i",{class:"bi bi-trash-fill me-2 rounded-3"},null,-1)),r.value?(l(),v(s,{key:1,t:"Deleting..."})):(l(),v(s,{key:0,t:"Delete"}))],8,H)])])])])]))}};export{J as default}; +import{$ as w,r as c,H as x,D as B,o as _,a as l,c as b,b as t,d as o,n as D,m as $,s as N,B as m,i as v,q as M,g as T}from"./index-DOaPWS1X.js";import{L as s}from"./localeText-CaAXeE0W.js";const I={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},R={class:"container d-flex h-100 w-100"},S={class:"m-auto modal-dialog-centered dashboardModal",style:{width:"700px"}},V={class:"card rounded-3 shadow flex-grow-1 bg-danger-subtle border-danger-subtle",id:"deleteConfigurationContainer"},A={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},L={class:"mb-0"},P={class:"card-body px-4 text-muted"},W={class:"mb-0"},q={key:0},z={key:1},E={key:2,class:"d-flex align-items-center gap-2"},G=["placeholder"],H=["disabled"],J={__name:"deleteConfiguration",emits:["backup"],setup(O,{emit:k}){const i=w().params.id,g=c(""),h=x(),p=B(),r=c(!1),y=()=>{clearInterval(p.Peers.RefreshInterval),r.value=!0,M("/api/deleteWireguardConfiguration",{Name:i},n=>{n.status?(h.push("/"),p.newMessage("Server","Configuration deleted","success")):r.value=!1})},u=c(!0),d=c([]),f=()=>{u.value=!0,T("/api/getWireguardConfigurationBackup",{configurationName:i},n=>{d.value=n.data,u.value=!1})};_(()=>{f()});const C=k;return(n,e)=>(l(),b("div",I,[t("div",R,[t("div",S,[t("div",V,[t("div",A,[t("h5",L,[o(s,{t:"Are you sure to delete this configuration?"})]),t("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=a=>n.$emit("close"))})]),t("div",P,[t("p",W,[o(s,{t:"Once you deleted this configuration:"})]),t("ul",null,[t("li",null,[o(s,{t:"All connected peers will get disconnected"})]),t("li",null,[o(s,{t:"Both configuration file (.conf) and database table related to this configuration will get deleted"})])]),t("div",{class:D(["alert",[u.value?"alert-secondary":d.value.length>0?"alert-success":"alert-danger"]])},[u.value?(l(),b("div",q,[e[5]||(e[5]=t("i",{class:"bi bi-search me-2"},null,-1)),o(s,{t:"Checking backups..."})])):d.value.length>0?(l(),b("div",z,[e[6]||(e[6]=t("i",{class:"bi bi-check-circle-fill me-2"},null,-1)),o(s,{t:"This configuration have "+d.value.length+" backups"},null,8,["t"])])):(l(),b("div",E,[e[9]||(e[9]=t("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),o(s,{t:"This configuration have no backup"}),t("a",{role:"button",onClick:e[1]||(e[1]=a=>C("backup")),class:"ms-auto btn btn-sm btn-primary rounded-3"},[e[7]||(e[7]=t("i",{class:"bi bi-clock-history me-2"},null,-1)),o(s,{t:"Backup"})]),t("a",{role:"button",onClick:e[2]||(e[2]=a=>f()),class:"btn btn-sm btn-primary rounded-3"},e[8]||(e[8]=[t("i",{class:"bi bi-arrow-clockwise"},null,-1)]))]))],2),e[11]||(e[11]=t("hr",null,null,-1)),t("p",null,[o(s,{t:"If you're sure, please type in the configuration name below and click Delete"})]),$(t("input",{class:"form-control rounded-3 mb-3",placeholder:m(i),"onUpdate:modelValue":e[3]||(e[3]=a=>g.value=a),type:"text"},null,8,G),[[N,g.value]]),t("button",{class:"btn btn-danger w-100",onClick:e[4]||(e[4]=a=>y()),disabled:g.value!==m(i)||r.value},[e[10]||(e[10]=t("i",{class:"bi bi-trash-fill me-2 rounded-3"},null,-1)),r.value?(l(),v(s,{key:1,t:"Deleting..."})):(l(),v(s,{key:0,t:"Delete"}))],8,H)])])])])]))}};export{J as default}; diff --git a/src/static/app/dist/assets/editConfiguration-hI0uF3Oq.js b/src/static/app/dist/assets/editConfiguration-kC_NwN06.js similarity index 98% rename from src/static/app/dist/assets/editConfiguration-hI0uF3Oq.js rename to src/static/app/dist/assets/editConfiguration-kC_NwN06.js index ed95ce7..d7a61ce 100644 --- a/src/static/app/dist/assets/editConfiguration-hI0uF3Oq.js +++ b/src/static/app/dist/assets/editConfiguration-kC_NwN06.js @@ -1 +1 @@ -import{_ as M,C as k,W as K,o as O,E as $,D as U,r as b,H as L,a as y,c as x,b as e,d as a,m as u,s as c,n as N,q as D,a0 as J,t as S,e as W,i as A,F,v as B}from"./index-BPNEscAR.js";import{L as n}from"./localeText-DX813vQA.js";const R={class:"card rounded-3 flex-grow-1 bg-danger-subtle border-danger-subtle border shadow"},T={class:"card-body"},q={class:"d-flex align-items-center gap-3 inputGroup"},E=["value"],G={class:"mb-0"},j={class:"d-flex mt-3"},z=["disabled"],H={__name:"updateConfigurationName",props:{configurationName:String},emits:["close"],setup(h,{emit:C}){const p=h,P=C,l=k({data:"",valid:!1}),i=K();O(()=>{$(()=>l.data,d=>{l.valid=/^[a-zA-Z0-9_=+.-]{1,15}$/.test(d)&&d.length>0&&!i.Configurations.find(r=>r.Name===d)})});const s=U(),m=b(!1),f=L(),g=async()=>{l.data&&(m.value=!0,clearInterval(s.Peers.RefreshInterval),await D("/api/renameWireguardConfiguration",{Name:p.configurationName,NewConfigurationName:l.data},async d=>{d.status?(await i.getConfigurations(),s.newMessage("Server","Configuration renamed","success"),f.push(`/configuration/${l.data}/peers`)):(s.newMessage("Server",d.message,"danger"),m.value=!1)}))};return(d,r)=>(y(),x("div",R,[e("div",T,[e("p",null,[a(n,{t:"To update this configuration's name, WGDashboard will execute the following operations:"})]),e("ol",null,[e("li",null,[a(n,{t:"Duplicate current configuration's database table and .conf file with the new name"})]),e("li",null,[a(n,{t:"Delete current configuration's database table and .conf file"})])]),e("div",q,[e("input",{class:"form-control form-control-sm rounded-3",value:h.configurationName,disabled:""},null,8,E),r[3]||(r[3]=e("h3",{class:"mb-0"},[e("i",{class:"bi bi-arrow-right"})],-1)),u(e("input",{class:N(["form-control form-control-sm rounded-3",[l.data?l.valid?"is-valid":"is-invalid":""]]),id:"newConfigurationName","onUpdate:modelValue":r[0]||(r[0]=v=>l.data=v)},null,2),[[c,l.data]])]),e("div",{class:N(["invalid-feedback",{"d-block":!l.valid&&l.data}])},[a(n,{t:"Configuration name is invalid. Possible reasons:"}),e("ul",G,[e("li",null,[a(n,{t:"Configuration name already exist."})]),e("li",null,[a(n,{t:"Configuration name can only contain 15 lower/uppercase alphabet, numbers, underscore, equal sign, plus sign, period and hyphen."})])])],2),e("div",j,[e("button",{onClick:r[1]||(r[1]=v=>P("close")),class:"btn btn-sm bg-secondary-subtle border-secondary-subtle text-secondary-emphasis rounded-3"},[a(n,{t:"Cancel"})]),e("button",{onClick:r[2]||(r[2]=v=>g()),disabled:!l.data||m.value,class:"btn btn-sm btn-danger rounded-3 ms-auto"},[a(n,{t:"Save"})],8,z)])])]))}},Z=M(H,[["__scopeId","data-v-4be4f48a"]]),Q={class:"container d-flex h-100 w-100"},X={class:"m-auto modal-dialog-centered dashboardModal",style:{width:"700px"}},Y={class:"card rounded-3 shadow flex-grow-1"},ee={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4"},te={class:"mb-0"},se={class:"card-body px-4 pb-4"},oe={class:"d-flex gap-2 flex-column"},ae={key:0,class:"d-flex align-items-center gap-3"},ne={class:"text-muted"},le={class:"d-flex align-items-center gap-3"},ie={class:"text-muted",style:{"word-break":"keep-all"}},re={class:"ms-auto",style:{"word-break":"break-all"}},de={class:"d-flex"},ue={for:"configuration_private_key",class:"form-label"},ce={class:"text-muted d-block"},me={class:"form-check form-switch ms-auto"},fe=["disabled"],be={for:"configuration_ipaddress_cidr",class:"form-label"},pe={class:"text-muted"},ge=["disabled"],ve={for:"configuration_listen_port",class:"form-label"},_e={class:"text-muted"},ye=["disabled"],he={for:"configuration_preup",class:"form-label"},we={class:"text-muted"},xe=["disabled"],Ce={for:"configuration_predown",class:"form-label"},Pe={class:"text-muted"},ke=["disabled"],Ne={for:"configuration_postup",class:"form-label"},Se={class:"text-muted"},Ke=["disabled"],$e={for:"configuration_postdown",class:"form-label"},Ue={class:"text-muted"},De=["disabled"],Ie={class:"d-flex align-items-center gap-2 mt-4"},Ve=["disabled"],Me=["disabled"],Je={__name:"editConfiguration",props:{configurationInfo:Object},emits:["changed","close"],setup(h,{emit:C}){const p=h,P=K(),l=U(),i=b(!1),s=k(JSON.parse(JSON.stringify(p.configurationInfo))),m=b(!1),f=b(!1);b(!1);const g=k({PrivateKey:!0,IPAddress:!0,ListenPort:!0}),d=J("editConfigurationContainer"),r=()=>{P.checkWGKeyLength(s.PrivateKey)?(g.PrivateKey=!0,s.PublicKey=window.wireguard.generatePublicKey(s.PrivateKey)):g.PrivateKey=!1},v=()=>{f.value=!1,Object.assign(s,JSON.parse(JSON.stringify(p.configurationInfo)))},I=C,V=()=>{i.value=!0,D("/api/updateWireguardConfiguration",s,_=>{i.value=!1,_.status?(l.newMessage("Server","Configuration saved","success"),f.value=!1,I("dataChanged",_.data)):l.newMessage("Server",_.message,"danger")})},w=b(!1);return $(s,()=>{f.value=JSON.stringify(s)!==JSON.stringify(p.configurationInfo)},{deep:!0}),(_,t)=>(y(),x("div",{class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll",ref_key:"editConfigurationContainer",ref:d},[e("div",Q,[e("div",X,[e("div",Y,[e("div",ee,[e("h4",te,[a(n,{t:"Configuration Settings"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=o=>_.$emit("close"))})]),e("div",se,[e("div",oe,[w.value?W("",!0):(y(),x("div",ae,[e("small",ne,[a(n,{t:"Name"})]),e("small",null,S(s.Name),1),e("button",{onClick:t[1]||(t[1]=o=>w.value=!0),class:"btn btn-sm bg-danger-subtle border-danger-subtle text-danger-emphasis rounded-3 ms-auto"}," Update Name ")])),w.value?(y(),A(Z,{key:1,onClose:t[2]||(t[2]=o=>w.value=!1),"configuration-name":s.Name},null,8,["configuration-name"])):(y(),x(F,{key:2},[t[17]||(t[17]=e("hr",null,null,-1)),e("div",le,[e("small",ie,[a(n,{t:"Public Key"})]),e("small",re,S(s.PublicKey),1)]),t[18]||(t[18]=e("hr",null,null,-1)),e("div",null,[e("div",de,[e("label",ue,[e("small",ce,[a(n,{t:"Private Key"})])]),e("div",me,[u(e("input",{class:"form-check-input",type:"checkbox",role:"switch",id:"editPrivateKeySwitch","onUpdate:modelValue":t[3]||(t[3]=o=>m.value=o)},null,512),[[B,m.value]]),t[14]||(t[14]=e("label",{class:"form-check-label",for:"editPrivateKeySwitch"},[e("small",null,"Edit")],-1))])]),u(e("input",{type:"text",class:N(["form-control form-control-sm rounded-3",{"is-invalid":!g.PrivateKey}]),disabled:i.value||!m.value,onKeyup:t[4]||(t[4]=o=>r()),"onUpdate:modelValue":t[5]||(t[5]=o=>s.PrivateKey=o),id:"configuration_private_key"},null,42,fe),[[c,s.PrivateKey]])]),e("div",null,[e("label",be,[e("small",pe,[a(n,{t:"IP Address/CIDR"})])]),u(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:i.value,"onUpdate:modelValue":t[6]||(t[6]=o=>s.Address=o),id:"configuration_ipaddress_cidr"},null,8,ge),[[c,s.Address]])]),e("div",null,[e("label",ve,[e("small",_e,[a(n,{t:"Listen Port"})])]),u(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:i.value,"onUpdate:modelValue":t[7]||(t[7]=o=>s.ListenPort=o),id:"configuration_listen_port"},null,8,ye),[[c,s.ListenPort]])]),e("div",null,[e("label",he,[e("small",we,[a(n,{t:"PreUp"})])]),u(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:i.value,"onUpdate:modelValue":t[8]||(t[8]=o=>s.PreUp=o),id:"configuration_preup"},null,8,xe),[[c,s.PreUp]])]),e("div",null,[e("label",Ce,[e("small",Pe,[a(n,{t:"PreDown"})])]),u(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:i.value,"onUpdate:modelValue":t[9]||(t[9]=o=>s.PreDown=o),id:"configuration_predown"},null,8,ke),[[c,s.PreDown]])]),e("div",null,[e("label",Ne,[e("small",Se,[a(n,{t:"PostUp"})])]),u(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:i.value,"onUpdate:modelValue":t[10]||(t[10]=o=>s.PostUp=o),id:"configuration_postup"},null,8,Ke),[[c,s.PostUp]])]),e("div",null,[e("label",$e,[e("small",Ue,[a(n,{t:"PostDown"})])]),u(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:i.value,"onUpdate:modelValue":t[11]||(t[11]=o=>s.PostDown=o),id:"configuration_postdown"},null,8,De),[[c,s.PostDown]])]),e("div",Ie,[e("button",{class:"btn bg-secondary-subtle border-secondary-subtle text-secondary-emphasis rounded-3 shadow ms-auto",onClick:t[12]||(t[12]=o=>v()),disabled:!f.value||i.value},t[15]||(t[15]=[e("i",{class:"bi bi-arrow-clockwise"},null,-1)]),8,Ve),e("button",{class:"btn bg-primary-subtle border-primary-subtle text-primary-emphasis rounded-3 shadow",disabled:!f.value||i.value,onClick:t[13]||(t[13]=o=>V())},t[16]||(t[16]=[e("i",{class:"bi bi-save-fill"},null,-1)]),8,Me)])],64))])])])])])],512))}};export{Je as default}; +import{_ as M,C as k,W as K,o as O,E as $,D as U,r as b,H as L,a as y,c as x,b as e,d as a,m as u,s as c,n as N,q as D,a0 as J,t as S,e as W,i as A,F,v as B}from"./index-DOaPWS1X.js";import{L as n}from"./localeText-CaAXeE0W.js";const R={class:"card rounded-3 flex-grow-1 bg-danger-subtle border-danger-subtle border shadow"},T={class:"card-body"},q={class:"d-flex align-items-center gap-3 inputGroup"},E=["value"],G={class:"mb-0"},j={class:"d-flex mt-3"},z=["disabled"],H={__name:"updateConfigurationName",props:{configurationName:String},emits:["close"],setup(h,{emit:C}){const p=h,P=C,l=k({data:"",valid:!1}),i=K();O(()=>{$(()=>l.data,d=>{l.valid=/^[a-zA-Z0-9_=+.-]{1,15}$/.test(d)&&d.length>0&&!i.Configurations.find(r=>r.Name===d)})});const s=U(),m=b(!1),f=L(),g=async()=>{l.data&&(m.value=!0,clearInterval(s.Peers.RefreshInterval),await D("/api/renameWireguardConfiguration",{Name:p.configurationName,NewConfigurationName:l.data},async d=>{d.status?(await i.getConfigurations(),s.newMessage("Server","Configuration renamed","success"),f.push(`/configuration/${l.data}/peers`)):(s.newMessage("Server",d.message,"danger"),m.value=!1)}))};return(d,r)=>(y(),x("div",R,[e("div",T,[e("p",null,[a(n,{t:"To update this configuration's name, WGDashboard will execute the following operations:"})]),e("ol",null,[e("li",null,[a(n,{t:"Duplicate current configuration's database table and .conf file with the new name"})]),e("li",null,[a(n,{t:"Delete current configuration's database table and .conf file"})])]),e("div",q,[e("input",{class:"form-control form-control-sm rounded-3",value:h.configurationName,disabled:""},null,8,E),r[3]||(r[3]=e("h3",{class:"mb-0"},[e("i",{class:"bi bi-arrow-right"})],-1)),u(e("input",{class:N(["form-control form-control-sm rounded-3",[l.data?l.valid?"is-valid":"is-invalid":""]]),id:"newConfigurationName","onUpdate:modelValue":r[0]||(r[0]=v=>l.data=v)},null,2),[[c,l.data]])]),e("div",{class:N(["invalid-feedback",{"d-block":!l.valid&&l.data}])},[a(n,{t:"Configuration name is invalid. Possible reasons:"}),e("ul",G,[e("li",null,[a(n,{t:"Configuration name already exist."})]),e("li",null,[a(n,{t:"Configuration name can only contain 15 lower/uppercase alphabet, numbers, underscore, equal sign, plus sign, period and hyphen."})])])],2),e("div",j,[e("button",{onClick:r[1]||(r[1]=v=>P("close")),class:"btn btn-sm bg-secondary-subtle border-secondary-subtle text-secondary-emphasis rounded-3"},[a(n,{t:"Cancel"})]),e("button",{onClick:r[2]||(r[2]=v=>g()),disabled:!l.data||m.value,class:"btn btn-sm btn-danger rounded-3 ms-auto"},[a(n,{t:"Save"})],8,z)])])]))}},Z=M(H,[["__scopeId","data-v-4be4f48a"]]),Q={class:"container d-flex h-100 w-100"},X={class:"m-auto modal-dialog-centered dashboardModal",style:{width:"700px"}},Y={class:"card rounded-3 shadow flex-grow-1"},ee={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4"},te={class:"mb-0"},se={class:"card-body px-4 pb-4"},oe={class:"d-flex gap-2 flex-column"},ae={key:0,class:"d-flex align-items-center gap-3"},ne={class:"text-muted"},le={class:"d-flex align-items-center gap-3"},ie={class:"text-muted",style:{"word-break":"keep-all"}},re={class:"ms-auto",style:{"word-break":"break-all"}},de={class:"d-flex"},ue={for:"configuration_private_key",class:"form-label"},ce={class:"text-muted d-block"},me={class:"form-check form-switch ms-auto"},fe=["disabled"],be={for:"configuration_ipaddress_cidr",class:"form-label"},pe={class:"text-muted"},ge=["disabled"],ve={for:"configuration_listen_port",class:"form-label"},_e={class:"text-muted"},ye=["disabled"],he={for:"configuration_preup",class:"form-label"},we={class:"text-muted"},xe=["disabled"],Ce={for:"configuration_predown",class:"form-label"},Pe={class:"text-muted"},ke=["disabled"],Ne={for:"configuration_postup",class:"form-label"},Se={class:"text-muted"},Ke=["disabled"],$e={for:"configuration_postdown",class:"form-label"},Ue={class:"text-muted"},De=["disabled"],Ie={class:"d-flex align-items-center gap-2 mt-4"},Ve=["disabled"],Me=["disabled"],Je={__name:"editConfiguration",props:{configurationInfo:Object},emits:["changed","close"],setup(h,{emit:C}){const p=h,P=K(),l=U(),i=b(!1),s=k(JSON.parse(JSON.stringify(p.configurationInfo))),m=b(!1),f=b(!1);b(!1);const g=k({PrivateKey:!0,IPAddress:!0,ListenPort:!0}),d=J("editConfigurationContainer"),r=()=>{P.checkWGKeyLength(s.PrivateKey)?(g.PrivateKey=!0,s.PublicKey=window.wireguard.generatePublicKey(s.PrivateKey)):g.PrivateKey=!1},v=()=>{f.value=!1,Object.assign(s,JSON.parse(JSON.stringify(p.configurationInfo)))},I=C,V=()=>{i.value=!0,D("/api/updateWireguardConfiguration",s,_=>{i.value=!1,_.status?(l.newMessage("Server","Configuration saved","success"),f.value=!1,I("dataChanged",_.data)):l.newMessage("Server",_.message,"danger")})},w=b(!1);return $(s,()=>{f.value=JSON.stringify(s)!==JSON.stringify(p.configurationInfo)},{deep:!0}),(_,t)=>(y(),x("div",{class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll",ref_key:"editConfigurationContainer",ref:d},[e("div",Q,[e("div",X,[e("div",Y,[e("div",ee,[e("h4",te,[a(n,{t:"Configuration Settings"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=o=>_.$emit("close"))})]),e("div",se,[e("div",oe,[w.value?W("",!0):(y(),x("div",ae,[e("small",ne,[a(n,{t:"Name"})]),e("small",null,S(s.Name),1),e("button",{onClick:t[1]||(t[1]=o=>w.value=!0),class:"btn btn-sm bg-danger-subtle border-danger-subtle text-danger-emphasis rounded-3 ms-auto"}," Update Name ")])),w.value?(y(),A(Z,{key:1,onClose:t[2]||(t[2]=o=>w.value=!1),"configuration-name":s.Name},null,8,["configuration-name"])):(y(),x(F,{key:2},[t[17]||(t[17]=e("hr",null,null,-1)),e("div",le,[e("small",ie,[a(n,{t:"Public Key"})]),e("small",re,S(s.PublicKey),1)]),t[18]||(t[18]=e("hr",null,null,-1)),e("div",null,[e("div",de,[e("label",ue,[e("small",ce,[a(n,{t:"Private Key"})])]),e("div",me,[u(e("input",{class:"form-check-input",type:"checkbox",role:"switch",id:"editPrivateKeySwitch","onUpdate:modelValue":t[3]||(t[3]=o=>m.value=o)},null,512),[[B,m.value]]),t[14]||(t[14]=e("label",{class:"form-check-label",for:"editPrivateKeySwitch"},[e("small",null,"Edit")],-1))])]),u(e("input",{type:"text",class:N(["form-control form-control-sm rounded-3",{"is-invalid":!g.PrivateKey}]),disabled:i.value||!m.value,onKeyup:t[4]||(t[4]=o=>r()),"onUpdate:modelValue":t[5]||(t[5]=o=>s.PrivateKey=o),id:"configuration_private_key"},null,42,fe),[[c,s.PrivateKey]])]),e("div",null,[e("label",be,[e("small",pe,[a(n,{t:"IP Address/CIDR"})])]),u(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:i.value,"onUpdate:modelValue":t[6]||(t[6]=o=>s.Address=o),id:"configuration_ipaddress_cidr"},null,8,ge),[[c,s.Address]])]),e("div",null,[e("label",ve,[e("small",_e,[a(n,{t:"Listen Port"})])]),u(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:i.value,"onUpdate:modelValue":t[7]||(t[7]=o=>s.ListenPort=o),id:"configuration_listen_port"},null,8,ye),[[c,s.ListenPort]])]),e("div",null,[e("label",he,[e("small",we,[a(n,{t:"PreUp"})])]),u(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:i.value,"onUpdate:modelValue":t[8]||(t[8]=o=>s.PreUp=o),id:"configuration_preup"},null,8,xe),[[c,s.PreUp]])]),e("div",null,[e("label",Ce,[e("small",Pe,[a(n,{t:"PreDown"})])]),u(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:i.value,"onUpdate:modelValue":t[9]||(t[9]=o=>s.PreDown=o),id:"configuration_predown"},null,8,ke),[[c,s.PreDown]])]),e("div",null,[e("label",Ne,[e("small",Se,[a(n,{t:"PostUp"})])]),u(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:i.value,"onUpdate:modelValue":t[10]||(t[10]=o=>s.PostUp=o),id:"configuration_postup"},null,8,Ke),[[c,s.PostUp]])]),e("div",null,[e("label",$e,[e("small",Ue,[a(n,{t:"PostDown"})])]),u(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:i.value,"onUpdate:modelValue":t[11]||(t[11]=o=>s.PostDown=o),id:"configuration_postdown"},null,8,De),[[c,s.PostDown]])]),e("div",Ie,[e("button",{class:"btn bg-secondary-subtle border-secondary-subtle text-secondary-emphasis rounded-3 shadow ms-auto",onClick:t[12]||(t[12]=o=>v()),disabled:!f.value||i.value},t[15]||(t[15]=[e("i",{class:"bi bi-arrow-clockwise"},null,-1)]),8,Ve),e("button",{class:"btn bg-primary-subtle border-primary-subtle text-primary-emphasis rounded-3 shadow",disabled:!f.value||i.value,onClick:t[13]||(t[13]=o=>V())},t[16]||(t[16]=[e("i",{class:"bi bi-save-fill"},null,-1)]),8,Me)])],64))])])])])])],512))}};export{Je as default}; diff --git a/src/static/app/dist/assets/index-C8JLgmcN.js b/src/static/app/dist/assets/index-C0bjwRB-.js similarity index 97% rename from src/static/app/dist/assets/index-C8JLgmcN.js rename to src/static/app/dist/assets/index-C0bjwRB-.js index 987010c..d3b0ab4 100644 --- a/src/static/app/dist/assets/index-C8JLgmcN.js +++ b/src/static/app/dist/assets/index-C0bjwRB-.js @@ -1 +1 @@ -import{r as C,o as D,a as o,c as l,b as e,d as s,e as g,f as m,t as v,_ as k,W as L,D as $,g as H,G as N,w as c,F as y,h as w,n as S,i as _,T as M,j as b,k as A,l as G,S as T}from"./index-BPNEscAR.js";import{L as h}from"./localeText-DX813vQA.js";import{M as V}from"./message-Cw7_G39b.js";import"./dayjs.min-Lw24H7b2.js";const U={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},W={class:"container d-flex h-100 w-100"},B={class:"m-auto modal-dialog-centered dashboardModal"},O={class:"card rounded-3 shadow flex-grow-1"},R={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},z={class:"mb-0"},F={class:"card-body px-4 pb-4 d-flex flex-column gap-2"},j={class:"card text-decoration-none",target:"_blank",role:"button",href:"https://discord.com/invite/ZkJSPAaQ"},q={class:"card-body d-flex gap-4 align-items-center"},I={class:"d-flex align-items-center"},J={class:"badge rounded-pill text-bg-primary ms-2"},P={key:0,class:"spinner-border spinner-border-sm",style:{width:"0.7rem",height:"0.7rem"}},E={key:1},Q={class:"text-muted"},Z={class:"card text-decoration-none",href:"https://donaldzou.github.io/WGDashboard-Documentation/",target:"_blank"},K={class:"card-body d-flex gap-4 align-items-center"},X={class:"mb-0"},Y={class:"text-muted"},ee={__name:"helpModal",setup(n){const t=C(!0),f=C(void 0);return D(()=>{t.value=!0,fetch("https://discord.com/api/guilds/1276818723637956628/widget.json").then(d=>d.json()).then(d=>{f.value=d,t.value=!1}).catch(()=>{t.value=!1})}),(d,a)=>(o(),l("div",U,[e("div",W,[e("div",B,[e("div",O,[e("div",R,[e("h4",z,[s(h,{t:"Help"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:a[0]||(a[0]=p=>d.$emit("close"))})]),e("div",F,[e("a",j,[e("div",q,[a[3]||(a[3]=e("h1",{class:"mb-0"},[e("i",{class:"bi bi-discord"})],-1)),e("div",null,[e("div",I,[a[2]||(a[2]=e("h5",{class:"mb-0"}," Discord Server ",-1)),e("span",J,[t.value?(o(),l("span",P)):g("",!0),f.value!==void 0&&!t.value?(o(),l("span",E,[a[1]||(a[1]=e("i",{class:"bi bi-person-fill me-2"},null,-1)),m(v(f.value.presence_count)+" Online ",1)])):g("",!0)])]),e("small",Q,[s(h,{t:"Join our Discord server for quick help or chat about WGDashboard!"})])])])]),e("a",Z,[e("div",K,[a[4]||(a[4]=e("h1",{class:"mb-0"},[e("i",{class:"bi bi-hash"})],-1)),e("div",null,[e("h5",X,[s(h,{t:"Official Documentation"})]),e("small",Y,[s(h,{t:"Official documentation contains User Guides and more..."})])])])])])])])])]))}},te={name:"navbar",components:{HelpModal:ee,LocaleText:h},setup(){const n=L(),t=$();return{wireguardConfigurationsStore:n,dashboardConfigurationStore:t}},data(){return{updateAvailable:!1,updateMessage:"Checking for update...",updateUrl:"",openHelpModal:!1}},computed:{getActiveCrossServer(){if(this.dashboardConfigurationStore.ActiveServerConfiguration)return new URL(this.dashboardConfigurationStore.CrossServerConfiguration.ServerList[this.dashboardConfigurationStore.ActiveServerConfiguration].host)}},mounted(){H("/api/getDashboardUpdate",{},n=>{n.status?(n.data&&(this.updateAvailable=!0,this.updateUrl=n.data),this.updateMessage=n.message):(this.updateMessage=N("Failed to check available update"),console.log(`Failed to get update: ${n.message}`))})}},se=["data-bs-theme"],oe={id:"sidebarMenu",class:"bg-body-tertiary sidebar border h-100 rounded-3 shadow overflow-y-scroll"},ae={class:"sidebar-sticky"},ne={class:"text-white text-center m-0 py-3 mb-3 btn-brand"},ie={key:0,class:"ms-auto"},re={class:"nav flex-column px-2"},le={class:"nav-item"},de={class:"nav-item"},ce={class:"nav-item"},ue={class:"sidebar-heading px-3 mt-4 mb-1 text-muted text-center"},me={class:"nav flex-column px-2"},be={class:"nav-item"},fe={class:"sidebar-heading px-3 mt-4 mb-1 text-muted text-center"},pe={class:"nav flex-column px-2"},ve={class:"nav-item"},he={class:"nav-item"},_e={class:"nav flex-column px-2 mb-3"},ge={class:"nav-item"},xe={class:"nav-item",style:{"font-size":"0.8rem"}},Ce=["href"],Se={class:"nav-link text-muted rounded-3"},ke={key:1,class:"nav-link text-muted rounded-3"};function $e(n,t,f,d,a,p){const i=b("LocaleText"),u=b("RouterLink"),x=b("HelpModal");return o(),l("div",{class:S(["col-md-3 col-lg-2 d-md-block p-2 navbar-container",{active:this.dashboardConfigurationStore.ShowNavBar}]),"data-bs-theme":d.dashboardConfigurationStore.Configuration.Server.dashboard_theme},[e("nav",oe,[e("div",ae,[e("div",ne,[t[4]||(t[4]=e("h5",{class:"mb-0"}," WGDashboard ",-1)),p.getActiveCrossServer!==void 0?(o(),l("small",ie,[t[3]||(t[3]=e("i",{class:"bi bi-hdd-rack-fill me-2"},null,-1)),m(v(p.getActiveCrossServer.host),1)])):g("",!0)]),e("ul",re,[e("li",le,[s(u,{class:"nav-link rounded-3",to:"/","exact-active-class":"active"},{default:c(()=>[t[5]||(t[5]=e("i",{class:"bi bi-house me-2"},null,-1)),s(i,{t:"Home"})]),_:1})]),e("li",de,[s(u,{class:"nav-link rounded-3",to:"/settings","exact-active-class":"active"},{default:c(()=>[t[6]||(t[6]=e("i",{class:"bi bi-gear me-2"},null,-1)),s(i,{t:"Settings"})]),_:1})]),e("li",ce,[e("a",{class:"nav-link rounded-3",role:"button",onClick:t[0]||(t[0]=r=>a.openHelpModal=!0)},[t[7]||(t[7]=e("i",{class:"bi bi-question-circle me-2"},null,-1)),s(i,{t:"Help"})])])]),t[12]||(t[12]=e("hr",{class:"text-body"},null,-1)),e("h6",ue,[t[8]||(t[8]=e("i",{class:"bi bi-body-text me-2"},null,-1)),s(i,{t:"WireGuard Configurations"})]),e("ul",me,[(o(!0),l(y,null,w(this.wireguardConfigurationsStore.Configurations,r=>(o(),l("li",be,[s(u,{to:"/configuration/"+r.Name+"/peers",class:"nav-link nav-conf-link rounded-3","active-class":"active"},{default:c(()=>[e("span",{class:S(["dot me-2",{active:r.Status}])},null,2),m(" "+v(r.Name),1)]),_:2},1032,["to"])]))),256))]),t[13]||(t[13]=e("hr",{class:"text-body"},null,-1)),e("h6",fe,[t[9]||(t[9]=e("i",{class:"bi bi-tools me-2"},null,-1)),s(i,{t:"Tools"})]),e("ul",pe,[e("li",ve,[s(u,{to:"/ping",class:"nav-link rounded-3","active-class":"active"},{default:c(()=>[s(i,{t:"Ping"})]),_:1})]),e("li",he,[s(u,{to:"/traceroute",class:"nav-link rounded-3","active-class":"active"},{default:c(()=>[s(i,{t:"Traceroute"})]),_:1})])]),t[14]||(t[14]=e("hr",{class:"text-body"},null,-1)),e("ul",_e,[e("li",ge,[e("a",{class:"nav-link text-danger rounded-3",onClick:t[1]||(t[1]=r=>this.dashboardConfigurationStore.signOut()),role:"button",style:{"font-weight":"bold"}},[t[10]||(t[10]=e("i",{class:"bi bi-box-arrow-left me-2"},null,-1)),s(i,{t:"Sign Out"})])]),e("li",xe,[this.updateAvailable?(o(),l("a",{key:0,href:this.updateUrl,class:"text-decoration-none rounded-3",target:"_blank"},[e("small",Se,[s(i,{t:this.updateMessage},null,8,["t"]),t[11]||(t[11]=m(" (")),s(i,{t:"Current Version:"}),m(" "+v(d.dashboardConfigurationStore.Configuration.Server.version)+") ",1)])],8,Ce)):(o(),l("small",ke,[s(i,{t:this.updateMessage},null,8,["t"]),m(" ("+v(d.dashboardConfigurationStore.Configuration.Server.version)+") ",1)]))])])])]),s(M,{name:"zoom"},{default:c(()=>[this.openHelpModal?(o(),_(x,{key:0,onClose:t[2]||(t[2]=r=>{a.openHelpModal=!1})})):g("",!0)]),_:1})],10,se)}const ye=k(te,[["render",$e],["__scopeId","data-v-83a7789f"]]),we={name:"index",components:{Message:V,Navbar:ye},async setup(){return{dashboardConfigurationStore:$()}},computed:{getMessages(){return this.dashboardConfigurationStore.Messages.filter(n=>n.show)}}},Me=["data-bs-theme"],De={class:"row h-100"},Le={class:"col-md-9 col-lg-10 overflow-y-scroll mb-0 pt-2"},He={class:"messageCentre text-body position-fixed d-flex"};function Ne(n,t,f,d,a,p){const i=b("Navbar"),u=b("RouterView"),x=b("Message");return o(),l("div",{class:"container-fluid flex-grow-1 main","data-bs-theme":this.dashboardConfigurationStore.Configuration.Server.dashboard_theme},[e("div",De,[s(i),e("main",Le,[(o(),_(T,null,{default:c(()=>[s(u,null,{default:c(({Component:r})=>[s(M,{name:"fade2",mode:"out-in",appear:""},{default:c(()=>[(o(),_(G(r)))]),_:2},1024)]),_:1})]),_:1})),e("div",He,[s(A,{name:"message",tag:"div",class:"position-relative flex-sm-grow-0 flex-grow-1 d-flex align-items-end ms-sm-auto flex-column gap-2"},{default:c(()=>[(o(!0),l(y,null,w(p.getMessages.slice().reverse(),r=>(o(),_(x,{message:r,key:r.id},null,8,["message"]))),128))]),_:1})])])])],8,Me)}const Ue=k(we,[["render",Ne],["__scopeId","data-v-ce114a8b"]]);export{Ue as default}; +import{r as C,o as D,a as o,c as l,b as e,d as s,e as g,f as m,t as v,_ as k,W as L,D as $,g as H,G as N,w as c,F as y,h as w,n as S,i as _,T as M,j as b,k as A,l as G,S as T}from"./index-DOaPWS1X.js";import{L as h}from"./localeText-CaAXeE0W.js";import{M as V}from"./message-ChztDIV3.js";import"./dayjs.min-D8jwq_wn.js";const U={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},W={class:"container d-flex h-100 w-100"},B={class:"m-auto modal-dialog-centered dashboardModal"},O={class:"card rounded-3 shadow flex-grow-1"},R={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},z={class:"mb-0"},F={class:"card-body px-4 pb-4 d-flex flex-column gap-2"},j={class:"card text-decoration-none",target:"_blank",role:"button",href:"https://discord.com/invite/ZkJSPAaQ"},q={class:"card-body d-flex gap-4 align-items-center"},I={class:"d-flex align-items-center"},J={class:"badge rounded-pill text-bg-primary ms-2"},P={key:0,class:"spinner-border spinner-border-sm",style:{width:"0.7rem",height:"0.7rem"}},E={key:1},Q={class:"text-muted"},Z={class:"card text-decoration-none",href:"https://donaldzou.github.io/WGDashboard-Documentation/",target:"_blank"},K={class:"card-body d-flex gap-4 align-items-center"},X={class:"mb-0"},Y={class:"text-muted"},ee={__name:"helpModal",setup(n){const t=C(!0),f=C(void 0);return D(()=>{t.value=!0,fetch("https://discord.com/api/guilds/1276818723637956628/widget.json").then(d=>d.json()).then(d=>{f.value=d,t.value=!1}).catch(()=>{t.value=!1})}),(d,a)=>(o(),l("div",U,[e("div",W,[e("div",B,[e("div",O,[e("div",R,[e("h4",z,[s(h,{t:"Help"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:a[0]||(a[0]=p=>d.$emit("close"))})]),e("div",F,[e("a",j,[e("div",q,[a[3]||(a[3]=e("h1",{class:"mb-0"},[e("i",{class:"bi bi-discord"})],-1)),e("div",null,[e("div",I,[a[2]||(a[2]=e("h5",{class:"mb-0"}," Discord Server ",-1)),e("span",J,[t.value?(o(),l("span",P)):g("",!0),f.value!==void 0&&!t.value?(o(),l("span",E,[a[1]||(a[1]=e("i",{class:"bi bi-person-fill me-2"},null,-1)),m(v(f.value.presence_count)+" Online ",1)])):g("",!0)])]),e("small",Q,[s(h,{t:"Join our Discord server for quick help or chat about WGDashboard!"})])])])]),e("a",Z,[e("div",K,[a[4]||(a[4]=e("h1",{class:"mb-0"},[e("i",{class:"bi bi-hash"})],-1)),e("div",null,[e("h5",X,[s(h,{t:"Official Documentation"})]),e("small",Y,[s(h,{t:"Official documentation contains User Guides and more..."})])])])])])])])])]))}},te={name:"navbar",components:{HelpModal:ee,LocaleText:h},setup(){const n=L(),t=$();return{wireguardConfigurationsStore:n,dashboardConfigurationStore:t}},data(){return{updateAvailable:!1,updateMessage:"Checking for update...",updateUrl:"",openHelpModal:!1}},computed:{getActiveCrossServer(){if(this.dashboardConfigurationStore.ActiveServerConfiguration)return new URL(this.dashboardConfigurationStore.CrossServerConfiguration.ServerList[this.dashboardConfigurationStore.ActiveServerConfiguration].host)}},mounted(){H("/api/getDashboardUpdate",{},n=>{n.status?(n.data&&(this.updateAvailable=!0,this.updateUrl=n.data),this.updateMessage=n.message):(this.updateMessage=N("Failed to check available update"),console.log(`Failed to get update: ${n.message}`))})}},se=["data-bs-theme"],oe={id:"sidebarMenu",class:"bg-body-tertiary sidebar border h-100 rounded-3 shadow overflow-y-scroll"},ae={class:"sidebar-sticky"},ne={class:"text-white text-center m-0 py-3 mb-3 btn-brand"},ie={key:0,class:"ms-auto"},re={class:"nav flex-column px-2"},le={class:"nav-item"},de={class:"nav-item"},ce={class:"nav-item"},ue={class:"sidebar-heading px-3 mt-4 mb-1 text-muted text-center"},me={class:"nav flex-column px-2"},be={class:"nav-item"},fe={class:"sidebar-heading px-3 mt-4 mb-1 text-muted text-center"},pe={class:"nav flex-column px-2"},ve={class:"nav-item"},he={class:"nav-item"},_e={class:"nav flex-column px-2 mb-3"},ge={class:"nav-item"},xe={class:"nav-item",style:{"font-size":"0.8rem"}},Ce=["href"],Se={class:"nav-link text-muted rounded-3"},ke={key:1,class:"nav-link text-muted rounded-3"};function $e(n,t,f,d,a,p){const i=b("LocaleText"),u=b("RouterLink"),x=b("HelpModal");return o(),l("div",{class:S(["col-md-3 col-lg-2 d-md-block p-2 navbar-container",{active:this.dashboardConfigurationStore.ShowNavBar}]),"data-bs-theme":d.dashboardConfigurationStore.Configuration.Server.dashboard_theme},[e("nav",oe,[e("div",ae,[e("div",ne,[t[4]||(t[4]=e("h5",{class:"mb-0"}," WGDashboard ",-1)),p.getActiveCrossServer!==void 0?(o(),l("small",ie,[t[3]||(t[3]=e("i",{class:"bi bi-hdd-rack-fill me-2"},null,-1)),m(v(p.getActiveCrossServer.host),1)])):g("",!0)]),e("ul",re,[e("li",le,[s(u,{class:"nav-link rounded-3",to:"/","exact-active-class":"active"},{default:c(()=>[t[5]||(t[5]=e("i",{class:"bi bi-house me-2"},null,-1)),s(i,{t:"Home"})]),_:1})]),e("li",de,[s(u,{class:"nav-link rounded-3",to:"/settings","exact-active-class":"active"},{default:c(()=>[t[6]||(t[6]=e("i",{class:"bi bi-gear me-2"},null,-1)),s(i,{t:"Settings"})]),_:1})]),e("li",ce,[e("a",{class:"nav-link rounded-3",role:"button",onClick:t[0]||(t[0]=r=>a.openHelpModal=!0)},[t[7]||(t[7]=e("i",{class:"bi bi-question-circle me-2"},null,-1)),s(i,{t:"Help"})])])]),t[12]||(t[12]=e("hr",{class:"text-body"},null,-1)),e("h6",ue,[t[8]||(t[8]=e("i",{class:"bi bi-body-text me-2"},null,-1)),s(i,{t:"WireGuard Configurations"})]),e("ul",me,[(o(!0),l(y,null,w(this.wireguardConfigurationsStore.Configurations,r=>(o(),l("li",be,[s(u,{to:"/configuration/"+r.Name+"/peers",class:"nav-link nav-conf-link rounded-3","active-class":"active"},{default:c(()=>[e("span",{class:S(["dot me-2",{active:r.Status}])},null,2),m(" "+v(r.Name),1)]),_:2},1032,["to"])]))),256))]),t[13]||(t[13]=e("hr",{class:"text-body"},null,-1)),e("h6",fe,[t[9]||(t[9]=e("i",{class:"bi bi-tools me-2"},null,-1)),s(i,{t:"Tools"})]),e("ul",pe,[e("li",ve,[s(u,{to:"/ping",class:"nav-link rounded-3","active-class":"active"},{default:c(()=>[s(i,{t:"Ping"})]),_:1})]),e("li",he,[s(u,{to:"/traceroute",class:"nav-link rounded-3","active-class":"active"},{default:c(()=>[s(i,{t:"Traceroute"})]),_:1})])]),t[14]||(t[14]=e("hr",{class:"text-body"},null,-1)),e("ul",_e,[e("li",ge,[e("a",{class:"nav-link text-danger rounded-3",onClick:t[1]||(t[1]=r=>this.dashboardConfigurationStore.signOut()),role:"button",style:{"font-weight":"bold"}},[t[10]||(t[10]=e("i",{class:"bi bi-box-arrow-left me-2"},null,-1)),s(i,{t:"Sign Out"})])]),e("li",xe,[this.updateAvailable?(o(),l("a",{key:0,href:this.updateUrl,class:"text-decoration-none rounded-3",target:"_blank"},[e("small",Se,[s(i,{t:this.updateMessage},null,8,["t"]),t[11]||(t[11]=m(" (")),s(i,{t:"Current Version:"}),m(" "+v(d.dashboardConfigurationStore.Configuration.Server.version)+") ",1)])],8,Ce)):(o(),l("small",ke,[s(i,{t:this.updateMessage},null,8,["t"]),m(" ("+v(d.dashboardConfigurationStore.Configuration.Server.version)+") ",1)]))])])])]),s(M,{name:"zoom"},{default:c(()=>[this.openHelpModal?(o(),_(x,{key:0,onClose:t[2]||(t[2]=r=>{a.openHelpModal=!1})})):g("",!0)]),_:1})],10,se)}const ye=k(te,[["render",$e],["__scopeId","data-v-83a7789f"]]),we={name:"index",components:{Message:V,Navbar:ye},async setup(){return{dashboardConfigurationStore:$()}},computed:{getMessages(){return this.dashboardConfigurationStore.Messages.filter(n=>n.show)}}},Me=["data-bs-theme"],De={class:"row h-100"},Le={class:"col-md-9 col-lg-10 overflow-y-scroll mb-0 pt-2"},He={class:"messageCentre text-body position-fixed d-flex"};function Ne(n,t,f,d,a,p){const i=b("Navbar"),u=b("RouterView"),x=b("Message");return o(),l("div",{class:"container-fluid flex-grow-1 main","data-bs-theme":this.dashboardConfigurationStore.Configuration.Server.dashboard_theme},[e("div",De,[s(i),e("main",Le,[(o(),_(T,null,{default:c(()=>[s(u,null,{default:c(({Component:r})=>[s(M,{name:"fade2",mode:"out-in",appear:""},{default:c(()=>[(o(),_(G(r)))]),_:2},1024)]),_:1})]),_:1})),e("div",He,[s(A,{name:"message",tag:"div",class:"position-relative flex-sm-grow-0 flex-grow-1 d-flex align-items-end ms-sm-auto flex-column gap-2"},{default:c(()=>[(o(!0),l(y,null,w(p.getMessages.slice().reverse(),r=>(o(),_(x,{message:r,key:r.id},null,8,["message"]))),128))]),_:1})])])])],8,Me)}const Ue=k(we,[["render",Ne],["__scopeId","data-v-ce114a8b"]]);export{Ue as default}; diff --git a/src/static/app/dist/assets/index-BPNEscAR.js b/src/static/app/dist/assets/index-DOaPWS1X.js similarity index 99% rename from src/static/app/dist/assets/index-BPNEscAR.js rename to src/static/app/dist/assets/index-DOaPWS1X.js index a74ebc4..f62ebfa 100644 --- a/src/static/app/dist/assets/index-BPNEscAR.js +++ b/src/static/app/dist/assets/index-DOaPWS1X.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C8JLgmcN.js","assets/localeText-DX813vQA.js","assets/message-Cw7_G39b.js","assets/dayjs.min-Lw24H7b2.js","assets/message-CmGi0ZIz.css","assets/index-BKNwSldE.css","assets/configurationList-TvNdRf4q.js","assets/configurationList-CWcGXYWr.css","assets/settings-ReVwIZ3m.js","assets/vue-datepicker-D9reu0Fg.js","assets/settings-H5PFVa1m.css","assets/ping-DUh82NQw.js","assets/osmap-DFqkfaU2.js","assets/osmap-CoctJCk_.css","assets/ping-DojRH9NX.css","assets/traceroute-D1nMpdIh.js","assets/traceroute-C5JbTTY4.css","assets/newConfiguration-Ccc7iqeY.js","assets/index-L60y6kc9.js","assets/restoreConfiguration-N3JQhUVT.js","assets/restoreConfiguration-C77qni2g.css","assets/peerList-CMo3vsiC.js","assets/peerList-D1fpqVhD.css","assets/peerCreate-C7F1RHXB.js","assets/peerCreate-BKh8DeBv.css","assets/signin-D6BnWOQO.js","assets/signin-wzAxJYhM.css","assets/setup-CE_Ispds.js","assets/totp-B2bG5DyX.js","assets/browser-CjSdxGTc.js","assets/share-Ddnyobqg.js","assets/share-B4McccvP.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C0bjwRB-.js","assets/localeText-CaAXeE0W.js","assets/message-ChztDIV3.js","assets/dayjs.min-D8jwq_wn.js","assets/message-CmGi0ZIz.css","assets/index-BKNwSldE.css","assets/configurationList-BAuTfbU-.js","assets/configurationList-CWcGXYWr.css","assets/settings-B22cgeoY.js","assets/vue-datepicker-D91GxXPq.js","assets/settings-H5PFVa1m.css","assets/ping-BB-b6WHn.js","assets/osmap-BRB1j1wE.js","assets/osmap-CoctJCk_.css","assets/ping-DojRH9NX.css","assets/traceroute-BGkng5o-.js","assets/traceroute-C5JbTTY4.css","assets/newConfiguration-R-olohWo.js","assets/index-L60y6kc9.js","assets/restoreConfiguration-DN55Pnc_.js","assets/restoreConfiguration-C77qni2g.css","assets/peerList-C2NQGcke.js","assets/peerList-D1fpqVhD.css","assets/peerCreate-B_n86hyd.js","assets/peerCreate-BKh8DeBv.css","assets/signin-M3EwqtyC.js","assets/signin-wzAxJYhM.css","assets/setup-DUH8iz4Z.js","assets/totp-BZU5dK65.js","assets/browser-CjSdxGTc.js","assets/share-BU0DtM5p.js","assets/share-B4McccvP.css"])))=>i.map(i=>d[i]); (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(r){if(r.ep)return;r.ep=!0;const o=n(r);fetch(r.href,o)}})();var vg=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Gy(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Eg(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function s(){return this instanceof s?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(s){var r=Object.getOwnPropertyDescriptor(e,s);Object.defineProperty(n,s,r.get?r:{enumerable:!0,get:function(){return e[s]}})}),n}var yg={exports:{}},qe="top",nt="bottom",st="right",ze="left",Kr="auto",fs=[qe,nt,st,ze],On="start",es="end",fc="clippingParents",uo="viewport",Kn="popper",dc="reference",Bi=fs.reduce(function(e,t){return e.concat([t+"-"+On,t+"-"+es])},[]),fo=[].concat(fs,[Kr]).reduce(function(e,t){return e.concat([t,t+"-"+On,t+"-"+es])},[]),hc="beforeRead",pc="read",gc="afterRead",mc="beforeMain",_c="main",vc="afterMain",Ec="beforeWrite",yc="write",bc="afterWrite",Ac=[hc,pc,gc,mc,_c,vc,Ec,yc,bc];function Nt(e){return e?(e.nodeName||"").toLowerCase():null}function rt(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function xn(e){var t=rt(e).Element;return e instanceof t||e instanceof Element}function ct(e){var t=rt(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function ho(e){if(typeof ShadowRoot>"u")return!1;var t=rt(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function bg(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var s=t.styles[n]||{},r=t.attributes[n]||{},o=t.elements[n];!ct(o)||!Nt(o)||(Object.assign(o.style,s),Object.keys(r).forEach(function(a){var l=r[a];l===!1?o.removeAttribute(a):o.setAttribute(a,l===!0?"":l)}))})}function Ag(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(s){var r=t.elements[s],o=t.attributes[s]||{},a=Object.keys(t.styles.hasOwnProperty(s)?t.styles[s]:n[s]),l=a.reduce(function(c,d){return c[d]="",c},{});!ct(r)||!Nt(r)||(Object.assign(r.style,l),Object.keys(o).forEach(function(c){r.removeAttribute(c)}))})}}const po={name:"applyStyles",enabled:!0,phase:"write",fn:bg,effect:Ag,requires:["computeStyles"]};function Ot(e){return e.split("-")[0]}var Tn=Math.max,Dr=Math.min,ts=Math.round;function ji(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function Tc(){return!/^((?!chrome|android).)*safari/i.test(ji())}function ns(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!1);var s=e.getBoundingClientRect(),r=1,o=1;t&&ct(e)&&(r=e.offsetWidth>0&&ts(s.width)/e.offsetWidth||1,o=e.offsetHeight>0&&ts(s.height)/e.offsetHeight||1);var a=xn(e)?rt(e):window,l=a.visualViewport,c=!Tc()&&n,d=(s.left+(c&&l?l.offsetLeft:0))/r,f=(s.top+(c&&l?l.offsetTop:0))/o,h=s.width/r,p=s.height/o;return{width:h,height:p,top:f,right:d+h,bottom:f+p,left:d,x:d,y:f}}function go(e){var t=ns(e),n=e.offsetWidth,s=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-s)<=1&&(s=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:s}}function wc(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&ho(n)){var s=t;do{if(s&&e.isSameNode(s))return!0;s=s.parentNode||s.host}while(s)}return!1}function Bt(e){return rt(e).getComputedStyle(e)}function Tg(e){return["table","td","th"].indexOf(Nt(e))>=0}function on(e){return((xn(e)?e.ownerDocument:e.document)||window.document).documentElement}function Wr(e){return Nt(e)==="html"?e:e.assignedSlot||e.parentNode||(ho(e)?e.host:null)||on(e)}function Ba(e){return!ct(e)||Bt(e).position==="fixed"?null:e.offsetParent}function wg(e){var t=/firefox/i.test(ji()),n=/Trident/i.test(ji());if(n&&ct(e)){var s=Bt(e);if(s.position==="fixed")return null}var r=Wr(e);for(ho(r)&&(r=r.host);ct(r)&&["html","body"].indexOf(Nt(r))<0;){var o=Bt(r);if(o.transform!=="none"||o.perspective!=="none"||o.contain==="paint"||["transform","perspective"].indexOf(o.willChange)!==-1||t&&o.willChange==="filter"||t&&o.filter&&o.filter!=="none")return r;r=r.parentNode}return null}function Us(e){for(var t=rt(e),n=Ba(e);n&&Tg(n)&&Bt(n).position==="static";)n=Ba(n);return n&&(Nt(n)==="html"||Nt(n)==="body"&&Bt(n).position==="static")?t:n||wg(e)||t}function mo(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Ss(e,t,n){return Tn(e,Dr(t,n))}function Cg(e,t,n){var s=Ss(e,t,n);return s>n?n:s}function Cc(){return{top:0,right:0,bottom:0,left:0}}function Sc(e){return Object.assign({},Cc(),e)}function Oc(e,t){return t.reduce(function(n,s){return n[s]=e,n},{})}var Sg=function(t,n){return t=typeof t=="function"?t(Object.assign({},n.rects,{placement:n.placement})):t,Sc(typeof t!="number"?t:Oc(t,fs))};function Og(e){var t,n=e.state,s=e.name,r=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,l=Ot(n.placement),c=mo(l),d=[ze,st].indexOf(l)>=0,f=d?"height":"width";if(!(!o||!a)){var h=Sg(r.padding,n),p=go(o),E=c==="y"?qe:ze,x=c==="y"?nt:st,C=n.rects.reference[f]+n.rects.reference[c]-a[c]-n.rects.popper[f],D=a[c]-n.rects.reference[c],P=Us(o),V=P?c==="y"?P.clientHeight||0:P.clientWidth||0:0,k=C/2-D/2,M=h[E],b=V-p[f]-h[x],y=V/2-p[f]/2+k,S=Ss(M,y,b),T=c;n.modifiersData[s]=(t={},t[T]=S,t.centerOffset=S-y,t)}}function xg(e){var t=e.state,n=e.options,s=n.element,r=s===void 0?"[data-popper-arrow]":s;r!=null&&(typeof r=="string"&&(r=t.elements.popper.querySelector(r),!r)||wc(t.elements.popper,r)&&(t.elements.arrow=r))}const xc={name:"arrow",enabled:!0,phase:"main",fn:Og,effect:xg,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function ss(e){return e.split("-")[1]}var Ng={top:"auto",right:"auto",bottom:"auto",left:"auto"};function $g(e,t){var n=e.x,s=e.y,r=t.devicePixelRatio||1;return{x:ts(n*r)/r||0,y:ts(s*r)/r||0}}function ja(e){var t,n=e.popper,s=e.popperRect,r=e.placement,o=e.variation,a=e.offsets,l=e.position,c=e.gpuAcceleration,d=e.adaptive,f=e.roundOffsets,h=e.isFixed,p=a.x,E=p===void 0?0:p,x=a.y,C=x===void 0?0:x,D=typeof f=="function"?f({x:E,y:C}):{x:E,y:C};E=D.x,C=D.y;var P=a.hasOwnProperty("x"),V=a.hasOwnProperty("y"),k=ze,M=qe,b=window;if(d){var y=Us(n),S="clientHeight",T="clientWidth";if(y===rt(n)&&(y=on(n),Bt(y).position!=="static"&&l==="absolute"&&(S="scrollHeight",T="scrollWidth")),y=y,r===qe||(r===ze||r===st)&&o===es){M=nt;var A=h&&y===b&&b.visualViewport?b.visualViewport.height:y[S];C-=A-s.height,C*=c?1:-1}if(r===ze||(r===qe||r===nt)&&o===es){k=st;var w=h&&y===b&&b.visualViewport?b.visualViewport.width:y[T];E-=w-s.width,E*=c?1:-1}}var j=Object.assign({position:l},d&&Ng),B=f===!0?$g({x:E,y:C},rt(n)):{x:E,y:C};if(E=B.x,C=B.y,c){var Q;return Object.assign({},j,(Q={},Q[M]=V?"0":"",Q[k]=P?"0":"",Q.transform=(b.devicePixelRatio||1)<=1?"translate("+E+"px, "+C+"px)":"translate3d("+E+"px, "+C+"px, 0)",Q))}return Object.assign({},j,(t={},t[M]=V?C+"px":"",t[k]=P?E+"px":"",t.transform="",t))}function Dg(e){var t=e.state,n=e.options,s=n.gpuAcceleration,r=s===void 0?!0:s,o=n.adaptive,a=o===void 0?!0:o,l=n.roundOffsets,c=l===void 0?!0:l,d={placement:Ot(t.placement),variation:ss(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,ja(Object.assign({},d,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:c})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,ja(Object.assign({},d,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:c})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const _o={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:Dg,data:{}};var dr={passive:!0};function Lg(e){var t=e.state,n=e.instance,s=e.options,r=s.scroll,o=r===void 0?!0:r,a=s.resize,l=a===void 0?!0:a,c=rt(t.elements.popper),d=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&d.forEach(function(f){f.addEventListener("scroll",n.update,dr)}),l&&c.addEventListener("resize",n.update,dr),function(){o&&d.forEach(function(f){f.removeEventListener("scroll",n.update,dr)}),l&&c.removeEventListener("resize",n.update,dr)}}const vo={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:Lg,data:{}};var Rg={left:"right",right:"left",bottom:"top",top:"bottom"};function wr(e){return e.replace(/left|right|bottom|top/g,function(t){return Rg[t]})}var Ig={start:"end",end:"start"};function Ka(e){return e.replace(/start|end/g,function(t){return Ig[t]})}function Eo(e){var t=rt(e),n=t.pageXOffset,s=t.pageYOffset;return{scrollLeft:n,scrollTop:s}}function yo(e){return ns(on(e)).left+Eo(e).scrollLeft}function Pg(e,t){var n=rt(e),s=on(e),r=n.visualViewport,o=s.clientWidth,a=s.clientHeight,l=0,c=0;if(r){o=r.width,a=r.height;var d=Tc();(d||!d&&t==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}return{width:o,height:a,x:l+yo(e),y:c}}function Mg(e){var t,n=on(e),s=Eo(e),r=(t=e.ownerDocument)==null?void 0:t.body,o=Tn(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Tn(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),l=-s.scrollLeft+yo(e),c=-s.scrollTop;return Bt(r||n).direction==="rtl"&&(l+=Tn(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:l,y:c}}function bo(e){var t=Bt(e),n=t.overflow,s=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+s)}function Nc(e){return["html","body","#document"].indexOf(Nt(e))>=0?e.ownerDocument.body:ct(e)&&bo(e)?e:Nc(Wr(e))}function Os(e,t){var n;t===void 0&&(t=[]);var s=Nc(e),r=s===((n=e.ownerDocument)==null?void 0:n.body),o=rt(s),a=r?[o].concat(o.visualViewport||[],bo(s)?s:[]):s,l=t.concat(a);return r?l:l.concat(Os(Wr(a)))}function Ki(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function kg(e,t){var n=ns(e,!1,t==="fixed");return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}function Wa(e,t,n){return t===uo?Ki(Pg(e,n)):xn(t)?kg(t,n):Ki(Mg(on(e)))}function Vg(e){var t=Os(Wr(e)),n=["absolute","fixed"].indexOf(Bt(e).position)>=0,s=n&&ct(e)?Us(e):e;return xn(s)?t.filter(function(r){return xn(r)&&wc(r,s)&&Nt(r)!=="body"}):[]}function Fg(e,t,n,s){var r=t==="clippingParents"?Vg(e):[].concat(t),o=[].concat(r,[n]),a=o[0],l=o.reduce(function(c,d){var f=Wa(e,d,s);return c.top=Tn(f.top,c.top),c.right=Dr(f.right,c.right),c.bottom=Dr(f.bottom,c.bottom),c.left=Tn(f.left,c.left),c},Wa(e,a,s));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function $c(e){var t=e.reference,n=e.element,s=e.placement,r=s?Ot(s):null,o=s?ss(s):null,a=t.x+t.width/2-n.width/2,l=t.y+t.height/2-n.height/2,c;switch(r){case qe:c={x:a,y:t.y-n.height};break;case nt:c={x:a,y:t.y+t.height};break;case st:c={x:t.x+t.width,y:l};break;case ze:c={x:t.x-n.width,y:l};break;default:c={x:t.x,y:t.y}}var d=r?mo(r):null;if(d!=null){var f=d==="y"?"height":"width";switch(o){case On:c[d]=c[d]-(t[f]/2-n[f]/2);break;case es:c[d]=c[d]+(t[f]/2-n[f]/2);break}}return c}function rs(e,t){t===void 0&&(t={});var n=t,s=n.placement,r=s===void 0?e.placement:s,o=n.strategy,a=o===void 0?e.strategy:o,l=n.boundary,c=l===void 0?fc:l,d=n.rootBoundary,f=d===void 0?uo:d,h=n.elementContext,p=h===void 0?Kn:h,E=n.altBoundary,x=E===void 0?!1:E,C=n.padding,D=C===void 0?0:C,P=Sc(typeof D!="number"?D:Oc(D,fs)),V=p===Kn?dc:Kn,k=e.rects.popper,M=e.elements[x?V:p],b=Fg(xn(M)?M:M.contextElement||on(e.elements.popper),c,f,a),y=ns(e.elements.reference),S=$c({reference:y,element:k,strategy:"absolute",placement:r}),T=Ki(Object.assign({},k,S)),A=p===Kn?T:y,w={top:b.top-A.top+P.top,bottom:A.bottom-b.bottom+P.bottom,left:b.left-A.left+P.left,right:A.right-b.right+P.right},j=e.modifiersData.offset;if(p===Kn&&j){var B=j[r];Object.keys(w).forEach(function(Q){var oe=[st,nt].indexOf(Q)>=0?1:-1,he=[qe,nt].indexOf(Q)>=0?"y":"x";w[Q]+=B[he]*oe})}return w}function Hg(e,t){t===void 0&&(t={});var n=t,s=n.placement,r=n.boundary,o=n.rootBoundary,a=n.padding,l=n.flipVariations,c=n.allowedAutoPlacements,d=c===void 0?fo:c,f=ss(s),h=f?l?Bi:Bi.filter(function(x){return ss(x)===f}):fs,p=h.filter(function(x){return d.indexOf(x)>=0});p.length===0&&(p=h);var E=p.reduce(function(x,C){return x[C]=rs(e,{placement:C,boundary:r,rootBoundary:o,padding:a})[Ot(C)],x},{});return Object.keys(E).sort(function(x,C){return E[x]-E[C]})}function Bg(e){if(Ot(e)===Kr)return[];var t=wr(e);return[Ka(e),t,Ka(t)]}function jg(e){var t=e.state,n=e.options,s=e.name;if(!t.modifiersData[s]._skip){for(var r=n.mainAxis,o=r===void 0?!0:r,a=n.altAxis,l=a===void 0?!0:a,c=n.fallbackPlacements,d=n.padding,f=n.boundary,h=n.rootBoundary,p=n.altBoundary,E=n.flipVariations,x=E===void 0?!0:E,C=n.allowedAutoPlacements,D=t.options.placement,P=Ot(D),V=P===D,k=c||(V||!x?[wr(D)]:Bg(D)),M=[D].concat(k).reduce(function(Be,Pe){return Be.concat(Ot(Pe)===Kr?Hg(t,{placement:Pe,boundary:f,rootBoundary:h,padding:d,flipVariations:x,allowedAutoPlacements:C}):Pe)},[]),b=t.rects.reference,y=t.rects.popper,S=new Map,T=!0,A=M[0],w=0;w=0,he=oe?"width":"height",te=rs(t,{placement:j,boundary:f,rootBoundary:h,altBoundary:p,padding:d}),Z=oe?Q?st:ze:Q?nt:qe;b[he]>y[he]&&(Z=wr(Z));var ce=wr(Z),Ce=[];if(o&&Ce.push(te[B]<=0),l&&Ce.push(te[Z]<=0,te[ce]<=0),Ce.every(function(Be){return Be})){A=j,T=!1;break}S.set(j,Ce)}if(T)for(var He=x?3:1,De=function(Pe){var we=M.find(function(R){var q=S.get(R);if(q)return q.slice(0,Pe).every(function(z){return z})});if(we)return A=we,"break"},Ae=He;Ae>0;Ae--){var et=De(Ae);if(et==="break")break}t.placement!==A&&(t.modifiersData[s]._skip=!0,t.placement=A,t.reset=!0)}}const Dc={name:"flip",enabled:!0,phase:"main",fn:jg,requiresIfExists:["offset"],data:{_skip:!1}};function Ua(e,t,n){return n===void 0&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function Ya(e){return[qe,st,nt,ze].some(function(t){return e[t]>=0})}function Kg(e){var t=e.state,n=e.name,s=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,a=rs(t,{elementContext:"reference"}),l=rs(t,{altBoundary:!0}),c=Ua(a,s),d=Ua(l,r,o),f=Ya(c),h=Ya(d);t.modifiersData[n]={referenceClippingOffsets:c,popperEscapeOffsets:d,isReferenceHidden:f,hasPopperEscaped:h},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":f,"data-popper-escaped":h})}const Lc={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:Kg};function Wg(e,t,n){var s=Ot(e),r=[ze,qe].indexOf(s)>=0?-1:1,o=typeof n=="function"?n(Object.assign({},t,{placement:e})):n,a=o[0],l=o[1];return a=a||0,l=(l||0)*r,[ze,st].indexOf(s)>=0?{x:l,y:a}:{x:a,y:l}}function Ug(e){var t=e.state,n=e.options,s=e.name,r=n.offset,o=r===void 0?[0,0]:r,a=fo.reduce(function(f,h){return f[h]=Wg(h,t.rects,o),f},{}),l=a[t.placement],c=l.x,d=l.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=c,t.modifiersData.popperOffsets.y+=d),t.modifiersData[s]=a}const Rc={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:Ug};function Yg(e){var t=e.state,n=e.name;t.modifiersData[n]=$c({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})}const Ao={name:"popperOffsets",enabled:!0,phase:"read",fn:Yg,data:{}};function Gg(e){return e==="x"?"y":"x"}function qg(e){var t=e.state,n=e.options,s=e.name,r=n.mainAxis,o=r===void 0?!0:r,a=n.altAxis,l=a===void 0?!1:a,c=n.boundary,d=n.rootBoundary,f=n.altBoundary,h=n.padding,p=n.tether,E=p===void 0?!0:p,x=n.tetherOffset,C=x===void 0?0:x,D=rs(t,{boundary:c,rootBoundary:d,padding:h,altBoundary:f}),P=Ot(t.placement),V=ss(t.placement),k=!V,M=mo(P),b=Gg(M),y=t.modifiersData.popperOffsets,S=t.rects.reference,T=t.rects.popper,A=typeof C=="function"?C(Object.assign({},t.rects,{placement:t.placement})):C,w=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),j=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,B={x:0,y:0};if(y){if(o){var Q,oe=M==="y"?qe:ze,he=M==="y"?nt:st,te=M==="y"?"height":"width",Z=y[M],ce=Z+D[oe],Ce=Z-D[he],He=E?-T[te]/2:0,De=V===On?S[te]:T[te],Ae=V===On?-T[te]:-S[te],et=t.elements.arrow,Be=E&&et?go(et):{width:0,height:0},Pe=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:Cc(),we=Pe[oe],R=Pe[he],q=Ss(0,S[te],Be[te]),z=k?S[te]/2-He-q-we-w.mainAxis:De-q-we-w.mainAxis,J=k?-S[te]/2+He+q+R+w.mainAxis:Ae+q+R+w.mainAxis,$=t.elements.arrow&&Us(t.elements.arrow),ge=$?M==="y"?$.clientTop||0:$.clientLeft||0:0,g=(Q=j?.[M])!=null?Q:0,_=Z+z-g-ge,O=Z+J-g,H=Ss(E?Dr(ce,_):ce,Z,E?Tn(Ce,O):Ce);y[M]=H,B[M]=H-Z}if(l){var L,F=M==="x"?qe:ze,G=M==="x"?nt:st,N=y[b],W=b==="y"?"height":"width",K=N+D[F],se=N-D[G],X=[qe,ze].indexOf(P)!==-1,ee=(L=j?.[b])!=null?L:0,re=X?K:N-S[W]-T[W]-ee+w.altAxis,ae=X?N+S[W]+T[W]-ee-w.altAxis:se,de=E&&X?Cg(re,N,ae):Ss(E?re:K,N,E?ae:se);y[b]=de,B[b]=de-N}t.modifiersData[s]=B}}const Ic={name:"preventOverflow",enabled:!0,phase:"main",fn:qg,requiresIfExists:["offset"]};function zg(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function Xg(e){return e===rt(e)||!ct(e)?Eo(e):zg(e)}function Qg(e){var t=e.getBoundingClientRect(),n=ts(t.width)/e.offsetWidth||1,s=ts(t.height)/e.offsetHeight||1;return n!==1||s!==1}function Jg(e,t,n){n===void 0&&(n=!1);var s=ct(t),r=ct(t)&&Qg(t),o=on(t),a=ns(e,r,n),l={scrollLeft:0,scrollTop:0},c={x:0,y:0};return(s||!s&&!n)&&((Nt(t)!=="body"||bo(o))&&(l=Xg(t)),ct(t)?(c=ns(t,!0),c.x+=t.clientLeft,c.y+=t.clientTop):o&&(c.x=yo(o))),{x:a.left+l.scrollLeft-c.x,y:a.top+l.scrollTop-c.y,width:a.width,height:a.height}}function Zg(e){var t=new Map,n=new Set,s=[];e.forEach(function(o){t.set(o.name,o)});function r(o){n.add(o.name);var a=[].concat(o.requires||[],o.requiresIfExists||[]);a.forEach(function(l){if(!n.has(l)){var c=t.get(l);c&&r(c)}}),s.push(o)}return e.forEach(function(o){n.has(o.name)||r(o)}),s}function em(e){var t=Zg(e);return Ac.reduce(function(n,s){return n.concat(t.filter(function(r){return r.phase===s}))},[])}function tm(e){var t;return function(){return t||(t=new Promise(function(n){Promise.resolve().then(function(){t=void 0,n(e())})})),t}}function nm(e){var t=e.reduce(function(n,s){var r=n[s.name];return n[s.name]=r?Object.assign({},r,s,{options:Object.assign({},r.options,s.options),data:Object.assign({},r.data,s.data)}):s,n},{});return Object.keys(t).map(function(n){return t[n]})}var Ga={placement:"bottom",modifiers:[],strategy:"absolute"};function qa(){for(var e=arguments.length,t=new Array(e),n=0;ne&&e.exact?hy:new RegExp(`(?:${en(e)}${mt}${en(e)})|(?:${en(e)}${li}${en(e)})`,"g");ci.v4=e=>e&&e.exact?py:new RegExp(`${en(e)}${mt}${en(e)}`,"g");ci.v6=e=>e&&e.exact?gy:new RegExp(`${en(e)}${li}${en(e)}`,"g");const If={exact:!1},Pf=`${ci.v4().source}\\/(3[0-2]|[12]?[0-9])`,Mf=`${ci.v6().source}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`,my=new RegExp(`^${Pf}$`),_y=new RegExp(`^${Mf}$`),vy=({exact:e}=If)=>e?my:new RegExp(Pf,"g"),Ey=({exact:e}=If)=>e?_y:new RegExp(Mf,"g"),kf=vy({exact:!0}),Vf=Ey({exact:!0}),Jo=e=>kf.test(e)?4:Vf.test(e)?6:0;Jo.v4=e=>kf.test(e);Jo.v6=e=>Vf.test(e);const kt=e=>{const t=un();if(t.Locale===null)return e;const s=Object.keys(t.Locale).filter(r=>e.match(new RegExp("^"+r+"$","gi"))!==null);return s.length===0||s.length>1||t.Locale[s[0]].length===0?e:e.replace(new RegExp(s[0],"gi"),t.Locale[s[0]])},yy=yf("WireguardConfigurationsStore",{state:()=>({Configurations:void 0,searchString:"",ConfigurationListInterval:void 0,PeerScheduleJobs:{dropdowns:{Field:[{display:kt("Total Received"),value:"total_receive",unit:"GB",type:"number"},{display:kt("Total Sent"),value:"total_sent",unit:"GB",type:"number"},{display:kt("Total Usage"),value:"total_data",unit:"GB",type:"number"},{display:kt("Date"),value:"date",type:"date"}],Operator:[{display:kt("larger than"),value:"lgt"}],Action:[{display:kt("Restrict Peer"),value:"restrict"},{display:kt("Delete Peer"),value:"delete"}]}}}),actions:{async getConfigurations(){await jr("/api/getWireguardConfigurations",{},e=>{e.status&&(this.Configurations=e.data)})},regexCheckIP(e){return/((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/.test(e)},checkCIDR(e){return Jo(e)!==0},checkWGKeyLength(e){return console.log(e),/^[A-Za-z0-9+/]{43}=?=?$/.test(e)}}}),by=async()=>{let e=!1;return await jr("/api/validateAuthentication",{},t=>{e=t.status}),e},ps=ay({history:VE(),scrollBehavior(){document.querySelector("main")!==null&&document.querySelector("main").scrollTo({top:0})},routes:[{name:"Index",path:"/",component:()=>Qe(()=>import("./index-C8JLgmcN.js"),__vite__mapDeps([0,1,2,3,4,5])),meta:{requiresAuth:!0},children:[{name:"Configuration List",path:"",component:()=>Qe(()=>import("./configurationList-TvNdRf4q.js"),__vite__mapDeps([6,1,7])),meta:{title:"WireGuard Configurations"}},{name:"Settings",path:"/settings",component:()=>Qe(()=>import("./settings-ReVwIZ3m.js"),__vite__mapDeps([8,1,3,9,10])),meta:{title:"Settings"}},{path:"/ping",name:"Ping",component:()=>Qe(()=>import("./ping-DUh82NQw.js"),__vite__mapDeps([11,1,12,13,14]))},{path:"/traceroute",name:"Traceroute",component:()=>Qe(()=>import("./traceroute-D1nMpdIh.js"),__vite__mapDeps([15,12,13,1,16]))},{name:"New Configuration",path:"/new_configuration",component:()=>Qe(()=>import("./newConfiguration-Ccc7iqeY.js"),__vite__mapDeps([17,18,1])),meta:{title:"New Configuration"}},{name:"Restore Configuration",path:"/restore_configuration",component:()=>Qe(()=>import("./restoreConfiguration-N3JQhUVT.js"),__vite__mapDeps([19,1,3,18,20])),meta:{title:"Restore Configuration"}},{name:"Configuration",path:"/configuration/:id",component:()=>Qe(()=>import("./configuration-BvSurJ6F.js"),[]),meta:{title:"Configuration"},children:[{name:"Peers List",path:"peers",component:()=>Qe(()=>import("./peerList-CMo3vsiC.js"),__vite__mapDeps([21,1,3,22]))},{name:"Peers Create",path:"create",component:()=>Qe(()=>import("./peerCreate-C7F1RHXB.js"),__vite__mapDeps([23,1,24]))}]}]},{path:"/signin",component:()=>Qe(()=>import("./signin-D6BnWOQO.js"),__vite__mapDeps([25,2,1,3,4,26])),meta:{title:"Sign In",hideTopNav:!0}},{path:"/welcome",component:()=>Qe(()=>import("./setup-CE_Ispds.js"),__vite__mapDeps([27,1])),meta:{requiresAuth:!0,title:"Welcome to WGDashboard",hideTopNav:!0}},{path:"/2FASetup",component:()=>Qe(()=>import("./totp-B2bG5DyX.js"),__vite__mapDeps([28,29,1])),meta:{requiresAuth:!0,title:"Multi-Factor Authentication Setup",hideTopNav:!0}},{path:"/share",component:()=>Qe(()=>import("./share-Ddnyobqg.js"),__vite__mapDeps([30,29,1,31])),meta:{title:"Share",hideTopNav:!0}}]});ps.beforeEach(async(e,t,n)=>{const s=yy(),r=un();e.meta.title?e.params.id?document.title=e.params.id+" | WGDashboard":document.title=e.meta.title+" | WGDashboard":document.title="WGDashboard",r.ShowNavBar=!1,document.querySelector(".loadingBar").classList.remove("loadingDone"),document.querySelector(".loadingBar").classList.add("loading"),e.meta.requiresAuth?r.getActiveCrossServer()?(await r.getConfiguration(),!s.Configurations&&e.name!=="Configuration List"&&await s.getConfigurations(),n()):dy.getCookie("authToken")&&await by()?(await r.getConfiguration(),!s.Configurations&&e.name!=="Configuration List"&&await s.getConfigurations(),r.Redirect=void 0,n()):(r.Redirect=e,n("/signin"),r.newMessage("WGDashboard","Sign in session ended, please sign in again","warning")):n()});ps.afterEach(()=>{document.querySelector(".loadingBar").classList.remove("loading"),document.querySelector(".loadingBar").classList.add("loadingDone")});const Ff=()=>{let e={"content-type":"application/json"};const n=un().getActiveCrossServer();return n&&(e["wg-dashboard-apikey"]=n.apiKey),e},Hf=e=>{const n=un().getActiveCrossServer();return n?`${n.host}${e}`:`${window.location.protocol}//${(window.location.host+window.location.pathname+e).replace(/\/\//g,"/")}`},jr=async(e,t=void 0,n=void 0)=>{const s=new URLSearchParams(t);await fetch(`${Hf(e)}?${s.toString()}`,{headers:Ff()}).then(r=>{const o=un();if(r.ok)return r.json();if(r.status!==200)throw r.status===401&&o.newMessage("WGDashboard","Sign in session ended, please sign in again","warning"),new Error(r.statusText)}).then(r=>n?n(r):void 0).catch(r=>{console.log(r),ps.push({path:"/signin"})})},hb=async(e,t,n)=>{await fetch(`${Hf(e)}`,{headers:Ff(),method:"POST",body:JSON.stringify(t)}).then(s=>{const r=un();if(s.ok)return s.json();if(s.status!==200)throw s.status===401&&r.newMessage("WGDashboard","Sign in session ended, please sign in again","warning"),new Error(s.statusText)}).then(s=>n?n(s):void 0).catch(s=>{console.log(s),ps.push({path:"/signin"})})};let Tr;const Ay=new Uint8Array(16);function Ty(){if(!Tr&&(Tr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Tr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Tr(Ay)}const Re=[];for(let e=0;e<256;++e)Re.push((e+256).toString(16).slice(1));function wy(e,t=0){return Re[e[t+0]]+Re[e[t+1]]+Re[e[t+2]]+Re[e[t+3]]+"-"+Re[e[t+4]]+Re[e[t+5]]+"-"+Re[e[t+6]]+Re[e[t+7]]+"-"+Re[e[t+8]]+Re[e[t+9]]+"-"+Re[e[t+10]]+Re[e[t+11]]+Re[e[t+12]]+Re[e[t+13]]+Re[e[t+14]]+Re[e[t+15]]}const Cy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),cc={randomUUID:Cy};function uc(e,t,n){if(cc.randomUUID&&!t&&!e)return cc.randomUUID();e=e||{};const s=e.random||(e.rng||Ty)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,wy(s)}const un=yf("DashboardConfigurationStore",{state:()=>({Redirect:void 0,Configuration:void 0,Messages:[],Peers:{Selecting:!1,RefreshInterval:void 0},CrossServerConfiguration:{Enable:!1,ServerList:{}},ActiveServerConfiguration:void 0,IsElectronApp:!1,ShowNavBar:!1,Locale:void 0}),actions:{initCrossServerConfiguration(){const e=localStorage.getItem("CrossServerConfiguration");localStorage.getItem("ActiveCrossServerConfiguration")!==null&&(this.ActiveServerConfiguration=localStorage.getItem("ActiveCrossServerConfiguration")),e===null?window.localStorage.setItem("CrossServerConfiguration",JSON.stringify(this.CrossServerConfiguration)):this.CrossServerConfiguration=JSON.parse(e)},syncCrossServerConfiguration(){window.localStorage.setItem("CrossServerConfiguration",JSON.stringify(this.CrossServerConfiguration))},addCrossServerConfiguration(){this.CrossServerConfiguration.ServerList[uc().toString()]={host:"",apiKey:"",active:!1}},deleteCrossServerConfiguration(e){delete this.CrossServerConfiguration.ServerList[e]},getActiveCrossServer(){const e=localStorage.getItem("ActiveCrossServerConfiguration");if(e!==null)return this.CrossServerConfiguration.ServerList[e]},setActiveCrossServer(e){this.ActiveServerConfiguration=e,localStorage.setItem("ActiveCrossServerConfiguration",e)},removeActiveCrossServer(){this.ActiveServerConfiguration=void 0,localStorage.removeItem("ActiveCrossServerConfiguration")},async getConfiguration(){await jr("/api/getDashboardConfiguration",{},e=>{e.status&&(this.Configuration=e.data)})},async signOut(){await jr("/api/signout",{},e=>{this.removeActiveCrossServer(),this.$router.go("/signin")})},newMessage(e,t,n){this.Messages.push({id:uc(),from:kt(e),content:kt(t),type:n,show:!0})},applyLocale(e){if(this.Locale===null)return e;const n=Object.keys(this.Locale).filter(s=>e.match(new RegExp("^"+s+"$","g"))!==null);return console.log(n),n.length===0||n.length>1?e:this.Locale[n[0]]}}});/*! SPDX-License-Identifier: GPL-2.0 +`.replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),hy=new RegExp(`(?:^${mt}$)|(?:^${li}$)`),py=new RegExp(`^${mt}$`),gy=new RegExp(`^${li}$`),ci=e=>e&&e.exact?hy:new RegExp(`(?:${en(e)}${mt}${en(e)})|(?:${en(e)}${li}${en(e)})`,"g");ci.v4=e=>e&&e.exact?py:new RegExp(`${en(e)}${mt}${en(e)}`,"g");ci.v6=e=>e&&e.exact?gy:new RegExp(`${en(e)}${li}${en(e)}`,"g");const If={exact:!1},Pf=`${ci.v4().source}\\/(3[0-2]|[12]?[0-9])`,Mf=`${ci.v6().source}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`,my=new RegExp(`^${Pf}$`),_y=new RegExp(`^${Mf}$`),vy=({exact:e}=If)=>e?my:new RegExp(Pf,"g"),Ey=({exact:e}=If)=>e?_y:new RegExp(Mf,"g"),kf=vy({exact:!0}),Vf=Ey({exact:!0}),Jo=e=>kf.test(e)?4:Vf.test(e)?6:0;Jo.v4=e=>kf.test(e);Jo.v6=e=>Vf.test(e);const kt=e=>{const t=un();if(t.Locale===null)return e;const s=Object.keys(t.Locale).filter(r=>e.match(new RegExp("^"+r+"$","gi"))!==null);return s.length===0||s.length>1||t.Locale[s[0]].length===0?e:e.replace(new RegExp(s[0],"gi"),t.Locale[s[0]])},yy=yf("WireguardConfigurationsStore",{state:()=>({Configurations:void 0,searchString:"",ConfigurationListInterval:void 0,PeerScheduleJobs:{dropdowns:{Field:[{display:kt("Total Received"),value:"total_receive",unit:"GB",type:"number"},{display:kt("Total Sent"),value:"total_sent",unit:"GB",type:"number"},{display:kt("Total Usage"),value:"total_data",unit:"GB",type:"number"},{display:kt("Date"),value:"date",type:"date"}],Operator:[{display:kt("larger than"),value:"lgt"}],Action:[{display:kt("Restrict Peer"),value:"restrict"},{display:kt("Delete Peer"),value:"delete"}]}}}),actions:{async getConfigurations(){await jr("/api/getWireguardConfigurations",{},e=>{e.status&&(this.Configurations=e.data)})},regexCheckIP(e){return/((^\s*((([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))\s*$)|(^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$))/.test(e)},checkCIDR(e){return Jo(e)!==0},checkWGKeyLength(e){return console.log(e),/^[A-Za-z0-9+/]{43}=?=?$/.test(e)}}}),by=async()=>{let e=!1;return await jr("/api/validateAuthentication",{},t=>{e=t.status}),e},ps=ay({history:VE(),scrollBehavior(){document.querySelector("main")!==null&&document.querySelector("main").scrollTo({top:0})},routes:[{name:"Index",path:"/",component:()=>Qe(()=>import("./index-C0bjwRB-.js"),__vite__mapDeps([0,1,2,3,4,5])),meta:{requiresAuth:!0},children:[{name:"Configuration List",path:"",component:()=>Qe(()=>import("./configurationList-BAuTfbU-.js"),__vite__mapDeps([6,1,7])),meta:{title:"WireGuard Configurations"}},{name:"Settings",path:"/settings",component:()=>Qe(()=>import("./settings-B22cgeoY.js"),__vite__mapDeps([8,1,3,9,10])),meta:{title:"Settings"}},{path:"/ping",name:"Ping",component:()=>Qe(()=>import("./ping-BB-b6WHn.js"),__vite__mapDeps([11,1,12,13,14]))},{path:"/traceroute",name:"Traceroute",component:()=>Qe(()=>import("./traceroute-BGkng5o-.js"),__vite__mapDeps([15,12,13,1,16]))},{name:"New Configuration",path:"/new_configuration",component:()=>Qe(()=>import("./newConfiguration-R-olohWo.js"),__vite__mapDeps([17,18,1])),meta:{title:"New Configuration"}},{name:"Restore Configuration",path:"/restore_configuration",component:()=>Qe(()=>import("./restoreConfiguration-DN55Pnc_.js"),__vite__mapDeps([19,1,3,18,20])),meta:{title:"Restore Configuration"}},{name:"Configuration",path:"/configuration/:id",component:()=>Qe(()=>import("./configuration-vZnfxuPU.js"),[]),meta:{title:"Configuration"},children:[{name:"Peers List",path:"peers",component:()=>Qe(()=>import("./peerList-C2NQGcke.js"),__vite__mapDeps([21,1,3,22]))},{name:"Peers Create",path:"create",component:()=>Qe(()=>import("./peerCreate-B_n86hyd.js"),__vite__mapDeps([23,1,24]))}]}]},{path:"/signin",component:()=>Qe(()=>import("./signin-M3EwqtyC.js"),__vite__mapDeps([25,2,1,3,4,26])),meta:{title:"Sign In",hideTopNav:!0}},{path:"/welcome",component:()=>Qe(()=>import("./setup-DUH8iz4Z.js"),__vite__mapDeps([27,1])),meta:{requiresAuth:!0,title:"Welcome to WGDashboard",hideTopNav:!0}},{path:"/2FASetup",component:()=>Qe(()=>import("./totp-BZU5dK65.js"),__vite__mapDeps([28,29,1])),meta:{requiresAuth:!0,title:"Multi-Factor Authentication Setup",hideTopNav:!0}},{path:"/share",component:()=>Qe(()=>import("./share-BU0DtM5p.js"),__vite__mapDeps([30,29,1,31])),meta:{title:"Share",hideTopNav:!0}}]});ps.beforeEach(async(e,t,n)=>{const s=yy(),r=un();e.meta.title?e.params.id?document.title=e.params.id+" | WGDashboard":document.title=e.meta.title+" | WGDashboard":document.title="WGDashboard",r.ShowNavBar=!1,document.querySelector(".loadingBar").classList.remove("loadingDone"),document.querySelector(".loadingBar").classList.add("loading"),e.meta.requiresAuth?r.getActiveCrossServer()?(await r.getConfiguration(),!s.Configurations&&e.name!=="Configuration List"&&await s.getConfigurations(),n()):dy.getCookie("authToken")&&await by()?(await r.getConfiguration(),!s.Configurations&&e.name!=="Configuration List"&&await s.getConfigurations(),r.Redirect=void 0,n()):(r.Redirect=e,n("/signin"),r.newMessage("WGDashboard","Sign in session ended, please sign in again","warning")):n()});ps.afterEach(()=>{document.querySelector(".loadingBar").classList.remove("loading"),document.querySelector(".loadingBar").classList.add("loadingDone")});const Ff=()=>{let e={"content-type":"application/json"};const n=un().getActiveCrossServer();return n&&(e["wg-dashboard-apikey"]=n.apiKey),e},Hf=e=>{const n=un().getActiveCrossServer();return n?`${n.host}${e}`:`${window.location.protocol}//${(window.location.host+window.location.pathname+e).replace(/\/\//g,"/")}`},jr=async(e,t=void 0,n=void 0)=>{const s=new URLSearchParams(t);await fetch(`${Hf(e)}?${s.toString()}`,{headers:Ff()}).then(r=>{const o=un();if(r.ok)return r.json();if(r.status!==200)throw r.status===401&&o.newMessage("WGDashboard","Sign in session ended, please sign in again","warning"),new Error(r.statusText)}).then(r=>n?n(r):void 0).catch(r=>{console.log(r),ps.push({path:"/signin"})})},hb=async(e,t,n)=>{await fetch(`${Hf(e)}`,{headers:Ff(),method:"POST",body:JSON.stringify(t)}).then(s=>{const r=un();if(s.ok)return s.json();if(s.status!==200)throw s.status===401&&r.newMessage("WGDashboard","Sign in session ended, please sign in again","warning"),new Error(s.statusText)}).then(s=>n?n(s):void 0).catch(s=>{console.log(s),ps.push({path:"/signin"})})};let Tr;const Ay=new Uint8Array(16);function Ty(){if(!Tr&&(Tr=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Tr))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Tr(Ay)}const Re=[];for(let e=0;e<256;++e)Re.push((e+256).toString(16).slice(1));function wy(e,t=0){return Re[e[t+0]]+Re[e[t+1]]+Re[e[t+2]]+Re[e[t+3]]+"-"+Re[e[t+4]]+Re[e[t+5]]+"-"+Re[e[t+6]]+Re[e[t+7]]+"-"+Re[e[t+8]]+Re[e[t+9]]+"-"+Re[e[t+10]]+Re[e[t+11]]+Re[e[t+12]]+Re[e[t+13]]+Re[e[t+14]]+Re[e[t+15]]}const Cy=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),cc={randomUUID:Cy};function uc(e,t,n){if(cc.randomUUID&&!t&&!e)return cc.randomUUID();e=e||{};const s=e.random||(e.rng||Ty)();return s[6]=s[6]&15|64,s[8]=s[8]&63|128,wy(s)}const un=yf("DashboardConfigurationStore",{state:()=>({Redirect:void 0,Configuration:void 0,Messages:[],Peers:{Selecting:!1,RefreshInterval:void 0},CrossServerConfiguration:{Enable:!1,ServerList:{}},ActiveServerConfiguration:void 0,IsElectronApp:!1,ShowNavBar:!1,Locale:void 0}),actions:{initCrossServerConfiguration(){const e=localStorage.getItem("CrossServerConfiguration");localStorage.getItem("ActiveCrossServerConfiguration")!==null&&(this.ActiveServerConfiguration=localStorage.getItem("ActiveCrossServerConfiguration")),e===null?window.localStorage.setItem("CrossServerConfiguration",JSON.stringify(this.CrossServerConfiguration)):this.CrossServerConfiguration=JSON.parse(e)},syncCrossServerConfiguration(){window.localStorage.setItem("CrossServerConfiguration",JSON.stringify(this.CrossServerConfiguration))},addCrossServerConfiguration(){this.CrossServerConfiguration.ServerList[uc().toString()]={host:"",apiKey:"",active:!1}},deleteCrossServerConfiguration(e){delete this.CrossServerConfiguration.ServerList[e]},getActiveCrossServer(){const e=localStorage.getItem("ActiveCrossServerConfiguration");if(e!==null)return this.CrossServerConfiguration.ServerList[e]},setActiveCrossServer(e){this.ActiveServerConfiguration=e,localStorage.setItem("ActiveCrossServerConfiguration",e)},removeActiveCrossServer(){this.ActiveServerConfiguration=void 0,localStorage.removeItem("ActiveCrossServerConfiguration")},async getConfiguration(){await jr("/api/getDashboardConfiguration",{},e=>{e.status&&(this.Configuration=e.data)})},async signOut(){await jr("/api/signout",{},e=>{this.removeActiveCrossServer(),this.$router.go("/signin")})},newMessage(e,t,n){this.Messages.push({id:uc(),from:kt(e),content:kt(t),type:n,show:!0})},applyLocale(e){if(this.Locale===null)return e;const n=Object.keys(this.Locale).filter(s=>e.match(new RegExp("^"+s+"$","g"))!==null);return console.log(n),n.length===0||n.length>1?e:this.Locale[n[0]]}}});/*! SPDX-License-Identifier: GPL-2.0 * * Copyright (C) 2015-2020 Jason A. Donenfeld . All Rights Reserved. */(function(){function e(b){var y=new Float64Array(16);if(b)for(var S=0;S>16&1),T[w-1]&=65535;T[15]=A[15]-32767-(T[14]>>16&1),S=T[15]>>16&1,T[14]&=65535,s(A,T,1-S)}for(var w=0;w<16;++w)b[2*w]=A[w]&255,b[2*w+1]=A[w]>>8}function n(b){for(var y=0;y<16;++y)b[(y+1)%16]+=(y<15?1:38)*Math.floor(b[y]/65536),b[y]&=65535}function s(b,y,S){for(var T,A=~(S-1),w=0;w<16;++w)T=A&(b[w]^y[w]),b[w]^=T,y[w]^=T}function r(b,y,S){for(var T=0;T<16;++T)b[T]=y[T]+S[T]|0}function o(b,y,S){for(var T=0;T<16;++T)b[T]=y[T]-S[T]|0}function a(b,y,S){for(var T=new Float64Array(31),A=0;A<16;++A)for(var w=0;w<16;++w)T[A+w]+=y[A]*S[w];for(var A=0;A<15;++A)T[A]+=38*T[A+16];for(var A=0;A<16;++A)b[A]=T[A];n(b),n(b)}function l(b,y){for(var S=e(),T=0;T<16;++T)S[T]=y[T];for(var T=253;T>=0;--T)a(S,S,S),T!==2&&T!==4&&a(S,S,y);for(var T=0;T<16;++T)b[T]=S[T]}function c(b){b[31]=b[31]&127|64,b[0]&=248}function d(b){for(var y,S=new Uint8Array(32),T=e([1]),A=e([9]),w=e(),j=e([1]),B=e(),Q=e(),oe=e([56129,1]),he=e([9]),te=0;te<32;++te)S[te]=b[te];c(S);for(var te=254;te>=0;--te)y=S[te>>>3]>>>(te&7)&1,s(T,A,y),s(w,j,y),r(B,T,w),o(T,T,w),r(w,A,j),o(A,A,j),a(j,B,B),a(Q,T,T),a(T,w,T),a(w,A,B),r(B,T,w),o(T,T,w),a(A,T,T),o(w,j,Q),a(T,w,oe),r(T,T,j),a(w,w,T),a(T,j,Q),a(j,A,he),a(A,B,B),s(T,A,y),s(w,j,y);return l(w,w),a(T,T,w),t(S,T),S}function f(){var b=new Uint8Array(32);return window.crypto.getRandomValues(b),b}function h(){var b=f();return c(b),b}function p(b,y){for(var S=Uint8Array.from([y[0]>>2&63,(y[0]<<4|y[1]>>4)&63,(y[1]<<2|y[2]>>6)&63,y[2]&63]),T=0;T<4;++T)b[T]=S[T]+65+(25-S[T]>>8&6)-(51-S[T]>>8&75)-(61-S[T]>>8&15)+(62-S[T]>>8&3)}function E(b){var y,S=new Uint8Array(44);for(y=0;y<32/3;++y)p(S.subarray(y*4),b.subarray(y*3));return p(S.subarray(y*4),Uint8Array.from([b[y*3+0],b[y*3+1],0])),S[43]=61,String.fromCharCode.apply(null,S)}function x(b){let y=window.atob(b),S=y.length,T=new Uint8Array(S);for(let w=0;w>>8&255,y>>>16&255,y>>>24&255)}function D(b,y){b.push(y&255,y>>>8&255)}function P(b,y){for(var S=0;S>>1:y>>>1;k.table[S]=y}}for(var A=-1,w=0;w>>8^k.table[(A^b[w])&255];return(A^-1)>>>0}function M(b){for(var y=[],S=[],T=0,A=0;A{const n=e.__vccOpts||e;for(const[s,r]of t)n[s]=r;return n},Oy={key:0,class:"navbar bg-dark sticky-top","data-bs-theme":"dark"},xy={class:"container-fluid d-flex text-body align-items-center"},Ny={key:0,class:"bi bi-list"},$y={key:1,class:"bi bi-x-lg"},Dy={__name:"App",setup(e){const t=un();t.initCrossServerConfiguration(),window.IS_WGDASHBOARD_DESKTOP&&(t.IsElectronApp=!0,t.CrossServerConfiguration.Enable=!0),Jn(t.CrossServerConfiguration,()=>{t.syncCrossServerConfiguration()},{deep:!0});const n=cy();return(s,r)=>{const o=__("RouterLink");return Ct(),br(Ve,null,[r[2]||(r[2]=Gn("div",{style:{"z-index":"9999",height:"5px"},class:"position-absolute loadingBar top-0 start-0"},null,-1)),vt(n).meta.hideTopNav?iv("",!0):(Ct(),br("nav",Oy,[Gn("div",xy,[ye(o,{to:"/",class:"navbar-brand mb-0 h1"},{default:Un(()=>r[1]||(r[1]=[Gn("img",{src:oE,alt:"WGDashboard Logo",style:{width:"32px"}},null,-1)])),_:1}),Gn("a",{role:"button",class:"navbarBtn text-body",onClick:r[0]||(r[0]=a=>vt(t).ShowNavBar=!vt(t).ShowNavBar),style:{"line-height":"0","font-size":"2rem"}},[ye(Al,{name:"fade2",mode:"out-in"},{default:Un(()=>[vt(t).ShowNavBar?(Ct(),br("i",$y)):(Ct(),br("i",Ny))]),_:1})])])])),(Ct(),js(z_,null,{default:Un(()=>[ye(vt(Rf),null,{default:Un(({Component:a})=>[ye(Al,{name:"app",mode:"out-in",type:"transition",appear:""},{default:Un(()=>[(Ct(),js(v_(a)))]),_:2},1024)]),_:1})]),_:1}))],64)}}},Ly=Sy(Dy,[["__scopeId","data-v-7966f302"]]);let co;await fetch("/api/locale").then(e=>e.json()).then(e=>co=e.data).catch(()=>{co=null});const Zo=Xv(Ly);Zo.use(ps);const Bf=eE();Bf.use(({store:e})=>{e.$router=Zr(ps)});Zo.use(Bf);const Ry=un();Ry.Locale=co;Zo.mount("#app");export{cy as $,ub as A,vt as B,Gs as C,un as D,Jn as E,Ve as F,kt as G,db as H,Yc as I,Tm as J,Fo as K,cu as L,zo as M,gv as N,jo as O,fe as P,ei as Q,Po as R,z_ as S,Al as T,Zy as U,Qe as V,yy as W,lb as X,vg as Y,Gy as Z,Sy as _,Ct as a,Jy as a0,sb as a1,zy as a2,tb as a3,nb as a4,qy as a5,sv as a6,ov as a7,Te as a8,Qy as a9,cb as aa,fb as ab,rb as ac,d_ as ad,ib as ae,Gn as b,br as c,ye as d,iv as e,rv as f,jr as g,eb as h,js as i,__ as j,ab as k,v_ as l,Xy as m,Xr as n,Bo as o,uc as p,hb as q,Cn as r,Vl as s,Am as t,ob as u,jv as v,Un as w,lt as x,Wv as y,zr as z}; diff --git a/src/static/app/dist/assets/localeText-DX813vQA.js b/src/static/app/dist/assets/localeText-CaAXeE0W.js similarity index 72% rename from src/static/app/dist/assets/localeText-DX813vQA.js rename to src/static/app/dist/assets/localeText-CaAXeE0W.js index 26dfda1..48972bc 100644 --- a/src/static/app/dist/assets/localeText-DX813vQA.js +++ b/src/static/app/dist/assets/localeText-CaAXeE0W.js @@ -1 +1 @@ -import{_ as t,G as e,t as o}from"./index-BPNEscAR.js";const s={name:"localeText",props:{t:""},computed:{getLocaleText(){return e(this.t)}}};function a(c,r,n,p,_,i){return o(this.getLocaleText)}const x=t(s,[["render",a]]);export{x as L}; +import{_ as t,G as e,t as o}from"./index-DOaPWS1X.js";const s={name:"localeText",props:{t:""},computed:{getLocaleText(){return e(this.t)}}};function a(c,r,n,p,_,i){return o(this.getLocaleText)}const x=t(s,[["render",a]]);export{x as L}; diff --git a/src/static/app/dist/assets/message-Cw7_G39b.js b/src/static/app/dist/assets/message-ChztDIV3.js similarity index 81% rename from src/static/app/dist/assets/message-Cw7_G39b.js rename to src/static/app/dist/assets/message-ChztDIV3.js index 4760f92..3d80d4d 100644 --- a/src/static/app/dist/assets/message-Cw7_G39b.js +++ b/src/static/app/dist/assets/message-ChztDIV3.js @@ -1 +1 @@ -import{L as c}from"./localeText-DX813vQA.js";import{d as n}from"./dayjs.min-Lw24H7b2.js";import{_ as d,a as r,c as m,b as s,d as i,f as t,t as e,n as l,j as _}from"./index-BPNEscAR.js";const p={name:"message",methods:{dayjs:n},components:{LocaleText:c},props:{message:Object},mounted(){setTimeout(()=>{this.message.show=!1},5e3)}},g=["id"],h={class:"card-body"},f={class:"d-flex"},x={class:"fw-bold d-block",style:{"text-transform":"uppercase"}},u={class:"ms-auto"};function b(y,v,w,T,j,a){const o=_("LocaleText");return r(),m("div",{class:l(["card shadow rounded-3 position-relative message ms-auto",{"text-bg-danger":this.message.type==="danger","text-bg-success":this.message.type==="success","text-bg-warning":this.message.type==="warning"}]),id:this.message.id},[s("div",h,[s("div",f,[s("small",x,[i(o,{t:"FROM "}),t(" "+e(this.message.from),1)]),s("small",u,e(a.dayjs().format("hh:mm A")),1)]),t(" "+e(this.message.content),1)])],10,g)}const M=d(p,[["render",b],["__scopeId","data-v-f50b8f0c"]]);export{M}; +import{L as c}from"./localeText-CaAXeE0W.js";import{d as n}from"./dayjs.min-D8jwq_wn.js";import{_ as d,a as r,c as m,b as s,d as i,f as t,t as e,n as l,j as _}from"./index-DOaPWS1X.js";const p={name:"message",methods:{dayjs:n},components:{LocaleText:c},props:{message:Object},mounted(){setTimeout(()=>{this.message.show=!1},5e3)}},g=["id"],h={class:"card-body"},f={class:"d-flex"},x={class:"fw-bold d-block",style:{"text-transform":"uppercase"}},u={class:"ms-auto"};function b(y,v,w,T,j,a){const o=_("LocaleText");return r(),m("div",{class:l(["card shadow rounded-3 position-relative message ms-auto",{"text-bg-danger":this.message.type==="danger","text-bg-success":this.message.type==="success","text-bg-warning":this.message.type==="warning"}]),id:this.message.id},[s("div",h,[s("div",f,[s("small",x,[i(o,{t:"FROM "}),t(" "+e(this.message.from),1)]),s("small",u,e(a.dayjs().format("hh:mm A")),1)]),t(" "+e(this.message.content),1)])],10,g)}const M=d(p,[["render",b],["__scopeId","data-v-f50b8f0c"]]);export{M}; diff --git a/src/static/app/dist/assets/newConfiguration-Ccc7iqeY.js b/src/static/app/dist/assets/newConfiguration-R-olohWo.js similarity index 98% rename from src/static/app/dist/assets/newConfiguration-Ccc7iqeY.js rename to src/static/app/dist/assets/newConfiguration-R-olohWo.js index 96b6d0c..69bcf07 100644 --- a/src/static/app/dist/assets/newConfiguration-Ccc7iqeY.js +++ b/src/static/app/dist/assets/newConfiguration-R-olohWo.js @@ -1 +1 @@ -import{p as b}from"./index-L60y6kc9.js";import{_ as y,W as _,q as w,c as d,b as s,d as o,w as C,m as l,s as u,t as c,f as g,j as m,a as r}from"./index-BPNEscAR.js";import{L as P}from"./localeText-DX813vQA.js";const x={name:"newConfiguration",components:{LocaleText:P},setup(){return{store:_()}},data(){return{newConfiguration:{ConfigurationName:"",Address:"",ListenPort:"",PrivateKey:"",PublicKey:"",PresharedKey:"",PreUp:"",PreDown:"",PostUp:"",PostDown:""},numberOfAvailableIPs:"0",error:!1,errorMessage:"",success:!1,loading:!1}},created(){this.wireguardGenerateKeypair()},methods:{wireguardGenerateKeypair(){const t=window.wireguard.generateKeypair();this.newConfiguration.PrivateKey=t.privateKey,this.newConfiguration.PublicKey=t.publicKey,this.newConfiguration.PresharedKey=t.presharedKey},async saveNewConfiguration(){this.goodToSubmit&&(this.loading=!0,await w("/api/addWireguardConfiguration",this.newConfiguration,async t=>{t.status?(this.success=!0,await this.store.getConfigurations(),this.$router.push(`/configuration/${this.newConfiguration.ConfigurationName}/peers`)):(this.error=!0,this.errorMessage=t.message,document.querySelector(`#${t.data}`).classList.remove("is-valid"),document.querySelector(`#${t.data}`).classList.add("is-invalid"),this.loading=!1)}))}},computed:{goodToSubmit(){let t=["ConfigurationName","Address","ListenPort","PrivateKey"],e=[...document.querySelectorAll("input[required]")];return t.find(a=>this.newConfiguration[a].length===0)===void 0&&e.find(a=>a.classList.contains("is-invalid"))===void 0}},watch:{"newConfiguration.Address"(t){let e=document.querySelector("#Address");e.classList.remove("is-invalid","is-valid");try{if(t.trim().split("/").filter(f=>f.length>0).length!==2)throw Error();let a=b(t),p=a.end-a.start;this.numberOfAvailableIPs=p.toLocaleString(),e.classList.add("is-valid")}catch{this.numberOfAvailableIPs="0",e.classList.add("is-invalid")}},"newConfiguration.ListenPort"(t){let e=document.querySelector("#ListenPort");e.classList.remove("is-invalid","is-valid"),t<0||t>65353||!Number.isInteger(t)?e.classList.add("is-invalid"):e.classList.add("is-valid")},"newConfiguration.ConfigurationName"(t){let e=document.querySelector("#ConfigurationName");e.classList.remove("is-invalid","is-valid"),!/^[a-zA-Z0-9_=+.-]{1,15}$/.test(t)||t.length===0||this.store.Configurations.find(a=>a.Name===t)?e.classList.add("is-invalid"):e.classList.add("is-valid")},"newConfiguration.PrivateKey"(t){let e=document.querySelector("#PrivateKey");e.classList.remove("is-invalid","is-valid");try{wireguard.generatePublicKey(t),e.classList.add("is-valid")}catch{e.classList.add("is-invalid")}}}},L={class:"mt-md-5 mt-3 text-body"},K={class:"container mb-4"},k={class:"mb-4 d-flex align-items-center gap-4"},A={class:"mb-0"},U={class:"card rounded-3 shadow"},S={class:"card-header"},N={class:"card-body"},q=["disabled"],D={class:"invalid-feedback"},I={key:0},O={key:1},T={class:"mb-0"},$={class:"card rounded-3 shadow"},V={class:"card-header"},M={class:"card-body",style:{"font-family":"var(--bs-font-monospace)"}},R={class:"mb-2"},B={class:"text-muted fw-bold mb-1"},E={class:"input-group"},G=["disabled"],W={class:"text-muted fw-bold mb-1"},j={class:"card rounded-3 shadow"},z={class:"card-header"},Z={class:"card-body"},F=["disabled"],H={class:"invalid-feedback"},J={key:0},Q={key:1},X={class:"card rounded-3 shadow"},Y={class:"card-header d-flex align-items-center"},ss={class:"badge rounded-pill text-bg-success ms-auto"},es={class:"card-body"},ts=["disabled"],is={class:"invalid-feedback"},os={key:0},ns={key:1},as={class:"accordion",id:"newConfigurationOptionalAccordion"},ds={class:"accordion-item"},rs={class:"accordion-header"},ls={class:"accordion-button collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#newConfigurationOptionalAccordionCollapse"},us={id:"newConfigurationOptionalAccordionCollapse",class:"accordion-collapse collapse","data-bs-parent":"#newConfigurationOptionalAccordion"},cs={class:"accordion-body d-flex flex-column gap-3"},fs={class:"card rounded-3"},ps={class:"card-body"},gs={class:"card rounded-3"},ms={class:"card-body"},hs={class:"card rounded-3"},vs={class:"card-body"},bs={class:"card rounded-3"},ys={class:"card-body"},_s=["disabled"],ws={key:0,class:"d-flex w-100"},Cs={key:1,class:"d-flex w-100"},Ps={key:2,class:"d-flex w-100 align-items-center"};function xs(t,e,a,p,f,h){const v=m("RouterLink"),n=m("LocaleText");return r(),d("div",L,[s("div",K,[s("div",k,[o(v,{to:"/",class:"btn btn-dark btn-brand p-2 shadow",style:{"border-radius":"100%"}},{default:C(()=>e[11]||(e[11]=[s("h2",{class:"mb-0",style:{"line-height":"0"}},[s("i",{class:"bi bi-arrow-left-circle"})],-1)])),_:1}),s("h2",A,[o(n,{t:"New Configuration"})])]),s("form",{class:"text-body d-flex flex-column gap-3",onSubmit:e[10]||(e[10]=i=>{i.preventDefault(),this.saveNewConfiguration()})},[s("div",U,[s("div",S,[o(n,{t:"Configuration Name"})]),s("div",N,[l(s("input",{type:"text",class:"form-control",placeholder:"ex. wg1",id:"ConfigurationName","onUpdate:modelValue":e[0]||(e[0]=i=>this.newConfiguration.ConfigurationName=i),disabled:this.loading,required:""},null,8,q),[[u,this.newConfiguration.ConfigurationName]]),s("div",D,[this.error?(r(),d("div",I,c(this.errorMessage),1)):(r(),d("div",O,[o(n,{t:"Configuration name is invalid. Possible reasons:"}),s("ul",T,[s("li",null,[o(n,{t:"Configuration name already exist."})]),s("li",null,[o(n,{t:"Configuration name can only contain 15 lower/uppercase alphabet, numbers, underscore, equal sign, plus sign, period and hyphen."})])])]))])])]),s("div",$,[s("div",V,[o(n,{t:"Private Key"}),e[12]||(e[12]=g(" & ")),o(n,{t:"Public Key"})]),s("div",M,[s("div",R,[s("label",B,[s("small",null,[o(n,{t:"Private Key"})])]),s("div",E,[l(s("input",{type:"text",class:"form-control",id:"PrivateKey",required:"",disabled:this.loading,"onUpdate:modelValue":e[1]||(e[1]=i=>this.newConfiguration.PrivateKey=i)},null,8,G),[[u,this.newConfiguration.PrivateKey]]),s("button",{class:"btn btn-outline-primary",type:"button",title:"Regenerate Private Key",onClick:e[2]||(e[2]=i=>h.wireguardGenerateKeypair())},e[13]||(e[13]=[s("i",{class:"bi bi-arrow-repeat"},null,-1)]))])]),s("div",null,[s("label",W,[s("small",null,[o(n,{t:"Public Key"})])]),l(s("input",{type:"text",class:"form-control",id:"PublicKey","onUpdate:modelValue":e[3]||(e[3]=i=>this.newConfiguration.PublicKey=i),disabled:""},null,512),[[u,this.newConfiguration.PublicKey]])])])]),s("div",j,[s("div",z,[o(n,{t:"Listen Port"})]),s("div",Z,[l(s("input",{type:"number",class:"form-control",placeholder:"0-65353",id:"ListenPort",min:"1",max:"65353","onUpdate:modelValue":e[4]||(e[4]=i=>this.newConfiguration.ListenPort=i),disabled:this.loading,required:""},null,8,F),[[u,this.newConfiguration.ListenPort]]),s("div",H,[this.error?(r(),d("div",J,c(this.errorMessage),1)):(r(),d("div",Q,[o(n,{t:"Invalid port"})]))])])]),s("div",X,[s("div",Y,[o(n,{t:"IP Address/CIDR"}),s("span",ss,c(f.numberOfAvailableIPs)+" Available IPs",1)]),s("div",es,[l(s("input",{type:"text",class:"form-control",placeholder:"Ex: 10.0.0.1/24",id:"Address","onUpdate:modelValue":e[5]||(e[5]=i=>this.newConfiguration.Address=i),disabled:this.loading,required:""},null,8,ts),[[u,this.newConfiguration.Address]]),s("div",is,[this.error?(r(),d("div",os,c(this.errorMessage),1)):(r(),d("div",ns," IP Address/CIDR is invalid "))])])]),e[22]||(e[22]=s("hr",null,null,-1)),s("div",as,[s("div",ds,[s("h2",rs,[s("button",ls,[o(n,{t:"Optional Settings"})])]),s("div",us,[s("div",cs,[s("div",fs,[e[14]||(e[14]=s("div",{class:"card-header"},"PreUp",-1)),s("div",ps,[l(s("input",{type:"text",class:"form-control",id:"preUp","onUpdate:modelValue":e[6]||(e[6]=i=>this.newConfiguration.PreUp=i)},null,512),[[u,this.newConfiguration.PreUp]])])]),s("div",gs,[e[15]||(e[15]=s("div",{class:"card-header"},"PreDown",-1)),s("div",ms,[l(s("input",{type:"text",class:"form-control",id:"preDown","onUpdate:modelValue":e[7]||(e[7]=i=>this.newConfiguration.PreDown=i)},null,512),[[u,this.newConfiguration.PreDown]])])]),s("div",hs,[e[16]||(e[16]=s("div",{class:"card-header"},"PostUp",-1)),s("div",vs,[l(s("input",{type:"text",class:"form-control",id:"postUp","onUpdate:modelValue":e[8]||(e[8]=i=>this.newConfiguration.PostUp=i)},null,512),[[u,this.newConfiguration.PostUp]])])]),s("div",bs,[e[17]||(e[17]=s("div",{class:"card-header"},"PostDown",-1)),s("div",ys,[l(s("input",{type:"text",class:"form-control",id:"postDown","onUpdate:modelValue":e[9]||(e[9]=i=>this.newConfiguration.PostDown=i)},null,512),[[u,this.newConfiguration.PostDown]])])])])])])]),s("button",{class:"btn btn-dark btn-brand rounded-3 px-3 py-2 shadow ms-auto",disabled:!this.goodToSubmit||this.loading||this.success},[this.success?(r(),d("span",ws,[o(n,{t:"Success"}),e[18]||(e[18]=g("! ")),e[19]||(e[19]=s("i",{class:"bi bi-check-circle-fill ms-2"},null,-1))])):this.loading?(r(),d("span",Ps,[o(n,{t:"Saving..."}),e[21]||(e[21]=s("span",{class:"ms-2 spinner-border spinner-border-sm",role:"status"},null,-1))])):(r(),d("span",Cs,[e[20]||(e[20]=s("i",{class:"bi bi-save-fill me-2"},null,-1)),o(n,{t:"Save"})]))],8,_s)],32)])])}const As=y(x,[["render",xs]]);export{As as default}; +import{p as b}from"./index-L60y6kc9.js";import{_ as y,W as _,q as w,c as d,b as s,d as o,w as C,m as l,s as u,t as c,f as g,j as m,a as r}from"./index-DOaPWS1X.js";import{L as P}from"./localeText-CaAXeE0W.js";const x={name:"newConfiguration",components:{LocaleText:P},setup(){return{store:_()}},data(){return{newConfiguration:{ConfigurationName:"",Address:"",ListenPort:"",PrivateKey:"",PublicKey:"",PresharedKey:"",PreUp:"",PreDown:"",PostUp:"",PostDown:""},numberOfAvailableIPs:"0",error:!1,errorMessage:"",success:!1,loading:!1}},created(){this.wireguardGenerateKeypair()},methods:{wireguardGenerateKeypair(){const t=window.wireguard.generateKeypair();this.newConfiguration.PrivateKey=t.privateKey,this.newConfiguration.PublicKey=t.publicKey,this.newConfiguration.PresharedKey=t.presharedKey},async saveNewConfiguration(){this.goodToSubmit&&(this.loading=!0,await w("/api/addWireguardConfiguration",this.newConfiguration,async t=>{t.status?(this.success=!0,await this.store.getConfigurations(),this.$router.push(`/configuration/${this.newConfiguration.ConfigurationName}/peers`)):(this.error=!0,this.errorMessage=t.message,document.querySelector(`#${t.data}`).classList.remove("is-valid"),document.querySelector(`#${t.data}`).classList.add("is-invalid"),this.loading=!1)}))}},computed:{goodToSubmit(){let t=["ConfigurationName","Address","ListenPort","PrivateKey"],e=[...document.querySelectorAll("input[required]")];return t.find(a=>this.newConfiguration[a].length===0)===void 0&&e.find(a=>a.classList.contains("is-invalid"))===void 0}},watch:{"newConfiguration.Address"(t){let e=document.querySelector("#Address");e.classList.remove("is-invalid","is-valid");try{if(t.trim().split("/").filter(f=>f.length>0).length!==2)throw Error();let a=b(t),p=a.end-a.start;this.numberOfAvailableIPs=p.toLocaleString(),e.classList.add("is-valid")}catch{this.numberOfAvailableIPs="0",e.classList.add("is-invalid")}},"newConfiguration.ListenPort"(t){let e=document.querySelector("#ListenPort");e.classList.remove("is-invalid","is-valid"),t<0||t>65353||!Number.isInteger(t)?e.classList.add("is-invalid"):e.classList.add("is-valid")},"newConfiguration.ConfigurationName"(t){let e=document.querySelector("#ConfigurationName");e.classList.remove("is-invalid","is-valid"),!/^[a-zA-Z0-9_=+.-]{1,15}$/.test(t)||t.length===0||this.store.Configurations.find(a=>a.Name===t)?e.classList.add("is-invalid"):e.classList.add("is-valid")},"newConfiguration.PrivateKey"(t){let e=document.querySelector("#PrivateKey");e.classList.remove("is-invalid","is-valid");try{wireguard.generatePublicKey(t),e.classList.add("is-valid")}catch{e.classList.add("is-invalid")}}}},L={class:"mt-md-5 mt-3 text-body"},K={class:"container mb-4"},k={class:"mb-4 d-flex align-items-center gap-4"},A={class:"mb-0"},U={class:"card rounded-3 shadow"},S={class:"card-header"},N={class:"card-body"},q=["disabled"],D={class:"invalid-feedback"},I={key:0},O={key:1},T={class:"mb-0"},$={class:"card rounded-3 shadow"},V={class:"card-header"},M={class:"card-body",style:{"font-family":"var(--bs-font-monospace)"}},R={class:"mb-2"},B={class:"text-muted fw-bold mb-1"},E={class:"input-group"},G=["disabled"],W={class:"text-muted fw-bold mb-1"},j={class:"card rounded-3 shadow"},z={class:"card-header"},Z={class:"card-body"},F=["disabled"],H={class:"invalid-feedback"},J={key:0},Q={key:1},X={class:"card rounded-3 shadow"},Y={class:"card-header d-flex align-items-center"},ss={class:"badge rounded-pill text-bg-success ms-auto"},es={class:"card-body"},ts=["disabled"],is={class:"invalid-feedback"},os={key:0},ns={key:1},as={class:"accordion",id:"newConfigurationOptionalAccordion"},ds={class:"accordion-item"},rs={class:"accordion-header"},ls={class:"accordion-button collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#newConfigurationOptionalAccordionCollapse"},us={id:"newConfigurationOptionalAccordionCollapse",class:"accordion-collapse collapse","data-bs-parent":"#newConfigurationOptionalAccordion"},cs={class:"accordion-body d-flex flex-column gap-3"},fs={class:"card rounded-3"},ps={class:"card-body"},gs={class:"card rounded-3"},ms={class:"card-body"},hs={class:"card rounded-3"},vs={class:"card-body"},bs={class:"card rounded-3"},ys={class:"card-body"},_s=["disabled"],ws={key:0,class:"d-flex w-100"},Cs={key:1,class:"d-flex w-100"},Ps={key:2,class:"d-flex w-100 align-items-center"};function xs(t,e,a,p,f,h){const v=m("RouterLink"),n=m("LocaleText");return r(),d("div",L,[s("div",K,[s("div",k,[o(v,{to:"/",class:"btn btn-dark btn-brand p-2 shadow",style:{"border-radius":"100%"}},{default:C(()=>e[11]||(e[11]=[s("h2",{class:"mb-0",style:{"line-height":"0"}},[s("i",{class:"bi bi-arrow-left-circle"})],-1)])),_:1}),s("h2",A,[o(n,{t:"New Configuration"})])]),s("form",{class:"text-body d-flex flex-column gap-3",onSubmit:e[10]||(e[10]=i=>{i.preventDefault(),this.saveNewConfiguration()})},[s("div",U,[s("div",S,[o(n,{t:"Configuration Name"})]),s("div",N,[l(s("input",{type:"text",class:"form-control",placeholder:"ex. wg1",id:"ConfigurationName","onUpdate:modelValue":e[0]||(e[0]=i=>this.newConfiguration.ConfigurationName=i),disabled:this.loading,required:""},null,8,q),[[u,this.newConfiguration.ConfigurationName]]),s("div",D,[this.error?(r(),d("div",I,c(this.errorMessage),1)):(r(),d("div",O,[o(n,{t:"Configuration name is invalid. Possible reasons:"}),s("ul",T,[s("li",null,[o(n,{t:"Configuration name already exist."})]),s("li",null,[o(n,{t:"Configuration name can only contain 15 lower/uppercase alphabet, numbers, underscore, equal sign, plus sign, period and hyphen."})])])]))])])]),s("div",$,[s("div",V,[o(n,{t:"Private Key"}),e[12]||(e[12]=g(" & ")),o(n,{t:"Public Key"})]),s("div",M,[s("div",R,[s("label",B,[s("small",null,[o(n,{t:"Private Key"})])]),s("div",E,[l(s("input",{type:"text",class:"form-control",id:"PrivateKey",required:"",disabled:this.loading,"onUpdate:modelValue":e[1]||(e[1]=i=>this.newConfiguration.PrivateKey=i)},null,8,G),[[u,this.newConfiguration.PrivateKey]]),s("button",{class:"btn btn-outline-primary",type:"button",title:"Regenerate Private Key",onClick:e[2]||(e[2]=i=>h.wireguardGenerateKeypair())},e[13]||(e[13]=[s("i",{class:"bi bi-arrow-repeat"},null,-1)]))])]),s("div",null,[s("label",W,[s("small",null,[o(n,{t:"Public Key"})])]),l(s("input",{type:"text",class:"form-control",id:"PublicKey","onUpdate:modelValue":e[3]||(e[3]=i=>this.newConfiguration.PublicKey=i),disabled:""},null,512),[[u,this.newConfiguration.PublicKey]])])])]),s("div",j,[s("div",z,[o(n,{t:"Listen Port"})]),s("div",Z,[l(s("input",{type:"number",class:"form-control",placeholder:"0-65353",id:"ListenPort",min:"1",max:"65353","onUpdate:modelValue":e[4]||(e[4]=i=>this.newConfiguration.ListenPort=i),disabled:this.loading,required:""},null,8,F),[[u,this.newConfiguration.ListenPort]]),s("div",H,[this.error?(r(),d("div",J,c(this.errorMessage),1)):(r(),d("div",Q,[o(n,{t:"Invalid port"})]))])])]),s("div",X,[s("div",Y,[o(n,{t:"IP Address/CIDR"}),s("span",ss,c(f.numberOfAvailableIPs)+" Available IPs",1)]),s("div",es,[l(s("input",{type:"text",class:"form-control",placeholder:"Ex: 10.0.0.1/24",id:"Address","onUpdate:modelValue":e[5]||(e[5]=i=>this.newConfiguration.Address=i),disabled:this.loading,required:""},null,8,ts),[[u,this.newConfiguration.Address]]),s("div",is,[this.error?(r(),d("div",os,c(this.errorMessage),1)):(r(),d("div",ns," IP Address/CIDR is invalid "))])])]),e[22]||(e[22]=s("hr",null,null,-1)),s("div",as,[s("div",ds,[s("h2",rs,[s("button",ls,[o(n,{t:"Optional Settings"})])]),s("div",us,[s("div",cs,[s("div",fs,[e[14]||(e[14]=s("div",{class:"card-header"},"PreUp",-1)),s("div",ps,[l(s("input",{type:"text",class:"form-control",id:"preUp","onUpdate:modelValue":e[6]||(e[6]=i=>this.newConfiguration.PreUp=i)},null,512),[[u,this.newConfiguration.PreUp]])])]),s("div",gs,[e[15]||(e[15]=s("div",{class:"card-header"},"PreDown",-1)),s("div",ms,[l(s("input",{type:"text",class:"form-control",id:"preDown","onUpdate:modelValue":e[7]||(e[7]=i=>this.newConfiguration.PreDown=i)},null,512),[[u,this.newConfiguration.PreDown]])])]),s("div",hs,[e[16]||(e[16]=s("div",{class:"card-header"},"PostUp",-1)),s("div",vs,[l(s("input",{type:"text",class:"form-control",id:"postUp","onUpdate:modelValue":e[8]||(e[8]=i=>this.newConfiguration.PostUp=i)},null,512),[[u,this.newConfiguration.PostUp]])])]),s("div",bs,[e[17]||(e[17]=s("div",{class:"card-header"},"PostDown",-1)),s("div",ys,[l(s("input",{type:"text",class:"form-control",id:"postDown","onUpdate:modelValue":e[9]||(e[9]=i=>this.newConfiguration.PostDown=i)},null,512),[[u,this.newConfiguration.PostDown]])])])])])])]),s("button",{class:"btn btn-dark btn-brand rounded-3 px-3 py-2 shadow ms-auto",disabled:!this.goodToSubmit||this.loading||this.success},[this.success?(r(),d("span",ws,[o(n,{t:"Success"}),e[18]||(e[18]=g("! ")),e[19]||(e[19]=s("i",{class:"bi bi-check-circle-fill ms-2"},null,-1))])):this.loading?(r(),d("span",Ps,[o(n,{t:"Saving..."}),e[21]||(e[21]=s("span",{class:"ms-2 spinner-border spinner-border-sm",role:"status"},null,-1))])):(r(),d("span",Cs,[e[20]||(e[20]=s("i",{class:"bi bi-save-fill me-2"},null,-1)),o(n,{t:"Save"})]))],8,_s)],32)])])}const As=y(x,[["render",xs]]);export{As as default}; diff --git a/src/static/app/dist/assets/osmap-DFqkfaU2.js b/src/static/app/dist/assets/osmap-BRB1j1wE.js similarity index 99% rename from src/static/app/dist/assets/osmap-DFqkfaU2.js rename to src/static/app/dist/assets/osmap-BRB1j1wE.js index c1da38b..687a6d9 100644 --- a/src/static/app/dist/assets/osmap-DFqkfaU2.js +++ b/src/static/app/dist/assets/osmap-BRB1j1wE.js @@ -1,4 +1,4 @@ -import{_ as el,D as il,a as nl,c as sl,e as rl}from"./index-BPNEscAR.js";class fe{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}const di={PROPERTYCHANGE:"propertychange"};class Wn{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function ol(n,t,e){let i,s;e=e||ae;let r=0,o=n.length,a=!1;for(;r>1),s=+e(n[i],t),s<0?r=i+1:(o=i,a=!s);return a?r:~r}function ae(n,t){return n>t?1:n0?s-1:s}return i-1}if(e>0){for(let s=1;s0||o===0)})}function Wi(){return!0}function Zn(){return!1}function fi(){}function No(n){let t,e,i;return function(){const s=Array.prototype.slice.call(arguments);return(!e||this!==i||!Ae(s,e))&&(i=this,e=s,t=n.apply(this,arguments)),t}}function hl(n){function t(){let e;try{e=n()}catch(i){return Promise.reject(i)}return e instanceof Promise?e:Promise.resolve(e)}return t()}function nn(n){for(const t in n)delete n[t]}function gi(n){let t;for(t in n)return!1;return!t}class Kn extends Wn{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),s=i[t]||(i[t]=[]);s.includes(e)||s.push(e)}dispatchEvent(t){const e=typeof t=="string",i=e?t:t.type,s=this.listeners_&&this.listeners_[i];if(!s)return;const r=e?new fe(t):t;r.target||(r.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let c=0,h=s.length;c0:!1}removeEventListener(t,e){if(!this.listeners_)return;const i=this.listeners_[t];if(!i)return;const s=i.indexOf(e);s!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[s]=fi,++this.pendingRemovals_[t]):(i.splice(s,1),i.length===0&&delete this.listeners_[t]))}}const z={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function V(n,t,e,i,s){if(s){const o=e;e=function(){n.removeEventListener(t,e),o.apply(i??this,arguments)}}else i&&i!==n&&(e=e.bind(i));const r={target:n,type:t,listener:e};return n.addEventListener(t,e),r}function vn(n,t,e,i){return V(n,t,e,i,!0)}function tt(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),nn(n))}class sn extends Kn{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(z.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,s=new Array(i);for(let r=0;r0;)this.pop()}extend(t){for(let e=0,i=t.length;ethis.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new gn(wt.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let i=0,s=e.length;i=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new gn(wt.REMOVE,e,t)),e}setAt(t,e){const i=this.getLength();if(t>=i){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const s=this.array_[t];this.array_[t]=e,this.dispatchEvent(new gn(wt.REMOVE,s,t)),this.dispatchEvent(new gn(wt.ADD,e,t))}updateLength_(){this.set(Nr.LENGTH,this.array_.length)}assertUnique_(t,e){for(let i=0,s=this.array_.length;i1?(e=s,i=r):l>0&&(e+=o*l,i+=a*l)}return hi(n,t,e,i)}function hi(n,t,e,i){const s=e-n,r=i-t;return s*s+r*r}function fl(n){const t=n.length;for(let i=0;ir&&(r=l,s=a)}if(r===0)return null;const o=n[s];n[s]=n[i],n[i]=o;for(let a=i+1;a=0;i--){e[i]=n[i][t]/n[i][i];for(let s=i-1;s>=0;s--)n[s][t]-=n[s][i]*e[i]}return e}function In(n){return n*Math.PI/180}function ci(n,t){const e=n%t;return e*t<0?e+t:e}function St(n,t,e){return n+e*(t-n)}function Vs(n,t){const e=Math.pow(10,t);return Math.round(n*e)/e}function _n(n,t){return Math.floor(Vs(n,t))}function mn(n,t){return Math.ceil(Vs(n,t))}class Go extends $t{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);typeof t.properties=="object"&&(delete e.properties,Object.assign(e,t.properties)),e[J.OPACITY]=t.opacity!==void 0?t.opacity:1,j(typeof e[J.OPACITY]=="number","Layer opacity must be a number"),e[J.VISIBLE]=t.visible!==void 0?t.visible:!0,e[J.Z_INDEX]=t.zIndex,e[J.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[J.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[J.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[J.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=e.className!==void 0?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:t===void 0?!0:t},i=this.getZIndex();return e.opacity=st(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=i===void 0&&!e.managed?1/0:i,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return U()}getLayerStatesArray(t){return U()}getExtent(){return this.get(J.EXTENT)}getMaxResolution(){return this.get(J.MAX_RESOLUTION)}getMinResolution(){return this.get(J.MIN_RESOLUTION)}getMinZoom(){return this.get(J.MIN_ZOOM)}getMaxZoom(){return this.get(J.MAX_ZOOM)}getOpacity(){return this.get(J.OPACITY)}getSourceState(){return U()}getVisible(){return this.get(J.VISIBLE)}getZIndex(){return this.get(J.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(J.EXTENT,t)}setMaxResolution(t){this.set(J.MAX_RESOLUTION,t)}setMinResolution(t){this.set(J.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(J.MAX_ZOOM,t)}setMinZoom(t){this.set(J.MIN_ZOOM,t)}setOpacity(t){j(typeof t=="number","Layer opacity must be a number"),this.set(J.OPACITY,t)}setVisible(t){this.set(J.VISIBLE,t)}setZIndex(t){this.set(J.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const Ot={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},mt={ANIMATING:0,INTERACTING:1},Nt={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},gl=42,Us=256,js={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class zo{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||js[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const rn=6378137,oi=Math.PI*rn,_l=[-oi,-oi,oi,oi],ml=[-180,-85,180,85],pn=rn*Math.log(Math.tan(Math.PI/2));class je extends zo{constructor(t){super({code:t,units:"m",extent:_l,global:!0,worldExtent:ml,getPointResolution:function(e,i){return e/Math.cosh(i[1]/rn)}})}}const Gr=[new je("EPSG:3857"),new je("EPSG:102100"),new je("EPSG:102113"),new je("EPSG:900913"),new je("http://www.opengis.net/def/crs/EPSG/0/3857"),new je("http://www.opengis.net/gml/srs/epsg.xml#3857")];function pl(n,t,e,i){const s=n.length;e=e>1?e:2,i=i??e,t===void 0&&(e>2?t=n.slice():t=new Array(s));for(let r=0;rpn?o=pn:o<-pn&&(o=-pn),t[r+1]=o}return t}function yl(n,t,e,i){const s=n.length;e=e>1?e:2,i=i??e,t===void 0&&(e>2?t=n.slice():t=new Array(s));for(let r=0;rs&&(l=l|ht.RIGHT),ar&&(l=l|ht.ABOVE),l===ht.UNKNOWN&&(l=ht.INTERSECTING),l}function Ft(){return[1/0,1/0,-1/0,-1/0]}function Se(n,t,e,i,s){return s?(s[0]=n,s[1]=t,s[2]=e,s[3]=i,s):[n,t,e,i]}function Bn(n){return Se(1/0,1/0,-1/0,-1/0,n)}function Yo(n,t){const e=n[0],i=n[1];return Se(e,i,e,i,t)}function $s(n,t,e,i,s){const r=Bn(s);return Zo(r,n,t,e,i)}function Yi(n,t){return n[0]==t[0]&&n[2]==t[2]&&n[1]==t[1]&&n[3]==t[3]}function Tl(n,t){return t[0]n[2]&&(n[2]=t[2]),t[1]n[3]&&(n[3]=t[3]),n}function zi(n,t){t[0]n[2]&&(n[2]=t[0]),t[1]n[3]&&(n[3]=t[1])}function Zo(n,t,e,i,s){for(;et[0]?i[0]=n[0]:i[0]=t[0],n[1]>t[1]?i[1]=n[1]:i[1]=t[1],n[2]=t[0]&&n[1]<=t[3]&&n[3]>=t[1]}function Hn(n){return n[2]=o&&_<=l),!i&&r&ht.RIGHT&&!(s&ht.RIGHT)&&(m=f-(d-l)*g,i=m>=a&&m<=c),!i&&r&ht.BELOW&&!(s&ht.BELOW)&&(_=d-(f-a)/g,i=_>=o&&_<=l),!i&&r&ht.LEFT&&!(s&ht.LEFT)&&(m=f-(d-o)*g,i=m>=a&&m<=c)}return i}function Bo(n,t){const e=t.getExtent(),i=Xe(n);if(t.canWrapX()&&(i[0]=e[2])){const s=q(e),o=Math.floor((i[0]-e[0])/s)*s;n[0]-=o,n[2]-=o}return n}function Js(n,t,e){if(t.canWrapX()){const i=t.getExtent();if(!isFinite(n[0])||!isFinite(n[2]))return[[i[0],n[1],i[2],n[3]]];Bo(n,t);const s=q(i);if(q(n)>s&&!e)return[[i[0],n[1],i[2],n[3]]];if(n[0]i[2])return[[n[0],n[1],i[2],n[3]],[i[0],n[1],n[2]-s,n[3]]]}return[n]}function Ml(n,t){return n[0]+=+t[0],n[1]+=+t[1],n}function Ln(n,t){let e=!0;for(let i=n.length-1;i>=0;--i)if(n[i]!=t[i]){e=!1;break}return e}function Qs(n,t){const e=Math.cos(t),i=Math.sin(t),s=n[0]*e-n[1]*i,r=n[1]*e+n[0]*i;return n[0]=s,n[1]=r,n}function bl(n,t){return n[0]*=t,n[1]*=t,n}function Vo(n,t){if(t.canWrapX()){const e=q(t.getExtent()),i=Dl(n,t,e);i&&(n[0]-=i*e)}return n}function Dl(n,t,e){const i=t.getExtent();let s=0;return t.canWrapX()&&(n[0]i[2])&&(e=e||q(i),s=Math.floor((n[0]-i[0])/e)),s}const Pl=63710088e-1;function Yr(n,t,e){e=e||Pl;const i=In(n[1]),s=In(t[1]),r=(s-i)/2,o=In(t[0]-n[0])/2,a=Math.sin(r)*Math.sin(r)+Math.sin(o)*Math.sin(o)*Math.cos(i)*Math.cos(s);return 2*e*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function Uo(...n){console.warn(...n)}let Os=!0;function jo(n){Os=!1}function tr(n,t){if(t!==void 0){for(let e=0,i=n.length;e=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(Os=!1,Uo("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n}function $o(n,t){return n}function Te(n,t){return n}function Nl(){Kr(Gr),Kr(Xr),kl(Xr,Gr,pl,yl)}Nl();function Br(n,t,e){return function(i,s,r,o,a){if(!i)return;if(!s&&!t)return i;const l=t?0:r[0]*s,c=t?0:r[1]*s,h=a?a[0]:0,u=a?a[1]:0;let d=n[0]+l/2+h,f=n[2]-l/2+h,g=n[1]+c/2+u,_=n[3]-c/2+u;d>f&&(d=(f+d)/2,f=d),g>_&&(g=(_+g)/2,_=g);let m=st(i[0],d,f),p=st(i[1],g,_);if(o&&e&&s){const y=30*s;m+=-y*Math.log(1+Math.max(0,d-i[0])/y)+y*Math.log(1+Math.max(0,i[0]-f)/y),p+=-y*Math.log(1+Math.max(0,g-i[1])/y)+y*Math.log(1+Math.max(0,i[1]-_)/y)}return[m,p]}}function Gl(n){return n}function nr(n,t,e,i){const s=q(t)/e[0],r=pt(t)/e[1];return i?Math.min(n,Math.max(s,r)):Math.min(n,Math.min(s,r))}function sr(n,t,e){let i=Math.min(n,t);const s=50;return i*=Math.log(1+s*Math.max(0,n/t-1))/s+1,e&&(i=Math.max(i,e),i/=Math.log(1+s*Math.max(0,e/n-1))/s+1),st(i,e/2,t*2)}function zl(n,t,e,i){return t=t!==void 0?t:!0,function(s,r,o,a){if(s!==void 0){const l=n[0],c=n[n.length-1],h=e?nr(l,e,o,i):l;if(a)return t?sr(s,h,c):st(s,c,h);const u=Math.min(h,s),d=Math.floor(Bs(n,u,r));return n[d]>h&&dMath.round(e*jr[i])/jr[i]).join(", ")+")"}function ve(n,t,e,i,s,r,o){r=r||[],o=o||2;let a=0;for(let l=t;l{if(!i)return this.getSimplifiedGeometry(e);const s=this.clone();return s.applyTransform(i),s.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return U()}closestPointXY(t,e,i,s){return U()}containsXY(t,e){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return U()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Bn(e),this.extentRevision_=this.getRevision()}return Ll(this.extent_,t)}rotate(t,e){U()}scale(t,e,i){U()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return U()}getType(){return U()}applyTransform(t){U()}intersectsExtent(t){return U()}translate(t,e){U()}transform(t,e){const i=kt(t),s=i.getUnits()=="tile-pixels"?function(r,o,a){const l=i.getExtent(),c=i.getWorldExtent(),h=pt(c)/pt(l);return de(Hr,c[0],c[3],h,-h,0,0,0),ve(r,0,r.length,a,Hr,o),An(i,e)(r,o,a)}:An(i,e);return this.applyTransform(s),this}}class qn extends ql{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return $s(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return U()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length1)u=e;else if(d>0){for(let f=0;fs&&(s=c),r=a,o=l}return s}function Ql(n,t,e,i,s){for(let r=0,o=e.length;r0;){const u=c.pop(),d=c.pop();let f=0;const g=n[d],_=n[d+1],m=n[u],p=n[u+1];for(let y=d+i;yf&&(h=y,f=w)}f>s&&(l[(h-t)/i]=1,d+i0&&_>f)&&(g<0&&m0&&m>g)){c=u,h=d;continue}r[o++]=c,r[o++]=h,a=c,l=h,c=u,h=d}return r[o++]=c,r[o++]=h,o}function ea(n,t,e,i,s,r,o,a){for(let l=0,c=e.length;lr&&(c-a)*(r-l)-(s-a)*(h-l)>0&&o++:h<=r&&(c-a)*(r-l)-(s-a)*(h-l)<0&&o--,a=c,l=h}return o!==0}function na(n,t,e,i,s,r){if(e.length===0||!Ne(n,t,e[0],i,s,r))return!1;for(let o=1,a=e.length;op&&(c=(h+u)/2,na(n,t,e,i,c,g)&&(m=c,p=y)),h=u}return isNaN(m)&&(m=s[r]),o?(o.push(m,g,p),o):[m,g,p]}function ah(n,t,e,i,s){let r=[];for(let o=0,a=e.length;o=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:sa(n,t,e,i,function(o,a){return Al(s,o,a)}):!1}function ra(n,t,e,i,s){return!!(cr(n,t,e,i,s)||Ne(n,t,e,i,s[0],s[1])||Ne(n,t,e,i,s[0],s[3])||Ne(n,t,e,i,s[2],s[1])||Ne(n,t,e,i,s[2],s[3]))}function lh(n,t,e,i,s){if(!ra(n,t,e[0],i,s))return!1;if(e.length===1)return!0;for(let r=1,o=e.length;r0}function ch(n,t,e,i,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r1&&typeof arguments[e-1]=="function"&&(i=arguments[e-1],--e);let s=0;for(;s0}getInteracting(){return this.hints_[mt.INTERACTING]>0}cancelAnimations(){this.setHint(mt.ANIMATING,-this.hints_[mt.ANIMATING]);let t;for(let e=0,i=this.animations_.length;e=0;--i){const s=this.animations_[i];let r=!0;for(let o=0,a=s.length;o0?c/l.duration:1;h>=1?(l.complete=!0,h=1):r=!1;const u=l.easing(h);if(l.sourceCenter){const d=l.sourceCenter[0],f=l.sourceCenter[1],g=l.targetCenter[0],_=l.targetCenter[1];this.nextCenter_=l.targetCenter;const m=d+u*(g-d),p=f+u*(_-f);this.targetCenter_=[m,p]}if(l.sourceResolution&&l.targetResolution){const d=u===1?l.targetResolution:l.sourceResolution+u*(l.targetResolution-l.sourceResolution);if(l.anchor){const f=this.getViewportSize_(this.getRotation()),g=this.constraints_.resolution(d,0,f,!0);this.targetCenter_=this.calculateCenterZoom(g,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const d=u===1?ci(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+u*(l.targetRotation-l.sourceRotation);if(l.anchor){const f=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(f,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),e=!0,!l.complete)break}if(r){this.animations_[i]=null,this.setHint(mt.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=s[0].callback;o&&yn(o,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i;const s=this.getCenterInternal();return s!==void 0&&(i=[s[0]-e[0],s[1]-e[1]],Qs(i,t-this.getRotation()),Ml(i,e)),i}calculateCenterZoom(t,e){let i;const s=this.getCenterInternal(),r=this.getResolution();if(s!==void 0&&r!==void 0){const o=e[0]-t*(e[0]-s[0])/r,a=e[1]-t*(e[1]-s[1])/r;i=[o,a]}return i}getViewportSize_(t){const e=this.viewportSize_;if(t){const i=e[0],s=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(s*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(s*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&Fs(t,this.getProjection())}getCenterInternal(){return this.get(Nt.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return $o(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();j(e,"The view center is not defined");const i=this.getResolution();j(i!==void 0,"The view resolution is not defined");const s=this.getRotation();return j(s!==void 0,"The view rotation is not defined"),Ps(e,i,s,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(Nt.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(Te(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const i=q(t)/e[0],s=pt(t)/e[1];return Math.max(i,s)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,s=Math.log(e/i)/Math.log(t);return function(r){return e/Math.pow(t,r*s)}}getRotation(){return this.get(Nt.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),s=this.minResolution_,r=Math.log(i/s)/e;return function(o){return Math.log(i/o)/e/r}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),i=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const o=this.getViewportSizeMinusPadding_();s=gs(s,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],e,i)}return{center:s.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,i,s;if(this.resolutions_){const r=Bs(this.resolutions_,t,1);e=r,i=this.resolutions_[r],r==this.resolutions_.length-1?s=2:s=i/this.resolutions_[r+1]}else i=this.maxResolution_,s=this.zoomFactor_;return e+Math.log(i/t)/Math.log(s)}getResolutionForZoom(t){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];const e=st(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,st(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if(j(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){j(!Hn(t),"Cannot fit empty extent provided as `geometry`");const s=Te(t,this.getProjection());i=to(s)}else if(t.getType()==="Circle"){const s=Te(t.getExtent(),this.getProjection());i=to(s),i.rotate(this.getRotation(),Xe(s))}else i=t;this.fitInternal(i,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),i=Math.cos(e),s=Math.sin(-e),r=t.getFlatCoordinates(),o=t.getStride();let a=1/0,l=1/0,c=-1/0,h=-1/0;for(let u=0,d=r.length;u{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e;const i=this.getMapInternal();!t&&i&&(t=i.getView()),t instanceof Vt?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let s;e.layerStatesArray?s=e.layerStatesArray.find(o=>o.layer===this):s=this.getLayerState();const r=this.getExtent();return dr(s,e.viewState)&&(!r||Tt(r,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];const e=this.getSource()?.getAttributions();if(!e)return[];const i=t instanceof Vt?t.getViewStateAndExtent():t;let s=e(i);return Array.isArray(s)||(s=[s]),s}render(t,e){const i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(J.MAP,t)}getMapInternal(){return this.get(J.MAP)}setMap(t){this.mapPrecomposeKey_&&(tt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(tt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=V(t,Ot.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=V(this,z.CHANGE,t.render,t),this.changed())}handlePrecompose_(t){const e=t.frameState.layerStatesArray,i=this.getLayerState(!1);j(!e.some(s=>s.layer===i.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(i)}setSource(t){this.set(J.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function dr(n,t){if(!n.visible)return!1;const e=t.resolution;if(e=n.maxResolution)return!1;const i=t.zoom;return i>n.minZoom&&i<=n.maxZoom}function oa(n,t,e=0,i=n.length-1,s=mh){for(;i>e;){if(i-e>600){const l=i-e+1,c=t-e+1,h=Math.log(l),u=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),f=Math.max(e,Math.floor(t-c*u/l+d)),g=Math.min(i,Math.floor(t+(l-c)*u/l+d));oa(n,t,f,g,s)}const r=n[t];let o=e,a=i;for(Ai(n,e,t),s(n[i],r)>0&&Ai(n,e,i);o0;)a--}s(n[e],r)===0?Ai(n,e,a):(a++,Ai(n,a,i)),a<=t&&(e=a+1),t<=a&&(i=a-1)}}function Ai(n,t,e){const i=n[t];n[t]=n[e],n[e]=i}function mh(n,t){return nt?1:0}let aa=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!xn(t,e))return i;const s=this.toBBox,r=[];for(;e;){for(let o=0;o=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)}_split(t,e){const i=t[e],s=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,s);const o=this._chooseSplitIndex(i,r,s),a=ii(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,He(i,this.toBBox),He(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=ii([t,e]),this.data.height=t.height+1,this.data.leaf=!1,He(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let s,r=1/0,o=1/0;for(let a=e;a<=i-e;a++){const l=Pi(t,0,a,this.toBBox),c=Pi(t,a,i,this.toBBox),h=wh(l,c),u=_s(l)+_s(c);h=e;c--){const h=t.children[c];Oi(a,t.leaf?r(h):h),l+=En(a)}return l}_adjustParentBBoxes(t,e,i){for(let s=i;s>=0;s--)Oi(e[s],t)}_condense(t){for(let e=t.length-1,i;e>=0;e--)t[e].children.length===0?e>0?(i=t[e-1].children,i.splice(i.indexOf(t[e]),1)):this.clear():He(t[e],this.toBBox)}};function ph(n,t,e){if(!e)return t.indexOf(n);for(let i=0;i=n.minX&&t.maxY>=n.minY}function ii(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function eo(n,t,e,i,s){const r=[t,e];for(;r.length;){if(e=r.pop(),t=r.pop(),e-t<=i)continue;const o=t+Math.ceil((e-t)/i/2)*i;oa(n,o,t,e,s),r.push(t,o,o,e)}}const Y={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function io(n){return n[0]>0&&n[1]>0}function Ch(n,t,e){return e===void 0&&(e=[0,0]),e[0]=n[0]*t+.5|0,e[1]=n[1]*t+.5|0,e}function vt(n,t){return Array.isArray(n)?n:(t===void 0?t=[n,n]:(t[0]=n,t[1]=n),t)}class Qn{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=vt(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new Qn({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return U()}getImage(t){return U()}getHitDetectionImage(){return U()}getPixelRatio(t){return 1}getImageState(){return U()}getImageSize(){return U()}getOrigin(){return U()}getSize(){return U()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=vt(t)}listenImageChange(t){U()}load(){U()}unlistenImageChange(t){U()}ready(){return Promise.resolve()}}const Ui={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var ft={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};ft.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}};ft.max=ft.whitepoint[2].D65;ft.rgb=function(n,t){t=t||ft.whitepoint[2].E;var e=n[0]/t[0],i=n[1]/t[1],s=n[2]/t[2],r,o,a;return r=e*3.240969941904521+i*-1.537383177570093+s*-.498610760293,o=e*-.96924363628087+i*1.87596750150772+s*.041555057407175,a=e*.055630079696993+i*-.20397695888897+s*1.056971514242878,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r=r*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[r*255,o*255,a*255]};Ui.xyz=function(n,t){var e=n[0]/255,i=n[1]/255,s=n[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var r=e*.41239079926595+i*.35758433938387+s*.18048078840183,o=e*.21263900587151+i*.71516867876775+s*.072192315360733,a=e*.019330818715591+i*.11919477979462+s*.95053215224966;return t=t||ft.whitepoint[2].E,[r*t[0],o*t[1],a*t[2]]};const fr={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(n,t,e){var i,s,r,o,a,l,c,h,u,d,f,g,_;if(r=n[0],o=n[1],a=n[2],r===0)return[0,0,0];var m=.0011070564598794539;return t=t||"D65",e=e||2,u=ft.whitepoint[e][t][0],d=ft.whitepoint[e][t][1],f=ft.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),i=o/(13*r)+g||0,s=a/(13*r)+_||0,c=r>8?d*Math.pow((r+16)/116,3):d*r*m,l=c*9*i/(4*s)||0,h=c*(12-3*i-20*s)/(4*s)||0,[l,c,h]}};ft.luv=function(n,t,e){var i,s,r,o,a,l,c,h,u,d,f,g,_,m=.008856451679035631,p=903.2962962962961;t=t||"D65",e=e||2,u=ft.whitepoint[e][t][0],d=ft.whitepoint[e][t][1],f=ft.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),l=n[0],c=n[1],h=n[2],i=4*l/(l+15*c+3*h)||0,s=9*c/(l+15*c+3*h)||0;var y=c/d;return r=y<=m?p*y:116*Math.pow(y,1/3)-16,o=13*r*(i-g),a=13*r*(s-_),[r,o,a]};var la={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(n){var t=n[0],e=n[1],i=n[2],s,r,o;return o=i/360*2*Math.PI,s=e*Math.cos(o),r=e*Math.sin(o),[t,s,r]},xyz:function(n){return fr.xyz(la.luv(n))}};fr.lchuv=function(n){var t=n[0],e=n[1],i=n[2],s=Math.sqrt(e*e+i*i),r=Math.atan2(i,e),o=r*360/2/Math.PI;return o<0&&(o+=360),[t,s,o]};ft.lchuv=function(n){return fr.lchuv(ft.luv(n))};const no={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var so={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Rh(n){var t,e=[],i=1,s;if(typeof n=="number")return{space:"rgb",values:[n>>>16,(n&65280)>>>8,n&255],alpha:1};if(typeof n=="number")return{space:"rgb",values:[n>>>16,(n&65280)>>>8,n&255],alpha:1};if(n=String(n).toLowerCase(),no[n])e=no[n].slice(),s="rgb";else if(n==="transparent")i=0,s="rgb",e=[0,0,0];else if(n[0]==="#"){var r=n.slice(1),o=r.length,a=o<=4;i=1,a?(e=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],o===4&&(i=parseInt(r[3]+r[3],16)/255)):(e=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],o===8&&(i=parseInt(r[6]+r[7],16)/255)),e[0]||(e[0]=0),e[1]||(e[1]=0),e[2]||(e[2]=0),s="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(n)){var l=t[1];s=l.replace(/a$/,"");var c=s==="cmyk"?4:s==="gray"?1:3;e=t[2].trim().split(/\s*[,\/]\s*|\s+/),s==="color"&&(s=e.shift()),e=e.map(function(h,u){if(h[h.length-1]==="%")return h=parseFloat(h)/100,u===3?h:s==="rgb"?h*255:s[0]==="h"||s[0]==="l"&&!u?h*100:s==="lab"?h*125:s==="lch"?u<2?h*150:h*360:s[0]==="o"&&!u?h:s==="oklab"?h*.4:s==="oklch"?u<2?h*.4:h*360:h;if(s[u]==="h"||u===2&&s[s.length-1]==="h"){if(so[h]!==void 0)return so[h];if(h.endsWith("deg"))return parseFloat(h);if(h.endsWith("turn"))return parseFloat(h)*360;if(h.endsWith("grad"))return parseFloat(h)*360/400;if(h.endsWith("rad"))return parseFloat(h)*180/Math.PI}return h==="none"?0:parseFloat(h)}),i=e.length>c?e.pop():1}else/[0-9](?:\s|\/|,)/.test(n)&&(e=n.match(/([0-9]+)/g).map(function(h){return parseFloat(h)}),s=n.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:s,values:e,alpha:i}}const ps={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(n){var t=n[0]/360,e=n[1]/100,i=n[2]/100,s,r,o,a,l,c=0;if(e===0)return l=i*255,[l,l,l];for(r=i<.5?i*(1+e):i+e-i*e,s=2*i-r,a=[0,0,0];c<3;)o=t+1/3*-(c-1),o<0?o++:o>1&&o--,l=6*o<1?s+(r-s)*6*o:2*o<1?r:3*o<2?s+(r-s)*(2/3-o)*6:s,a[c++]=l*255;return a}};Ui.hsl=function(n){var t=n[0]/255,e=n[1]/255,i=n[2]/255,s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a,l,c;return r===s?a=0:t===r?a=(e-i)/o:e===r?a=2+(i-t)/o:i===r&&(a=4+(t-e)/o),a=Math.min(a*60,360),a<0&&(a+=360),c=(s+r)/2,r===s?l=0:c<=.5?l=o/(r+s):l=o/(2-r-s),[a,l*100,c*100]};function Th(n){Array.isArray(n)&&n.raw&&(n=String.raw(...arguments)),n instanceof Number&&(n=+n);var t,e=Rh(n);if(!e.space)return[];const i=e.space[0]==="h"?ps.min:Ui.min,s=e.space[0]==="h"?ps.max:Ui.max;return t=Array(3),t[0]=Math.min(Math.max(e.values[0],i[0]),s[0]),t[1]=Math.min(Math.max(e.values[1],i[1]),s[1]),t[2]=Math.min(Math.max(e.values[2],i[2]),s[2]),e.space[0]==="h"&&(t=ps.rgb(t)),t.push(Math.min(Math.max(e.alpha,0),1)),t}const gr=[NaN,NaN,NaN,0];function Ih(n){return typeof n=="string"?n:mr(n)}const vh=1024,Mi={};let ys=0;function Sh(n){if(n.length===4)return n;const t=n.slice();return t[3]=1,t}function ro(n){const t=ft.lchuv(Ui.xyz(n));return t[3]=n[3],t}function Lh(n){const t=ft.rgb(la.xyz(n));return t[3]=n[3],t}function _r(n){if(n==="none")return gr;if(Mi.hasOwnProperty(n))return Mi[n];if(ys>=vh){let e=0;for(const i in Mi)e++&3||(delete Mi[i],--ys)}const t=Th(n);if(t.length!==4)throw new Error('failed to parse "'+n+'" as color');for(const e of t)if(isNaN(e))throw new Error('failed to parse "'+n+'" as color');return ha(t),Mi[n]=t,++ys,t}function ji(n){return Array.isArray(n)?n:_r(n)}function ha(n){return n[0]=st(n[0]+.5|0,0,255),n[1]=st(n[1]+.5|0,0,255),n[2]=st(n[2]+.5|0,0,255),n[3]=st(n[3],0,1),n}function mr(n){let t=n[0];t!=(t|0)&&(t=t+.5|0);let e=n[1];e!=(e|0)&&(e=e+.5|0);let i=n[2];i!=(i|0)&&(i=i+.5|0);const s=n[3]===void 0?1:Math.round(n[3]*1e3)/1e3;return"rgba("+t+","+e+","+i+","+s+")"}const Le=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",Ah=Le.includes("firefox"),Mh=Le.includes("safari")&&!Le.includes("chrom");Mh&&(Le.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Le));const bh=Le.includes("webkit")&&!Le.includes("edge"),ca=Le.includes("macintosh"),ua=typeof devicePixelRatio<"u"?devicePixelRatio:1,da=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,fa=typeof Image<"u"&&Image.prototype.decode,ga=function(){let n=!1;try{const t=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return n}();function rt(n,t,e,i){let s;return e&&e.length?s=e.shift():da?s=new OffscreenCanvas(n||300,t||300):s=document.createElement("canvas"),n&&(s.width=n),t&&(s.height=t),s.getContext("2d",i)}let Es;function bn(){return Es||(Es=rt(1,1)),Es}function mi(n){const t=n.canvas;t.width=1,t.height=1,n.clearRect(0,0,1,1)}function oo(n,t){const e=t.parentNode;e&&e.replaceChild(n,t)}function Dh(n){for(;n.lastChild;)n.lastChild.remove()}function Ph(n,t){const e=n.childNodes;for(let i=0;;++i){const s=e[i],r=t[i];if(!s&&!r)break;if(s!==r){if(!s){n.appendChild(r);continue}if(!r){n.removeChild(s),--i;continue}n.insertBefore(r,s)}}}function Oh(n,t,e){const i=n;let s=!0,r=!1,o=!1;const a=[vn(i,z.LOAD,function(){o=!0,r||t()})];return i.src&&fa?(r=!0,i.decode().then(function(){s&&t()}).catch(function(l){s&&(o?t():e())})):a.push(vn(i,z.ERROR,e)),function(){s=!1,a.forEach(tt)}}function Fh(n,t){return new Promise((e,i)=>{function s(){o(),e(n)}function r(){o(),i(new Error("Image load error"))}function o(){n.removeEventListener("load",s),n.removeEventListener("error",r)}n.addEventListener("load",s),n.addEventListener("error",r)})}function kh(n,t){return t&&(n.src=t),n.src&&fa?new Promise((e,i)=>n.decode().then(()=>e(n)).catch(s=>n.complete&&n.width?e(n):i(s))):Fh(n)}class Nh{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const i=this.cache_[e];!(t++&3)&&!i.hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,i){const s=xs(t,e,i);return s in this.cache_?this.cache_[s]:null}getPattern(t,e,i){const s=xs(t,e,i);return s in this.patternCache_?this.patternCache_[s]:null}set(t,e,i,s,r){const o=xs(t,e,i),a=o in this.cache_;this.cache_[o]=s,r&&(s.getImageState()===Y.IDLE&&s.load(),s.getImageState()===Y.LOADING?s.ready().then(()=>{this.patternCache_[o]=bn().createPattern(s.getImage(1),"repeat")}):this.patternCache_[o]=bn().createPattern(s.getImage(1),"repeat")),a||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function xs(n,t,e){const i=e?ji(e):"null";return t+":"+n+":"+i}const Ht=new Nh;let bi=null;class Gh extends Kn{constructor(t,e,i,s,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=r,this.imageState_=s===void 0?Y.IDLE:s,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===Y.LOADED){bi||(bi=rt(1,1,void 0,{willReadFrequently:!0})),bi.drawImage(this.image_,0,0);try{bi.getImageData(0,0,1,1),this.tainted_=!1}catch{bi=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(z.CHANGE)}handleImageError_(){this.imageState_=Y.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=Y.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],i=rt(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===Y.IDLE){this.image_||this.initializeImage_(),this.imageState_=Y.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&kh(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==Y.LOADED)return;const e=this.image_,i=rt(Math.ceil(e.width*t),Math.ceil(e.height*t)),s=i.canvas;i.scale(t,t),i.drawImage(e,0,0),i.globalCompositeOperation="multiply",i.fillStyle=Ih(this.color_),i.fillRect(0,0,s.width/t,s.height/t),i.globalCompositeOperation="destination-in",i.drawImage(e,0,0),this.canvas_[t]=s}ready(){return this.ready_||(this.ready_=new Promise(t=>{if(this.imageState_===Y.LOADED||this.imageState_===Y.ERROR)t();else{const e=()=>{(this.imageState_===Y.LOADED||this.imageState_===Y.ERROR)&&(this.removeEventListener(z.CHANGE,e),t())};this.addEventListener(z.CHANGE,e)}})),this.ready_}}function pr(n,t,e,i,s,r){let o=t===void 0?void 0:Ht.get(t,e,s);return o||(o=new Gh(n,n&&"src"in n?n.src||void 0:t,e,i,s),Ht.set(t,e,s,o,r)),r&&o&&!Ht.getPattern(t,e,s)&&Ht.set(t,e,s,o,r),o}function qt(n){return n?Array.isArray(n)?mr(n):typeof n=="object"&&"src"in n?zh(n):n:null}function zh(n){if(!n.offset||!n.size)return Ht.getPattern(n.src,"anonymous",n.color);const t=n.src+":"+n.offset,e=Ht.getPattern(t,void 0,n.color);if(e)return e;const i=Ht.get(n.src,"anonymous",null);if(i.getImageState()!==Y.LOADED)return null;const s=rt(n.size[0],n.size[1]);return s.drawImage(i.getImage(1),n.offset[0],n.offset[1],n.size[0],n.size[1],0,0,n.size[0],n.size[1]),pr(s.canvas,t,void 0,Y.LOADED,n.color,!0),Ht.getPattern(t,void 0,n.color)}const wn="ol-hidden",ts="ol-unselectable",yr="ol-control",ao="ol-collapsed",Xh=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),lo=["style","variant","weight","size","lineHeight","family"],_a=function(n){const t=n.match(Xh);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,s=lo.length;i>1),s=+e(n[i],t),s<0?r=i+1:(o=i,a=!s);return a?r:~r}function ae(n,t){return n>t?1:n0?s-1:s}return i-1}if(e>0){for(let s=1;s0||o===0)})}function Wi(){return!0}function Zn(){return!1}function fi(){}function No(n){let t,e,i;return function(){const s=Array.prototype.slice.call(arguments);return(!e||this!==i||!Ae(s,e))&&(i=this,e=s,t=n.apply(this,arguments)),t}}function hl(n){function t(){let e;try{e=n()}catch(i){return Promise.reject(i)}return e instanceof Promise?e:Promise.resolve(e)}return t()}function nn(n){for(const t in n)delete n[t]}function gi(n){let t;for(t in n)return!1;return!t}class Kn extends Wn{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const i=this.listeners_||(this.listeners_={}),s=i[t]||(i[t]=[]);s.includes(e)||s.push(e)}dispatchEvent(t){const e=typeof t=="string",i=e?t:t.type,s=this.listeners_&&this.listeners_[i];if(!s)return;const r=e?new fe(t):t;r.target||(r.target=this.eventTarget_||this);const o=this.dispatching_||(this.dispatching_={}),a=this.pendingRemovals_||(this.pendingRemovals_={});i in o||(o[i]=0,a[i]=0),++o[i];let l;for(let c=0,h=s.length;c0:!1}removeEventListener(t,e){if(!this.listeners_)return;const i=this.listeners_[t];if(!i)return;const s=i.indexOf(e);s!==-1&&(this.pendingRemovals_&&t in this.pendingRemovals_?(i[s]=fi,++this.pendingRemovals_[t]):(i.splice(s,1),i.length===0&&delete this.listeners_[t]))}}const z={CHANGE:"change",ERROR:"error",BLUR:"blur",CLEAR:"clear",CONTEXTMENU:"contextmenu",CLICK:"click",DBLCLICK:"dblclick",DRAGENTER:"dragenter",DRAGOVER:"dragover",DROP:"drop",FOCUS:"focus",KEYDOWN:"keydown",KEYPRESS:"keypress",LOAD:"load",RESIZE:"resize",TOUCHMOVE:"touchmove",WHEEL:"wheel"};function V(n,t,e,i,s){if(s){const o=e;e=function(){n.removeEventListener(t,e),o.apply(i??this,arguments)}}else i&&i!==n&&(e=e.bind(i));const r={target:n,type:t,listener:e};return n.addEventListener(t,e),r}function vn(n,t,e,i){return V(n,t,e,i,!0)}function tt(n){n&&n.target&&(n.target.removeEventListener(n.type,n.listener),nn(n))}class sn extends Kn{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(z.CHANGE)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const i=t.length,s=new Array(i);for(let r=0;r0;)this.pop()}extend(t){for(let e=0,i=t.length;ethis.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new gn(wt.ADD,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){this.unique_&&this.assertUnique_(t);const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let i=0,s=e.length;i=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new gn(wt.REMOVE,e,t)),e}setAt(t,e){const i=this.getLength();if(t>=i){this.insertAt(t,e);return}if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const s=this.array_[t];this.array_[t]=e,this.dispatchEvent(new gn(wt.REMOVE,s,t)),this.dispatchEvent(new gn(wt.ADD,e,t))}updateLength_(){this.set(Nr.LENGTH,this.array_.length)}assertUnique_(t,e){for(let i=0,s=this.array_.length;i1?(e=s,i=r):l>0&&(e+=o*l,i+=a*l)}return hi(n,t,e,i)}function hi(n,t,e,i){const s=e-n,r=i-t;return s*s+r*r}function fl(n){const t=n.length;for(let i=0;ir&&(r=l,s=a)}if(r===0)return null;const o=n[s];n[s]=n[i],n[i]=o;for(let a=i+1;a=0;i--){e[i]=n[i][t]/n[i][i];for(let s=i-1;s>=0;s--)n[s][t]-=n[s][i]*e[i]}return e}function In(n){return n*Math.PI/180}function ci(n,t){const e=n%t;return e*t<0?e+t:e}function St(n,t,e){return n+e*(t-n)}function Vs(n,t){const e=Math.pow(10,t);return Math.round(n*e)/e}function _n(n,t){return Math.floor(Vs(n,t))}function mn(n,t){return Math.ceil(Vs(n,t))}class Go extends $t{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);typeof t.properties=="object"&&(delete e.properties,Object.assign(e,t.properties)),e[J.OPACITY]=t.opacity!==void 0?t.opacity:1,j(typeof e[J.OPACITY]=="number","Layer opacity must be a number"),e[J.VISIBLE]=t.visible!==void 0?t.visible:!0,e[J.Z_INDEX]=t.zIndex,e[J.MAX_RESOLUTION]=t.maxResolution!==void 0?t.maxResolution:1/0,e[J.MIN_RESOLUTION]=t.minResolution!==void 0?t.minResolution:0,e[J.MIN_ZOOM]=t.minZoom!==void 0?t.minZoom:-1/0,e[J.MAX_ZOOM]=t.maxZoom!==void 0?t.maxZoom:1/0,this.className_=e.className!==void 0?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:t===void 0?!0:t},i=this.getZIndex();return e.opacity=st(Math.round(this.getOpacity()*100)/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=i===void 0&&!e.managed?1/0:i,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return U()}getLayerStatesArray(t){return U()}getExtent(){return this.get(J.EXTENT)}getMaxResolution(){return this.get(J.MAX_RESOLUTION)}getMinResolution(){return this.get(J.MIN_RESOLUTION)}getMinZoom(){return this.get(J.MIN_ZOOM)}getMaxZoom(){return this.get(J.MAX_ZOOM)}getOpacity(){return this.get(J.OPACITY)}getSourceState(){return U()}getVisible(){return this.get(J.VISIBLE)}getZIndex(){return this.get(J.Z_INDEX)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(J.EXTENT,t)}setMaxResolution(t){this.set(J.MAX_RESOLUTION,t)}setMinResolution(t){this.set(J.MIN_RESOLUTION,t)}setMaxZoom(t){this.set(J.MAX_ZOOM,t)}setMinZoom(t){this.set(J.MIN_ZOOM,t)}setOpacity(t){j(typeof t=="number","Layer opacity must be a number"),this.set(J.OPACITY,t)}setVisible(t){this.set(J.VISIBLE,t)}setZIndex(t){this.set(J.Z_INDEX,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const Ot={PRERENDER:"prerender",POSTRENDER:"postrender",PRECOMPOSE:"precompose",POSTCOMPOSE:"postcompose",RENDERCOMPLETE:"rendercomplete"},mt={ANIMATING:0,INTERACTING:1},Nt={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"},gl=42,Us=256,js={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class zo{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=t.extent!==void 0?t.extent:null,this.worldExtent_=t.worldExtent!==void 0?t.worldExtent:null,this.axisOrientation_=t.axisOrientation!==void 0?t.axisOrientation:"enu",this.global_=t.global!==void 0?t.global:!1,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||js[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!!(t&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!!(this.global_&&t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const rn=6378137,oi=Math.PI*rn,_l=[-oi,-oi,oi,oi],ml=[-180,-85,180,85],pn=rn*Math.log(Math.tan(Math.PI/2));class je extends zo{constructor(t){super({code:t,units:"m",extent:_l,global:!0,worldExtent:ml,getPointResolution:function(e,i){return e/Math.cosh(i[1]/rn)}})}}const Gr=[new je("EPSG:3857"),new je("EPSG:102100"),new je("EPSG:102113"),new je("EPSG:900913"),new je("http://www.opengis.net/def/crs/EPSG/0/3857"),new je("http://www.opengis.net/gml/srs/epsg.xml#3857")];function pl(n,t,e,i){const s=n.length;e=e>1?e:2,i=i??e,t===void 0&&(e>2?t=n.slice():t=new Array(s));for(let r=0;rpn?o=pn:o<-pn&&(o=-pn),t[r+1]=o}return t}function yl(n,t,e,i){const s=n.length;e=e>1?e:2,i=i??e,t===void 0&&(e>2?t=n.slice():t=new Array(s));for(let r=0;rs&&(l=l|ht.RIGHT),ar&&(l=l|ht.ABOVE),l===ht.UNKNOWN&&(l=ht.INTERSECTING),l}function Ft(){return[1/0,1/0,-1/0,-1/0]}function Se(n,t,e,i,s){return s?(s[0]=n,s[1]=t,s[2]=e,s[3]=i,s):[n,t,e,i]}function Bn(n){return Se(1/0,1/0,-1/0,-1/0,n)}function Yo(n,t){const e=n[0],i=n[1];return Se(e,i,e,i,t)}function $s(n,t,e,i,s){const r=Bn(s);return Zo(r,n,t,e,i)}function Yi(n,t){return n[0]==t[0]&&n[2]==t[2]&&n[1]==t[1]&&n[3]==t[3]}function Tl(n,t){return t[0]n[2]&&(n[2]=t[2]),t[1]n[3]&&(n[3]=t[3]),n}function zi(n,t){t[0]n[2]&&(n[2]=t[0]),t[1]n[3]&&(n[3]=t[1])}function Zo(n,t,e,i,s){for(;et[0]?i[0]=n[0]:i[0]=t[0],n[1]>t[1]?i[1]=n[1]:i[1]=t[1],n[2]=t[0]&&n[1]<=t[3]&&n[3]>=t[1]}function Hn(n){return n[2]=o&&_<=l),!i&&r&ht.RIGHT&&!(s&ht.RIGHT)&&(m=f-(d-l)*g,i=m>=a&&m<=c),!i&&r&ht.BELOW&&!(s&ht.BELOW)&&(_=d-(f-a)/g,i=_>=o&&_<=l),!i&&r&ht.LEFT&&!(s&ht.LEFT)&&(m=f-(d-o)*g,i=m>=a&&m<=c)}return i}function Bo(n,t){const e=t.getExtent(),i=Xe(n);if(t.canWrapX()&&(i[0]=e[2])){const s=q(e),o=Math.floor((i[0]-e[0])/s)*s;n[0]-=o,n[2]-=o}return n}function Js(n,t,e){if(t.canWrapX()){const i=t.getExtent();if(!isFinite(n[0])||!isFinite(n[2]))return[[i[0],n[1],i[2],n[3]]];Bo(n,t);const s=q(i);if(q(n)>s&&!e)return[[i[0],n[1],i[2],n[3]]];if(n[0]i[2])return[[n[0],n[1],i[2],n[3]],[i[0],n[1],n[2]-s,n[3]]]}return[n]}function Ml(n,t){return n[0]+=+t[0],n[1]+=+t[1],n}function Ln(n,t){let e=!0;for(let i=n.length-1;i>=0;--i)if(n[i]!=t[i]){e=!1;break}return e}function Qs(n,t){const e=Math.cos(t),i=Math.sin(t),s=n[0]*e-n[1]*i,r=n[1]*e+n[0]*i;return n[0]=s,n[1]=r,n}function bl(n,t){return n[0]*=t,n[1]*=t,n}function Vo(n,t){if(t.canWrapX()){const e=q(t.getExtent()),i=Dl(n,t,e);i&&(n[0]-=i*e)}return n}function Dl(n,t,e){const i=t.getExtent();let s=0;return t.canWrapX()&&(n[0]i[2])&&(e=e||q(i),s=Math.floor((n[0]-i[0])/e)),s}const Pl=63710088e-1;function Yr(n,t,e){e=e||Pl;const i=In(n[1]),s=In(t[1]),r=(s-i)/2,o=In(t[0]-n[0])/2,a=Math.sin(r)*Math.sin(r)+Math.sin(o)*Math.sin(o)*Math.cos(i)*Math.cos(s);return 2*e*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function Uo(...n){console.warn(...n)}let Os=!0;function jo(n){Os=!1}function tr(n,t){if(t!==void 0){for(let e=0,i=n.length;e=-180&&n[0]<=180&&n[1]>=-90&&n[1]<=90&&(Os=!1,Uo("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),n}function $o(n,t){return n}function Te(n,t){return n}function Nl(){Kr(Gr),Kr(Xr),kl(Xr,Gr,pl,yl)}Nl();function Br(n,t,e){return function(i,s,r,o,a){if(!i)return;if(!s&&!t)return i;const l=t?0:r[0]*s,c=t?0:r[1]*s,h=a?a[0]:0,u=a?a[1]:0;let d=n[0]+l/2+h,f=n[2]-l/2+h,g=n[1]+c/2+u,_=n[3]-c/2+u;d>f&&(d=(f+d)/2,f=d),g>_&&(g=(_+g)/2,_=g);let m=st(i[0],d,f),p=st(i[1],g,_);if(o&&e&&s){const y=30*s;m+=-y*Math.log(1+Math.max(0,d-i[0])/y)+y*Math.log(1+Math.max(0,i[0]-f)/y),p+=-y*Math.log(1+Math.max(0,g-i[1])/y)+y*Math.log(1+Math.max(0,i[1]-_)/y)}return[m,p]}}function Gl(n){return n}function nr(n,t,e,i){const s=q(t)/e[0],r=pt(t)/e[1];return i?Math.min(n,Math.max(s,r)):Math.min(n,Math.min(s,r))}function sr(n,t,e){let i=Math.min(n,t);const s=50;return i*=Math.log(1+s*Math.max(0,n/t-1))/s+1,e&&(i=Math.max(i,e),i/=Math.log(1+s*Math.max(0,e/n-1))/s+1),st(i,e/2,t*2)}function zl(n,t,e,i){return t=t!==void 0?t:!0,function(s,r,o,a){if(s!==void 0){const l=n[0],c=n[n.length-1],h=e?nr(l,e,o,i):l;if(a)return t?sr(s,h,c):st(s,c,h);const u=Math.min(h,s),d=Math.floor(Bs(n,u,r));return n[d]>h&&dMath.round(e*jr[i])/jr[i]).join(", ")+")"}function ve(n,t,e,i,s,r,o){r=r||[],o=o||2;let a=0;for(let l=t;l{if(!i)return this.getSimplifiedGeometry(e);const s=this.clone();return s.applyTransform(i),s.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return U()}closestPointXY(t,e,i,s){return U()}containsXY(t,e){const i=this.getClosestPoint([t,e]);return i[0]===t&&i[1]===e}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return U()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const e=this.computeExtent(this.extent_);(isNaN(e[0])||isNaN(e[1]))&&Bn(e),this.extentRevision_=this.getRevision()}return Ll(this.extent_,t)}rotate(t,e){U()}scale(t,e,i){U()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return U()}getType(){return U()}applyTransform(t){U()}intersectsExtent(t){return U()}translate(t,e){U()}transform(t,e){const i=kt(t),s=i.getUnits()=="tile-pixels"?function(r,o,a){const l=i.getExtent(),c=i.getWorldExtent(),h=pt(c)/pt(l);return de(Hr,c[0],c[3],h,-h,0,0,0),ve(r,0,r.length,a,Hr,o),An(i,e)(r,o,a)}:An(i,e);return this.applyTransform(s),this}}class qn extends ql{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return $s(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return U()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||this.simplifiedGeometryMaxMinSquaredTolerance!==0&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length1)u=e;else if(d>0){for(let f=0;fs&&(s=c),r=a,o=l}return s}function Ql(n,t,e,i,s){for(let r=0,o=e.length;r0;){const u=c.pop(),d=c.pop();let f=0;const g=n[d],_=n[d+1],m=n[u],p=n[u+1];for(let y=d+i;yf&&(h=y,f=w)}f>s&&(l[(h-t)/i]=1,d+i0&&_>f)&&(g<0&&m0&&m>g)){c=u,h=d;continue}r[o++]=c,r[o++]=h,a=c,l=h,c=u,h=d}return r[o++]=c,r[o++]=h,o}function ea(n,t,e,i,s,r,o,a){for(let l=0,c=e.length;lr&&(c-a)*(r-l)-(s-a)*(h-l)>0&&o++:h<=r&&(c-a)*(r-l)-(s-a)*(h-l)<0&&o--,a=c,l=h}return o!==0}function na(n,t,e,i,s,r){if(e.length===0||!Ne(n,t,e[0],i,s,r))return!1;for(let o=1,a=e.length;op&&(c=(h+u)/2,na(n,t,e,i,c,g)&&(m=c,p=y)),h=u}return isNaN(m)&&(m=s[r]),o?(o.push(m,g,p),o):[m,g,p]}function ah(n,t,e,i,s){let r=[];for(let o=0,a=e.length;o=s[0]&&r[2]<=s[2]||r[1]>=s[1]&&r[3]<=s[3]?!0:sa(n,t,e,i,function(o,a){return Al(s,o,a)}):!1}function ra(n,t,e,i,s){return!!(cr(n,t,e,i,s)||Ne(n,t,e,i,s[0],s[1])||Ne(n,t,e,i,s[0],s[3])||Ne(n,t,e,i,s[2],s[1])||Ne(n,t,e,i,s[2],s[3]))}function lh(n,t,e,i,s){if(!ra(n,t,e[0],i,s))return!1;if(e.length===1)return!0;for(let r=1,o=e.length;r0}function ch(n,t,e,i,s){s=s!==void 0?s:!1;for(let r=0,o=e.length;r1&&typeof arguments[e-1]=="function"&&(i=arguments[e-1],--e);let s=0;for(;s0}getInteracting(){return this.hints_[mt.INTERACTING]>0}cancelAnimations(){this.setHint(mt.ANIMATING,-this.hints_[mt.ANIMATING]);let t;for(let e=0,i=this.animations_.length;e=0;--i){const s=this.animations_[i];let r=!0;for(let o=0,a=s.length;o0?c/l.duration:1;h>=1?(l.complete=!0,h=1):r=!1;const u=l.easing(h);if(l.sourceCenter){const d=l.sourceCenter[0],f=l.sourceCenter[1],g=l.targetCenter[0],_=l.targetCenter[1];this.nextCenter_=l.targetCenter;const m=d+u*(g-d),p=f+u*(_-f);this.targetCenter_=[m,p]}if(l.sourceResolution&&l.targetResolution){const d=u===1?l.targetResolution:l.sourceResolution+u*(l.targetResolution-l.sourceResolution);if(l.anchor){const f=this.getViewportSize_(this.getRotation()),g=this.constraints_.resolution(d,0,f,!0);this.targetCenter_=this.calculateCenterZoom(g,l.anchor)}this.nextResolution_=l.targetResolution,this.targetResolution_=d,this.applyTargetState_(!0)}if(l.sourceRotation!==void 0&&l.targetRotation!==void 0){const d=u===1?ci(l.targetRotation+Math.PI,2*Math.PI)-Math.PI:l.sourceRotation+u*(l.targetRotation-l.sourceRotation);if(l.anchor){const f=this.constraints_.rotation(d,!0);this.targetCenter_=this.calculateCenterRotate(f,l.anchor)}this.nextRotation_=l.targetRotation,this.targetRotation_=d}if(this.applyTargetState_(!0),e=!0,!l.complete)break}if(r){this.animations_[i]=null,this.setHint(mt.ANIMATING,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const o=s[0].callback;o&&yn(o,!0)}}this.animations_=this.animations_.filter(Boolean),e&&this.updateAnimationKey_===void 0&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let i;const s=this.getCenterInternal();return s!==void 0&&(i=[s[0]-e[0],s[1]-e[1]],Qs(i,t-this.getRotation()),Ml(i,e)),i}calculateCenterZoom(t,e){let i;const s=this.getCenterInternal(),r=this.getResolution();if(s!==void 0&&r!==void 0){const o=e[0]-t*(e[0]-s[0])/r,a=e[1]-t*(e[1]-s[1])/r;i=[o,a]}return i}getViewportSize_(t){const e=this.viewportSize_;if(t){const i=e[0],s=e[1];return[Math.abs(i*Math.cos(t))+Math.abs(s*Math.sin(t)),Math.abs(i*Math.sin(t))+Math.abs(s*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t&&Fs(t,this.getProjection())}getCenterInternal(){return this.get(Nt.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return t!==void 0?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){const e=this.calculateExtentInternal(t);return $o(e,this.getProjection())}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();j(e,"The view center is not defined");const i=this.getResolution();j(i!==void 0,"The view resolution is not defined");const s=this.getRotation();return j(s!==void 0,"The view rotation is not defined"),Ps(e,i,s,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(Nt.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(Te(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const i=q(t)/e[0],s=pt(t)/e[1];return Math.max(i,s)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,s=Math.log(e/i)/Math.log(t);return function(r){return e/Math.pow(t,r*s)}}getRotation(){return this.get(Nt.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),i=this.getConstrainedResolution(this.maxResolution_),s=this.minResolution_,r=Math.log(i/s)/e;return function(o){return Math.log(i/o)/e/r}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const i=this.padding_;return i&&(e=[e[0]-i[1]-i[3],e[1]-i[0]-i[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),i=this.getRotation();let s=this.getCenterInternal();const r=this.padding_;if(r){const o=this.getViewportSizeMinusPadding_();s=gs(s,this.getViewportSize_(),[o[0]/2+r[3],o[1]/2+r[0]],e,i)}return{center:s.slice(0),projection:t!==void 0?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:i,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return e!==void 0&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e=this.minZoom_||0,i,s;if(this.resolutions_){const r=Bs(this.resolutions_,t,1);e=r,i=this.resolutions_[r],r==this.resolutions_.length-1?s=2:s=i/this.resolutions_[r+1]}else i=this.maxResolution_,s=this.zoomFactor_;return e+Math.log(i/t)/Math.log(s)}getResolutionForZoom(t){if(this.resolutions_?.length){if(this.resolutions_.length===1)return this.resolutions_[0];const e=st(Math.floor(t),0,this.resolutions_.length-2),i=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(i,st(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let i;if(j(Array.isArray(t)||typeof t.getSimplifiedGeometry=="function","Invalid extent or geometry provided as `geometry`"),Array.isArray(t)){j(!Hn(t),"Cannot fit empty extent provided as `geometry`");const s=Te(t,this.getProjection());i=to(s)}else if(t.getType()==="Circle"){const s=Te(t.getExtent(),this.getProjection());i=to(s),i.rotate(this.getRotation(),Xe(s))}else i=t;this.fitInternal(i,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),i=Math.cos(e),s=Math.sin(-e),r=t.getFlatCoordinates(),o=t.getStride();let a=1/0,l=1/0,c=-1/0,h=-1/0;for(let u=0,d=r.length;u{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return!this.renderer_||!this.rendered?null:this.renderer_.getData(t)}isVisible(t){let e;const i=this.getMapInternal();!t&&i&&(t=i.getView()),t instanceof Vt?e={viewState:t.getState(),extent:t.calculateExtent()}:e=t,!e.layerStatesArray&&i&&(e.layerStatesArray=i.getLayerGroup().getLayerStatesArray());let s;e.layerStatesArray?s=e.layerStatesArray.find(o=>o.layer===this):s=this.getLayerState();const r=this.getExtent();return dr(s,e.viewState)&&(!r||Tt(r,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];const e=this.getSource()?.getAttributions();if(!e)return[];const i=t instanceof Vt?t.getViewStateAndExtent():t;let s=e(i);return Array.isArray(s)||(s=[s]),s}render(t,e){const i=this.getRenderer();return i.prepareFrame(t)?(this.rendered=!0,i.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set(J.MAP,t)}getMapInternal(){return this.get(J.MAP)}setMap(t){this.mapPrecomposeKey_&&(tt(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(tt(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=V(t,Ot.PRECOMPOSE,this.handlePrecompose_,this),this.mapRenderKey_=V(this,z.CHANGE,t.render,t),this.changed())}handlePrecompose_(t){const e=t.frameState.layerStatesArray,i=this.getLayerState(!1);j(!e.some(s=>s.layer===i.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(i)}setSource(t){this.set(J.SOURCE,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}disposeInternal(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_),this.setSource(null),super.disposeInternal()}}function dr(n,t){if(!n.visible)return!1;const e=t.resolution;if(e=n.maxResolution)return!1;const i=t.zoom;return i>n.minZoom&&i<=n.maxZoom}function oa(n,t,e=0,i=n.length-1,s=mh){for(;i>e;){if(i-e>600){const l=i-e+1,c=t-e+1,h=Math.log(l),u=.5*Math.exp(2*h/3),d=.5*Math.sqrt(h*u*(l-u)/l)*(c-l/2<0?-1:1),f=Math.max(e,Math.floor(t-c*u/l+d)),g=Math.min(i,Math.floor(t+(l-c)*u/l+d));oa(n,t,f,g,s)}const r=n[t];let o=e,a=i;for(Ai(n,e,t),s(n[i],r)>0&&Ai(n,e,i);o0;)a--}s(n[e],r)===0?Ai(n,e,a):(a++,Ai(n,a,i)),a<=t&&(e=a+1),t<=a&&(i=a-1)}}function Ai(n,t,e){const i=n[t];n[t]=n[e],n[e]=i}function mh(n,t){return nt?1:0}let aa=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(this._maxEntries*.4)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const i=[];if(!xn(t,e))return i;const s=this.toBBox,r=[];for(;e;){for(let o=0;o=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(s,r,e)}_split(t,e){const i=t[e],s=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,s);const o=this._chooseSplitIndex(i,r,s),a=ii(i.children.splice(o,i.children.length-o));a.height=i.height,a.leaf=i.leaf,He(i,this.toBBox),He(a,this.toBBox),e?t[e-1].children.push(a):this._splitRoot(i,a)}_splitRoot(t,e){this.data=ii([t,e]),this.data.height=t.height+1,this.data.leaf=!1,He(this.data,this.toBBox)}_chooseSplitIndex(t,e,i){let s,r=1/0,o=1/0;for(let a=e;a<=i-e;a++){const l=Pi(t,0,a,this.toBBox),c=Pi(t,a,i,this.toBBox),h=wh(l,c),u=_s(l)+_s(c);h=e;c--){const h=t.children[c];Oi(a,t.leaf?r(h):h),l+=En(a)}return l}_adjustParentBBoxes(t,e,i){for(let s=i;s>=0;s--)Oi(e[s],t)}_condense(t){for(let e=t.length-1,i;e>=0;e--)t[e].children.length===0?e>0?(i=t[e-1].children,i.splice(i.indexOf(t[e]),1)):this.clear():He(t[e],this.toBBox)}};function ph(n,t,e){if(!e)return t.indexOf(n);for(let i=0;i=n.minX&&t.maxY>=n.minY}function ii(n){return{children:n,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function eo(n,t,e,i,s){const r=[t,e];for(;r.length;){if(e=r.pop(),t=r.pop(),e-t<=i)continue;const o=t+Math.ceil((e-t)/i/2)*i;oa(n,o,t,e,s),r.push(t,o,o,e)}}const Y={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function io(n){return n[0]>0&&n[1]>0}function Ch(n,t,e){return e===void 0&&(e=[0,0]),e[0]=n[0]*t+.5|0,e[1]=n[1]*t+.5|0,e}function vt(n,t){return Array.isArray(n)?n:(t===void 0?t=[n,n]:(t[0]=n,t[1]=n),t)}class Qn{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=vt(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new Qn({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return U()}getImage(t){return U()}getHitDetectionImage(){return U()}getPixelRatio(t){return 1}getImageState(){return U()}getImageSize(){return U()}getOrigin(){return U()}getSize(){return U()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=vt(t)}listenImageChange(t){U()}load(){U()}unlistenImageChange(t){U()}ready(){return Promise.resolve()}}const Ui={name:"rgb",min:[0,0,0],max:[255,255,255],channel:["red","green","blue"],alias:["RGB"]};var ft={name:"xyz",min:[0,0,0],channel:["X","Y","Z"],alias:["XYZ","ciexyz","cie1931"]};ft.whitepoint={2:{A:[109.85,100,35.585],C:[98.074,100,118.232],D50:[96.422,100,82.521],D55:[95.682,100,92.149],D65:[95.045592705167,100,108.9057750759878],D75:[94.972,100,122.638],F2:[99.187,100,67.395],F7:[95.044,100,108.755],F11:[100.966,100,64.37],E:[100,100,100]},10:{A:[111.144,100,35.2],C:[97.285,100,116.145],D50:[96.72,100,81.427],D55:[95.799,100,90.926],D65:[94.811,100,107.304],D75:[94.416,100,120.641],F2:[103.28,100,69.026],F7:[95.792,100,107.687],F11:[103.866,100,65.627],E:[100,100,100]}};ft.max=ft.whitepoint[2].D65;ft.rgb=function(n,t){t=t||ft.whitepoint[2].E;var e=n[0]/t[0],i=n[1]/t[1],s=n[2]/t[2],r,o,a;return r=e*3.240969941904521+i*-1.537383177570093+s*-.498610760293,o=e*-.96924363628087+i*1.87596750150772+s*.041555057407175,a=e*.055630079696993+i*-.20397695888897+s*1.056971514242878,r=r>.0031308?1.055*Math.pow(r,1/2.4)-.055:r=r*12.92,o=o>.0031308?1.055*Math.pow(o,1/2.4)-.055:o=o*12.92,a=a>.0031308?1.055*Math.pow(a,1/2.4)-.055:a=a*12.92,r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),a=Math.min(Math.max(0,a),1),[r*255,o*255,a*255]};Ui.xyz=function(n,t){var e=n[0]/255,i=n[1]/255,s=n[2]/255;e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,i=i>.04045?Math.pow((i+.055)/1.055,2.4):i/12.92,s=s>.04045?Math.pow((s+.055)/1.055,2.4):s/12.92;var r=e*.41239079926595+i*.35758433938387+s*.18048078840183,o=e*.21263900587151+i*.71516867876775+s*.072192315360733,a=e*.019330818715591+i*.11919477979462+s*.95053215224966;return t=t||ft.whitepoint[2].E,[r*t[0],o*t[1],a*t[2]]};const fr={name:"luv",min:[0,-134,-140],max:[100,224,122],channel:["lightness","u","v"],alias:["LUV","cieluv","cie1976"],xyz:function(n,t,e){var i,s,r,o,a,l,c,h,u,d,f,g,_;if(r=n[0],o=n[1],a=n[2],r===0)return[0,0,0];var m=.0011070564598794539;return t=t||"D65",e=e||2,u=ft.whitepoint[e][t][0],d=ft.whitepoint[e][t][1],f=ft.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),i=o/(13*r)+g||0,s=a/(13*r)+_||0,c=r>8?d*Math.pow((r+16)/116,3):d*r*m,l=c*9*i/(4*s)||0,h=c*(12-3*i-20*s)/(4*s)||0,[l,c,h]}};ft.luv=function(n,t,e){var i,s,r,o,a,l,c,h,u,d,f,g,_,m=.008856451679035631,p=903.2962962962961;t=t||"D65",e=e||2,u=ft.whitepoint[e][t][0],d=ft.whitepoint[e][t][1],f=ft.whitepoint[e][t][2],g=4*u/(u+15*d+3*f),_=9*d/(u+15*d+3*f),l=n[0],c=n[1],h=n[2],i=4*l/(l+15*c+3*h)||0,s=9*c/(l+15*c+3*h)||0;var y=c/d;return r=y<=m?p*y:116*Math.pow(y,1/3)-16,o=13*r*(i-g),a=13*r*(s-_),[r,o,a]};var la={name:"lchuv",channel:["lightness","chroma","hue"],alias:["LCHuv","cielchuv"],min:[0,0,0],max:[100,100,360],luv:function(n){var t=n[0],e=n[1],i=n[2],s,r,o;return o=i/360*2*Math.PI,s=e*Math.cos(o),r=e*Math.sin(o),[t,s,r]},xyz:function(n){return fr.xyz(la.luv(n))}};fr.lchuv=function(n){var t=n[0],e=n[1],i=n[2],s=Math.sqrt(e*e+i*i),r=Math.atan2(i,e),o=r*360/2/Math.PI;return o<0&&(o+=360),[t,s,o]};ft.lchuv=function(n){return fr.lchuv(ft.luv(n))};const no={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};var so={red:0,orange:60,yellow:120,green:180,blue:240,purple:300};function Rh(n){var t,e=[],i=1,s;if(typeof n=="number")return{space:"rgb",values:[n>>>16,(n&65280)>>>8,n&255],alpha:1};if(typeof n=="number")return{space:"rgb",values:[n>>>16,(n&65280)>>>8,n&255],alpha:1};if(n=String(n).toLowerCase(),no[n])e=no[n].slice(),s="rgb";else if(n==="transparent")i=0,s="rgb",e=[0,0,0];else if(n[0]==="#"){var r=n.slice(1),o=r.length,a=o<=4;i=1,a?(e=[parseInt(r[0]+r[0],16),parseInt(r[1]+r[1],16),parseInt(r[2]+r[2],16)],o===4&&(i=parseInt(r[3]+r[3],16)/255)):(e=[parseInt(r[0]+r[1],16),parseInt(r[2]+r[3],16),parseInt(r[4]+r[5],16)],o===8&&(i=parseInt(r[6]+r[7],16)/255)),e[0]||(e[0]=0),e[1]||(e[1]=0),e[2]||(e[2]=0),s="rgb"}else if(t=/^((?:rgba?|hs[lvb]a?|hwba?|cmyk?|xy[zy]|gray|lab|lchu?v?|[ly]uv|lms|oklch|oklab|color))\s*\(([^\)]*)\)/.exec(n)){var l=t[1];s=l.replace(/a$/,"");var c=s==="cmyk"?4:s==="gray"?1:3;e=t[2].trim().split(/\s*[,\/]\s*|\s+/),s==="color"&&(s=e.shift()),e=e.map(function(h,u){if(h[h.length-1]==="%")return h=parseFloat(h)/100,u===3?h:s==="rgb"?h*255:s[0]==="h"||s[0]==="l"&&!u?h*100:s==="lab"?h*125:s==="lch"?u<2?h*150:h*360:s[0]==="o"&&!u?h:s==="oklab"?h*.4:s==="oklch"?u<2?h*.4:h*360:h;if(s[u]==="h"||u===2&&s[s.length-1]==="h"){if(so[h]!==void 0)return so[h];if(h.endsWith("deg"))return parseFloat(h);if(h.endsWith("turn"))return parseFloat(h)*360;if(h.endsWith("grad"))return parseFloat(h)*360/400;if(h.endsWith("rad"))return parseFloat(h)*180/Math.PI}return h==="none"?0:parseFloat(h)}),i=e.length>c?e.pop():1}else/[0-9](?:\s|\/|,)/.test(n)&&(e=n.match(/([0-9]+)/g).map(function(h){return parseFloat(h)}),s=n.match(/([a-z])/ig)?.join("")?.toLowerCase()||"rgb");return{space:s,values:e,alpha:i}}const ps={name:"hsl",min:[0,0,0],max:[360,100,100],channel:["hue","saturation","lightness"],alias:["HSL"],rgb:function(n){var t=n[0]/360,e=n[1]/100,i=n[2]/100,s,r,o,a,l,c=0;if(e===0)return l=i*255,[l,l,l];for(r=i<.5?i*(1+e):i+e-i*e,s=2*i-r,a=[0,0,0];c<3;)o=t+1/3*-(c-1),o<0?o++:o>1&&o--,l=6*o<1?s+(r-s)*6*o:2*o<1?r:3*o<2?s+(r-s)*(2/3-o)*6:s,a[c++]=l*255;return a}};Ui.hsl=function(n){var t=n[0]/255,e=n[1]/255,i=n[2]/255,s=Math.min(t,e,i),r=Math.max(t,e,i),o=r-s,a,l,c;return r===s?a=0:t===r?a=(e-i)/o:e===r?a=2+(i-t)/o:i===r&&(a=4+(t-e)/o),a=Math.min(a*60,360),a<0&&(a+=360),c=(s+r)/2,r===s?l=0:c<=.5?l=o/(r+s):l=o/(2-r-s),[a,l*100,c*100]};function Th(n){Array.isArray(n)&&n.raw&&(n=String.raw(...arguments)),n instanceof Number&&(n=+n);var t,e=Rh(n);if(!e.space)return[];const i=e.space[0]==="h"?ps.min:Ui.min,s=e.space[0]==="h"?ps.max:Ui.max;return t=Array(3),t[0]=Math.min(Math.max(e.values[0],i[0]),s[0]),t[1]=Math.min(Math.max(e.values[1],i[1]),s[1]),t[2]=Math.min(Math.max(e.values[2],i[2]),s[2]),e.space[0]==="h"&&(t=ps.rgb(t)),t.push(Math.min(Math.max(e.alpha,0),1)),t}const gr=[NaN,NaN,NaN,0];function Ih(n){return typeof n=="string"?n:mr(n)}const vh=1024,Mi={};let ys=0;function Sh(n){if(n.length===4)return n;const t=n.slice();return t[3]=1,t}function ro(n){const t=ft.lchuv(Ui.xyz(n));return t[3]=n[3],t}function Lh(n){const t=ft.rgb(la.xyz(n));return t[3]=n[3],t}function _r(n){if(n==="none")return gr;if(Mi.hasOwnProperty(n))return Mi[n];if(ys>=vh){let e=0;for(const i in Mi)e++&3||(delete Mi[i],--ys)}const t=Th(n);if(t.length!==4)throw new Error('failed to parse "'+n+'" as color');for(const e of t)if(isNaN(e))throw new Error('failed to parse "'+n+'" as color');return ha(t),Mi[n]=t,++ys,t}function ji(n){return Array.isArray(n)?n:_r(n)}function ha(n){return n[0]=st(n[0]+.5|0,0,255),n[1]=st(n[1]+.5|0,0,255),n[2]=st(n[2]+.5|0,0,255),n[3]=st(n[3],0,1),n}function mr(n){let t=n[0];t!=(t|0)&&(t=t+.5|0);let e=n[1];e!=(e|0)&&(e=e+.5|0);let i=n[2];i!=(i|0)&&(i=i+.5|0);const s=n[3]===void 0?1:Math.round(n[3]*1e3)/1e3;return"rgba("+t+","+e+","+i+","+s+")"}const Le=typeof navigator<"u"&&typeof navigator.userAgent<"u"?navigator.userAgent.toLowerCase():"",Ah=Le.includes("firefox"),Mh=Le.includes("safari")&&!Le.includes("chrom");Mh&&(Le.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(Le));const bh=Le.includes("webkit")&&!Le.includes("edge"),ca=Le.includes("macintosh"),ua=typeof devicePixelRatio<"u"?devicePixelRatio:1,da=typeof WorkerGlobalScope<"u"&&typeof OffscreenCanvas<"u"&&self instanceof WorkerGlobalScope,fa=typeof Image<"u"&&Image.prototype.decode,ga=function(){let n=!1;try{const t=Object.defineProperty({},"passive",{get:function(){n=!0}});window.addEventListener("_",null,t),window.removeEventListener("_",null,t)}catch{}return n}();function rt(n,t,e,i){let s;return e&&e.length?s=e.shift():da?s=new OffscreenCanvas(n||300,t||300):s=document.createElement("canvas"),n&&(s.width=n),t&&(s.height=t),s.getContext("2d",i)}let Es;function bn(){return Es||(Es=rt(1,1)),Es}function mi(n){const t=n.canvas;t.width=1,t.height=1,n.clearRect(0,0,1,1)}function oo(n,t){const e=t.parentNode;e&&e.replaceChild(n,t)}function Dh(n){for(;n.lastChild;)n.lastChild.remove()}function Ph(n,t){const e=n.childNodes;for(let i=0;;++i){const s=e[i],r=t[i];if(!s&&!r)break;if(s!==r){if(!s){n.appendChild(r);continue}if(!r){n.removeChild(s),--i;continue}n.insertBefore(r,s)}}}function Oh(n,t,e){const i=n;let s=!0,r=!1,o=!1;const a=[vn(i,z.LOAD,function(){o=!0,r||t()})];return i.src&&fa?(r=!0,i.decode().then(function(){s&&t()}).catch(function(l){s&&(o?t():e())})):a.push(vn(i,z.ERROR,e)),function(){s=!1,a.forEach(tt)}}function Fh(n,t){return new Promise((e,i)=>{function s(){o(),e(n)}function r(){o(),i(new Error("Image load error"))}function o(){n.removeEventListener("load",s),n.removeEventListener("error",r)}n.addEventListener("load",s),n.addEventListener("error",r)})}function kh(n,t){return t&&(n.src=t),n.src&&fa?new Promise((e,i)=>n.decode().then(()=>e(n)).catch(s=>n.complete&&n.width?e(n):i(s))):Fh(n)}class Nh{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=32}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const i=this.cache_[e];!(t++&3)&&!i.hasListener()&&(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,i){const s=xs(t,e,i);return s in this.cache_?this.cache_[s]:null}getPattern(t,e,i){const s=xs(t,e,i);return s in this.patternCache_?this.patternCache_[s]:null}set(t,e,i,s,r){const o=xs(t,e,i),a=o in this.cache_;this.cache_[o]=s,r&&(s.getImageState()===Y.IDLE&&s.load(),s.getImageState()===Y.LOADING?s.ready().then(()=>{this.patternCache_[o]=bn().createPattern(s.getImage(1),"repeat")}):this.patternCache_[o]=bn().createPattern(s.getImage(1),"repeat")),a||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}}function xs(n,t,e){const i=e?ji(e):"null";return t+":"+n+":"+i}const Ht=new Nh;let bi=null;class Gh extends Kn{constructor(t,e,i,s,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=i,this.canvas_={},this.color_=r,this.imageState_=s===void 0?Y.IDLE:s,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(this.tainted_===void 0&&this.imageState_===Y.LOADED){bi||(bi=rt(1,1,void 0,{willReadFrequently:!0})),bi.drawImage(this.image_,0,0);try{bi.getImageData(0,0,1,1),this.tainted_=!1}catch{bi=null,this.tainted_=!0}}return this.tainted_===!0}dispatchChangeEvent_(){this.dispatchEvent(z.CHANGE)}handleImageError_(){this.imageState_=Y.ERROR,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=Y.LOADED,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],i=rt(t,e);i.fillRect(0,0,t,e),this.hitDetectionImage_=i.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(this.imageState_===Y.IDLE){this.image_||this.initializeImage_(),this.imageState_=Y.LOADING;try{this.src_!==void 0&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&kh(this.image_,this.src_).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}}replaceColor_(t){if(!this.color_||this.canvas_[t]||this.imageState_!==Y.LOADED)return;const e=this.image_,i=rt(Math.ceil(e.width*t),Math.ceil(e.height*t)),s=i.canvas;i.scale(t,t),i.drawImage(e,0,0),i.globalCompositeOperation="multiply",i.fillStyle=Ih(this.color_),i.fillRect(0,0,s.width/t,s.height/t),i.globalCompositeOperation="destination-in",i.drawImage(e,0,0),this.canvas_[t]=s}ready(){return this.ready_||(this.ready_=new Promise(t=>{if(this.imageState_===Y.LOADED||this.imageState_===Y.ERROR)t();else{const e=()=>{(this.imageState_===Y.LOADED||this.imageState_===Y.ERROR)&&(this.removeEventListener(z.CHANGE,e),t())};this.addEventListener(z.CHANGE,e)}})),this.ready_}}function pr(n,t,e,i,s,r){let o=t===void 0?void 0:Ht.get(t,e,s);return o||(o=new Gh(n,n&&"src"in n?n.src||void 0:t,e,i,s),Ht.set(t,e,s,o,r)),r&&o&&!Ht.getPattern(t,e,s)&&Ht.set(t,e,s,o,r),o}function qt(n){return n?Array.isArray(n)?mr(n):typeof n=="object"&&"src"in n?zh(n):n:null}function zh(n){if(!n.offset||!n.size)return Ht.getPattern(n.src,"anonymous",n.color);const t=n.src+":"+n.offset,e=Ht.getPattern(t,void 0,n.color);if(e)return e;const i=Ht.get(n.src,"anonymous",null);if(i.getImageState()!==Y.LOADED)return null;const s=rt(n.size[0],n.size[1]);return s.drawImage(i.getImage(1),n.offset[0],n.offset[1],n.size[0],n.size[1],0,0,n.size[0],n.size[1]),pr(s.canvas,t,void 0,Y.LOADED,n.color,!0),Ht.getPattern(t,void 0,n.color)}const wn="ol-hidden",ts="ol-unselectable",yr="ol-control",ao="ol-collapsed",Xh=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))",`?\\s*([-,\\"\\'\\sa-z]+?)\\s*$`].join(""),"i"),lo=["style","variant","weight","size","lineHeight","family"],_a=function(n){const t=n.match(Xh);if(!t)return null;const e={lineHeight:"normal",size:"1.2em",style:"normal",weight:"normal",variant:"normal"};for(let i=0,s=lo.length;i{navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(d.configurationFile).then(()=>{s.value=!0,setTimeout(()=>{s.value=!1},3e3)}).catch(()=>{n.newMessage("WGDashboard","Failed to copy","danger")}):(document.querySelector("#peerConfigurationFile").select(),document.execCommand("copy")?(s.value=!0,setTimeout(()=>{s.value=!1},3e3)):n.newMessage("WGDashboard","Failed to copy","danger"))};return(p,t)=>(o(),a("div",y,[e("div",x,[e("div",w,[e("div",C,[e("div",k,[e("h4",F,[l(v,{t:"Peer Configuration File"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=b=>c("close"))})]),e("div",T,[e("div",D,[e("button",{onClick:t[1]||(t[1]=b=>u()),disabled:s.value,class:"ms-auto btn bg-primary-subtle border-primary-subtle text-primary-emphasis rounded-3 position-relative"},[l(h,{name:"slide-up",mode:"out-in"},{default:g(()=>[s.value?(o(),a("span",M,t[3]||(t[3]=[e("i",{class:"bi bi-check-circle-fill"},null,-1)]))):(o(),a("span",B,t[2]||(t[2]=[e("i",{class:"bi bi-clipboard-fill"},null,-1)])))]),_:1})],8,S)]),e("textarea",{style:{height:"300px"},class:"form-control w-100 rounded-3 mt-2",disabled:"",id:"peerConfigurationFile",value:i.configurationFile},null,8,G)])])])])]))}},W=f(L,[["__scopeId","data-v-e8a2c914"]]);export{W as default}; +import{_ as f,D as m,r as _,a as s,c as a,b as e,d as l,w as g,T as h}from"./index-DOaPWS1X.js";import{L as v}from"./localeText-CaAXeE0W.js";const y={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0"},x={class:"container d-flex h-100 w-100"},w={class:"m-auto modal-dialog-centered dashboardModal justify-content-center"},C={class:"card rounded-3 shadow w-100"},k={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},F={class:"mb-0"},T={class:"card-body p-4"},D={class:"d-flex"},S=["disabled"],B={key:0,class:"d-block"},M={key:1,class:"d-block",id:"check"},G=["value"],L={__name:"peerConfigurationFile",props:{configurationFile:String},emits:["close"],setup(i,{emit:r}){const c=r,d=i,n=m(),o=_(!1),u=async()=>{navigator.clipboard&&navigator.clipboard.writeText?navigator.clipboard.writeText(d.configurationFile).then(()=>{o.value=!0,setTimeout(()=>{o.value=!1},3e3)}).catch(()=>{n.newMessage("WGDashboard","Failed to copy","danger")}):(document.querySelector("#peerConfigurationFile").select(),document.execCommand("copy")?(o.value=!0,setTimeout(()=>{o.value=!1},3e3)):n.newMessage("WGDashboard","Failed to copy","danger"))};return(p,t)=>(s(),a("div",y,[e("div",x,[e("div",w,[e("div",C,[e("div",k,[e("h4",F,[l(v,{t:"Peer Configuration File"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=b=>c("close"))})]),e("div",T,[e("div",D,[e("button",{onClick:t[1]||(t[1]=b=>u()),disabled:o.value,class:"ms-auto btn bg-primary-subtle border-primary-subtle text-primary-emphasis rounded-3 position-relative"},[l(h,{name:"slide-up",mode:"out-in"},{default:g(()=>[o.value?(s(),a("span",M,t[3]||(t[3]=[e("i",{class:"bi bi-check-circle-fill"},null,-1)]))):(s(),a("span",B,t[2]||(t[2]=[e("i",{class:"bi bi-clipboard-fill"},null,-1)])))]),_:1})],8,S)]),e("textarea",{style:{height:"300px"},class:"form-control w-100 rounded-3 mt-2",id:"peerConfigurationFile",value:i.configurationFile},null,8,G)])])])])]))}},W=f(L,[["__scopeId","data-v-fcd3ae95"]]);export{W as default}; diff --git a/src/static/app/dist/assets/peerConfigurationFile-CNB9RKjb.css b/src/static/app/dist/assets/peerConfigurationFile-CNB9RKjb.css new file mode 100644 index 0000000..7b682a9 --- /dev/null +++ b/src/static/app/dist/assets/peerConfigurationFile-CNB9RKjb.css @@ -0,0 +1 @@ +.slide-up-enter-active[data-v-fcd3ae95],.slide-up-leave-active[data-v-fcd3ae95]{transition:all .2s cubic-bezier(.42,0,.22,1)}.slide-up-enter-from[data-v-fcd3ae95],.slide-up-leave-to[data-v-fcd3ae95]{opacity:0;transform:scale(.9)}@keyframes spin-fcd3ae95{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#check[data-v-fcd3ae95]{animation:cubic-bezier(.42,0,.22,1.3) .7s spin-fcd3ae95} diff --git a/src/static/app/dist/assets/peerConfigurationFile-fak3wop9.css b/src/static/app/dist/assets/peerConfigurationFile-fak3wop9.css deleted file mode 100644 index fab6172..0000000 --- a/src/static/app/dist/assets/peerConfigurationFile-fak3wop9.css +++ /dev/null @@ -1 +0,0 @@ -.slide-up-enter-active[data-v-e8a2c914],.slide-up-leave-active[data-v-e8a2c914]{transition:all .2s cubic-bezier(.42,0,.22,1)}.slide-up-enter-from[data-v-e8a2c914],.slide-up-leave-to[data-v-e8a2c914]{opacity:0;transform:scale(.9)}@keyframes spin-e8a2c914{0%{transform:rotate(0)}to{transform:rotate(360deg)}}#check[data-v-e8a2c914]{animation:cubic-bezier(.42,0,.22,1.3) .7s spin-e8a2c914} diff --git a/src/static/app/dist/assets/peerCreate-C7F1RHXB.js b/src/static/app/dist/assets/peerCreate-B_n86hyd.js similarity index 99% rename from src/static/app/dist/assets/peerCreate-C7F1RHXB.js rename to src/static/app/dist/assets/peerCreate-B_n86hyd.js index bc87815..d21a606 100644 --- a/src/static/app/dist/assets/peerCreate-C7F1RHXB.js +++ b/src/static/app/dist/assets/peerCreate-B_n86hyd.js @@ -1 +1 @@ -import{_ as b,a as n,c as r,b as e,d as o,m as p,s as u,n as h,j as d,D as g,W as y,v as I,G as L,w as C,F as S,h as P,f as K,t as x,k as E,e as f,g as F,q as G,i as k}from"./index-BPNEscAR.js";import{L as _}from"./localeText-DX813vQA.js";const O={name:"nameInput",components:{LocaleText:_},props:{bulk:Boolean,data:Object,saving:Boolean}},R={for:"peer_name_textbox",class:"form-label"},j={class:"text-muted"},q=["disabled"];function W(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",{class:h({inactiveField:this.bulk})},[e("label",R,[e("small",j,[o(l,{t:"Name"})])]),p(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving||this.bulk,"onUpdate:modelValue":t[0]||(t[0]=a=>this.data.name=a),id:"peer_name_textbox",placeholder:""},null,8,q),[[u,this.data.name]])],2)}const J=b(O,[["render",W]]),z={name:"privatePublicKeyInput",components:{LocaleText:_},props:{data:Object,saving:Boolean,bulk:Boolean},setup(){const s=g(),t=y();return{dashboardStore:s,wgStore:t}},data(){return{keypair:{publicKey:"",privateKey:"",presharedKey:""},editKey:!1,error:!1}},methods:{genKeyPair(){this.editKey=!1,this.keypair=window.wireguard.generateKeypair(),this.data.private_key=this.keypair.privateKey,this.data.public_key=this.keypair.publicKey},testKey(s){return/^[A-Za-z0-9+/]{43}=?=?$/.test(s)},checkMatching(){try{this.keypair.privateKey&&this.wgStore.checkWGKeyLength(this.keypair.privateKey)&&(this.keypair.publicKey=window.wireguard.generatePublicKey(this.keypair.privateKey),window.wireguard.generatePublicKey(this.keypair.privateKey)!==this.keypair.publicKey?(this.error=!0,this.dashboardStore.newMessage("WGDashboard","Private key does not match with the public key","danger")):(this.data.private_key=this.keypair.privateKey,this.data.public_key=this.keypair.publicKey))}catch{this.error=!0,this.data.private_key="",this.data.public_key=""}}},mounted(){this.genKeyPair()},watch:{keypair:{deep:!0,handler(){this.error=!1,this.checkMatching()}}}},H={for:"peer_private_key_textbox",class:"form-label"},Q={class:"text-muted"},Y={class:"input-group"},Z=["disabled"],X=["disabled"],ee={class:"d-flex"},te={for:"public_key",class:"form-label"},se={class:"text-muted"},ae={class:"form-check form-switch ms-auto"},le=["disabled"],oe={class:"form-check-label",for:"enablePublicKeyEdit"},ie=["disabled"];function ne(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",{class:h(["d-flex gap-2 flex-column",{inactiveField:this.bulk}])},[e("div",null,[e("label",H,[e("small",Q,[o(l,{t:"Private Key"}),e("code",null,[o(l,{t:"(Required for QR Code and Download)"})])])]),e("div",Y,[p(e("input",{type:"text",class:h(["form-control form-control-sm rounded-start-3",{"is-invalid":this.error}]),"onUpdate:modelValue":t[0]||(t[0]=a=>this.keypair.privateKey=a),disabled:!this.editKey||this.bulk,onBlur:t[1]||(t[1]=a=>this.checkMatching()),id:"peer_private_key_textbox"},null,42,Z),[[u,this.keypair.privateKey]]),e("button",{class:"btn btn-outline-info btn-sm rounded-end-3",onClick:t[2]||(t[2]=a=>this.genKeyPair()),disabled:this.bulk,type:"button",id:"button-addon2"},t[6]||(t[6]=[e("i",{class:"bi bi-arrow-repeat"},null,-1)]),8,X)])]),e("div",null,[e("div",ee,[e("label",te,[e("small",se,[o(l,{t:"Public Key"}),e("code",null,[o(l,{t:"(Required)"})])])]),e("div",ae,[p(e("input",{class:"form-check-input",type:"checkbox",role:"switch",disabled:this.bulk,id:"enablePublicKeyEdit","onUpdate:modelValue":t[3]||(t[3]=a=>this.editKey=a)},null,8,le),[[I,this.editKey]]),e("label",oe,[e("small",null,[o(l,{t:"Use your own Private and Public Key"})])])])]),p(e("input",{class:h(["form-control-sm form-control rounded-3",{"is-invalid":this.error}]),"onUpdate:modelValue":t[4]||(t[4]=a=>this.keypair.publicKey=a),onBlur:t[5]||(t[5]=a=>this.checkMatching()),disabled:!this.editKey||this.bulk,type:"text",id:"public_key"},null,42,ie),[[u,this.keypair.publicKey]])])],2)}const de=b(z,[["render",ne]]),re={name:"allowedIPsInput",components:{LocaleText:_},props:{data:Object,saving:Boolean,bulk:Boolean,availableIp:void 0},data(){return{allowedIp:[],availableIpSearchString:"",customAvailableIp:"",allowedIpFormatError:!1}},setup(){const s=y(),t=g();return{store:s,dashboardStore:t}},computed:{searchAvailableIps(){return this.availableIpSearchString?this.availableIp.filter(s=>s.includes(this.availableIpSearchString)&&!this.data.allowed_ips.includes(s)):this.availableIp.filter(s=>!this.data.allowed_ips.includes(s))},inputGetLocale(){return L("Enter IP Address/CIDR")}},methods:{addAllowedIp(s){return this.store.checkCIDR(s)?(this.data.allowed_ips.push(s),this.customAvailableIp="",!0):(this.allowedIpFormatError=!0,this.dashboardStore.newMessage("WGDashboard","Allowed IPs is invalid","danger"),!1)}},watch:{customAvailableIp(){this.allowedIpFormatError=!1},availableIp(){this.availableIp!==void 0&&this.availableIp.length>0&&this.addAllowedIp(this.availableIp[0])}},mounted(){}},ce={for:"peer_allowed_ip_textbox",class:"form-label"},pe={class:"text-muted"},ue=["onClick"],he={class:"d-flex gap-2 align-items-center"},be={class:"input-group"},_e=["placeholder","disabled"],me=["disabled"],ve={class:"text-muted"},fe={class:"dropdown flex-grow-1"},ke=["disabled"],ge={key:0,class:"dropdown-menu mt-2 shadow w-100 dropdown-menu-end rounded-3",style:{"overflow-y":"scroll","max-height":"270px",width:"300px !important"}},ye={class:"px-3 pb-2 pt-1 d-flex gap-3 align-items-center"},we=["onClick"],Ie={class:"me-auto"},xe={key:0},$e={class:"px-3 text-muted"};function Ae(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",{class:h({inactiveField:this.bulk})},[e("label",ce,[e("small",pe,[o(l,{t:"Allowed IPs"}),e("code",null,[o(l,{t:"(Required)"})])])]),e("div",{class:h(["d-flex gap-2 flex-wrap",{"mb-2":this.data.allowed_ips.length>0}])},[o(E,{name:"list"},{default:C(()=>[(n(!0),r(S,null,P(this.data.allowed_ips,(a,w)=>(n(),r("span",{class:"badge rounded-pill text-bg-success",key:a},[K(x(a)+" ",1),e("a",{role:"button",onClick:$=>this.data.allowed_ips.splice(w,1)},t[3]||(t[3]=[e("i",{class:"bi bi-x-circle-fill ms-1"},null,-1)]),8,ue)]))),128))]),_:1})],2),e("div",he,[e("div",be,[p(e("input",{type:"text",class:h(["form-control form-control-sm rounded-start-3",{"is-invalid":this.allowedIpFormatError}]),placeholder:this.inputGetLocale,"onUpdate:modelValue":t[0]||(t[0]=a=>i.customAvailableIp=a),disabled:c.bulk},null,10,_e),[[u,i.customAvailableIp]]),e("button",{class:"btn btn-outline-success btn-sm rounded-end-3",disabled:c.bulk||!this.customAvailableIp,onClick:t[1]||(t[1]=a=>this.addAllowedIp(this.customAvailableIp)),type:"button",id:"button-addon2"},t[4]||(t[4]=[e("i",{class:"bi bi-plus-lg"},null,-1)]),8,me)]),e("small",ve,[o(l,{t:"or"})]),e("div",fe,[e("button",{class:"btn btn-outline-secondary btn-sm dropdown-toggle rounded-3 w-100",disabled:!c.availableIp||c.bulk,"data-bs-auto-close":"outside",type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[t[5]||(t[5]=e("i",{class:"bi bi-filter-circle me-2"},null,-1)),o(l,{t:"Pick Available IP"})],8,ke),this.availableIp?(n(),r("ul",ge,[e("li",null,[e("div",ye,[t[6]||(t[6]=e("label",{for:"availableIpSearchString",class:"text-muted"},[e("i",{class:"bi bi-search"})],-1)),p(e("input",{id:"availableIpSearchString",class:"form-control form-control-sm rounded-3","onUpdate:modelValue":t[2]||(t[2]=a=>this.availableIpSearchString=a)},null,512),[[u,this.availableIpSearchString]])])]),(n(!0),r(S,null,P(this.searchAvailableIps,a=>(n(),r("li",null,[e("a",{class:"dropdown-item d-flex",role:"button",onClick:w=>this.addAllowedIp(a)},[e("span",Ie,[e("small",null,x(a),1)])],8,we)]))),256)),this.searchAvailableIps.length===0?(n(),r("li",xe,[e("small",$e,[o(l,{t:"No available IP containing"}),K(' "'+x(this.availableIpSearchString)+'"',1)])])):f("",!0)])):f("",!0)])])],2)}const Se=b(re,[["render",Ae],["__scopeId","data-v-6d5fc831"]]),Pe={name:"dnsInput",components:{LocaleText:_},props:{data:Object,saving:Boolean},data(){return{error:!1,dns:JSON.parse(JSON.stringify(this.data.DNS))}},setup(){const s=y(),t=g();return{store:s,dashboardStore:t}},methods:{checkDNS(){if(this.dns){let s=this.dns.split(",").map(t=>t.replaceAll(" ",""));for(let t in s)if(!this.store.regexCheckIP(s[t])){this.error||this.dashboardStore.newMessage("WGDashboard","DNS format is incorrect","danger"),this.error=!0,this.data.DNS="";return}this.error=!1,this.data.DNS=this.dns}}},watch:{dns(){this.checkDNS()}}},Ke={for:"peer_DNS_textbox",class:"form-label"},Le={class:"text-muted"},Ce=["disabled"];function De(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",null,[e("label",Ke,[e("small",Le,[o(l,{t:"DNS"})])]),p(e("input",{type:"text",class:h(["form-control form-control-sm rounded-3",{"is-invalid":this.error}]),disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.dns=a),id:"peer_DNS_textbox"},null,10,Ce),[[u,this.dns]])])}const Te=b(Pe,[["render",De]]),Be={name:"endpointAllowedIps",components:{LocaleText:_},props:{data:Object,saving:Boolean},setup(){const s=y(),t=g();return{store:s,dashboardStore:t}},data(){return{endpointAllowedIps:JSON.parse(JSON.stringify(this.data.endpoint_allowed_ip)),error:!1}},methods:{checkAllowedIP(){let s=this.endpointAllowedIps.split(",").map(t=>t.replaceAll(" ",""));for(let t in s)if(!this.store.checkCIDR(s[t])){this.error||this.dashboardStore.newMessage("WGDashboard","Endpoint Allowed IPs format is incorrect","danger"),this.data.endpoint_allowed_ip="",this.error=!0;return}this.error=!1,this.data.endpoint_allowed_ip=this.endpointAllowedIps}},watch:{endpointAllowedIps(){this.checkAllowedIP()}}},Ne={for:"peer_endpoint_allowed_ips",class:"form-label"},Ve={class:"text-muted"},Ue=["disabled"];function Me(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",null,[e("label",Ne,[e("small",Ve,[o(l,{t:"Endpoint Allowed IPs"}),e("code",null,[o(l,{t:"(Required)"})])])]),p(e("input",{type:"text",class:h(["form-control form-control-sm rounded-3",{"is-invalid":i.error}]),disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.endpointAllowedIps=a),onBlur:t[1]||(t[1]=a=>this.checkAllowedIP()),id:"peer_endpoint_allowed_ips"},null,42,Ue),[[u,this.endpointAllowedIps]])])}const Ee=b(Be,[["render",Me]]),Fe={name:"presharedKeyInput",components:{LocaleText:_},props:{data:Object,saving:Boolean},data(){return{enable:!1}},watch:{enable(){this.enable?this.data.preshared_key=window.wireguard.generateKeypair().presharedKey:this.data.preshared_key=""}}},Ge={class:"d-flex align-items-start"},Oe={for:"peer_preshared_key_textbox",class:"form-label"},Re={class:"text-muted"},je={class:"form-check form-switch ms-auto"},qe=["disabled"];function We(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",null,[e("div",Ge,[e("label",Oe,[e("small",Re,[o(l,{t:"Pre-Shared Key"})])]),e("div",je,[p(e("input",{class:"form-check-input",type:"checkbox",role:"switch","onUpdate:modelValue":t[0]||(t[0]=a=>this.enable=a),id:"peer_preshared_key_switch"},null,512),[[I,this.enable]])])]),p(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving||!this.enable,"onUpdate:modelValue":t[1]||(t[1]=a=>this.data.preshared_key=a),id:"peer_preshared_key_textbox"},null,8,qe),[[u,this.data.preshared_key]])])}const Je=b(Fe,[["render",We]]),ze={name:"mtuInput",components:{LocaleText:_},props:{data:Object,saving:Boolean}},He={for:"peer_mtu",class:"form-label"},Qe={class:"text-muted"},Ye=["disabled"];function Ze(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",null,[e("label",He,[e("small",Qe,[o(l,{t:"MTU"})])]),p(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.data.mtu=a),min:"0",id:"peer_mtu"},null,8,Ye),[[u,this.data.mtu]])])}const Xe=b(ze,[["render",Ze]]),et={name:"persistentKeepAliveInput",components:{LocaleText:_},props:{data:Object,saving:Boolean}},tt={for:"peer_keep_alive",class:"form-label"},st={class:"text-muted"},at=["disabled"];function lt(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",null,[e("label",tt,[e("small",st,[o(l,{t:"Persistent Keepalive"})])]),p(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.data.keepalive=a),id:"peer_keep_alive"},null,8,at),[[u,this.data.keepalive]])])}const ot=b(et,[["render",lt]]),it={name:"bulkAdd",components:{LocaleText:_},props:{saving:Boolean,data:Object,availableIp:void 0},computed:{bulkAddGetLocale(){return L("How many peers you want to add?")}}},nt={class:"form-check form-switch"},dt=["disabled"],rt={class:"form-check-label me-2",for:"bulk_add"},ct={class:"text-muted d-block"},pt={key:0,class:"form-group"},ut=["max","placeholder"],ht={class:"text-muted"};function bt(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",null,[e("div",nt,[p(e("input",{class:"form-check-input",type:"checkbox",role:"switch",disabled:!this.availableIp,id:"bulk_add","onUpdate:modelValue":t[0]||(t[0]=a=>this.data.bulkAdd=a)},null,8,dt),[[I,this.data.bulkAdd]]),e("label",rt,[e("small",null,[e("strong",null,[o(l,{t:"Bulk Add"})])])])]),e("p",{class:h({"mb-0":!this.data.bulkAdd})},[e("small",ct,[o(l,{t:"By adding peers by bulk, each peer's name will be auto generated, and Allowed IP will be assign to the next available IP."})])],2),this.data.bulkAdd?(n(),r("div",pt,[p(e("input",{class:"form-control form-control-sm rounded-3 mb-1",type:"number",min:"1",max:this.availableIp.length,"onUpdate:modelValue":t[1]||(t[1]=a=>this.data.bulkAddAmount=a),placeholder:this.bulkAddGetLocale},null,8,ut),[[u,this.data.bulkAddAmount]]),e("small",ht,[o(l,{t:"You can add up to "+this.availableIp.length+" peers"},null,8,["t"])])])):f("",!0)])}const _t=b(it,[["render",bt]]),mt={name:"peerCreate",components:{LocaleText:_,BulkAdd:_t,PersistentKeepAliveInput:ot,MtuInput:Xe,PresharedKeyInput:Je,EndpointAllowedIps:Ee,DnsInput:Te,AllowedIPsInput:Se,PrivatePublicKeyInput:de,NameInput:J},data(){return{data:{bulkAdd:!1,bulkAddAmount:0,name:"",allowed_ips:[],private_key:"",public_key:"",DNS:this.dashboardStore.Configuration.Peers.peer_global_dns,endpoint_allowed_ip:this.dashboardStore.Configuration.Peers.peer_endpoint_allowed_ip,keepalive:parseInt(this.dashboardStore.Configuration.Peers.peer_keep_alive),mtu:parseInt(this.dashboardStore.Configuration.Peers.peer_mtu),preshared_key:"",preshared_key_bulkAdd:!1},availableIp:void 0,availableIpSearchString:"",saving:!1,allowedIpDropdown:void 0}},mounted(){F("/api/getAvailableIPs/"+this.$route.params.id,{},s=>{s.status&&(this.availableIp=s.data)})},setup(){const s=y(),t=g();return{store:s,dashboardStore:t}},methods:{peerCreate(){this.saving=!0,G("/api/addPeers/"+this.$route.params.id,this.data,s=>{s.status?(this.$router.push(`/configuration/${this.$route.params.id}/peers`),this.dashboardStore.newMessage("Server","Peer created successfully","success")):this.dashboardStore.newMessage("Server",s.message,"danger"),this.saving=!1})}},computed:{allRequireFieldsFilled(){let s=!0;return this.data.bulkAdd?(this.data.bulkAddAmount.length===0||this.data.bulkAddAmount>this.availableIp.length)&&(s=!1):["allowed_ips","private_key","public_key","endpoint_allowed_ip","keepalive","mtu"].forEach(c=>{this.data[c].length===0&&(s=!1)}),s}},watch:{bulkAdd(s){s||(this.data.bulkAddAmount="")},"data.bulkAddAmount"(){this.data.bulkAddAmount>this.availableIp.length&&(this.data.bulkAddAmount=this.availableIp.length)}}},vt={class:"container"},ft={class:"mb-4"},kt={class:"mb-5 d-flex align-items-center gap-4"},gt={class:"mb-0"},yt={class:"d-flex flex-column gap-2"},wt={class:"row gy-3"},It={key:0,class:"col-sm"},xt={class:"col-sm"},$t={class:"col-sm"},At={key:1,class:"col-12"},St={class:"form-check form-switch"},Pt={class:"form-check-label",for:"bullAdd_PresharedKey_Switch"},Kt={class:"fw-bold"},Lt={class:"d-flex mt-2"},Ct=["disabled"],Dt={key:0,class:"bi bi-plus-circle-fill me-2"};function Tt(s,t,c,m,i,v){const l=d("RouterLink"),a=d("LocaleText"),w=d("BulkAdd"),$=d("NameInput"),D=d("PrivatePublicKeyInput"),T=d("AllowedIPsInput"),B=d("EndpointAllowedIps"),N=d("DnsInput"),V=d("PresharedKeyInput"),U=d("MtuInput"),M=d("PersistentKeepAliveInput");return n(),r("div",vt,[e("div",ft,[e("div",kt,[o(l,{to:"peers",class:"btn btn-dark btn-brand p-2 shadow",style:{"border-radius":"100%"}},{default:C(()=>t[2]||(t[2]=[e("h2",{class:"mb-0",style:{"line-height":"0"}},[e("i",{class:"bi bi-arrow-left-circle"})],-1)])),_:1}),e("h2",gt,[o(a,{t:"Add Peers"})])])]),e("div",yt,[o(w,{saving:i.saving,data:this.data,availableIp:this.availableIp},null,8,["saving","data","availableIp"]),t[3]||(t[3]=e("hr",{class:"mb-0 mt-2"},null,-1)),this.data.bulkAdd?f("",!0):(n(),k($,{key:0,saving:i.saving,data:this.data},null,8,["saving","data"])),this.data.bulkAdd?f("",!0):(n(),k(D,{key:1,saving:i.saving,data:i.data},null,8,["saving","data"])),this.data.bulkAdd?f("",!0):(n(),k(T,{key:2,availableIp:this.availableIp,saving:i.saving,data:i.data},null,8,["availableIp","saving","data"])),o(B,{saving:i.saving,data:i.data},null,8,["saving","data"]),o(N,{saving:i.saving,data:i.data},null,8,["saving","data"]),t[4]||(t[4]=e("hr",{class:"mb-0 mt-2"},null,-1)),e("div",wt,[this.data.bulkAdd?f("",!0):(n(),r("div",It,[o(V,{saving:i.saving,data:i.data,bulk:this.data.bulkAdd},null,8,["saving","data","bulk"])])),e("div",xt,[o(U,{saving:i.saving,data:i.data},null,8,["saving","data"])]),e("div",$t,[o(M,{saving:i.saving,data:i.data},null,8,["saving","data"])]),this.data.bulkAdd?(n(),r("div",At,[e("div",St,[p(e("input",{class:"form-check-input",type:"checkbox",role:"switch","onUpdate:modelValue":t[0]||(t[0]=A=>this.data.preshared_key_bulkAdd=A),id:"bullAdd_PresharedKey_Switch",checked:""},null,512),[[I,this.data.preshared_key_bulkAdd]]),e("label",Pt,[e("small",Kt,[o(a,{t:"Pre-Shared Key"}),this.data.preshared_key_bulkAdd?(n(),k(a,{key:0,t:"Enabled"})):(n(),k(a,{key:1,t:"Disabled"}))])])])])):f("",!0)]),e("div",Lt,[e("button",{class:"ms-auto btn btn-dark btn-brand rounded-3 px-3 py-2 shadow",disabled:!this.allRequireFieldsFilled||this.saving,onClick:t[1]||(t[1]=A=>this.peerCreate())},[this.saving?f("",!0):(n(),r("i",Dt)),this.saving?(n(),k(a,{key:1,t:"Adding..."})):(n(),k(a,{key:2,t:"Add"}))],8,Ct)])])])}const Vt=b(mt,[["render",Tt],["__scopeId","data-v-17eb547c"]]);export{Vt as default}; +import{_ as b,a as n,c as r,b as e,d as o,m as p,s as u,n as h,j as d,D as g,W as y,v as I,G as L,w as C,F as S,h as P,f as K,t as x,k as E,e as f,g as F,q as G,i as k}from"./index-DOaPWS1X.js";import{L as _}from"./localeText-CaAXeE0W.js";const O={name:"nameInput",components:{LocaleText:_},props:{bulk:Boolean,data:Object,saving:Boolean}},R={for:"peer_name_textbox",class:"form-label"},j={class:"text-muted"},q=["disabled"];function W(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",{class:h({inactiveField:this.bulk})},[e("label",R,[e("small",j,[o(l,{t:"Name"})])]),p(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving||this.bulk,"onUpdate:modelValue":t[0]||(t[0]=a=>this.data.name=a),id:"peer_name_textbox",placeholder:""},null,8,q),[[u,this.data.name]])],2)}const J=b(O,[["render",W]]),z={name:"privatePublicKeyInput",components:{LocaleText:_},props:{data:Object,saving:Boolean,bulk:Boolean},setup(){const s=g(),t=y();return{dashboardStore:s,wgStore:t}},data(){return{keypair:{publicKey:"",privateKey:"",presharedKey:""},editKey:!1,error:!1}},methods:{genKeyPair(){this.editKey=!1,this.keypair=window.wireguard.generateKeypair(),this.data.private_key=this.keypair.privateKey,this.data.public_key=this.keypair.publicKey},testKey(s){return/^[A-Za-z0-9+/]{43}=?=?$/.test(s)},checkMatching(){try{this.keypair.privateKey&&this.wgStore.checkWGKeyLength(this.keypair.privateKey)&&(this.keypair.publicKey=window.wireguard.generatePublicKey(this.keypair.privateKey),window.wireguard.generatePublicKey(this.keypair.privateKey)!==this.keypair.publicKey?(this.error=!0,this.dashboardStore.newMessage("WGDashboard","Private key does not match with the public key","danger")):(this.data.private_key=this.keypair.privateKey,this.data.public_key=this.keypair.publicKey))}catch{this.error=!0,this.data.private_key="",this.data.public_key=""}}},mounted(){this.genKeyPair()},watch:{keypair:{deep:!0,handler(){this.error=!1,this.checkMatching()}}}},H={for:"peer_private_key_textbox",class:"form-label"},Q={class:"text-muted"},Y={class:"input-group"},Z=["disabled"],X=["disabled"],ee={class:"d-flex"},te={for:"public_key",class:"form-label"},se={class:"text-muted"},ae={class:"form-check form-switch ms-auto"},le=["disabled"],oe={class:"form-check-label",for:"enablePublicKeyEdit"},ie=["disabled"];function ne(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",{class:h(["d-flex gap-2 flex-column",{inactiveField:this.bulk}])},[e("div",null,[e("label",H,[e("small",Q,[o(l,{t:"Private Key"}),e("code",null,[o(l,{t:"(Required for QR Code and Download)"})])])]),e("div",Y,[p(e("input",{type:"text",class:h(["form-control form-control-sm rounded-start-3",{"is-invalid":this.error}]),"onUpdate:modelValue":t[0]||(t[0]=a=>this.keypair.privateKey=a),disabled:!this.editKey||this.bulk,onBlur:t[1]||(t[1]=a=>this.checkMatching()),id:"peer_private_key_textbox"},null,42,Z),[[u,this.keypair.privateKey]]),e("button",{class:"btn btn-outline-info btn-sm rounded-end-3",onClick:t[2]||(t[2]=a=>this.genKeyPair()),disabled:this.bulk,type:"button",id:"button-addon2"},t[6]||(t[6]=[e("i",{class:"bi bi-arrow-repeat"},null,-1)]),8,X)])]),e("div",null,[e("div",ee,[e("label",te,[e("small",se,[o(l,{t:"Public Key"}),e("code",null,[o(l,{t:"(Required)"})])])]),e("div",ae,[p(e("input",{class:"form-check-input",type:"checkbox",role:"switch",disabled:this.bulk,id:"enablePublicKeyEdit","onUpdate:modelValue":t[3]||(t[3]=a=>this.editKey=a)},null,8,le),[[I,this.editKey]]),e("label",oe,[e("small",null,[o(l,{t:"Use your own Private and Public Key"})])])])]),p(e("input",{class:h(["form-control-sm form-control rounded-3",{"is-invalid":this.error}]),"onUpdate:modelValue":t[4]||(t[4]=a=>this.keypair.publicKey=a),onBlur:t[5]||(t[5]=a=>this.checkMatching()),disabled:!this.editKey||this.bulk,type:"text",id:"public_key"},null,42,ie),[[u,this.keypair.publicKey]])])],2)}const de=b(z,[["render",ne]]),re={name:"allowedIPsInput",components:{LocaleText:_},props:{data:Object,saving:Boolean,bulk:Boolean,availableIp:void 0},data(){return{allowedIp:[],availableIpSearchString:"",customAvailableIp:"",allowedIpFormatError:!1}},setup(){const s=y(),t=g();return{store:s,dashboardStore:t}},computed:{searchAvailableIps(){return this.availableIpSearchString?this.availableIp.filter(s=>s.includes(this.availableIpSearchString)&&!this.data.allowed_ips.includes(s)):this.availableIp.filter(s=>!this.data.allowed_ips.includes(s))},inputGetLocale(){return L("Enter IP Address/CIDR")}},methods:{addAllowedIp(s){return this.store.checkCIDR(s)?(this.data.allowed_ips.push(s),this.customAvailableIp="",!0):(this.allowedIpFormatError=!0,this.dashboardStore.newMessage("WGDashboard","Allowed IPs is invalid","danger"),!1)}},watch:{customAvailableIp(){this.allowedIpFormatError=!1},availableIp(){this.availableIp!==void 0&&this.availableIp.length>0&&this.addAllowedIp(this.availableIp[0])}},mounted(){}},ce={for:"peer_allowed_ip_textbox",class:"form-label"},pe={class:"text-muted"},ue=["onClick"],he={class:"d-flex gap-2 align-items-center"},be={class:"input-group"},_e=["placeholder","disabled"],me=["disabled"],ve={class:"text-muted"},fe={class:"dropdown flex-grow-1"},ke=["disabled"],ge={key:0,class:"dropdown-menu mt-2 shadow w-100 dropdown-menu-end rounded-3",style:{"overflow-y":"scroll","max-height":"270px",width:"300px !important"}},ye={class:"px-3 pb-2 pt-1 d-flex gap-3 align-items-center"},we=["onClick"],Ie={class:"me-auto"},xe={key:0},$e={class:"px-3 text-muted"};function Ae(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",{class:h({inactiveField:this.bulk})},[e("label",ce,[e("small",pe,[o(l,{t:"Allowed IPs"}),e("code",null,[o(l,{t:"(Required)"})])])]),e("div",{class:h(["d-flex gap-2 flex-wrap",{"mb-2":this.data.allowed_ips.length>0}])},[o(E,{name:"list"},{default:C(()=>[(n(!0),r(S,null,P(this.data.allowed_ips,(a,w)=>(n(),r("span",{class:"badge rounded-pill text-bg-success",key:a},[K(x(a)+" ",1),e("a",{role:"button",onClick:$=>this.data.allowed_ips.splice(w,1)},t[3]||(t[3]=[e("i",{class:"bi bi-x-circle-fill ms-1"},null,-1)]),8,ue)]))),128))]),_:1})],2),e("div",he,[e("div",be,[p(e("input",{type:"text",class:h(["form-control form-control-sm rounded-start-3",{"is-invalid":this.allowedIpFormatError}]),placeholder:this.inputGetLocale,"onUpdate:modelValue":t[0]||(t[0]=a=>i.customAvailableIp=a),disabled:c.bulk},null,10,_e),[[u,i.customAvailableIp]]),e("button",{class:"btn btn-outline-success btn-sm rounded-end-3",disabled:c.bulk||!this.customAvailableIp,onClick:t[1]||(t[1]=a=>this.addAllowedIp(this.customAvailableIp)),type:"button",id:"button-addon2"},t[4]||(t[4]=[e("i",{class:"bi bi-plus-lg"},null,-1)]),8,me)]),e("small",ve,[o(l,{t:"or"})]),e("div",fe,[e("button",{class:"btn btn-outline-secondary btn-sm dropdown-toggle rounded-3 w-100",disabled:!c.availableIp||c.bulk,"data-bs-auto-close":"outside",type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[t[5]||(t[5]=e("i",{class:"bi bi-filter-circle me-2"},null,-1)),o(l,{t:"Pick Available IP"})],8,ke),this.availableIp?(n(),r("ul",ge,[e("li",null,[e("div",ye,[t[6]||(t[6]=e("label",{for:"availableIpSearchString",class:"text-muted"},[e("i",{class:"bi bi-search"})],-1)),p(e("input",{id:"availableIpSearchString",class:"form-control form-control-sm rounded-3","onUpdate:modelValue":t[2]||(t[2]=a=>this.availableIpSearchString=a)},null,512),[[u,this.availableIpSearchString]])])]),(n(!0),r(S,null,P(this.searchAvailableIps,a=>(n(),r("li",null,[e("a",{class:"dropdown-item d-flex",role:"button",onClick:w=>this.addAllowedIp(a)},[e("span",Ie,[e("small",null,x(a),1)])],8,we)]))),256)),this.searchAvailableIps.length===0?(n(),r("li",xe,[e("small",$e,[o(l,{t:"No available IP containing"}),K(' "'+x(this.availableIpSearchString)+'"',1)])])):f("",!0)])):f("",!0)])])],2)}const Se=b(re,[["render",Ae],["__scopeId","data-v-6d5fc831"]]),Pe={name:"dnsInput",components:{LocaleText:_},props:{data:Object,saving:Boolean},data(){return{error:!1,dns:JSON.parse(JSON.stringify(this.data.DNS))}},setup(){const s=y(),t=g();return{store:s,dashboardStore:t}},methods:{checkDNS(){if(this.dns){let s=this.dns.split(",").map(t=>t.replaceAll(" ",""));for(let t in s)if(!this.store.regexCheckIP(s[t])){this.error||this.dashboardStore.newMessage("WGDashboard","DNS format is incorrect","danger"),this.error=!0,this.data.DNS="";return}this.error=!1,this.data.DNS=this.dns}}},watch:{dns(){this.checkDNS()}}},Ke={for:"peer_DNS_textbox",class:"form-label"},Le={class:"text-muted"},Ce=["disabled"];function De(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",null,[e("label",Ke,[e("small",Le,[o(l,{t:"DNS"})])]),p(e("input",{type:"text",class:h(["form-control form-control-sm rounded-3",{"is-invalid":this.error}]),disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.dns=a),id:"peer_DNS_textbox"},null,10,Ce),[[u,this.dns]])])}const Te=b(Pe,[["render",De]]),Be={name:"endpointAllowedIps",components:{LocaleText:_},props:{data:Object,saving:Boolean},setup(){const s=y(),t=g();return{store:s,dashboardStore:t}},data(){return{endpointAllowedIps:JSON.parse(JSON.stringify(this.data.endpoint_allowed_ip)),error:!1}},methods:{checkAllowedIP(){let s=this.endpointAllowedIps.split(",").map(t=>t.replaceAll(" ",""));for(let t in s)if(!this.store.checkCIDR(s[t])){this.error||this.dashboardStore.newMessage("WGDashboard","Endpoint Allowed IPs format is incorrect","danger"),this.data.endpoint_allowed_ip="",this.error=!0;return}this.error=!1,this.data.endpoint_allowed_ip=this.endpointAllowedIps}},watch:{endpointAllowedIps(){this.checkAllowedIP()}}},Ne={for:"peer_endpoint_allowed_ips",class:"form-label"},Ve={class:"text-muted"},Ue=["disabled"];function Me(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",null,[e("label",Ne,[e("small",Ve,[o(l,{t:"Endpoint Allowed IPs"}),e("code",null,[o(l,{t:"(Required)"})])])]),p(e("input",{type:"text",class:h(["form-control form-control-sm rounded-3",{"is-invalid":i.error}]),disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.endpointAllowedIps=a),onBlur:t[1]||(t[1]=a=>this.checkAllowedIP()),id:"peer_endpoint_allowed_ips"},null,42,Ue),[[u,this.endpointAllowedIps]])])}const Ee=b(Be,[["render",Me]]),Fe={name:"presharedKeyInput",components:{LocaleText:_},props:{data:Object,saving:Boolean},data(){return{enable:!1}},watch:{enable(){this.enable?this.data.preshared_key=window.wireguard.generateKeypair().presharedKey:this.data.preshared_key=""}}},Ge={class:"d-flex align-items-start"},Oe={for:"peer_preshared_key_textbox",class:"form-label"},Re={class:"text-muted"},je={class:"form-check form-switch ms-auto"},qe=["disabled"];function We(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",null,[e("div",Ge,[e("label",Oe,[e("small",Re,[o(l,{t:"Pre-Shared Key"})])]),e("div",je,[p(e("input",{class:"form-check-input",type:"checkbox",role:"switch","onUpdate:modelValue":t[0]||(t[0]=a=>this.enable=a),id:"peer_preshared_key_switch"},null,512),[[I,this.enable]])])]),p(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving||!this.enable,"onUpdate:modelValue":t[1]||(t[1]=a=>this.data.preshared_key=a),id:"peer_preshared_key_textbox"},null,8,qe),[[u,this.data.preshared_key]])])}const Je=b(Fe,[["render",We]]),ze={name:"mtuInput",components:{LocaleText:_},props:{data:Object,saving:Boolean}},He={for:"peer_mtu",class:"form-label"},Qe={class:"text-muted"},Ye=["disabled"];function Ze(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",null,[e("label",He,[e("small",Qe,[o(l,{t:"MTU"})])]),p(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.data.mtu=a),min:"0",id:"peer_mtu"},null,8,Ye),[[u,this.data.mtu]])])}const Xe=b(ze,[["render",Ze]]),et={name:"persistentKeepAliveInput",components:{LocaleText:_},props:{data:Object,saving:Boolean}},tt={for:"peer_keep_alive",class:"form-label"},st={class:"text-muted"},at=["disabled"];function lt(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",null,[e("label",tt,[e("small",st,[o(l,{t:"Persistent Keepalive"})])]),p(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[0]||(t[0]=a=>this.data.keepalive=a),id:"peer_keep_alive"},null,8,at),[[u,this.data.keepalive]])])}const ot=b(et,[["render",lt]]),it={name:"bulkAdd",components:{LocaleText:_},props:{saving:Boolean,data:Object,availableIp:void 0},computed:{bulkAddGetLocale(){return L("How many peers you want to add?")}}},nt={class:"form-check form-switch"},dt=["disabled"],rt={class:"form-check-label me-2",for:"bulk_add"},ct={class:"text-muted d-block"},pt={key:0,class:"form-group"},ut=["max","placeholder"],ht={class:"text-muted"};function bt(s,t,c,m,i,v){const l=d("LocaleText");return n(),r("div",null,[e("div",nt,[p(e("input",{class:"form-check-input",type:"checkbox",role:"switch",disabled:!this.availableIp,id:"bulk_add","onUpdate:modelValue":t[0]||(t[0]=a=>this.data.bulkAdd=a)},null,8,dt),[[I,this.data.bulkAdd]]),e("label",rt,[e("small",null,[e("strong",null,[o(l,{t:"Bulk Add"})])])])]),e("p",{class:h({"mb-0":!this.data.bulkAdd})},[e("small",ct,[o(l,{t:"By adding peers by bulk, each peer's name will be auto generated, and Allowed IP will be assign to the next available IP."})])],2),this.data.bulkAdd?(n(),r("div",pt,[p(e("input",{class:"form-control form-control-sm rounded-3 mb-1",type:"number",min:"1",max:this.availableIp.length,"onUpdate:modelValue":t[1]||(t[1]=a=>this.data.bulkAddAmount=a),placeholder:this.bulkAddGetLocale},null,8,ut),[[u,this.data.bulkAddAmount]]),e("small",ht,[o(l,{t:"You can add up to "+this.availableIp.length+" peers"},null,8,["t"])])])):f("",!0)])}const _t=b(it,[["render",bt]]),mt={name:"peerCreate",components:{LocaleText:_,BulkAdd:_t,PersistentKeepAliveInput:ot,MtuInput:Xe,PresharedKeyInput:Je,EndpointAllowedIps:Ee,DnsInput:Te,AllowedIPsInput:Se,PrivatePublicKeyInput:de,NameInput:J},data(){return{data:{bulkAdd:!1,bulkAddAmount:0,name:"",allowed_ips:[],private_key:"",public_key:"",DNS:this.dashboardStore.Configuration.Peers.peer_global_dns,endpoint_allowed_ip:this.dashboardStore.Configuration.Peers.peer_endpoint_allowed_ip,keepalive:parseInt(this.dashboardStore.Configuration.Peers.peer_keep_alive),mtu:parseInt(this.dashboardStore.Configuration.Peers.peer_mtu),preshared_key:"",preshared_key_bulkAdd:!1},availableIp:void 0,availableIpSearchString:"",saving:!1,allowedIpDropdown:void 0}},mounted(){F("/api/getAvailableIPs/"+this.$route.params.id,{},s=>{s.status&&(this.availableIp=s.data)})},setup(){const s=y(),t=g();return{store:s,dashboardStore:t}},methods:{peerCreate(){this.saving=!0,G("/api/addPeers/"+this.$route.params.id,this.data,s=>{s.status?(this.$router.push(`/configuration/${this.$route.params.id}/peers`),this.dashboardStore.newMessage("Server","Peer created successfully","success")):this.dashboardStore.newMessage("Server",s.message,"danger"),this.saving=!1})}},computed:{allRequireFieldsFilled(){let s=!0;return this.data.bulkAdd?(this.data.bulkAddAmount.length===0||this.data.bulkAddAmount>this.availableIp.length)&&(s=!1):["allowed_ips","private_key","public_key","endpoint_allowed_ip","keepalive","mtu"].forEach(c=>{this.data[c].length===0&&(s=!1)}),s}},watch:{bulkAdd(s){s||(this.data.bulkAddAmount="")},"data.bulkAddAmount"(){this.data.bulkAddAmount>this.availableIp.length&&(this.data.bulkAddAmount=this.availableIp.length)}}},vt={class:"container"},ft={class:"mb-4"},kt={class:"mb-5 d-flex align-items-center gap-4"},gt={class:"mb-0"},yt={class:"d-flex flex-column gap-2"},wt={class:"row gy-3"},It={key:0,class:"col-sm"},xt={class:"col-sm"},$t={class:"col-sm"},At={key:1,class:"col-12"},St={class:"form-check form-switch"},Pt={class:"form-check-label",for:"bullAdd_PresharedKey_Switch"},Kt={class:"fw-bold"},Lt={class:"d-flex mt-2"},Ct=["disabled"],Dt={key:0,class:"bi bi-plus-circle-fill me-2"};function Tt(s,t,c,m,i,v){const l=d("RouterLink"),a=d("LocaleText"),w=d("BulkAdd"),$=d("NameInput"),D=d("PrivatePublicKeyInput"),T=d("AllowedIPsInput"),B=d("EndpointAllowedIps"),N=d("DnsInput"),V=d("PresharedKeyInput"),U=d("MtuInput"),M=d("PersistentKeepAliveInput");return n(),r("div",vt,[e("div",ft,[e("div",kt,[o(l,{to:"peers",class:"btn btn-dark btn-brand p-2 shadow",style:{"border-radius":"100%"}},{default:C(()=>t[2]||(t[2]=[e("h2",{class:"mb-0",style:{"line-height":"0"}},[e("i",{class:"bi bi-arrow-left-circle"})],-1)])),_:1}),e("h2",gt,[o(a,{t:"Add Peers"})])])]),e("div",yt,[o(w,{saving:i.saving,data:this.data,availableIp:this.availableIp},null,8,["saving","data","availableIp"]),t[3]||(t[3]=e("hr",{class:"mb-0 mt-2"},null,-1)),this.data.bulkAdd?f("",!0):(n(),k($,{key:0,saving:i.saving,data:this.data},null,8,["saving","data"])),this.data.bulkAdd?f("",!0):(n(),k(D,{key:1,saving:i.saving,data:i.data},null,8,["saving","data"])),this.data.bulkAdd?f("",!0):(n(),k(T,{key:2,availableIp:this.availableIp,saving:i.saving,data:i.data},null,8,["availableIp","saving","data"])),o(B,{saving:i.saving,data:i.data},null,8,["saving","data"]),o(N,{saving:i.saving,data:i.data},null,8,["saving","data"]),t[4]||(t[4]=e("hr",{class:"mb-0 mt-2"},null,-1)),e("div",wt,[this.data.bulkAdd?f("",!0):(n(),r("div",It,[o(V,{saving:i.saving,data:i.data,bulk:this.data.bulkAdd},null,8,["saving","data","bulk"])])),e("div",xt,[o(U,{saving:i.saving,data:i.data},null,8,["saving","data"])]),e("div",$t,[o(M,{saving:i.saving,data:i.data},null,8,["saving","data"])]),this.data.bulkAdd?(n(),r("div",At,[e("div",St,[p(e("input",{class:"form-check-input",type:"checkbox",role:"switch","onUpdate:modelValue":t[0]||(t[0]=A=>this.data.preshared_key_bulkAdd=A),id:"bullAdd_PresharedKey_Switch",checked:""},null,512),[[I,this.data.preshared_key_bulkAdd]]),e("label",Pt,[e("small",Kt,[o(a,{t:"Pre-Shared Key"}),this.data.preshared_key_bulkAdd?(n(),k(a,{key:0,t:"Enabled"})):(n(),k(a,{key:1,t:"Disabled"}))])])])])):f("",!0)]),e("div",Lt,[e("button",{class:"ms-auto btn btn-dark btn-brand rounded-3 px-3 py-2 shadow",disabled:!this.allRequireFieldsFilled||this.saving,onClick:t[1]||(t[1]=A=>this.peerCreate())},[this.saving?f("",!0):(n(),r("i",Dt)),this.saving?(n(),k(a,{key:1,t:"Adding..."})):(n(),k(a,{key:2,t:"Add"}))],8,Ct)])])])}const Vt=b(mt,[["render",Tt],["__scopeId","data-v-17eb547c"]]);export{Vt as default}; diff --git a/src/static/app/dist/assets/peerJobs-Cnl9B8_O.js b/src/static/app/dist/assets/peerJobs-BbNYdlYw.js similarity index 90% rename from src/static/app/dist/assets/peerJobs-Cnl9B8_O.js rename to src/static/app/dist/assets/peerJobs-BbNYdlYw.js index 7f44961..235b60e 100644 --- a/src/static/app/dist/assets/peerJobs-Cnl9B8_O.js +++ b/src/static/app/dist/assets/peerJobs-BbNYdlYw.js @@ -1 +1 @@ -import{S as p,a as b}from"./schedulePeerJob-UvgbczqH.js";import{_ as h,W as u,p as m,j as i,a as o,c as a,b as e,d as r,w as _,F as v,h as f,i as J,e as x,k as g}from"./index-BPNEscAR.js";import{L as w}from"./localeText-DX813vQA.js";import"./vue-datepicker-D9reu0Fg.js";import"./dayjs.min-Lw24H7b2.js";const P={name:"peerJobs",setup(){return{store:u()}},props:{selectedPeer:Object},components:{LocaleText:w,SchedulePeerJob:p,ScheduleDropdown:b},data(){return{}},methods:{deleteJob(d){this.selectedPeer.jobs=this.selectedPeer.jobs.filter(t=>t.JobID!==d.JobID)},addJob(){this.selectedPeer.jobs.unshift(JSON.parse(JSON.stringify({JobID:m().toString(),Configuration:this.selectedPeer.configuration.Name,Peer:this.selectedPeer.id,Field:this.store.PeerScheduleJobs.dropdowns.Field[0].value,Operator:this.store.PeerScheduleJobs.dropdowns.Operator[0].value,Value:"",CreationDate:"",ExpireDate:"",Action:this.store.PeerScheduleJobs.dropdowns.Action[0].value})))}}},S={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},y={class:"container d-flex h-100 w-100"},$={class:"m-auto modal-dialog-centered dashboardModal"},C={class:"card rounded-3 shadow",style:{width:"700px"}},D={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},j={class:"mb-0 fw-normal"},k={class:"card-body px-4 pb-4 pt-2 position-relative"},N={class:"d-flex align-items-center mb-3"},T={class:"card shadow-sm",key:"none",style:{height:"153px"}},I={class:"card-body text-muted text-center d-flex"},L={class:"m-auto"};function O(d,t,B,F,V,A){const n=i("LocaleText"),l=i("SchedulePeerJob");return o(),a("div",S,[e("div",y,[e("div",$,[e("div",C,[e("div",D,[e("h4",j,[r(n,{t:"Schedule Jobs"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=s=>this.$emit("close"))})]),e("div",k,[e("div",N,[e("button",{class:"btn bg-primary-subtle border-1 border-primary-subtle text-primary-emphasis rounded-3 shadow",onClick:t[1]||(t[1]=s=>this.addJob())},[t[3]||(t[3]=e("i",{class:"bi bi-plus-lg me-2"},null,-1)),r(n,{t:"Job"})])]),r(g,{name:"schedulePeerJobTransition",tag:"div",class:"position-relative"},{default:_(()=>[(o(!0),a(v,null,f(this.selectedPeer.jobs,(s,E)=>(o(),J(l,{onRefresh:t[2]||(t[2]=c=>this.$emit("refresh")),onDelete:c=>this.deleteJob(s),dropdowns:this.store.PeerScheduleJobs.dropdowns,key:s.JobID,pjob:s},null,8,["onDelete","dropdowns","pjob"]))),128)),this.selectedPeer.jobs.length===0?(o(),a("div",T,[e("div",I,[e("h6",L,[r(n,{t:"This peer does not have any job yet."})])])])):x("",!0)]),_:1})])])])])])}const z=h(P,[["render",O],["__scopeId","data-v-5bbdd42b"]]);export{z as default}; +import{S as p,a as b}from"./schedulePeerJob-Bfwzc6gk.js";import{_ as h,W as u,p as m,j as i,a as o,c as a,b as e,d as r,w as _,F as v,h as f,i as J,e as x,k as g}from"./index-DOaPWS1X.js";import{L as w}from"./localeText-CaAXeE0W.js";import"./vue-datepicker-D91GxXPq.js";import"./dayjs.min-D8jwq_wn.js";const P={name:"peerJobs",setup(){return{store:u()}},props:{selectedPeer:Object},components:{LocaleText:w,SchedulePeerJob:p,ScheduleDropdown:b},data(){return{}},methods:{deleteJob(d){this.selectedPeer.jobs=this.selectedPeer.jobs.filter(t=>t.JobID!==d.JobID)},addJob(){this.selectedPeer.jobs.unshift(JSON.parse(JSON.stringify({JobID:m().toString(),Configuration:this.selectedPeer.configuration.Name,Peer:this.selectedPeer.id,Field:this.store.PeerScheduleJobs.dropdowns.Field[0].value,Operator:this.store.PeerScheduleJobs.dropdowns.Operator[0].value,Value:"",CreationDate:"",ExpireDate:"",Action:this.store.PeerScheduleJobs.dropdowns.Action[0].value})))}}},S={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},y={class:"container d-flex h-100 w-100"},$={class:"m-auto modal-dialog-centered dashboardModal"},C={class:"card rounded-3 shadow",style:{width:"700px"}},D={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},j={class:"mb-0 fw-normal"},k={class:"card-body px-4 pb-4 pt-2 position-relative"},N={class:"d-flex align-items-center mb-3"},T={class:"card shadow-sm",key:"none",style:{height:"153px"}},I={class:"card-body text-muted text-center d-flex"},L={class:"m-auto"};function O(d,t,B,F,V,A){const n=i("LocaleText"),l=i("SchedulePeerJob");return o(),a("div",S,[e("div",y,[e("div",$,[e("div",C,[e("div",D,[e("h4",j,[r(n,{t:"Schedule Jobs"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=s=>this.$emit("close"))})]),e("div",k,[e("div",N,[e("button",{class:"btn bg-primary-subtle border-1 border-primary-subtle text-primary-emphasis rounded-3 shadow",onClick:t[1]||(t[1]=s=>this.addJob())},[t[3]||(t[3]=e("i",{class:"bi bi-plus-lg me-2"},null,-1)),r(n,{t:"Job"})])]),r(g,{name:"schedulePeerJobTransition",tag:"div",class:"position-relative"},{default:_(()=>[(o(!0),a(v,null,f(this.selectedPeer.jobs,(s,E)=>(o(),J(l,{onRefresh:t[2]||(t[2]=c=>this.$emit("refresh")),onDelete:c=>this.deleteJob(s),dropdowns:this.store.PeerScheduleJobs.dropdowns,key:s.JobID,pjob:s},null,8,["onDelete","dropdowns","pjob"]))),128)),this.selectedPeer.jobs.length===0?(o(),a("div",T,[e("div",I,[e("h6",L,[r(n,{t:"This peer does not have any job yet."})])])])):x("",!0)]),_:1})])])])])])}const z=h(P,[["render",O],["__scopeId","data-v-5bbdd42b"]]);export{z as default}; diff --git a/src/static/app/dist/assets/peerJobsAllModal-BuV_jZ_r.js b/src/static/app/dist/assets/peerJobsAllModal-CkJIs1TM.js similarity index 89% rename from src/static/app/dist/assets/peerJobsAllModal-BuV_jZ_r.js rename to src/static/app/dist/assets/peerJobsAllModal-CkJIs1TM.js index 418794a..34f523d 100644 --- a/src/static/app/dist/assets/peerJobsAllModal-BuV_jZ_r.js +++ b/src/static/app/dist/assets/peerJobsAllModal-CkJIs1TM.js @@ -1 +1 @@ -import{S as b}from"./schedulePeerJob-UvgbczqH.js";import{_ as g,W as v,p as f,j as l,a as o,c as t,b as e,d as i,F as p,h,t as _,e as y,i as x}from"./index-BPNEscAR.js";import{L as J}from"./localeText-DX813vQA.js";import"./vue-datepicker-D9reu0Fg.js";import"./dayjs.min-Lw24H7b2.js";const w={name:"peerJobsAllModal",setup(){return{store:v()}},components:{LocaleText:J,SchedulePeerJob:b},props:{configurationPeers:Array[Object]},methods:{getuuid(){return f()}},computed:{getAllJobs(){return this.configurationPeers.filter(r=>r.jobs.length>0)}}},A={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},$={class:"container d-flex h-100 w-100"},k={class:"m-auto modal-dialog-centered dashboardModal"},S={class:"card rounded-3 shadow",style:{width:"700px"}},L={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},j={class:"mb-0 fw-normal"},P={class:"card-body px-4 pb-4 pt-2"},C={key:0,class:"accordion",id:"peerJobsLogsModalAccordion"},M={class:"accordion-header"},B=["data-bs-target"],N={key:0},D={class:"text-muted"},T=["id"],V={class:"accordion-body"},F={key:1,class:"card shadow-sm",style:{height:"153px"}},O={class:"card-body text-muted text-center d-flex"},W={class:"m-auto"};function E(r,s,I,R,q,z){const n=l("LocaleText"),u=l("SchedulePeerJob");return o(),t("div",A,[e("div",$,[e("div",k,[e("div",S,[e("div",L,[e("h4",j,[i(n,{t:"All Active Jobs"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:s[0]||(s[0]=a=>this.$emit("close"))})]),e("div",P,[this.getAllJobs.length>0?(o(),t("div",C,[(o(!0),t(p,null,h(this.getAllJobs,(a,d)=>(o(),t("div",{class:"accordion-item",key:a.id},[e("h2",M,[e("button",{class:"accordion-button collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#collapse_"+d},[e("small",null,[e("strong",null,[a.name?(o(),t("span",N,_(a.name)+" • ",1)):y("",!0),e("samp",D,_(a.id),1)])])],8,B)]),e("div",{id:"collapse_"+d,class:"accordion-collapse collapse","data-bs-parent":"#peerJobsLogsModalAccordion"},[e("div",V,[(o(!0),t(p,null,h(a.jobs,c=>(o(),x(u,{onDelete:s[1]||(s[1]=m=>this.$emit("refresh")),onRefresh:s[2]||(s[2]=m=>this.$emit("refresh")),dropdowns:this.store.PeerScheduleJobs.dropdowns,viewOnly:!0,key:c.JobID,pjob:c},null,8,["dropdowns","pjob"]))),128))])],8,T)]))),128))])):(o(),t("div",F,[e("div",O,[e("span",W,[i(n,{t:"No active job at the moment."})])])]))])])])])])}const X=g(w,[["render",E]]);export{X as default}; +import{S as b}from"./schedulePeerJob-Bfwzc6gk.js";import{_ as g,W as v,p as f,j as l,a as o,c as t,b as e,d as i,F as p,h,t as _,e as y,i as x}from"./index-DOaPWS1X.js";import{L as J}from"./localeText-CaAXeE0W.js";import"./vue-datepicker-D91GxXPq.js";import"./dayjs.min-D8jwq_wn.js";const w={name:"peerJobsAllModal",setup(){return{store:v()}},components:{LocaleText:J,SchedulePeerJob:b},props:{configurationPeers:Array[Object]},methods:{getuuid(){return f()}},computed:{getAllJobs(){return this.configurationPeers.filter(r=>r.jobs.length>0)}}},A={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},$={class:"container d-flex h-100 w-100"},k={class:"m-auto modal-dialog-centered dashboardModal"},S={class:"card rounded-3 shadow",style:{width:"700px"}},L={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},j={class:"mb-0 fw-normal"},P={class:"card-body px-4 pb-4 pt-2"},C={key:0,class:"accordion",id:"peerJobsLogsModalAccordion"},M={class:"accordion-header"},B=["data-bs-target"],N={key:0},D={class:"text-muted"},T=["id"],V={class:"accordion-body"},F={key:1,class:"card shadow-sm",style:{height:"153px"}},O={class:"card-body text-muted text-center d-flex"},W={class:"m-auto"};function E(r,s,I,R,q,z){const n=l("LocaleText"),u=l("SchedulePeerJob");return o(),t("div",A,[e("div",$,[e("div",k,[e("div",S,[e("div",L,[e("h4",j,[i(n,{t:"All Active Jobs"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:s[0]||(s[0]=a=>this.$emit("close"))})]),e("div",P,[this.getAllJobs.length>0?(o(),t("div",C,[(o(!0),t(p,null,h(this.getAllJobs,(a,d)=>(o(),t("div",{class:"accordion-item",key:a.id},[e("h2",M,[e("button",{class:"accordion-button collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#collapse_"+d},[e("small",null,[e("strong",null,[a.name?(o(),t("span",N,_(a.name)+" • ",1)):y("",!0),e("samp",D,_(a.id),1)])])],8,B)]),e("div",{id:"collapse_"+d,class:"accordion-collapse collapse","data-bs-parent":"#peerJobsLogsModalAccordion"},[e("div",V,[(o(!0),t(p,null,h(a.jobs,c=>(o(),x(u,{onDelete:s[1]||(s[1]=m=>this.$emit("refresh")),onRefresh:s[2]||(s[2]=m=>this.$emit("refresh")),dropdowns:this.store.PeerScheduleJobs.dropdowns,viewOnly:!0,key:c.JobID,pjob:c},null,8,["dropdowns","pjob"]))),128))])],8,T)]))),128))])):(o(),t("div",F,[e("div",O,[e("span",W,[i(n,{t:"No active job at the moment."})])])]))])])])])])}const X=g(w,[["render",E]]);export{X as default}; diff --git a/src/static/app/dist/assets/peerJobsLogsModal-oNsuA1Dm.js b/src/static/app/dist/assets/peerJobsLogsModal-ZNMKiJ-k.js similarity index 96% rename from src/static/app/dist/assets/peerJobsLogsModal-oNsuA1Dm.js rename to src/static/app/dist/assets/peerJobsLogsModal-ZNMKiJ-k.js index ecc4ca6..33455b7 100644 --- a/src/static/app/dist/assets/peerJobsLogsModal-oNsuA1Dm.js +++ b/src/static/app/dist/assets/peerJobsLogsModal-ZNMKiJ-k.js @@ -1 +1 @@ -import{d as m}from"./dayjs.min-Lw24H7b2.js";import{_ as p,g,j as _,a,c as n,b as s,d as i,f as b,t as c,m as h,v as u,e as d,F as f,h as w,n as L}from"./index-BPNEscAR.js";import{L as k}from"./localeText-DX813vQA.js";const x={name:"peerJobsLogsModal",components:{LocaleText:k},props:{configurationInfo:Object},data(){return{dataLoading:!0,data:[],logFetchTime:void 0,showLogID:!1,showJobID:!0,showSuccessJob:!0,showFailedJob:!0,showLogAmount:10}},async mounted(){await this.fetchLog()},methods:{async fetchLog(){this.dataLoading=!0,await g(`/api/getPeerScheduleJobLogs/${this.configurationInfo.Name}`,{},r=>{this.data=r.data,this.logFetchTime=m().format("YYYY-MM-DD HH:mm:ss"),this.dataLoading=!1})}},computed:{getLogs(){return this.data.filter(r=>this.showSuccessJob&&r.Status==="1"||this.showFailedJob&&r.Status==="0")},showLogs(){return this.getLogs.slice(0,this.showLogAmount)}}},y={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},v={class:"container-fluid d-flex h-100 w-100"},D={class:"m-auto mt-0 modal-dialog-centered dashboardModal",style:{width:"100%"}},S={class:"card rounded-3 shadow w-100"},I={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},J={class:"mb-0"},C={class:"card-body px-4 pb-4 pt-2"},F={key:0},j={class:"mb-2 d-flex gap-3"},M={class:"d-flex gap-3 align-items-center"},V={class:"text-muted"},T={class:"form-check"},A={class:"form-check-label",for:"jobLogsShowSuccessCheck"},N={class:"badge text-success-emphasis bg-success-subtle"},U={class:"form-check"},Y={class:"form-check-label",for:"jobLogsShowFailedCheck"},B={class:"badge text-danger-emphasis bg-danger-subtle"},z={class:"d-flex gap-3 align-items-center ms-auto"},H={class:"text-muted"},$={class:"form-check"},E={class:"form-check-label",for:"jobLogsShowJobIDCheck"},G={class:"form-check"},O={class:"form-check-label",for:"jobLogsShowLogIDCheck"},P={class:"table"},R={scope:"col"},q={key:0,scope:"col"},K={key:1,scope:"col"},Q={scope:"col"},W={scope:"col"},X={style:{"font-size":"0.875rem"}},Z={scope:"row"},ss={key:0},ts={class:"text-muted"},os={key:1},es={class:"text-muted"},is={class:"d-flex gap-2"},as={key:1,class:"d-flex align-items-center flex-column"};function ns(r,t,ls,cs,l,ds){const e=_("LocaleText");return a(),n("div",y,[s("div",v,[s("div",D,[s("div",S,[s("div",I,[s("h4",J,[i(e,{t:"Jobs Logs"})]),s("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=o=>this.$emit("close"))})]),s("div",C,[this.dataLoading?(a(),n("div",as,t[11]||(t[11]=[s("div",{class:"spinner-border text-body",role:"status"},[s("span",{class:"visually-hidden"},"Loading...")],-1)]))):(a(),n("div",F,[s("p",null,[i(e,{t:"Updated at"}),b(" : "+c(this.logFetchTime),1)]),s("div",j,[s("button",{onClick:t[1]||(t[1]=o=>this.fetchLog()),class:"btn btn-sm rounded-3 shadow-sm text-info-emphasis bg-info-subtle border-1 border-info-subtle me-1"},[t[8]||(t[8]=s("i",{class:"bi bi-arrow-clockwise me-2"},null,-1)),i(e,{t:"Refresh"})]),s("div",M,[s("span",V,[i(e,{t:"Filter"})]),s("div",T,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[2]||(t[2]=o=>this.showSuccessJob=o),id:"jobLogsShowSuccessCheck"},null,512),[[u,this.showSuccessJob]]),s("label",A,[s("span",N,[i(e,{t:"Success"})])])]),s("div",U,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[3]||(t[3]=o=>this.showFailedJob=o),id:"jobLogsShowFailedCheck"},null,512),[[u,this.showFailedJob]]),s("label",Y,[s("span",B,[i(e,{t:"Failed"})])])])]),s("div",z,[s("span",H,[i(e,{t:"Display"})]),s("div",$,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[4]||(t[4]=o=>l.showJobID=o),id:"jobLogsShowJobIDCheck"},null,512),[[u,l.showJobID]]),s("label",E,[i(e,{t:"Job ID"})])]),s("div",G,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[5]||(t[5]=o=>l.showLogID=o),id:"jobLogsShowLogIDCheck"},null,512),[[u,l.showLogID]]),s("label",O,[i(e,{t:"Log ID"})])])])]),s("table",P,[s("thead",null,[s("tr",null,[s("th",R,[i(e,{t:"Date"})]),l.showLogID?(a(),n("th",q,[i(e,{t:"Log ID"})])):d("",!0),l.showJobID?(a(),n("th",K,[i(e,{t:"Job ID"})])):d("",!0),s("th",Q,[i(e,{t:"Status"})]),s("th",W,[i(e,{t:"Message"})])])]),s("tbody",null,[(a(!0),n(f,null,w(this.showLogs,o=>(a(),n("tr",X,[s("th",Z,c(o.LogDate),1),l.showLogID?(a(),n("td",ss,[s("samp",ts,c(o.LogID),1)])):d("",!0),l.showJobID?(a(),n("td",os,[s("samp",es,c(o.JobID),1)])):d("",!0),s("td",null,[s("span",{class:L(["badge",[o.Status==="1"?"text-success-emphasis bg-success-subtle":"text-danger-emphasis bg-danger-subtle"]])},c(o.Status==="1"?"Success":"Failed"),3)]),s("td",null,c(o.Message),1)]))),256))])]),s("div",is,[this.getLogs.length>this.showLogAmount?(a(),n("button",{key:0,onClick:t[6]||(t[6]=o=>this.showLogAmount+=20),class:"btn btn-sm rounded-3 shadow-sm text-primary-emphasis bg-primary-subtle border-1 border-primary-subtle"},t[9]||(t[9]=[s("i",{class:"bi bi-chevron-down me-2"},null,-1),b(" Show More ")]))):d("",!0),this.showLogAmount>20?(a(),n("button",{key:1,onClick:t[7]||(t[7]=o=>this.showLogAmount=20),class:"btn btn-sm rounded-3 shadow-sm text-primary-emphasis bg-primary-subtle border-1 border-primary-subtle"},t[10]||(t[10]=[s("i",{class:"bi bi-chevron-up me-2"},null,-1),b(" Collapse ")]))):d("",!0)])]))])])])])])}const bs=p(x,[["render",ns]]);export{bs as default}; +import{d as m}from"./dayjs.min-D8jwq_wn.js";import{_ as p,g,j as _,a,c as n,b as s,d as i,f as b,t as c,m as h,v as u,e as d,F as f,h as w,n as L}from"./index-DOaPWS1X.js";import{L as k}from"./localeText-CaAXeE0W.js";const x={name:"peerJobsLogsModal",components:{LocaleText:k},props:{configurationInfo:Object},data(){return{dataLoading:!0,data:[],logFetchTime:void 0,showLogID:!1,showJobID:!0,showSuccessJob:!0,showFailedJob:!0,showLogAmount:10}},async mounted(){await this.fetchLog()},methods:{async fetchLog(){this.dataLoading=!0,await g(`/api/getPeerScheduleJobLogs/${this.configurationInfo.Name}`,{},r=>{this.data=r.data,this.logFetchTime=m().format("YYYY-MM-DD HH:mm:ss"),this.dataLoading=!1})}},computed:{getLogs(){return this.data.filter(r=>this.showSuccessJob&&r.Status==="1"||this.showFailedJob&&r.Status==="0")},showLogs(){return this.getLogs.slice(0,this.showLogAmount)}}},y={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},v={class:"container-fluid d-flex h-100 w-100"},D={class:"m-auto mt-0 modal-dialog-centered dashboardModal",style:{width:"100%"}},S={class:"card rounded-3 shadow w-100"},I={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},J={class:"mb-0"},C={class:"card-body px-4 pb-4 pt-2"},F={key:0},j={class:"mb-2 d-flex gap-3"},M={class:"d-flex gap-3 align-items-center"},V={class:"text-muted"},T={class:"form-check"},A={class:"form-check-label",for:"jobLogsShowSuccessCheck"},N={class:"badge text-success-emphasis bg-success-subtle"},U={class:"form-check"},Y={class:"form-check-label",for:"jobLogsShowFailedCheck"},B={class:"badge text-danger-emphasis bg-danger-subtle"},z={class:"d-flex gap-3 align-items-center ms-auto"},H={class:"text-muted"},$={class:"form-check"},E={class:"form-check-label",for:"jobLogsShowJobIDCheck"},G={class:"form-check"},O={class:"form-check-label",for:"jobLogsShowLogIDCheck"},P={class:"table"},R={scope:"col"},q={key:0,scope:"col"},K={key:1,scope:"col"},Q={scope:"col"},W={scope:"col"},X={style:{"font-size":"0.875rem"}},Z={scope:"row"},ss={key:0},ts={class:"text-muted"},os={key:1},es={class:"text-muted"},is={class:"d-flex gap-2"},as={key:1,class:"d-flex align-items-center flex-column"};function ns(r,t,ls,cs,l,ds){const e=_("LocaleText");return a(),n("div",y,[s("div",v,[s("div",D,[s("div",S,[s("div",I,[s("h4",J,[i(e,{t:"Jobs Logs"})]),s("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=o=>this.$emit("close"))})]),s("div",C,[this.dataLoading?(a(),n("div",as,t[11]||(t[11]=[s("div",{class:"spinner-border text-body",role:"status"},[s("span",{class:"visually-hidden"},"Loading...")],-1)]))):(a(),n("div",F,[s("p",null,[i(e,{t:"Updated at"}),b(" : "+c(this.logFetchTime),1)]),s("div",j,[s("button",{onClick:t[1]||(t[1]=o=>this.fetchLog()),class:"btn btn-sm rounded-3 shadow-sm text-info-emphasis bg-info-subtle border-1 border-info-subtle me-1"},[t[8]||(t[8]=s("i",{class:"bi bi-arrow-clockwise me-2"},null,-1)),i(e,{t:"Refresh"})]),s("div",M,[s("span",V,[i(e,{t:"Filter"})]),s("div",T,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[2]||(t[2]=o=>this.showSuccessJob=o),id:"jobLogsShowSuccessCheck"},null,512),[[u,this.showSuccessJob]]),s("label",A,[s("span",N,[i(e,{t:"Success"})])])]),s("div",U,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[3]||(t[3]=o=>this.showFailedJob=o),id:"jobLogsShowFailedCheck"},null,512),[[u,this.showFailedJob]]),s("label",Y,[s("span",B,[i(e,{t:"Failed"})])])])]),s("div",z,[s("span",H,[i(e,{t:"Display"})]),s("div",$,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[4]||(t[4]=o=>l.showJobID=o),id:"jobLogsShowJobIDCheck"},null,512),[[u,l.showJobID]]),s("label",E,[i(e,{t:"Job ID"})])]),s("div",G,[h(s("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":t[5]||(t[5]=o=>l.showLogID=o),id:"jobLogsShowLogIDCheck"},null,512),[[u,l.showLogID]]),s("label",O,[i(e,{t:"Log ID"})])])])]),s("table",P,[s("thead",null,[s("tr",null,[s("th",R,[i(e,{t:"Date"})]),l.showLogID?(a(),n("th",q,[i(e,{t:"Log ID"})])):d("",!0),l.showJobID?(a(),n("th",K,[i(e,{t:"Job ID"})])):d("",!0),s("th",Q,[i(e,{t:"Status"})]),s("th",W,[i(e,{t:"Message"})])])]),s("tbody",null,[(a(!0),n(f,null,w(this.showLogs,o=>(a(),n("tr",X,[s("th",Z,c(o.LogDate),1),l.showLogID?(a(),n("td",ss,[s("samp",ts,c(o.LogID),1)])):d("",!0),l.showJobID?(a(),n("td",os,[s("samp",es,c(o.JobID),1)])):d("",!0),s("td",null,[s("span",{class:L(["badge",[o.Status==="1"?"text-success-emphasis bg-success-subtle":"text-danger-emphasis bg-danger-subtle"]])},c(o.Status==="1"?"Success":"Failed"),3)]),s("td",null,c(o.Message),1)]))),256))])]),s("div",is,[this.getLogs.length>this.showLogAmount?(a(),n("button",{key:0,onClick:t[6]||(t[6]=o=>this.showLogAmount+=20),class:"btn btn-sm rounded-3 shadow-sm text-primary-emphasis bg-primary-subtle border-1 border-primary-subtle"},t[9]||(t[9]=[s("i",{class:"bi bi-chevron-down me-2"},null,-1),b(" Show More ")]))):d("",!0),this.showLogAmount>20?(a(),n("button",{key:1,onClick:t[7]||(t[7]=o=>this.showLogAmount=20),class:"btn btn-sm rounded-3 shadow-sm text-primary-emphasis bg-primary-subtle border-1 border-primary-subtle"},t[10]||(t[10]=[s("i",{class:"bi bi-chevron-up me-2"},null,-1),b(" Collapse ")]))):d("",!0)])]))])])])])])}const bs=p(x,[["render",ns]]);export{bs as default}; diff --git a/src/static/app/dist/assets/peerList-CMo3vsiC.js b/src/static/app/dist/assets/peerList-C2NQGcke.js similarity index 99% rename from src/static/app/dist/assets/peerList-CMo3vsiC.js rename to src/static/app/dist/assets/peerList-C2NQGcke.js index aeb5251..2934beb 100644 --- a/src/static/app/dist/assets/peerList-CMo3vsiC.js +++ b/src/static/app/dist/assets/peerList-C2NQGcke.js @@ -1,5 +1,5 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/deleteConfiguration-BCmwxoLx.js","assets/index-BPNEscAR.js","assets/index-D2eeEsuX.css","assets/localeText-DX813vQA.js","assets/configurationBackupRestore-ByIwj5e4.js","assets/dayjs.min-Lw24H7b2.js","assets/configurationBackupRestore-BeBqyCqt.css","assets/selectPeers-BBMqr9bY.js","assets/selectPeers-Wjnh8YUZ.css","assets/editConfiguration-hI0uF3Oq.js","assets/editConfiguration-Oqrarw_V.css","assets/peerShareLinkModal-Bqogws3W.js","assets/vue-datepicker-D9reu0Fg.js","assets/peerJobsLogsModal-oNsuA1Dm.js","assets/peerJobsAllModal-BuV_jZ_r.js","assets/schedulePeerJob-UvgbczqH.js","assets/schedulePeerJob--V7cpve7.css","assets/peerJobs-Cnl9B8_O.js","assets/peerJobs-voXURBEt.css","assets/peerCreate-C7F1RHXB.js","assets/peerCreate-BKh8DeBv.css","assets/peerQRCode-BbWkgVDW.js","assets/browser-CjSdxGTc.js","assets/peerConfigurationFile-phV9SBBy.js","assets/peerConfigurationFile-fak3wop9.css","assets/peerSettings-BNzBnZYL.js","assets/peerSettings-Cm-ugvIi.css"])))=>i.map(i=>d[i]); -import{_ as rs,D as Hs,W as Dn,G as _t,q as me,g as ve,a as D,c as $,b as p,d as P,w as G,m as On,s as No,F as qt,h as ks,t as K,e as V,T as tt,j as W,I as Ho,J as Wo,B as Vo,E as An,f as Wt,n as Vt,i as H,r as Qe,K as Tn,L as Ln,M as Ms,N as jo,o as Uo,O as Yo,P as Ps,Q as Ko,R as In,U as ot,v as Xo,k as Go,V as rt}from"./index-BPNEscAR.js";import{L as as}from"./localeText-DX813vQA.js";import{d as oi}from"./dayjs.min-Lw24H7b2.js";const Jo={name:"peerSearch",components:{LocaleText:as},setup(){const s=Hs(),t=Dn();return{store:s,wireguardConfigurationStore:t}},props:{configuration:Object},data(){return{sort:{status:_t("Status"),name:_t("Name"),allowed_ip:_t("Allowed IPs"),restricted:_t("Restricted")},interval:{5e3:_t("5 Seconds"),1e4:_t("10 Seconds"),3e4:_t("30 Seconds"),6e4:_t("1 Minutes")},searchString:"",searchStringTimeout:void 0,showDisplaySettings:!1,showMoreSettings:!1}},methods:{debounce(){this.searchStringTimeout?(clearTimeout(this.searchStringTimeout),this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)):this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)},updateSort(s){me("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_sort",value:s},t=>{t.status&&this.store.getConfiguration()})},updateRefreshInterval(s){me("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_refresh_interval",value:s},t=>{t.status&&this.store.getConfiguration()})},downloadAllPeer(){ve(`/api/downloadAllPeers/${this.configuration.Name}`,{},s=>{console.log(s),window.wireguard.generateZipFiles(s,this.configuration.Name)})}},computed:{searchBarPlaceholder(){return _t("Search Peers...")}}},qo={class:"mb-3"},Qo={class:"d-flex gap-2 z-3 peerSearchContainer"},Zo={class:"mt-3 mt-md-0 flex-grow-1"},tr=["placeholder"],er={key:0,class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll displayModal"},sr={class:"container-md d-flex h-100 w-100"},ir={class:"m-auto modal-dialog-centered dashboardModal"},nr={class:"card rounded-3 shadow w-100"},or={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},rr={class:"mb-0 fw-normal"},ar={class:"card-body px-4 pb-4 d-flex gap-3 flex-column"},lr={class:"text-muted fw-bold mb-2"},cr={class:"list-group"},hr=["onClick"],dr={class:"me-auto"},ur={key:0,class:"bi bi-check text-primary"},fr={class:"text-muted fw-bold mb-2"},gr={class:"list-group"},pr=["onClick"],mr={class:"me-auto"},br={key:0,class:"bi bi-check text-primary"},_r={key:0,class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll displayModal"},xr={class:"container-md d-flex h-100 w-100"},yr={class:"m-auto modal-dialog-centered dashboardModal"},vr={class:"card rounded-3 shadow w-100"},Sr={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4"},wr={class:"mb-0"},kr={class:"card-body px-4 pb-4 d-flex gap-3 flex-column pt-0"},Mr={class:"text-muted fw-bold mb-2"},Pr={class:"list-group"},Cr={class:"text-muted fw-bold mb-2"},Dr={class:"list-group"};function Or(s,t,e,i,n,o){const r=W("LocaleText"),a=W("RouterLink");return D(),$("div",qo,[p("div",Qo,[P(a,{to:"create",class:"text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle shadow-sm"},{default:G(()=>[t[13]||(t[13]=p("i",{class:"bi bi-plus-lg me-2"},null,-1)),P(r,{t:"Peer"})]),_:1}),p("button",{class:"btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle shadow-sm",onClick:t[0]||(t[0]=l=>this.downloadAllPeer())},[t[14]||(t[14]=p("i",{class:"bi bi-download me-2"},null,-1)),P(r,{t:"Download All"})]),p("div",Zo,[On(p("input",{class:"form-control rounded-3 bg-secondary-subtle border-1 border-secondary-subtle shadow-sm w-100",placeholder:o.searchBarPlaceholder,id:"searchPeers",onKeyup:t[1]||(t[1]=l=>this.debounce()),"onUpdate:modelValue":t[2]||(t[2]=l=>this.searchString=l)},null,40,tr),[[No,this.searchString]])]),p("button",{onClick:t[3]||(t[3]=l=>this.showDisplaySettings=!0),class:"btn text-secondary-emphasis bg-secondary-subtle rounded-3 border-1 border-secondary-subtle shadow-sm",type:"button","aria-expanded":"false"},[t[15]||(t[15]=p("i",{class:"bi bi-filter-circle me-2"},null,-1)),P(r,{t:"Display"})]),p("button",{class:"btn text-secondary-emphasis bg-secondary-subtle rounded-3 border-1 border-secondary-subtle shadow-sm",onClick:t[4]||(t[4]=l=>this.$emit("editConfiguration")),type:"button","aria-expanded":"false"},t[16]||(t[16]=[p("i",{class:"bi bi-gear-fill"},null,-1)])),p("button",{class:"btn text-secondary-emphasis bg-secondary-subtle rounded-3 border-1 border-secondary-subtle shadow-sm",onClick:t[5]||(t[5]=l=>this.showMoreSettings=!0),type:"button","aria-expanded":"false"},t[17]||(t[17]=[p("i",{class:"bi bi-three-dots"},null,-1)])),P(tt,{name:"zoom"},{default:G(()=>[this.showDisplaySettings?(D(),$("div",er,[p("div",sr,[p("div",ir,[p("div",nr,[p("div",or,[p("h4",rr,[P(r,{t:"Display"})]),p("button",{type:"button",class:"btn-close ms-auto",onClick:t[6]||(t[6]=l=>this.showDisplaySettings=!1)})]),p("div",ar,[p("div",null,[p("p",lr,[p("small",null,[P(r,{t:"Sort by"})])]),p("div",cr,[(D(!0),$(qt,null,ks(this.sort,(l,c)=>(D(),$("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:h=>this.updateSort(c)},[p("span",dr,K(l),1),i.store.Configuration.Server.dashboard_sort===c?(D(),$("i",ur)):V("",!0)],8,hr))),256))])]),p("div",null,[p("p",fr,[p("small",null,[P(r,{t:"Refresh Interval"})])]),p("div",gr,[(D(!0),$(qt,null,ks(this.interval,(l,c)=>(D(),$("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:h=>this.updateRefreshInterval(c)},[p("span",mr,K(l),1),i.store.Configuration.Server.dashboard_refresh_interval===c?(D(),$("i",br)):V("",!0)],8,pr))),256))])])])])])])])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.showMoreSettings?(D(),$("div",_r,[p("div",xr,[p("div",yr,[p("div",vr,[p("div",Sr,[p("h4",wr,[P(r,{t:"Other Settings"})]),p("button",{type:"button",class:"btn-close ms-auto",onClick:t[7]||(t[7]=l=>this.showMoreSettings=!1)})]),p("div",kr,[p("div",null,[p("p",Mr,[p("small",null,[P(r,{t:"Peers"})])]),p("div",Pr,[p("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:t[8]||(t[8]=l=>this.$emit("selectPeers"))},[P(r,{t:"Select Peers"})]),p("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:t[9]||(t[9]=l=>this.$emit("jobsAll"))},[P(r,{t:"Active Jobs"})]),p("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:t[10]||(t[10]=l=>this.$emit("jobLogs"))},[P(r,{t:"Logs"})])])]),p("div",null,[p("p",Cr,[p("small",null,[P(r,{t:"Configuration"})])]),p("div",Dr,[p("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:t[11]||(t[11]=l=>this.$emit("backupRestore"))},[P(r,{t:"Backup & Restore"})]),p("a",{class:"list-group-item list-group-item-action d-flex text-danger fw-bold",role:"button",onClick:t[12]||(t[12]=l=>this.$emit("deleteConfiguration"))},[P(r,{t:"Delete Configuration"})])])])])])])])])):V("",!0)]),_:1})])])}const Ar=rs(Jo,[["render",Or],["__scopeId","data-v-162e14b9"]]);function Tr(s){return Ho()?(Wo(s),!0):!1}function Rn(s){return typeof s=="function"?s():Vo(s)}const En=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Lr=Object.prototype.toString,Ir=s=>Lr.call(s)==="[object Object]",Ge=()=>{},Rr=Er();function Er(){var s,t;return En&&((s=window?.navigator)==null?void 0:s.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window?.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function ue(s){var t;const e=Rn(s);return(t=e?.$el)!=null?t:e}const Fn=En?window:void 0;function ds(...s){let t,e,i,n;if(typeof s[0]=="string"||Array.isArray(s[0])?([e,i,n]=s,t=Fn):[t,e,i,n]=s,!t)return Ge;Array.isArray(e)||(e=[e]),Array.isArray(i)||(i=[i]);const o=[],r=()=>{o.forEach(h=>h()),o.length=0},a=(h,d,u,f)=>(h.addEventListener(d,u,f),()=>h.removeEventListener(d,u,f)),l=An(()=>[ue(t),Rn(n)],([h,d])=>{if(r(),!h)return;const u=Ir(d)?{...d}:d;o.push(...e.flatMap(f=>i.map(g=>a(h,f,g,u))))},{immediate:!0,flush:"post"}),c=()=>{l(),r()};return Tr(c),c}let ri=!1;function Fr(s,t,e={}){const{window:i=Fn,ignore:n=[],capture:o=!0,detectIframe:r=!1}=e;if(!i)return Ge;Rr&&!ri&&(ri=!0,Array.from(i.document.body.children).forEach(u=>u.addEventListener("click",Ge)),i.document.documentElement.addEventListener("click",Ge));let a=!0;const l=u=>n.some(f=>{if(typeof f=="string")return Array.from(i.document.querySelectorAll(f)).some(g=>g===u.target||u.composedPath().includes(g));{const g=ue(f);return g&&(u.target===g||u.composedPath().includes(g))}}),h=[ds(i,"click",u=>{const f=ue(s);if(!(!f||f===u.target||u.composedPath().includes(f))){if(u.detail===0&&(a=!l(u)),!a){a=!0;return}t(u)}},{passive:!0,capture:o}),ds(i,"pointerdown",u=>{const f=ue(s);a=!l(u)&&!!(f&&!u.composedPath().includes(f))},{passive:!0}),r&&ds(i,"blur",u=>{setTimeout(()=>{var f;const g=ue(s);((f=i.document.activeElement)==null?void 0:f.tagName)==="IFRAME"&&!g?.contains(i.document.activeElement)&&t(u)},0)})].filter(Boolean);return()=>h.forEach(u=>u())}const zr={name:"peerSettingsDropdown",components:{LocaleText:as},setup(){return{dashboardStore:Hs()}},props:{Peer:Object},data(){return{deleteBtnDisabled:!1,restrictBtnDisabled:!1,allowAccessBtnDisabled:!1,confirmDelete:!1}},methods:{downloadPeer(){ve("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},s=>{if(s.status){const t=new Blob([s.data.file],{type:"text/plain"}),e=URL.createObjectURL(t),i=`${s.data.fileName}.conf`,n=document.createElement("a");n.href=e,n.download=i,n.click(),this.dashboardStore.newMessage("WGDashboard","Peer download started","success")}else this.dashboardStore.newMessage("Server",s.message,"danger")})},downloadQRCode(s){ve("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},t=>{t.status?this.$emit(s,t.data.file):this.dashboardStore.newMessage("Server",t.message,"danger")})},deletePeer(){this.deleteBtnDisabled=!0,me(`/api/deletePeers/${this.$route.params.id}`,{peers:[this.Peer.id]},s=>{this.dashboardStore.newMessage("Server",s.message,s.status?"success":"danger"),this.$emit("refresh"),this.deleteBtnDisabled=!1})},restrictPeer(){this.restrictBtnDisabled=!0,me(`/api/restrictPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},s=>{this.dashboardStore.newMessage("Server",s.message,s.status?"success":"danger"),this.$emit("refresh"),this.restrictBtnDisabled=!1})},allowAccessPeer(){this.allowAccessBtnDisabled=!0,me(`/api/allowAccessPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},s=>{this.dashboardStore.newMessage("Server",s.message,s.status?"success":"danger"),this.$emit("refresh"),this.allowAccessBtnDisabled=!1})}}},Br={class:"dropdown-menu mt-2 shadow-lg d-block rounded-3",style:{"max-width":"200px"}},$r={style:{"font-size":"0.8rem","padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},Nr={class:"text-body d-flex"},Hr={class:"ms-auto"},Wr={key:1},Vr={class:"w-100 dropdown-item text-muted",style:{"white-space":"break-spaces","font-size":"0.7rem"}},jr={key:2,class:"d-flex",style:{"padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},Ur={key:1,class:"confirmDelete"},Yr={style:{"white-space":"break-spaces"},class:"mb-2 d-block fw-bold"},Kr={class:"d-flex w-100 gap-2"},Xr=["disabled"],Gr=["disabled"],Jr={key:1};function qr(s,t,e,i,n,o){const r=W("LocaleText");return D(),$("ul",Br,[this.Peer.restricted?(D(),$("li",Jr,[p("a",{class:Vt(["dropdown-item d-flex text-warning",{disabled:this.allowAccessBtnDisabled}]),onClick:t[10]||(t[10]=a=>this.allowAccessPeer()),role:"button"},[t[25]||(t[25]=p("i",{class:"me-auto bi bi-unlock"},null,-1)),this.allowAccessBtnDisabled?(D(),H(r,{key:1,t:"Allowing Access..."})):(D(),H(r,{key:0,t:"Allow Access"}))],2)])):(D(),$(qt,{key:0},[this.confirmDelete?(D(),$("li",Ur,[p("p",Yr,[P(r,{t:"Are you sure to delete this peer?"})]),p("div",Kr,[p("button",{onClick:t[8]||(t[8]=a=>this.deletePeer()),disabled:this.deleteBtnDisabled,class:"flex-grow-1 ms-auto btn btn-sm bg-danger"},[P(r,{t:"Yes"})],8,Xr),p("button",{disabled:this.deleteBtnDisabled,onClick:t[9]||(t[9]=a=>this.confirmDelete=!1),class:"flex-grow-1 btn btn-sm bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle"},[P(r,{t:"No"})],8,Gr)])])):(D(),$(qt,{key:0},[this.Peer.status==="running"?(D(),$(qt,{key:0},[p("li",$r,[p("span",Nr,[t[11]||(t[11]=p("i",{class:"bi bi-box-arrow-in-right"},null,-1)),p("span",Hr,K(this.Peer.endpoint),1)])]),t[12]||(t[12]=p("li",null,[p("hr",{class:"dropdown-divider"})],-1))],64)):V("",!0),this.Peer.private_key?(D(),$("li",jr,[p("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:t[0]||(t[0]=a=>this.downloadPeer())},t[13]||(t[13]=[p("i",{class:"me-auto bi bi-download"},null,-1)])),p("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:t[1]||(t[1]=a=>this.downloadQRCode("qrcode"))},t[14]||(t[14]=[p("i",{class:"me-auto bi bi-qr-code"},null,-1)])),p("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:t[2]||(t[2]=a=>this.downloadQRCode("configurationFile"))},t[15]||(t[15]=[p("i",{class:"me-auto bi bi-body-text"},null,-1)])),p("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:t[3]||(t[3]=a=>this.$emit("share"))},t[16]||(t[16]=[p("i",{class:"me-auto bi bi-share"},null,-1)]))])):(D(),$("li",Wr,[p("small",Vr,[P(r,{t:"Download & QR Code is not available due to no private key set for this peer"})])])),t[23]||(t[23]=p("li",null,[p("hr",{class:"dropdown-divider"})],-1)),p("li",null,[p("a",{class:"dropdown-item d-flex",role:"button",onClick:t[4]||(t[4]=a=>this.$emit("setting"))},[t[17]||(t[17]=p("i",{class:"me-auto bi bi-pen"},null,-1)),t[18]||(t[18]=Wt()),P(r,{t:"Peer Settings"})])]),p("li",null,[p("a",{class:"dropdown-item d-flex",role:"button",onClick:t[5]||(t[5]=a=>this.$emit("jobs"))},[t[19]||(t[19]=p("i",{class:"me-auto bi bi-app-indicator"},null,-1)),t[20]||(t[20]=Wt()),P(r,{t:"Schedule Jobs"})])]),t[24]||(t[24]=p("li",null,[p("hr",{class:"dropdown-divider"})],-1)),p("li",null,[p("a",{class:Vt(["dropdown-item d-flex text-warning",{disabled:this.restrictBtnDisabled}]),onClick:t[6]||(t[6]=a=>this.restrictPeer()),role:"button"},[t[21]||(t[21]=p("i",{class:"me-auto bi bi-lock"},null,-1)),this.restrictBtnDisabled?(D(),H(r,{key:1,t:"Restricting..."})):(D(),H(r,{key:0,t:"Restrict Access"}))],2)]),p("li",null,[p("a",{class:Vt(["dropdown-item d-flex fw-bold text-danger",{disabled:this.deleteBtnDisabled}]),onClick:t[7]||(t[7]=a=>this.confirmDelete=!0),role:"button"},[t[22]||(t[22]=p("i",{class:"me-auto bi bi-trash"},null,-1)),this.deleteBtnDisabled?(D(),H(r,{key:1,t:"Deleting..."})):(D(),H(r,{key:0,t:"Delete"}))],2)])],64))],64))])}const Qr=rs(zr,[["render",qr],["__scopeId","data-v-b72b1a20"]]),Zr={name:"peer",components:{LocaleText:as,PeerSettingsDropdown:Qr},props:{Peer:Object},data(){return{}},setup(){const s=Qe(null),t=Qe(!1);return Fr(s,e=>{t.value=!1}),{target:s,subMenuOpened:t}},computed:{getLatestHandshake(){return this.Peer.latest_handshake.includes(",")?this.Peer.latest_handshake.split(",")[0]:this.Peer.latest_handshake}}},ta={key:0,class:"card-header bg-transparent d-flex align-items-center gap-2 border-0"},ea={style:{"font-size":"0.8rem"},class:"ms-auto d-flex gap-2"},sa={class:"text-primary"},ia={class:"text-success"},na={key:0,class:"text-secondary"},oa={key:1,class:"border-0 card-header bg-transparent text-warning fw-bold",style:{"font-size":"0.8rem"}},ra={class:"card-body pt-1",style:{"font-size":"0.9rem"}},aa={class:"mb-1"},la={class:"text-muted"},ca={class:"d-block"},ha={class:"text-muted"},da={class:"d-block"},ua={class:"d-flex align-items-end"};function fa(s,t,e,i,n,o){const r=W("LocaleText"),a=W("PeerSettingsDropdown");return D(),$("div",{class:Vt(["card shadow-sm rounded-3 peerCard bg-transparent",{"border-warning":e.Peer.restricted}])},[p("div",null,[e.Peer.restricted?(D(),$("div",oa,[t[12]||(t[12]=p("i",{class:"bi-lock-fill me-2"},null,-1)),P(r,{t:"Access Restricted"})])):(D(),$("div",ta,[p("div",{class:Vt(["dot ms-0",{active:e.Peer.status==="running"}])},null,2),p("div",ea,[p("span",sa,[t[7]||(t[7]=p("i",{class:"bi bi-arrow-down"},null,-1)),p("strong",null,K((e.Peer.cumu_receive+e.Peer.total_receive).toFixed(4)),1),t[8]||(t[8]=Wt(" GB "))]),p("span",ia,[t[9]||(t[9]=p("i",{class:"bi bi-arrow-up"},null,-1)),p("strong",null,K((e.Peer.cumu_sent+e.Peer.total_sent).toFixed(4)),1),t[10]||(t[10]=Wt(" GB "))]),e.Peer.latest_handshake!=="No Handshake"?(D(),$("span",na,[t[11]||(t[11]=p("i",{class:"bi bi-arrows-angle-contract"},null,-1)),Wt(" "+K(o.getLatestHandshake)+" ago ",1)])):V("",!0)])]))]),p("div",ra,[p("h6",null,K(e.Peer.name?e.Peer.name:"Untitled Peer"),1),p("div",aa,[p("small",la,[P(r,{t:"Public Key"})]),p("small",ca,[p("samp",null,K(e.Peer.id),1)])]),p("div",null,[p("small",ha,[P(r,{t:"Allowed IPs"})]),p("small",da,[p("samp",null,K(e.Peer.allowed_ip),1)])]),p("div",ua,[p("div",{class:Vt(["ms-auto px-2 rounded-3 subMenuBtn",{active:this.subMenuOpened}])},[p("a",{role:"button",class:"text-body",onClick:t[0]||(t[0]=l=>this.subMenuOpened=!0)},t[13]||(t[13]=[p("h5",{class:"mb-0"},[p("i",{class:"bi bi-three-dots"})],-1)])),P(tt,{name:"slide-fade"},{default:G(()=>[this.subMenuOpened?(D(),H(a,{key:0,onQrcode:t[1]||(t[1]=l=>this.$emit("qrcode",l)),onConfigurationFile:t[2]||(t[2]=l=>this.$emit("configurationFile",l)),onSetting:t[3]||(t[3]=l=>this.$emit("setting")),onJobs:t[4]||(t[4]=l=>this.$emit("jobs")),onRefresh:t[5]||(t[5]=l=>this.$emit("refresh")),onShare:t[6]||(t[6]=l=>this.$emit("share")),Peer:e.Peer,ref:"target"},null,8,["Peer"])):V("",!0)]),_:1})],2)])])],2)}const ga=rs(Zr,[["render",fa],["__scopeId","data-v-0f6bdc2a"]]);/*! +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/deleteConfiguration-BU0tzWgI.js","assets/index-DOaPWS1X.js","assets/index-D2eeEsuX.css","assets/localeText-CaAXeE0W.js","assets/configurationBackupRestore-CerUpwbQ.js","assets/dayjs.min-D8jwq_wn.js","assets/configurationBackupRestore-BeBqyCqt.css","assets/selectPeers-B6Dm7IFO.js","assets/selectPeers-Wjnh8YUZ.css","assets/editConfiguration-kC_NwN06.js","assets/editConfiguration-Oqrarw_V.css","assets/peerShareLinkModal-6b5Bdaqt.js","assets/vue-datepicker-D91GxXPq.js","assets/peerJobsLogsModal-ZNMKiJ-k.js","assets/peerJobsAllModal-CkJIs1TM.js","assets/schedulePeerJob-Bfwzc6gk.js","assets/schedulePeerJob--V7cpve7.css","assets/peerJobs-BbNYdlYw.js","assets/peerJobs-voXURBEt.css","assets/peerCreate-B_n86hyd.js","assets/peerCreate-BKh8DeBv.css","assets/peerQRCode-DEHFJvZX.js","assets/browser-CjSdxGTc.js","assets/peerConfigurationFile-BRKM9nlG.js","assets/peerConfigurationFile-CNB9RKjb.css","assets/peerSettings-Bgrsto1V.js","assets/peerSettings-Cm-ugvIi.css"])))=>i.map(i=>d[i]); +import{_ as rs,D as Hs,W as Dn,G as _t,q as me,g as ve,a as D,c as $,b as p,d as P,w as G,m as On,s as No,F as qt,h as ks,t as K,e as V,T as tt,j as W,I as Ho,J as Wo,B as Vo,E as An,f as Wt,n as Vt,i as H,r as Qe,K as Tn,L as Ln,M as Ms,N as jo,o as Uo,O as Yo,P as Ps,Q as Ko,R as In,U as ot,v as Xo,k as Go,V as rt}from"./index-DOaPWS1X.js";import{L as as}from"./localeText-CaAXeE0W.js";import{d as oi}from"./dayjs.min-D8jwq_wn.js";const Jo={name:"peerSearch",components:{LocaleText:as},setup(){const s=Hs(),t=Dn();return{store:s,wireguardConfigurationStore:t}},props:{configuration:Object},data(){return{sort:{status:_t("Status"),name:_t("Name"),allowed_ip:_t("Allowed IPs"),restricted:_t("Restricted")},interval:{5e3:_t("5 Seconds"),1e4:_t("10 Seconds"),3e4:_t("30 Seconds"),6e4:_t("1 Minutes")},searchString:"",searchStringTimeout:void 0,showDisplaySettings:!1,showMoreSettings:!1}},methods:{debounce(){this.searchStringTimeout?(clearTimeout(this.searchStringTimeout),this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)):this.searchStringTimeout=setTimeout(()=>{this.wireguardConfigurationStore.searchString=this.searchString},300)},updateSort(s){me("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_sort",value:s},t=>{t.status&&this.store.getConfiguration()})},updateRefreshInterval(s){me("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_refresh_interval",value:s},t=>{t.status&&this.store.getConfiguration()})},downloadAllPeer(){ve(`/api/downloadAllPeers/${this.configuration.Name}`,{},s=>{console.log(s),window.wireguard.generateZipFiles(s,this.configuration.Name)})}},computed:{searchBarPlaceholder(){return _t("Search Peers...")}}},qo={class:"mb-3"},Qo={class:"d-flex gap-2 z-3 peerSearchContainer"},Zo={class:"mt-3 mt-md-0 flex-grow-1"},tr=["placeholder"],er={key:0,class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll displayModal"},sr={class:"container-md d-flex h-100 w-100"},ir={class:"m-auto modal-dialog-centered dashboardModal"},nr={class:"card rounded-3 shadow w-100"},or={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},rr={class:"mb-0 fw-normal"},ar={class:"card-body px-4 pb-4 d-flex gap-3 flex-column"},lr={class:"text-muted fw-bold mb-2"},cr={class:"list-group"},hr=["onClick"],dr={class:"me-auto"},ur={key:0,class:"bi bi-check text-primary"},fr={class:"text-muted fw-bold mb-2"},gr={class:"list-group"},pr=["onClick"],mr={class:"me-auto"},br={key:0,class:"bi bi-check text-primary"},_r={key:0,class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll displayModal"},xr={class:"container-md d-flex h-100 w-100"},yr={class:"m-auto modal-dialog-centered dashboardModal"},vr={class:"card rounded-3 shadow w-100"},Sr={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4"},wr={class:"mb-0"},kr={class:"card-body px-4 pb-4 d-flex gap-3 flex-column pt-0"},Mr={class:"text-muted fw-bold mb-2"},Pr={class:"list-group"},Cr={class:"text-muted fw-bold mb-2"},Dr={class:"list-group"};function Or(s,t,e,i,n,o){const r=W("LocaleText"),a=W("RouterLink");return D(),$("div",qo,[p("div",Qo,[P(a,{to:"create",class:"text-decoration-none btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle shadow-sm"},{default:G(()=>[t[13]||(t[13]=p("i",{class:"bi bi-plus-lg me-2"},null,-1)),P(r,{t:"Peer"})]),_:1}),p("button",{class:"btn text-primary-emphasis bg-primary-subtle rounded-3 border-1 border-primary-subtle shadow-sm",onClick:t[0]||(t[0]=l=>this.downloadAllPeer())},[t[14]||(t[14]=p("i",{class:"bi bi-download me-2"},null,-1)),P(r,{t:"Download All"})]),p("div",Zo,[On(p("input",{class:"form-control rounded-3 bg-secondary-subtle border-1 border-secondary-subtle shadow-sm w-100",placeholder:o.searchBarPlaceholder,id:"searchPeers",onKeyup:t[1]||(t[1]=l=>this.debounce()),"onUpdate:modelValue":t[2]||(t[2]=l=>this.searchString=l)},null,40,tr),[[No,this.searchString]])]),p("button",{onClick:t[3]||(t[3]=l=>this.showDisplaySettings=!0),class:"btn text-secondary-emphasis bg-secondary-subtle rounded-3 border-1 border-secondary-subtle shadow-sm",type:"button","aria-expanded":"false"},[t[15]||(t[15]=p("i",{class:"bi bi-filter-circle me-2"},null,-1)),P(r,{t:"Display"})]),p("button",{class:"btn text-secondary-emphasis bg-secondary-subtle rounded-3 border-1 border-secondary-subtle shadow-sm",onClick:t[4]||(t[4]=l=>this.$emit("editConfiguration")),type:"button","aria-expanded":"false"},t[16]||(t[16]=[p("i",{class:"bi bi-gear-fill"},null,-1)])),p("button",{class:"btn text-secondary-emphasis bg-secondary-subtle rounded-3 border-1 border-secondary-subtle shadow-sm",onClick:t[5]||(t[5]=l=>this.showMoreSettings=!0),type:"button","aria-expanded":"false"},t[17]||(t[17]=[p("i",{class:"bi bi-three-dots"},null,-1)])),P(tt,{name:"zoom"},{default:G(()=>[this.showDisplaySettings?(D(),$("div",er,[p("div",sr,[p("div",ir,[p("div",nr,[p("div",or,[p("h4",rr,[P(r,{t:"Display"})]),p("button",{type:"button",class:"btn-close ms-auto",onClick:t[6]||(t[6]=l=>this.showDisplaySettings=!1)})]),p("div",ar,[p("div",null,[p("p",lr,[p("small",null,[P(r,{t:"Sort by"})])]),p("div",cr,[(D(!0),$(qt,null,ks(this.sort,(l,c)=>(D(),$("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:h=>this.updateSort(c)},[p("span",dr,K(l),1),i.store.Configuration.Server.dashboard_sort===c?(D(),$("i",ur)):V("",!0)],8,hr))),256))])]),p("div",null,[p("p",fr,[p("small",null,[P(r,{t:"Refresh Interval"})])]),p("div",gr,[(D(!0),$(qt,null,ks(this.interval,(l,c)=>(D(),$("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:h=>this.updateRefreshInterval(c)},[p("span",mr,K(l),1),i.store.Configuration.Server.dashboard_refresh_interval===c?(D(),$("i",br)):V("",!0)],8,pr))),256))])])])])])])])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.showMoreSettings?(D(),$("div",_r,[p("div",xr,[p("div",yr,[p("div",vr,[p("div",Sr,[p("h4",wr,[P(r,{t:"Other Settings"})]),p("button",{type:"button",class:"btn-close ms-auto",onClick:t[7]||(t[7]=l=>this.showMoreSettings=!1)})]),p("div",kr,[p("div",null,[p("p",Mr,[p("small",null,[P(r,{t:"Peers"})])]),p("div",Pr,[p("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:t[8]||(t[8]=l=>this.$emit("selectPeers"))},[P(r,{t:"Select Peers"})]),p("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:t[9]||(t[9]=l=>this.$emit("jobsAll"))},[P(r,{t:"Active Jobs"})]),p("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:t[10]||(t[10]=l=>this.$emit("jobLogs"))},[P(r,{t:"Logs"})])])]),p("div",null,[p("p",Cr,[p("small",null,[P(r,{t:"Configuration"})])]),p("div",Dr,[p("a",{class:"list-group-item list-group-item-action d-flex",role:"button",onClick:t[11]||(t[11]=l=>this.$emit("backupRestore"))},[P(r,{t:"Backup & Restore"})]),p("a",{class:"list-group-item list-group-item-action d-flex text-danger fw-bold",role:"button",onClick:t[12]||(t[12]=l=>this.$emit("deleteConfiguration"))},[P(r,{t:"Delete Configuration"})])])])])])])])])):V("",!0)]),_:1})])])}const Ar=rs(Jo,[["render",Or],["__scopeId","data-v-162e14b9"]]);function Tr(s){return Ho()?(Wo(s),!0):!1}function Rn(s){return typeof s=="function"?s():Vo(s)}const En=typeof window<"u"&&typeof document<"u";typeof WorkerGlobalScope<"u"&&globalThis instanceof WorkerGlobalScope;const Lr=Object.prototype.toString,Ir=s=>Lr.call(s)==="[object Object]",Ge=()=>{},Rr=Er();function Er(){var s,t;return En&&((s=window?.navigator)==null?void 0:s.userAgent)&&(/iP(?:ad|hone|od)/.test(window.navigator.userAgent)||((t=window?.navigator)==null?void 0:t.maxTouchPoints)>2&&/iPad|Macintosh/.test(window?.navigator.userAgent))}function ue(s){var t;const e=Rn(s);return(t=e?.$el)!=null?t:e}const Fn=En?window:void 0;function ds(...s){let t,e,i,n;if(typeof s[0]=="string"||Array.isArray(s[0])?([e,i,n]=s,t=Fn):[t,e,i,n]=s,!t)return Ge;Array.isArray(e)||(e=[e]),Array.isArray(i)||(i=[i]);const o=[],r=()=>{o.forEach(h=>h()),o.length=0},a=(h,d,u,f)=>(h.addEventListener(d,u,f),()=>h.removeEventListener(d,u,f)),l=An(()=>[ue(t),Rn(n)],([h,d])=>{if(r(),!h)return;const u=Ir(d)?{...d}:d;o.push(...e.flatMap(f=>i.map(g=>a(h,f,g,u))))},{immediate:!0,flush:"post"}),c=()=>{l(),r()};return Tr(c),c}let ri=!1;function Fr(s,t,e={}){const{window:i=Fn,ignore:n=[],capture:o=!0,detectIframe:r=!1}=e;if(!i)return Ge;Rr&&!ri&&(ri=!0,Array.from(i.document.body.children).forEach(u=>u.addEventListener("click",Ge)),i.document.documentElement.addEventListener("click",Ge));let a=!0;const l=u=>n.some(f=>{if(typeof f=="string")return Array.from(i.document.querySelectorAll(f)).some(g=>g===u.target||u.composedPath().includes(g));{const g=ue(f);return g&&(u.target===g||u.composedPath().includes(g))}}),h=[ds(i,"click",u=>{const f=ue(s);if(!(!f||f===u.target||u.composedPath().includes(f))){if(u.detail===0&&(a=!l(u)),!a){a=!0;return}t(u)}},{passive:!0,capture:o}),ds(i,"pointerdown",u=>{const f=ue(s);a=!l(u)&&!!(f&&!u.composedPath().includes(f))},{passive:!0}),r&&ds(i,"blur",u=>{setTimeout(()=>{var f;const g=ue(s);((f=i.document.activeElement)==null?void 0:f.tagName)==="IFRAME"&&!g?.contains(i.document.activeElement)&&t(u)},0)})].filter(Boolean);return()=>h.forEach(u=>u())}const zr={name:"peerSettingsDropdown",components:{LocaleText:as},setup(){return{dashboardStore:Hs()}},props:{Peer:Object},data(){return{deleteBtnDisabled:!1,restrictBtnDisabled:!1,allowAccessBtnDisabled:!1,confirmDelete:!1}},methods:{downloadPeer(){ve("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},s=>{if(s.status){const t=new Blob([s.data.file],{type:"text/plain"}),e=URL.createObjectURL(t),i=`${s.data.fileName}.conf`,n=document.createElement("a");n.href=e,n.download=i,n.click(),this.dashboardStore.newMessage("WGDashboard","Peer download started","success")}else this.dashboardStore.newMessage("Server",s.message,"danger")})},downloadQRCode(s){ve("/api/downloadPeer/"+this.$route.params.id,{id:this.Peer.id},t=>{t.status?this.$emit(s,t.data.file):this.dashboardStore.newMessage("Server",t.message,"danger")})},deletePeer(){this.deleteBtnDisabled=!0,me(`/api/deletePeers/${this.$route.params.id}`,{peers:[this.Peer.id]},s=>{this.dashboardStore.newMessage("Server",s.message,s.status?"success":"danger"),this.$emit("refresh"),this.deleteBtnDisabled=!1})},restrictPeer(){this.restrictBtnDisabled=!0,me(`/api/restrictPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},s=>{this.dashboardStore.newMessage("Server",s.message,s.status?"success":"danger"),this.$emit("refresh"),this.restrictBtnDisabled=!1})},allowAccessPeer(){this.allowAccessBtnDisabled=!0,me(`/api/allowAccessPeers/${this.$route.params.id}`,{peers:[this.Peer.id]},s=>{this.dashboardStore.newMessage("Server",s.message,s.status?"success":"danger"),this.$emit("refresh"),this.allowAccessBtnDisabled=!1})}}},Br={class:"dropdown-menu mt-2 shadow-lg d-block rounded-3",style:{"max-width":"200px"}},$r={style:{"font-size":"0.8rem","padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},Nr={class:"text-body d-flex"},Hr={class:"ms-auto"},Wr={key:1},Vr={class:"w-100 dropdown-item text-muted",style:{"white-space":"break-spaces","font-size":"0.7rem"}},jr={key:2,class:"d-flex",style:{"padding-left":"var(--bs-dropdown-item-padding-x)","padding-right":"var(--bs-dropdown-item-padding-x)"}},Ur={key:1,class:"confirmDelete"},Yr={style:{"white-space":"break-spaces"},class:"mb-2 d-block fw-bold"},Kr={class:"d-flex w-100 gap-2"},Xr=["disabled"],Gr=["disabled"],Jr={key:1};function qr(s,t,e,i,n,o){const r=W("LocaleText");return D(),$("ul",Br,[this.Peer.restricted?(D(),$("li",Jr,[p("a",{class:Vt(["dropdown-item d-flex text-warning",{disabled:this.allowAccessBtnDisabled}]),onClick:t[10]||(t[10]=a=>this.allowAccessPeer()),role:"button"},[t[25]||(t[25]=p("i",{class:"me-auto bi bi-unlock"},null,-1)),this.allowAccessBtnDisabled?(D(),H(r,{key:1,t:"Allowing Access..."})):(D(),H(r,{key:0,t:"Allow Access"}))],2)])):(D(),$(qt,{key:0},[this.confirmDelete?(D(),$("li",Ur,[p("p",Yr,[P(r,{t:"Are you sure to delete this peer?"})]),p("div",Kr,[p("button",{onClick:t[8]||(t[8]=a=>this.deletePeer()),disabled:this.deleteBtnDisabled,class:"flex-grow-1 ms-auto btn btn-sm bg-danger"},[P(r,{t:"Yes"})],8,Xr),p("button",{disabled:this.deleteBtnDisabled,onClick:t[9]||(t[9]=a=>this.confirmDelete=!1),class:"flex-grow-1 btn btn-sm bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle"},[P(r,{t:"No"})],8,Gr)])])):(D(),$(qt,{key:0},[this.Peer.status==="running"?(D(),$(qt,{key:0},[p("li",$r,[p("span",Nr,[t[11]||(t[11]=p("i",{class:"bi bi-box-arrow-in-right"},null,-1)),p("span",Hr,K(this.Peer.endpoint),1)])]),t[12]||(t[12]=p("li",null,[p("hr",{class:"dropdown-divider"})],-1))],64)):V("",!0),this.Peer.private_key?(D(),$("li",jr,[p("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:t[0]||(t[0]=a=>this.downloadPeer())},t[13]||(t[13]=[p("i",{class:"me-auto bi bi-download"},null,-1)])),p("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:t[1]||(t[1]=a=>this.downloadQRCode("qrcode"))},t[14]||(t[14]=[p("i",{class:"me-auto bi bi-qr-code"},null,-1)])),p("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:t[2]||(t[2]=a=>this.downloadQRCode("configurationFile"))},t[15]||(t[15]=[p("i",{class:"me-auto bi bi-body-text"},null,-1)])),p("a",{class:"dropdown-item text-center px-0 rounded-3",role:"button",onClick:t[3]||(t[3]=a=>this.$emit("share"))},t[16]||(t[16]=[p("i",{class:"me-auto bi bi-share"},null,-1)]))])):(D(),$("li",Wr,[p("small",Vr,[P(r,{t:"Download & QR Code is not available due to no private key set for this peer"})])])),t[23]||(t[23]=p("li",null,[p("hr",{class:"dropdown-divider"})],-1)),p("li",null,[p("a",{class:"dropdown-item d-flex",role:"button",onClick:t[4]||(t[4]=a=>this.$emit("setting"))},[t[17]||(t[17]=p("i",{class:"me-auto bi bi-pen"},null,-1)),t[18]||(t[18]=Wt()),P(r,{t:"Peer Settings"})])]),p("li",null,[p("a",{class:"dropdown-item d-flex",role:"button",onClick:t[5]||(t[5]=a=>this.$emit("jobs"))},[t[19]||(t[19]=p("i",{class:"me-auto bi bi-app-indicator"},null,-1)),t[20]||(t[20]=Wt()),P(r,{t:"Schedule Jobs"})])]),t[24]||(t[24]=p("li",null,[p("hr",{class:"dropdown-divider"})],-1)),p("li",null,[p("a",{class:Vt(["dropdown-item d-flex text-warning",{disabled:this.restrictBtnDisabled}]),onClick:t[6]||(t[6]=a=>this.restrictPeer()),role:"button"},[t[21]||(t[21]=p("i",{class:"me-auto bi bi-lock"},null,-1)),this.restrictBtnDisabled?(D(),H(r,{key:1,t:"Restricting..."})):(D(),H(r,{key:0,t:"Restrict Access"}))],2)]),p("li",null,[p("a",{class:Vt(["dropdown-item d-flex fw-bold text-danger",{disabled:this.deleteBtnDisabled}]),onClick:t[7]||(t[7]=a=>this.confirmDelete=!0),role:"button"},[t[22]||(t[22]=p("i",{class:"me-auto bi bi-trash"},null,-1)),this.deleteBtnDisabled?(D(),H(r,{key:1,t:"Deleting..."})):(D(),H(r,{key:0,t:"Delete"}))],2)])],64))],64))])}const Qr=rs(zr,[["render",qr],["__scopeId","data-v-b72b1a20"]]),Zr={name:"peer",components:{LocaleText:as,PeerSettingsDropdown:Qr},props:{Peer:Object},data(){return{}},setup(){const s=Qe(null),t=Qe(!1);return Fr(s,e=>{t.value=!1}),{target:s,subMenuOpened:t}},computed:{getLatestHandshake(){return this.Peer.latest_handshake.includes(",")?this.Peer.latest_handshake.split(",")[0]:this.Peer.latest_handshake}}},ta={key:0,class:"card-header bg-transparent d-flex align-items-center gap-2 border-0"},ea={style:{"font-size":"0.8rem"},class:"ms-auto d-flex gap-2"},sa={class:"text-primary"},ia={class:"text-success"},na={key:0,class:"text-secondary"},oa={key:1,class:"border-0 card-header bg-transparent text-warning fw-bold",style:{"font-size":"0.8rem"}},ra={class:"card-body pt-1",style:{"font-size":"0.9rem"}},aa={class:"mb-1"},la={class:"text-muted"},ca={class:"d-block"},ha={class:"text-muted"},da={class:"d-block"},ua={class:"d-flex align-items-end"};function fa(s,t,e,i,n,o){const r=W("LocaleText"),a=W("PeerSettingsDropdown");return D(),$("div",{class:Vt(["card shadow-sm rounded-3 peerCard bg-transparent",{"border-warning":e.Peer.restricted}])},[p("div",null,[e.Peer.restricted?(D(),$("div",oa,[t[12]||(t[12]=p("i",{class:"bi-lock-fill me-2"},null,-1)),P(r,{t:"Access Restricted"})])):(D(),$("div",ta,[p("div",{class:Vt(["dot ms-0",{active:e.Peer.status==="running"}])},null,2),p("div",ea,[p("span",sa,[t[7]||(t[7]=p("i",{class:"bi bi-arrow-down"},null,-1)),p("strong",null,K((e.Peer.cumu_receive+e.Peer.total_receive).toFixed(4)),1),t[8]||(t[8]=Wt(" GB "))]),p("span",ia,[t[9]||(t[9]=p("i",{class:"bi bi-arrow-up"},null,-1)),p("strong",null,K((e.Peer.cumu_sent+e.Peer.total_sent).toFixed(4)),1),t[10]||(t[10]=Wt(" GB "))]),e.Peer.latest_handshake!=="No Handshake"?(D(),$("span",na,[t[11]||(t[11]=p("i",{class:"bi bi-arrows-angle-contract"},null,-1)),Wt(" "+K(o.getLatestHandshake)+" ago ",1)])):V("",!0)])]))]),p("div",ra,[p("h6",null,K(e.Peer.name?e.Peer.name:"Untitled Peer"),1),p("div",aa,[p("small",la,[P(r,{t:"Public Key"})]),p("small",ca,[p("samp",null,K(e.Peer.id),1)])]),p("div",null,[p("small",ha,[P(r,{t:"Allowed IPs"})]),p("small",da,[p("samp",null,K(e.Peer.allowed_ip),1)])]),p("div",ua,[p("div",{class:Vt(["ms-auto px-2 rounded-3 subMenuBtn",{active:this.subMenuOpened}])},[p("a",{role:"button",class:"text-body",onClick:t[0]||(t[0]=l=>this.subMenuOpened=!0)},t[13]||(t[13]=[p("h5",{class:"mb-0"},[p("i",{class:"bi bi-three-dots"})],-1)])),P(tt,{name:"slide-fade"},{default:G(()=>[this.subMenuOpened?(D(),H(a,{key:0,onQrcode:t[1]||(t[1]=l=>this.$emit("qrcode",l)),onConfigurationFile:t[2]||(t[2]=l=>this.$emit("configurationFile",l)),onSetting:t[3]||(t[3]=l=>this.$emit("setting")),onJobs:t[4]||(t[4]=l=>this.$emit("jobs")),onRefresh:t[5]||(t[5]=l=>this.$emit("refresh")),onShare:t[6]||(t[6]=l=>this.$emit("share")),Peer:e.Peer,ref:"target"},null,8,["Peer"])):V("",!0)]),_:1})],2)])])],2)}const ga=rs(Zr,[["render",fa],["__scopeId","data-v-0f6bdc2a"]]);/*! * @kurkle/color v0.3.2 * https://github.com/kurkle/color#readme * (c) 2023 Jukka Kurkela @@ -16,4 +16,4 @@ import{_ as rs,D as Hs,W as Dn,G as _t,q as me,g as ve,a as D,c as $,b as p,d as * Released under the MIT License */class rc{constructor(){this._request=null,this._charts=new Map,this._running=!1,this._lastDate=void 0}_notify(t,e,i,n){const o=e.listeners[n],r=e.duration;o.forEach(a=>a({chart:t,initial:e.initial,numSteps:r,currentStep:Math.min(i-e.start,r)}))}_refresh(){this._request||(this._running=!0,this._request=jn.call(window,()=>{this._update(),this._request=null,this._running&&this._refresh()}))}_update(t=Date.now()){let e=0;this._charts.forEach((i,n)=>{if(!i.running||!i.items.length)return;const o=i.items;let r=o.length-1,a=!1,l;for(;r>=0;--r)l=o[r],l._active?(l._total>i.duration&&(i.duration=l._total),l.tick(t),a=!0):(o[r]=o[o.length-1],o.pop());a&&(n.draw(),this._notify(n,i,t,"progress")),o.length||(i.running=!1,this._notify(n,i,t,"complete"),i.initial=!1),e+=o.length}),this._lastDate=t,e===0&&(this._running=!1)}_getAnims(t){const e=this._charts;let i=e.get(t);return i||(i={running:!1,initial:!0,items:[],listeners:{complete:[],progress:[]}},e.set(t,i)),i}listen(t,e,i){this._getAnims(t).listeners[e].push(i)}add(t,e){!e||!e.length||this._getAnims(t).items.push(...e)}has(t){return this._getAnims(t).items.length>0}start(t){const e=this._charts.get(t);e&&(e.running=!0,e.start=Date.now(),e.duration=e.items.reduce((i,n)=>Math.max(i,n._duration),0),this._refresh())}running(t){if(!this._running)return!1;const e=this._charts.get(t);return!(!e||!e.running||!e.items.length)}stop(t){const e=this._charts.get(t);if(!e||!e.items.length)return;const i=e.items;let n=i.length-1;for(;n>=0;--n)i[n].cancel();e.items=[],this._notify(t,e,Date.now(),"complete")}remove(t){return this._charts.delete(t)}}var yt=new rc;const Ai="transparent",ac={boolean(s,t,e){return e>.5?t:s},color(s,t,e){const i=xi(s||Ai),n=i.valid&&xi(t||Ai);return n&&n.valid?n.mix(i,e).hexString():t},number(s,t,e){return s+(t-s)*e}};class lc{constructor(t,e,i,n){const o=e[i];n=Be([t.to,n,o,t.from]);const r=Be([t.from,o,n]);this._active=!0,this._fn=t.fn||ac[t.type||typeof r],this._easing=xe[t.easing]||xe.linear,this._start=Math.floor(Date.now()+(t.delay||0)),this._duration=this._total=Math.floor(t.duration),this._loop=!!t.loop,this._target=e,this._prop=i,this._from=r,this._to=n,this._promises=void 0}active(){return this._active}update(t,e,i){if(this._active){this._notify(!1);const n=this._target[this._prop],o=i-this._start,r=this._duration-o;this._start=i,this._duration=Math.floor(Math.max(r,t.duration)),this._total+=o,this._loop=!!t.loop,this._to=Be([t.to,e,n,t.from]),this._from=Be([t.from,n,e])}}cancel(){this._active&&(this.tick(Date.now()),this._active=!1,this._notify(!1))}tick(t){const e=t-this._start,i=this._duration,n=this._prop,o=this._from,r=this._loop,a=this._to;let l;if(this._active=o!==a&&(r||e1?2-l:l,l=this._easing(Math.min(1,Math.max(0,l))),this._target[n]=this._fn(o,a,l)}wait(){const t=this._promises||(this._promises=[]);return new Promise((e,i)=>{t.push({res:e,rej:i})})}_notify(t){const e=t?"res":"rej",i=this._promises||[];for(let n=0;n{const o=t[n];if(!R(o))return;const r={};for(const a of e)r[a]=o[a];(Y(o.properties)&&o.properties||[n]).forEach(a=>{(a===n||!i.has(a))&&i.set(a,r)})})}_animateOptions(t,e){const i=e.options,n=hc(t,i);if(!n)return[];const o=this._createAnimations(n,i);return i.$shared&&cc(t.options.$animations,i).then(()=>{t.options=i},()=>{}),o}_createAnimations(t,e){const i=this._properties,n=[],o=t.$animations||(t.$animations={}),r=Object.keys(e),a=Date.now();let l;for(l=r.length-1;l>=0;--l){const c=r[l];if(c.charAt(0)==="$")continue;if(c==="options"){n.push(...this._animateOptions(t,e));continue}const h=e[c];let d=o[c];const u=i.get(c);if(d)if(u&&d.active()){d.update(u,h,a);continue}else d.cancel();if(!u||!u.duration){t[c]=h;continue}o[c]=d=new lc(u,t,c,h),n.push(d)}return n}update(t,e){if(this._properties.size===0){Object.assign(t,e);return}const i=this._createAnimations(t,e);if(i.length)return yt.add(this._chart,i),!0}}function cc(s,t){const e=[],i=Object.keys(t);for(let n=0;n0||!e&&o<0)return n.index}return null}function Ei(s,t){const{chart:e,_cachedMeta:i}=s,n=e._stacks||(e._stacks={}),{iScale:o,vScale:r,index:a}=i,l=o.axis,c=r.axis,h=gc(o,r,i),d=t.length;let u;for(let f=0;fe[i].axis===t).shift()}function bc(s,t){return Yt(s,{active:!1,dataset:void 0,datasetIndex:t,index:t,mode:"default",type:"dataset"})}function _c(s,t,e){return Yt(s,{active:!1,dataIndex:t,parsed:void 0,raw:void 0,element:e,index:t,mode:"default",type:"data"})}function ae(s,t){const e=s.controller.index,i=s.vScale&&s.vScale.axis;if(i){t=t||s._parsed;for(const n of t){const o=n._stacks;if(!o||o[i]===void 0||o[i][e]===void 0)return;delete o[i][e],o[i]._visualValues!==void 0&&o[i]._visualValues[e]!==void 0&&delete o[i]._visualValues[e]}}}const ms=s=>s==="reset"||s==="none",Fi=(s,t)=>t?s:Object.assign({},s),xc=(s,t,e)=>s&&!t.hidden&&t._stacked&&{keys:ao(e,!0),values:null};class si{static defaults={};static datasetElementType=null;static dataElementType=null;constructor(t,e){this.chart=t,this._ctx=t.ctx,this.index=e,this._cachedDataOpts={},this._cachedMeta=this.getMeta(),this._type=this._cachedMeta.type,this.options=void 0,this._parsing=!1,this._data=void 0,this._objectData=void 0,this._sharedOptions=void 0,this._drawStart=void 0,this._drawCount=void 0,this.enableOptionSharing=!1,this.supportsDecimation=!1,this.$context=void 0,this._syncList=[],this.datasetElementType=new.target.datasetElementType,this.dataElementType=new.target.dataElementType,this.initialize()}initialize(){const t=this._cachedMeta;this.configure(),this.linkScales(),t._stacked=Ii(t.vScale,t),this.addElements(),this.options.fill&&!this.chart.isPluginEnabled("filler")&&console.warn("Tried to use the 'fill' option without the 'Filler' plugin enabled. Please import and register the 'Filler' plugin and make sure it is not disabled in the options")}updateIndex(t){this.index!==t&&ae(this._cachedMeta),this.index=t}linkScales(){const t=this.chart,e=this._cachedMeta,i=this.getDataset(),n=(d,u,f,g)=>d==="x"?u:d==="r"?g:f,o=e.xAxisID=L(i.xAxisID,ps(t,"x")),r=e.yAxisID=L(i.yAxisID,ps(t,"y")),a=e.rAxisID=L(i.rAxisID,ps(t,"r")),l=e.indexAxis,c=e.iAxisID=n(l,o,r,a),h=e.vAxisID=n(l,r,o,a);e.xScale=this.getScaleForId(o),e.yScale=this.getScaleForId(r),e.rScale=this.getScaleForId(a),e.iScale=this.getScaleForId(c),e.vScale=this.getScaleForId(h)}getDataset(){return this.chart.data.datasets[this.index]}getMeta(){return this.chart.getDatasetMeta(this.index)}getScaleForId(t){return this.chart.scales[t]}_getOtherScale(t){const e=this._cachedMeta;return t===e.iScale?e.vScale:e.iScale}reset(){this._update("reset")}_destroy(){const t=this._cachedMeta;this._data&&mi(this._data,this),t._stacked&&ae(t)}_dataCheck(){const t=this.getDataset(),e=t.data||(t.data=[]),i=this._data;if(R(e)){const n=this._cachedMeta;this._data=fc(e,n)}else if(i!==e){if(i){mi(i,this);const n=this._cachedMeta;ae(n),n._parsed=[]}e&&Object.isExtensible(e)&&el(e,this),this._syncList=[],this._data=e}}addElements(){const t=this._cachedMeta;this._dataCheck(),this.datasetElementType&&(t.dataset=new this.datasetElementType)}buildOrUpdateElements(t){const e=this._cachedMeta,i=this.getDataset();let n=!1;this._dataCheck();const o=e._stacked;e._stacked=Ii(e.vScale,e),e.stack!==i.stack&&(n=!0,ae(e),e.stack=i.stack),this._resyncElements(t),(n||o!==e._stacked)&&Ei(this,e._parsed)}configure(){const t=this.chart.config,e=t.datasetScopeKeys(this._type),i=t.getOptionScopes(this.getDataset(),e,!0);this.options=t.createResolver(i,this.getContext()),this._parsing=this.options.parsing,this._cachedDataOpts={}}parse(t,e){const{_cachedMeta:i,_data:n}=this,{iScale:o,_stacked:r}=i,a=o.axis;let l=t===0&&e===n.length?!0:i._sorted,c=t>0&&i._parsed[t-1],h,d,u;if(this._parsing===!1)i._parsed=n,i._sorted=!0,u=n;else{Y(n[t])?u=this.parseArrayData(i,n,t,e):R(n[t])?u=this.parseObjectData(i,n,t,e):u=this.parsePrimitiveData(i,n,t,e);const f=()=>d[a]===null||c&&d[a]m||d=0;--u)if(!g()){this.updateRangeFromParsed(c,t,f,l);break}}return c}getAllParsedValues(t){const e=this._cachedMeta._parsed,i=[];let n,o,r;for(n=0,o=e.length;n=0&&tthis.getContext(i,n,e),m=c.resolveNamedOptions(u,f,g,d);return m.$shared&&(m.$shared=l,o[r]=Object.freeze(Fi(m,l))),m}_resolveAnimations(t,e,i){const n=this.chart,o=this._cachedDataOpts,r=`animation-${e}`,a=o[r];if(a)return a;let l;if(n.options.animation!==!1){const h=this.chart.config,d=h.datasetAnimationScopeKeys(this._type,e),u=h.getOptionScopes(this.getDataset(),d);l=h.createResolver(u,this.getContext(t,i,e))}const c=new ro(n,l&&l.animations);return l&&l._cacheable&&(o[r]=Object.freeze(c)),c}getSharedOptions(t){if(t.$shared)return this._sharedOptions||(this._sharedOptions=Object.assign({},t))}includeOptions(t,e){return!e||ms(t)||this.chart._animationsDisabled}_getSharedOptions(t,e){const i=this.resolveDataElementOptions(t,e),n=this._sharedOptions,o=this.getSharedOptions(i),r=this.includeOptions(e,o)||o!==n;return this.updateSharedOptions(o,e,i),{sharedOptions:o,includeOptions:r}}updateElement(t,e,i,n){ms(n)?Object.assign(t,i):this._resolveAnimations(e,n).update(t,i)}updateSharedOptions(t,e,i){t&&!ms(e)&&this._resolveAnimations(void 0,e).update(t,i)}_setStyle(t,e,i,n){t.active=n;const o=this.getStyle(e,n);this._resolveAnimations(e,i,n).update(t,{options:!n&&this.getSharedOptions(o)||o})}removeHoverStyle(t,e,i){this._setStyle(t,i,"active",!1)}setHoverStyle(t,e,i){this._setStyle(t,i,"active",!0)}_removeDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!1)}_setDatasetHoverStyle(){const t=this._cachedMeta.dataset;t&&this._setStyle(t,void 0,"active",!0)}_resyncElements(t){const e=this._data,i=this._cachedMeta.data;for(const[a,l,c]of this._syncList)this[a](l,c);this._syncList=[];const n=i.length,o=e.length,r=Math.min(o,n);r&&this.parse(0,r),o>n?this._insertElements(n,o-n,t):o{for(c.length+=e,a=c.length-1;a>=r;a--)c[a]=c[a-e]};for(l(o),a=t;an-o))}return s._cache.$bar}function vc(s){const t=s.iScale,e=yc(t,s.type);let i=t._length,n,o,r,a;const l=()=>{r===32767||r===-32768||(ke(a)&&(i=Math.min(i,Math.abs(r-a)||i)),a=r)};for(n=0,o=e.length;n0?n[s-1]:null,a=sMath.abs(a)&&(l=a,c=r),t[e.axis]=c,t._custom={barStart:l,barEnd:c,start:n,end:o,min:r,max:a}}function lo(s,t,e,i){return Y(s)?kc(s,t,e,i):t[e.axis]=e.parse(s,i),t}function zi(s,t,e,i){const n=s.iScale,o=s.vScale,r=n.getLabels(),a=n===o,l=[];let c,h,d,u;for(c=e,h=e+i;c=e?1:-1)}function Pc(s){let t,e,i,n,o;return s.horizontal?(t=s.base>s.x,e="left",i="right"):(t=s.baseh.controller.options.grouped),o=i.options.stacked,r=[],a=this._cachedMeta.controller.getParsed(e),l=a&&a[i.axis],c=h=>{const d=h._parsed.find(f=>f[i.axis]===l),u=d&&d[h.vScale.axis];if(z(u)||isNaN(u))return!0};for(const h of n)if(!(e!==void 0&&c(h))&&((o===!1||r.indexOf(h.stack)===-1||o===void 0&&h.stack===void 0)&&r.push(h.stack),h.index===t))break;return r.length||r.push(void 0),r}_getStackCount(t){return this._getStacks(void 0,t).length}_getStackIndex(t,e,i){const n=this._getStacks(t,i),o=e!==void 0?n.indexOf(e):-1;return o===-1?n.length-1:o}_getRuler(){const t=this.options,e=this._cachedMeta,i=e.iScale,n=[];let o,r;for(o=0,r=e.data.length;o0&&this.getParsed(e-1);for(let v=0;v=y){w.skip=!0;continue}const k=this.getParsed(v),C=z(k[f]),I=w[u]=r.getPixelForValue(k[u],v),A=w[f]=o||C?a.getBasePixel():a.getPixelForValue(l?this.applyStack(a,k,l):k[f],v);w.skip=isNaN(I)||isNaN(A)||C,w.stop=v>0&&Math.abs(k[u]-M[u])>b,m&&(w.parsed=k,w.raw=c.data[v]),d&&(w.options=h||this.resolveDataElementOptions(v,x.active?"active":n)),_||this.updateElement(x,v,w,n),M=k}}getMaxOverflow(){const t=this._cachedMeta,e=t.dataset,i=e.options&&e.options.borderWidth||0,n=t.data||[];if(!n.length)return i;const o=n[0].size(this.resolveDataElementOptions(0)),r=n[n.length-1].size(this.resolveDataElementOptions(n.length-1));return Math.max(i,o,r)/2}draw(){const t=this._cachedMeta;t.dataset.updateControlPoints(this.chart.chartArea,t.iScale.axis),super.draw()}}function Et(){throw new Error("This method is not implemented: Check that a complete date adapter is provided.")}class ii{static override(t){Object.assign(ii.prototype,t)}options;constructor(t){this.options=t||{}}init(){}formats(){return Et()}parse(){return Et()}format(){return Et()}add(){return Et()}diff(){return Et()}startOf(){return Et()}endOf(){return Et()}}var Ac={_date:ii};function Tc(s,t,e,i){const{controller:n,data:o,_sorted:r}=s,a=n._cachedMeta.iScale;if(a&&t===a.axis&&t!=="r"&&r&&o.length){const l=a._reversePixels?Za:Ht;if(i){if(n._sharedOptions){const c=o[0],h=typeof c.getRange=="function"&&c.getRange(t);if(h){const d=l(o,t,e-h),u=l(o,t,e+h);return{lo:d.lo,hi:u.hi}}}}else return l(o,t,e)}return{lo:0,hi:o.length-1}}function Ae(s,t,e,i,n){const o=s.getSortedVisibleDatasetMetas(),r=e[t];for(let a=0,l=o.length;a{l[r]&&l[r](t[e],n)&&(o.push({element:l,datasetIndex:c,index:h}),a=a||l.inRange(t.x,t.y,n))}),i&&!a?[]:o}var Ec={evaluateInteractionItems:Ae,modes:{index(s,t,e,i){const n=Ft(t,s),o=e.axis||"x",r=e.includeInvisible||!1,a=e.intersect?_s(s,n,o,i,r):xs(s,n,o,!1,i,r),l=[];return a.length?(s.getSortedVisibleDatasetMetas().forEach(c=>{const h=a[0].index,d=c.data[h];d&&!d.skip&&l.push({element:d,datasetIndex:c.index,index:h})}),l):[]},dataset(s,t,e,i){const n=Ft(t,s),o=e.axis||"xy",r=e.includeInvisible||!1;let a=e.intersect?_s(s,n,o,i,r):xs(s,n,o,!1,i,r);if(a.length>0){const l=a[0].datasetIndex,c=s.getDatasetMeta(l).data;a=[];for(let h=0;he.pos===t)}function Hi(s,t){return s.filter(e=>uo.indexOf(e.pos)===-1&&e.box.axis===t)}function ce(s,t){return s.sort((e,i)=>{const n=t?i:e,o=t?e:i;return n.weight===o.weight?n.index-o.index:n.weight-o.weight})}function Fc(s){const t=[];let e,i,n,o,r,a;for(e=0,i=(s||[]).length;ec.box.fullSize),!0),i=ce(le(t,"left"),!0),n=ce(le(t,"right")),o=ce(le(t,"top"),!0),r=ce(le(t,"bottom")),a=Hi(t,"x"),l=Hi(t,"y");return{fullSize:e,leftAndTop:i.concat(o),rightAndBottom:n.concat(l).concat(r).concat(a),chartArea:le(t,"chartArea"),vertical:i.concat(n).concat(l),horizontal:o.concat(r).concat(a)}}function Wi(s,t,e,i){return Math.max(s[e],t[e])+Math.max(s[i],t[i])}function fo(s,t){s.top=Math.max(s.top,t.top),s.left=Math.max(s.left,t.left),s.bottom=Math.max(s.bottom,t.bottom),s.right=Math.max(s.right,t.right)}function Nc(s,t,e,i){const{pos:n,box:o}=e,r=s.maxPadding;if(!R(n)){e.size&&(s[n]-=e.size);const d=i[e.stack]||{size:0,count:1};d.size=Math.max(d.size,e.horizontal?o.height:o.width),e.size=d.size/d.count,s[n]+=e.size}o.getPadding&&fo(r,o.getPadding());const a=Math.max(0,t.outerWidth-Wi(r,s,"left","right")),l=Math.max(0,t.outerHeight-Wi(r,s,"top","bottom")),c=a!==s.w,h=l!==s.h;return s.w=a,s.h=l,e.horizontal?{same:c,other:h}:{same:h,other:c}}function Hc(s){const t=s.maxPadding;function e(i){const n=Math.max(t[i]-s[i],0);return s[i]+=n,n}s.y+=e("top"),s.x+=e("left"),e("right"),e("bottom")}function Wc(s,t){const e=t.maxPadding;function i(n){const o={left:0,top:0,right:0,bottom:0};return n.forEach(r=>{o[r]=Math.max(t[r],e[r])}),o}return i(s?["left","right"]:["top","bottom"])}function ge(s,t,e,i){const n=[];let o,r,a,l,c,h;for(o=0,r=s.length,c=0;o{typeof m.beforeLayout=="function"&&m.beforeLayout()});const h=l.reduce((m,b)=>b.box.options&&b.box.options.display===!1?m:m+1,0)||1,d=Object.freeze({outerWidth:t,outerHeight:e,padding:n,availableWidth:o,availableHeight:r,vBoxMaxWidth:o/2/h,hBoxMaxHeight:r/2}),u=Object.assign({},n);fo(u,ht(i));const f=Object.assign({maxPadding:u,w:o,h:r,x:n.left,y:n.top},n),g=Bc(l.concat(c),d);ge(a.fullSize,f,d,g),ge(l,f,d,g),ge(c,f,d,g)&&ge(l,f,d,g),Hc(f),Vi(a.leftAndTop,f,d,g),f.x+=f.w,f.y+=f.h,Vi(a.rightAndBottom,f,d,g),s.chartArea={left:f.left,top:f.top,right:f.left+f.w,bottom:f.top+f.h,height:f.h,width:f.w},E(a.chartArea,m=>{const b=m.box;Object.assign(b,s.chartArea),b.update(f.w,f.h,{left:0,top:0,right:0,bottom:0})})}};class go{acquireContext(t,e){}releaseContext(t){return!1}addEventListener(t,e,i){}removeEventListener(t,e,i){}getDevicePixelRatio(){return 1}getMaximumSize(t,e,i,n){return e=Math.max(0,e||t.width),i=i||t.height,{width:e,height:Math.max(0,n?Math.floor(e/n):i)}}isAttached(t){return!0}updateConfig(t){}}class Vc extends go{acquireContext(t){return t&&t.getContext&&t.getContext("2d")||null}updateConfig(t){t.options.animation=!1}}const Je="$chartjs",jc={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"},ji=s=>s===null||s==="";function Uc(s,t){const e=s.style,i=s.getAttribute("height"),n=s.getAttribute("width");if(s[Je]={initial:{height:i,width:n,style:{display:e.display,height:e.height,width:e.width}}},e.display=e.display||"block",e.boxSizing=e.boxSizing||"border-box",ji(n)){const o=Pi(s,"width");o!==void 0&&(s.width=o)}if(ji(i))if(s.style.height==="")s.height=s.width/(t||2);else{const o=Pi(s,"height");o!==void 0&&(s.height=o)}return s}const po=Kl?{passive:!0}:!1;function Yc(s,t,e){s&&s.addEventListener(t,e,po)}function Kc(s,t,e){s&&s.canvas&&s.canvas.removeEventListener(t,e,po)}function Xc(s,t){const e=jc[s.type]||s.type,{x:i,y:n}=Ft(s,t);return{type:e,chart:t,native:s,x:i!==void 0?i:null,y:n!==void 0?n:null}}function ns(s,t){for(const e of s)if(e===t||e.contains(t))return!0}function Gc(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ns(a.addedNodes,i),r=r&&!ns(a.removedNodes,i);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}function Jc(s,t,e){const i=s.canvas,n=new MutationObserver(o=>{let r=!1;for(const a of o)r=r||ns(a.removedNodes,i),r=r&&!ns(a.addedNodes,i);r&&e()});return n.observe(document,{childList:!0,subtree:!0}),n}const De=new Map;let Ui=0;function mo(){const s=window.devicePixelRatio;s!==Ui&&(Ui=s,De.forEach((t,e)=>{e.currentDevicePixelRatio!==s&&t()}))}function qc(s,t){De.size||window.addEventListener("resize",mo),De.set(s,t)}function Qc(s){De.delete(s),De.size||window.removeEventListener("resize",mo)}function Zc(s,t,e){const i=s.canvas,n=i&&ei(i);if(!n)return;const o=Un((a,l)=>{const c=n.clientWidth;e(a,l),c{const l=a[0],c=l.contentRect.width,h=l.contentRect.height;c===0&&h===0||o(c,h)});return r.observe(n),qc(s,o),r}function ys(s,t,e){e&&e.disconnect(),t==="resize"&&Qc(s)}function th(s,t,e){const i=s.canvas,n=Un(o=>{s.ctx!==null&&e(Xc(o,s))},s);return Yc(i,t,n),n}class eh extends go{acquireContext(t,e){const i=t&&t.getContext&&t.getContext("2d");return i&&i.canvas===t?(Uc(t,e),i):null}releaseContext(t){const e=t.canvas;if(!e[Je])return!1;const i=e[Je].initial;["height","width"].forEach(o=>{const r=i[o];z(r)?e.removeAttribute(o):e.setAttribute(o,r)});const n=i.style||{};return Object.keys(n).forEach(o=>{e.style[o]=n[o]}),e.width=e.width,delete e[Je],!0}addEventListener(t,e,i){this.removeEventListener(t,e);const n=t.$proxies||(t.$proxies={}),r={attach:Gc,detach:Jc,resize:Zc}[e]||th;n[e]=r(t,e,i)}removeEventListener(t,e){const i=t.$proxies||(t.$proxies={}),n=i[e];if(!n)return;({attach:ys,detach:ys,resize:ys}[e]||Kc)(t,e,n),i[e]=void 0}getDevicePixelRatio(){return window.devicePixelRatio}getMaximumSize(t,e,i,n){return Yl(t,e,i,n)}isAttached(t){const e=t&&ei(t);return!!(e&&e.isConnected)}}function sh(s){return!ti()||typeof OffscreenCanvas<"u"&&s instanceof OffscreenCanvas?Vc:eh}class Ot{static defaults={};static defaultRoutes=void 0;x;y;active=!1;options;$animations;tooltipPosition(t){const{x:e,y:i}=this.getProps(["x","y"],t);return{x:e,y:i}}hasValue(){return Me(this.x)&&Me(this.y)}getProps(t,e){const i=this.$animations;if(!e||!i)return this;const n={};return t.forEach(o=>{n[o]=i[o]&&i[o].active()?i[o]._to:this[o]}),n}}function ih(s,t){const e=s.options.ticks,i=nh(s),n=Math.min(e.maxTicksLimit||i,i),o=e.major.enabled?rh(t):[],r=o.length,a=o[0],l=o[r-1],c=[];if(r>n)return ah(t,c,o,r/n),c;const h=oh(o,t,n);if(r>0){let d,u;const f=r>1?Math.round((l-a)/(r-1)):null;for(We(t,c,h,z(f)?0:a-f,a),d=0,u=r-1;dn)return l}return Math.max(n,1)}function rh(s){const t=[];let e,i;for(e=0,i=s.length;es==="left"?"right":s==="right"?"left":s,Yi=(s,t,e)=>t==="top"||t==="left"?s[t]+e:s[t]-e,Ki=(s,t)=>Math.min(t||s,s);function Xi(s,t){const e=[],i=s.length/t,n=s.length;let o=0;for(;or+a)))return l}function dh(s,t){E(s,e=>{const i=e.gc,n=i.length/2;let o;if(n>t){for(o=0;oi?i:e,i=n&&e>i?e:i,{min:ut(e,ut(i,e)),max:ut(i,ut(e,i))}}getPadding(){return{left:this.paddingLeft||0,top:this.paddingTop||0,right:this.paddingRight||0,bottom:this.paddingBottom||0}}getTicks(){return this.ticks}getLabels(){const t=this.chart.data;return this.options.labels||(this.isHorizontal()?t.xLabels:t.yLabels)||t.labels||[]}getLabelItems(t=this.chart.chartArea){return this._labelItems||(this._labelItems=this._computeLabelItems(t))}beforeLayout(){this._cache={},this._dataLimitsCached=!1}beforeUpdate(){B(this.options.beforeUpdate,[this])}update(t,e,i){const{beginAtZero:n,grace:o,ticks:r}=this.options,a=r.sampleSize;this.beforeUpdate(),this.maxWidth=t,this.maxHeight=e,this._margins=i=Object.assign({left:0,right:0,top:0,bottom:0},i),this.ticks=null,this._labelSizes=null,this._gridLineItems=null,this._labelItems=null,this.beforeSetDimensions(),this.setDimensions(),this.afterSetDimensions(),this._maxLength=this.isHorizontal()?this.width+i.left+i.right:this.height+i.top+i.bottom,this._dataLimitsCached||(this.beforeDataLimits(),this.determineDataLimits(),this.afterDataLimits(),this._range=kl(this,o,n),this._dataLimitsCached=!0),this.beforeBuildTicks(),this.ticks=this.buildTicks()||[],this.afterBuildTicks();const l=a=o||i<=1||!this.isHorizontal()){this.labelRotation=n;return}const h=this._getLabelSizes(),d=h.widest.width,u=h.highest.height,f=it(this.chart.width-d,0,this.maxWidth);a=t.offset?this.maxWidth/i:f/(i-1),d+6>a&&(a=f/(i-(t.offset?.5:1)),l=this.maxHeight-he(t.grid)-e.padding-Gi(t.title,this.chart.options.font),c=Math.sqrt(d*d+u*u),r=Ga(Math.min(Math.asin(it((h.highest.height+6)/a,-1,1)),Math.asin(it(l/c,-1,1))-Math.asin(it(u/c,-1,1)))),r=Math.max(n,Math.min(o,r))),this.labelRotation=r}afterCalculateLabelRotation(){B(this.options.afterCalculateLabelRotation,[this])}afterAutoSkip(){}beforeFit(){B(this.options.beforeFit,[this])}fit(){const t={width:0,height:0},{chart:e,options:{ticks:i,title:n,grid:o}}=this,r=this._isVisible(),a=this.isHorizontal();if(r){const l=Gi(n,e.options.font);if(a?(t.width=this.maxWidth,t.height=he(o)+l):(t.height=this.maxHeight,t.width=he(o)+l),i.display&&this.ticks.length){const{first:c,last:h,widest:d,highest:u}=this._getLabelSizes(),f=i.padding*2,g=$t(this.labelRotation),m=Math.cos(g),b=Math.sin(g);if(a){const _=i.mirror?0:b*d.width+m*u.height;t.height=Math.min(this.maxHeight,t.height+_+f)}else{const _=i.mirror?0:m*d.width+b*u.height;t.width=Math.min(this.maxWidth,t.width+_+f)}this._calculatePadding(c,h,b,m)}}this._handleMargins(),a?(this.width=this._length=e.width-this._margins.left-this._margins.right,this.height=t.height):(this.width=t.width,this.height=this._length=e.height-this._margins.top-this._margins.bottom)}_calculatePadding(t,e,i,n){const{ticks:{align:o,padding:r},position:a}=this.options,l=this.labelRotation!==0,c=a!=="top"&&this.axis==="x";if(this.isHorizontal()){const h=this.getPixelForTick(0)-this.left,d=this.right-this.getPixelForTick(this.ticks.length-1);let u=0,f=0;l?c?(u=n*t.width,f=i*e.height):(u=i*t.height,f=n*e.width):o==="start"?f=e.width:o==="end"?u=t.width:o!=="inner"&&(u=t.width/2,f=e.width/2),this.paddingLeft=Math.max((u-h+r)*this.width/(this.width-h),0),this.paddingRight=Math.max((f-d+r)*this.width/(this.width-d),0)}else{let h=e.height/2,d=t.height/2;o==="start"?(h=0,d=t.height):o==="end"&&(h=e.height,d=0),this.paddingTop=h+r,this.paddingBottom=d+r}}_handleMargins(){this._margins&&(this._margins.left=Math.max(this.paddingLeft,this._margins.left),this._margins.top=Math.max(this.paddingTop,this._margins.top),this._margins.right=Math.max(this.paddingRight,this._margins.right),this._margins.bottom=Math.max(this.paddingBottom,this._margins.bottom))}afterFit(){B(this.options.afterFit,[this])}isHorizontal(){const{axis:t,position:e}=this.options;return e==="top"||e==="bottom"||t==="x"}isFullSize(){return this.options.fullSize}_convertTicksToLabels(t){this.beforeTickToLabelConversion(),this.generateTickLabels(t);let e,i;for(e=0,i=t.length;e({width:r[C]||0,height:a[C]||0});return{first:k(0),last:k(e-1),widest:k(x),highest:k(w),widths:r,heights:a}}getLabelForValue(t){return t}getPixelForValue(t,e){return NaN}getValueForPixel(t){}getPixelForTick(t){const e=this.ticks;return t<0||t>e.length-1?null:this.getPixelForValue(e[t].value)}getPixelForDecimal(t){this._reversePixels&&(t=1-t);const e=this._startPixel+t*this._length;return Qa(this._alignToPixels?Rt(this.chart,e,0):e)}getDecimalForPixel(t){const e=(t-this._startPixel)/this._length;return this._reversePixels?1-e:e}getBasePixel(){return this.getPixelForValue(this.getBaseValue())}getBaseValue(){const{min:t,max:e}=this;return t<0&&e<0?e:t>0&&e>0?t:0}getContext(t){const e=this.ticks||[];if(t>=0&&ta*n?a/i:l/n:l*n0}_computeGridLineItems(t){const e=this.axis,i=this.chart,n=this.options,{grid:o,position:r,border:a}=n,l=o.offset,c=this.isHorizontal(),d=this.ticks.length+(l?1:0),u=he(o),f=[],g=a.setContext(this.getContext()),m=g.display?g.width:0,b=m/2,_=function(U){return Rt(i,U,m)};let y,S,M,v,x,w,k,C,I,A,T,Q;if(r==="top")y=_(this.bottom),w=this.bottom-u,C=y-b,A=_(t.top)+b,Q=t.bottom;else if(r==="bottom")y=_(this.top),A=t.top,Q=_(t.bottom)-b,w=y+b,C=this.top+u;else if(r==="left")y=_(this.right),x=this.right-u,k=y-b,I=_(t.left)+b,T=t.right;else if(r==="right")y=_(this.left),I=t.left,T=_(t.right)-b,x=y+b,k=this.left+u;else if(e==="x"){if(r==="center")y=_((t.top+t.bottom)/2+.5);else if(R(r)){const U=Object.keys(r)[0],nt=r[U];y=_(this.chart.scales[U].getPixelForValue(nt))}A=t.top,Q=t.bottom,w=y+b,C=w+u}else if(e==="y"){if(r==="center")y=_((t.left+t.right)/2);else if(R(r)){const U=Object.keys(r)[0],nt=r[U];y=_(this.chart.scales[U].getPixelForValue(nt))}x=y-b,k=x-u,I=t.left,T=t.right}const N=L(n.ticks.maxTicksLimit,d),F=Math.max(1,Math.ceil(d/N));for(S=0;S0&&(Lt-=Tt/2);break}Ie={left:Lt,top:re,width:Tt+Xt.width,height:oe+Xt.height,color:F.backdropColor}}b.push({label:M,font:C,textOffset:T,options:{rotation:m,color:nt,strokeColor:Te,strokeWidth:Le,textAlign:Kt,textBaseline:Q,translation:[v,x],backdrop:Ie}})}return b}_getXAxisLabelAlignment(){const{position:t,ticks:e}=this.options;if(-$t(this.labelRotation))return t==="top"?"left":"right";let n="center";return e.align==="start"?n="left":e.align==="end"?n="right":e.align==="inner"&&(n="inner"),n}_getYAxisLabelAlignment(t){const{position:e,ticks:{crossAlign:i,mirror:n,padding:o}}=this.options,r=this._getLabelSizes(),a=t+o,l=r.widest.width;let c,h;return e==="left"?n?(h=this.right+o,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h+=l)):(h=this.right-a,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h=this.left)):e==="right"?n?(h=this.left+o,i==="near"?c="right":i==="center"?(c="center",h-=l/2):(c="left",h-=l)):(h=this.left+a,i==="near"?c="left":i==="center"?(c="center",h+=l/2):(c="right",h=this.right)):c="right",{textAlign:c,x:h}}_computeLabelArea(){if(this.options.ticks.mirror)return;const t=this.chart,e=this.options.position;if(e==="left"||e==="right")return{top:0,left:this.left,bottom:t.height,right:this.right};if(e==="top"||e==="bottom")return{top:this.top,left:0,bottom:this.bottom,right:t.width}}drawBackground(){const{ctx:t,options:{backgroundColor:e},left:i,top:n,width:o,height:r}=this;e&&(t.save(),t.fillStyle=e,t.fillRect(i,n,o,r),t.restore())}getLineWidthForValue(t){const e=this.options.grid;if(!this._isVisible()||!e.display)return 0;const n=this.ticks.findIndex(o=>o.value===t);return n>=0?e.setContext(this.getContext(n)).lineWidth:0}drawGrid(t){const e=this.options.grid,i=this.ctx,n=this._gridLineItems||(this._gridLineItems=this._computeGridLineItems(t));let o,r;const a=(l,c,h)=>{!h.width||!h.color||(i.save(),i.lineWidth=h.width,i.strokeStyle=h.color,i.setLineDash(h.borderDash||[]),i.lineDashOffset=h.borderDashOffset,i.beginPath(),i.moveTo(l.x,l.y),i.lineTo(c.x,c.y),i.stroke(),i.restore())};if(e.display)for(o=0,r=n.length;o{this.draw(o)}}]:[{z:i,draw:o=>{this.drawBackground(),this.drawGrid(o),this.drawTitle()}},{z:n,draw:()=>{this.drawBorder()}},{z:e,draw:o=>{this.drawLabels(o)}}]}getMatchingVisibleMetas(t){const e=this.chart.getSortedVisibleDatasetMetas(),i=this.axis+"AxisID",n=[];let o,r;for(o=0,r=e.length;o{const i=e.split("."),n=i.pop(),o=[s].concat(i).join("."),r=t[e].split("."),a=r.pop(),l=r.join(".");j.route(o,n,l,a)})}function _h(s){return"id"in s&&"defaults"in s}class xh{constructor(){this.controllers=new Ve(si,"datasets",!0),this.elements=new Ve(Ot,"elements"),this.plugins=new Ve(Object,"plugins"),this.scales=new Ve(ie,"scales"),this._typedRegistries=[this.controllers,this.scales,this.elements]}add(...t){this._each("register",t)}remove(...t){this._each("unregister",t)}addControllers(...t){this._each("register",t,this.controllers)}addElements(...t){this._each("register",t,this.elements)}addPlugins(...t){this._each("register",t,this.plugins)}addScales(...t){this._each("register",t,this.scales)}getController(t){return this._get(t,this.controllers,"controller")}getElement(t){return this._get(t,this.elements,"element")}getPlugin(t){return this._get(t,this.plugins,"plugin")}getScale(t){return this._get(t,this.scales,"scale")}removeControllers(...t){this._each("unregister",t,this.controllers)}removeElements(...t){this._each("unregister",t,this.elements)}removePlugins(...t){this._each("unregister",t,this.plugins)}removeScales(...t){this._each("unregister",t,this.scales)}_each(t,e,i){[...e].forEach(n=>{const o=i||this._getRegistryForType(n);i||o.isForType(n)||o===this.plugins&&n.id?this._exec(t,o,n):E(n,r=>{const a=i||this._getRegistryForType(r);this._exec(t,a,r)})})}_exec(t,e,i){const n=Us(t);B(i["before"+n],[],i),e[t](i),B(i["after"+n],[],i)}_getRegistryForType(t){for(let e=0;eo.filter(a=>!r.some(l=>a.plugin.id===l.plugin.id));this._notify(n(e,i),t,"stop"),this._notify(n(i,e),t,"start")}}function vh(s){const t={},e=[],i=Object.keys(gt.plugins.items);for(let o=0;o1&&Ji(s[0].toLowerCase());if(i)return i}throw new Error(`Cannot determine type of '${s}' axis. Please provide 'axis' or 'position' option.`)}function qi(s,t,e){if(e[t+"AxisID"]===s)return{axis:t}}function Dh(s,t){if(t.data&&t.data.datasets){const e=t.data.datasets.filter(i=>i.xAxisID===s||i.yAxisID===s);if(e.length)return qi(s,"x",e[0])||qi(s,"y",e[0])}return{}}function Oh(s,t){const e=Ut[s.type]||{scales:{}},i=t.scales||{},n=Ls(s.type,t),o=Object.create(null);return Object.keys(i).forEach(r=>{const a=i[r];if(!R(a))return console.error(`Invalid scale configuration for scale: ${r}`);if(a._proxy)return console.warn(`Ignoring resolver passed as options for scale: ${r}`);const l=Is(r,a,Dh(r,s),j.scales[a.type]),c=Ph(l,n),h=e.scales||{};o[r]=be(Object.create(null),[{axis:l},a,h[l],h[c]])}),s.data.datasets.forEach(r=>{const a=r.type||s.type,l=r.indexAxis||Ls(a,t),h=(Ut[a]||{}).scales||{};Object.keys(h).forEach(d=>{const u=Mh(d,l),f=r[u+"AxisID"]||u;o[f]=o[f]||Object.create(null),be(o[f],[{axis:u},i[f],h[d]])})}),Object.keys(o).forEach(r=>{const a=o[r];be(a,[j.scales[a.type],j.scale])}),o}function bo(s){const t=s.options||(s.options={});t.plugins=L(t.plugins,{}),t.scales=Oh(s,t)}function _o(s){return s=s||{},s.datasets=s.datasets||[],s.labels=s.labels||[],s}function Ah(s){return s=s||{},s.data=_o(s.data),bo(s),s}const Qi=new Map,xo=new Set;function je(s,t){let e=Qi.get(s);return e||(e=t(),Qi.set(s,e),xo.add(e)),e}const de=(s,t,e)=>{const i=te(t,e);i!==void 0&&s.add(i)};let Th=class{constructor(t){this._config=Ah(t),this._scopeCache=new Map,this._resolverCache=new Map}get platform(){return this._config.platform}get type(){return this._config.type}set type(t){this._config.type=t}get data(){return this._config.data}set data(t){this._config.data=_o(t)}get options(){return this._config.options}set options(t){this._config.options=t}get plugins(){return this._config.plugins}update(){const t=this._config;this.clearCache(),bo(t)}clearCache(){this._scopeCache.clear(),this._resolverCache.clear()}datasetScopeKeys(t){return je(t,()=>[[`datasets.${t}`,""]])}datasetAnimationScopeKeys(t,e){return je(`${t}.transition.${e}`,()=>[[`datasets.${t}.transitions.${e}`,`transitions.${e}`],[`datasets.${t}`,""]])}datasetElementScopeKeys(t,e){return je(`${t}-${e}`,()=>[[`datasets.${t}.elements.${e}`,`datasets.${t}`,`elements.${e}`,""]])}pluginScopeKeys(t){const e=t.id,i=this.type;return je(`${i}-plugin-${e}`,()=>[[`plugins.${e}`,...t.additionalOptionScopes||[]]])}_cachedScopes(t,e){const i=this._scopeCache;let n=i.get(t);return(!n||e)&&(n=new Map,i.set(t,n)),n}getOptionScopes(t,e,i){const{options:n,type:o}=this,r=this._cachedScopes(t,i),a=r.get(e);if(a)return a;const l=new Set;e.forEach(h=>{t&&(l.add(t),h.forEach(d=>de(l,t,d))),h.forEach(d=>de(l,n,d)),h.forEach(d=>de(l,Ut[o]||{},d)),h.forEach(d=>de(l,j,d)),h.forEach(d=>de(l,As,d))});const c=Array.from(l);return c.length===0&&c.push(Object.create(null)),xo.has(e)&&r.set(e,c),c}chartOptionScopes(){const{options:t,type:e}=this;return[t,Ut[e]||{},j.datasets[e]||{},{type:e},j,As]}resolveNamedOptions(t,e,i,n=[""]){const o={$shared:!0},{resolver:r,subPrefixes:a}=Zi(this._resolverCache,t,n);let l=r;if(Ih(r,e)){o.$shared=!1,i=Dt(i)?i():i;const c=this.createResolver(t,i,a);l=ee(r,i,c)}for(const c of e)o[c]=l[c];return o}createResolver(t,e,i=[""],n){const{resolver:o}=Zi(this._resolverCache,t,i);return R(e)?ee(o,e,void 0,n):o}};function Zi(s,t,e){let i=s.get(t);i||(i=new Map,s.set(t,i));const n=e.join();let o=i.get(n);return o||(o={resolver:qs(t,e),subPrefixes:e.filter(a=>!a.toLowerCase().includes("hover"))},i.set(n,o)),o}const Lh=s=>R(s)&&Object.getOwnPropertyNames(s).some(t=>Dt(s[t]));function Ih(s,t){const{isScriptable:e,isIndexable:i}=Qn(s);for(const n of t){const o=e(n),r=i(n),a=(r||o)&&s[n];if(o&&(Dt(a)||Lh(a))||r&&Y(a))return!0}return!1}var Rh="4.4.4";const Eh=["top","bottom","left","right","chartArea"];function tn(s,t){return s==="top"||s==="bottom"||Eh.indexOf(s)===-1&&t==="x"}function en(s,t){return function(e,i){return e[s]===i[s]?e[t]-i[t]:e[s]-i[s]}}function sn(s){const t=s.chart,e=t.options.animation;t.notifyPlugins("afterRender"),B(e&&e.onComplete,[s],t)}function Fh(s){const t=s.chart,e=t.options.animation;B(e&&e.onProgress,[s],t)}function yo(s){return ti()&&typeof s=="string"?s=document.getElementById(s):s&&s.length&&(s=s[0]),s&&s.canvas&&(s=s.canvas),s}const qe={},nn=s=>{const t=yo(s);return Object.values(qe).filter(e=>e.canvas===t).pop()};function zh(s,t,e){const i=Object.keys(s);for(const n of i){const o=+n;if(o>=t){const r=s[n];delete s[n],(e>0||o>t)&&(s[o+e]=r)}}}function Bh(s,t,e,i){return!e||s.type==="mouseout"?null:i?t:s}function Ue(s,t,e){return s.options.clip?s[e]:t[e]}function $h(s,t){const{xScale:e,yScale:i}=s;return e&&i?{left:Ue(e,t,"left"),right:Ue(e,t,"right"),top:Ue(i,t,"top"),bottom:Ue(i,t,"bottom")}:t}let cs=class{static defaults=j;static instances=qe;static overrides=Ut;static registry=gt;static version=Rh;static getChart=nn;static register(...t){gt.add(...t),on()}static unregister(...t){gt.remove(...t),on()}constructor(t,e){const i=this.config=new Th(e),n=yo(t),o=nn(n);if(o)throw new Error("Canvas is already in use. Chart with ID '"+o.id+"' must be destroyed before the canvas with ID '"+o.canvas.id+"' can be reused.");const r=i.createResolver(i.chartOptionScopes(),this.getContext());this.platform=new(i.platform||sh(n)),this.platform.updateConfig(i);const a=this.platform.acquireContext(n,r.aspectRatio),l=a&&a.canvas,c=l&&l.height,h=l&&l.width;if(this.id=za(),this.ctx=a,this.canvas=l,this.width=h,this.height=c,this._options=r,this._aspectRatio=this.aspectRatio,this._layers=[],this._metasets=[],this._stacks=void 0,this.boxes=[],this.currentDevicePixelRatio=void 0,this.chartArea=void 0,this._active=[],this._lastEvent=void 0,this._listeners={},this._responsiveListeners=void 0,this._sortedMetasets=[],this.scales={},this._plugins=new yh,this.$proxies={},this._hiddenIndices={},this.attached=!1,this._animationsDisabled=void 0,this.$context=void 0,this._doResize=sl(d=>this.update(d),r.resizeDelay||0),this._dataChanges=[],qe[this.id]=this,!a||!l){console.error("Failed to create chart: can't acquire context from the given item");return}yt.listen(this,"complete",sn),yt.listen(this,"progress",Fh),this._initialize(),this.attached&&this.update()}get aspectRatio(){const{options:{aspectRatio:t,maintainAspectRatio:e},width:i,height:n,_aspectRatio:o}=this;return z(t)?e&&o?o:n?i/n:null:t}get data(){return this.config.data}set data(t){this.config.data=t}get options(){return this._options}set options(t){this.config.options=t}get registry(){return gt}_initialize(){return this.notifyPlugins("beforeInit"),this.options.responsive?this.resize():Mi(this,this.options.devicePixelRatio),this.bindEvents(),this.notifyPlugins("afterInit"),this}clear(){return Si(this.canvas,this.ctx),this}stop(){return yt.stop(this),this}resize(t,e){yt.running(this)?this._resizeBeforeDraw={width:t,height:e}:this._resize(t,e)}_resize(t,e){const i=this.options,n=this.canvas,o=i.maintainAspectRatio&&this.aspectRatio,r=this.platform.getMaximumSize(n,t,e,o),a=i.devicePixelRatio||this.platform.getDevicePixelRatio(),l=this.width?"resize":"attach";this.width=r.width,this.height=r.height,this._aspectRatio=this.aspectRatio,Mi(this,a,!0)&&(this.notifyPlugins("resize",{size:r}),B(i.onResize,[this,r],this),this.attached&&this._doResize(l)&&this.render())}ensureScalesHaveIDs(){const e=this.options.scales||{};E(e,(i,n)=>{i.id=n})}buildOrUpdateScales(){const t=this.options,e=t.scales,i=this.scales,n=Object.keys(i).reduce((r,a)=>(r[a]=!1,r),{});let o=[];e&&(o=o.concat(Object.keys(e).map(r=>{const a=e[r],l=Is(r,a),c=l==="r",h=l==="x";return{options:a,dposition:c?"chartArea":h?"bottom":"left",dtype:c?"radialLinear":h?"category":"linear"}}))),E(o,r=>{const a=r.options,l=a.id,c=Is(l,a),h=L(a.type,r.dtype);(a.position===void 0||tn(a.position,c)!==tn(r.dposition))&&(a.position=r.dposition),n[l]=!0;let d=null;if(l in i&&i[l].type===h)d=i[l];else{const u=gt.getScale(h);d=new u({id:l,type:h,ctx:this.ctx,chart:this}),i[d.id]=d}d.init(a,t)}),E(n,(r,a)=>{r||delete i[a]}),E(i,r=>{lt.configure(this,r,r.options),lt.addBox(this,r)})}_updateMetasets(){const t=this._metasets,e=this.data.datasets.length,i=t.length;if(t.sort((n,o)=>n.index-o.index),i>e){for(let n=e;ne.length&&delete this._stacks,t.forEach((i,n)=>{e.filter(o=>o===i._dataset).length===0&&this._destroyDatasetMeta(n)})}buildOrUpdateControllers(){const t=[],e=this.data.datasets;let i,n;for(this._removeUnreferencedMetasets(),i=0,n=e.length;i{this.getDatasetMeta(e).controller.reset()},this)}reset(){this._resetElements(),this.notifyPlugins("reset")}update(t){const e=this.config;e.update();const i=this._options=e.createResolver(e.chartOptionScopes(),this.getContext()),n=this._animationsDisabled=!i.animation;if(this._updateScales(),this._checkEventBindings(),this._updateHiddenIndices(),this._plugins.invalidate(),this.notifyPlugins("beforeUpdate",{mode:t,cancelable:!0})===!1)return;const o=this.buildOrUpdateControllers();this.notifyPlugins("beforeElementsUpdate");let r=0;for(let c=0,h=this.data.datasets.length;c{c.reset()}),this._updateDatasets(t),this.notifyPlugins("afterUpdate",{mode:t}),this._layers.sort(en("z","_idx"));const{_active:a,_lastEvent:l}=this;l?this._eventHandler(l,!0):a.length&&this._updateHoverStyles(a,a,!0),this.render()}_updateScales(){E(this.scales,t=>{lt.removeBox(this,t)}),this.ensureScalesHaveIDs(),this.buildOrUpdateScales()}_checkEventBindings(){const t=this.options,e=new Set(Object.keys(this._listeners)),i=new Set(t.events);(!ui(e,i)||!!this._responsiveListeners!==t.responsive)&&(this.unbindEvents(),this.bindEvents())}_updateHiddenIndices(){const{_hiddenIndices:t}=this,e=this._getUniformDataChanges()||[];for(const{method:i,start:n,count:o}of e){const r=i==="_removeElements"?-o:o;zh(t,n,r)}}_getUniformDataChanges(){const t=this._dataChanges;if(!t||!t.length)return;this._dataChanges=[];const e=this.data.datasets.length,i=o=>new Set(t.filter(r=>r[0]===o).map((r,a)=>a+","+r.splice(1).join(","))),n=i(0);for(let o=1;oo.split(",")).map(o=>({method:o[1],start:+o[2],count:+o[3]}))}_updateLayout(t){if(this.notifyPlugins("beforeLayout",{cancelable:!0})===!1)return;lt.update(this,this.width,this.height,t);const e=this.chartArea,i=e.width<=0||e.height<=0;this._layers=[],E(this.boxes,n=>{i&&n.position==="chartArea"||(n.configure&&n.configure(),this._layers.push(...n._layers()))},this),this._layers.forEach((n,o)=>{n._idx=o}),this.notifyPlugins("afterLayout")}_updateDatasets(t){if(this.notifyPlugins("beforeDatasetsUpdate",{mode:t,cancelable:!0})!==!1){for(let e=0,i=this.data.datasets.length;e=0;--e)this._drawDataset(t[e]);this.notifyPlugins("afterDatasetsDraw")}_drawDataset(t){const e=this.ctx,i=t._clip,n=!i.disabled,o=$h(t,this.chartArea),r={meta:t,index:t.index,cancelable:!0};this.notifyPlugins("beforeDatasetDraw",r)!==!1&&(n&&Gs(e,{left:i.left===!1?0:o.left-i.left,right:i.right===!1?this.width:o.right+i.right,top:i.top===!1?0:o.top-i.top,bottom:i.bottom===!1?this.height:o.bottom+i.bottom}),t.controller.draw(),n&&Js(e),r.cancelable=!1,this.notifyPlugins("afterDatasetDraw",r))}isPointInArea(t){return Pe(t,this.chartArea,this._minPadding)}getElementsAtEventForMode(t,e,i,n){const o=Ec.modes[e];return typeof o=="function"?o(this,t,i,n):[]}getDatasetMeta(t){const e=this.data.datasets[t],i=this._metasets;let n=i.filter(o=>o&&o._dataset===e).pop();return n||(n={type:null,data:[],dataset:null,controller:null,hidden:null,xAxisID:null,yAxisID:null,order:e&&e.order||0,index:t,_dataset:e,_parsed:[],_sorted:!1},i.push(n)),n}getContext(){return this.$context||(this.$context=Yt(null,{chart:this,type:"chart"}))}getVisibleDatasetCount(){return this.getSortedVisibleDatasetMetas().length}isDatasetVisible(t){const e=this.data.datasets[t];if(!e)return!1;const i=this.getDatasetMeta(t);return typeof i.hidden=="boolean"?!i.hidden:!e.hidden}setDatasetVisibility(t,e){const i=this.getDatasetMeta(t);i.hidden=!e}toggleDataVisibility(t){this._hiddenIndices[t]=!this._hiddenIndices[t]}getDataVisibility(t){return!this._hiddenIndices[t]}_updateVisibility(t,e,i){const n=i?"show":"hide",o=this.getDatasetMeta(t),r=o.controller._resolveAnimations(void 0,n);ke(e)?(o.data[e].hidden=!i,this.update()):(this.setDatasetVisibility(t,i),r.update(o,{visible:i}),this.update(a=>a.datasetIndex===t?n:void 0))}hide(t,e){this._updateVisibility(t,e,!1)}show(t,e){this._updateVisibility(t,e,!0)}_destroyDatasetMeta(t){const e=this._metasets[t];e&&e.controller&&e.controller._destroy(),delete this._metasets[t]}_stop(){let t,e;for(this.stop(),yt.remove(this),t=0,e=this.data.datasets.length;t{e.addEventListener(this,o,r),t[o]=r},n=(o,r,a)=>{o.offsetX=r,o.offsetY=a,this._eventHandler(o)};E(this.options.events,o=>i(o,n))}bindResponsiveEvents(){this._responsiveListeners||(this._responsiveListeners={});const t=this._responsiveListeners,e=this.platform,i=(l,c)=>{e.addEventListener(this,l,c),t[l]=c},n=(l,c)=>{t[l]&&(e.removeEventListener(this,l,c),delete t[l])},o=(l,c)=>{this.canvas&&this.resize(l,c)};let r;const a=()=>{n("attach",a),this.attached=!0,this.resize(),i("resize",o),i("detach",r)};r=()=>{this.attached=!1,n("resize",o),this._stop(),this._resize(0,0),i("attach",a)},e.isAttached(this.canvas)?a():r()}unbindEvents(){E(this._listeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._listeners={},E(this._responsiveListeners,(t,e)=>{this.platform.removeEventListener(this,e,t)}),this._responsiveListeners=void 0}updateHoverStyle(t,e,i){const n=i?"set":"remove";let o,r,a,l;for(e==="dataset"&&(o=this.getDatasetMeta(t[0].datasetIndex),o.controller["_"+n+"DatasetHoverStyle"]()),a=0,l=t.length;a{const a=this.getDatasetMeta(o);if(!a)throw new Error("No dataset found at index "+o);return{datasetIndex:o,element:a.data[r],index:r}});!Ze(i,e)&&(this._active=i,this._lastEvent=null,this._updateHoverStyles(i,e))}notifyPlugins(t,e,i){return this._plugins.notify(this,t,e,i)}isPluginEnabled(t){return this._plugins._cache.filter(e=>e.plugin.id===t).length===1}_updateHoverStyles(t,e,i){const n=this.options.hover,o=(l,c)=>l.filter(h=>!c.some(d=>h.datasetIndex===d.datasetIndex&&h.index===d.index)),r=o(e,t),a=i?t:o(t,e);r.length&&this.updateHoverStyle(r,n.mode,!1),a.length&&n.mode&&this.updateHoverStyle(a,n.mode,!0)}_eventHandler(t,e){const i={event:t,replay:e,cancelable:!0,inChartArea:this.isPointInArea(t)},n=r=>(r.options.events||this.options.events).includes(t.native.type);if(this.notifyPlugins("beforeEvent",i,n)===!1)return;const o=this._handleEvent(t,e,i.inChartArea);return i.cancelable=!1,this.notifyPlugins("afterEvent",i,n),(o||i.changed)&&this.render(),this}_handleEvent(t,e,i){const{_active:n=[],options:o}=this,r=e,a=this._getActiveElements(t,n,i,r),l=Va(t),c=Bh(t,this._lastEvent,i,l);i&&(this._lastEvent=null,B(o.onHover,[t,a,this],this),l&&B(o.onClick,[t,a,this],this));const h=!Ze(a,n);return(h||e)&&(this._active=a,this._updateHoverStyles(a,n,e)),this._lastEvent=c,h}_getActiveElements(t,e,i,n){if(t.type==="mouseout")return[];if(!i)return e;const o=this.options.hover;return this.getElementsAtEventForMode(t,o.mode,o,n)}};function on(){return E(cs.instances,s=>s._plugins.invalidate())}function vo(s,t,e=t){s.lineCap=L(e.borderCapStyle,t.borderCapStyle),s.setLineDash(L(e.borderDash,t.borderDash)),s.lineDashOffset=L(e.borderDashOffset,t.borderDashOffset),s.lineJoin=L(e.borderJoinStyle,t.borderJoinStyle),s.lineWidth=L(e.borderWidth,t.borderWidth),s.strokeStyle=L(e.borderColor,t.borderColor)}function Nh(s,t,e){s.lineTo(e.x,e.y)}function Hh(s){return s.stepped?pl:s.tension||s.cubicInterpolationMode==="monotone"?ml:Nh}function So(s,t,e={}){const i=s.length,{start:n=0,end:o=i-1}=e,{start:r,end:a}=t,l=Math.max(n,r),c=Math.min(o,a),h=na&&o>a;return{count:i,start:l,loop:t.loop,ilen:c(r+(c?a-M:M))%o,S=()=>{m!==b&&(s.lineTo(h,b),s.lineTo(h,m),s.lineTo(h,_))};for(l&&(f=n[y(0)],s.moveTo(f.x,f.y)),u=0;u<=a;++u){if(f=n[y(u)],f.skip)continue;const M=f.x,v=f.y,x=M|0;x===g?(vb&&(b=v),h=(d*h+M)/++d):(S(),s.lineTo(M,v),g=x,d=0,m=b=v),_=v}S()}function Rs(s){const t=s.options,e=t.borderDash&&t.borderDash.length;return!s._decimated&&!s._loop&&!t.tension&&t.cubicInterpolationMode!=="monotone"&&!t.stepped&&!e?Vh:Wh}function jh(s){return s.stepped?Xl:s.tension||s.cubicInterpolationMode==="monotone"?Gl:zt}function Uh(s,t,e,i){let n=t._path;n||(n=t._path=new Path2D,t.path(n,e,i)&&n.closePath()),vo(s,t.options),s.stroke(n)}function Yh(s,t,e,i){const{segments:n,options:o}=t,r=Rs(t);for(const a of n)vo(s,o,a.style),s.beginPath(),r(s,t,a,{start:e,end:e+i-1})&&s.closePath(),s.stroke()}const Kh=typeof Path2D=="function";function Xh(s,t,e,i){Kh&&!t.options.segment?Uh(s,t,e,i):Yh(s,t,e,i)}class Gh extends Ot{static id="line";static defaults={borderCapStyle:"butt",borderDash:[],borderDashOffset:0,borderJoinStyle:"miter",borderWidth:3,capBezierPoints:!0,cubicInterpolationMode:"default",fill:!1,spanGaps:!1,stepped:!1,tension:0};static defaultRoutes={backgroundColor:"backgroundColor",borderColor:"borderColor"};static descriptors={_scriptable:!0,_indexable:t=>t!=="borderDash"&&t!=="fill"};constructor(t){super(),this.animated=!0,this.options=void 0,this._chart=void 0,this._loop=void 0,this._fullLoop=void 0,this._path=void 0,this._points=void 0,this._segments=void 0,this._decimated=!1,this._pointsUpdated=!1,this._datasetIndex=void 0,t&&Object.assign(this,t)}updateControlPoints(t,e){const i=this.options;if((i.tension||i.cubicInterpolationMode==="monotone")&&!i.stepped&&!this._pointsUpdated){const n=i.spanGaps?this._loop:this._fullLoop;Nl(this._points,i,t,n,e),this._pointsUpdated=!0}}set points(t){this._points=t,delete this._segments,delete this._path,this._pointsUpdated=!1}get points(){return this._points}get segments(){return this._segments||(this._segments=ic(this,this.options.segment))}first(){const t=this.segments,e=this.points;return t.length&&e[t[0].start]}last(){const t=this.segments,e=this.points,i=t.length;return i&&e[t[i-1].end]}interpolate(t,e){const i=this.options,n=t[e],o=this.points,r=tc(this,{property:e,start:n,end:n});if(!r.length)return;const a=[],l=jh(i);let c,h;for(c=0,h=r.length;c{let{boxHeight:e=t,boxWidth:i=t}=s;return s.usePointStyle&&(e=Math.min(e,t),i=s.pointStyleWidth||Math.min(i,t)),{boxWidth:i,boxHeight:e,itemHeight:Math.max(t,e)}},id=(s,t)=>s!==null&&t!==null&&s.datasetIndex===t.datasetIndex&&s.index===t.index;class ln extends Ot{constructor(t){super(),this._added=!1,this.legendHitBoxes=[],this._hoveredItem=null,this.doughnutMode=!1,this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this.legendItems=void 0,this.columnSizes=void 0,this.lineWidths=void 0,this.maxHeight=void 0,this.maxWidth=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.height=void 0,this.width=void 0,this._margins=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e,i){this.maxWidth=t,this.maxHeight=e,this._margins=i,this.setDimensions(),this.buildLabels(),this.fit()}setDimensions(){this.isHorizontal()?(this.width=this.maxWidth,this.left=this._margins.left,this.right=this.width):(this.height=this.maxHeight,this.top=this._margins.top,this.bottom=this.height)}buildLabels(){const t=this.options.labels||{};let e=B(t.generateLabels,[this.chart],this)||[];t.filter&&(e=e.filter(i=>t.filter(i,this.chart.data))),t.sort&&(e=e.sort((i,n)=>t.sort(i,n,this.chart.data))),this.options.reverse&&e.reverse(),this.legendItems=e}fit(){const{options:t,ctx:e}=this;if(!t.display){this.width=this.height=0;return}const i=t.labels,n=q(i.font),o=n.size,r=this._computeTitleHeight(),{boxWidth:a,itemHeight:l}=an(i,o);let c,h;e.font=n.string,this.isHorizontal()?(c=this.maxWidth,h=this._fitRows(r,o,a,l)+10):(h=this.maxHeight,c=this._fitCols(r,n,a,l)+10),this.width=Math.min(c,t.maxWidth||this.maxWidth),this.height=Math.min(h,t.maxHeight||this.maxHeight)}_fitRows(t,e,i,n){const{ctx:o,maxWidth:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.lineWidths=[0],h=n+a;let d=t;o.textAlign="left",o.textBaseline="middle";let u=-1,f=-h;return this.legendItems.forEach((g,m)=>{const b=i+e/2+o.measureText(g.text).width;(m===0||c[c.length-1]+b+2*a>r)&&(d+=h,c[c.length-(m>0?0:1)]=0,f+=h,u++),l[m]={left:0,top:f,row:u,width:b,height:n},c[c.length-1]+=b+a}),d}_fitCols(t,e,i,n){const{ctx:o,maxHeight:r,options:{labels:{padding:a}}}=this,l=this.legendHitBoxes=[],c=this.columnSizes=[],h=r-t;let d=a,u=0,f=0,g=0,m=0;return this.legendItems.forEach((b,_)=>{const{itemWidth:y,itemHeight:S}=nd(i,e,o,b,n);_>0&&f+S+2*a>h&&(d+=u+a,c.push({width:u,height:f}),g+=u+a,m++,u=f=0),l[_]={left:g,top:f,col:m,width:y,height:S},u=Math.max(u,y),f+=S+a}),d+=u,c.push({width:u,height:f}),d}adjustHitBoxes(){if(!this.options.display)return;const t=this._computeTitleHeight(),{legendHitBoxes:e,options:{align:i,labels:{padding:n},rtl:o}}=this,r=Zt(o,this.left,this.width);if(this.isHorizontal()){let a=0,l=J(i,this.left+n,this.right-this.lineWidths[a]);for(const c of e)a!==c.row&&(a=c.row,l=J(i,this.left+n,this.right-this.lineWidths[a])),c.top+=this.top+t+n,c.left=r.leftForLtr(r.x(l),c.width),l+=c.width+n}else{let a=0,l=J(i,this.top+t+n,this.bottom-this.columnSizes[a].height);for(const c of e)c.col!==a&&(a=c.col,l=J(i,this.top+t+n,this.bottom-this.columnSizes[a].height)),c.top=l,c.left+=this.left+n,c.left=r.leftForLtr(r.x(c.left),c.width),l+=c.height+n}}isHorizontal(){return this.options.position==="top"||this.options.position==="bottom"}draw(){if(this.options.display){const t=this.ctx;Gs(t,this),this._draw(),Js(t)}}_draw(){const{options:t,columnSizes:e,lineWidths:i,ctx:n}=this,{align:o,labels:r}=t,a=j.color,l=Zt(t.rtl,this.left,this.width),c=q(r.font),{padding:h}=r,d=c.size,u=d/2;let f;this.drawTitle(),n.textAlign=l.textAlign("left"),n.textBaseline="middle",n.lineWidth=.5,n.font=c.string;const{boxWidth:g,boxHeight:m,itemHeight:b}=an(r,d),_=function(x,w,k){if(isNaN(g)||g<=0||isNaN(m)||m<0)return;n.save();const C=L(k.lineWidth,1);if(n.fillStyle=L(k.fillStyle,a),n.lineCap=L(k.lineCap,"butt"),n.lineDashOffset=L(k.lineDashOffset,0),n.lineJoin=L(k.lineJoin,"miter"),n.lineWidth=C,n.strokeStyle=L(k.strokeStyle,a),n.setLineDash(L(k.lineDash,[])),r.usePointStyle){const I={radius:m*Math.SQRT2/2,pointStyle:k.pointStyle,rotation:k.rotation,borderWidth:C},A=l.xPlus(x,g/2),T=w+u;Gn(n,I,A,T,r.pointStyleWidth&&g)}else{const I=w+Math.max((d-m)/2,0),A=l.leftForLtr(x,g),T=Qt(k.borderRadius);n.beginPath(),Object.values(T).some(Q=>Q!==0)?ss(n,{x:A,y:I,w:g,h:m,radius:T}):n.rect(A,I,g,m),n.fill(),C!==0&&n.stroke()}n.restore()},y=function(x,w,k){Ce(n,k.text,x,w+b/2,c,{strikethrough:k.hidden,textAlign:l.textAlign(k.textAlign)})},S=this.isHorizontal(),M=this._computeTitleHeight();S?f={x:J(o,this.left+h,this.right-i[0]),y:this.top+h+M,line:0}:f={x:this.left+h,y:J(o,this.top+M+h,this.bottom-e[0].height),line:0},io(this.ctx,t.textDirection);const v=b+h;this.legendItems.forEach((x,w)=>{n.strokeStyle=x.fontColor,n.fillStyle=x.fontColor;const k=n.measureText(x.text).width,C=l.textAlign(x.textAlign||(x.textAlign=r.textAlign)),I=g+u+k;let A=f.x,T=f.y;l.setWidth(this.width),S?w>0&&A+I+h>this.right&&(T=f.y+=v,f.line++,A=f.x=J(o,this.left+h,this.right-i[f.line])):w>0&&T+v>this.bottom&&(A=f.x=A+e[f.line].width+h,f.line++,T=f.y=J(o,this.top+M+h,this.bottom-e[f.line].height));const Q=l.x(A);if(_(Q,T,x),A=il(C,A+g+u,S?A+I:this.right,t.rtl),y(l.x(A),T,x),S)f.x+=I+h;else if(typeof x.text!="string"){const N=c.lineHeight;f.y+=ko(x,N)+h}else f.y+=v}),no(this.ctx,t.textDirection)}drawTitle(){const t=this.options,e=t.title,i=q(e.font),n=ht(e.padding);if(!e.display)return;const o=Zt(t.rtl,this.left,this.width),r=this.ctx,a=e.position,l=i.size/2,c=n.top+l;let h,d=this.left,u=this.width;if(this.isHorizontal())u=Math.max(...this.lineWidths),h=this.top+c,d=J(t.align,d,this.right-u);else{const g=this.columnSizes.reduce((m,b)=>Math.max(m,b.height),0);h=c+J(t.align,this.top,this.bottom-g-t.labels.padding-this._computeTitleHeight())}const f=J(a,d,d+u);r.textAlign=o.textAlign(Ks(a)),r.textBaseline="middle",r.strokeStyle=e.color,r.fillStyle=e.color,r.font=i.string,Ce(r,e.text,f,h,i)}_computeTitleHeight(){const t=this.options.title,e=q(t.font),i=ht(t.padding);return t.display?e.lineHeight+i.height:0}_getLegendItemAt(t,e){let i,n,o;if(Nt(t,this.left,this.right)&&Nt(e,this.top,this.bottom)){for(o=this.legendHitBoxes,i=0;io.length>r.length?o:r)),t+e.size/2+i.measureText(n).width}function rd(s,t,e){let i=s;return typeof t.text!="string"&&(i=ko(t,e)),i}function ko(s,t){const e=s.text?s.text.length:0;return t*e}function ad(s,t){return!!((s==="mousemove"||s==="mouseout")&&(t.onHover||t.onLeave)||t.onClick&&(s==="click"||s==="mouseup"))}var ld={id:"legend",_element:ln,start(s,t,e){const i=s.legend=new ln({ctx:s.ctx,options:e,chart:s});lt.configure(s,i,e),lt.addBox(s,i)},stop(s){lt.removeBox(s,s.legend),delete s.legend},beforeUpdate(s,t,e){const i=s.legend;lt.configure(s,i,e),i.options=e},afterUpdate(s){const t=s.legend;t.buildLabels(),t.adjustHitBoxes()},afterEvent(s,t){t.replay||s.legend.handleEvent(t.event)},defaults:{display:!0,position:"top",align:"center",fullSize:!0,reverse:!1,weight:1e3,onClick(s,t,e){const i=t.datasetIndex,n=e.chart;n.isDatasetVisible(i)?(n.hide(i),t.hidden=!0):(n.show(i),t.hidden=!1)},onHover:null,onLeave:null,labels:{color:s=>s.chart.options.color,boxWidth:40,padding:10,generateLabels(s){const t=s.data.datasets,{labels:{usePointStyle:e,pointStyle:i,textAlign:n,color:o,useBorderRadius:r,borderRadius:a}}=s.legend.options;return s._getSortedDatasetMetas().map(l=>{const c=l.controller.getStyle(e?0:void 0),h=ht(c.borderWidth);return{text:t[l.index].label,fillStyle:c.backgroundColor,fontColor:o,hidden:!l.visible,lineCap:c.borderCapStyle,lineDash:c.borderDash,lineDashOffset:c.borderDashOffset,lineJoin:c.borderJoinStyle,lineWidth:(h.width+h.height)/4,strokeStyle:c.borderColor,pointStyle:i||c.pointStyle,rotation:c.rotation,textAlign:n||c.textAlign,borderRadius:r&&(a||c.borderRadius),datasetIndex:l.index}},this)}},title:{color:s=>s.chart.options.color,display:!1,position:"center",text:""}},descriptors:{_scriptable:s=>!s.startsWith("on"),labels:{_scriptable:s=>!["generateLabels","filter","sort"].includes(s)}}};class Mo extends Ot{constructor(t){super(),this.chart=t.chart,this.options=t.options,this.ctx=t.ctx,this._padding=void 0,this.top=void 0,this.bottom=void 0,this.left=void 0,this.right=void 0,this.width=void 0,this.height=void 0,this.position=void 0,this.weight=void 0,this.fullSize=void 0}update(t,e){const i=this.options;if(this.left=0,this.top=0,!i.display){this.width=this.height=this.right=this.bottom=0;return}this.width=this.right=t,this.height=this.bottom=e;const n=Y(i.text)?i.text.length:1;this._padding=ht(i.padding);const o=n*q(i.font).lineHeight+this._padding.height;this.isHorizontal()?this.height=o:this.width=o}isHorizontal(){const t=this.options.position;return t==="top"||t==="bottom"}_drawArgs(t){const{top:e,left:i,bottom:n,right:o,options:r}=this,a=r.align;let l=0,c,h,d;return this.isHorizontal()?(h=J(a,i,o),d=e+t,c=o-i):(r.position==="left"?(h=i+t,d=J(a,n,e),l=X*-.5):(h=o-t,d=J(a,e,n),l=X*.5),c=n-e),{titleX:h,titleY:d,maxWidth:c,rotation:l}}draw(){const t=this.ctx,e=this.options;if(!e.display)return;const i=q(e.font),o=i.lineHeight/2+this._padding.top,{titleX:r,titleY:a,maxWidth:l,rotation:c}=this._drawArgs(o);Ce(t,e.text,0,0,i,{color:e.color,maxWidth:l,rotation:c,textAlign:Ks(e.align),textBaseline:"middle",translation:[r,a]})}}function cd(s,t){const e=new Mo({ctx:s.ctx,options:t,chart:s});lt.configure(s,e,t),lt.addBox(s,e),s.titleBlock=e}var hd={id:"title",_element:Mo,start(s,t,e){cd(s,e)},stop(s){const t=s.titleBlock;lt.removeBox(s,t),delete s.titleBlock},beforeUpdate(s,t,e){const i=s.titleBlock;lt.configure(s,i,e),i.options=e},defaults:{align:"center",display:!1,font:{weight:"bold"},fullSize:!0,padding:10,position:"top",text:"",weight:2e3},defaultRoutes:{color:"color"},descriptors:{_scriptable:!0,_indexable:!1}};const pe={average(s){if(!s.length)return!1;let t,e,i=new Set,n=0,o=0;for(t=0,e=s.length;ta+l)/i.size,y:n/o}},nearest(s,t){if(!s.length)return!1;let e=t.x,i=t.y,n=Number.POSITIVE_INFINITY,o,r,a;for(o=0,r=s.length;o-1?s.split(` -`):s}function dd(s,t){const{element:e,datasetIndex:i,index:n}=t,o=s.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:s,label:r,parsed:o.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:i,element:e}}function cn(s,t){const e=s.chart.ctx,{body:i,footer:n,title:o}=s,{boxWidth:r,boxHeight:a}=t,l=q(t.bodyFont),c=q(t.titleFont),h=q(t.footerFont),d=o.length,u=n.length,f=i.length,g=ht(t.padding);let m=g.height,b=0,_=i.reduce((M,v)=>M+v.before.length+v.lines.length+v.after.length,0);if(_+=s.beforeBody.length+s.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){const M=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*M+(_-f)*l.lineHeight+(_-1)*t.bodySpacing}u&&(m+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const S=function(M){b=Math.max(b,e.measureText(M).width+y)};return e.save(),e.font=c.string,E(s.title,S),e.font=l.string,E(s.beforeBody.concat(s.afterBody),S),y=t.displayColors?r+2+t.boxPadding:0,E(i,M=>{E(M.before,S),E(M.lines,S),E(M.after,S)}),y=0,e.font=h.string,E(s.footer,S),e.restore(),b+=g.width,{width:b,height:m}}function ud(s,t){const{y:e,height:i}=t;return es.height-i/2?"bottom":"center"}function fd(s,t,e,i){const{x:n,width:o}=i,r=e.caretSize+e.caretPadding;if(s==="left"&&n+o+r>t.width||s==="right"&&n-o-r<0)return!0}function gd(s,t,e,i){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=s;let c="center";return i==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),fd(c,s,t,e)&&(c="center"),c}function hn(s,t,e){const i=e.yAlign||t.yAlign||ud(s,e);return{xAlign:e.xAlign||t.xAlign||gd(s,t,e,i),yAlign:i}}function pd(s,t){let{x:e,width:i}=s;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function md(s,t,e){let{y:i,height:n}=s;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function dn(s,t,e,i){const{caretSize:n,caretPadding:o,cornerRadius:r}=s,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Qt(r);let g=pd(t,a);const m=md(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,u)+n:a==="right"&&(g+=Math.max(d,f)+n),{x:it(g,0,i.width-t.width),y:it(m,0,i.height-t.height)}}function Ye(s,t,e){const i=ht(e.padding);return t==="center"?s.x+s.width/2:t==="right"?s.x+s.width-i.right:s.x+i.left}function un(s){return ft([],vt(s))}function bd(s,t,e){return Yt(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function fn(s,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}const Po={beforeTitle:xt,title(s){if(s.length>0){const t=s[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?Po[t].call(e,i):n}class gn extends Ot{static positioners=pe;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,o=new ro(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=bd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,n=Z(i,"beforeTitle",this,t),o=Z(i,"title",this,t),r=Z(i,"afterTitle",this,t);let a=[];return a=ft(a,vt(n)),a=ft(a,vt(o)),a=ft(a,vt(r)),a}getBeforeBody(t,e){return un(Z(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return E(t,o=>{const r={before:[],lines:[],after:[]},a=fn(i,o);ft(r.before,vt(Z(a,"beforeLabel",this,o))),ft(r.lines,Z(a,"label",this,o)),ft(r.after,vt(Z(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return un(Z(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=Z(i,"beforeFooter",this,t),o=Z(i,"footer",this,t),r=Z(i,"afterFooter",this,t);let a=[];return a=ft(a,vt(n)),a=ft(a,vt(o)),a=ft(a,vt(r)),a}_createItems(t){const e=this._active,i=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;lt.filter(h,d,u,i))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,i))),E(a,h=>{const d=fn(t.callbacks,h);n.push(Z(d,"labelColor",this,h)),o.push(Z(d,"labelPointStyle",this,h)),r.push(Z(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=pe[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=cn(this,i),c=Object.assign({},a,l),h=hn(this.chart,i,c),d=dn(i,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const o=this.getCaretPosition(t,i,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Qt(a),{x:u,y:f}=t,{width:g,height:m}=e;let b,_,y,S,M,v;return o==="center"?(M=f+m/2,n==="left"?(b=u,_=b-r,S=M+r,v=M-r):(b=u+g,_=b+r,S=M-r,v=M+r),y=b):(n==="left"?_=u+Math.max(l,h)+r:n==="right"?_=u+g-Math.max(c,d)-r:_=this.caretX,o==="top"?(S=f,M=S-r,b=_-r,y=_+r):(S=f+m,M=S+r,b=_+r,y=_-r),v=S),{x1:b,x2:_,x3:y,y1:S,y2:M,y3:v}}drawTitle(t,e,i){const n=this.title,o=n.length;let r,a,l;if(o){const c=Zt(i.rtl,this.x,this.width);for(t.x=Ye(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",r=q(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ss(t,{x:m,y:g,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ss(t,{x:b,y:g+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=i,d=q(i.bodyFont);let u=d.lineHeight,f=0;const g=Zt(i.rtl,this.x,this.width),m=function(k){e.fillText(k,g.x(t.x+f),t.y+u/2),t.y+=u+o},b=g.textAlign(r);let _,y,S,M,v,x,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Ye(this,b,i),e.fillStyle=i.bodyColor,E(this.beforeBody,m),f=a&&b!=="right"?r==="center"?c/2+h:c+2+h:0,M=0,x=n.length;M0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,o=i&&i.y;if(n||o){const r=pe[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=cn(this,t),l=Object.assign({},r,this._size),c=hn(e,t,l),h=dn(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=ht(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,n,e),io(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),no(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Ze(i,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),l=e||!Ze(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:n,options:o}=this,r=pe[o.position].call(this,t,e);return r!==!1&&(i!==r.x||n!==r.y)}}var _d={id:"tooltip",_element:gn,positioners:pe,afterInit(s,t,e){e&&(s.tooltip=new gn({chart:s,options:e}))},beforeUpdate(s,t,e){s.tooltip&&s.tooltip.initialize(e)},reset(s,t,e){s.tooltip&&s.tooltip.initialize(e)},afterDraw(s){const t=s.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(s.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(s.ctx),s.notifyPlugins("afterTooltipDraw",e)}},afterEvent(s,t){if(s.tooltip){const e=t.replay;s.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(s,t)=>t.bodyFont.size,boxWidth:(s,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Po},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:s=>s!=="filter"&&s!=="itemSort"&&s!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const xd=(s,t,e,i)=>(typeof t=="string"?(e=s.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function yd(s,t,e,i){const n=s.indexOf(t);if(n===-1)return xd(s,t,e,i);const o=s.lastIndexOf(t);return n!==o?e:n}const vd=(s,t)=>s===null?null:it(Math.round(s),0,t);function pn(s){const t=this.getLabels();return s>=0&&se.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function wd(s,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=s,f=o||1,g=h-1,{min:m,max:b}=t,_=!z(r),y=!z(a),S=!z(c),M=(b-m)/(d+1);let v=gi((b-m)/g/f)*f,x,w,k,C;if(v<1e-14&&!_&&!y)return[{value:m},{value:b}];C=Math.ceil(b/v)-Math.floor(m/v),C>g&&(v=gi(C*v/g/f)*f),z(l)||(x=Math.pow(10,l),v=Math.ceil(v*x)/x),n==="ticks"?(w=Math.floor(m/v)*v,k=Math.ceil(b/v)*v):(w=m,k=b),_&&y&&o&&Ka((a-r)/o,v/1e3)?(C=Math.round(Math.min((a-r)/v,h)),v=(a-r)/C,w=r,k=a):S?(w=_?r:w,k=y?a:k,C=c-1,v=(k-w)/C):(C=(k-w)/v,_e(C,Math.round(C),v/1e3)?C=Math.round(C):C=Math.ceil(C));const I=Math.max(pi(v),pi(w));x=Math.pow(10,z(l)?I:l),w=Math.round(w*x)/x,k=Math.round(k*x)/x;let A=0;for(_&&(u&&w!==r?(e.push({value:r}),wa)break;e.push({value:T})}return y&&u&&k!==a?e.length&&_e(e[e.length-1].value,a,mn(a,M,s))?e[e.length-1].value=a:e.push({value:a}):(!y||k===a)&&e.push({value:k}),e}function mn(s,t,{horizontal:e,minRotation:i}){const n=$t(i),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+s).length;return Math.min(t/o,r)}class kd extends ie{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return z(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=i?o:l;if(t){const l=bt(n),c=bt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=wd(n,o);return t.bounds==="ticks"&&Xa(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Yn(t,this.chart.options.locale,this.options.ticks.format)}}class Md extends kd{static id="linear";static defaults={ticks:{callback:Xn.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ct(t)?t:0,this.max=ct(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=$t(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const hs={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},et=Object.keys(hs);function bn(s,t){return s-t}function _n(s,t){if(z(t))return null;const e=s._adapter,{parser:i,round:n,isoWeekday:o}=s._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),ct(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(Me(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function xn(s,t,e,i){const n=et.length;for(let o=et.indexOf(s);o=et.indexOf(e);o--){const r=et[o];if(hs[r].common&&s._adapter.diff(n,i,r)>=t-1)return r}return et[e?et.indexOf(e):0]}function Cd(s){for(let t=et.indexOf(s)+1,e=et.length;t=t?e[i]:e[n];s[o]=!0}}function Dd(s,t,e,i){const n=s._adapter,o=+n.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function vn(s,t,e){const i=[],n={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t=[]){let e=0,i=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=it(e,0,r),i=it(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,o=n.time,r=o.unit||xn(o.minUnit,e,i,this._getLabelCapacity(e)),a=L(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Me(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const g=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u+m)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,n){const o=this.options,r=o.ticks.callback;if(r)return B(r,[t,e,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],u=i[e],f=c&&d&&u&&u.major;return this._adapter.format(t,n||(f?d:h))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,i=n.length;e=s[i].pos&&t<=s[n].pos&&({lo:i,hi:n}=Ht(s,"pos",t)),{pos:o,time:a}=s[i],{pos:r,time:l}=s[n]):(t>=s[i].time&&t<=s[n].time&&({lo:i,hi:n}=Ht(s,"time",t)),{time:o,pos:a}=s[i],{time:r,pos:l}=s[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Hf extends Sn{static id="timeseries";static defaults=Sn.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ke(e,this.min),this._tableRange=Ke(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r=e&&c<=i&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,a=n.length;rn-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ke(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ke(this._table,i*this._tableRange+this._minPos,!0)}}const Co={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},Od={ariaLabel:{type:String},ariaDescribedby:{type:String}},Ad={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Co,...Od},Td=jo[0]==="2"?(s,t)=>Object.assign(s,{attrs:t}):(s,t)=>Object.assign(s,t);function Jt(s){return In(s)?Ps(s):s}function Ld(s){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s;return In(t)?new Proxy(s,{}):s}function Id(s,t){const e=s.options;e&&t&&Object.assign(e,t)}function Do(s,t){s.labels=t}function Oo(s,t,e){const i=[];s.datasets=t.map(n=>{const o=s.datasets.find(r=>r[e]===n[e]);return!o||!n.data||i.includes(o)?{...n}:(i.push(o),Object.assign(o,n),o)})}function Rd(s,t){const e={labels:[],datasets:[]};return Do(e,s.labels),Oo(e,s.datasets,t),e}const Ed=Tn({props:Ad,setup(s,t){let{expose:e,slots:i}=t;const n=Qe(null),o=Ln(null);e({chart:o});const r=()=>{if(!n.value)return;const{type:c,data:h,options:d,plugins:u,datasetIdKey:f}=s,g=Rd(h,f),m=Ld(g,h);o.value=new cs(n.value,{type:c,data:m,options:{...d},plugins:u})},a=()=>{const c=Ps(o.value);c&&(s.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},s.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(s.updateMode)};return Uo(r),Yo(a),An([()=>s.options,()=>s.data],(c,h)=>{let[d,u]=c,[f,g]=h;const m=Ps(o.value);if(!m)return;let b=!1;if(d){const _=Jt(d),y=Jt(f);_&&_!==y&&(Id(m,_),b=!0)}if(u){const _=Jt(u.labels),y=Jt(g.labels),S=Jt(u.datasets),M=Jt(g.datasets);_!==y&&(Do(m.config.data,_),b=!0),S&&S!==M&&(Oo(m.config.data,S,s.datasetIdKey),b=!0)}b&&Ko(()=>{l(m)})},{deep:!0}),()=>Ms("canvas",{role:"img",ariaLabel:s.ariaLabel,ariaDescribedby:s.ariaDescribedby,ref:n},[Ms("p",{},[i.default?i.default():""])])}});function Ao(s,t){return cs.register(t),Tn({props:Co,setup(e,i){let{expose:n}=i;const o=Ln(null),r=a=>{o.value=a?.chart};return n({chart:o}),()=>Ms(Ed,Td({ref:r},{type:s,...e}))}})}const Fd=Ao("bar",co),zd=Ao("line",ho);function wt(s){return Array.isArray?Array.isArray(s):Io(s)==="[object Array]"}const Bd=1/0;function $d(s){if(typeof s=="string")return s;let t=s+"";return t=="0"&&1/s==-Bd?"-0":t}function Nd(s){return s==null?"":$d(s)}function pt(s){return typeof s=="string"}function To(s){return typeof s=="number"}function Hd(s){return s===!0||s===!1||Wd(s)&&Io(s)=="[object Boolean]"}function Lo(s){return typeof s=="object"}function Wd(s){return Lo(s)&&s!==null}function st(s){return s!=null}function ws(s){return!s.trim().length}function Io(s){return s==null?s===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(s)}const Vd="Incorrect 'index' type",jd=s=>`Invalid value for key ${s}`,Ud=s=>`Pattern length exceeds max of ${s}.`,Yd=s=>`Missing ${s} property in key`,Kd=s=>`Property 'weight' in key '${s}' must be a positive integer`,wn=Object.prototype.hasOwnProperty;class Xd{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(i=>{let n=Ro(i);this._keys.push(n),this._keyMap[n.id]=n,e+=n.weight}),this._keys.forEach(i=>{i.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Ro(s){let t=null,e=null,i=null,n=1,o=null;if(pt(s)||wt(s))i=s,t=kn(s),e=Es(s);else{if(!wn.call(s,"name"))throw new Error(Yd("name"));const r=s.name;if(i=r,wn.call(s,"weight")&&(n=s.weight,n<=0))throw new Error(Kd(r));t=kn(r),e=Es(r),o=s.getFn}return{path:t,id:e,weight:n,src:i,getFn:o}}function kn(s){return wt(s)?s:s.split(".")}function Es(s){return wt(s)?s.join("."):s}function Gd(s,t){let e=[],i=!1;const n=(o,r,a)=>{if(st(o))if(!r[a])e.push(o);else{let l=r[a];const c=o[l];if(!st(c))return;if(a===r.length-1&&(pt(c)||To(c)||Hd(c)))e.push(Nd(c));else if(wt(c)){i=!0;for(let h=0,d=c.length;hs.score===t.score?s.idx{this._keysMap[e.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,pt(this.docs[0])?this.docs.forEach((t,e)=>{this._addString(t,e)}):this.docs.forEach((t,e)=>{this._addObject(t,e)}),this.norm.clear())}add(t){const e=this.size();pt(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,i=this.size();e{let r=n.getFn?n.getFn(t):this.getFn(t,n.path);if(st(r)){if(wt(r)){let a=[];const l=[{nestedArrIndex:-1,value:r}];for(;l.length;){const{nestedArrIndex:c,value:h}=l.pop();if(st(h))if(pt(h)&&!ws(h)){let d={v:h,i:c,n:this.norm.get(h)};a.push(d)}else wt(h)&&h.forEach((d,u)=>{l.push({nestedArrIndex:u,value:d})})}i.$[o]=a}else if(pt(r)&&!ws(r)){let a={v:r,n:this.norm.get(r)};i.$[o]=a}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function Eo(s,t,{getFn:e=O.getFn,fieldNormWeight:i=O.fieldNormWeight}={}){const n=new ni({getFn:e,fieldNormWeight:i});return n.setKeys(s.map(Ro)),n.setSources(t),n.create(),n}function su(s,{getFn:t=O.getFn,fieldNormWeight:e=O.fieldNormWeight}={}){const{keys:i,records:n}=s,o=new ni({getFn:t,fieldNormWeight:e});return o.setKeys(i),o.setIndexRecords(n),o}function Xe(s,{errors:t=0,currentLocation:e=0,expectedLocation:i=0,distance:n=O.distance,ignoreLocation:o=O.ignoreLocation}={}){const r=t/s.length;if(o)return r;const a=Math.abs(i-e);return n?r+a/n:a?1:r}function iu(s=[],t=O.minMatchCharLength){let e=[],i=-1,n=-1,o=0;for(let r=s.length;o=t&&e.push([i,n]),i=-1)}return s[o-1]&&o-i>=t&&e.push([i,o-1]),e}const Bt=32;function nu(s,t,e,{location:i=O.location,distance:n=O.distance,threshold:o=O.threshold,findAllMatches:r=O.findAllMatches,minMatchCharLength:a=O.minMatchCharLength,includeMatches:l=O.includeMatches,ignoreLocation:c=O.ignoreLocation}={}){if(t.length>Bt)throw new Error(Ud(Bt));const h=t.length,d=s.length,u=Math.max(0,Math.min(i,d));let f=o,g=u;const m=a>1||l,b=m?Array(d):[];let _;for(;(_=s.indexOf(t,g))>-1;){let w=Xe(t,{currentLocation:_,expectedLocation:u,distance:n,ignoreLocation:c});if(f=Math.min(w,f),g=_+h,m){let k=0;for(;k=I;N-=1){let F=N-1,U=e[s.charAt(F)];if(m&&(b[F]=+!!U),T[N]=(T[N+1]<<1|1)&U,w&&(T[N]|=(y[N+1]|y[N])<<1|1|y[N+1]),T[N]&v&&(S=Xe(t,{errors:w,currentLocation:F,expectedLocation:u,distance:n,ignoreLocation:c}),S<=f)){if(f=S,g=F,g<=u)break;I=Math.max(1,2*u-g)}}if(Xe(t,{errors:w+1,currentLocation:u,expectedLocation:u,distance:n,ignoreLocation:c})>f)break;y=T}const x={isMatch:g>=0,score:Math.max(.001,S)};if(m){const w=iu(b,a);w.length?l&&(x.indices=w):x.isMatch=!1}return x}function ou(s){let t={};for(let e=0,i=s.length;e{this.chunks.push({pattern:u,alphabet:ou(u),startIndex:f})},d=this.pattern.length;if(d>Bt){let u=0;const f=d%Bt,g=d-f;for(;u{const{isMatch:_,score:y,indices:S}=nu(t,g,m,{location:n+b,distance:o,threshold:r,findAllMatches:a,minMatchCharLength:l,includeMatches:i,ignoreLocation:c});_&&(u=!0),d+=y,_&&S&&(h=[...h,...S])});let f={isMatch:u,score:u?d/this.chunks.length:1};return u&&i&&(f.indices=h),f}}class At{constructor(t){this.pattern=t}static isMultiMatch(t){return Mn(t,this.multiRegex)}static isSingleMatch(t){return Mn(t,this.singleRegex)}search(){}}function Mn(s,t){const e=s.match(t);return e?e[1]:null}class ru extends At{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class au extends At{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const i=t.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,t.length-1]}}}class lu extends At{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class cu extends At{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class hu extends At{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class du extends At{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class zo extends At{constructor(t,{location:e=O.location,threshold:i=O.threshold,distance:n=O.distance,includeMatches:o=O.includeMatches,findAllMatches:r=O.findAllMatches,minMatchCharLength:a=O.minMatchCharLength,isCaseSensitive:l=O.isCaseSensitive,ignoreLocation:c=O.ignoreLocation}={}){super(t),this._bitapSearch=new Fo(t,{location:e,threshold:i,distance:n,includeMatches:o,findAllMatches:r,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Bo extends At{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e=0,i;const n=[],o=this.pattern.length;for(;(i=t.indexOf(this.pattern,e))>-1;)e=i+o,n.push([i,e-1]);const r=!!n.length;return{isMatch:r,score:r?0:1,indices:n}}}const Fs=[ru,Bo,lu,cu,du,hu,au,zo],Pn=Fs.length,uu=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,fu="|";function gu(s,t={}){return s.split(fu).map(e=>{let i=e.trim().split(uu).filter(o=>o&&!!o.trim()),n=[];for(let o=0,r=i.length;o!!(s[os.AND]||s[os.OR]),_u=s=>!!s[$s.PATH],xu=s=>!wt(s)&&Lo(s)&&!Ns(s),Cn=s=>({[os.AND]:Object.keys(s).map(t=>({[t]:s[t]}))});function $o(s,t,{auto:e=!0}={}){const i=n=>{let o=Object.keys(n);const r=_u(n);if(!r&&o.length>1&&!Ns(n))return i(Cn(n));if(xu(n)){const l=r?n[$s.PATH]:o[0],c=r?n[$s.PATTERN]:n[l];if(!pt(c))throw new Error(jd(l));const h={keyId:Es(l),pattern:c};return e&&(h.searcher=Bs(c,t)),h}let a={children:[],operator:o[0]};return o.forEach(l=>{const c=n[l];wt(c)&&c.forEach(h=>{a.children.push(i(h))})}),a};return Ns(s)||(s=Cn(s)),i(s)}function yu(s,{ignoreFieldNorm:t=O.ignoreFieldNorm}){s.forEach(e=>{let i=1;e.matches.forEach(({key:n,norm:o,score:r})=>{const a=n?n.weight:null;i*=Math.pow(r===0&&a?Number.EPSILON:r,(a||1)*(t?1:o))}),e.score=i})}function vu(s,t){const e=s.matches;t.matches=[],st(e)&&e.forEach(i=>{if(!st(i.indices)||!i.indices.length)return;const{indices:n,value:o}=i;let r={indices:n,value:o};i.key&&(r.key=i.key.src),i.idx>-1&&(r.refIndex=i.idx),t.matches.push(r)})}function Su(s,t){t.score=s.score}function wu(s,t,{includeMatches:e=O.includeMatches,includeScore:i=O.includeScore}={}){const n=[];return e&&n.push(vu),i&&n.push(Su),s.map(o=>{const{idx:r}=o,a={item:t[r],refIndex:r};return n.length&&n.forEach(l=>{l(o,a)}),a})}class ne{constructor(t,e={},i){this.options={...O,...e},this.options.useExtendedSearch,this._keyStore=new Xd(this.options.keys),this.setCollection(t,i)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof ni))throw new Error(Vd);this._myIndex=e||Eo(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){st(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const e=[];for(let i=0,n=this._docs.length;i-1&&(l=l.slice(0,e)),wu(l,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(t){const e=Bs(t,this.options),{records:i}=this._myIndex,n=[];return i.forEach(({v:o,i:r,n:a})=>{if(!st(o))return;const{isMatch:l,score:c,indices:h}=e.searchIn(o);l&&n.push({item:o,idx:r,matches:[{score:c,value:o,norm:a,indices:h}]})}),n}_searchLogical(t){const e=$o(t,this.options),i=(a,l,c)=>{if(!a.children){const{keyId:d,searcher:u}=a,f=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(l,d),searcher:u});return f&&f.length?[{idx:c,item:l,matches:f}]:[]}const h=[];for(let d=0,u=a.children.length;d{if(st(a)){let c=i(e,a,l);c.length&&(o[l]||(o[l]={idx:l,item:a,matches:[]},r.push(o[l])),c.forEach(({matches:h})=>{o[l].matches.push(...h)}))}}),r}_searchObjectList(t){const e=Bs(t,this.options),{keys:i,records:n}=this._myIndex,o=[];return n.forEach(({$:r,i:a})=>{if(!st(r))return;let l=[];i.forEach((c,h)=>{l.push(...this._findMatches({key:c,value:r[h],searcher:e}))}),l.length&&o.push({idx:a,item:r,matches:l})}),o}_findMatches({key:t,value:e,searcher:i}){if(!st(e))return[];let n=[];if(wt(e))e.forEach(({v:o,i:r,n:a})=>{if(!st(o))return;const{isMatch:l,score:c,indices:h}=i.searchIn(o);l&&n.push({score:c,key:t,value:o,idx:r,norm:a,indices:h})});else{const{v:o,n:r}=e,{isMatch:a,score:l,indices:c}=i.searchIn(o);a&&n.push({score:l,key:t,value:o,norm:r,indices:c})}return n}}ne.version="7.0.0";ne.createIndex=Eo;ne.parseIndex=su;ne.config=O;ne.parseQuery=$o;bu(mu);cs.register(Gh,sd,co,ho,Md,ld,hd,_d,Sd,Jh);const ku={name:"peerList",components:{DeleteConfiguration:ot(()=>rt(()=>import("./deleteConfiguration-BCmwxoLx.js"),__vite__mapDeps([0,1,2,3]))),ConfigurationBackupRestore:ot(()=>rt(()=>import("./configurationBackupRestore-ByIwj5e4.js"),__vite__mapDeps([4,1,2,5,3,6]))),SelectPeers:ot(()=>rt(()=>import("./selectPeers-BBMqr9bY.js"),__vite__mapDeps([7,1,2,3,8]))),EditConfiguration:ot(()=>rt(()=>import("./editConfiguration-hI0uF3Oq.js"),__vite__mapDeps([9,1,2,3,10]))),LocaleText:as,PeerShareLinkModal:ot(()=>rt(()=>import("./peerShareLinkModal-Bqogws3W.js"),__vite__mapDeps([11,1,2,5,12,3]))),PeerJobsLogsModal:ot(()=>rt(()=>import("./peerJobsLogsModal-oNsuA1Dm.js"),__vite__mapDeps([13,5,1,2,3]))),PeerJobsAllModal:ot(()=>rt(()=>import("./peerJobsAllModal-BuV_jZ_r.js"),__vite__mapDeps([14,15,1,2,12,5,3,16]))),PeerJobs:ot(()=>rt(()=>import("./peerJobs-Cnl9B8_O.js"),__vite__mapDeps([17,15,1,2,12,5,3,16,18]))),PeerCreate:ot(()=>rt(()=>import("./peerCreate-C7F1RHXB.js"),__vite__mapDeps([19,1,2,3,20]))),PeerQRCode:ot(()=>rt(()=>import("./peerQRCode-BbWkgVDW.js"),__vite__mapDeps([21,22,3,1,2]))),PeerConfigurationFile:ot(()=>rt(()=>import("./peerConfigurationFile-phV9SBBy.js"),__vite__mapDeps([23,1,2,3,24]))),PeerSettings:ot(()=>rt(()=>import("./peerSettings-BNzBnZYL.js"),__vite__mapDeps([25,1,2,3,26]))),PeerSearch:Ar,Peer:ga,Line:zd,Bar:Fd},setup(){const s=Hs(),t=Dn(),e=Qe(void 0);return{dashboardConfigurationStore:s,wireguardConfigurationStore:t,interval:e}},data(){return{configurationToggling:!1,loading:!1,error:null,configurationInfo:[],configurationPeers:[],historyDataSentDifference:[],historyDataReceivedDifference:[],historySentData:{labels:[],datasets:[{label:"Data Sent",data:[],fill:!1,borderColor:"#198754",tension:0}]},historyReceiveData:{labels:[],datasets:[{label:"Data Received",data:[],fill:!1,borderColor:"#0d6efd",tension:0}]},peerSetting:{modalOpen:!1,selectedPeer:void 0},peerScheduleJobs:{modalOpen:!1,selectedPeer:void 0},peerQRCode:{modalOpen:!1,peerConfigData:void 0},peerConfigurationFile:{modalOpen:!1,peerConfigData:void 0},peerCreate:{modalOpen:!1},peerScheduleJobsAll:{modalOpen:!1},peerScheduleJobsLogs:{modalOpen:!1},peerShare:{modalOpen:!1,selectedPeer:void 0},editConfiguration:{modalOpen:!1},selectPeers:{modalOpen:!1},backupRestore:{modalOpen:!1},deleteConfiguration:{modalOpen:!1}}},mounted(){},watch:{$route:{immediate:!0,handler(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval),this.loading=!0;let s=this.$route.params.id;this.configurationInfo=[],this.configurationPeers=[],s&&(this.getPeers(s),this.setPeerInterval())}},"dashboardConfigurationStore.Configuration.Server.dashboard_refresh_interval"(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval),this.setPeerInterval()}},beforeRouteLeave(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval)},methods:{toggle(){this.configurationToggling=!0,ve("/api/toggleWireguardConfiguration/",{configurationName:this.configurationInfo.Name},s=>{s.status?this.dashboardConfigurationStore.newMessage("Server",`${this.configurationInfo.Name} ${s.data?"is on":"is off"}`,"success"):this.dashboardConfigurationStore.newMessage("Server",s.message,"danger"),this.configurationInfo.Status=s.data,this.configurationToggling=!1})},getPeers(s=this.$route.params.id){ve("/api/getWireguardConfigurationInfo",{configurationName:s},t=>{if(this.configurationInfo=t.data.configurationInfo,this.configurationPeers=t.data.configurationPeers,this.configurationPeers.forEach(e=>{e.restricted=!1}),t.data.configurationRestrictedPeers.forEach(e=>{e.restricted=!0,this.configurationPeers.push(e)}),this.loading=!1,this.configurationPeers.length>0){const e=this.configurationPeers.map(n=>n.total_sent+n.cumu_sent).reduce((n,o)=>n+o).toFixed(4),i=this.configurationPeers.map(n=>n.total_receive+n.cumu_receive).reduce((n,o)=>n+o).toFixed(4);this.historyDataSentDifference[this.historyDataSentDifference.length-1]!==e&&(this.historyDataSentDifference.length>0&&(this.historySentData={labels:[...this.historySentData.labels,oi().format("HH:mm:ss A")],datasets:[{label:"Data Sent",data:[...this.historySentData.datasets[0].data,((e-this.historyDataSentDifference[this.historyDataSentDifference.length-1])*1e3).toFixed(4)],fill:!1,borderColor:"#198754",tension:0}]}),this.historyDataSentDifference.push(e)),this.historyDataReceivedDifference[this.historyDataReceivedDifference.length-1]!==i&&(this.historyDataReceivedDifference.length>0&&(this.historyReceiveData={labels:[...this.historyReceiveData.labels,oi().format("HH:mm:ss A")],datasets:[{label:"Data Received",data:[...this.historyReceiveData.datasets[0].data,((i-this.historyDataReceivedDifference[this.historyDataReceivedDifference.length-1])*1e3).toFixed(4)],fill:!1,borderColor:"#0d6efd",tension:0}]}),this.historyDataReceivedDifference.push(i))}})},setPeerInterval(){this.dashboardConfigurationStore.Peers.RefreshInterval=setInterval(()=>{this.getPeers()},parseInt(this.dashboardConfigurationStore.Configuration.Server.dashboard_refresh_interval))}},computed:{configurationSummary(){return{connectedPeers:this.configurationPeers.filter(t=>t.status==="running").length,totalUsage:this.configurationPeers.length>0?this.configurationPeers.filter(t=>!t.restricted).map(t=>t.total_data+t.cumu_data).reduce((t,e)=>t+e,0).toFixed(4):0,totalReceive:this.configurationPeers.length>0?this.configurationPeers.filter(t=>!t.restricted).map(t=>t.total_receive+t.cumu_receive).reduce((t,e)=>t+e,0).toFixed(4):0,totalSent:this.configurationPeers.length>0?this.configurationPeers.filter(t=>!t.restricted).map(t=>t.total_sent+t.cumu_sent).reduce((t,e)=>t+e,0).toFixed(4):0}},receiveData(){return this.historyReceiveData},sentData(){return this.historySentData},individualDataUsage(){return{labels:this.configurationPeers.map(s=>s.name?s.name:`Untitled Peer - ${s.id}`),datasets:[{label:"Total Data Usage",data:this.configurationPeers.map(s=>s.cumu_data+s.total_data),backgroundColor:this.configurationPeers.map(s=>"#0dcaf0"),tooltip:{callbacks:{label:s=>`${s.formattedValue} GB`}}}]}},individualDataUsageChartOption(){return{responsive:!0,plugins:{legend:{display:!1}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(s,t)=>`${s} GB`},grid:{display:!1}}}}},chartOptions(){return{responsive:!0,plugins:{legend:{display:!1},tooltip:{callbacks:{label:s=>`${s.formattedValue} MB/s`}}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(s,t)=>`${s} MB/s`},grid:{display:!1}}}}},searchPeers(){new ne(this.configurationPeers,{keys:["name","id","allowed_ip"]});const s=this.wireguardConfigurationStore.searchString?this.configurationPeers.filter(t=>t.name.includes(this.wireguardConfigurationStore.searchString)||t.id.includes(this.wireguardConfigurationStore.searchString)||t.allowed_ip.includes(this.wireguardConfigurationStore.searchString)):this.configurationPeers;return this.dashboardConfigurationStore.Configuration.Server.dashboard_sort==="restricted"?s.slice().sort((t,e)=>t[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?-1:0):s.slice().sort((t,e)=>t[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?1:0)}}},Mu={key:0,class:"container-md"},Pu={class:"d-flex align-items-center"},Cu={CLASS:"text-muted"},Du={class:"d-flex align-items-center gap-3"},Ou={class:"mb-0 display-4"},Au={class:"card rounded-3 bg-transparent shadow-sm ms-auto"},Tu={class:"card-body py-2 d-flex align-items-center"},Lu={class:"mb-0 text-muted"},Iu={class:"form-check form-switch ms-auto"},Ru=["for"],Eu={key:4,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},Fu=["disabled","id"],zu={class:"row mt-3 gy-2 gx-2 mb-2"},Bu={class:"col-12 col-lg-3"},$u={class:"card rounded-3 bg-transparent shadow-sm"},Nu={class:"card-body py-2"},Hu={class:"mb-0 text-muted"},Wu={class:"col-12 col-lg-3"},Vu={class:"card rounded-3 bg-transparent shadow-sm"},ju={class:"card-body py-2"},Uu={class:"mb-0 text-muted"},Yu={style:{"word-break":"break-all"},class:"col-12 col-lg-6"},Ku={class:"card rounded-3 bg-transparent shadow-sm"},Xu={class:"card-body py-2"},Gu={class:"mb-0 text-muted"},Ju={class:"row gx-2 gy-2 mb-2"},qu={class:"col-12 col-lg-3"},Qu={class:"card rounded-3 bg-transparent shadow-sm"},Zu={class:"card-body d-flex"},tf={class:"mb-0 text-muted"},ef={class:"h4"},sf={class:"col-12 col-lg-3"},nf={class:"card rounded-3 bg-transparent shadow-sm"},of={class:"card-body d-flex"},rf={class:"mb-0 text-muted"},af={class:"h4"},lf={class:"col-12 col-lg-3"},cf={class:"card rounded-3 bg-transparent shadow-sm"},hf={class:"card-body d-flex"},df={class:"mb-0 text-muted"},uf={class:"h4 text-primary"},ff={class:"col-12 col-lg-3"},gf={class:"card rounded-3 bg-transparent shadow-sm"},pf={class:"card-body d-flex"},mf={class:"mb-0 text-muted"},bf={class:"h4 text-success"},_f={class:"row gx-2 gy-2 mb-3"},xf={class:"col-12 col-lg-6"},yf={class:"card rounded-3 bg-transparent shadow-sm",style:{height:"270px"}},vf={class:"card-header bg-transparent border-0"},Sf={class:"text-muted"},wf={class:"card-body pt-1"},kf={class:"col-sm col-lg-3"},Mf={class:"card rounded-3 bg-transparent shadow-sm",style:{height:"270px"}},Pf={class:"card-header bg-transparent border-0"},Cf={class:"text-muted"},Df={class:"card-body pt-1"},Of={class:"col-sm col-lg-3"},Af={class:"card rounded-3 bg-transparent shadow-sm",style:{height:"270px"}},Tf={class:"card-header bg-transparent border-0"},Lf={class:"text-muted"},If={class:"card-body pt-1"},Rf={class:"mb-3"};function Ef(s,t,e,i,n,o){const r=W("LocaleText"),a=W("Bar"),l=W("Line"),c=W("PeerSearch"),h=W("Peer"),d=W("PeerSettings"),u=W("PeerQRCode"),f=W("PeerJobs"),g=W("PeerJobsAllModal"),m=W("PeerJobsLogsModal"),b=W("PeerShareLinkModal"),_=W("EditConfiguration"),y=W("SelectPeers"),S=W("DeleteConfiguration"),M=W("ConfigurationBackupRestore"),v=W("PeerConfigurationFile");return this.loading?V("",!0):(D(),$("div",Mu,[p("div",Pu,[p("div",null,[p("small",Cu,[P(r,{t:"CONFIGURATION"})]),p("div",Du,[p("h1",Ou,[p("samp",null,K(this.configurationInfo.Name),1)])])]),p("div",Au,[p("div",Tu,[p("div",null,[p("p",Lu,[p("small",null,[P(r,{t:"Status"})])]),p("div",Iu,[p("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+this.configurationInfo.id},[!this.configurationInfo.Status&&this.configurationToggling?(D(),H(r,{key:0,t:"Turning Off..."})):this.configurationInfo.Status&&this.configurationToggling?(D(),H(r,{key:1,t:"Turning On..."})):this.configurationInfo.Status&&!this.configurationToggling?(D(),H(r,{key:2,t:"On"})):!this.configurationInfo.Status&&!this.configurationToggling?(D(),H(r,{key:3,t:"Off"})):V("",!0),this.configurationToggling?(D(),$("span",Eu)):V("",!0)],8,Ru),On(p("input",{class:"form-check-input",style:{cursor:"pointer"},disabled:this.configurationToggling,type:"checkbox",role:"switch",id:"switch"+this.configurationInfo.id,onChange:t[0]||(t[0]=x=>this.toggle()),"onUpdate:modelValue":t[1]||(t[1]=x=>this.configurationInfo.Status=x)},null,40,Fu),[[Xo,this.configurationInfo.Status]])])]),p("div",{class:Vt(["dot ms-5",{active:this.configurationInfo.Status}])},null,2)])])]),t[33]||(t[33]=p("hr",null,null,-1)),p("div",zu,[p("div",Bu,[p("div",$u,[p("div",Nu,[p("p",Hu,[p("small",null,[P(r,{t:"Address"})])]),Wt(" "+K(this.configurationInfo.Address),1)])])]),p("div",Wu,[p("div",Vu,[p("div",ju,[p("p",Uu,[p("small",null,[P(r,{t:"Listen Port"})])]),Wt(" "+K(this.configurationInfo.ListenPort),1)])])]),p("div",Yu,[p("div",Ku,[p("div",Xu,[p("p",Gu,[p("small",null,[P(r,{t:"Public Key"})])]),p("samp",null,K(this.configurationInfo.PublicKey),1)])])])]),p("div",Ju,[p("div",qu,[p("div",Qu,[p("div",Zu,[p("div",null,[p("p",tf,[p("small",null,[P(r,{t:"Connected Peers"})])]),p("strong",ef,K(o.configurationSummary.connectedPeers)+" / "+K(n.configurationPeers.length),1)]),t[29]||(t[29]=p("i",{class:"bi bi-ethernet ms-auto h2 text-muted"},null,-1))])])]),p("div",sf,[p("div",nf,[p("div",of,[p("div",null,[p("p",rf,[p("small",null,[P(r,{t:"Total Usage"})])]),p("strong",af,K(o.configurationSummary.totalUsage)+" GB",1)]),t[30]||(t[30]=p("i",{class:"bi bi-arrow-down-up ms-auto h2 text-muted"},null,-1))])])]),p("div",lf,[p("div",cf,[p("div",hf,[p("div",null,[p("p",df,[p("small",null,[P(r,{t:"Total Received"})])]),p("strong",uf,K(o.configurationSummary.totalReceive)+" GB",1)]),t[31]||(t[31]=p("i",{class:"bi bi-arrow-down ms-auto h2 text-muted"},null,-1))])])]),p("div",ff,[p("div",gf,[p("div",pf,[p("div",null,[p("p",mf,[p("small",null,[P(r,{t:"Total Sent"})])]),p("strong",bf,K(o.configurationSummary.totalSent)+" GB",1)]),t[32]||(t[32]=p("i",{class:"bi bi-arrow-up ms-auto h2 text-muted"},null,-1))])])])]),p("div",_f,[p("div",xf,[p("div",yf,[p("div",vf,[p("small",Sf,[P(r,{t:"Peers Data Usage"})])]),p("div",wf,[P(a,{data:o.individualDataUsage,options:o.individualDataUsageChartOption,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["data","options"])])])]),p("div",kf,[p("div",Mf,[p("div",Pf,[p("small",Cf,[P(r,{t:"Real Time Received Data Usage"})])]),p("div",Df,[P(l,{options:o.chartOptions,data:o.receiveData,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])]),p("div",Of,[p("div",Af,[p("div",Tf,[p("small",Lf,[P(r,{t:"Real Time Sent Data Usage"})])]),p("div",If,[P(l,{options:o.chartOptions,data:o.sentData,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])])]),p("div",Rf,[P(c,{onJobsAll:t[2]||(t[2]=x=>this.peerScheduleJobsAll.modalOpen=!0),onJobLogs:t[3]||(t[3]=x=>this.peerScheduleJobsLogs.modalOpen=!0),onEditConfiguration:t[4]||(t[4]=x=>this.editConfiguration.modalOpen=!0),onSelectPeers:t[5]||(t[5]=x=>this.selectPeers.modalOpen=!0),onBackupRestore:t[6]||(t[6]=x=>this.backupRestore.modalOpen=!0),onDeleteConfiguration:t[7]||(t[7]=x=>this.deleteConfiguration.modalOpen=!0),configuration:this.configurationInfo},null,8,["configuration"]),P(Go,{name:"list",tag:"div",class:"row gx-2 gy-2 z-0"},{default:G(()=>[(D(!0),$(qt,null,ks(this.searchPeers,x=>(D(),$("div",{class:"col-12 col-lg-6 col-xl-4",key:x.id},[P(h,{Peer:x,onShare:w=>{this.peerShare.selectedPeer=x.id,this.peerShare.modalOpen=!0},onRefresh:t[8]||(t[8]=w=>this.getPeers()),onJobs:w=>{n.peerScheduleJobs.modalOpen=!0,n.peerScheduleJobs.selectedPeer=this.configurationPeers.find(k=>k.id===x.id)},onSetting:w=>{n.peerSetting.modalOpen=!0,n.peerSetting.selectedPeer=this.configurationPeers.find(k=>k.id===x.id)},onQrcode:t[9]||(t[9]=w=>{this.peerQRCode.peerConfigData=w,this.peerQRCode.modalOpen=!0}),onConfigurationFile:t[10]||(t[10]=w=>{this.peerConfigurationFile.peerConfigData=w,this.peerConfigurationFile.modalOpen=!0})},null,8,["Peer","onShare","onJobs","onSetting"])]))),128))]),_:1})]),P(tt,{name:"zoom"},{default:G(()=>[this.peerSetting.modalOpen?(D(),H(d,{key:"settings",selectedPeer:this.peerSetting.selectedPeer,onRefresh:t[11]||(t[11]=x=>this.getPeers()),onClose:t[12]||(t[12]=x=>this.peerSetting.modalOpen=!1)},null,8,["selectedPeer"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[n.peerQRCode.modalOpen?(D(),H(u,{peerConfigData:this.peerQRCode.peerConfigData,key:"qrcode",onClose:t[13]||(t[13]=x=>this.peerQRCode.modalOpen=!1)},null,8,["peerConfigData"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.peerScheduleJobs.modalOpen?(D(),H(f,{key:0,onRefresh:t[14]||(t[14]=x=>this.getPeers()),selectedPeer:this.peerScheduleJobs.selectedPeer,onClose:t[15]||(t[15]=x=>this.peerScheduleJobs.modalOpen=!1)},null,8,["selectedPeer"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.peerScheduleJobsAll.modalOpen?(D(),H(g,{key:0,onRefresh:t[16]||(t[16]=x=>this.getPeers()),onClose:t[17]||(t[17]=x=>this.peerScheduleJobsAll.modalOpen=!1),configurationPeers:this.configurationPeers},null,8,["configurationPeers"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.peerScheduleJobsLogs.modalOpen?(D(),H(m,{key:0,onClose:t[18]||(t[18]=x=>this.peerScheduleJobsLogs.modalOpen=!1),configurationInfo:this.configurationInfo},null,8,["configurationInfo"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.peerShare.modalOpen?(D(),H(b,{key:0,onClose:t[19]||(t[19]=x=>{this.peerShare.modalOpen=!1,this.peerShare.selectedPeer=void 0}),peer:this.configurationPeers.find(x=>x.id===this.peerShare.selectedPeer)},null,8,["peer"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.editConfiguration.modalOpen?(D(),H(_,{key:0,onClose:t[20]||(t[20]=x=>this.editConfiguration.modalOpen=!1),onDataChanged:t[21]||(t[21]=x=>this.configurationInfo=x),configurationInfo:this.configurationInfo},null,8,["configurationInfo"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.selectPeers.modalOpen?(D(),H(y,{key:0,onRefresh:t[22]||(t[22]=x=>this.getPeers()),configurationPeers:this.configurationPeers,onClose:t[23]||(t[23]=x=>this.selectPeers.modalOpen=!1)},null,8,["configurationPeers"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[n.deleteConfiguration.modalOpen?(D(),H(S,{key:0,onBackup:t[24]||(t[24]=x=>n.backupRestore.modalOpen=!0),onClose:t[25]||(t[25]=x=>n.deleteConfiguration.modalOpen=!1)})):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[n.backupRestore.modalOpen?(D(),H(M,{key:0,onClose:t[26]||(t[26]=x=>n.backupRestore.modalOpen=!1),onRefreshPeersList:t[27]||(t[27]=x=>this.getPeers())})):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[n.peerConfigurationFile.modalOpen?(D(),H(v,{key:0,onClose:t[28]||(t[28]=x=>n.peerConfigurationFile.modalOpen=!1),configurationFile:n.peerConfigurationFile.peerConfigData},null,8,["configurationFile"])):V("",!0)]),_:1})]))}const Wf=rs(ku,[["render",Ef],["__scopeId","data-v-16505bc9"]]);export{Wf as default}; +`):s}function dd(s,t){const{element:e,datasetIndex:i,index:n}=t,o=s.getDatasetMeta(i).controller,{label:r,value:a}=o.getLabelAndValue(n);return{chart:s,label:r,parsed:o.getParsed(n),raw:s.data.datasets[i].data[n],formattedValue:a,dataset:o.getDataset(),dataIndex:n,datasetIndex:i,element:e}}function cn(s,t){const e=s.chart.ctx,{body:i,footer:n,title:o}=s,{boxWidth:r,boxHeight:a}=t,l=q(t.bodyFont),c=q(t.titleFont),h=q(t.footerFont),d=o.length,u=n.length,f=i.length,g=ht(t.padding);let m=g.height,b=0,_=i.reduce((M,v)=>M+v.before.length+v.lines.length+v.after.length,0);if(_+=s.beforeBody.length+s.afterBody.length,d&&(m+=d*c.lineHeight+(d-1)*t.titleSpacing+t.titleMarginBottom),_){const M=t.displayColors?Math.max(a,l.lineHeight):l.lineHeight;m+=f*M+(_-f)*l.lineHeight+(_-1)*t.bodySpacing}u&&(m+=t.footerMarginTop+u*h.lineHeight+(u-1)*t.footerSpacing);let y=0;const S=function(M){b=Math.max(b,e.measureText(M).width+y)};return e.save(),e.font=c.string,E(s.title,S),e.font=l.string,E(s.beforeBody.concat(s.afterBody),S),y=t.displayColors?r+2+t.boxPadding:0,E(i,M=>{E(M.before,S),E(M.lines,S),E(M.after,S)}),y=0,e.font=h.string,E(s.footer,S),e.restore(),b+=g.width,{width:b,height:m}}function ud(s,t){const{y:e,height:i}=t;return es.height-i/2?"bottom":"center"}function fd(s,t,e,i){const{x:n,width:o}=i,r=e.caretSize+e.caretPadding;if(s==="left"&&n+o+r>t.width||s==="right"&&n-o-r<0)return!0}function gd(s,t,e,i){const{x:n,width:o}=e,{width:r,chartArea:{left:a,right:l}}=s;let c="center";return i==="center"?c=n<=(a+l)/2?"left":"right":n<=o/2?c="left":n>=r-o/2&&(c="right"),fd(c,s,t,e)&&(c="center"),c}function hn(s,t,e){const i=e.yAlign||t.yAlign||ud(s,e);return{xAlign:e.xAlign||t.xAlign||gd(s,t,e,i),yAlign:i}}function pd(s,t){let{x:e,width:i}=s;return t==="right"?e-=i:t==="center"&&(e-=i/2),e}function md(s,t,e){let{y:i,height:n}=s;return t==="top"?i+=e:t==="bottom"?i-=n+e:i-=n/2,i}function dn(s,t,e,i){const{caretSize:n,caretPadding:o,cornerRadius:r}=s,{xAlign:a,yAlign:l}=e,c=n+o,{topLeft:h,topRight:d,bottomLeft:u,bottomRight:f}=Qt(r);let g=pd(t,a);const m=md(t,l,c);return l==="center"?a==="left"?g+=c:a==="right"&&(g-=c):a==="left"?g-=Math.max(h,u)+n:a==="right"&&(g+=Math.max(d,f)+n),{x:it(g,0,i.width-t.width),y:it(m,0,i.height-t.height)}}function Ye(s,t,e){const i=ht(e.padding);return t==="center"?s.x+s.width/2:t==="right"?s.x+s.width-i.right:s.x+i.left}function un(s){return ft([],vt(s))}function bd(s,t,e){return Yt(s,{tooltip:t,tooltipItems:e,type:"tooltip"})}function fn(s,t){const e=t&&t.dataset&&t.dataset.tooltip&&t.dataset.tooltip.callbacks;return e?s.override(e):s}const Po={beforeTitle:xt,title(s){if(s.length>0){const t=s[0],e=t.chart.data.labels,i=e?e.length:0;if(this&&this.options&&this.options.mode==="dataset")return t.dataset.label||"";if(t.label)return t.label;if(i>0&&t.dataIndex"u"?Po[t].call(e,i):n}class gn extends Ot{static positioners=pe;constructor(t){super(),this.opacity=0,this._active=[],this._eventPosition=void 0,this._size=void 0,this._cachedAnimations=void 0,this._tooltipItems=[],this.$animations=void 0,this.$context=void 0,this.chart=t.chart,this.options=t.options,this.dataPoints=void 0,this.title=void 0,this.beforeBody=void 0,this.body=void 0,this.afterBody=void 0,this.footer=void 0,this.xAlign=void 0,this.yAlign=void 0,this.x=void 0,this.y=void 0,this.height=void 0,this.width=void 0,this.caretX=void 0,this.caretY=void 0,this.labelColors=void 0,this.labelPointStyles=void 0,this.labelTextColors=void 0}initialize(t){this.options=t,this._cachedAnimations=void 0,this.$context=void 0}_resolveAnimations(){const t=this._cachedAnimations;if(t)return t;const e=this.chart,i=this.options.setContext(this.getContext()),n=i.enabled&&e.options.animation&&i.animations,o=new ro(this.chart,n);return n._cacheable&&(this._cachedAnimations=Object.freeze(o)),o}getContext(){return this.$context||(this.$context=bd(this.chart.getContext(),this,this._tooltipItems))}getTitle(t,e){const{callbacks:i}=e,n=Z(i,"beforeTitle",this,t),o=Z(i,"title",this,t),r=Z(i,"afterTitle",this,t);let a=[];return a=ft(a,vt(n)),a=ft(a,vt(o)),a=ft(a,vt(r)),a}getBeforeBody(t,e){return un(Z(e.callbacks,"beforeBody",this,t))}getBody(t,e){const{callbacks:i}=e,n=[];return E(t,o=>{const r={before:[],lines:[],after:[]},a=fn(i,o);ft(r.before,vt(Z(a,"beforeLabel",this,o))),ft(r.lines,Z(a,"label",this,o)),ft(r.after,vt(Z(a,"afterLabel",this,o))),n.push(r)}),n}getAfterBody(t,e){return un(Z(e.callbacks,"afterBody",this,t))}getFooter(t,e){const{callbacks:i}=e,n=Z(i,"beforeFooter",this,t),o=Z(i,"footer",this,t),r=Z(i,"afterFooter",this,t);let a=[];return a=ft(a,vt(n)),a=ft(a,vt(o)),a=ft(a,vt(r)),a}_createItems(t){const e=this._active,i=this.chart.data,n=[],o=[],r=[];let a=[],l,c;for(l=0,c=e.length;lt.filter(h,d,u,i))),t.itemSort&&(a=a.sort((h,d)=>t.itemSort(h,d,i))),E(a,h=>{const d=fn(t.callbacks,h);n.push(Z(d,"labelColor",this,h)),o.push(Z(d,"labelPointStyle",this,h)),r.push(Z(d,"labelTextColor",this,h))}),this.labelColors=n,this.labelPointStyles=o,this.labelTextColors=r,this.dataPoints=a,a}update(t,e){const i=this.options.setContext(this.getContext()),n=this._active;let o,r=[];if(!n.length)this.opacity!==0&&(o={opacity:0});else{const a=pe[i.position].call(this,n,this._eventPosition);r=this._createItems(i),this.title=this.getTitle(r,i),this.beforeBody=this.getBeforeBody(r,i),this.body=this.getBody(r,i),this.afterBody=this.getAfterBody(r,i),this.footer=this.getFooter(r,i);const l=this._size=cn(this,i),c=Object.assign({},a,l),h=hn(this.chart,i,c),d=dn(i,c,h,this.chart);this.xAlign=h.xAlign,this.yAlign=h.yAlign,o={opacity:1,x:d.x,y:d.y,width:l.width,height:l.height,caretX:a.x,caretY:a.y}}this._tooltipItems=r,this.$context=void 0,o&&this._resolveAnimations().update(this,o),t&&i.external&&i.external.call(this,{chart:this.chart,tooltip:this,replay:e})}drawCaret(t,e,i,n){const o=this.getCaretPosition(t,i,n);e.lineTo(o.x1,o.y1),e.lineTo(o.x2,o.y2),e.lineTo(o.x3,o.y3)}getCaretPosition(t,e,i){const{xAlign:n,yAlign:o}=this,{caretSize:r,cornerRadius:a}=i,{topLeft:l,topRight:c,bottomLeft:h,bottomRight:d}=Qt(a),{x:u,y:f}=t,{width:g,height:m}=e;let b,_,y,S,M,v;return o==="center"?(M=f+m/2,n==="left"?(b=u,_=b-r,S=M+r,v=M-r):(b=u+g,_=b+r,S=M-r,v=M+r),y=b):(n==="left"?_=u+Math.max(l,h)+r:n==="right"?_=u+g-Math.max(c,d)-r:_=this.caretX,o==="top"?(S=f,M=S-r,b=_-r,y=_+r):(S=f+m,M=S+r,b=_+r,y=_-r),v=S),{x1:b,x2:_,x3:y,y1:S,y2:M,y3:v}}drawTitle(t,e,i){const n=this.title,o=n.length;let r,a,l;if(o){const c=Zt(i.rtl,this.x,this.width);for(t.x=Ye(this,i.titleAlign,i),e.textAlign=c.textAlign(i.titleAlign),e.textBaseline="middle",r=q(i.titleFont),a=i.titleSpacing,e.fillStyle=i.titleColor,e.font=r.string,l=0;ly!==0)?(t.beginPath(),t.fillStyle=o.multiKeyBackground,ss(t,{x:m,y:g,w:c,h:l,radius:_}),t.fill(),t.stroke(),t.fillStyle=r.backgroundColor,t.beginPath(),ss(t,{x:b,y:g+1,w:c-2,h:l-2,radius:_}),t.fill()):(t.fillStyle=o.multiKeyBackground,t.fillRect(m,g,c,l),t.strokeRect(m,g,c,l),t.fillStyle=r.backgroundColor,t.fillRect(b,g+1,c-2,l-2))}t.fillStyle=this.labelTextColors[i]}drawBody(t,e,i){const{body:n}=this,{bodySpacing:o,bodyAlign:r,displayColors:a,boxHeight:l,boxWidth:c,boxPadding:h}=i,d=q(i.bodyFont);let u=d.lineHeight,f=0;const g=Zt(i.rtl,this.x,this.width),m=function(k){e.fillText(k,g.x(t.x+f),t.y+u/2),t.y+=u+o},b=g.textAlign(r);let _,y,S,M,v,x,w;for(e.textAlign=r,e.textBaseline="middle",e.font=d.string,t.x=Ye(this,b,i),e.fillStyle=i.bodyColor,E(this.beforeBody,m),f=a&&b!=="right"?r==="center"?c/2+h:c+2+h:0,M=0,x=n.length;M0&&e.stroke()}_updateAnimationTarget(t){const e=this.chart,i=this.$animations,n=i&&i.x,o=i&&i.y;if(n||o){const r=pe[t.position].call(this,this._active,this._eventPosition);if(!r)return;const a=this._size=cn(this,t),l=Object.assign({},r,this._size),c=hn(e,t,l),h=dn(t,l,c,e);(n._to!==h.x||o._to!==h.y)&&(this.xAlign=c.xAlign,this.yAlign=c.yAlign,this.width=a.width,this.height=a.height,this.caretX=r.x,this.caretY=r.y,this._resolveAnimations().update(this,h))}}_willRender(){return!!this.opacity}draw(t){const e=this.options.setContext(this.getContext());let i=this.opacity;if(!i)return;this._updateAnimationTarget(e);const n={width:this.width,height:this.height},o={x:this.x,y:this.y};i=Math.abs(i)<.001?0:i;const r=ht(e.padding),a=this.title.length||this.beforeBody.length||this.body.length||this.afterBody.length||this.footer.length;e.enabled&&a&&(t.save(),t.globalAlpha=i,this.drawBackground(o,t,n,e),io(t,e.textDirection),o.y+=r.top,this.drawTitle(o,t,e),this.drawBody(o,t,e),this.drawFooter(o,t,e),no(t,e.textDirection),t.restore())}getActiveElements(){return this._active||[]}setActiveElements(t,e){const i=this._active,n=t.map(({datasetIndex:a,index:l})=>{const c=this.chart.getDatasetMeta(a);if(!c)throw new Error("Cannot find a dataset at index "+a);return{datasetIndex:a,element:c.data[l],index:l}}),o=!Ze(i,n),r=this._positionChanged(n,e);(o||r)&&(this._active=n,this._eventPosition=e,this._ignoreReplayEvents=!0,this.update(!0))}handleEvent(t,e,i=!0){if(e&&this._ignoreReplayEvents)return!1;this._ignoreReplayEvents=!1;const n=this.options,o=this._active||[],r=this._getActiveElements(t,o,e,i),a=this._positionChanged(r,t),l=e||!Ze(r,o)||a;return l&&(this._active=r,(n.enabled||n.external)&&(this._eventPosition={x:t.x,y:t.y},this.update(!0,e))),l}_getActiveElements(t,e,i,n){const o=this.options;if(t.type==="mouseout")return[];if(!n)return e.filter(a=>this.chart.data.datasets[a.datasetIndex]&&this.chart.getDatasetMeta(a.datasetIndex).controller.getParsed(a.index)!==void 0);const r=this.chart.getElementsAtEventForMode(t,o.mode,o,i);return o.reverse&&r.reverse(),r}_positionChanged(t,e){const{caretX:i,caretY:n,options:o}=this,r=pe[o.position].call(this,t,e);return r!==!1&&(i!==r.x||n!==r.y)}}var _d={id:"tooltip",_element:gn,positioners:pe,afterInit(s,t,e){e&&(s.tooltip=new gn({chart:s,options:e}))},beforeUpdate(s,t,e){s.tooltip&&s.tooltip.initialize(e)},reset(s,t,e){s.tooltip&&s.tooltip.initialize(e)},afterDraw(s){const t=s.tooltip;if(t&&t._willRender()){const e={tooltip:t};if(s.notifyPlugins("beforeTooltipDraw",{...e,cancelable:!0})===!1)return;t.draw(s.ctx),s.notifyPlugins("afterTooltipDraw",e)}},afterEvent(s,t){if(s.tooltip){const e=t.replay;s.tooltip.handleEvent(t.event,e,t.inChartArea)&&(t.changed=!0)}},defaults:{enabled:!0,external:null,position:"average",backgroundColor:"rgba(0,0,0,0.8)",titleColor:"#fff",titleFont:{weight:"bold"},titleSpacing:2,titleMarginBottom:6,titleAlign:"left",bodyColor:"#fff",bodySpacing:2,bodyFont:{},bodyAlign:"left",footerColor:"#fff",footerSpacing:2,footerMarginTop:6,footerFont:{weight:"bold"},footerAlign:"left",padding:6,caretPadding:2,caretSize:5,cornerRadius:6,boxHeight:(s,t)=>t.bodyFont.size,boxWidth:(s,t)=>t.bodyFont.size,multiKeyBackground:"#fff",displayColors:!0,boxPadding:0,borderColor:"rgba(0,0,0,0)",borderWidth:0,animation:{duration:400,easing:"easeOutQuart"},animations:{numbers:{type:"number",properties:["x","y","width","height","caretX","caretY"]},opacity:{easing:"linear",duration:200}},callbacks:Po},defaultRoutes:{bodyFont:"font",footerFont:"font",titleFont:"font"},descriptors:{_scriptable:s=>s!=="filter"&&s!=="itemSort"&&s!=="external",_indexable:!1,callbacks:{_scriptable:!1,_indexable:!1},animation:{_fallback:!1},animations:{_fallback:"animation"}},additionalOptionScopes:["interaction"]};const xd=(s,t,e,i)=>(typeof t=="string"?(e=s.push(t)-1,i.unshift({index:e,label:t})):isNaN(t)&&(e=null),e);function yd(s,t,e,i){const n=s.indexOf(t);if(n===-1)return xd(s,t,e,i);const o=s.lastIndexOf(t);return n!==o?e:n}const vd=(s,t)=>s===null?null:it(Math.round(s),0,t);function pn(s){const t=this.getLabels();return s>=0&&se.length-1?null:this.getPixelForValue(e[t].value)}getValueForPixel(t){return Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange)}getBasePixel(){return this.bottom}}function wd(s,t){const e=[],{bounds:n,step:o,min:r,max:a,precision:l,count:c,maxTicks:h,maxDigits:d,includeBounds:u}=s,f=o||1,g=h-1,{min:m,max:b}=t,_=!z(r),y=!z(a),S=!z(c),M=(b-m)/(d+1);let v=gi((b-m)/g/f)*f,x,w,k,C;if(v<1e-14&&!_&&!y)return[{value:m},{value:b}];C=Math.ceil(b/v)-Math.floor(m/v),C>g&&(v=gi(C*v/g/f)*f),z(l)||(x=Math.pow(10,l),v=Math.ceil(v*x)/x),n==="ticks"?(w=Math.floor(m/v)*v,k=Math.ceil(b/v)*v):(w=m,k=b),_&&y&&o&&Ka((a-r)/o,v/1e3)?(C=Math.round(Math.min((a-r)/v,h)),v=(a-r)/C,w=r,k=a):S?(w=_?r:w,k=y?a:k,C=c-1,v=(k-w)/C):(C=(k-w)/v,_e(C,Math.round(C),v/1e3)?C=Math.round(C):C=Math.ceil(C));const I=Math.max(pi(v),pi(w));x=Math.pow(10,z(l)?I:l),w=Math.round(w*x)/x,k=Math.round(k*x)/x;let A=0;for(_&&(u&&w!==r?(e.push({value:r}),wa)break;e.push({value:T})}return y&&u&&k!==a?e.length&&_e(e[e.length-1].value,a,mn(a,M,s))?e[e.length-1].value=a:e.push({value:a}):(!y||k===a)&&e.push({value:k}),e}function mn(s,t,{horizontal:e,minRotation:i}){const n=$t(i),o=(e?Math.sin(n):Math.cos(n))||.001,r=.75*t*(""+s).length;return Math.min(t/o,r)}class kd extends ie{constructor(t){super(t),this.start=void 0,this.end=void 0,this._startValue=void 0,this._endValue=void 0,this._valueRange=0}parse(t,e){return z(t)||(typeof t=="number"||t instanceof Number)&&!isFinite(+t)?null:+t}handleTickRangeOptions(){const{beginAtZero:t}=this.options,{minDefined:e,maxDefined:i}=this.getUserBounds();let{min:n,max:o}=this;const r=l=>n=e?n:l,a=l=>o=i?o:l;if(t){const l=bt(n),c=bt(o);l<0&&c<0?a(0):l>0&&c>0&&r(0)}if(n===o){let l=o===0?1:Math.abs(o*.05);a(o+l),t||r(n-l)}this.min=n,this.max=o}getTickLimit(){const t=this.options.ticks;let{maxTicksLimit:e,stepSize:i}=t,n;return i?(n=Math.ceil(this.max/i)-Math.floor(this.min/i)+1,n>1e3&&(console.warn(`scales.${this.id}.ticks.stepSize: ${i} would result generating up to ${n} ticks. Limiting to 1000.`),n=1e3)):(n=this.computeTickLimit(),e=e||11),e&&(n=Math.min(e,n)),n}computeTickLimit(){return Number.POSITIVE_INFINITY}buildTicks(){const t=this.options,e=t.ticks;let i=this.getTickLimit();i=Math.max(2,i);const n={maxTicks:i,bounds:t.bounds,min:t.min,max:t.max,precision:e.precision,step:e.stepSize,count:e.count,maxDigits:this._maxDigits(),horizontal:this.isHorizontal(),minRotation:e.minRotation||0,includeBounds:e.includeBounds!==!1},o=this._range||this,r=wd(n,o);return t.bounds==="ticks"&&Xa(r,this,"value"),t.reverse?(r.reverse(),this.start=this.max,this.end=this.min):(this.start=this.min,this.end=this.max),r}configure(){const t=this.ticks;let e=this.min,i=this.max;if(super.configure(),this.options.offset&&t.length){const n=(i-e)/Math.max(t.length-1,1)/2;e-=n,i+=n}this._startValue=e,this._endValue=i,this._valueRange=i-e}getLabelForValue(t){return Yn(t,this.chart.options.locale,this.options.ticks.format)}}class Md extends kd{static id="linear";static defaults={ticks:{callback:Xn.formatters.numeric}};determineDataLimits(){const{min:t,max:e}=this.getMinMax(!0);this.min=ct(t)?t:0,this.max=ct(e)?e:1,this.handleTickRangeOptions()}computeTickLimit(){const t=this.isHorizontal(),e=t?this.width:this.height,i=$t(this.options.ticks.minRotation),n=(t?Math.sin(i):Math.cos(i))||.001,o=this._resolveTickFontOptions(0);return Math.ceil(e/Math.min(40,o.lineHeight/n))}getPixelForValue(t){return t===null?NaN:this.getPixelForDecimal((t-this._startValue)/this._valueRange)}getValueForPixel(t){return this._startValue+this.getDecimalForPixel(t)*this._valueRange}}const hs={millisecond:{common:!0,size:1,steps:1e3},second:{common:!0,size:1e3,steps:60},minute:{common:!0,size:6e4,steps:60},hour:{common:!0,size:36e5,steps:24},day:{common:!0,size:864e5,steps:30},week:{common:!1,size:6048e5,steps:4},month:{common:!0,size:2628e6,steps:12},quarter:{common:!1,size:7884e6,steps:4},year:{common:!0,size:3154e7}},et=Object.keys(hs);function bn(s,t){return s-t}function _n(s,t){if(z(t))return null;const e=s._adapter,{parser:i,round:n,isoWeekday:o}=s._parseOpts;let r=t;return typeof i=="function"&&(r=i(r)),ct(r)||(r=typeof i=="string"?e.parse(r,i):e.parse(r)),r===null?null:(n&&(r=n==="week"&&(Me(o)||o===!0)?e.startOf(r,"isoWeek",o):e.startOf(r,n)),+r)}function xn(s,t,e,i){const n=et.length;for(let o=et.indexOf(s);o=et.indexOf(e);o--){const r=et[o];if(hs[r].common&&s._adapter.diff(n,i,r)>=t-1)return r}return et[e?et.indexOf(e):0]}function Cd(s){for(let t=et.indexOf(s)+1,e=et.length;t=t?e[i]:e[n];s[o]=!0}}function Dd(s,t,e,i){const n=s._adapter,o=+n.startOf(t[0].value,i),r=t[t.length-1].value;let a,l;for(a=o;a<=r;a=+n.add(a,1,i))l=e[a],l>=0&&(t[l].major=!0);return t}function vn(s,t,e){const i=[],n={},o=t.length;let r,a;for(r=0;r+t.value))}initOffsets(t=[]){let e=0,i=0,n,o;this.options.offset&&t.length&&(n=this.getDecimalForValue(t[0]),t.length===1?e=1-n:e=(this.getDecimalForValue(t[1])-n)/2,o=this.getDecimalForValue(t[t.length-1]),t.length===1?i=o:i=(o-this.getDecimalForValue(t[t.length-2]))/2);const r=t.length<3?.5:.25;e=it(e,0,r),i=it(i,0,r),this._offsets={start:e,end:i,factor:1/(e+1+i)}}_generate(){const t=this._adapter,e=this.min,i=this.max,n=this.options,o=n.time,r=o.unit||xn(o.minUnit,e,i,this._getLabelCapacity(e)),a=L(n.ticks.stepSize,1),l=r==="week"?o.isoWeekday:!1,c=Me(l)||l===!0,h={};let d=e,u,f;if(c&&(d=+t.startOf(d,"isoWeek",l)),d=+t.startOf(d,c?"day":r),t.diff(i,e,r)>1e5*a)throw new Error(e+" and "+i+" are too far apart with stepSize of "+a+" "+r);const g=n.ticks.source==="data"&&this.getDataTimestamps();for(u=d,f=0;u+m)}getLabelForValue(t){const e=this._adapter,i=this.options.time;return i.tooltipFormat?e.format(t,i.tooltipFormat):e.format(t,i.displayFormats.datetime)}format(t,e){const n=this.options.time.displayFormats,o=this._unit,r=e||n[o];return this._adapter.format(t,r)}_tickFormatFunction(t,e,i,n){const o=this.options,r=o.ticks.callback;if(r)return B(r,[t,e,i],this);const a=o.time.displayFormats,l=this._unit,c=this._majorUnit,h=l&&a[l],d=c&&a[c],u=i[e],f=c&&d&&u&&u.major;return this._adapter.format(t,n||(f?d:h))}generateTickLabels(t){let e,i,n;for(e=0,i=t.length;e0?a:1}getDataTimestamps(){let t=this._cache.data||[],e,i;if(t.length)return t;const n=this.getMatchingVisibleMetas();if(this._normalized&&n.length)return this._cache.data=n[0].controller.getAllParsedValues(this);for(e=0,i=n.length;e=s[i].pos&&t<=s[n].pos&&({lo:i,hi:n}=Ht(s,"pos",t)),{pos:o,time:a}=s[i],{pos:r,time:l}=s[n]):(t>=s[i].time&&t<=s[n].time&&({lo:i,hi:n}=Ht(s,"time",t)),{time:o,pos:a}=s[i],{time:r,pos:l}=s[n]);const c=r-o;return c?a+(l-a)*(t-o)/c:a}class Hf extends Sn{static id="timeseries";static defaults=Sn.defaults;constructor(t){super(t),this._table=[],this._minPos=void 0,this._tableRange=void 0}initOffsets(){const t=this._getTimestampsForTable(),e=this._table=this.buildLookupTable(t);this._minPos=Ke(e,this.min),this._tableRange=Ke(e,this.max)-this._minPos,super.initOffsets(t)}buildLookupTable(t){const{min:e,max:i}=this,n=[],o=[];let r,a,l,c,h;for(r=0,a=t.length;r=e&&c<=i&&n.push(c);if(n.length<2)return[{time:e,pos:0},{time:i,pos:1}];for(r=0,a=n.length;rn-o)}_getTimestampsForTable(){let t=this._cache.all||[];if(t.length)return t;const e=this.getDataTimestamps(),i=this.getLabelTimestamps();return e.length&&i.length?t=this.normalize(e.concat(i)):t=e.length?e:i,t=this._cache.all=t,t}getDecimalForValue(t){return(Ke(this._table,t)-this._minPos)/this._tableRange}getValueForPixel(t){const e=this._offsets,i=this.getDecimalForPixel(t)/e.factor-e.end;return Ke(this._table,i*this._tableRange+this._minPos,!0)}}const Co={data:{type:Object,required:!0},options:{type:Object,default:()=>({})},plugins:{type:Array,default:()=>[]},datasetIdKey:{type:String,default:"label"},updateMode:{type:String,default:void 0}},Od={ariaLabel:{type:String},ariaDescribedby:{type:String}},Ad={type:{type:String,required:!0},destroyDelay:{type:Number,default:0},...Co,...Od},Td=jo[0]==="2"?(s,t)=>Object.assign(s,{attrs:t}):(s,t)=>Object.assign(s,t);function Jt(s){return In(s)?Ps(s):s}function Ld(s){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s;return In(t)?new Proxy(s,{}):s}function Id(s,t){const e=s.options;e&&t&&Object.assign(e,t)}function Do(s,t){s.labels=t}function Oo(s,t,e){const i=[];s.datasets=t.map(n=>{const o=s.datasets.find(r=>r[e]===n[e]);return!o||!n.data||i.includes(o)?{...n}:(i.push(o),Object.assign(o,n),o)})}function Rd(s,t){const e={labels:[],datasets:[]};return Do(e,s.labels),Oo(e,s.datasets,t),e}const Ed=Tn({props:Ad,setup(s,t){let{expose:e,slots:i}=t;const n=Qe(null),o=Ln(null);e({chart:o});const r=()=>{if(!n.value)return;const{type:c,data:h,options:d,plugins:u,datasetIdKey:f}=s,g=Rd(h,f),m=Ld(g,h);o.value=new cs(n.value,{type:c,data:m,options:{...d},plugins:u})},a=()=>{const c=Ps(o.value);c&&(s.destroyDelay>0?setTimeout(()=>{c.destroy(),o.value=null},s.destroyDelay):(c.destroy(),o.value=null))},l=c=>{c.update(s.updateMode)};return Uo(r),Yo(a),An([()=>s.options,()=>s.data],(c,h)=>{let[d,u]=c,[f,g]=h;const m=Ps(o.value);if(!m)return;let b=!1;if(d){const _=Jt(d),y=Jt(f);_&&_!==y&&(Id(m,_),b=!0)}if(u){const _=Jt(u.labels),y=Jt(g.labels),S=Jt(u.datasets),M=Jt(g.datasets);_!==y&&(Do(m.config.data,_),b=!0),S&&S!==M&&(Oo(m.config.data,S,s.datasetIdKey),b=!0)}b&&Ko(()=>{l(m)})},{deep:!0}),()=>Ms("canvas",{role:"img",ariaLabel:s.ariaLabel,ariaDescribedby:s.ariaDescribedby,ref:n},[Ms("p",{},[i.default?i.default():""])])}});function Ao(s,t){return cs.register(t),Tn({props:Co,setup(e,i){let{expose:n}=i;const o=Ln(null),r=a=>{o.value=a?.chart};return n({chart:o}),()=>Ms(Ed,Td({ref:r},{type:s,...e}))}})}const Fd=Ao("bar",co),zd=Ao("line",ho);function wt(s){return Array.isArray?Array.isArray(s):Io(s)==="[object Array]"}const Bd=1/0;function $d(s){if(typeof s=="string")return s;let t=s+"";return t=="0"&&1/s==-Bd?"-0":t}function Nd(s){return s==null?"":$d(s)}function pt(s){return typeof s=="string"}function To(s){return typeof s=="number"}function Hd(s){return s===!0||s===!1||Wd(s)&&Io(s)=="[object Boolean]"}function Lo(s){return typeof s=="object"}function Wd(s){return Lo(s)&&s!==null}function st(s){return s!=null}function ws(s){return!s.trim().length}function Io(s){return s==null?s===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(s)}const Vd="Incorrect 'index' type",jd=s=>`Invalid value for key ${s}`,Ud=s=>`Pattern length exceeds max of ${s}.`,Yd=s=>`Missing ${s} property in key`,Kd=s=>`Property 'weight' in key '${s}' must be a positive integer`,wn=Object.prototype.hasOwnProperty;class Xd{constructor(t){this._keys=[],this._keyMap={};let e=0;t.forEach(i=>{let n=Ro(i);this._keys.push(n),this._keyMap[n.id]=n,e+=n.weight}),this._keys.forEach(i=>{i.weight/=e})}get(t){return this._keyMap[t]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Ro(s){let t=null,e=null,i=null,n=1,o=null;if(pt(s)||wt(s))i=s,t=kn(s),e=Es(s);else{if(!wn.call(s,"name"))throw new Error(Yd("name"));const r=s.name;if(i=r,wn.call(s,"weight")&&(n=s.weight,n<=0))throw new Error(Kd(r));t=kn(r),e=Es(r),o=s.getFn}return{path:t,id:e,weight:n,src:i,getFn:o}}function kn(s){return wt(s)?s:s.split(".")}function Es(s){return wt(s)?s.join("."):s}function Gd(s,t){let e=[],i=!1;const n=(o,r,a)=>{if(st(o))if(!r[a])e.push(o);else{let l=r[a];const c=o[l];if(!st(c))return;if(a===r.length-1&&(pt(c)||To(c)||Hd(c)))e.push(Nd(c));else if(wt(c)){i=!0;for(let h=0,d=c.length;hs.score===t.score?s.idx{this._keysMap[e.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,pt(this.docs[0])?this.docs.forEach((t,e)=>{this._addString(t,e)}):this.docs.forEach((t,e)=>{this._addObject(t,e)}),this.norm.clear())}add(t){const e=this.size();pt(t)?this._addString(t,e):this._addObject(t,e)}removeAt(t){this.records.splice(t,1);for(let e=t,i=this.size();e{let r=n.getFn?n.getFn(t):this.getFn(t,n.path);if(st(r)){if(wt(r)){let a=[];const l=[{nestedArrIndex:-1,value:r}];for(;l.length;){const{nestedArrIndex:c,value:h}=l.pop();if(st(h))if(pt(h)&&!ws(h)){let d={v:h,i:c,n:this.norm.get(h)};a.push(d)}else wt(h)&&h.forEach((d,u)=>{l.push({nestedArrIndex:u,value:d})})}i.$[o]=a}else if(pt(r)&&!ws(r)){let a={v:r,n:this.norm.get(r)};i.$[o]=a}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function Eo(s,t,{getFn:e=O.getFn,fieldNormWeight:i=O.fieldNormWeight}={}){const n=new ni({getFn:e,fieldNormWeight:i});return n.setKeys(s.map(Ro)),n.setSources(t),n.create(),n}function su(s,{getFn:t=O.getFn,fieldNormWeight:e=O.fieldNormWeight}={}){const{keys:i,records:n}=s,o=new ni({getFn:t,fieldNormWeight:e});return o.setKeys(i),o.setIndexRecords(n),o}function Xe(s,{errors:t=0,currentLocation:e=0,expectedLocation:i=0,distance:n=O.distance,ignoreLocation:o=O.ignoreLocation}={}){const r=t/s.length;if(o)return r;const a=Math.abs(i-e);return n?r+a/n:a?1:r}function iu(s=[],t=O.minMatchCharLength){let e=[],i=-1,n=-1,o=0;for(let r=s.length;o=t&&e.push([i,n]),i=-1)}return s[o-1]&&o-i>=t&&e.push([i,o-1]),e}const Bt=32;function nu(s,t,e,{location:i=O.location,distance:n=O.distance,threshold:o=O.threshold,findAllMatches:r=O.findAllMatches,minMatchCharLength:a=O.minMatchCharLength,includeMatches:l=O.includeMatches,ignoreLocation:c=O.ignoreLocation}={}){if(t.length>Bt)throw new Error(Ud(Bt));const h=t.length,d=s.length,u=Math.max(0,Math.min(i,d));let f=o,g=u;const m=a>1||l,b=m?Array(d):[];let _;for(;(_=s.indexOf(t,g))>-1;){let w=Xe(t,{currentLocation:_,expectedLocation:u,distance:n,ignoreLocation:c});if(f=Math.min(w,f),g=_+h,m){let k=0;for(;k=I;N-=1){let F=N-1,U=e[s.charAt(F)];if(m&&(b[F]=+!!U),T[N]=(T[N+1]<<1|1)&U,w&&(T[N]|=(y[N+1]|y[N])<<1|1|y[N+1]),T[N]&v&&(S=Xe(t,{errors:w,currentLocation:F,expectedLocation:u,distance:n,ignoreLocation:c}),S<=f)){if(f=S,g=F,g<=u)break;I=Math.max(1,2*u-g)}}if(Xe(t,{errors:w+1,currentLocation:u,expectedLocation:u,distance:n,ignoreLocation:c})>f)break;y=T}const x={isMatch:g>=0,score:Math.max(.001,S)};if(m){const w=iu(b,a);w.length?l&&(x.indices=w):x.isMatch=!1}return x}function ou(s){let t={};for(let e=0,i=s.length;e{this.chunks.push({pattern:u,alphabet:ou(u),startIndex:f})},d=this.pattern.length;if(d>Bt){let u=0;const f=d%Bt,g=d-f;for(;u{const{isMatch:_,score:y,indices:S}=nu(t,g,m,{location:n+b,distance:o,threshold:r,findAllMatches:a,minMatchCharLength:l,includeMatches:i,ignoreLocation:c});_&&(u=!0),d+=y,_&&S&&(h=[...h,...S])});let f={isMatch:u,score:u?d/this.chunks.length:1};return u&&i&&(f.indices=h),f}}class At{constructor(t){this.pattern=t}static isMultiMatch(t){return Mn(t,this.multiRegex)}static isSingleMatch(t){return Mn(t,this.singleRegex)}search(){}}function Mn(s,t){const e=s.match(t);return e?e[1]:null}class ru extends At{constructor(t){super(t)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(t){const e=t===this.pattern;return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class au extends At{constructor(t){super(t)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(t){const i=t.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,t.length-1]}}}class lu extends At{constructor(t){super(t)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(t){const e=t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,this.pattern.length-1]}}}class cu extends At{constructor(t){super(t)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(t){const e=!t.startsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class hu extends At{constructor(t){super(t)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(t){const e=t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[t.length-this.pattern.length,t.length-1]}}}class du extends At{constructor(t){super(t)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(t){const e=!t.endsWith(this.pattern);return{isMatch:e,score:e?0:1,indices:[0,t.length-1]}}}class zo extends At{constructor(t,{location:e=O.location,threshold:i=O.threshold,distance:n=O.distance,includeMatches:o=O.includeMatches,findAllMatches:r=O.findAllMatches,minMatchCharLength:a=O.minMatchCharLength,isCaseSensitive:l=O.isCaseSensitive,ignoreLocation:c=O.ignoreLocation}={}){super(t),this._bitapSearch=new Fo(t,{location:e,threshold:i,distance:n,includeMatches:o,findAllMatches:r,minMatchCharLength:a,isCaseSensitive:l,ignoreLocation:c})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(t){return this._bitapSearch.searchIn(t)}}class Bo extends At{constructor(t){super(t)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(t){let e=0,i;const n=[],o=this.pattern.length;for(;(i=t.indexOf(this.pattern,e))>-1;)e=i+o,n.push([i,e-1]);const r=!!n.length;return{isMatch:r,score:r?0:1,indices:n}}}const Fs=[ru,Bo,lu,cu,du,hu,au,zo],Pn=Fs.length,uu=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,fu="|";function gu(s,t={}){return s.split(fu).map(e=>{let i=e.trim().split(uu).filter(o=>o&&!!o.trim()),n=[];for(let o=0,r=i.length;o!!(s[os.AND]||s[os.OR]),_u=s=>!!s[$s.PATH],xu=s=>!wt(s)&&Lo(s)&&!Ns(s),Cn=s=>({[os.AND]:Object.keys(s).map(t=>({[t]:s[t]}))});function $o(s,t,{auto:e=!0}={}){const i=n=>{let o=Object.keys(n);const r=_u(n);if(!r&&o.length>1&&!Ns(n))return i(Cn(n));if(xu(n)){const l=r?n[$s.PATH]:o[0],c=r?n[$s.PATTERN]:n[l];if(!pt(c))throw new Error(jd(l));const h={keyId:Es(l),pattern:c};return e&&(h.searcher=Bs(c,t)),h}let a={children:[],operator:o[0]};return o.forEach(l=>{const c=n[l];wt(c)&&c.forEach(h=>{a.children.push(i(h))})}),a};return Ns(s)||(s=Cn(s)),i(s)}function yu(s,{ignoreFieldNorm:t=O.ignoreFieldNorm}){s.forEach(e=>{let i=1;e.matches.forEach(({key:n,norm:o,score:r})=>{const a=n?n.weight:null;i*=Math.pow(r===0&&a?Number.EPSILON:r,(a||1)*(t?1:o))}),e.score=i})}function vu(s,t){const e=s.matches;t.matches=[],st(e)&&e.forEach(i=>{if(!st(i.indices)||!i.indices.length)return;const{indices:n,value:o}=i;let r={indices:n,value:o};i.key&&(r.key=i.key.src),i.idx>-1&&(r.refIndex=i.idx),t.matches.push(r)})}function Su(s,t){t.score=s.score}function wu(s,t,{includeMatches:e=O.includeMatches,includeScore:i=O.includeScore}={}){const n=[];return e&&n.push(vu),i&&n.push(Su),s.map(o=>{const{idx:r}=o,a={item:t[r],refIndex:r};return n.length&&n.forEach(l=>{l(o,a)}),a})}class ne{constructor(t,e={},i){this.options={...O,...e},this.options.useExtendedSearch,this._keyStore=new Xd(this.options.keys),this.setCollection(t,i)}setCollection(t,e){if(this._docs=t,e&&!(e instanceof ni))throw new Error(Vd);this._myIndex=e||Eo(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(t){st(t)&&(this._docs.push(t),this._myIndex.add(t))}remove(t=()=>!1){const e=[];for(let i=0,n=this._docs.length;i-1&&(l=l.slice(0,e)),wu(l,this._docs,{includeMatches:i,includeScore:n})}_searchStringList(t){const e=Bs(t,this.options),{records:i}=this._myIndex,n=[];return i.forEach(({v:o,i:r,n:a})=>{if(!st(o))return;const{isMatch:l,score:c,indices:h}=e.searchIn(o);l&&n.push({item:o,idx:r,matches:[{score:c,value:o,norm:a,indices:h}]})}),n}_searchLogical(t){const e=$o(t,this.options),i=(a,l,c)=>{if(!a.children){const{keyId:d,searcher:u}=a,f=this._findMatches({key:this._keyStore.get(d),value:this._myIndex.getValueForItemAtKeyId(l,d),searcher:u});return f&&f.length?[{idx:c,item:l,matches:f}]:[]}const h=[];for(let d=0,u=a.children.length;d{if(st(a)){let c=i(e,a,l);c.length&&(o[l]||(o[l]={idx:l,item:a,matches:[]},r.push(o[l])),c.forEach(({matches:h})=>{o[l].matches.push(...h)}))}}),r}_searchObjectList(t){const e=Bs(t,this.options),{keys:i,records:n}=this._myIndex,o=[];return n.forEach(({$:r,i:a})=>{if(!st(r))return;let l=[];i.forEach((c,h)=>{l.push(...this._findMatches({key:c,value:r[h],searcher:e}))}),l.length&&o.push({idx:a,item:r,matches:l})}),o}_findMatches({key:t,value:e,searcher:i}){if(!st(e))return[];let n=[];if(wt(e))e.forEach(({v:o,i:r,n:a})=>{if(!st(o))return;const{isMatch:l,score:c,indices:h}=i.searchIn(o);l&&n.push({score:c,key:t,value:o,idx:r,norm:a,indices:h})});else{const{v:o,n:r}=e,{isMatch:a,score:l,indices:c}=i.searchIn(o);a&&n.push({score:l,key:t,value:o,norm:r,indices:c})}return n}}ne.version="7.0.0";ne.createIndex=Eo;ne.parseIndex=su;ne.config=O;ne.parseQuery=$o;bu(mu);cs.register(Gh,sd,co,ho,Md,ld,hd,_d,Sd,Jh);const ku={name:"peerList",components:{DeleteConfiguration:ot(()=>rt(()=>import("./deleteConfiguration-BU0tzWgI.js"),__vite__mapDeps([0,1,2,3]))),ConfigurationBackupRestore:ot(()=>rt(()=>import("./configurationBackupRestore-CerUpwbQ.js"),__vite__mapDeps([4,1,2,5,3,6]))),SelectPeers:ot(()=>rt(()=>import("./selectPeers-B6Dm7IFO.js"),__vite__mapDeps([7,1,2,3,8]))),EditConfiguration:ot(()=>rt(()=>import("./editConfiguration-kC_NwN06.js"),__vite__mapDeps([9,1,2,3,10]))),LocaleText:as,PeerShareLinkModal:ot(()=>rt(()=>import("./peerShareLinkModal-6b5Bdaqt.js"),__vite__mapDeps([11,1,2,5,12,3]))),PeerJobsLogsModal:ot(()=>rt(()=>import("./peerJobsLogsModal-ZNMKiJ-k.js"),__vite__mapDeps([13,5,1,2,3]))),PeerJobsAllModal:ot(()=>rt(()=>import("./peerJobsAllModal-CkJIs1TM.js"),__vite__mapDeps([14,15,1,2,12,5,3,16]))),PeerJobs:ot(()=>rt(()=>import("./peerJobs-BbNYdlYw.js"),__vite__mapDeps([17,15,1,2,12,5,3,16,18]))),PeerCreate:ot(()=>rt(()=>import("./peerCreate-B_n86hyd.js"),__vite__mapDeps([19,1,2,3,20]))),PeerQRCode:ot(()=>rt(()=>import("./peerQRCode-DEHFJvZX.js"),__vite__mapDeps([21,22,3,1,2]))),PeerConfigurationFile:ot(()=>rt(()=>import("./peerConfigurationFile-BRKM9nlG.js"),__vite__mapDeps([23,1,2,3,24]))),PeerSettings:ot(()=>rt(()=>import("./peerSettings-Bgrsto1V.js"),__vite__mapDeps([25,1,2,3,26]))),PeerSearch:Ar,Peer:ga,Line:zd,Bar:Fd},setup(){const s=Hs(),t=Dn(),e=Qe(void 0);return{dashboardConfigurationStore:s,wireguardConfigurationStore:t,interval:e}},data(){return{configurationToggling:!1,loading:!1,error:null,configurationInfo:[],configurationPeers:[],historyDataSentDifference:[],historyDataReceivedDifference:[],historySentData:{labels:[],datasets:[{label:"Data Sent",data:[],fill:!1,borderColor:"#198754",tension:0}]},historyReceiveData:{labels:[],datasets:[{label:"Data Received",data:[],fill:!1,borderColor:"#0d6efd",tension:0}]},peerSetting:{modalOpen:!1,selectedPeer:void 0},peerScheduleJobs:{modalOpen:!1,selectedPeer:void 0},peerQRCode:{modalOpen:!1,peerConfigData:void 0},peerConfigurationFile:{modalOpen:!1,peerConfigData:void 0},peerCreate:{modalOpen:!1},peerScheduleJobsAll:{modalOpen:!1},peerScheduleJobsLogs:{modalOpen:!1},peerShare:{modalOpen:!1,selectedPeer:void 0},editConfiguration:{modalOpen:!1},selectPeers:{modalOpen:!1},backupRestore:{modalOpen:!1},deleteConfiguration:{modalOpen:!1}}},mounted(){},watch:{$route:{immediate:!0,handler(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval),this.loading=!0;let s=this.$route.params.id;this.configurationInfo=[],this.configurationPeers=[],s&&(this.getPeers(s),this.setPeerInterval())}},"dashboardConfigurationStore.Configuration.Server.dashboard_refresh_interval"(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval),this.setPeerInterval()}},beforeRouteLeave(){clearInterval(this.dashboardConfigurationStore.Peers.RefreshInterval)},methods:{toggle(){this.configurationToggling=!0,ve("/api/toggleWireguardConfiguration/",{configurationName:this.configurationInfo.Name},s=>{s.status?this.dashboardConfigurationStore.newMessage("Server",`${this.configurationInfo.Name} ${s.data?"is on":"is off"}`,"success"):this.dashboardConfigurationStore.newMessage("Server",s.message,"danger"),this.configurationInfo.Status=s.data,this.configurationToggling=!1})},getPeers(s=this.$route.params.id){ve("/api/getWireguardConfigurationInfo",{configurationName:s},t=>{if(this.configurationInfo=t.data.configurationInfo,this.configurationPeers=t.data.configurationPeers,this.configurationPeers.forEach(e=>{e.restricted=!1}),t.data.configurationRestrictedPeers.forEach(e=>{e.restricted=!0,this.configurationPeers.push(e)}),this.loading=!1,this.configurationPeers.length>0){const e=this.configurationPeers.map(n=>n.total_sent+n.cumu_sent).reduce((n,o)=>n+o).toFixed(4),i=this.configurationPeers.map(n=>n.total_receive+n.cumu_receive).reduce((n,o)=>n+o).toFixed(4);this.historyDataSentDifference[this.historyDataSentDifference.length-1]!==e&&(this.historyDataSentDifference.length>0&&(this.historySentData={labels:[...this.historySentData.labels,oi().format("HH:mm:ss A")],datasets:[{label:"Data Sent",data:[...this.historySentData.datasets[0].data,((e-this.historyDataSentDifference[this.historyDataSentDifference.length-1])*1e3).toFixed(4)],fill:!1,borderColor:"#198754",tension:0}]}),this.historyDataSentDifference.push(e)),this.historyDataReceivedDifference[this.historyDataReceivedDifference.length-1]!==i&&(this.historyDataReceivedDifference.length>0&&(this.historyReceiveData={labels:[...this.historyReceiveData.labels,oi().format("HH:mm:ss A")],datasets:[{label:"Data Received",data:[...this.historyReceiveData.datasets[0].data,((i-this.historyDataReceivedDifference[this.historyDataReceivedDifference.length-1])*1e3).toFixed(4)],fill:!1,borderColor:"#0d6efd",tension:0}]}),this.historyDataReceivedDifference.push(i))}})},setPeerInterval(){this.dashboardConfigurationStore.Peers.RefreshInterval=setInterval(()=>{this.getPeers()},parseInt(this.dashboardConfigurationStore.Configuration.Server.dashboard_refresh_interval))}},computed:{configurationSummary(){return{connectedPeers:this.configurationPeers.filter(t=>t.status==="running").length,totalUsage:this.configurationPeers.length>0?this.configurationPeers.filter(t=>!t.restricted).map(t=>t.total_data+t.cumu_data).reduce((t,e)=>t+e,0).toFixed(4):0,totalReceive:this.configurationPeers.length>0?this.configurationPeers.filter(t=>!t.restricted).map(t=>t.total_receive+t.cumu_receive).reduce((t,e)=>t+e,0).toFixed(4):0,totalSent:this.configurationPeers.length>0?this.configurationPeers.filter(t=>!t.restricted).map(t=>t.total_sent+t.cumu_sent).reduce((t,e)=>t+e,0).toFixed(4):0}},receiveData(){return this.historyReceiveData},sentData(){return this.historySentData},individualDataUsage(){return{labels:this.configurationPeers.map(s=>s.name?s.name:`Untitled Peer - ${s.id}`),datasets:[{label:"Total Data Usage",data:this.configurationPeers.map(s=>s.cumu_data+s.total_data),backgroundColor:this.configurationPeers.map(s=>"#0dcaf0"),tooltip:{callbacks:{label:s=>`${s.formattedValue} GB`}}}]}},individualDataUsageChartOption(){return{responsive:!0,plugins:{legend:{display:!1}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(s,t)=>`${s} GB`},grid:{display:!1}}}}},chartOptions(){return{responsive:!0,plugins:{legend:{display:!1},tooltip:{callbacks:{label:s=>`${s.formattedValue} MB/s`}}},scales:{x:{ticks:{display:!1},grid:{display:!1}},y:{ticks:{callback:(s,t)=>`${s} MB/s`},grid:{display:!1}}}}},searchPeers(){new ne(this.configurationPeers,{keys:["name","id","allowed_ip"]});const s=this.wireguardConfigurationStore.searchString?this.configurationPeers.filter(t=>t.name.includes(this.wireguardConfigurationStore.searchString)||t.id.includes(this.wireguardConfigurationStore.searchString)||t.allowed_ip.includes(this.wireguardConfigurationStore.searchString)):this.configurationPeers;return this.dashboardConfigurationStore.Configuration.Server.dashboard_sort==="restricted"?s.slice().sort((t,e)=>t[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?-1:0):s.slice().sort((t,e)=>t[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]e[this.dashboardConfigurationStore.Configuration.Server.dashboard_sort]?1:0)}}},Mu={key:0,class:"container-md"},Pu={class:"d-flex align-items-center"},Cu={CLASS:"text-muted"},Du={class:"d-flex align-items-center gap-3"},Ou={class:"mb-0 display-4"},Au={class:"card rounded-3 bg-transparent shadow-sm ms-auto"},Tu={class:"card-body py-2 d-flex align-items-center"},Lu={class:"mb-0 text-muted"},Iu={class:"form-check form-switch ms-auto"},Ru=["for"],Eu={key:4,class:"spinner-border spinner-border-sm ms-2","aria-hidden":"true"},Fu=["disabled","id"],zu={class:"row mt-3 gy-2 gx-2 mb-2"},Bu={class:"col-12 col-lg-3"},$u={class:"card rounded-3 bg-transparent shadow-sm"},Nu={class:"card-body py-2"},Hu={class:"mb-0 text-muted"},Wu={class:"col-12 col-lg-3"},Vu={class:"card rounded-3 bg-transparent shadow-sm"},ju={class:"card-body py-2"},Uu={class:"mb-0 text-muted"},Yu={style:{"word-break":"break-all"},class:"col-12 col-lg-6"},Ku={class:"card rounded-3 bg-transparent shadow-sm"},Xu={class:"card-body py-2"},Gu={class:"mb-0 text-muted"},Ju={class:"row gx-2 gy-2 mb-2"},qu={class:"col-12 col-lg-3"},Qu={class:"card rounded-3 bg-transparent shadow-sm"},Zu={class:"card-body d-flex"},tf={class:"mb-0 text-muted"},ef={class:"h4"},sf={class:"col-12 col-lg-3"},nf={class:"card rounded-3 bg-transparent shadow-sm"},of={class:"card-body d-flex"},rf={class:"mb-0 text-muted"},af={class:"h4"},lf={class:"col-12 col-lg-3"},cf={class:"card rounded-3 bg-transparent shadow-sm"},hf={class:"card-body d-flex"},df={class:"mb-0 text-muted"},uf={class:"h4 text-primary"},ff={class:"col-12 col-lg-3"},gf={class:"card rounded-3 bg-transparent shadow-sm"},pf={class:"card-body d-flex"},mf={class:"mb-0 text-muted"},bf={class:"h4 text-success"},_f={class:"row gx-2 gy-2 mb-3"},xf={class:"col-12 col-lg-6"},yf={class:"card rounded-3 bg-transparent shadow-sm",style:{height:"270px"}},vf={class:"card-header bg-transparent border-0"},Sf={class:"text-muted"},wf={class:"card-body pt-1"},kf={class:"col-sm col-lg-3"},Mf={class:"card rounded-3 bg-transparent shadow-sm",style:{height:"270px"}},Pf={class:"card-header bg-transparent border-0"},Cf={class:"text-muted"},Df={class:"card-body pt-1"},Of={class:"col-sm col-lg-3"},Af={class:"card rounded-3 bg-transparent shadow-sm",style:{height:"270px"}},Tf={class:"card-header bg-transparent border-0"},Lf={class:"text-muted"},If={class:"card-body pt-1"},Rf={class:"mb-3"};function Ef(s,t,e,i,n,o){const r=W("LocaleText"),a=W("Bar"),l=W("Line"),c=W("PeerSearch"),h=W("Peer"),d=W("PeerSettings"),u=W("PeerQRCode"),f=W("PeerJobs"),g=W("PeerJobsAllModal"),m=W("PeerJobsLogsModal"),b=W("PeerShareLinkModal"),_=W("EditConfiguration"),y=W("SelectPeers"),S=W("DeleteConfiguration"),M=W("ConfigurationBackupRestore"),v=W("PeerConfigurationFile");return this.loading?V("",!0):(D(),$("div",Mu,[p("div",Pu,[p("div",null,[p("small",Cu,[P(r,{t:"CONFIGURATION"})]),p("div",Du,[p("h1",Ou,[p("samp",null,K(this.configurationInfo.Name),1)])])]),p("div",Au,[p("div",Tu,[p("div",null,[p("p",Lu,[p("small",null,[P(r,{t:"Status"})])]),p("div",Iu,[p("label",{class:"form-check-label",style:{cursor:"pointer"},for:"switch"+this.configurationInfo.id},[!this.configurationInfo.Status&&this.configurationToggling?(D(),H(r,{key:0,t:"Turning Off..."})):this.configurationInfo.Status&&this.configurationToggling?(D(),H(r,{key:1,t:"Turning On..."})):this.configurationInfo.Status&&!this.configurationToggling?(D(),H(r,{key:2,t:"On"})):!this.configurationInfo.Status&&!this.configurationToggling?(D(),H(r,{key:3,t:"Off"})):V("",!0),this.configurationToggling?(D(),$("span",Eu)):V("",!0)],8,Ru),On(p("input",{class:"form-check-input",style:{cursor:"pointer"},disabled:this.configurationToggling,type:"checkbox",role:"switch",id:"switch"+this.configurationInfo.id,onChange:t[0]||(t[0]=x=>this.toggle()),"onUpdate:modelValue":t[1]||(t[1]=x=>this.configurationInfo.Status=x)},null,40,Fu),[[Xo,this.configurationInfo.Status]])])]),p("div",{class:Vt(["dot ms-5",{active:this.configurationInfo.Status}])},null,2)])])]),t[33]||(t[33]=p("hr",null,null,-1)),p("div",zu,[p("div",Bu,[p("div",$u,[p("div",Nu,[p("p",Hu,[p("small",null,[P(r,{t:"Address"})])]),Wt(" "+K(this.configurationInfo.Address),1)])])]),p("div",Wu,[p("div",Vu,[p("div",ju,[p("p",Uu,[p("small",null,[P(r,{t:"Listen Port"})])]),Wt(" "+K(this.configurationInfo.ListenPort),1)])])]),p("div",Yu,[p("div",Ku,[p("div",Xu,[p("p",Gu,[p("small",null,[P(r,{t:"Public Key"})])]),p("samp",null,K(this.configurationInfo.PublicKey),1)])])])]),p("div",Ju,[p("div",qu,[p("div",Qu,[p("div",Zu,[p("div",null,[p("p",tf,[p("small",null,[P(r,{t:"Connected Peers"})])]),p("strong",ef,K(o.configurationSummary.connectedPeers)+" / "+K(n.configurationPeers.length),1)]),t[29]||(t[29]=p("i",{class:"bi bi-ethernet ms-auto h2 text-muted"},null,-1))])])]),p("div",sf,[p("div",nf,[p("div",of,[p("div",null,[p("p",rf,[p("small",null,[P(r,{t:"Total Usage"})])]),p("strong",af,K(o.configurationSummary.totalUsage)+" GB",1)]),t[30]||(t[30]=p("i",{class:"bi bi-arrow-down-up ms-auto h2 text-muted"},null,-1))])])]),p("div",lf,[p("div",cf,[p("div",hf,[p("div",null,[p("p",df,[p("small",null,[P(r,{t:"Total Received"})])]),p("strong",uf,K(o.configurationSummary.totalReceive)+" GB",1)]),t[31]||(t[31]=p("i",{class:"bi bi-arrow-down ms-auto h2 text-muted"},null,-1))])])]),p("div",ff,[p("div",gf,[p("div",pf,[p("div",null,[p("p",mf,[p("small",null,[P(r,{t:"Total Sent"})])]),p("strong",bf,K(o.configurationSummary.totalSent)+" GB",1)]),t[32]||(t[32]=p("i",{class:"bi bi-arrow-up ms-auto h2 text-muted"},null,-1))])])])]),p("div",_f,[p("div",xf,[p("div",yf,[p("div",vf,[p("small",Sf,[P(r,{t:"Peers Data Usage"})])]),p("div",wf,[P(a,{data:o.individualDataUsage,options:o.individualDataUsageChartOption,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["data","options"])])])]),p("div",kf,[p("div",Mf,[p("div",Pf,[p("small",Cf,[P(r,{t:"Real Time Received Data Usage"})])]),p("div",Df,[P(l,{options:o.chartOptions,data:o.receiveData,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])]),p("div",Of,[p("div",Af,[p("div",Tf,[p("small",Lf,[P(r,{t:"Real Time Sent Data Usage"})])]),p("div",If,[P(l,{options:o.chartOptions,data:o.sentData,style:{width:"100%",height:"200px","max-height":"200px"}},null,8,["options","data"])])])])]),p("div",Rf,[P(c,{onJobsAll:t[2]||(t[2]=x=>this.peerScheduleJobsAll.modalOpen=!0),onJobLogs:t[3]||(t[3]=x=>this.peerScheduleJobsLogs.modalOpen=!0),onEditConfiguration:t[4]||(t[4]=x=>this.editConfiguration.modalOpen=!0),onSelectPeers:t[5]||(t[5]=x=>this.selectPeers.modalOpen=!0),onBackupRestore:t[6]||(t[6]=x=>this.backupRestore.modalOpen=!0),onDeleteConfiguration:t[7]||(t[7]=x=>this.deleteConfiguration.modalOpen=!0),configuration:this.configurationInfo},null,8,["configuration"]),P(Go,{name:"list",tag:"div",class:"row gx-2 gy-2 z-0"},{default:G(()=>[(D(!0),$(qt,null,ks(this.searchPeers,x=>(D(),$("div",{class:"col-12 col-lg-6 col-xl-4",key:x.id},[P(h,{Peer:x,onShare:w=>{this.peerShare.selectedPeer=x.id,this.peerShare.modalOpen=!0},onRefresh:t[8]||(t[8]=w=>this.getPeers()),onJobs:w=>{n.peerScheduleJobs.modalOpen=!0,n.peerScheduleJobs.selectedPeer=this.configurationPeers.find(k=>k.id===x.id)},onSetting:w=>{n.peerSetting.modalOpen=!0,n.peerSetting.selectedPeer=this.configurationPeers.find(k=>k.id===x.id)},onQrcode:t[9]||(t[9]=w=>{this.peerQRCode.peerConfigData=w,this.peerQRCode.modalOpen=!0}),onConfigurationFile:t[10]||(t[10]=w=>{this.peerConfigurationFile.peerConfigData=w,this.peerConfigurationFile.modalOpen=!0})},null,8,["Peer","onShare","onJobs","onSetting"])]))),128))]),_:1})]),P(tt,{name:"zoom"},{default:G(()=>[this.peerSetting.modalOpen?(D(),H(d,{key:"settings",selectedPeer:this.peerSetting.selectedPeer,onRefresh:t[11]||(t[11]=x=>this.getPeers()),onClose:t[12]||(t[12]=x=>this.peerSetting.modalOpen=!1)},null,8,["selectedPeer"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[n.peerQRCode.modalOpen?(D(),H(u,{peerConfigData:this.peerQRCode.peerConfigData,key:"qrcode",onClose:t[13]||(t[13]=x=>this.peerQRCode.modalOpen=!1)},null,8,["peerConfigData"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.peerScheduleJobs.modalOpen?(D(),H(f,{key:0,onRefresh:t[14]||(t[14]=x=>this.getPeers()),selectedPeer:this.peerScheduleJobs.selectedPeer,onClose:t[15]||(t[15]=x=>this.peerScheduleJobs.modalOpen=!1)},null,8,["selectedPeer"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.peerScheduleJobsAll.modalOpen?(D(),H(g,{key:0,onRefresh:t[16]||(t[16]=x=>this.getPeers()),onClose:t[17]||(t[17]=x=>this.peerScheduleJobsAll.modalOpen=!1),configurationPeers:this.configurationPeers},null,8,["configurationPeers"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.peerScheduleJobsLogs.modalOpen?(D(),H(m,{key:0,onClose:t[18]||(t[18]=x=>this.peerScheduleJobsLogs.modalOpen=!1),configurationInfo:this.configurationInfo},null,8,["configurationInfo"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.peerShare.modalOpen?(D(),H(b,{key:0,onClose:t[19]||(t[19]=x=>{this.peerShare.modalOpen=!1,this.peerShare.selectedPeer=void 0}),peer:this.configurationPeers.find(x=>x.id===this.peerShare.selectedPeer)},null,8,["peer"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.editConfiguration.modalOpen?(D(),H(_,{key:0,onClose:t[20]||(t[20]=x=>this.editConfiguration.modalOpen=!1),onDataChanged:t[21]||(t[21]=x=>this.configurationInfo=x),configurationInfo:this.configurationInfo},null,8,["configurationInfo"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[this.selectPeers.modalOpen?(D(),H(y,{key:0,onRefresh:t[22]||(t[22]=x=>this.getPeers()),configurationPeers:this.configurationPeers,onClose:t[23]||(t[23]=x=>this.selectPeers.modalOpen=!1)},null,8,["configurationPeers"])):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[n.deleteConfiguration.modalOpen?(D(),H(S,{key:0,onBackup:t[24]||(t[24]=x=>n.backupRestore.modalOpen=!0),onClose:t[25]||(t[25]=x=>n.deleteConfiguration.modalOpen=!1)})):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[n.backupRestore.modalOpen?(D(),H(M,{key:0,onClose:t[26]||(t[26]=x=>n.backupRestore.modalOpen=!1),onRefreshPeersList:t[27]||(t[27]=x=>this.getPeers())})):V("",!0)]),_:1}),P(tt,{name:"zoom"},{default:G(()=>[n.peerConfigurationFile.modalOpen?(D(),H(v,{key:0,onClose:t[28]||(t[28]=x=>n.peerConfigurationFile.modalOpen=!1),configurationFile:n.peerConfigurationFile.peerConfigData},null,8,["configurationFile"])):V("",!0)]),_:1})]))}const Wf=rs(ku,[["render",Ef],["__scopeId","data-v-16505bc9"]]);export{Wf as default}; diff --git a/src/static/app/dist/assets/peerQRCode-BbWkgVDW.js b/src/static/app/dist/assets/peerQRCode-DEHFJvZX.js similarity index 88% rename from src/static/app/dist/assets/peerQRCode-BbWkgVDW.js rename to src/static/app/dist/assets/peerQRCode-DEHFJvZX.js index a89ed3f..0e2f5bb 100644 --- a/src/static/app/dist/assets/peerQRCode-BbWkgVDW.js +++ b/src/static/app/dist/assets/peerQRCode-DEHFJvZX.js @@ -1 +1 @@ -import{b as a}from"./browser-CjSdxGTc.js";import{L as n}from"./localeText-DX813vQA.js";import{_ as c,j as r,a as d,c as i,b as e,d as l}from"./index-BPNEscAR.js";const p={name:"peerQRCode",components:{LocaleText:n},props:{peerConfigData:String},mounted(){a.toCanvas(document.querySelector("#qrcode"),this.peerConfigData,o=>{o&&console.error(o)})}},_={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0"},m={class:"container d-flex h-100 w-100"},h={class:"m-auto modal-dialog-centered dashboardModal justify-content-center"},u={class:"card rounded-3 shadow"},f={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},b={class:"mb-0"},v={class:"card-body"},C={id:"qrcode",class:"rounded-3 shadow",ref:"qrcode"};function g(o,t,x,$,w,q){const s=r("LocaleText");return d(),i("div",_,[e("div",m,[e("div",h,[e("div",u,[e("div",f,[e("h4",b,[l(s,{t:"QR Code"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=y=>this.$emit("close"))})]),e("div",v,[e("canvas",C,null,512)])])])])])}const Q=c(p,[["render",g]]);export{Q as default}; +import{b as a}from"./browser-CjSdxGTc.js";import{L as n}from"./localeText-CaAXeE0W.js";import{_ as c,j as r,a as d,c as i,b as e,d as l}from"./index-DOaPWS1X.js";const p={name:"peerQRCode",components:{LocaleText:n},props:{peerConfigData:String},mounted(){a.toCanvas(document.querySelector("#qrcode"),this.peerConfigData,o=>{o&&console.error(o)})}},_={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0"},m={class:"container d-flex h-100 w-100"},h={class:"m-auto modal-dialog-centered dashboardModal justify-content-center"},u={class:"card rounded-3 shadow"},f={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},b={class:"mb-0"},v={class:"card-body"},C={id:"qrcode",class:"rounded-3 shadow",ref:"qrcode"};function g(o,t,x,$,w,q){const s=r("LocaleText");return d(),i("div",_,[e("div",m,[e("div",h,[e("div",u,[e("div",f,[e("h4",b,[l(s,{t:"QR Code"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=y=>this.$emit("close"))})]),e("div",v,[e("canvas",C,null,512)])])])])])}const Q=c(p,[["render",g]]);export{Q as default}; diff --git a/src/static/app/dist/assets/peerSettings-BNzBnZYL.js b/src/static/app/dist/assets/peerSettings-Bgrsto1V.js similarity index 98% rename from src/static/app/dist/assets/peerSettings-BNzBnZYL.js rename to src/static/app/dist/assets/peerSettings-Bgrsto1V.js index b3d01e4..c614538 100644 --- a/src/static/app/dist/assets/peerSettings-BNzBnZYL.js +++ b/src/static/app/dist/assets/peerSettings-Bgrsto1V.js @@ -1 +1 @@ -import{_ as u,D as c,q as n,j as m,a as r,c as p,b as e,d as a,t as b,m as i,s as d,n as h,X as _,e as f}from"./index-BPNEscAR.js";import{L as g}from"./localeText-DX813vQA.js";const v={name:"peerSettings",components:{LocaleText:g},props:{selectedPeer:Object},data(){return{data:void 0,dataChanged:!1,showKey:!1,saving:!1}},setup(){return{dashboardConfigurationStore:c()}},methods:{reset(){this.selectedPeer&&(this.data=JSON.parse(JSON.stringify(this.selectedPeer)),this.dataChanged=!1)},savePeer(){this.saving=!0,n(`/api/updatePeerSettings/${this.$route.params.id}`,this.data,l=>{this.saving=!1,l.status?this.dashboardConfigurationStore.newMessage("Server","Peer saved","success"):this.dashboardConfigurationStore.newMessage("Server",l.message,"danger"),this.$emit("refresh")})},resetPeerData(l){this.saving=!0,n(`/api/resetPeerData/${this.$route.params.id}`,{id:this.data.id,type:l},t=>{this.saving=!1,t.status?this.dashboardConfigurationStore.newMessage("Server","Peer data usage reset successfully","success"):this.dashboardConfigurationStore.newMessage("Server",t.message,"danger"),this.$emit("refresh")})}},beforeMount(){this.reset()},mounted(){this.$el.querySelectorAll("input").forEach(l=>{l.addEventListener("keyup",()=>{this.dataChanged=!0})})}},x={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},y={class:"container d-flex h-100 w-100"},w={class:"m-auto modal-dialog-centered dashboardModal"},S={class:"card rounded-3 shadow flex-grow-1"},k={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},C={class:"mb-0"},P={key:0,class:"card-body px-4 pb-4"},$={class:"d-flex flex-column gap-2 mb-4"},D={class:"d-flex align-items-center"},N={class:"text-muted"},V={class:"ms-auto"},K={for:"peer_name_textbox",class:"form-label"},U={class:"text-muted"},M=["disabled"],A={class:"d-flex position-relative"},O={for:"peer_private_key_textbox",class:"form-label"},R={class:"text-muted"},T=["type","disabled"],q={for:"peer_allowed_ip_textbox",class:"form-label"},L={class:"text-muted"},E=["disabled"],B={for:"peer_endpoint_allowed_ips",class:"form-label"},I={class:"text-muted"},j=["disabled"],J={for:"peer_DNS_textbox",class:"form-label"},z={class:"text-muted"},Q=["disabled"],X={class:"accordion mt-3",id:"peerSettingsAccordion"},F={class:"accordion-item"},G={class:"accordion-header"},H={class:"accordion-button rounded-3 collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#peerSettingsAccordionOptional"},W={id:"peerSettingsAccordionOptional",class:"accordion-collapse collapse","data-bs-parent":"#peerSettingsAccordion"},Y={class:"accordion-body d-flex flex-column gap-2 mb-2"},Z={for:"peer_preshared_key_textbox",class:"form-label"},ee={class:"text-muted"},te=["disabled"],se={for:"peer_mtu",class:"form-label"},oe={class:"text-muted"},ae=["disabled"],le={for:"peer_keep_alive",class:"form-label"},ie={class:"text-muted"},de=["disabled"],ne={class:"d-flex gap-2 align-items-center"},re={class:"d-flex gap-2 ms-auto"},pe={class:"d-flex align-items-center gap-2"},ue=["disabled"],ce=["disabled"];function me(l,t,be,he,_e,fe){const o=m("LocaleText");return r(),p("div",x,[e("div",y,[e("div",w,[e("div",S,[e("div",k,[e("h4",C,[a(o,{t:"Peer Settings"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=s=>this.$emit("close"))})]),this.data?(r(),p("div",P,[e("div",$,[e("div",D,[e("small",N,[a(o,{t:"Public Key"})]),e("small",V,[e("samp",null,b(this.data.id),1)])]),e("div",null,[e("label",K,[e("small",U,[a(o,{t:"Name"})])]),i(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[1]||(t[1]=s=>this.data.name=s),id:"peer_name_textbox",placeholder:""},null,8,M),[[d,this.data.name]])]),e("div",null,[e("div",A,[e("label",O,[e("small",R,[a(o,{t:"Private Key"}),e("code",null,[a(o,{t:"(Required for QR Code and Download)"})])])]),e("a",{role:"button",class:"ms-auto text-decoration-none toggleShowKey",onClick:t[2]||(t[2]=s=>this.showKey=!this.showKey)},[e("i",{class:h(["bi",[this.showKey?"bi-eye-slash-fill":"bi-eye-fill"]])},null,2)])]),i(e("input",{type:[this.showKey?"text":"password"],class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[3]||(t[3]=s=>this.data.private_key=s),id:"peer_private_key_textbox",style:{"padding-right":"40px"}},null,8,T),[[_,this.data.private_key]])]),e("div",null,[e("label",q,[e("small",L,[a(o,{t:"Allowed IPs"}),e("code",null,[a(o,{t:"(Required)"})])])]),i(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[4]||(t[4]=s=>this.data.allowed_ip=s),id:"peer_allowed_ip_textbox"},null,8,E),[[d,this.data.allowed_ip]])]),e("div",null,[e("label",B,[e("small",I,[a(o,{t:"Endpoint Allowed IPs"}),e("code",null,[a(o,{t:"(Required)"})])])]),i(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[5]||(t[5]=s=>this.data.endpoint_allowed_ip=s),id:"peer_endpoint_allowed_ips"},null,8,j),[[d,this.data.endpoint_allowed_ip]])]),e("div",null,[e("label",J,[e("small",z,[a(o,{t:"DNS"})])]),i(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[6]||(t[6]=s=>this.data.DNS=s),id:"peer_DNS_textbox"},null,8,Q),[[d,this.data.DNS]])]),e("div",X,[e("div",F,[e("h2",G,[e("button",H,[a(o,{t:"Optional Settings"})])]),e("div",W,[e("div",Y,[e("div",null,[e("label",Z,[e("small",ee,[a(o,{t:"Pre-Shared Key"})])]),i(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[7]||(t[7]=s=>this.data.preshared_key=s),id:"peer_preshared_key_textbox"},null,8,te),[[d,this.data.preshared_key]])]),e("div",null,[e("label",se,[e("small",oe,[a(o,{t:"MTU"})])]),i(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[8]||(t[8]=s=>this.data.mtu=s),id:"peer_mtu"},null,8,ae),[[d,this.data.mtu]])]),e("div",null,[e("label",le,[e("small",ie,[a(o,{t:"Persistent Keepalive"})])]),i(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[9]||(t[9]=s=>this.data.keepalive=s),id:"peer_keep_alive"},null,8,de),[[d,this.data.keepalive]])])])])])]),t[18]||(t[18]=e("hr",null,null,-1)),e("div",ne,[e("strong",null,[a(o,{t:"Reset Data Usage"})]),e("div",re,[e("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:t[10]||(t[10]=s=>this.resetPeerData("total"))},[t[15]||(t[15]=e("i",{class:"bi bi-arrow-down-up me-2"},null,-1)),a(o,{t:"Total"})]),e("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:t[11]||(t[11]=s=>this.resetPeerData("receive"))},[t[16]||(t[16]=e("i",{class:"bi bi-arrow-down me-2"},null,-1)),a(o,{t:"Received"})]),e("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:t[12]||(t[12]=s=>this.resetPeerData("sent"))},[t[17]||(t[17]=e("i",{class:"bi bi-arrow-up me-2"},null,-1)),a(o,{t:"Sent"})])])])]),e("div",pe,[e("button",{class:"btn bg-secondary-subtle border-secondary-subtle text-secondary-emphasis rounded-3 shadow ms-auto px-3 py-2",onClick:t[13]||(t[13]=s=>this.reset()),disabled:!this.dataChanged||this.saving},t[19]||(t[19]=[e("i",{class:"bi bi-arrow-clockwise"},null,-1)]),8,ue),e("button",{class:"btn bg-primary-subtle border-primary-subtle text-primary-emphasis rounded-3 px-3 py-2 shadow",disabled:!this.dataChanged||this.saving,onClick:t[14]||(t[14]=s=>this.savePeer())},t[20]||(t[20]=[e("i",{class:"bi bi-save-fill"},null,-1)]),8,ce)])])):f("",!0)])])])])}const xe=u(v,[["render",me],["__scopeId","data-v-a63ae8cb"]]);export{xe as default}; +import{_ as u,D as c,q as n,j as m,a as r,c as p,b as e,d as a,t as b,m as i,s as d,n as h,X as _,e as f}from"./index-DOaPWS1X.js";import{L as g}from"./localeText-CaAXeE0W.js";const v={name:"peerSettings",components:{LocaleText:g},props:{selectedPeer:Object},data(){return{data:void 0,dataChanged:!1,showKey:!1,saving:!1}},setup(){return{dashboardConfigurationStore:c()}},methods:{reset(){this.selectedPeer&&(this.data=JSON.parse(JSON.stringify(this.selectedPeer)),this.dataChanged=!1)},savePeer(){this.saving=!0,n(`/api/updatePeerSettings/${this.$route.params.id}`,this.data,l=>{this.saving=!1,l.status?this.dashboardConfigurationStore.newMessage("Server","Peer saved","success"):this.dashboardConfigurationStore.newMessage("Server",l.message,"danger"),this.$emit("refresh")})},resetPeerData(l){this.saving=!0,n(`/api/resetPeerData/${this.$route.params.id}`,{id:this.data.id,type:l},t=>{this.saving=!1,t.status?this.dashboardConfigurationStore.newMessage("Server","Peer data usage reset successfully","success"):this.dashboardConfigurationStore.newMessage("Server",t.message,"danger"),this.$emit("refresh")})}},beforeMount(){this.reset()},mounted(){this.$el.querySelectorAll("input").forEach(l=>{l.addEventListener("keyup",()=>{this.dataChanged=!0})})}},x={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},y={class:"container d-flex h-100 w-100"},w={class:"m-auto modal-dialog-centered dashboardModal"},S={class:"card rounded-3 shadow flex-grow-1"},k={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-2"},C={class:"mb-0"},P={key:0,class:"card-body px-4 pb-4"},$={class:"d-flex flex-column gap-2 mb-4"},D={class:"d-flex align-items-center"},N={class:"text-muted"},V={class:"ms-auto"},K={for:"peer_name_textbox",class:"form-label"},U={class:"text-muted"},M=["disabled"],A={class:"d-flex position-relative"},O={for:"peer_private_key_textbox",class:"form-label"},R={class:"text-muted"},T=["type","disabled"],q={for:"peer_allowed_ip_textbox",class:"form-label"},L={class:"text-muted"},E=["disabled"],B={for:"peer_endpoint_allowed_ips",class:"form-label"},I={class:"text-muted"},j=["disabled"],J={for:"peer_DNS_textbox",class:"form-label"},z={class:"text-muted"},Q=["disabled"],X={class:"accordion mt-3",id:"peerSettingsAccordion"},F={class:"accordion-item"},G={class:"accordion-header"},H={class:"accordion-button rounded-3 collapsed",type:"button","data-bs-toggle":"collapse","data-bs-target":"#peerSettingsAccordionOptional"},W={id:"peerSettingsAccordionOptional",class:"accordion-collapse collapse","data-bs-parent":"#peerSettingsAccordion"},Y={class:"accordion-body d-flex flex-column gap-2 mb-2"},Z={for:"peer_preshared_key_textbox",class:"form-label"},ee={class:"text-muted"},te=["disabled"],se={for:"peer_mtu",class:"form-label"},oe={class:"text-muted"},ae=["disabled"],le={for:"peer_keep_alive",class:"form-label"},ie={class:"text-muted"},de=["disabled"],ne={class:"d-flex gap-2 align-items-center"},re={class:"d-flex gap-2 ms-auto"},pe={class:"d-flex align-items-center gap-2"},ue=["disabled"],ce=["disabled"];function me(l,t,be,he,_e,fe){const o=m("LocaleText");return r(),p("div",x,[e("div",y,[e("div",w,[e("div",S,[e("div",k,[e("h4",C,[a(o,{t:"Peer Settings"})]),e("button",{type:"button",class:"btn-close ms-auto",onClick:t[0]||(t[0]=s=>this.$emit("close"))})]),this.data?(r(),p("div",P,[e("div",$,[e("div",D,[e("small",N,[a(o,{t:"Public Key"})]),e("small",V,[e("samp",null,b(this.data.id),1)])]),e("div",null,[e("label",K,[e("small",U,[a(o,{t:"Name"})])]),i(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[1]||(t[1]=s=>this.data.name=s),id:"peer_name_textbox",placeholder:""},null,8,M),[[d,this.data.name]])]),e("div",null,[e("div",A,[e("label",O,[e("small",R,[a(o,{t:"Private Key"}),e("code",null,[a(o,{t:"(Required for QR Code and Download)"})])])]),e("a",{role:"button",class:"ms-auto text-decoration-none toggleShowKey",onClick:t[2]||(t[2]=s=>this.showKey=!this.showKey)},[e("i",{class:h(["bi",[this.showKey?"bi-eye-slash-fill":"bi-eye-fill"]])},null,2)])]),i(e("input",{type:[this.showKey?"text":"password"],class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[3]||(t[3]=s=>this.data.private_key=s),id:"peer_private_key_textbox",style:{"padding-right":"40px"}},null,8,T),[[_,this.data.private_key]])]),e("div",null,[e("label",q,[e("small",L,[a(o,{t:"Allowed IPs"}),e("code",null,[a(o,{t:"(Required)"})])])]),i(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[4]||(t[4]=s=>this.data.allowed_ip=s),id:"peer_allowed_ip_textbox"},null,8,E),[[d,this.data.allowed_ip]])]),e("div",null,[e("label",B,[e("small",I,[a(o,{t:"Endpoint Allowed IPs"}),e("code",null,[a(o,{t:"(Required)"})])])]),i(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[5]||(t[5]=s=>this.data.endpoint_allowed_ip=s),id:"peer_endpoint_allowed_ips"},null,8,j),[[d,this.data.endpoint_allowed_ip]])]),e("div",null,[e("label",J,[e("small",z,[a(o,{t:"DNS"})])]),i(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[6]||(t[6]=s=>this.data.DNS=s),id:"peer_DNS_textbox"},null,8,Q),[[d,this.data.DNS]])]),e("div",X,[e("div",F,[e("h2",G,[e("button",H,[a(o,{t:"Optional Settings"})])]),e("div",W,[e("div",Y,[e("div",null,[e("label",Z,[e("small",ee,[a(o,{t:"Pre-Shared Key"})])]),i(e("input",{type:"text",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[7]||(t[7]=s=>this.data.preshared_key=s),id:"peer_preshared_key_textbox"},null,8,te),[[d,this.data.preshared_key]])]),e("div",null,[e("label",se,[e("small",oe,[a(o,{t:"MTU"})])]),i(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[8]||(t[8]=s=>this.data.mtu=s),id:"peer_mtu"},null,8,ae),[[d,this.data.mtu]])]),e("div",null,[e("label",le,[e("small",ie,[a(o,{t:"Persistent Keepalive"})])]),i(e("input",{type:"number",class:"form-control form-control-sm rounded-3",disabled:this.saving,"onUpdate:modelValue":t[9]||(t[9]=s=>this.data.keepalive=s),id:"peer_keep_alive"},null,8,de),[[d,this.data.keepalive]])])])])])]),t[18]||(t[18]=e("hr",null,null,-1)),e("div",ne,[e("strong",null,[a(o,{t:"Reset Data Usage"})]),e("div",re,[e("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:t[10]||(t[10]=s=>this.resetPeerData("total"))},[t[15]||(t[15]=e("i",{class:"bi bi-arrow-down-up me-2"},null,-1)),a(o,{t:"Total"})]),e("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:t[11]||(t[11]=s=>this.resetPeerData("receive"))},[t[16]||(t[16]=e("i",{class:"bi bi-arrow-down me-2"},null,-1)),a(o,{t:"Received"})]),e("button",{class:"btn bg-primary-subtle text-primary-emphasis rounded-3 flex-grow-1 shadow-sm",onClick:t[12]||(t[12]=s=>this.resetPeerData("sent"))},[t[17]||(t[17]=e("i",{class:"bi bi-arrow-up me-2"},null,-1)),a(o,{t:"Sent"})])])])]),e("div",pe,[e("button",{class:"btn bg-secondary-subtle border-secondary-subtle text-secondary-emphasis rounded-3 shadow ms-auto px-3 py-2",onClick:t[13]||(t[13]=s=>this.reset()),disabled:!this.dataChanged||this.saving},t[19]||(t[19]=[e("i",{class:"bi bi-arrow-clockwise"},null,-1)]),8,ue),e("button",{class:"btn bg-primary-subtle border-primary-subtle text-primary-emphasis rounded-3 px-3 py-2 shadow",disabled:!this.dataChanged||this.saving,onClick:t[14]||(t[14]=s=>this.savePeer())},t[20]||(t[20]=[e("i",{class:"bi bi-save-fill"},null,-1)]),8,ce)])])):f("",!0)])])])])}const xe=u(v,[["render",me],["__scopeId","data-v-a63ae8cb"]]);export{xe as default}; diff --git a/src/static/app/dist/assets/peerShareLinkModal-Bqogws3W.js b/src/static/app/dist/assets/peerShareLinkModal-6b5Bdaqt.js similarity index 95% rename from src/static/app/dist/assets/peerShareLinkModal-Bqogws3W.js rename to src/static/app/dist/assets/peerShareLinkModal-6b5Bdaqt.js index 65f33b8..7897095 100644 --- a/src/static/app/dist/assets/peerShareLinkModal-Bqogws3W.js +++ b/src/static/app/dist/assets/peerShareLinkModal-6b5Bdaqt.js @@ -1 +1 @@ -import{_ as g,D as f,q as h,j as p,a as s,c as r,b as t,d as o,n as m,i as n,t as _,e as b}from"./index-BPNEscAR.js";import{d}from"./dayjs.min-Lw24H7b2.js";import{V as y}from"./vue-datepicker-D9reu0Fg.js";import{L as S}from"./localeText-DX813vQA.js";const k={name:"peerShareLinkModal",props:{peer:Object},components:{LocaleText:S,VueDatePicker:y},data(){return{dataCopy:void 0,loading:!1}},setup(){return{store:f()}},mounted(){this.dataCopy=JSON.parse(JSON.stringify(this.peer.ShareLink)).at(0)},watch:{"peer.ShareLink":{deep:!0,handler(e,a){a.length!==e.length&&(this.dataCopy=JSON.parse(JSON.stringify(this.peer.ShareLink)).at(0))}}},methods:{startSharing(){this.loading=!0,h("/api/sharePeer/create",{Configuration:this.peer.configuration.Name,Peer:this.peer.id,ExpireDate:d().add(7,"d").format("YYYY-MM-DD HH:mm:ss")},e=>{e.status?(this.peer.ShareLink=e.data,this.dataCopy=e.data.at(0)):this.store.newMessage("Server","Share link failed to create. Reason: "+e.message,"danger"),this.loading=!1})},updateLinkExpireDate(){h("/api/sharePeer/update",this.dataCopy,e=>{e.status?(this.dataCopy=e.data.at(0),this.peer.ShareLink=e.data,this.store.newMessage("Server","Link expire date updated","success")):this.store.newMessage("Server","Link expire date failed to update. Reason: "+e.message,"danger"),this.loading=!1})},stopSharing(){this.loading=!0,this.dataCopy.ExpireDate=d().format("YYYY-MM-DD HH:mm:ss"),this.updateLinkExpireDate()},parseTime(e){e?this.dataCopy.ExpireDate=d(e).format("YYYY-MM-DD HH:mm:ss"):this.dataCopy.ExpireDate=void 0,this.updateLinkExpireDate()}},computed:{getUrl(){const e=this.store.getActiveCrossServer();return e?`${e.host}/${this.$router.resolve({path:"/share",query:{ShareID:this.dataCopy.ShareID}}).href}`:window.location.origin+window.location.pathname+this.$router.resolve({path:"/share",query:{ShareID:this.dataCopy.ShareID}}).href}}},x={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},v={class:"container d-flex h-100 w-100"},C={class:"m-auto modal-dialog-centered dashboardModal",style:{width:"500px"}},D={class:"card rounded-3 shadow flex-grow-1"},w={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4"},L={class:"mb-0"},M={key:0,class:"card-body px-4 pb-4"},Y={key:0},$={class:"mb-3 text-muted"},E=["disabled"],H={key:1},V={class:"d-flex gap-2 mb-4"},N=["href"],P={class:"d-flex flex-column gap-2 mb-3"},O=["disabled"];function T(e,a,U,B,I,c){const i=p("LocaleText"),u=p("VueDatePicker");return s(),r("div",x,[t("div",v,[t("div",C,[t("div",D,[t("div",w,[t("h4",L,[o(i,{t:"Share Peer"})]),t("button",{type:"button",class:"btn-close ms-auto",onClick:a[0]||(a[0]=l=>this.$emit("close"))})]),this.peer.ShareLink?(s(),r("div",M,[this.dataCopy?(s(),r("div",H,[t("div",V,[a[4]||(a[4]=t("i",{class:"bi bi-link-45deg"},null,-1)),t("a",{href:this.getUrl,class:"text-decoration-none",target:"_blank"},_(c.getUrl),9,N)]),t("div",P,[t("small",null,[a[5]||(a[5]=t("i",{class:"bi bi-calendar me-2"},null,-1)),o(i,{t:"Expire At"})]),o(u,{is24:!0,"min-date":new Date,"model-value":this.dataCopy.ExpireDate,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","dark"])]),t("button",{onClick:a[2]||(a[2]=l=>this.stopSharing()),disabled:this.loading,class:"w-100 btn bg-danger-subtle text-danger-emphasis border-1 border-danger-subtle rounded-3 shadow-sm"},[t("span",{class:m({"animate__animated animate__flash animate__infinite animate__slower":this.loading})},a[6]||(a[6]=[t("i",{class:"bi bi-send-slash-fill me-2"},null,-1)]),2),this.loading?(s(),n(i,{key:0,t:"Stop Sharing..."})):(s(),n(i,{key:1,t:"Stop Sharing"}))],8,O)])):(s(),r("div",Y,[t("h6",$,[o(i,{t:"Currently the peer is not sharing"})]),t("button",{onClick:a[1]||(a[1]=l=>this.startSharing()),disabled:this.loading,class:"w-100 btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm"},[t("span",{class:m({"animate__animated animate__flash animate__infinite animate__slower":this.loading})},a[3]||(a[3]=[t("i",{class:"bi bi-send-fill me-2"},null,-1)]),2),this.loading?(s(),n(i,{key:0,t:"Sharing..."})):(s(),n(i,{key:1,t:"Start Sharing"}))],8,E)]))])):b("",!0)])])])])}const R=g(k,[["render",T]]);export{R as default}; +import{_ as g,D as f,q as h,j as p,a as s,c as r,b as t,d as o,n as m,i as n,t as _,e as b}from"./index-DOaPWS1X.js";import{d}from"./dayjs.min-D8jwq_wn.js";import{V as y}from"./vue-datepicker-D91GxXPq.js";import{L as S}from"./localeText-CaAXeE0W.js";const k={name:"peerShareLinkModal",props:{peer:Object},components:{LocaleText:S,VueDatePicker:y},data(){return{dataCopy:void 0,loading:!1}},setup(){return{store:f()}},mounted(){this.dataCopy=JSON.parse(JSON.stringify(this.peer.ShareLink)).at(0)},watch:{"peer.ShareLink":{deep:!0,handler(e,a){a.length!==e.length&&(this.dataCopy=JSON.parse(JSON.stringify(this.peer.ShareLink)).at(0))}}},methods:{startSharing(){this.loading=!0,h("/api/sharePeer/create",{Configuration:this.peer.configuration.Name,Peer:this.peer.id,ExpireDate:d().add(7,"d").format("YYYY-MM-DD HH:mm:ss")},e=>{e.status?(this.peer.ShareLink=e.data,this.dataCopy=e.data.at(0)):this.store.newMessage("Server","Share link failed to create. Reason: "+e.message,"danger"),this.loading=!1})},updateLinkExpireDate(){h("/api/sharePeer/update",this.dataCopy,e=>{e.status?(this.dataCopy=e.data.at(0),this.peer.ShareLink=e.data,this.store.newMessage("Server","Link expire date updated","success")):this.store.newMessage("Server","Link expire date failed to update. Reason: "+e.message,"danger"),this.loading=!1})},stopSharing(){this.loading=!0,this.dataCopy.ExpireDate=d().format("YYYY-MM-DD HH:mm:ss"),this.updateLinkExpireDate()},parseTime(e){e?this.dataCopy.ExpireDate=d(e).format("YYYY-MM-DD HH:mm:ss"):this.dataCopy.ExpireDate=void 0,this.updateLinkExpireDate()}},computed:{getUrl(){const e=this.store.getActiveCrossServer();return e?`${e.host}/${this.$router.resolve({path:"/share",query:{ShareID:this.dataCopy.ShareID}}).href}`:window.location.origin+window.location.pathname+this.$router.resolve({path:"/share",query:{ShareID:this.dataCopy.ShareID}}).href}}},x={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll"},v={class:"container d-flex h-100 w-100"},C={class:"m-auto modal-dialog-centered dashboardModal",style:{width:"500px"}},D={class:"card rounded-3 shadow flex-grow-1"},w={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4"},L={class:"mb-0"},M={key:0,class:"card-body px-4 pb-4"},Y={key:0},$={class:"mb-3 text-muted"},E=["disabled"],H={key:1},V={class:"d-flex gap-2 mb-4"},N=["href"],P={class:"d-flex flex-column gap-2 mb-3"},O=["disabled"];function T(e,a,U,B,I,c){const i=p("LocaleText"),u=p("VueDatePicker");return s(),r("div",x,[t("div",v,[t("div",C,[t("div",D,[t("div",w,[t("h4",L,[o(i,{t:"Share Peer"})]),t("button",{type:"button",class:"btn-close ms-auto",onClick:a[0]||(a[0]=l=>this.$emit("close"))})]),this.peer.ShareLink?(s(),r("div",M,[this.dataCopy?(s(),r("div",H,[t("div",V,[a[4]||(a[4]=t("i",{class:"bi bi-link-45deg"},null,-1)),t("a",{href:this.getUrl,class:"text-decoration-none",target:"_blank"},_(c.getUrl),9,N)]),t("div",P,[t("small",null,[a[5]||(a[5]=t("i",{class:"bi bi-calendar me-2"},null,-1)),o(i,{t:"Expire At"})]),o(u,{is24:!0,"min-date":new Date,"model-value":this.dataCopy.ExpireDate,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","dark"])]),t("button",{onClick:a[2]||(a[2]=l=>this.stopSharing()),disabled:this.loading,class:"w-100 btn bg-danger-subtle text-danger-emphasis border-1 border-danger-subtle rounded-3 shadow-sm"},[t("span",{class:m({"animate__animated animate__flash animate__infinite animate__slower":this.loading})},a[6]||(a[6]=[t("i",{class:"bi bi-send-slash-fill me-2"},null,-1)]),2),this.loading?(s(),n(i,{key:0,t:"Stop Sharing..."})):(s(),n(i,{key:1,t:"Stop Sharing"}))],8,O)])):(s(),r("div",Y,[t("h6",$,[o(i,{t:"Currently the peer is not sharing"})]),t("button",{onClick:a[1]||(a[1]=l=>this.startSharing()),disabled:this.loading,class:"w-100 btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm"},[t("span",{class:m({"animate__animated animate__flash animate__infinite animate__slower":this.loading})},a[3]||(a[3]=[t("i",{class:"bi bi-send-fill me-2"},null,-1)]),2),this.loading?(s(),n(i,{key:0,t:"Sharing..."})):(s(),n(i,{key:1,t:"Start Sharing"}))],8,E)]))])):b("",!0)])])])])}const R=g(k,[["render",T]]);export{R as default}; diff --git a/src/static/app/dist/assets/ping-DUh82NQw.js b/src/static/app/dist/assets/ping-BB-b6WHn.js similarity index 98% rename from src/static/app/dist/assets/ping-DUh82NQw.js rename to src/static/app/dist/assets/ping-BB-b6WHn.js index 067e75e..e14684a 100644 --- a/src/static/app/dist/assets/ping-DUh82NQw.js +++ b/src/static/app/dist/assets/ping-BB-b6WHn.js @@ -1 +1 @@ -import{_ as R,D as k,g as b,c as l,b as e,d,m as u,y as _,F as c,h as p,e as m,s as I,t as i,w as f,T as v,a as n,f as g,n as h,z as P,i as w,j as x}from"./index-BPNEscAR.js";import{L as C}from"./localeText-DX813vQA.js";import{O as A}from"./osmap-DFqkfaU2.js";const S={name:"ping",components:{OSMap:A,LocaleText:C},data(){return{loading:!1,cips:{},selectedConfiguration:void 0,selectedPeer:void 0,selectedIp:void 0,count:4,pingResult:void 0,pinging:!1}},setup(){return{store:k()}},mounted(){b("/api/ping/getAllPeersIpAddress",{},a=>{a.status&&(this.loading=!0,this.cips=a.data,console.log(this.cips))})},methods:{execute(){this.selectedIp&&(this.pinging=!0,this.pingResult=void 0,b("/api/ping/execute",{ipAddress:this.selectedIp,count:this.count},a=>{a.status?this.pingResult=a.data:this.store.newMessage("Server",a.message,"danger"),this.pinging=!1}))}},watch:{selectedConfiguration(){this.selectedPeer=void 0,this.selectedIp=void 0},selectedPeer(){this.selectedIp=void 0}}},T={class:"mt-md-5 mt-3 text-body"},M={class:"container"},V={class:"row"},$={class:"col-sm-4 d-flex gap-2 flex-column"},L={class:"mb-1 text-muted",for:"configuration"},N=["disabled"],O=["value"],B={class:"mb-1 text-muted",for:"peer"},D=["disabled"],U=["value"],z={class:"mb-1 text-muted",for:"ip"},E=["disabled"],F={class:"d-flex align-items-center gap-2"},G={class:"text-muted"},j={class:"mb-1 text-muted",for:"ipAddress"},H=["disabled"],Y={class:"mb-1 text-muted",for:"count"},q={class:"d-flex gap-3 align-items-center"},J=["disabled"],K=["disabled"],Q={key:0,class:"d-block"},W={key:1,class:"d-block"},X={class:"col-sm-8 position-relative"},Z={key:"pingPlaceholder"},ee={key:"pingResult",class:"d-flex flex-column gap-2 w-100"},se={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.15s"}},te={class:"card-body row"},ie={class:"col-sm"},ne={class:"mb-0 text-muted"},le={key:0,class:"col-sm"},de={class:"mb-0 text-muted"},oe={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.3s"}},ae={class:"card-body"},re={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.45s"}},ue={class:"card-body"},ce={class:"mb-0 text-muted"},pe={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.6s"}},me={class:"card-body"},ge={class:"mb-0 text-muted"};function _e(a,s,he,be,fe,ve){const o=x("LocaleText"),y=x("OSMap");return n(),l("div",T,[e("div",M,[s[19]||(s[19]=e("h3",{class:"mb-3 text-body"},"Ping",-1)),e("div",V,[e("div",$,[e("div",null,[e("label",L,[e("small",null,[d(o,{t:"Configuration"})])]),u(e("select",{class:"form-select","onUpdate:modelValue":s[0]||(s[0]=t=>this.selectedConfiguration=t),disabled:this.pinging},[s[7]||(s[7]=e("option",{disabled:"",selected:"",value:void 0},null,-1)),(n(!0),l(c,null,p(this.cips,(t,r)=>(n(),l("option",{value:r},i(r),9,O))),256))],8,N),[[_,this.selectedConfiguration]])]),e("div",null,[e("label",B,[e("small",null,[d(o,{t:"Peer"})])]),u(e("select",{id:"peer",class:"form-select","onUpdate:modelValue":s[1]||(s[1]=t=>this.selectedPeer=t),disabled:this.selectedConfiguration===void 0||this.pinging},[s[8]||(s[8]=e("option",{disabled:"",selected:"",value:void 0},null,-1)),this.selectedConfiguration!==void 0?(n(!0),l(c,{key:0},p(this.cips[this.selectedConfiguration],(t,r)=>(n(),l("option",{value:r},i(r),9,U))),256)):m("",!0)],8,D),[[_,this.selectedPeer]])]),e("div",null,[e("label",z,[e("small",null,[d(o,{t:"IP Address"})])]),u(e("select",{id:"ip",class:"form-select","onUpdate:modelValue":s[2]||(s[2]=t=>this.selectedIp=t),disabled:this.selectedPeer===void 0||this.pinging},[s[9]||(s[9]=e("option",{disabled:"",selected:"",value:void 0},null,-1)),this.selectedPeer!==void 0?(n(!0),l(c,{key:0},p(this.cips[this.selectedConfiguration][this.selectedPeer].allowed_ips,t=>(n(),l("option",null,i(t),1))),256)):m("",!0)],8,E),[[_,this.selectedIp]])]),e("div",F,[s[10]||(s[10]=e("div",{class:"flex-grow-1 border-top"},null,-1)),e("small",G,[d(o,{t:"OR"})]),s[11]||(s[11]=e("div",{class:"flex-grow-1 border-top"},null,-1))]),e("div",null,[e("label",j,[e("small",null,[d(o,{t:"Enter IP Address / Hostname"})])]),u(e("input",{class:"form-control",type:"text",id:"ipAddress",disabled:this.pinging,"onUpdate:modelValue":s[3]||(s[3]=t=>this.selectedIp=t)},null,8,H),[[I,this.selectedIp]])]),s[16]||(s[16]=e("div",{class:"w-100 border-top my-2"},null,-1)),e("div",null,[e("label",Y,[e("small",null,[d(o,{t:"Count"})])]),e("div",q,[e("button",{onClick:s[4]||(s[4]=t=>this.count--),disabled:this.count===1,class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis"},s[12]||(s[12]=[e("i",{class:"bi bi-dash-lg"},null,-1)]),8,J),e("strong",null,i(this.count),1),e("button",{role:"button",onClick:s[5]||(s[5]=t=>this.count++),class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis"},s[13]||(s[13]=[e("i",{class:"bi bi-plus-lg"},null,-1)]))])]),e("button",{class:"btn btn-primary rounded-3 mt-3 position-relative",disabled:!this.selectedIp||this.pinging,onClick:s[6]||(s[6]=t=>this.execute())},[d(v,{name:"slide"},{default:f(()=>[this.pinging?(n(),l("span",W,s[15]||(s[15]=[e("span",{class:"spinner-border spinner-border-sm","aria-hidden":"true"},null,-1),e("span",{class:"visually-hidden",role:"status"},"Loading...",-1)]))):(n(),l("span",Q,s[14]||(s[14]=[e("i",{class:"bi bi-person-walking me-2"},null,-1),g("Ping! ")])))]),_:1})],8,K)]),e("div",X,[d(v,{name:"ping"},{default:f(()=>[this.pingResult?(n(),l("div",ee,[this.pingResult.geo&&this.pingResult.geo.status==="success"?(n(),w(y,{key:0,d:this.pingResult},null,8,["d"])):m("",!0),e("div",se,[e("div",te,[e("div",ie,[e("p",ne,[e("small",null,[d(o,{t:"IP Address"})])]),g(" "+i(this.pingResult.address),1)]),this.pingResult.geo&&this.pingResult.geo.status==="success"?(n(),l("div",le,[e("p",de,[e("small",null,[d(o,{t:"Geolocation"})])]),g(" "+i(this.pingResult.geo.city)+", "+i(this.pingResult.geo.country),1)])):m("",!0)])]),e("div",oe,[e("div",ae,[s[18]||(s[18]=e("p",{class:"mb-0 text-muted"},[e("small",null,"Is Alive")],-1)),e("span",{class:h([this.pingResult.is_alive?"text-success":"text-danger"])},[e("i",{class:h(["bi me-1",[this.pingResult.is_alive?"bi-check-circle-fill":"bi-x-circle-fill"]])},null,2),g(" "+i(this.pingResult.is_alive?"Yes":"No"),1)],2)])]),e("div",re,[e("div",ue,[e("p",ce,[e("small",null,[d(o,{t:"Average / Min / Max Round Trip Time"})])]),e("samp",null,i(this.pingResult.avg_rtt)+"ms / "+i(this.pingResult.min_rtt)+"ms / "+i(this.pingResult.max_rtt)+"ms ",1)])]),e("div",pe,[e("div",me,[e("p",ge,[e("small",null,[d(o,{t:"Sent / Received / Lost Package"})])]),e("samp",null,i(this.pingResult.package_sent)+" / "+i(this.pingResult.package_received)+" / "+i(this.pingResult.package_loss),1)])])])):(n(),l("div",Z,[s[17]||(s[17]=e("div",{class:"pingPlaceholder bg-body-secondary rounded-3 mb-3",style:{height:"300px"}},null,-1)),(n(),l(c,null,p(4,t=>e("div",{class:h(["pingPlaceholder bg-body-secondary rounded-3 mb-3",{"animate__animated animate__flash animate__slower animate__infinite":this.pinging}]),style:P({"animation-delay":`${t*.15}s`})},null,6)),64))]))]),_:1})])])])])}const ke=R(S,[["render",_e],["__scopeId","data-v-a08ce97e"]]);export{ke as default}; +import{_ as R,D as k,g as b,c as l,b as e,d,m as u,y as _,F as c,h as p,e as m,s as I,t as i,w as f,T as v,a as n,f as g,n as h,z as P,i as w,j as x}from"./index-DOaPWS1X.js";import{L as C}from"./localeText-CaAXeE0W.js";import{O as A}from"./osmap-BRB1j1wE.js";const S={name:"ping",components:{OSMap:A,LocaleText:C},data(){return{loading:!1,cips:{},selectedConfiguration:void 0,selectedPeer:void 0,selectedIp:void 0,count:4,pingResult:void 0,pinging:!1}},setup(){return{store:k()}},mounted(){b("/api/ping/getAllPeersIpAddress",{},a=>{a.status&&(this.loading=!0,this.cips=a.data,console.log(this.cips))})},methods:{execute(){this.selectedIp&&(this.pinging=!0,this.pingResult=void 0,b("/api/ping/execute",{ipAddress:this.selectedIp,count:this.count},a=>{a.status?this.pingResult=a.data:this.store.newMessage("Server",a.message,"danger"),this.pinging=!1}))}},watch:{selectedConfiguration(){this.selectedPeer=void 0,this.selectedIp=void 0},selectedPeer(){this.selectedIp=void 0}}},T={class:"mt-md-5 mt-3 text-body"},M={class:"container"},V={class:"row"},$={class:"col-sm-4 d-flex gap-2 flex-column"},L={class:"mb-1 text-muted",for:"configuration"},N=["disabled"],O=["value"],B={class:"mb-1 text-muted",for:"peer"},D=["disabled"],U=["value"],z={class:"mb-1 text-muted",for:"ip"},E=["disabled"],F={class:"d-flex align-items-center gap-2"},G={class:"text-muted"},j={class:"mb-1 text-muted",for:"ipAddress"},H=["disabled"],Y={class:"mb-1 text-muted",for:"count"},q={class:"d-flex gap-3 align-items-center"},J=["disabled"],K=["disabled"],Q={key:0,class:"d-block"},W={key:1,class:"d-block"},X={class:"col-sm-8 position-relative"},Z={key:"pingPlaceholder"},ee={key:"pingResult",class:"d-flex flex-column gap-2 w-100"},se={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.15s"}},te={class:"card-body row"},ie={class:"col-sm"},ne={class:"mb-0 text-muted"},le={key:0,class:"col-sm"},de={class:"mb-0 text-muted"},oe={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.3s"}},ae={class:"card-body"},re={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.45s"}},ue={class:"card-body"},ce={class:"mb-0 text-muted"},pe={class:"card rounded-3 bg-transparent shadow-sm animate__animated animate__fadeIn",style:{"animation-delay":"0.6s"}},me={class:"card-body"},ge={class:"mb-0 text-muted"};function _e(a,s,he,be,fe,ve){const o=x("LocaleText"),y=x("OSMap");return n(),l("div",T,[e("div",M,[s[19]||(s[19]=e("h3",{class:"mb-3 text-body"},"Ping",-1)),e("div",V,[e("div",$,[e("div",null,[e("label",L,[e("small",null,[d(o,{t:"Configuration"})])]),u(e("select",{class:"form-select","onUpdate:modelValue":s[0]||(s[0]=t=>this.selectedConfiguration=t),disabled:this.pinging},[s[7]||(s[7]=e("option",{disabled:"",selected:"",value:void 0},null,-1)),(n(!0),l(c,null,p(this.cips,(t,r)=>(n(),l("option",{value:r},i(r),9,O))),256))],8,N),[[_,this.selectedConfiguration]])]),e("div",null,[e("label",B,[e("small",null,[d(o,{t:"Peer"})])]),u(e("select",{id:"peer",class:"form-select","onUpdate:modelValue":s[1]||(s[1]=t=>this.selectedPeer=t),disabled:this.selectedConfiguration===void 0||this.pinging},[s[8]||(s[8]=e("option",{disabled:"",selected:"",value:void 0},null,-1)),this.selectedConfiguration!==void 0?(n(!0),l(c,{key:0},p(this.cips[this.selectedConfiguration],(t,r)=>(n(),l("option",{value:r},i(r),9,U))),256)):m("",!0)],8,D),[[_,this.selectedPeer]])]),e("div",null,[e("label",z,[e("small",null,[d(o,{t:"IP Address"})])]),u(e("select",{id:"ip",class:"form-select","onUpdate:modelValue":s[2]||(s[2]=t=>this.selectedIp=t),disabled:this.selectedPeer===void 0||this.pinging},[s[9]||(s[9]=e("option",{disabled:"",selected:"",value:void 0},null,-1)),this.selectedPeer!==void 0?(n(!0),l(c,{key:0},p(this.cips[this.selectedConfiguration][this.selectedPeer].allowed_ips,t=>(n(),l("option",null,i(t),1))),256)):m("",!0)],8,E),[[_,this.selectedIp]])]),e("div",F,[s[10]||(s[10]=e("div",{class:"flex-grow-1 border-top"},null,-1)),e("small",G,[d(o,{t:"OR"})]),s[11]||(s[11]=e("div",{class:"flex-grow-1 border-top"},null,-1))]),e("div",null,[e("label",j,[e("small",null,[d(o,{t:"Enter IP Address / Hostname"})])]),u(e("input",{class:"form-control",type:"text",id:"ipAddress",disabled:this.pinging,"onUpdate:modelValue":s[3]||(s[3]=t=>this.selectedIp=t)},null,8,H),[[I,this.selectedIp]])]),s[16]||(s[16]=e("div",{class:"w-100 border-top my-2"},null,-1)),e("div",null,[e("label",Y,[e("small",null,[d(o,{t:"Count"})])]),e("div",q,[e("button",{onClick:s[4]||(s[4]=t=>this.count--),disabled:this.count===1,class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis"},s[12]||(s[12]=[e("i",{class:"bi bi-dash-lg"},null,-1)]),8,J),e("strong",null,i(this.count),1),e("button",{role:"button",onClick:s[5]||(s[5]=t=>this.count++),class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis"},s[13]||(s[13]=[e("i",{class:"bi bi-plus-lg"},null,-1)]))])]),e("button",{class:"btn btn-primary rounded-3 mt-3 position-relative",disabled:!this.selectedIp||this.pinging,onClick:s[6]||(s[6]=t=>this.execute())},[d(v,{name:"slide"},{default:f(()=>[this.pinging?(n(),l("span",W,s[15]||(s[15]=[e("span",{class:"spinner-border spinner-border-sm","aria-hidden":"true"},null,-1),e("span",{class:"visually-hidden",role:"status"},"Loading...",-1)]))):(n(),l("span",Q,s[14]||(s[14]=[e("i",{class:"bi bi-person-walking me-2"},null,-1),g("Ping! ")])))]),_:1})],8,K)]),e("div",X,[d(v,{name:"ping"},{default:f(()=>[this.pingResult?(n(),l("div",ee,[this.pingResult.geo&&this.pingResult.geo.status==="success"?(n(),w(y,{key:0,d:this.pingResult},null,8,["d"])):m("",!0),e("div",se,[e("div",te,[e("div",ie,[e("p",ne,[e("small",null,[d(o,{t:"IP Address"})])]),g(" "+i(this.pingResult.address),1)]),this.pingResult.geo&&this.pingResult.geo.status==="success"?(n(),l("div",le,[e("p",de,[e("small",null,[d(o,{t:"Geolocation"})])]),g(" "+i(this.pingResult.geo.city)+", "+i(this.pingResult.geo.country),1)])):m("",!0)])]),e("div",oe,[e("div",ae,[s[18]||(s[18]=e("p",{class:"mb-0 text-muted"},[e("small",null,"Is Alive")],-1)),e("span",{class:h([this.pingResult.is_alive?"text-success":"text-danger"])},[e("i",{class:h(["bi me-1",[this.pingResult.is_alive?"bi-check-circle-fill":"bi-x-circle-fill"]])},null,2),g(" "+i(this.pingResult.is_alive?"Yes":"No"),1)],2)])]),e("div",re,[e("div",ue,[e("p",ce,[e("small",null,[d(o,{t:"Average / Min / Max Round Trip Time"})])]),e("samp",null,i(this.pingResult.avg_rtt)+"ms / "+i(this.pingResult.min_rtt)+"ms / "+i(this.pingResult.max_rtt)+"ms ",1)])]),e("div",pe,[e("div",me,[e("p",ge,[e("small",null,[d(o,{t:"Sent / Received / Lost Package"})])]),e("samp",null,i(this.pingResult.package_sent)+" / "+i(this.pingResult.package_received)+" / "+i(this.pingResult.package_loss),1)])])])):(n(),l("div",Z,[s[17]||(s[17]=e("div",{class:"pingPlaceholder bg-body-secondary rounded-3 mb-3",style:{height:"300px"}},null,-1)),(n(),l(c,null,p(4,t=>e("div",{class:h(["pingPlaceholder bg-body-secondary rounded-3 mb-3",{"animate__animated animate__flash animate__slower animate__infinite":this.pinging}]),style:P({"animation-delay":`${t*.15}s`})},null,6)),64))]))]),_:1})])])])])}const ke=R(S,[["render",_e],["__scopeId","data-v-a08ce97e"]]);export{ke as default}; diff --git a/src/static/app/dist/assets/restoreConfiguration-N3JQhUVT.js b/src/static/app/dist/assets/restoreConfiguration-DN55Pnc_.js similarity index 99% rename from src/static/app/dist/assets/restoreConfiguration-N3JQhUVT.js rename to src/static/app/dist/assets/restoreConfiguration-DN55Pnc_.js index 40cf237..2899fd9 100644 --- a/src/static/app/dist/assets/restoreConfiguration-N3JQhUVT.js +++ b/src/static/app/dist/assets/restoreConfiguration-DN55Pnc_.js @@ -1,4 +1,4 @@ -import{_ as V,r as C,o as N,a as l,c as r,b as e,t as _,d as n,n as v,F as O,h as T,B as M,i as m,e as P,C as Y,W,x,E as F,D as G,H as z,m as b,s as g,f as $,q as H,g as Z,w as B,T as K,j as J}from"./index-BPNEscAR.js";import{L as o}from"./localeText-DX813vQA.js";import{d as Q}from"./dayjs.min-Lw24H7b2.js";import{p as R}from"./index-L60y6kc9.js";const X={class:"card rounded-3 shadow-sm"},ee={class:"d-flex gap-3 align-items-center"},te={class:"mb-0"},se={class:"text-muted"},oe={key:0,class:"card-footer p-3 d-flex flex-column gap-2"},ne=["onClick","id"],le={class:"card-body d-flex p-3 gap-3 align-items-center"},ae={__name:"backupGroup",props:{configurationName:String,backups:Array,open:!1,selectedConfigurationBackup:Object},emits:["select"],setup(f,{emit:u}){const t=f,k=u,p=C(t.open);return N(()=>{t.selectedConfigurationBackup&&document.querySelector(`#${t.selectedConfigurationBackup.filename.replace(".conf","")}`).scrollIntoView({behavior:"smooth"})}),(y,a)=>(l(),r("div",X,[e("a",{role:"button",class:"card-body d-flex align-items-center text-decoration-none",onClick:a[0]||(a[0]=c=>p.value=!p.value)},[e("div",ee,[e("h6",te,[e("samp",null,_(f.configurationName),1)]),e("small",se,[n(o,{t:f.backups.length+(f.backups.length>1?" Backups":" Backup")},null,8,["t"])])]),e("h5",{class:v(["ms-auto mb-0 dropdownIcon text-muted",{active:p.value}])},a[1]||(a[1]=[e("i",{class:"bi bi-chevron-down"},null,-1)]),2)]),p.value?(l(),r("div",oe,[(l(!0),r(O,null,T(f.backups,c=>(l(),r("div",{class:"card rounded-3 shadow-sm animate__animated",key:c.filename,onClick:()=>{k("select",c)},id:c.filename.replace(".conf",""),role:"button"},[e("div",le,[e("small",null,[a[2]||(a[2]=e("i",{class:"bi bi-file-earmark me-2"},null,-1)),e("samp",null,_(c.filename),1)]),e("small",null,[a[3]||(a[3]=e("i",{class:"bi bi-clock-history me-2"},null,-1)),e("samp",null,_(M(Q)(c.backupDate).format("YYYY-MM-DD HH:mm:ss")),1)]),e("small",null,[a[4]||(a[4]=e("i",{class:"bi bi-database me-2"},null,-1)),c.database?(l(),m(o,{key:0,t:"Yes"})):(l(),m(o,{key:1,t:"No"}))]),a[5]||(a[5]=e("small",{class:"text-muted ms-auto"},[e("i",{class:"bi bi-chevron-right"})],-1))])],8,ne))),128))])):P("",!0)]))}},ie=V(ae,[["__scopeId","data-v-626f1988"]]),de={class:"d-flex flex-column gap-5",id:"confirmBackup"},re={class:"d-flex flex-column gap-3"},ue={class:"d-flex flex-column flex-sm-row align-items-start align-items-sm-center gap-3"},ce={class:"mb-0"},me={class:"text-muted mb-1",for:"ConfigurationName"},fe={class:"invalid-feedback"},pe={key:0},ve={key:1},be={class:"mb-0"},ge={class:"row g-3"},_e={class:"col-sm"},ke={class:"text-muted mb-1",for:"PrivateKey"},ye={class:"input-group"},he={class:"col-sm"},xe={class:"text-muted mb-1",for:"PublicKey"},Ce={class:"text-muted mb-1",for:"ListenPort"},Pe={class:"invalid-feedback"},we={key:0},$e={key:1},Be={class:"mb-0"},Ne={class:"text-muted mb-1 d-flex",for:"ListenPort"},De={class:"invalid-feedback"},Le={key:0},Ue={key:1},Ae={class:"accordion",id:"newConfigurationOptionalAccordion"},Ie={class:"accordion-item"},Se={class:"accordion-header"},Ke={class:"accordion-button collapsed rounded-3",type:"button","data-bs-toggle":"collapse","data-bs-target":"#newConfigurationOptionalAccordionCollapse"},Re={id:"newConfigurationOptionalAccordionCollapse",class:"accordion-collapse collapse","data-bs-parent":"#newConfigurationOptionalAccordion"},Ve={class:"accordion-body d-flex flex-column gap-3"},Oe={class:"text-muted mb-1",for:"PreUp"},Te={class:"text-muted mb-1",for:"PreDown"},qe={class:"text-muted mb-1",for:"PostUp"},Ee={class:"text-muted mb-1",for:"PostDown"},je={class:"d-flex flex-column gap-3"},Me={class:"d-flex flex-column flex-sm-row align-items-start align-items-sm-center gap-3"},Ye={class:"mb-0"},We={key:0},Fe={class:"row g-3"},Ge={class:"col-sm"},ze={class:"card text-bg-success rounded-3"},He={class:"card-body"},Ze={class:"col-sm"},Je={class:"card text-bg-warning rounded-3"},Qe={class:"card-body"},Xe={class:"d-flex"},et=["disabled"],tt={__name:"confirmBackup",props:{selectedConfigurationBackup:Object},setup(f){const u=f,t=Y({ConfigurationName:u.selectedConfigurationBackup.filename.split("_")[0],Backup:u.selectedConfigurationBackup.filename}),k=u.selectedConfigurationBackup.content.split(` +import{_ as V,r as C,o as N,a as l,c as r,b as e,t as _,d as n,n as v,F as O,h as T,B as M,i as m,e as P,C as Y,W,x,E as F,D as G,H as z,m as b,s as g,f as $,q as H,g as Z,w as B,T as K,j as J}from"./index-DOaPWS1X.js";import{L as o}from"./localeText-CaAXeE0W.js";import{d as Q}from"./dayjs.min-D8jwq_wn.js";import{p as R}from"./index-L60y6kc9.js";const X={class:"card rounded-3 shadow-sm"},ee={class:"d-flex gap-3 align-items-center"},te={class:"mb-0"},se={class:"text-muted"},oe={key:0,class:"card-footer p-3 d-flex flex-column gap-2"},ne=["onClick","id"],le={class:"card-body d-flex p-3 gap-3 align-items-center"},ae={__name:"backupGroup",props:{configurationName:String,backups:Array,open:!1,selectedConfigurationBackup:Object},emits:["select"],setup(f,{emit:u}){const t=f,k=u,p=C(t.open);return N(()=>{t.selectedConfigurationBackup&&document.querySelector(`#${t.selectedConfigurationBackup.filename.replace(".conf","")}`).scrollIntoView({behavior:"smooth"})}),(y,a)=>(l(),r("div",X,[e("a",{role:"button",class:"card-body d-flex align-items-center text-decoration-none",onClick:a[0]||(a[0]=c=>p.value=!p.value)},[e("div",ee,[e("h6",te,[e("samp",null,_(f.configurationName),1)]),e("small",se,[n(o,{t:f.backups.length+(f.backups.length>1?" Backups":" Backup")},null,8,["t"])])]),e("h5",{class:v(["ms-auto mb-0 dropdownIcon text-muted",{active:p.value}])},a[1]||(a[1]=[e("i",{class:"bi bi-chevron-down"},null,-1)]),2)]),p.value?(l(),r("div",oe,[(l(!0),r(O,null,T(f.backups,c=>(l(),r("div",{class:"card rounded-3 shadow-sm animate__animated",key:c.filename,onClick:()=>{k("select",c)},id:c.filename.replace(".conf",""),role:"button"},[e("div",le,[e("small",null,[a[2]||(a[2]=e("i",{class:"bi bi-file-earmark me-2"},null,-1)),e("samp",null,_(c.filename),1)]),e("small",null,[a[3]||(a[3]=e("i",{class:"bi bi-clock-history me-2"},null,-1)),e("samp",null,_(M(Q)(c.backupDate).format("YYYY-MM-DD HH:mm:ss")),1)]),e("small",null,[a[4]||(a[4]=e("i",{class:"bi bi-database me-2"},null,-1)),c.database?(l(),m(o,{key:0,t:"Yes"})):(l(),m(o,{key:1,t:"No"}))]),a[5]||(a[5]=e("small",{class:"text-muted ms-auto"},[e("i",{class:"bi bi-chevron-right"})],-1))])],8,ne))),128))])):P("",!0)]))}},ie=V(ae,[["__scopeId","data-v-626f1988"]]),de={class:"d-flex flex-column gap-5",id:"confirmBackup"},re={class:"d-flex flex-column gap-3"},ue={class:"d-flex flex-column flex-sm-row align-items-start align-items-sm-center gap-3"},ce={class:"mb-0"},me={class:"text-muted mb-1",for:"ConfigurationName"},fe={class:"invalid-feedback"},pe={key:0},ve={key:1},be={class:"mb-0"},ge={class:"row g-3"},_e={class:"col-sm"},ke={class:"text-muted mb-1",for:"PrivateKey"},ye={class:"input-group"},he={class:"col-sm"},xe={class:"text-muted mb-1",for:"PublicKey"},Ce={class:"text-muted mb-1",for:"ListenPort"},Pe={class:"invalid-feedback"},we={key:0},$e={key:1},Be={class:"mb-0"},Ne={class:"text-muted mb-1 d-flex",for:"ListenPort"},De={class:"invalid-feedback"},Le={key:0},Ue={key:1},Ae={class:"accordion",id:"newConfigurationOptionalAccordion"},Ie={class:"accordion-item"},Se={class:"accordion-header"},Ke={class:"accordion-button collapsed rounded-3",type:"button","data-bs-toggle":"collapse","data-bs-target":"#newConfigurationOptionalAccordionCollapse"},Re={id:"newConfigurationOptionalAccordionCollapse",class:"accordion-collapse collapse","data-bs-parent":"#newConfigurationOptionalAccordion"},Ve={class:"accordion-body d-flex flex-column gap-3"},Oe={class:"text-muted mb-1",for:"PreUp"},Te={class:"text-muted mb-1",for:"PreDown"},qe={class:"text-muted mb-1",for:"PostUp"},Ee={class:"text-muted mb-1",for:"PostDown"},je={class:"d-flex flex-column gap-3"},Me={class:"d-flex flex-column flex-sm-row align-items-start align-items-sm-center gap-3"},Ye={class:"mb-0"},We={key:0},Fe={class:"row g-3"},Ge={class:"col-sm"},ze={class:"card text-bg-success rounded-3"},He={class:"card-body"},Ze={class:"col-sm"},Je={class:"card text-bg-warning rounded-3"},Qe={class:"card-body"},Xe={class:"d-flex"},et=["disabled"],tt={__name:"confirmBackup",props:{selectedConfigurationBackup:Object},setup(f){const u=f,t=Y({ConfigurationName:u.selectedConfigurationBackup.filename.split("_")[0],Backup:u.selectedConfigurationBackup.filename}),k=u.selectedConfigurationBackup.content.split(` `);for(let i of k){if(i==="[Peer]")break;if(i.length>0){let s=i.replace(" = ","=").split("=");s[0]==="ListenPort"?t[s[0]]=parseInt(s[1]):t[s[0]]=s[1]}}const p=C(!1),y=C(!1),a=C(""),c=W(),h=x(()=>/^[a-zA-Z0-9_=+.-]{1,15}$/.test(t.ConfigurationName)&&t.ConfigurationName.length>0&&!c.Configurations.find(i=>i.Name===t.ConfigurationName)),w=x(()=>{try{window.wireguard.generatePublicKey(t.PrivateKey)}catch{return!1}return!0}),D=x(()=>t.ListenPort>0&&t.ListenPort<=65353&&Number.isInteger(t.ListenPort)&&!c.Configurations.find(i=>parseInt(i.ListenPort)===t.ListenPort)),L=x(()=>{try{return R(t.Address),!0}catch{return!1}}),U=x(()=>L.value&&D.value&&w.value&&h.value);N(()=>{document.querySelector("main").scrollTo({top:0,behavior:"smooth"}),F(()=>w,i=>{i&&(t.PublicKey=window.wireguard.generatePublicKey(t.PrivateKey))},{immediate:!0})});const A=x(()=>{let i;try{i=R(t.Address)}catch{return 0}return i.end-i.start}),I=x(()=>u.selectedConfigurationBackup.database?u.selectedConfigurationBackup.databaseContent.split(` `).filter(s=>s.search(`INSERT INTO "${t.ConfigurationName}"`)>=0).length:0),S=x(()=>u.selectedConfigurationBackup.database?u.selectedConfigurationBackup.databaseContent.split(` `).filter(s=>s.search(`INSERT INTO "${t.ConfigurationName}_restrict_access"`)>=0).length:0),q=G(),E=z(),j=async()=>{U.value&&(y.value=!0,await H("/api/addWireguardConfiguration",t,async i=>{i.status?(q.newMessage("Server","Configuration restored","success"),await c.getConfigurations(),await E.push(`/configuration/${t.ConfigurationName}/peers`)):y.value=!1}))};return(i,s)=>(l(),r("div",de,[e("form",re,[e("div",ue,[e("h4",ce,[n(o,{t:"Configuration"})])]),e("div",null,[e("label",me,[e("small",null,[n(o,{t:"Configuration Name"})])]),b(e("input",{type:"text",class:v(["form-control rounded-3",[h.value?"is-valid":"is-invalid"]]),placeholder:"ex. wg1",id:"ConfigurationName","onUpdate:modelValue":s[0]||(s[0]=d=>t.ConfigurationName=d),disabled:"",required:""},null,2),[[g,t.ConfigurationName]]),e("div",fe,[p.value?(l(),r("div",pe,_(a.value),1)):(l(),r("div",ve,[n(o,{t:"Configuration name is invalid. Possible reasons:"}),e("ul",be,[e("li",null,[n(o,{t:"Configuration name already exist."})]),e("li",null,[n(o,{t:"Configuration name can only contain 15 lower/uppercase alphabet, numbers, underscore, equal sign, plus sign, period and hyphen."})])])]))])]),e("div",ge,[e("div",_e,[e("div",null,[e("label",ke,[e("small",null,[n(o,{t:"Private Key"})])]),e("div",ye,[b(e("input",{type:"text",class:v(["form-control rounded-start-3",[w.value?"is-valid":"is-invalid"]]),id:"PrivateKey",required:"","onUpdate:modelValue":s[1]||(s[1]=d=>t.PrivateKey=d),disabled:""},null,2),[[g,t.PrivateKey]])])])]),e("div",he,[e("div",null,[e("label",xe,[e("small",null,[n(o,{t:"Public Key"})])]),b(e("input",{type:"text",class:"form-control rounded-3",id:"PublicKey","onUpdate:modelValue":s[2]||(s[2]=d=>t.PublicKey=d),disabled:""},null,512),[[g,t.PublicKey]])])])]),e("div",null,[e("label",Ce,[e("small",null,[n(o,{t:"Listen Port"})])]),b(e("input",{type:"number",class:v(["form-control rounded-3",[D.value?"is-valid":"is-invalid"]]),placeholder:"0-65353",id:"ListenPort",min:"1",max:"65353","onUpdate:modelValue":s[3]||(s[3]=d=>t.ListenPort=d),disabled:"",required:""},null,2),[[g,t.ListenPort]]),e("div",Pe,[p.value?(l(),r("div",we,_(a.value),1)):(l(),r("div",$e,[n(o,{t:"Listen Port is invalid. Possible reasons:"}),e("ul",Be,[e("li",null,[n(o,{t:"Invalid port."})]),e("li",null,[n(o,{t:"Port is assigned to existing WireGuard Configuration."})])])]))])]),e("div",null,[e("label",Ne,[e("small",null,[n(o,{t:"IP Address/CIDR"})]),e("small",{class:v(["ms-auto",[A.value>0?"text-success":"text-danger"]])},[n(o,{t:A.value+" Available IP Address"},null,8,["t"])],2)]),b(e("input",{type:"text",class:v(["form-control",[L.value?"is-valid":"is-invalid"]]),placeholder:"Ex: 10.0.0.1/24",id:"Address","onUpdate:modelValue":s[4]||(s[4]=d=>t.Address=d),disabled:"",required:""},null,2),[[g,t.Address]]),e("div",De,[p.value?(l(),r("div",Le,_(a.value),1)):(l(),r("div",Ue,[n(o,{t:"IP Address/CIDR is invalid"})]))])]),e("div",Ae,[e("div",Ie,[e("h2",Se,[e("button",Ke,[n(o,{t:"Optional Settings"})])]),e("div",Re,[e("div",Ve,[e("div",null,[e("label",Oe,[e("small",null,[n(o,{t:"PreUp"})])]),b(e("input",{type:"text",class:"form-control rounded-3",id:"PreUp",disabled:"","onUpdate:modelValue":s[5]||(s[5]=d=>t.PreUp=d)},null,512),[[g,t.PreUp]])]),e("div",null,[e("label",Te,[e("small",null,[n(o,{t:"PreDown"})])]),b(e("input",{type:"text",class:"form-control rounded-3",id:"PreDown",disabled:"","onUpdate:modelValue":s[6]||(s[6]=d=>t.PreDown=d)},null,512),[[g,t.PreDown]])]),e("div",null,[e("label",qe,[e("small",null,[n(o,{t:"PostUp"})])]),b(e("input",{type:"text",class:"form-control rounded-3",id:"PostUp",disabled:"","onUpdate:modelValue":s[7]||(s[7]=d=>t.PostUp=d)},null,512),[[g,t.PostUp]])]),e("div",null,[e("label",Ee,[e("small",null,[n(o,{t:"PostDown"})])]),b(e("input",{type:"text",class:"form-control rounded-3",id:"PostDown",disabled:"","onUpdate:modelValue":s[8]||(s[8]=d=>t.PostDown=d)},null,512),[[g,t.PostDown]])])])])])])]),e("div",je,[e("div",Me,[e("h4",Ye,[n(o,{t:"Database File"})]),e("h4",{class:v(["mb-0 ms-auto",[f.selectedConfigurationBackup.database?"text-success":"text-danger"]])},[e("i",{class:v(["bi",[f.selectedConfigurationBackup.database?"bi-check-circle-fill":"bi-x-circle-fill"]])},null,2)],2)]),f.selectedConfigurationBackup.database?(l(),r("div",We,[e("div",Fe,[e("div",Ge,[e("div",ze,[e("div",He,[s[10]||(s[10]=e("i",{class:"bi bi-person-fill me-2"},null,-1)),n(o,{t:"Contain"}),s[11]||(s[11]=$()),e("strong",null,_(I.value),1),s[12]||(s[12]=$()),I.value>1?(l(),m(o,{key:0,t:"Peer"})):(l(),m(o,{key:1,t:"Peer"}))])])]),e("div",Ze,[e("div",Je,[e("div",Qe,[s[13]||(s[13]=e("i",{class:"bi bi-person-fill-lock me-2"},null,-1)),n(o,{t:"Contain"}),s[14]||(s[14]=$()),e("strong",null,_(S.value),1),s[15]||(s[15]=$()),S.value>1?(l(),m(o,{key:0,t:"Restricted Peers"})):(l(),m(o,{key:1,t:"Restricted Peers"}))])])])])])):P("",!0)]),e("div",Xe,[e("button",{class:"btn btn-dark btn-brand rounded-3 px-3 py-2 shadow ms-auto",disabled:!U.value||y.value,onClick:s[9]||(s[9]=d=>j())},[s[16]||(s[16]=e("i",{class:"bi bi-clock-history me-2"},null,-1)),n(o,{t:y.value?"Restoring...":"Restore"},null,8,["t"])],8,et)])]))}},st={class:"mt-md-5 mt-3 text-body"},ot={class:"container mb-4"},nt={class:"mb-5 d-flex align-items-center gap-4"},lt={class:"mb-0"},at={key:0},it={class:"d-flex text-decoration-none text-body flex-grow-1 align-items-center gap-3"},dt={class:"mb-0"},rt={class:"text-muted"},ut={key:0,class:"ms-sm-auto"},ct={class:"text-muted"},mt={key:0,id:"step1Detail"},ft={class:"mb-4"},pt={class:"d-flex gap-3 flex-column"},vt={key:0},bt={class:"card rounded-3"},gt={class:"card-body"},_t={class:"mb-0"},kt={class:"my-5",key:"step2",id:"step2"},yt={class:"text-muted"},ht={__name:"restoreConfiguration",setup(f){const u=C(void 0);N(()=>{Z("/api/getAllWireguardConfigurationBackup",{},y=>{u.value=y.data})});const t=C(!1),k=C(void 0),p=C("");return(y,a)=>{const c=J("RouterLink");return l(),r("div",st,[e("div",ot,[e("div",nt,[n(c,{to:"/",class:"btn btn-dark btn-brand p-2 shadow",style:{"border-radius":"100%"}},{default:B(()=>a[1]||(a[1]=[e("h2",{class:"mb-0",style:{"line-height":"0"}},[e("i",{class:"bi bi-arrow-left-circle"})],-1)])),_:1}),e("h2",lt,[n(o,{t:"Restore Configuration"})])]),n(K,{name:"fade",appear:""},{default:B(()=>[u.value?(l(),r("div",at,[e("div",{class:v(["d-flex mb-5 align-items-center steps",{active:!t.value}]),role:"button",onClick:a[0]||(a[0]=h=>t.value=!1),key:"step1"},[e("div",it,[a[2]||(a[2]=e("h1",{class:"mb-0",style:{"line-height":"0"}},[e("i",{class:"bi bi-1-circle-fill"})],-1)),e("div",null,[e("h4",dt,[n(o,{t:"Step 1"})]),e("small",rt,[t.value?(l(),m(o,{key:1,t:"Click to change a backup"})):(l(),m(o,{key:0,t:"Select a backup you want to restore"}))])])]),n(K,{name:"zoomReversed"},{default:B(()=>[t.value?(l(),r("div",ut,[e("small",ct,[n(o,{t:"Selected Backup"})]),e("h6",null,[e("samp",null,_(k.value.filename),1)])])):P("",!0)]),_:1})],2),t.value?P("",!0):(l(),r("div",mt,[e("div",ft,[e("div",pt,[(l(!0),r(O,null,T(Object.keys(u.value.NonExistingConfigurations),h=>(l(),m(ie,{onSelect:w=>{k.value=w,p.value=h,t.value=!0},selectedConfigurationBackup:k.value,open:p.value===h,"configuration-name":h,backups:u.value.NonExistingConfigurations[h]},null,8,["onSelect","selectedConfigurationBackup","open","configuration-name","backups"]))),256)),Object.keys(u.value.NonExistingConfigurations).length===0?(l(),r("div",vt,[e("div",bt,[e("div",gt,[e("p",_t,[n(o,{t:"You don't have any configuration to restore"})])])])])):P("",!0)])])])),e("div",kt,[e("div",{class:v(["steps d-flex text-decoration-none text-body flex-grow-1 align-items-center gap-3",{active:t.value}])},[a[4]||(a[4]=e("h1",{class:"mb-0",style:{"line-height":"0"}},[e("i",{class:"bi bi-2-circle-fill"})],-1)),e("div",null,[a[3]||(a[3]=e("h4",{class:"mb-0"},"Step 2",-1)),e("small",yt,[t.value?(l(),m(o,{key:1,t:"Confirm & edit restore information"})):(l(),m(o,{key:0,t:"Backup not selected"}))])])],2)]),t.value?(l(),m(tt,{selectedConfigurationBackup:k.value,key:"confirm"},null,8,["selectedConfigurationBackup"])):P("",!0)])):P("",!0)]),_:1})])])}}},$t=V(ht,[["__scopeId","data-v-f0245d51"]]);export{$t as default}; diff --git a/src/static/app/dist/assets/schedulePeerJob-UvgbczqH.js b/src/static/app/dist/assets/schedulePeerJob-Bfwzc6gk.js similarity index 96% rename from src/static/app/dist/assets/schedulePeerJob-UvgbczqH.js rename to src/static/app/dist/assets/schedulePeerJob-Bfwzc6gk.js index b5609fb..4e66f93 100644 --- a/src/static/app/dist/assets/schedulePeerJob-UvgbczqH.js +++ b/src/static/app/dist/assets/schedulePeerJob-Bfwzc6gk.js @@ -1 +1 @@ -import{_,a as d,c as r,b as s,t as m,n as y,F as j,h as S,e as f,r as h,D as k,q as v,j as b,d as n,i as x,m as D,s as $,f as p}from"./index-BPNEscAR.js";import{V as J}from"./vue-datepicker-D9reu0Fg.js";import{d as V}from"./dayjs.min-Lw24H7b2.js";import{L as C}from"./localeText-DX813vQA.js";const O={name:"scheduleDropdown",props:{options:Array,data:String,edit:!1},setup(t){t.data===void 0&&this.$emit("update",this.options[0].value)},computed:{currentSelection(){return this.options.find(t=>t.value===this.data)}}},M={class:"dropdown scheduleDropdown"},N={class:"dropdown-menu rounded-3 shadow",style:{"font-size":"0.875rem",width:"200px"}},P=["onClick"],F={key:0,class:"bi bi-check ms-auto"};function L(t,e,l,o,c,w){return d(),r("div",M,[s("button",{class:y(["btn btn-sm btn-outline-primary rounded-3",{"disabled border-transparent":!l.edit}]),type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[s("samp",null,m(this.currentSelection.display),1)],2),s("ul",N,[l.edit?(d(!0),r(j,{key:0},S(this.options,a=>(d(),r("li",null,[s("a",{class:"dropdown-item d-flex align-items-center",role:"button",onClick:u=>t.$emit("update",a.value)},[s("samp",null,m(a.display),1),a.value===this.currentSelection.value?(d(),r("i",F)):f("",!0)],8,P)]))),256)):f("",!0)])])}const T=_(O,[["render",L],["__scopeId","data-v-6a5aba2a"]]),A={name:"schedulePeerJob",components:{LocaleText:C,VueDatePicker:J,ScheduleDropdown:T},props:{dropdowns:Array[Object],pjob:Object,viewOnly:!1},setup(t){const e=h({}),l=h(!1),o=h(!1);e.value=JSON.parse(JSON.stringify(t.pjob)),e.value.CreationDate||(l.value=!0,o.value=!0);const c=k();return{job:e,edit:l,newJob:o,store:c}},data(){return{inputType:void 0}},watch:{pjob:{deep:!0,immediate:!0,handler(t){this.edit||(this.job=JSON.parse(JSON.stringify(t)))}}},methods:{save(){this.job.Field&&this.job.Operator&&this.job.Action&&this.job.Value?v("/api/savePeerScheduleJob/",{Job:this.job},t=>{t.status?(this.edit=!1,this.store.newMessage("Server","Peer job saved","success"),console.log(t.data),this.$emit("refresh",t.data[0]),this.newJob=!1):this.store.newMessage("Server",t.message,"danger")}):this.alert()},alert(){let t="animate__flash",e=this.$el.querySelectorAll(".scheduleDropdown"),l=this.$el.querySelectorAll("input");e.forEach(o=>o.classList.add("animate__animated",t)),l.forEach(o=>o.classList.add("animate__animated",t)),setTimeout(()=>{e.forEach(o=>o.classList.remove("animate__animated",t)),l.forEach(o=>o.classList.remove("animate__animated",t))},2e3)},reset(){this.job.CreationDate?(this.job=JSON.parse(JSON.stringify(this.pjob)),this.edit=!1):this.$emit("delete")},delete(){this.job.CreationDate&&v("/api/deletePeerScheduleJob/",{Job:this.job},t=>{t.status?this.store.newMessage("Server","Peer job deleted","success"):(this.store.newMessage("Server",t.message,"danger"),this.$emit("delete"))}),this.$emit("delete")},parseTime(t){t&&(this.job.Value=V(t).format("YYYY-MM-DD HH:mm:ss"))}}},E={class:"card-header bg-transparent text-muted border-0"},U={key:0,class:"d-flex"},H={class:"me-auto"},B={key:1},I={class:"badge text-bg-warning"},Y={class:"card-body pt-1",style:{"font-family":"var(--bs-font-monospace)"}},q={class:"d-flex gap-2 align-items-center mb-2"},z=["disabled"],G={class:"px-5 d-flex gap-2 align-items-center"},K={class:"d-flex gap-3"},Q={key:0,class:"ms-auto d-flex gap-3"},R={key:1,class:"ms-auto d-flex gap-3"};function W(t,e,l,o,c,w){const a=b("LocaleText"),u=b("ScheduleDropdown"),g=b("VueDatePicker");return d(),r("div",{class:y(["card shadow-sm rounded-3 mb-2",{"border-warning-subtle":this.newJob}])},[s("div",E,[this.newJob?(d(),r("small",B,[s("span",I,[n(a,{t:"Unsaved Job"})])])):(d(),r("small",U,[s("strong",H,[n(a,{t:"Job ID"})]),s("samp",null,m(this.job.JobID),1)]))]),s("div",Y,[s("div",q,[s("samp",null,[n(a,{t:"if"})]),n(u,{edit:o.edit,options:this.dropdowns.Field,data:this.job.Field,onUpdate:e[0]||(e[0]=i=>{this.job.Field=i})},null,8,["edit","options","data"]),s("samp",null,[n(a,{t:"is"})]),n(u,{edit:o.edit,options:this.dropdowns.Operator,data:this.job.Operator,onUpdate:e[1]||(e[1]=i=>this.job.Operator=i)},null,8,["edit","options","data"]),this.job.Field==="date"?(d(),x(g,{key:0,is24:!0,"min-date":new Date,"model-value":this.job.Value,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",clearable:!1,disabled:!o.edit,dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","disabled","dark"])):D((d(),r("input",{key:1,class:"form-control form-control-sm form-control-dark rounded-3 flex-grow-1",disabled:!o.edit,"onUpdate:modelValue":e[2]||(e[2]=i=>this.job.Value=i),style:{width:"auto"}},null,8,z)),[[$,this.job.Value]]),s("samp",null,m(this.dropdowns.Field.find(i=>i.value===this.job.Field)?.unit)+" { ",1)]),s("div",G,[s("samp",null,[n(a,{t:"then"})]),n(u,{edit:o.edit,options:this.dropdowns.Action,data:this.job.Action,onUpdate:e[3]||(e[3]=i=>this.job.Action=i)},null,8,["edit","options","data"])]),s("div",K,[e[12]||(e[12]=s("samp",null,"}",-1)),this.edit?(d(),r("div",R,[s("a",{role:"button",class:"text-secondary text-decoration-none",onClick:e[6]||(e[6]=i=>this.reset())},[e[10]||(e[10]=p("[C] ")),n(a,{t:"Cancel"})]),s("a",{role:"button",class:"text-primary ms-auto text-decoration-none",onClick:e[7]||(e[7]=i=>this.save())},[e[11]||(e[11]=p("[S] ")),n(a,{t:"Save"})])])):(d(),r("div",Q,[s("a",{role:"button",class:"ms-auto text-decoration-none",onClick:e[4]||(e[4]=i=>this.edit=!0)},[e[8]||(e[8]=p("[E] ")),n(a,{t:"Edit"})]),s("a",{role:"button",onClick:e[5]||(e[5]=i=>this.delete()),class:"text-danger text-decoration-none"},[e[9]||(e[9]=p("[D] ")),n(a,{t:"Delete"})])]))])])],2)}const se=_(A,[["render",W],["__scopeId","data-v-8f3f1b93"]]);export{se as S,T as a}; +import{_,a as d,c as r,b as s,t as m,n as y,F as j,h as S,e as f,r as h,D as k,q as v,j as b,d as n,i as x,m as D,s as $,f as p}from"./index-DOaPWS1X.js";import{V as J}from"./vue-datepicker-D91GxXPq.js";import{d as V}from"./dayjs.min-D8jwq_wn.js";import{L as C}from"./localeText-CaAXeE0W.js";const O={name:"scheduleDropdown",props:{options:Array,data:String,edit:!1},setup(t){t.data===void 0&&this.$emit("update",this.options[0].value)},computed:{currentSelection(){return this.options.find(t=>t.value===this.data)}}},M={class:"dropdown scheduleDropdown"},N={class:"dropdown-menu rounded-3 shadow",style:{"font-size":"0.875rem",width:"200px"}},P=["onClick"],F={key:0,class:"bi bi-check ms-auto"};function L(t,e,l,o,c,w){return d(),r("div",M,[s("button",{class:y(["btn btn-sm btn-outline-primary rounded-3",{"disabled border-transparent":!l.edit}]),type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[s("samp",null,m(this.currentSelection.display),1)],2),s("ul",N,[l.edit?(d(!0),r(j,{key:0},S(this.options,a=>(d(),r("li",null,[s("a",{class:"dropdown-item d-flex align-items-center",role:"button",onClick:u=>t.$emit("update",a.value)},[s("samp",null,m(a.display),1),a.value===this.currentSelection.value?(d(),r("i",F)):f("",!0)],8,P)]))),256)):f("",!0)])])}const T=_(O,[["render",L],["__scopeId","data-v-6a5aba2a"]]),A={name:"schedulePeerJob",components:{LocaleText:C,VueDatePicker:J,ScheduleDropdown:T},props:{dropdowns:Array[Object],pjob:Object,viewOnly:!1},setup(t){const e=h({}),l=h(!1),o=h(!1);e.value=JSON.parse(JSON.stringify(t.pjob)),e.value.CreationDate||(l.value=!0,o.value=!0);const c=k();return{job:e,edit:l,newJob:o,store:c}},data(){return{inputType:void 0}},watch:{pjob:{deep:!0,immediate:!0,handler(t){this.edit||(this.job=JSON.parse(JSON.stringify(t)))}}},methods:{save(){this.job.Field&&this.job.Operator&&this.job.Action&&this.job.Value?v("/api/savePeerScheduleJob/",{Job:this.job},t=>{t.status?(this.edit=!1,this.store.newMessage("Server","Peer job saved","success"),console.log(t.data),this.$emit("refresh",t.data[0]),this.newJob=!1):this.store.newMessage("Server",t.message,"danger")}):this.alert()},alert(){let t="animate__flash",e=this.$el.querySelectorAll(".scheduleDropdown"),l=this.$el.querySelectorAll("input");e.forEach(o=>o.classList.add("animate__animated",t)),l.forEach(o=>o.classList.add("animate__animated",t)),setTimeout(()=>{e.forEach(o=>o.classList.remove("animate__animated",t)),l.forEach(o=>o.classList.remove("animate__animated",t))},2e3)},reset(){this.job.CreationDate?(this.job=JSON.parse(JSON.stringify(this.pjob)),this.edit=!1):this.$emit("delete")},delete(){this.job.CreationDate&&v("/api/deletePeerScheduleJob/",{Job:this.job},t=>{t.status?this.store.newMessage("Server","Peer job deleted","success"):(this.store.newMessage("Server",t.message,"danger"),this.$emit("delete"))}),this.$emit("delete")},parseTime(t){t&&(this.job.Value=V(t).format("YYYY-MM-DD HH:mm:ss"))}}},E={class:"card-header bg-transparent text-muted border-0"},U={key:0,class:"d-flex"},H={class:"me-auto"},B={key:1},I={class:"badge text-bg-warning"},Y={class:"card-body pt-1",style:{"font-family":"var(--bs-font-monospace)"}},q={class:"d-flex gap-2 align-items-center mb-2"},z=["disabled"],G={class:"px-5 d-flex gap-2 align-items-center"},K={class:"d-flex gap-3"},Q={key:0,class:"ms-auto d-flex gap-3"},R={key:1,class:"ms-auto d-flex gap-3"};function W(t,e,l,o,c,w){const a=b("LocaleText"),u=b("ScheduleDropdown"),g=b("VueDatePicker");return d(),r("div",{class:y(["card shadow-sm rounded-3 mb-2",{"border-warning-subtle":this.newJob}])},[s("div",E,[this.newJob?(d(),r("small",B,[s("span",I,[n(a,{t:"Unsaved Job"})])])):(d(),r("small",U,[s("strong",H,[n(a,{t:"Job ID"})]),s("samp",null,m(this.job.JobID),1)]))]),s("div",Y,[s("div",q,[s("samp",null,[n(a,{t:"if"})]),n(u,{edit:o.edit,options:this.dropdowns.Field,data:this.job.Field,onUpdate:e[0]||(e[0]=i=>{this.job.Field=i})},null,8,["edit","options","data"]),s("samp",null,[n(a,{t:"is"})]),n(u,{edit:o.edit,options:this.dropdowns.Operator,data:this.job.Operator,onUpdate:e[1]||(e[1]=i=>this.job.Operator=i)},null,8,["edit","options","data"]),this.job.Field==="date"?(d(),x(g,{key:0,is24:!0,"min-date":new Date,"model-value":this.job.Value,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",clearable:!1,disabled:!o.edit,dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","disabled","dark"])):D((d(),r("input",{key:1,class:"form-control form-control-sm form-control-dark rounded-3 flex-grow-1",disabled:!o.edit,"onUpdate:modelValue":e[2]||(e[2]=i=>this.job.Value=i),style:{width:"auto"}},null,8,z)),[[$,this.job.Value]]),s("samp",null,m(this.dropdowns.Field.find(i=>i.value===this.job.Field)?.unit)+" { ",1)]),s("div",G,[s("samp",null,[n(a,{t:"then"})]),n(u,{edit:o.edit,options:this.dropdowns.Action,data:this.job.Action,onUpdate:e[3]||(e[3]=i=>this.job.Action=i)},null,8,["edit","options","data"])]),s("div",K,[e[12]||(e[12]=s("samp",null,"}",-1)),this.edit?(d(),r("div",R,[s("a",{role:"button",class:"text-secondary text-decoration-none",onClick:e[6]||(e[6]=i=>this.reset())},[e[10]||(e[10]=p("[C] ")),n(a,{t:"Cancel"})]),s("a",{role:"button",class:"text-primary ms-auto text-decoration-none",onClick:e[7]||(e[7]=i=>this.save())},[e[11]||(e[11]=p("[S] ")),n(a,{t:"Save"})])])):(d(),r("div",Q,[s("a",{role:"button",class:"ms-auto text-decoration-none",onClick:e[4]||(e[4]=i=>this.edit=!0)},[e[8]||(e[8]=p("[E] ")),n(a,{t:"Edit"})]),s("a",{role:"button",onClick:e[5]||(e[5]=i=>this.delete()),class:"text-danger text-decoration-none"},[e[9]||(e[9]=p("[D] ")),n(a,{t:"Delete"})])]))])])],2)}const se=_(A,[["render",W],["__scopeId","data-v-8f3f1b93"]]);export{se as S,T as a}; diff --git a/src/static/app/dist/assets/selectPeers-BBMqr9bY.js b/src/static/app/dist/assets/selectPeers-B6Dm7IFO.js similarity index 97% rename from src/static/app/dist/assets/selectPeers-BBMqr9bY.js rename to src/static/app/dist/assets/selectPeers-B6Dm7IFO.js index 24dd4fd..a7eef2b 100644 --- a/src/static/app/dist/assets/selectPeers-BBMqr9bY.js +++ b/src/static/app/dist/assets/selectPeers-B6Dm7IFO.js @@ -1 +1 @@ -import{_ as R,r as g,x as j,E as A,$ as F,D as M,C as O,a0 as C,a as o,c as n,b as t,d as r,e as b,m as q,s as z,F as p,h as G,n as w,t as $,f as h,q as Y,g as H}from"./index-BPNEscAR.js";import{L as d}from"./localeText-DX813vQA.js";const J={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll",ref:"selectPeersContainer"},K={class:"container d-flex h-100 w-100"},Q={class:"m-auto modal-dialog-centered dashboardModal",style:{width:"700px"}},W={class:"card rounded-3 shadow flex-grow-1"},X={class:"card-header bg-transparent d-flex align-items-center gap-2 p-4 flex-column pb-3"},Z={class:"mb-2 w-100 d-flex"},ee={class:"mb-0"},te={class:"d-flex w-100 align-items-center gap-2"},se={class:"d-flex gap-3"},le={class:"card-body px-4 flex-grow-1 d-flex gap-2 flex-column position-relative",ref:"card-body",style:{"overflow-y":"scroll"}},ae=["onClick","disabled","data-id"],oe={key:0},ne={class:"d-flex flex-column"},ie={class:"fw-bold"},re={class:"text-muted"},de={key:1,class:"ms-auto"},ue={key:0,class:"spinner-border spinner-border-sm",role:"status"},ce={class:"card-footer px-4 py-3 gap-2 d-flex align-items-center"},fe=["disabled"],be={key:0,class:"flex-grow-1 text-center"},ve=["disabled"],me={key:0,class:"flex-grow-1 text-center"},ge=["disabled"],pe={key:0,class:"flex-grow-1 text-center"},he=["disabled"],xe={__name:"selectPeers",props:{configurationPeers:Array},emits:["refresh","close"],setup(x,{emit:S}){const y=x,f=g(!1),u=g(!1),s=g([]),m=g(""),D=a=>{s.value.find(e=>e===a)?s.value=s.value.filter(e=>e!==a):s.value.push(a)},B=j(()=>f.value||u.value?y.configurationPeers.filter(a=>s.value.find(e=>e===a.id)):m.value.length>0?y.configurationPeers.filter(a=>a.id.includes(m.value)||a.name.includes(m.value)):y.configurationPeers);A(s,()=>{s.value.length===0&&(f.value=!1,u.value=!1)});const P=F(),N=M(),_=S,v=g(!1),T=()=>{v.value=!0,Y(`/api/deletePeers/${P.params.id}`,{peers:s.value},a=>{N.newMessage("Server",a.message,a.status?"success":"danger"),a.status&&(s.value=[],f.value=!1),_("refresh"),v.value=!1})},c=O({success:[],failed:[]}),L=C("card-body"),U=C("sp"),V=async()=>{u.value=!0;for(const a of s.value)L.value.scrollTo({top:U.value.find(e=>e.dataset.id===a).offsetTop-20,behavior:"smooth"}),await H("/api/downloadPeer/"+P.params.id,{id:a},e=>{if(e.status){const l=new Blob([e.data.file],{type:"text/plain"}),i=URL.createObjectURL(l),I=`${e.data.fileName}.conf`,k=document.createElement("a");k.href=i,k.download=I,k.click(),c.success.push(a)}else c.failed.push(a)})},E=()=>{c.success=[],c.failed=[],u.value=!1};return(a,e)=>(o(),n("div",J,[t("div",K,[t("div",Q,[t("div",W,[t("div",X,[t("div",Z,[t("h4",ee,[r(d,{t:"Select Peers"})]),t("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=l=>_("close"))})]),t("div",te,[t("div",se,[!u.value&&s.value.length!==x.configurationPeers.map(l=>l.id).length?(o(),n("a",{key:0,role:"button",onClick:e[1]||(e[1]=l=>s.value=x.configurationPeers.map(i=>i.id)),class:"text-decoration-none text-body"},[t("small",null,[e[9]||(e[9]=t("i",{class:"bi bi-check-all me-2"},null,-1)),r(d,{t:"Select All"})])])):b("",!0),s.value.length>0&&!u.value?(o(),n("a",{key:1,role:"button",class:"text-decoration-none text-body",onClick:e[2]||(e[2]=l=>s.value=[])},[t("small",null,[e[10]||(e[10]=t("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),r(d,{t:"Clear Selection"})])])):b("",!0)]),e[11]||(e[11]=t("label",{class:"ms-auto",for:"selectPeersSearchInput"},[t("i",{class:"bi bi-search"})],-1)),q(t("input",{class:"form-control form-control-sm rounded-3","onUpdate:modelValue":e[3]||(e[3]=l=>m.value=l),id:"selectPeersSearchInput",style:{width:"200px !important"},type:"text"},null,512),[[z,m.value]])])]),t("div",le,[(o(!0),n(p,null,G(B.value,l=>(o(),n("button",{type:"button",class:w(["btn w-100 peerBtn text-start rounded-3 d-flex align-items-center gap-3",{active:s.value.find(i=>i===l.id)}]),onClick:i=>D(l.id),key:l.id,disabled:f.value||u.value,ref_for:!0,ref:"sp","data-id":l.id},[u.value?b("",!0):(o(),n("span",oe,[t("i",{class:w(["bi",[s.value.find(i=>i===l.id)?"bi-check-circle-fill":"bi-circle"]])},null,2)])),t("span",ne,[t("small",ie,$(l.name?l.name:"Untitled Peer"),1),t("small",re,[t("samp",null,$(l.id),1)])]),u.value?(o(),n("span",de,[!c.success.find(i=>i===l.id)&&!c.failed.find(i=>i===l.id)?(o(),n("span",ue)):(o(),n("i",{key:1,class:w(["bi",[c.failed.find(i=>i===l.id)?"bi-x-circle-fill":"bi-check-circle-fill"]])},null,2))])):b("",!0)],10,ae))),128))],512),t("div",ce,[!f.value&&!u.value?(o(),n(p,{key:0},[t("button",{class:"btn bg-primary-subtle text-primary-emphasis border-primary-subtle rounded-3",disabled:s.value.length===0||v.value,onClick:e[4]||(e[4]=l=>V())},e[12]||(e[12]=[t("i",{class:"bi bi-download"},null,-1)]),8,fe),s.value.length>0?(o(),n("span",be,[e[13]||(e[13]=t("i",{class:"bi bi-check-circle-fill me-2"},null,-1)),r(d,{t:s.value.length+" Peer"+(s.value.length>1?"s":"")},null,8,["t"])])):b("",!0),t("button",{class:"btn bg-danger-subtle text-danger-emphasis border-danger-subtle ms-auto rounded-3",onClick:e[5]||(e[5]=l=>f.value=!0),disabled:s.value.length===0||v.value},e[14]||(e[14]=[t("i",{class:"bi bi-trash"},null,-1)]),8,ve)],64)):u.value?(o(),n(p,{key:1},[c.failed.length+c.success.length1?"s":"")},null,8,["t"]),e[16]||(e[16]=h("... "))])):(o(),n(p,{key:1},[t("strong",null,[r(d,{t:"Download Finished"})]),t("button",{onClick:e[6]||(e[6]=l=>E()),class:"btn bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle rounded-3 ms-auto"},[r(d,{t:"Done"})])],64))],64)):f.value?(o(),n(p,{key:2},[t("button",{class:"btn btn-danger rounded-3",disabled:s.value.length===0||v.value,onClick:e[7]||(e[7]=l=>T())},[r(d,{t:"Yes"})],8,ge),s.value.length>0?(o(),n("strong",pe,[r(d,{t:"Are you sure to delete"}),e[17]||(e[17]=h()),r(d,{t:s.value.length+" Peer"+(s.value.length>1?"s":"")},null,8,["t"]),e[18]||(e[18]=h("? "))])):b("",!0),t("button",{class:"btn bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle ms-auto rounded-3",disabled:s.value.length===0||v.value,onClick:e[8]||(e[8]=l=>f.value=!1)},[r(d,{t:"No"})],8,he)],64)):b("",!0)])])])])],512))}},we=R(xe,[["__scopeId","data-v-177407c1"]]);export{we as default}; +import{_ as R,r as g,x as j,E as A,$ as F,D as M,C as O,a0 as C,a as o,c as n,b as t,d as r,e as b,m as q,s as z,F as p,h as G,n as w,t as $,f as h,q as Y,g as H}from"./index-DOaPWS1X.js";import{L as d}from"./localeText-CaAXeE0W.js";const J={class:"peerSettingContainer w-100 h-100 position-absolute top-0 start-0 overflow-y-scroll",ref:"selectPeersContainer"},K={class:"container d-flex h-100 w-100"},Q={class:"m-auto modal-dialog-centered dashboardModal",style:{width:"700px"}},W={class:"card rounded-3 shadow flex-grow-1"},X={class:"card-header bg-transparent d-flex align-items-center gap-2 p-4 flex-column pb-3"},Z={class:"mb-2 w-100 d-flex"},ee={class:"mb-0"},te={class:"d-flex w-100 align-items-center gap-2"},se={class:"d-flex gap-3"},le={class:"card-body px-4 flex-grow-1 d-flex gap-2 flex-column position-relative",ref:"card-body",style:{"overflow-y":"scroll"}},ae=["onClick","disabled","data-id"],oe={key:0},ne={class:"d-flex flex-column"},ie={class:"fw-bold"},re={class:"text-muted"},de={key:1,class:"ms-auto"},ue={key:0,class:"spinner-border spinner-border-sm",role:"status"},ce={class:"card-footer px-4 py-3 gap-2 d-flex align-items-center"},fe=["disabled"],be={key:0,class:"flex-grow-1 text-center"},ve=["disabled"],me={key:0,class:"flex-grow-1 text-center"},ge=["disabled"],pe={key:0,class:"flex-grow-1 text-center"},he=["disabled"],xe={__name:"selectPeers",props:{configurationPeers:Array},emits:["refresh","close"],setup(x,{emit:S}){const y=x,f=g(!1),u=g(!1),s=g([]),m=g(""),D=a=>{s.value.find(e=>e===a)?s.value=s.value.filter(e=>e!==a):s.value.push(a)},B=j(()=>f.value||u.value?y.configurationPeers.filter(a=>s.value.find(e=>e===a.id)):m.value.length>0?y.configurationPeers.filter(a=>a.id.includes(m.value)||a.name.includes(m.value)):y.configurationPeers);A(s,()=>{s.value.length===0&&(f.value=!1,u.value=!1)});const P=F(),N=M(),_=S,v=g(!1),T=()=>{v.value=!0,Y(`/api/deletePeers/${P.params.id}`,{peers:s.value},a=>{N.newMessage("Server",a.message,a.status?"success":"danger"),a.status&&(s.value=[],f.value=!1),_("refresh"),v.value=!1})},c=O({success:[],failed:[]}),L=C("card-body"),U=C("sp"),V=async()=>{u.value=!0;for(const a of s.value)L.value.scrollTo({top:U.value.find(e=>e.dataset.id===a).offsetTop-20,behavior:"smooth"}),await H("/api/downloadPeer/"+P.params.id,{id:a},e=>{if(e.status){const l=new Blob([e.data.file],{type:"text/plain"}),i=URL.createObjectURL(l),I=`${e.data.fileName}.conf`,k=document.createElement("a");k.href=i,k.download=I,k.click(),c.success.push(a)}else c.failed.push(a)})},E=()=>{c.success=[],c.failed=[],u.value=!1};return(a,e)=>(o(),n("div",J,[t("div",K,[t("div",Q,[t("div",W,[t("div",X,[t("div",Z,[t("h4",ee,[r(d,{t:"Select Peers"})]),t("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=l=>_("close"))})]),t("div",te,[t("div",se,[!u.value&&s.value.length!==x.configurationPeers.map(l=>l.id).length?(o(),n("a",{key:0,role:"button",onClick:e[1]||(e[1]=l=>s.value=x.configurationPeers.map(i=>i.id)),class:"text-decoration-none text-body"},[t("small",null,[e[9]||(e[9]=t("i",{class:"bi bi-check-all me-2"},null,-1)),r(d,{t:"Select All"})])])):b("",!0),s.value.length>0&&!u.value?(o(),n("a",{key:1,role:"button",class:"text-decoration-none text-body",onClick:e[2]||(e[2]=l=>s.value=[])},[t("small",null,[e[10]||(e[10]=t("i",{class:"bi bi-x-circle-fill me-2"},null,-1)),r(d,{t:"Clear Selection"})])])):b("",!0)]),e[11]||(e[11]=t("label",{class:"ms-auto",for:"selectPeersSearchInput"},[t("i",{class:"bi bi-search"})],-1)),q(t("input",{class:"form-control form-control-sm rounded-3","onUpdate:modelValue":e[3]||(e[3]=l=>m.value=l),id:"selectPeersSearchInput",style:{width:"200px !important"},type:"text"},null,512),[[z,m.value]])])]),t("div",le,[(o(!0),n(p,null,G(B.value,l=>(o(),n("button",{type:"button",class:w(["btn w-100 peerBtn text-start rounded-3 d-flex align-items-center gap-3",{active:s.value.find(i=>i===l.id)}]),onClick:i=>D(l.id),key:l.id,disabled:f.value||u.value,ref_for:!0,ref:"sp","data-id":l.id},[u.value?b("",!0):(o(),n("span",oe,[t("i",{class:w(["bi",[s.value.find(i=>i===l.id)?"bi-check-circle-fill":"bi-circle"]])},null,2)])),t("span",ne,[t("small",ie,$(l.name?l.name:"Untitled Peer"),1),t("small",re,[t("samp",null,$(l.id),1)])]),u.value?(o(),n("span",de,[!c.success.find(i=>i===l.id)&&!c.failed.find(i=>i===l.id)?(o(),n("span",ue)):(o(),n("i",{key:1,class:w(["bi",[c.failed.find(i=>i===l.id)?"bi-x-circle-fill":"bi-check-circle-fill"]])},null,2))])):b("",!0)],10,ae))),128))],512),t("div",ce,[!f.value&&!u.value?(o(),n(p,{key:0},[t("button",{class:"btn bg-primary-subtle text-primary-emphasis border-primary-subtle rounded-3",disabled:s.value.length===0||v.value,onClick:e[4]||(e[4]=l=>V())},e[12]||(e[12]=[t("i",{class:"bi bi-download"},null,-1)]),8,fe),s.value.length>0?(o(),n("span",be,[e[13]||(e[13]=t("i",{class:"bi bi-check-circle-fill me-2"},null,-1)),r(d,{t:s.value.length+" Peer"+(s.value.length>1?"s":"")},null,8,["t"])])):b("",!0),t("button",{class:"btn bg-danger-subtle text-danger-emphasis border-danger-subtle ms-auto rounded-3",onClick:e[5]||(e[5]=l=>f.value=!0),disabled:s.value.length===0||v.value},e[14]||(e[14]=[t("i",{class:"bi bi-trash"},null,-1)]),8,ve)],64)):u.value?(o(),n(p,{key:1},[c.failed.length+c.success.length1?"s":"")},null,8,["t"]),e[16]||(e[16]=h("... "))])):(o(),n(p,{key:1},[t("strong",null,[r(d,{t:"Download Finished"})]),t("button",{onClick:e[6]||(e[6]=l=>E()),class:"btn bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle rounded-3 ms-auto"},[r(d,{t:"Done"})])],64))],64)):f.value?(o(),n(p,{key:2},[t("button",{class:"btn btn-danger rounded-3",disabled:s.value.length===0||v.value,onClick:e[7]||(e[7]=l=>T())},[r(d,{t:"Yes"})],8,ge),s.value.length>0?(o(),n("strong",pe,[r(d,{t:"Are you sure to delete"}),e[17]||(e[17]=h()),r(d,{t:s.value.length+" Peer"+(s.value.length>1?"s":"")},null,8,["t"]),e[18]||(e[18]=h("? "))])):b("",!0),t("button",{class:"btn bg-secondary-subtle text-secondary-emphasis border border-secondary-subtle ms-auto rounded-3",disabled:s.value.length===0||v.value,onClick:e[8]||(e[8]=l=>f.value=!1)},[r(d,{t:"No"})],8,he)],64)):b("",!0)])])])])],512))}},we=R(xe,[["__scopeId","data-v-177407c1"]]);export{we as default}; diff --git a/src/static/app/dist/assets/settings-ReVwIZ3m.js b/src/static/app/dist/assets/settings-B22cgeoY.js similarity index 99% rename from src/static/app/dist/assets/settings-ReVwIZ3m.js rename to src/static/app/dist/assets/settings-B22cgeoY.js index 8516ef0..a0ad182 100644 --- a/src/static/app/dist/assets/settings-ReVwIZ3m.js +++ b/src/static/app/dist/assets/settings-B22cgeoY.js @@ -1 +1 @@ -import{_,D as f,p as I,q as b,a as o,c as d,b as t,d as n,m as w,s as x,n as g,t as y,e as m,j as l,W as F,f as D,v as V,i as v,F as P,g as L,w as T,h as S,k as H,T as M,r as j,x as B}from"./index-BPNEscAR.js";import{L as $}from"./localeText-DX813vQA.js";import{d as C}from"./dayjs.min-Lw24H7b2.js";import{V as R}from"./vue-datepicker-D9reu0Fg.js";const z={components:{LocaleText:$},props:{targetData:String,title:String,warning:!1,warningText:""},setup(){const s=f(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Peers[this.targetData]},methods:{async useValidation(){this.changed&&await b("/api/updateDashboardConfigurationItem",{section:"Peers",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Peers[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message),this.changed=!1,this.updating=!1})}}},O={class:"form-group mb-2"},q=["for"],Q=["id","disabled"],J={class:"invalid-feedback"},X={key:0,class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mt-1"};function Z(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",O,[t("label",{for:this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[n(a,{t:this.title},null,8,["t"])])])],8,q),w(t("input",{type:"text",class:g(["form-control",{"is-invalid":r.showInvalidFeedback,"is-valid":r.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=i=>this.value=i),onKeydown:e[1]||(e[1]=i=>this.changed=!0),onBlur:e[2]||(e[2]=i=>h.useValidation()),disabled:this.updating},null,42,Q),[[x,this.value]]),t("div",J,y(this.invalidFeedback),1),u.warning?(o(),d("div",X,[t("small",null,[e[3]||(e[3]=t("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),n(a,{t:u.warningText},null,8,["t"])])])):m("",!0)])}const tt=_(z,[["render",Z]]),et=s=>{},st={name:"accountSettingsInputUsername",components:{LocaleText:$},props:{targetData:String,title:String},setup(){const s=f(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Account[this.targetData]},methods:{async useValidation(s){this.changed&&(this.updating=!0,await b("/api/updateDashboardConfigurationItem",{section:"Account",key:this.targetData,value:this.value},e=>{e.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=e.message),this.changed=!1,this.updating=!1}))}}},at={class:"form-group mb-2"},it=["for"],ot=["id","disabled"],nt={class:"invalid-feedback"};function dt(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",at,[t("label",{for:this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[n(a,{t:this.title},null,8,["t"])])])],8,it),w(t("input",{type:"text",class:g(["form-control",{"is-invalid":r.showInvalidFeedback,"is-valid":r.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=i=>this.value=i),onKeydown:e[1]||(e[1]=i=>this.changed=!0),onBlur:e[2]||(e[2]=i=>h.useValidation()),disabled:this.updating},null,42,ot),[[x,this.value]]),t("div",nt,y(this.invalidFeedback),1)])}const rt=_(st,[["render",dt]]),lt={name:"accountSettingsInputPassword",components:{LocaleText:$},props:{targetData:String,warning:!1,warningText:""},setup(){const s=f(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{value:{currentPassword:"",newPassword:"",repeatNewPassword:""},invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0}},methods:{async useValidation(){Object.values(this.value).find(s=>s.length===0)===void 0?this.value.newPassword===this.value.repeatNewPassword?await b("/api/updateDashboardConfigurationItem",{section:"Account",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.isValid=!1,this.value={currentPassword:"",newPassword:"",repeatNewPassword:""}},5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message)}):(this.showInvalidFeedback=!0,this.invalidFeedback="New passwords does not match"):(this.showInvalidFeedback=!0,this.invalidFeedback="Please fill in all required fields.")}},computed:{passwordValid(){return Object.values(this.value).find(s=>s.length===0)===void 0&&this.value.newPassword===this.value.repeatNewPassword}}},ut={class:"d-flex flex-column gap-2"},ct={class:"row g-2"},ht={class:"col-sm"},pt={class:"form-group"},mt=["for"],gt=["id"],bt={key:0,class:"invalid-feedback d-block"},_t={class:"col-sm"},ft={class:"form-group"},vt=["for"],wt=["id"],yt={class:"col-sm"},$t={class:"form-group"},kt=["for"],xt=["id"],Dt=["disabled"];function It(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("form",ut,[t("div",ct,[t("div",ht,[t("div",pt,[t("label",{for:"currentPassword_"+this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[n(a,{t:"Current Password"})])])],8,mt),w(t("input",{type:"password",class:g(["form-control",{"is-invalid":r.showInvalidFeedback,"is-valid":r.isValid}]),autocomplete:"current-password","onUpdate:modelValue":e[0]||(e[0]=i=>this.value.currentPassword=i),id:"currentPassword_"+this.uuid},null,10,gt),[[x,this.value.currentPassword]]),r.showInvalidFeedback?(o(),d("div",bt,y(this.invalidFeedback),1)):m("",!0)])]),t("div",_t,[t("div",ft,[t("label",{for:"newPassword_"+this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[n(a,{t:"New Password"})])])],8,vt),w(t("input",{type:"password",class:g(["form-control",{"is-invalid":r.showInvalidFeedback,"is-valid":r.isValid}]),autocomplete:"new-password","onUpdate:modelValue":e[1]||(e[1]=i=>this.value.newPassword=i),id:"newPassword_"+this.uuid},null,10,wt),[[x,this.value.newPassword]])])]),t("div",yt,[t("div",$t,[t("label",{for:"repeatNewPassword_"+this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[n(a,{t:"Repeat New Password"})])])],8,kt),w(t("input",{type:"password",class:g(["form-control",{"is-invalid":r.showInvalidFeedback,"is-valid":r.isValid}]),autocomplete:"new-password","onUpdate:modelValue":e[2]||(e[2]=i=>this.value.repeatNewPassword=i),id:"repeatNewPassword_"+this.uuid},null,10,xt),[[x,this.value.repeatNewPassword]])])])]),t("button",{disabled:!this.passwordValid,class:"ms-auto btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm",onClick:e[3]||(e[3]=i=>this.useValidation())},[e[4]||(e[4]=t("i",{class:"bi bi-save2-fill me-2"},null,-1)),n(a,{t:"Update Password"})],8,Dt)])}const Pt=_(lt,[["render",It]]),At={name:"dashboardSettingsInputWireguardConfigurationPath",components:{LocaleText:$},props:{targetData:String,title:String,warning:!1,warningText:""},setup(){const s=f(),e=F(),u=`input_${I()}`;return{store:s,uuid:u,WireguardConfigurationStore:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Server[this.targetData]},methods:{async useValidation(){this.changed&&(this.updating=!0,await b("/api/updateDashboardConfigurationItem",{section:"Server",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3),this.WireguardConfigurationStore.getConfigurations(),this.store.newMessage("Server","WireGuard configuration path saved","success")):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message),this.changed=!1,this.updating=!1}))}}},Ct={class:"card"},St={class:"card-header"},Kt={class:"my-2"},Tt={class:"card-body"},Vt={class:"form-group"},Ft=["for"],Lt={class:"d-flex gap-2 align-items-start"},Mt={class:"flex-grow-1"},Wt=["id","disabled"],Nt={class:"invalid-feedback fw-bold"},Ut=["disabled"],Et={key:0,class:"bi bi-save2-fill"},Yt={key:1,class:"spinner-border spinner-border-sm"},Gt={key:0,class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mt-1 mb-2"};function Ht(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",Ct,[t("div",St,[t("h6",Kt,[n(a,{t:"Path"})])]),t("div",Tt,[t("div",Vt,[t("label",{for:this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[n(a,{t:this.title},null,8,["t"])])])],8,Ft),t("div",Lt,[t("div",Mt,[w(t("input",{type:"text",class:g(["form-control rounded-3",{"is-invalid":this.showInvalidFeedback,"is-valid":this.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=i=>this.value=i),onKeydown:e[1]||(e[1]=i=>this.changed=!0),disabled:this.updating},null,42,Wt),[[x,this.value]]),t("div",Nt,y(this.invalidFeedback),1)]),t("button",{onClick:e[2]||(e[2]=i=>this.useValidation()),disabled:!this.changed,class:"ms-auto btn rounded-3 border-success-subtle bg-success-subtle text-success-emphasis"},[this.updating?(o(),d("span",Yt)):(o(),d("i",Et))],8,Ut)]),u.warning?(o(),d("div",Gt,[t("small",null,[e[3]||(e[3]=t("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),n(a,{t:u.warningText},null,8,["t"])])])):m("",!0)])])])}const jt=_(At,[["render",Ht]]),Bt={name:"dashboardTheme",components:{LocaleText:$},setup(){return{dashboardConfigurationStore:f()}},methods:{async switchTheme(s){await b("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_theme",value:s},e=>{e.status&&(this.dashboardConfigurationStore.Configuration.Server.dashboard_theme=s)})}}},Rt={class:"text-muted mb-1 d-block"},zt={class:"d-flex gap-1"};function Ot(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",null,[t("small",Rt,[t("strong",null,[n(a,{t:"Theme"})])]),t("div",zt,[t("button",{class:g(["btn bg-primary-subtle text-primary-emphasis flex-grow-1",{active:this.dashboardConfigurationStore.Configuration.Server.dashboard_theme==="light"}]),onClick:e[0]||(e[0]=i=>this.switchTheme("light"))},[e[2]||(e[2]=t("i",{class:"bi bi-sun-fill me-2"},null,-1)),n(a,{t:"Light"})],2),t("button",{class:g(["btn bg-primary-subtle text-primary-emphasis flex-grow-1",{active:this.dashboardConfigurationStore.Configuration.Server.dashboard_theme==="dark"}]),onClick:e[1]||(e[1]=i=>this.switchTheme("dark"))},[e[3]||(e[3]=t("i",{class:"bi bi-moon-fill me-2"},null,-1)),n(a,{t:"Dark"})],2)])])}const qt=_(Bt,[["render",Ot]]),Qt={name:"dashboardSettingsInputIPAddressAndPort",props:{},setup(){const s=f(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{app_ip:"",app_port:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.app_ip=this.store.Configuration.Server.app_ip,this.app_port=this.store.Configuration.Server.app_port},methods:{async useValidation(){this.changed&&await b("/api/updateDashboardConfigurationItem",{section:"Server",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message)})}}},Jt={class:"invalid-feedback d-block mt-0"},Xt={class:"row"},Zt={class:"form-group mb-2 col-sm"},te=["for"],ee=["id"],se={class:"form-group col-sm"},ae=["for"],ie=["id"];function oe(s,e,u,c,r,h){return o(),d("div",null,[t("div",Jt,y(this.invalidFeedback),1),t("div",Xt,[t("div",Zt,[t("label",{for:"app_ip_"+this.uuid,class:"text-muted mb-1"},e[2]||(e[2]=[t("strong",null,[t("small",null,"Dashboard IP Address")],-1)]),8,te),w(t("input",{type:"text",class:"form-control mb-2",id:"app_ip_"+this.uuid,"onUpdate:modelValue":e[0]||(e[0]=a=>this.app_ip=a)},null,8,ee),[[x,this.app_ip]]),e[3]||(e[3]=t("div",{class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block"},[t("small",null,[t("i",{class:"bi bi-exclamation-triangle-fill me-2"}),t("code",null,"0.0.0.0"),D(" means it can be access by anyone with your server IP Address.")])],-1))]),t("div",se,[t("label",{for:"app_port_"+this.uuid,class:"text-muted mb-1"},e[4]||(e[4]=[t("strong",null,[t("small",null,"Dashboard Port")],-1)]),8,ae),w(t("input",{type:"text",class:"form-control mb-2",id:"app_port_"+this.uuid,"onUpdate:modelValue":e[1]||(e[1]=a=>this.app_port=a)},null,8,ie),[[x,this.app_port]])])]),e[5]||(e[5]=t("button",{class:"btn btn-success btn-sm fw-bold rounded-3"},[t("i",{class:"bi bi-floppy-fill me-2"}),D("Update Dashboard Settings & Restart ")],-1))])}const ne=_(Qt,[["render",oe]]),de={name:"newDashboardAPIKey",components:{LocaleText:$,VueDatePicker:R},data(){return{newKeyData:{ExpiredAt:C().add(7,"d").format("YYYY-MM-DD HH:mm:ss"),neverExpire:!1},submitting:!1}},setup(){return{store:f()}},mounted(){console.log(this.newKeyData.ExpiredAt)},methods:{submitNewAPIKey(){this.submitting=!0,b("/api/newDashboardAPIKey",this.newKeyData,s=>{s.status?(this.$emit("created",s.data),this.store.newMessage("Server","API Key created","success"),this.$emit("close")):this.store.newMessage("Server",s.message,"danger"),this.submitting=!1})},fixDate(s){return console.log(C(s).format("YYYY-MM-DDTHH:mm:ss")),C(s).format("YYYY-MM-DDTHH:mm:ss")},parseTime(s){s?this.newKeyData.ExpiredAt=C(s).format("YYYY-MM-DD HH:mm:ss"):this.newKeyData.ExpiredAt=void 0}}},re={class:"position-absolute w-100 h-100 top-0 start-0 rounded-bottom-3 p-3 d-flex",style:{"background-color":"#00000060","backdrop-filter":"blur(3px)"}},le={class:"card m-auto rounded-3 mt-5"},ue={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},ce={class:"mb-0"},he={class:"card-body d-flex gap-2 p-4 flex-column"},pe={class:"text-muted"},me={class:"d-flex align-items-center gap-2"},ge={class:"form-check"},be=["disabled"],_e={class:"form-check-label",for:"neverExpire"},fe={key:0,class:"bi bi-check-lg me-2"};function ve(s,e,u,c,r,h){const a=l("LocaleText"),i=l("VueDatePicker");return o(),d("div",re,[t("div",le,[t("div",ue,[t("h6",ce,[n(a,{t:"Create API Key"})]),t("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=k=>this.$emit("close"))})]),t("div",he,[t("small",pe,[n(a,{t:"When should this API Key expire?"})]),t("div",me,[n(i,{is24:!0,"min-date":new Date,"model-value":this.newKeyData.ExpiredAt,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",clearable:!1,disabled:this.newKeyData.neverExpire||this.submitting,dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","disabled","dark"])]),t("div",ge,[w(t("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[1]||(e[1]=k=>this.newKeyData.neverExpire=k),id:"neverExpire",disabled:this.submitting},null,8,be),[[V,this.newKeyData.neverExpire]]),t("label",_e,[n(a,{t:"Never Expire"}),e[3]||(e[3]=D(" (")),e[4]||(e[4]=t("i",{class:"bi bi-emoji-grimace-fill me-2"},null,-1)),n(a,{t:"Don't think that's a good idea"}),e[5]||(e[5]=D(") "))])]),t("button",{class:g(["ms-auto btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm",{disabled:this.submitting}]),onClick:e[2]||(e[2]=k=>this.submitNewAPIKey())},[this.submitting?m("",!0):(o(),d("i",fe)),this.submitting?(o(),v(a,{key:1,t:"Creating..."})):(o(),v(a,{key:2,t:"Create"}))],2)])])])}const we=_(de,[["render",ve]]),ye={name:"dashboardAPIKey",components:{LocaleText:$},props:{apiKey:Object},setup(){return{store:f()}},data(){return{confirmDelete:!1}},methods:{deleteAPIKey(){b("/api/deleteDashboardAPIKey",{Key:this.apiKey.Key},s=>{s.status?(this.$emit("deleted",s.data),this.store.newMessage("Server","API Key deleted","success")):this.store.newMessage("Server",s.message,"danger")})}}},$e={class:"card rounded-3 shadow-sm"},ke={key:0,class:"card-body d-flex gap-3 align-items-center apiKey-card-body"},xe={class:"d-flex align-items-center gap-2"},De={class:"text-muted"},Ie={style:{"word-break":"break-all"}},Pe={class:"d-flex align-items-center gap-2 ms-auto"},Ae={class:"text-muted"},Ce={key:0,class:"card-body d-flex gap-3 align-items-center justify-content-end"};function Se(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",$e,[this.confirmDelete?(o(),d(P,{key:1},[this.store.getActiveCrossServer()?m("",!0):(o(),d("div",Ce,[n(a,{t:"Are you sure to delete this API key?"}),t("a",{role:"button",class:"btn btn-sm bg-success-subtle text-success-emphasis rounded-3",onClick:e[1]||(e[1]=i=>this.deleteAPIKey())},e[4]||(e[4]=[t("i",{class:"bi bi-check-lg"},null,-1)])),t("a",{role:"button",class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis rounded-3",onClick:e[2]||(e[2]=i=>this.confirmDelete=!1)},e[5]||(e[5]=[t("i",{class:"bi bi-x-lg"},null,-1)]))]))],64)):(o(),d("div",ke,[t("div",xe,[t("small",De,[n(a,{t:"Key"})]),t("span",Ie,y(this.apiKey.Key),1)]),t("div",Pe,[t("small",Ae,[n(a,{t:"Expire At"})]),this.apiKey.ExpiredAt?m("",!0):(o(),v(a,{key:0,t:"Never Expire"})),t("span",null,y(this.apiKey.ExpiredAt),1)]),this.store.getActiveCrossServer()?m("",!0):(o(),d("a",{key:0,role:"button",class:"btn btn-sm bg-danger-subtle text-danger-emphasis rounded-3",onClick:e[0]||(e[0]=i=>this.confirmDelete=!0)},e[3]||(e[3]=[t("i",{class:"bi bi-trash-fill"},null,-1)])))]))])}const Ke=_(ye,[["render",Se],["__scopeId","data-v-a76253c8"]]),Te={name:"dashboardAPIKeys",components:{LocaleText:$,DashboardAPIKey:Ke,NewDashboardAPIKey:we},setup(){return{store:f()}},data(){return{value:this.store.Configuration.Server.dashboard_api_key,apiKeys:[],newDashboardAPIKey:!1}},methods:{async toggleDashboardAPIKeys(){await b("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_api_key",value:this.value},s=>{s.status?(this.store.Configuration.Peers[this.targetData]=this.value,this.store.newMessage("Server",`API Keys function is successfully ${this.value?"enabled":"disabled"}`,"success")):(this.value=this.store.Configuration.Peers[this.targetData],this.store.newMessage("Server",`API Keys function is failed to ${this.value?"enabled":"disabled"}`,"danger"))})}},watch:{value:{immediate:!0,handler(s){s?L("/api/getDashboardAPIKeys",{},e=>{e.status?this.apiKeys=e.data:(this.apiKeys=[],this.store.newMessage("Server",e.message,"danger"))}):this.apiKeys=[]}}}},Ve={class:"card rounded-3"},Fe={class:"my-2"},Le={key:0,class:"form-check form-switch ms-auto"},Me={class:"form-check-label",for:"allowAPIKeysSwitch"},We={key:0,class:"card-body position-relative d-flex flex-column gap-2"},Ne={key:1,class:"card",style:{height:"300px"}},Ue={class:"card-body d-flex text-muted"},Ee={class:"m-auto"},Ye={key:2,class:"d-flex flex-column gap-2 position-relative",style:{"min-height":"300px"}};function Ge(s,e,u,c,r,h){const a=l("LocaleText"),i=l("DashboardAPIKey"),k=l("NewDashboardAPIKey");return o(),d("div",Ve,[t("div",{class:g(["card-header d-flex align-items-center",{"border-bottom-0 rounded-3":!this.value}])},[t("h6",Fe,[n(a,{t:"API Keys"})]),this.store.getActiveCrossServer()?m("",!0):(o(),d("div",Le,[w(t("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=p=>this.value=p),onChange:e[1]||(e[1]=p=>this.toggleDashboardAPIKeys()),role:"switch",id:"allowAPIKeysSwitch"},null,544),[[V,this.value]]),t("label",Me,[this.value?(o(),v(a,{key:0,t:"Enabled"})):(o(),v(a,{key:1,t:"Disabled"}))])]))],2),this.value?(o(),d("div",We,[this.store.getActiveCrossServer()?m("",!0):(o(),d("button",{key:0,class:"btn bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle rounded-3 shadow-sm",onClick:e[2]||(e[2]=p=>this.newDashboardAPIKey=!0)},[e[6]||(e[6]=t("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),n(a,{t:"API Key"})])),this.apiKeys.length===0?(o(),d("div",Ne,[t("div",Ue,[t("span",Ee,[n(a,{t:"No WGDashboard API Key"})])])])):(o(),d("div",Ye,[n(H,{name:"apiKey"},{default:T(()=>[(o(!0),d(P,null,S(this.apiKeys,p=>(o(),v(i,{apiKey:p,key:p.Key,onDeleted:e[3]||(e[3]=A=>this.apiKeys=A)},null,8,["apiKey"]))),128))]),_:1})])),n(M,{name:"zoomReversed"},{default:T(()=>[this.newDashboardAPIKey?(o(),v(k,{key:0,onCreated:e[4]||(e[4]=p=>this.apiKeys=p),onClose:e[5]||(e[5]=p=>this.newDashboardAPIKey=!1)})):m("",!0)]),_:1})])):m("",!0)])}const He=_(Te,[["render",Ge],["__scopeId","data-v-100ee9f9"]]),je={name:"accountSettingsMFA",components:{LocaleText:$},setup(){const s=f(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{status:!1}},mounted(){this.status=this.store.Configuration.Account.enable_totp},methods:{async resetMFA(){await b("/api/updateDashboardConfigurationItem",{section:"Account",key:"totp_verified",value:"false"},async s=>{await b("/api/updateDashboardConfigurationItem",{section:"Account",key:"enable_totp",value:"false"},e=>{e.status&&this.$router.push("/2FASetup")})})}}},Be={class:"d-flex align-items-center"},Re={class:"form-check form-switch"},ze={for:"allowMFAKeysSwitch"};function Oe(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",null,[t("div",Be,[t("div",Re,[w(t("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=i=>this.status=i),role:"switch",id:"allowMFAKeysSwitch"},null,512),[[V,this.status]]),t("label",ze,[this.status?(o(),v(a,{key:0,t:"Enabled"})):(o(),v(a,{key:1,t:"Disabled"}))])]),this.status?(o(),d("button",{key:0,class:"btn bg-warning-subtle text-warning-emphasis border-1 border-warning-subtle ms-auto rounded-3 shadow-sm",onClick:e[1]||(e[1]=i=>this.resetMFA())},[e[2]||(e[2]=t("i",{class:"bi bi-shield-lock-fill me-2"},null,-1)),this.store.Configuration.Account.totp_verified?(o(),v(a,{key:0,t:"Reset"})):(o(),v(a,{key:1,t:"Setup"})),e[3]||(e[3]=D(" MFA "))])):m("",!0)])])}const qe=_(je,[["render",Oe]]),Qe={name:"dashboardLanguage",components:{LocaleText:$},setup(){return{store:f()}},data(){return{languages:void 0}},mounted(){L("/api/locale/available",{},s=>{this.languages=s.data})},methods:{changeLanguage(s){b("/api/locale/update",{lang_id:s},e=>{e.status?(this.store.Configuration.Server.dashboard_language=s,this.store.Locale=e.data):this.store.newMessage("Server","WGDashboard language update failed","danger")})}},computed:{currentLanguage(){let s=this.store.Configuration.Server.dashboard_language;return this.languages.find(e=>e.lang_id===s)}}},Je={class:"text-muted d-block mb-1"},Xe={class:"d-flex gap-2"},Ze={class:"dropdown w-100"},ts=["disabled"],es={key:1},ss={class:"dropdown-menu rounded-3 shadow"},as=["onClick"],is={class:"me-auto mb-0"},os={class:"d-block",style:{"font-size":"0.8rem"}},ns={key:0,class:"bi bi-check text-primary fs-5"};function ds(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",null,[t("small",Je,[t("strong",null,[n(a,{t:"Language"})])]),t("div",Xe,[t("div",Ze,[t("button",{class:"btn bg-primary-subtle text-primary-emphasis dropdown-toggle w-100 rounded-3",disabled:!this.languages,type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[this.languages?(o(),d("span",es,y(h.currentLanguage?.lang_name_localized),1)):(o(),v(a,{key:0,t:"Loading..."}))],8,ts),t("ul",ss,[(o(!0),d(P,null,S(this.languages,i=>(o(),d("li",null,[t("a",{class:"dropdown-item d-flex align-items-center",role:"button",onClick:k=>this.changeLanguage(i.lang_id)},[t("p",is,[D(y(i.lang_name_localized)+" ",1),t("small",os,y(i.lang_name),1)]),h.currentLanguage?.lang_id===i.lang_id?(o(),d("i",ns)):m("",!0)],8,as)]))),256))])])])])}const rs=_(Qe,[["render",ds],["__scopeId","data-v-0f26916d"]]),ls={name:"dashboardIPPortInput",components:{LocaleText:$},setup(){return{store:f()}},data(){return{ipAddress:"",port:0,invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.ipAddress=this.store.Configuration.Server.app_ip,this.port=this.store.Configuration.Server.app_port},methods:{async useValidation(s,e,u){this.changed&&(this.updating=!0,await b("/api/updateDashboardConfigurationItem",{section:"Server",key:e,value:u},c=>{c.status?(s.target.classList.add("is-valid"),this.showInvalidFeedback=!1,this.store.Configuration.Server[e]=u,clearTimeout(this.timeout),this.timeout=setTimeout(()=>{s.target.classList.remove("is-valid")},5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=c.message),this.changed=!1,this.updating=!1}))}}},us={class:"row g-2"},cs={class:"col-sm"},hs={class:"form-group"},ps={for:"input_dashboard_ip",class:"text-muted mb-1"},ms=["disabled"],gs={class:"invalid-feedback"},bs={class:"col-sm"},_s={class:"form-group"},fs={for:"input_dashboard_ip",class:"text-muted mb-1"},vs=["disabled"],ws={class:"invalid-feedback"},ys={class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mb-2 mt-2"};function $s(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",null,[t("div",us,[t("div",cs,[t("div",hs,[t("label",ps,[t("strong",null,[t("small",null,[n(a,{t:"IP Address / Hostname"})])])]),w(t("input",{type:"text",class:g(["form-control",{"is-invalid":r.showInvalidFeedback,"is-valid":r.isValid}]),id:"input_dashboard_ip","onUpdate:modelValue":e[0]||(e[0]=i=>this.ipAddress=i),onKeydown:e[1]||(e[1]=i=>this.changed=!0),onBlur:e[2]||(e[2]=i=>h.useValidation(i,"app_ip",this.ipAddress)),disabled:this.updating},null,42,ms),[[x,this.ipAddress]]),t("div",gs,y(this.invalidFeedback),1)])]),t("div",bs,[t("div",_s,[t("label",fs,[t("strong",null,[t("small",null,[n(a,{t:"Listen Port"})])])]),w(t("input",{type:"number",class:g(["form-control",{"is-invalid":r.showInvalidFeedback,"is-valid":r.isValid}]),id:"input_dashboard_ip","onUpdate:modelValue":e[3]||(e[3]=i=>this.port=i),onKeydown:e[4]||(e[4]=i=>this.changed=!0),onBlur:e[5]||(e[5]=i=>h.useValidation(i,"app_port",this.port)),disabled:this.updating},null,42,vs),[[x,this.port]]),t("div",ws,y(this.invalidFeedback),1)])])]),t("div",ys,[t("small",null,[e[6]||(e[6]=t("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),n(a,{t:"Manual restart of WGDashboard is needed to apply changes on IP Address and Listen Port"})])])])}const ks=_(ls,[["render",$s]]),xs={class:"card rounded-3"},Ds={class:"card-header"},Is={class:"my-2"},Ps={class:"card-body d-flex gap-2"},As={class:"list-group w-100"},Cs=["onClick"],Ss={__name:"dashboardSettingsWireguardConfigurationAutostart",setup(s){const e=f(),u=F(),c=j(e.Configuration.WireGuardConfiguration.autostart),r=B(()=>u.Configurations.map(i=>i.Name)),h=async()=>{await b("/api/updateDashboardConfigurationItem",{section:"WireGuardConfiguration",key:"autostart",value:c.value},async i=>{i.status?(e.newMessage("Server","Start up configurations saved","success"),c.value=i.data):e.newMessage("Server","Start up configurations failed to save","danger")})},a=i=>{c.value.includes(i)?c.value=c.value.filter(k=>k!==i):c.value.push(i),h()};return(i,k)=>(o(),d("div",xs,[t("div",Ds,[t("h6",Is,[n($,{t:"Toggle When Start Up"})])]),t("div",Ps,[t("div",As,[(o(!0),d(P,null,S(r.value,p=>(o(),d("button",{type:"button",key:p,onClick:A=>a(p),class:"list-group-item list-group-item-action py-2 w-100 d-flex align-items-center"},[t("samp",null,y(p),1),t("i",{class:g(["ms-auto",[c.value.includes(p)?"bi-check-circle-fill":"bi-circle"]])},null,2)],8,Cs))),128))])])]))}},Ks=_(Ss,[["__scopeId","data-v-4aa2aed9"]]),Ts={name:"settings",methods:{ipV46RegexCheck:et},components:{DashboardSettingsWireguardConfigurationAutostart:Ks,DashboardIPPortInput:ks,DashboardLanguage:rs,LocaleText:$,AccountSettingsMFA:qe,DashboardAPIKeys:He,DashboardSettingsInputIPAddressAndPort:ne,DashboardTheme:qt,DashboardSettingsInputWireguardConfigurationPath:jt,AccountSettingsInputPassword:Pt,AccountSettingsInputUsername:rt,PeersDefaultSettingsInput:tt},setup(){return{dashboardConfigurationStore:f()}},data(){return{activeTab:"WGDashboard",tabs:[{id:"WGDashboard",title:"WGDashboard Settings"},{id:"Peers",title:"Peers Settings"},{id:"WireGuardConfiguration",title:"WireGuard Configuration Settings"}]}}},Vs={class:"mt-md-5 mt-3 text-body mb-3"},Fs={class:"container-md d-flex flex-column gap-4"},Ls={class:"nav nav-pills nav-justified align-items-center gap-2"},Ms={class:"nav-item"},Ws=["onClick"],Ns={class:"my-2"},Us={key:0,class:"d-flex gap-3 flex-column"},Es={key:1,class:"d-flex gap-3 flex-column"},Ys={class:"card rounded-3"},Gs={class:"card-header"},Hs={class:"my-2"},js={class:"card-body"},Bs={key:2,class:"d-flex gap-3 flex-column"},Rs={class:"card rounded-3"},zs={class:"card-header"},Os={class:"my-2"},qs={class:"card-body"},Qs={class:"row g-2"},Js={class:"col-sm"},Xs={class:"col-sm"},Zs={class:"card"},ta={class:"card-header"},ea={class:"my-2"},sa={class:"card-body"},aa={class:"card"},ia={class:"card-header"},oa={class:"my-2"},na={class:"card-body d-flex flex-column gap-3"},da={class:"card"},ra={class:"card-header"},la={class:"my-2"},ua={class:"card-body"};function ca(s,e,u,c,r,h){const a=l("LocaleText"),i=l("DashboardSettingsInputWireguardConfigurationPath"),k=l("DashboardSettingsWireguardConfigurationAutostart"),p=l("PeersDefaultSettingsInput"),A=l("DashboardTheme"),W=l("DashboardLanguage"),N=l("DashboardIPPortInput"),U=l("AccountSettingsInputUsername"),E=l("AccountSettingsInputPassword"),Y=l("AccountSettingsMFA"),G=l("DashboardAPIKeys");return o(),d("div",Vs,[t("div",Fs,[t("div",null,[t("ul",Ls,[(o(!0),d(P,null,S(this.tabs,K=>(o(),d("li",Ms,[t("a",{class:g(["nav-link rounded-3",{active:this.activeTab===K.id}]),onClick:ha=>this.activeTab=K.id,role:"button"},[t("h6",Ns,[n(a,{t:K.title},null,8,["t"])])],10,Ws)]))),256))]),e[1]||(e[1]=t("hr",null,null,-1)),t("div",null,[n(M,{name:"fade2",mode:"out-in"},{default:T(()=>[r.activeTab==="WireGuardConfiguration"?(o(),d("div",Us,[n(i,{targetData:"wg_conf_path",title:"Configurations Directory",warning:!0,"warning-text":"Remember to remove / at the end of your path. e.g /etc/wireguard"}),n(k)])):r.activeTab==="Peers"?(o(),d("div",Es,[t("div",Ys,[t("div",Gs,[t("h6",Hs,[n(a,{t:"Peer Default Settings"})])]),t("div",js,[t("div",null,[n(p,{targetData:"peer_global_dns",title:"DNS"}),n(p,{targetData:"peer_endpoint_allowed_ip",title:"Endpoint Allowed IPs"}),n(p,{targetData:"peer_mtu",title:"MTU"}),n(p,{targetData:"peer_keep_alive",title:"Persistent Keepalive"}),n(p,{targetData:"remote_endpoint",title:"Peer Remote Endpoint",warning:!0,warningText:"This will be changed globally, and will be apply to all peer's QR code and configuration file."})])])])])):r.activeTab==="WGDashboard"?(o(),d("div",Bs,[t("div",Rs,[t("div",zs,[t("h6",Os,[n(a,{t:"Appearance"})])]),t("div",qs,[t("div",Qs,[t("div",Js,[n(A)]),t("div",Xs,[n(W)])])])]),t("div",Zs,[t("div",ta,[t("h6",ea,[n(a,{t:"Dashboard IP Address & Listen Port"})])]),t("div",sa,[n(N)])]),t("div",aa,[t("div",ia,[t("h6",oa,[n(a,{t:"Account Settings"})])]),t("div",na,[t("div",null,[n(U,{targetData:"username",title:"Username"})]),e[0]||(e[0]=t("hr",null,null,-1)),t("div",null,[n(E,{targetData:"password"})])])]),t("div",da,[t("div",ra,[t("h6",la,[n(a,{t:"Multi-Factor Authentication (MFA)"})])]),t("div",ua,[this.dashboardConfigurationStore.getActiveCrossServer()?m("",!0):(o(),v(Y,{key:0}))])]),n(G)])):m("",!0)]),_:1})])])])])}const _a=_(Ts,[["render",ca]]);export{_a as default}; +import{_,D as f,p as I,q as b,a as o,c as d,b as t,d as n,m as w,s as x,n as g,t as y,e as m,j as l,W as F,f as D,v as V,i as v,F as P,g as L,w as T,h as S,k as H,T as M,r as j,x as B}from"./index-DOaPWS1X.js";import{L as $}from"./localeText-CaAXeE0W.js";import{d as C}from"./dayjs.min-D8jwq_wn.js";import{V as R}from"./vue-datepicker-D91GxXPq.js";const z={components:{LocaleText:$},props:{targetData:String,title:String,warning:!1,warningText:""},setup(){const s=f(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Peers[this.targetData]},methods:{async useValidation(){this.changed&&await b("/api/updateDashboardConfigurationItem",{section:"Peers",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Peers[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message),this.changed=!1,this.updating=!1})}}},O={class:"form-group mb-2"},q=["for"],Q=["id","disabled"],J={class:"invalid-feedback"},X={key:0,class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mt-1"};function Z(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",O,[t("label",{for:this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[n(a,{t:this.title},null,8,["t"])])])],8,q),w(t("input",{type:"text",class:g(["form-control",{"is-invalid":r.showInvalidFeedback,"is-valid":r.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=i=>this.value=i),onKeydown:e[1]||(e[1]=i=>this.changed=!0),onBlur:e[2]||(e[2]=i=>h.useValidation()),disabled:this.updating},null,42,Q),[[x,this.value]]),t("div",J,y(this.invalidFeedback),1),u.warning?(o(),d("div",X,[t("small",null,[e[3]||(e[3]=t("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),n(a,{t:u.warningText},null,8,["t"])])])):m("",!0)])}const tt=_(z,[["render",Z]]),et=s=>{},st={name:"accountSettingsInputUsername",components:{LocaleText:$},props:{targetData:String,title:String},setup(){const s=f(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Account[this.targetData]},methods:{async useValidation(s){this.changed&&(this.updating=!0,await b("/api/updateDashboardConfigurationItem",{section:"Account",key:this.targetData,value:this.value},e=>{e.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=e.message),this.changed=!1,this.updating=!1}))}}},at={class:"form-group mb-2"},it=["for"],ot=["id","disabled"],nt={class:"invalid-feedback"};function dt(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",at,[t("label",{for:this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[n(a,{t:this.title},null,8,["t"])])])],8,it),w(t("input",{type:"text",class:g(["form-control",{"is-invalid":r.showInvalidFeedback,"is-valid":r.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=i=>this.value=i),onKeydown:e[1]||(e[1]=i=>this.changed=!0),onBlur:e[2]||(e[2]=i=>h.useValidation()),disabled:this.updating},null,42,ot),[[x,this.value]]),t("div",nt,y(this.invalidFeedback),1)])}const rt=_(st,[["render",dt]]),lt={name:"accountSettingsInputPassword",components:{LocaleText:$},props:{targetData:String,warning:!1,warningText:""},setup(){const s=f(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{value:{currentPassword:"",newPassword:"",repeatNewPassword:""},invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0}},methods:{async useValidation(){Object.values(this.value).find(s=>s.length===0)===void 0?this.value.newPassword===this.value.repeatNewPassword?await b("/api/updateDashboardConfigurationItem",{section:"Account",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>{this.isValid=!1,this.value={currentPassword:"",newPassword:"",repeatNewPassword:""}},5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message)}):(this.showInvalidFeedback=!0,this.invalidFeedback="New passwords does not match"):(this.showInvalidFeedback=!0,this.invalidFeedback="Please fill in all required fields.")}},computed:{passwordValid(){return Object.values(this.value).find(s=>s.length===0)===void 0&&this.value.newPassword===this.value.repeatNewPassword}}},ut={class:"d-flex flex-column gap-2"},ct={class:"row g-2"},ht={class:"col-sm"},pt={class:"form-group"},mt=["for"],gt=["id"],bt={key:0,class:"invalid-feedback d-block"},_t={class:"col-sm"},ft={class:"form-group"},vt=["for"],wt=["id"],yt={class:"col-sm"},$t={class:"form-group"},kt=["for"],xt=["id"],Dt=["disabled"];function It(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("form",ut,[t("div",ct,[t("div",ht,[t("div",pt,[t("label",{for:"currentPassword_"+this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[n(a,{t:"Current Password"})])])],8,mt),w(t("input",{type:"password",class:g(["form-control",{"is-invalid":r.showInvalidFeedback,"is-valid":r.isValid}]),autocomplete:"current-password","onUpdate:modelValue":e[0]||(e[0]=i=>this.value.currentPassword=i),id:"currentPassword_"+this.uuid},null,10,gt),[[x,this.value.currentPassword]]),r.showInvalidFeedback?(o(),d("div",bt,y(this.invalidFeedback),1)):m("",!0)])]),t("div",_t,[t("div",ft,[t("label",{for:"newPassword_"+this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[n(a,{t:"New Password"})])])],8,vt),w(t("input",{type:"password",class:g(["form-control",{"is-invalid":r.showInvalidFeedback,"is-valid":r.isValid}]),autocomplete:"new-password","onUpdate:modelValue":e[1]||(e[1]=i=>this.value.newPassword=i),id:"newPassword_"+this.uuid},null,10,wt),[[x,this.value.newPassword]])])]),t("div",yt,[t("div",$t,[t("label",{for:"repeatNewPassword_"+this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[n(a,{t:"Repeat New Password"})])])],8,kt),w(t("input",{type:"password",class:g(["form-control",{"is-invalid":r.showInvalidFeedback,"is-valid":r.isValid}]),autocomplete:"new-password","onUpdate:modelValue":e[2]||(e[2]=i=>this.value.repeatNewPassword=i),id:"repeatNewPassword_"+this.uuid},null,10,xt),[[x,this.value.repeatNewPassword]])])])]),t("button",{disabled:!this.passwordValid,class:"ms-auto btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm",onClick:e[3]||(e[3]=i=>this.useValidation())},[e[4]||(e[4]=t("i",{class:"bi bi-save2-fill me-2"},null,-1)),n(a,{t:"Update Password"})],8,Dt)])}const Pt=_(lt,[["render",It]]),At={name:"dashboardSettingsInputWireguardConfigurationPath",components:{LocaleText:$},props:{targetData:String,title:String,warning:!1,warningText:""},setup(){const s=f(),e=F(),u=`input_${I()}`;return{store:s,uuid:u,WireguardConfigurationStore:e}},data(){return{value:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.value=this.store.Configuration.Server[this.targetData]},methods:{async useValidation(){this.changed&&(this.updating=!0,await b("/api/updateDashboardConfigurationItem",{section:"Server",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3),this.WireguardConfigurationStore.getConfigurations(),this.store.newMessage("Server","WireGuard configuration path saved","success")):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message),this.changed=!1,this.updating=!1}))}}},Ct={class:"card"},St={class:"card-header"},Kt={class:"my-2"},Tt={class:"card-body"},Vt={class:"form-group"},Ft=["for"],Lt={class:"d-flex gap-2 align-items-start"},Mt={class:"flex-grow-1"},Wt=["id","disabled"],Nt={class:"invalid-feedback fw-bold"},Ut=["disabled"],Et={key:0,class:"bi bi-save2-fill"},Yt={key:1,class:"spinner-border spinner-border-sm"},Gt={key:0,class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mt-1 mb-2"};function Ht(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",Ct,[t("div",St,[t("h6",Kt,[n(a,{t:"Path"})])]),t("div",Tt,[t("div",Vt,[t("label",{for:this.uuid,class:"text-muted mb-1"},[t("strong",null,[t("small",null,[n(a,{t:this.title},null,8,["t"])])])],8,Ft),t("div",Lt,[t("div",Mt,[w(t("input",{type:"text",class:g(["form-control rounded-3",{"is-invalid":this.showInvalidFeedback,"is-valid":this.isValid}]),id:this.uuid,"onUpdate:modelValue":e[0]||(e[0]=i=>this.value=i),onKeydown:e[1]||(e[1]=i=>this.changed=!0),disabled:this.updating},null,42,Wt),[[x,this.value]]),t("div",Nt,y(this.invalidFeedback),1)]),t("button",{onClick:e[2]||(e[2]=i=>this.useValidation()),disabled:!this.changed,class:"ms-auto btn rounded-3 border-success-subtle bg-success-subtle text-success-emphasis"},[this.updating?(o(),d("span",Yt)):(o(),d("i",Et))],8,Ut)]),u.warning?(o(),d("div",Gt,[t("small",null,[e[3]||(e[3]=t("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),n(a,{t:u.warningText},null,8,["t"])])])):m("",!0)])])])}const jt=_(At,[["render",Ht]]),Bt={name:"dashboardTheme",components:{LocaleText:$},setup(){return{dashboardConfigurationStore:f()}},methods:{async switchTheme(s){await b("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_theme",value:s},e=>{e.status&&(this.dashboardConfigurationStore.Configuration.Server.dashboard_theme=s)})}}},Rt={class:"text-muted mb-1 d-block"},zt={class:"d-flex gap-1"};function Ot(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",null,[t("small",Rt,[t("strong",null,[n(a,{t:"Theme"})])]),t("div",zt,[t("button",{class:g(["btn bg-primary-subtle text-primary-emphasis flex-grow-1",{active:this.dashboardConfigurationStore.Configuration.Server.dashboard_theme==="light"}]),onClick:e[0]||(e[0]=i=>this.switchTheme("light"))},[e[2]||(e[2]=t("i",{class:"bi bi-sun-fill me-2"},null,-1)),n(a,{t:"Light"})],2),t("button",{class:g(["btn bg-primary-subtle text-primary-emphasis flex-grow-1",{active:this.dashboardConfigurationStore.Configuration.Server.dashboard_theme==="dark"}]),onClick:e[1]||(e[1]=i=>this.switchTheme("dark"))},[e[3]||(e[3]=t("i",{class:"bi bi-moon-fill me-2"},null,-1)),n(a,{t:"Dark"})],2)])])}const qt=_(Bt,[["render",Ot]]),Qt={name:"dashboardSettingsInputIPAddressAndPort",props:{},setup(){const s=f(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{app_ip:"",app_port:"",invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.app_ip=this.store.Configuration.Server.app_ip,this.app_port=this.store.Configuration.Server.app_port},methods:{async useValidation(){this.changed&&await b("/api/updateDashboardConfigurationItem",{section:"Server",key:this.targetData,value:this.value},s=>{s.status?(this.isValid=!0,this.showInvalidFeedback=!1,this.store.Configuration.Account[this.targetData]=this.value,clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.isValid=!1,5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=s.message)})}}},Jt={class:"invalid-feedback d-block mt-0"},Xt={class:"row"},Zt={class:"form-group mb-2 col-sm"},te=["for"],ee=["id"],se={class:"form-group col-sm"},ae=["for"],ie=["id"];function oe(s,e,u,c,r,h){return o(),d("div",null,[t("div",Jt,y(this.invalidFeedback),1),t("div",Xt,[t("div",Zt,[t("label",{for:"app_ip_"+this.uuid,class:"text-muted mb-1"},e[2]||(e[2]=[t("strong",null,[t("small",null,"Dashboard IP Address")],-1)]),8,te),w(t("input",{type:"text",class:"form-control mb-2",id:"app_ip_"+this.uuid,"onUpdate:modelValue":e[0]||(e[0]=a=>this.app_ip=a)},null,8,ee),[[x,this.app_ip]]),e[3]||(e[3]=t("div",{class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block"},[t("small",null,[t("i",{class:"bi bi-exclamation-triangle-fill me-2"}),t("code",null,"0.0.0.0"),D(" means it can be access by anyone with your server IP Address.")])],-1))]),t("div",se,[t("label",{for:"app_port_"+this.uuid,class:"text-muted mb-1"},e[4]||(e[4]=[t("strong",null,[t("small",null,"Dashboard Port")],-1)]),8,ae),w(t("input",{type:"text",class:"form-control mb-2",id:"app_port_"+this.uuid,"onUpdate:modelValue":e[1]||(e[1]=a=>this.app_port=a)},null,8,ie),[[x,this.app_port]])])]),e[5]||(e[5]=t("button",{class:"btn btn-success btn-sm fw-bold rounded-3"},[t("i",{class:"bi bi-floppy-fill me-2"}),D("Update Dashboard Settings & Restart ")],-1))])}const ne=_(Qt,[["render",oe]]),de={name:"newDashboardAPIKey",components:{LocaleText:$,VueDatePicker:R},data(){return{newKeyData:{ExpiredAt:C().add(7,"d").format("YYYY-MM-DD HH:mm:ss"),neverExpire:!1},submitting:!1}},setup(){return{store:f()}},mounted(){console.log(this.newKeyData.ExpiredAt)},methods:{submitNewAPIKey(){this.submitting=!0,b("/api/newDashboardAPIKey",this.newKeyData,s=>{s.status?(this.$emit("created",s.data),this.store.newMessage("Server","API Key created","success"),this.$emit("close")):this.store.newMessage("Server",s.message,"danger"),this.submitting=!1})},fixDate(s){return console.log(C(s).format("YYYY-MM-DDTHH:mm:ss")),C(s).format("YYYY-MM-DDTHH:mm:ss")},parseTime(s){s?this.newKeyData.ExpiredAt=C(s).format("YYYY-MM-DD HH:mm:ss"):this.newKeyData.ExpiredAt=void 0}}},re={class:"position-absolute w-100 h-100 top-0 start-0 rounded-bottom-3 p-3 d-flex",style:{"background-color":"#00000060","backdrop-filter":"blur(3px)"}},le={class:"card m-auto rounded-3 mt-5"},ue={class:"card-header bg-transparent d-flex align-items-center gap-2 border-0 p-4 pb-0"},ce={class:"mb-0"},he={class:"card-body d-flex gap-2 p-4 flex-column"},pe={class:"text-muted"},me={class:"d-flex align-items-center gap-2"},ge={class:"form-check"},be=["disabled"],_e={class:"form-check-label",for:"neverExpire"},fe={key:0,class:"bi bi-check-lg me-2"};function ve(s,e,u,c,r,h){const a=l("LocaleText"),i=l("VueDatePicker");return o(),d("div",re,[t("div",le,[t("div",ue,[t("h6",ce,[n(a,{t:"Create API Key"})]),t("button",{type:"button",class:"btn-close ms-auto",onClick:e[0]||(e[0]=k=>this.$emit("close"))})]),t("div",he,[t("small",pe,[n(a,{t:"When should this API Key expire?"})]),t("div",me,[n(i,{is24:!0,"min-date":new Date,"model-value":this.newKeyData.ExpiredAt,"onUpdate:modelValue":this.parseTime,"time-picker-inline":"",format:"yyyy-MM-dd HH:mm:ss","preview-format":"yyyy-MM-dd HH:mm:ss",clearable:!1,disabled:this.newKeyData.neverExpire||this.submitting,dark:this.store.Configuration.Server.dashboard_theme==="dark"},null,8,["min-date","model-value","onUpdate:modelValue","disabled","dark"])]),t("div",ge,[w(t("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[1]||(e[1]=k=>this.newKeyData.neverExpire=k),id:"neverExpire",disabled:this.submitting},null,8,be),[[V,this.newKeyData.neverExpire]]),t("label",_e,[n(a,{t:"Never Expire"}),e[3]||(e[3]=D(" (")),e[4]||(e[4]=t("i",{class:"bi bi-emoji-grimace-fill me-2"},null,-1)),n(a,{t:"Don't think that's a good idea"}),e[5]||(e[5]=D(") "))])]),t("button",{class:g(["ms-auto btn bg-success-subtle text-success-emphasis border-1 border-success-subtle rounded-3 shadow-sm",{disabled:this.submitting}]),onClick:e[2]||(e[2]=k=>this.submitNewAPIKey())},[this.submitting?m("",!0):(o(),d("i",fe)),this.submitting?(o(),v(a,{key:1,t:"Creating..."})):(o(),v(a,{key:2,t:"Create"}))],2)])])])}const we=_(de,[["render",ve]]),ye={name:"dashboardAPIKey",components:{LocaleText:$},props:{apiKey:Object},setup(){return{store:f()}},data(){return{confirmDelete:!1}},methods:{deleteAPIKey(){b("/api/deleteDashboardAPIKey",{Key:this.apiKey.Key},s=>{s.status?(this.$emit("deleted",s.data),this.store.newMessage("Server","API Key deleted","success")):this.store.newMessage("Server",s.message,"danger")})}}},$e={class:"card rounded-3 shadow-sm"},ke={key:0,class:"card-body d-flex gap-3 align-items-center apiKey-card-body"},xe={class:"d-flex align-items-center gap-2"},De={class:"text-muted"},Ie={style:{"word-break":"break-all"}},Pe={class:"d-flex align-items-center gap-2 ms-auto"},Ae={class:"text-muted"},Ce={key:0,class:"card-body d-flex gap-3 align-items-center justify-content-end"};function Se(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",$e,[this.confirmDelete?(o(),d(P,{key:1},[this.store.getActiveCrossServer()?m("",!0):(o(),d("div",Ce,[n(a,{t:"Are you sure to delete this API key?"}),t("a",{role:"button",class:"btn btn-sm bg-success-subtle text-success-emphasis rounded-3",onClick:e[1]||(e[1]=i=>this.deleteAPIKey())},e[4]||(e[4]=[t("i",{class:"bi bi-check-lg"},null,-1)])),t("a",{role:"button",class:"btn btn-sm bg-secondary-subtle text-secondary-emphasis rounded-3",onClick:e[2]||(e[2]=i=>this.confirmDelete=!1)},e[5]||(e[5]=[t("i",{class:"bi bi-x-lg"},null,-1)]))]))],64)):(o(),d("div",ke,[t("div",xe,[t("small",De,[n(a,{t:"Key"})]),t("span",Ie,y(this.apiKey.Key),1)]),t("div",Pe,[t("small",Ae,[n(a,{t:"Expire At"})]),this.apiKey.ExpiredAt?m("",!0):(o(),v(a,{key:0,t:"Never Expire"})),t("span",null,y(this.apiKey.ExpiredAt),1)]),this.store.getActiveCrossServer()?m("",!0):(o(),d("a",{key:0,role:"button",class:"btn btn-sm bg-danger-subtle text-danger-emphasis rounded-3",onClick:e[0]||(e[0]=i=>this.confirmDelete=!0)},e[3]||(e[3]=[t("i",{class:"bi bi-trash-fill"},null,-1)])))]))])}const Ke=_(ye,[["render",Se],["__scopeId","data-v-a76253c8"]]),Te={name:"dashboardAPIKeys",components:{LocaleText:$,DashboardAPIKey:Ke,NewDashboardAPIKey:we},setup(){return{store:f()}},data(){return{value:this.store.Configuration.Server.dashboard_api_key,apiKeys:[],newDashboardAPIKey:!1}},methods:{async toggleDashboardAPIKeys(){await b("/api/updateDashboardConfigurationItem",{section:"Server",key:"dashboard_api_key",value:this.value},s=>{s.status?(this.store.Configuration.Peers[this.targetData]=this.value,this.store.newMessage("Server",`API Keys function is successfully ${this.value?"enabled":"disabled"}`,"success")):(this.value=this.store.Configuration.Peers[this.targetData],this.store.newMessage("Server",`API Keys function is failed to ${this.value?"enabled":"disabled"}`,"danger"))})}},watch:{value:{immediate:!0,handler(s){s?L("/api/getDashboardAPIKeys",{},e=>{e.status?this.apiKeys=e.data:(this.apiKeys=[],this.store.newMessage("Server",e.message,"danger"))}):this.apiKeys=[]}}}},Ve={class:"card rounded-3"},Fe={class:"my-2"},Le={key:0,class:"form-check form-switch ms-auto"},Me={class:"form-check-label",for:"allowAPIKeysSwitch"},We={key:0,class:"card-body position-relative d-flex flex-column gap-2"},Ne={key:1,class:"card",style:{height:"300px"}},Ue={class:"card-body d-flex text-muted"},Ee={class:"m-auto"},Ye={key:2,class:"d-flex flex-column gap-2 position-relative",style:{"min-height":"300px"}};function Ge(s,e,u,c,r,h){const a=l("LocaleText"),i=l("DashboardAPIKey"),k=l("NewDashboardAPIKey");return o(),d("div",Ve,[t("div",{class:g(["card-header d-flex align-items-center",{"border-bottom-0 rounded-3":!this.value}])},[t("h6",Fe,[n(a,{t:"API Keys"})]),this.store.getActiveCrossServer()?m("",!0):(o(),d("div",Le,[w(t("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=p=>this.value=p),onChange:e[1]||(e[1]=p=>this.toggleDashboardAPIKeys()),role:"switch",id:"allowAPIKeysSwitch"},null,544),[[V,this.value]]),t("label",Me,[this.value?(o(),v(a,{key:0,t:"Enabled"})):(o(),v(a,{key:1,t:"Disabled"}))])]))],2),this.value?(o(),d("div",We,[this.store.getActiveCrossServer()?m("",!0):(o(),d("button",{key:0,class:"btn bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle rounded-3 shadow-sm",onClick:e[2]||(e[2]=p=>this.newDashboardAPIKey=!0)},[e[6]||(e[6]=t("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),n(a,{t:"API Key"})])),this.apiKeys.length===0?(o(),d("div",Ne,[t("div",Ue,[t("span",Ee,[n(a,{t:"No WGDashboard API Key"})])])])):(o(),d("div",Ye,[n(H,{name:"apiKey"},{default:T(()=>[(o(!0),d(P,null,S(this.apiKeys,p=>(o(),v(i,{apiKey:p,key:p.Key,onDeleted:e[3]||(e[3]=A=>this.apiKeys=A)},null,8,["apiKey"]))),128))]),_:1})])),n(M,{name:"zoomReversed"},{default:T(()=>[this.newDashboardAPIKey?(o(),v(k,{key:0,onCreated:e[4]||(e[4]=p=>this.apiKeys=p),onClose:e[5]||(e[5]=p=>this.newDashboardAPIKey=!1)})):m("",!0)]),_:1})])):m("",!0)])}const He=_(Te,[["render",Ge],["__scopeId","data-v-100ee9f9"]]),je={name:"accountSettingsMFA",components:{LocaleText:$},setup(){const s=f(),e=`input_${I()}`;return{store:s,uuid:e}},data(){return{status:!1}},mounted(){this.status=this.store.Configuration.Account.enable_totp},methods:{async resetMFA(){await b("/api/updateDashboardConfigurationItem",{section:"Account",key:"totp_verified",value:"false"},async s=>{await b("/api/updateDashboardConfigurationItem",{section:"Account",key:"enable_totp",value:"false"},e=>{e.status&&this.$router.push("/2FASetup")})})}}},Be={class:"d-flex align-items-center"},Re={class:"form-check form-switch"},ze={for:"allowMFAKeysSwitch"};function Oe(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",null,[t("div",Be,[t("div",Re,[w(t("input",{class:"form-check-input",type:"checkbox","onUpdate:modelValue":e[0]||(e[0]=i=>this.status=i),role:"switch",id:"allowMFAKeysSwitch"},null,512),[[V,this.status]]),t("label",ze,[this.status?(o(),v(a,{key:0,t:"Enabled"})):(o(),v(a,{key:1,t:"Disabled"}))])]),this.status?(o(),d("button",{key:0,class:"btn bg-warning-subtle text-warning-emphasis border-1 border-warning-subtle ms-auto rounded-3 shadow-sm",onClick:e[1]||(e[1]=i=>this.resetMFA())},[e[2]||(e[2]=t("i",{class:"bi bi-shield-lock-fill me-2"},null,-1)),this.store.Configuration.Account.totp_verified?(o(),v(a,{key:0,t:"Reset"})):(o(),v(a,{key:1,t:"Setup"})),e[3]||(e[3]=D(" MFA "))])):m("",!0)])])}const qe=_(je,[["render",Oe]]),Qe={name:"dashboardLanguage",components:{LocaleText:$},setup(){return{store:f()}},data(){return{languages:void 0}},mounted(){L("/api/locale/available",{},s=>{this.languages=s.data})},methods:{changeLanguage(s){b("/api/locale/update",{lang_id:s},e=>{e.status?(this.store.Configuration.Server.dashboard_language=s,this.store.Locale=e.data):this.store.newMessage("Server","WGDashboard language update failed","danger")})}},computed:{currentLanguage(){let s=this.store.Configuration.Server.dashboard_language;return this.languages.find(e=>e.lang_id===s)}}},Je={class:"text-muted d-block mb-1"},Xe={class:"d-flex gap-2"},Ze={class:"dropdown w-100"},ts=["disabled"],es={key:1},ss={class:"dropdown-menu rounded-3 shadow"},as=["onClick"],is={class:"me-auto mb-0"},os={class:"d-block",style:{"font-size":"0.8rem"}},ns={key:0,class:"bi bi-check text-primary fs-5"};function ds(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",null,[t("small",Je,[t("strong",null,[n(a,{t:"Language"})])]),t("div",Xe,[t("div",Ze,[t("button",{class:"btn bg-primary-subtle text-primary-emphasis dropdown-toggle w-100 rounded-3",disabled:!this.languages,type:"button","data-bs-toggle":"dropdown","aria-expanded":"false"},[this.languages?(o(),d("span",es,y(h.currentLanguage?.lang_name_localized),1)):(o(),v(a,{key:0,t:"Loading..."}))],8,ts),t("ul",ss,[(o(!0),d(P,null,S(this.languages,i=>(o(),d("li",null,[t("a",{class:"dropdown-item d-flex align-items-center",role:"button",onClick:k=>this.changeLanguage(i.lang_id)},[t("p",is,[D(y(i.lang_name_localized)+" ",1),t("small",os,y(i.lang_name),1)]),h.currentLanguage?.lang_id===i.lang_id?(o(),d("i",ns)):m("",!0)],8,as)]))),256))])])])])}const rs=_(Qe,[["render",ds],["__scopeId","data-v-0f26916d"]]),ls={name:"dashboardIPPortInput",components:{LocaleText:$},setup(){return{store:f()}},data(){return{ipAddress:"",port:0,invalidFeedback:"",showInvalidFeedback:!1,isValid:!1,timeout:void 0,changed:!1,updating:!1}},mounted(){this.ipAddress=this.store.Configuration.Server.app_ip,this.port=this.store.Configuration.Server.app_port},methods:{async useValidation(s,e,u){this.changed&&(this.updating=!0,await b("/api/updateDashboardConfigurationItem",{section:"Server",key:e,value:u},c=>{c.status?(s.target.classList.add("is-valid"),this.showInvalidFeedback=!1,this.store.Configuration.Server[e]=u,clearTimeout(this.timeout),this.timeout=setTimeout(()=>{s.target.classList.remove("is-valid")},5e3)):(this.isValid=!1,this.showInvalidFeedback=!0,this.invalidFeedback=c.message),this.changed=!1,this.updating=!1}))}}},us={class:"row g-2"},cs={class:"col-sm"},hs={class:"form-group"},ps={for:"input_dashboard_ip",class:"text-muted mb-1"},ms=["disabled"],gs={class:"invalid-feedback"},bs={class:"col-sm"},_s={class:"form-group"},fs={for:"input_dashboard_ip",class:"text-muted mb-1"},vs=["disabled"],ws={class:"invalid-feedback"},ys={class:"px-2 py-1 text-warning-emphasis bg-warning-subtle border border-warning-subtle rounded-2 d-inline-block mb-2 mt-2"};function $s(s,e,u,c,r,h){const a=l("LocaleText");return o(),d("div",null,[t("div",us,[t("div",cs,[t("div",hs,[t("label",ps,[t("strong",null,[t("small",null,[n(a,{t:"IP Address / Hostname"})])])]),w(t("input",{type:"text",class:g(["form-control",{"is-invalid":r.showInvalidFeedback,"is-valid":r.isValid}]),id:"input_dashboard_ip","onUpdate:modelValue":e[0]||(e[0]=i=>this.ipAddress=i),onKeydown:e[1]||(e[1]=i=>this.changed=!0),onBlur:e[2]||(e[2]=i=>h.useValidation(i,"app_ip",this.ipAddress)),disabled:this.updating},null,42,ms),[[x,this.ipAddress]]),t("div",gs,y(this.invalidFeedback),1)])]),t("div",bs,[t("div",_s,[t("label",fs,[t("strong",null,[t("small",null,[n(a,{t:"Listen Port"})])])]),w(t("input",{type:"number",class:g(["form-control",{"is-invalid":r.showInvalidFeedback,"is-valid":r.isValid}]),id:"input_dashboard_ip","onUpdate:modelValue":e[3]||(e[3]=i=>this.port=i),onKeydown:e[4]||(e[4]=i=>this.changed=!0),onBlur:e[5]||(e[5]=i=>h.useValidation(i,"app_port",this.port)),disabled:this.updating},null,42,vs),[[x,this.port]]),t("div",ws,y(this.invalidFeedback),1)])])]),t("div",ys,[t("small",null,[e[6]||(e[6]=t("i",{class:"bi bi-exclamation-triangle-fill me-2"},null,-1)),n(a,{t:"Manual restart of WGDashboard is needed to apply changes on IP Address and Listen Port"})])])])}const ks=_(ls,[["render",$s]]),xs={class:"card rounded-3"},Ds={class:"card-header"},Is={class:"my-2"},Ps={class:"card-body d-flex gap-2"},As={class:"list-group w-100"},Cs=["onClick"],Ss={__name:"dashboardSettingsWireguardConfigurationAutostart",setup(s){const e=f(),u=F(),c=j(e.Configuration.WireGuardConfiguration.autostart),r=B(()=>u.Configurations.map(i=>i.Name)),h=async()=>{await b("/api/updateDashboardConfigurationItem",{section:"WireGuardConfiguration",key:"autostart",value:c.value},async i=>{i.status?(e.newMessage("Server","Start up configurations saved","success"),c.value=i.data):e.newMessage("Server","Start up configurations failed to save","danger")})},a=i=>{c.value.includes(i)?c.value=c.value.filter(k=>k!==i):c.value.push(i),h()};return(i,k)=>(o(),d("div",xs,[t("div",Ds,[t("h6",Is,[n($,{t:"Toggle When Start Up"})])]),t("div",Ps,[t("div",As,[(o(!0),d(P,null,S(r.value,p=>(o(),d("button",{type:"button",key:p,onClick:A=>a(p),class:"list-group-item list-group-item-action py-2 w-100 d-flex align-items-center"},[t("samp",null,y(p),1),t("i",{class:g(["ms-auto",[c.value.includes(p)?"bi-check-circle-fill":"bi-circle"]])},null,2)],8,Cs))),128))])])]))}},Ks=_(Ss,[["__scopeId","data-v-4aa2aed9"]]),Ts={name:"settings",methods:{ipV46RegexCheck:et},components:{DashboardSettingsWireguardConfigurationAutostart:Ks,DashboardIPPortInput:ks,DashboardLanguage:rs,LocaleText:$,AccountSettingsMFA:qe,DashboardAPIKeys:He,DashboardSettingsInputIPAddressAndPort:ne,DashboardTheme:qt,DashboardSettingsInputWireguardConfigurationPath:jt,AccountSettingsInputPassword:Pt,AccountSettingsInputUsername:rt,PeersDefaultSettingsInput:tt},setup(){return{dashboardConfigurationStore:f()}},data(){return{activeTab:"WGDashboard",tabs:[{id:"WGDashboard",title:"WGDashboard Settings"},{id:"Peers",title:"Peers Settings"},{id:"WireGuardConfiguration",title:"WireGuard Configuration Settings"}]}}},Vs={class:"mt-md-5 mt-3 text-body mb-3"},Fs={class:"container-md d-flex flex-column gap-4"},Ls={class:"nav nav-pills nav-justified align-items-center gap-2"},Ms={class:"nav-item"},Ws=["onClick"],Ns={class:"my-2"},Us={key:0,class:"d-flex gap-3 flex-column"},Es={key:1,class:"d-flex gap-3 flex-column"},Ys={class:"card rounded-3"},Gs={class:"card-header"},Hs={class:"my-2"},js={class:"card-body"},Bs={key:2,class:"d-flex gap-3 flex-column"},Rs={class:"card rounded-3"},zs={class:"card-header"},Os={class:"my-2"},qs={class:"card-body"},Qs={class:"row g-2"},Js={class:"col-sm"},Xs={class:"col-sm"},Zs={class:"card"},ta={class:"card-header"},ea={class:"my-2"},sa={class:"card-body"},aa={class:"card"},ia={class:"card-header"},oa={class:"my-2"},na={class:"card-body d-flex flex-column gap-3"},da={class:"card"},ra={class:"card-header"},la={class:"my-2"},ua={class:"card-body"};function ca(s,e,u,c,r,h){const a=l("LocaleText"),i=l("DashboardSettingsInputWireguardConfigurationPath"),k=l("DashboardSettingsWireguardConfigurationAutostart"),p=l("PeersDefaultSettingsInput"),A=l("DashboardTheme"),W=l("DashboardLanguage"),N=l("DashboardIPPortInput"),U=l("AccountSettingsInputUsername"),E=l("AccountSettingsInputPassword"),Y=l("AccountSettingsMFA"),G=l("DashboardAPIKeys");return o(),d("div",Vs,[t("div",Fs,[t("div",null,[t("ul",Ls,[(o(!0),d(P,null,S(this.tabs,K=>(o(),d("li",Ms,[t("a",{class:g(["nav-link rounded-3",{active:this.activeTab===K.id}]),onClick:ha=>this.activeTab=K.id,role:"button"},[t("h6",Ns,[n(a,{t:K.title},null,8,["t"])])],10,Ws)]))),256))]),e[1]||(e[1]=t("hr",null,null,-1)),t("div",null,[n(M,{name:"fade2",mode:"out-in"},{default:T(()=>[r.activeTab==="WireGuardConfiguration"?(o(),d("div",Us,[n(i,{targetData:"wg_conf_path",title:"Configurations Directory",warning:!0,"warning-text":"Remember to remove / at the end of your path. e.g /etc/wireguard"}),n(k)])):r.activeTab==="Peers"?(o(),d("div",Es,[t("div",Ys,[t("div",Gs,[t("h6",Hs,[n(a,{t:"Peer Default Settings"})])]),t("div",js,[t("div",null,[n(p,{targetData:"peer_global_dns",title:"DNS"}),n(p,{targetData:"peer_endpoint_allowed_ip",title:"Endpoint Allowed IPs"}),n(p,{targetData:"peer_mtu",title:"MTU"}),n(p,{targetData:"peer_keep_alive",title:"Persistent Keepalive"}),n(p,{targetData:"remote_endpoint",title:"Peer Remote Endpoint",warning:!0,warningText:"This will be changed globally, and will be apply to all peer's QR code and configuration file."})])])])])):r.activeTab==="WGDashboard"?(o(),d("div",Bs,[t("div",Rs,[t("div",zs,[t("h6",Os,[n(a,{t:"Appearance"})])]),t("div",qs,[t("div",Qs,[t("div",Js,[n(A)]),t("div",Xs,[n(W)])])])]),t("div",Zs,[t("div",ta,[t("h6",ea,[n(a,{t:"Dashboard IP Address & Listen Port"})])]),t("div",sa,[n(N)])]),t("div",aa,[t("div",ia,[t("h6",oa,[n(a,{t:"Account Settings"})])]),t("div",na,[t("div",null,[n(U,{targetData:"username",title:"Username"})]),e[0]||(e[0]=t("hr",null,null,-1)),t("div",null,[n(E,{targetData:"password"})])])]),t("div",da,[t("div",ra,[t("h6",la,[n(a,{t:"Multi-Factor Authentication (MFA)"})])]),t("div",ua,[this.dashboardConfigurationStore.getActiveCrossServer()?m("",!0):(o(),v(Y,{key:0}))])]),n(G)])):m("",!0)]),_:1})])])])])}const _a=_(Ts,[["render",ca]]);export{_a as default}; diff --git a/src/static/app/dist/assets/setup-CE_Ispds.js b/src/static/app/dist/assets/setup-DUH8iz4Z.js similarity index 96% rename from src/static/app/dist/assets/setup-CE_Ispds.js rename to src/static/app/dist/assets/setup-DUH8iz4Z.js index 9de821c..01ab501 100644 --- a/src/static/app/dist/assets/setup-CE_Ispds.js +++ b/src/static/app/dist/assets/setup-DUH8iz4Z.js @@ -1 +1 @@ -import{_ as u,D as m,q as p,c as r,b as e,d as o,f as c,t as h,e as f,m as l,s as d,a as i,j as w}from"./index-BPNEscAR.js";import{L as g}from"./localeText-DX813vQA.js";const b={name:"setup",components:{LocaleText:g},setup(){return{store:m()}},data(){return{setup:{username:"",newPassword:"",repeatNewPassword:"",enable_totp:!0},loading:!1,errorMessage:"",done:!1}},computed:{goodToSubmit(){return this.setup.username&&this.setup.newPassword.length>=8&&this.setup.repeatNewPassword.length>=8&&this.setup.newPassword===this.setup.repeatNewPassword}},methods:{submit(){this.loading=!0,p("/api/Welcome_Finish",this.setup,n=>{n.status?(this.done=!0,this.$router.push("/2FASetup")):(document.querySelectorAll("#createAccount input").forEach(s=>s.classList.add("is-invalid")),this.errorMessage=n.message,document.querySelector(".login-container-fluid").scrollTo({top:0,left:0,behavior:"smooth"})),this.loading=!1})}}},_=["data-bs-theme"],x={class:"m-auto text-body",style:{width:"500px"}},v={class:"dashboardLogo display-4"},y={class:"mb-5"},P={key:0,class:"alert alert-danger"},N={class:"d-flex flex-column gap-3"},k={id:"createAccount",class:"d-flex flex-column gap-2"},S={class:"form-group text-body"},T={for:"username",class:"mb-1 text-muted"},C={class:"form-group text-body"},L={for:"password",class:"mb-1 text-muted"},V={class:"form-group text-body"},q={for:"confirmPassword",class:"mb-1 text-muted"},$=["disabled"],A={key:0,class:"d-flex align-items-center w-100"},M={key:1,class:"d-flex align-items-center w-100"};function B(n,s,D,E,U,F){const t=w("LocaleText");return i(),r("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.store.Configuration.Server.dashboard_theme},[e("div",x,[e("span",v,[o(t,{t:"Nice to meet you!"})]),e("p",y,[o(t,{t:"Please fill in the following fields to finish setup"}),s[4]||(s[4]=c(" 😊"))]),e("div",null,[e("h3",null,[o(t,{t:"Create an account"})]),this.errorMessage?(i(),r("div",P,h(this.errorMessage),1)):f("",!0),e("div",N,[e("form",k,[e("div",S,[e("label",T,[e("small",null,[o(t,{t:"Enter an username you like"})])]),l(e("input",{type:"text",autocomplete:"username","onUpdate:modelValue":s[0]||(s[0]=a=>this.setup.username=a),class:"form-control",id:"username",name:"username",required:""},null,512),[[d,this.setup.username]])]),e("div",C,[e("label",L,[e("small",null,[o(t,{t:"Enter a password"}),e("code",null,[o(t,{t:"(At least 8 characters and make sure is strong enough!)"})])])]),l(e("input",{type:"password",autocomplete:"new-password","onUpdate:modelValue":s[1]||(s[1]=a=>this.setup.newPassword=a),class:"form-control",id:"password",name:"password",required:""},null,512),[[d,this.setup.newPassword]])]),e("div",V,[e("label",q,[e("small",null,[o(t,{t:"Confirm password"})])]),l(e("input",{type:"password",autocomplete:"confirm-new-password","onUpdate:modelValue":s[2]||(s[2]=a=>this.setup.repeatNewPassword=a),class:"form-control",id:"confirmPassword",name:"confirmPassword",required:""},null,512),[[d,this.setup.repeatNewPassword]])])]),e("button",{class:"btn btn-dark btn-lg mb-5 d-flex btn-brand shadow align-items-center",ref:"signInBtn",disabled:!this.goodToSubmit||this.loading||this.done,onClick:s[3]||(s[3]=a=>this.submit())},[!this.loading&&!this.done?(i(),r("span",A,[o(t,{t:"Next"}),s[5]||(s[5]=e("i",{class:"bi bi-chevron-right ms-auto"},null,-1))])):(i(),r("span",M,[o(t,{t:"Saving..."}),s[6]||(s[6]=e("span",{class:"spinner-border ms-auto spinner-border-sm",role:"status"},[e("span",{class:"visually-hidden"},"Loading...")],-1))]))],8,$)])])])],8,_)}const W=u(b,[["render",B]]);export{W as default}; +import{_ as u,D as m,q as p,c as r,b as e,d as o,f as c,t as h,e as f,m as l,s as d,a as i,j as w}from"./index-DOaPWS1X.js";import{L as g}from"./localeText-CaAXeE0W.js";const b={name:"setup",components:{LocaleText:g},setup(){return{store:m()}},data(){return{setup:{username:"",newPassword:"",repeatNewPassword:"",enable_totp:!0},loading:!1,errorMessage:"",done:!1}},computed:{goodToSubmit(){return this.setup.username&&this.setup.newPassword.length>=8&&this.setup.repeatNewPassword.length>=8&&this.setup.newPassword===this.setup.repeatNewPassword}},methods:{submit(){this.loading=!0,p("/api/Welcome_Finish",this.setup,n=>{n.status?(this.done=!0,this.$router.push("/2FASetup")):(document.querySelectorAll("#createAccount input").forEach(s=>s.classList.add("is-invalid")),this.errorMessage=n.message,document.querySelector(".login-container-fluid").scrollTo({top:0,left:0,behavior:"smooth"})),this.loading=!1})}}},_=["data-bs-theme"],x={class:"m-auto text-body",style:{width:"500px"}},v={class:"dashboardLogo display-4"},y={class:"mb-5"},P={key:0,class:"alert alert-danger"},N={class:"d-flex flex-column gap-3"},k={id:"createAccount",class:"d-flex flex-column gap-2"},S={class:"form-group text-body"},T={for:"username",class:"mb-1 text-muted"},C={class:"form-group text-body"},L={for:"password",class:"mb-1 text-muted"},V={class:"form-group text-body"},q={for:"confirmPassword",class:"mb-1 text-muted"},$=["disabled"],A={key:0,class:"d-flex align-items-center w-100"},M={key:1,class:"d-flex align-items-center w-100"};function B(n,s,D,E,U,F){const t=w("LocaleText");return i(),r("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.store.Configuration.Server.dashboard_theme},[e("div",x,[e("span",v,[o(t,{t:"Nice to meet you!"})]),e("p",y,[o(t,{t:"Please fill in the following fields to finish setup"}),s[4]||(s[4]=c(" 😊"))]),e("div",null,[e("h3",null,[o(t,{t:"Create an account"})]),this.errorMessage?(i(),r("div",P,h(this.errorMessage),1)):f("",!0),e("div",N,[e("form",k,[e("div",S,[e("label",T,[e("small",null,[o(t,{t:"Enter an username you like"})])]),l(e("input",{type:"text",autocomplete:"username","onUpdate:modelValue":s[0]||(s[0]=a=>this.setup.username=a),class:"form-control",id:"username",name:"username",required:""},null,512),[[d,this.setup.username]])]),e("div",C,[e("label",L,[e("small",null,[o(t,{t:"Enter a password"}),e("code",null,[o(t,{t:"(At least 8 characters and make sure is strong enough!)"})])])]),l(e("input",{type:"password",autocomplete:"new-password","onUpdate:modelValue":s[1]||(s[1]=a=>this.setup.newPassword=a),class:"form-control",id:"password",name:"password",required:""},null,512),[[d,this.setup.newPassword]])]),e("div",V,[e("label",q,[e("small",null,[o(t,{t:"Confirm password"})])]),l(e("input",{type:"password",autocomplete:"confirm-new-password","onUpdate:modelValue":s[2]||(s[2]=a=>this.setup.repeatNewPassword=a),class:"form-control",id:"confirmPassword",name:"confirmPassword",required:""},null,512),[[d,this.setup.repeatNewPassword]])])]),e("button",{class:"btn btn-dark btn-lg mb-5 d-flex btn-brand shadow align-items-center",ref:"signInBtn",disabled:!this.goodToSubmit||this.loading||this.done,onClick:s[3]||(s[3]=a=>this.submit())},[!this.loading&&!this.done?(i(),r("span",A,[o(t,{t:"Next"}),s[5]||(s[5]=e("i",{class:"bi bi-chevron-right ms-auto"},null,-1))])):(i(),r("span",M,[o(t,{t:"Saving..."}),s[6]||(s[6]=e("span",{class:"spinner-border ms-auto spinner-border-sm",role:"status"},[e("span",{class:"visually-hidden"},"Loading...")],-1))]))],8,$)])])])],8,_)}const W=u(b,[["render",B]]);export{W as default}; diff --git a/src/static/app/dist/assets/share-Ddnyobqg.js b/src/static/app/dist/assets/share-BU0DtM5p.js similarity index 95% rename from src/static/app/dist/assets/share-Ddnyobqg.js rename to src/static/app/dist/assets/share-BU0DtM5p.js index 1526fd0..644a527 100644 --- a/src/static/app/dist/assets/share-Ddnyobqg.js +++ b/src/static/app/dist/assets/share-BU0DtM5p.js @@ -1 +1 @@ -import{_,r,D as p,g as u,c as m,b as t,d as c,$ as h,a as f,j as b}from"./index-BPNEscAR.js";import{b as v}from"./browser-CjSdxGTc.js";import{L as y}from"./localeText-DX813vQA.js";const g={name:"share",components:{LocaleText:y},async setup(){const o=h(),e=r(!1),i=p(),n=r(""),s=r(void 0),l=r(new Blob);await u("/api/getDashboardTheme",{},d=>{n.value=d.data});const a=o.query.ShareID;return a===void 0||a.length===0?(s.value=void 0,e.value=!0):await u("/api/sharePeer/get",{ShareID:a},d=>{d.status?(s.value=d.data,l.value=new Blob([s.value.file],{type:"text/plain"})):s.value=void 0,e.value=!0}),{store:i,theme:n,peerConfiguration:s,blob:l}},mounted(){this.peerConfiguration&&v.toCanvas(document.querySelector("#qrcode"),this.peerConfiguration.file,o=>{o&&console.error(o)})},methods:{download(){const o=new Blob([this.peerConfiguration.file],{type:"text/plain"}),e=URL.createObjectURL(o),i=`${this.peerConfiguration.fileName}.conf`,n=document.createElement("a");n.href=e,n.download=i,n.click()}},computed:{getBlob(){return URL.createObjectURL(this.blob)}}},w=["data-bs-theme"],x={class:"m-auto text-body",style:{width:"500px"}},C={key:0,class:"text-center position-relative",style:{}},U={class:"position-absolute w-100 h-100 top-0 start-0 d-flex animate__animated animate__fadeInUp",style:{"animation-delay":"0.1s"}},I={class:"m-auto"},L={key:1,class:"d-flex align-items-center flex-column gap-3"},B={class:"h1 dashboardLogo text-center animate__animated animate__fadeInUp"},k={id:"qrcode",class:"rounded-3 shadow animate__animated animate__fadeInUp mb-3",ref:"qrcode"},D={class:"text-muted animate__animated animate__fadeInUp mb-1",style:{"animation-delay":"0.2s"}},R=["download","href"];function j(o,e,i,n,s,l){const a=b("LocaleText");return f(),m("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.theme},[t("div",x,[this.peerConfiguration?(f(),m("div",L,[t("div",B,[e[1]||(e[1]=t("h6",null,"WGDashboard",-1)),c(a,{t:"Scan QR Code with the WireGuard App to add peer"})]),t("canvas",k,null,512),t("p",D,[c(a,{t:"or click the button below to download the "}),e[2]||(e[2]=t("samp",null,".conf",-1)),c(a,{t:" file"})]),t("a",{download:this.peerConfiguration.fileName+".conf",href:l.getBlob,class:"btn btn-lg bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle animate__animated animate__fadeInUp shadow-sm",style:{"animation-delay":"0.25s"}},e[3]||(e[3]=[t("i",{class:"bi bi-download"},null,-1)]),8,R)])):(f(),m("div",C,[e[0]||(e[0]=t("div",{class:"animate__animated animate__fadeInUp"},[t("h1",{style:{"font-size":"20rem",filter:"blur(1rem)","animation-duration":"7s"},class:"animate__animated animate__flash animate__infinite"},[t("i",{class:"bi bi-file-binary"})])],-1)),t("div",U,[t("h3",I,[c(a,{t:"Oh no... This link is either expired or invalid."})])])]))])],8,w)}const $=_(g,[["render",j],["__scopeId","data-v-1b44aacd"]]);export{$ as default}; +import{_,r,D as p,g as u,c as m,b as t,d as c,$ as h,a as f,j as b}from"./index-DOaPWS1X.js";import{b as v}from"./browser-CjSdxGTc.js";import{L as y}from"./localeText-CaAXeE0W.js";const g={name:"share",components:{LocaleText:y},async setup(){const o=h(),e=r(!1),i=p(),n=r(""),s=r(void 0),l=r(new Blob);await u("/api/getDashboardTheme",{},d=>{n.value=d.data});const a=o.query.ShareID;return a===void 0||a.length===0?(s.value=void 0,e.value=!0):await u("/api/sharePeer/get",{ShareID:a},d=>{d.status?(s.value=d.data,l.value=new Blob([s.value.file],{type:"text/plain"})):s.value=void 0,e.value=!0}),{store:i,theme:n,peerConfiguration:s,blob:l}},mounted(){this.peerConfiguration&&v.toCanvas(document.querySelector("#qrcode"),this.peerConfiguration.file,o=>{o&&console.error(o)})},methods:{download(){const o=new Blob([this.peerConfiguration.file],{type:"text/plain"}),e=URL.createObjectURL(o),i=`${this.peerConfiguration.fileName}.conf`,n=document.createElement("a");n.href=e,n.download=i,n.click()}},computed:{getBlob(){return URL.createObjectURL(this.blob)}}},w=["data-bs-theme"],x={class:"m-auto text-body",style:{width:"500px"}},C={key:0,class:"text-center position-relative",style:{}},U={class:"position-absolute w-100 h-100 top-0 start-0 d-flex animate__animated animate__fadeInUp",style:{"animation-delay":"0.1s"}},I={class:"m-auto"},L={key:1,class:"d-flex align-items-center flex-column gap-3"},B={class:"h1 dashboardLogo text-center animate__animated animate__fadeInUp"},k={id:"qrcode",class:"rounded-3 shadow animate__animated animate__fadeInUp mb-3",ref:"qrcode"},D={class:"text-muted animate__animated animate__fadeInUp mb-1",style:{"animation-delay":"0.2s"}},R=["download","href"];function j(o,e,i,n,s,l){const a=b("LocaleText");return f(),m("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.theme},[t("div",x,[this.peerConfiguration?(f(),m("div",L,[t("div",B,[e[1]||(e[1]=t("h6",null,"WGDashboard",-1)),c(a,{t:"Scan QR Code with the WireGuard App to add peer"})]),t("canvas",k,null,512),t("p",D,[c(a,{t:"or click the button below to download the "}),e[2]||(e[2]=t("samp",null,".conf",-1)),c(a,{t:" file"})]),t("a",{download:this.peerConfiguration.fileName+".conf",href:l.getBlob,class:"btn btn-lg bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle animate__animated animate__fadeInUp shadow-sm",style:{"animation-delay":"0.25s"}},e[3]||(e[3]=[t("i",{class:"bi bi-download"},null,-1)]),8,R)])):(f(),m("div",C,[e[0]||(e[0]=t("div",{class:"animate__animated animate__fadeInUp"},[t("h1",{style:{"font-size":"20rem",filter:"blur(1rem)","animation-duration":"7s"},class:"animate__animated animate__flash animate__infinite"},[t("i",{class:"bi bi-file-binary"})])],-1)),t("div",U,[t("h3",I,[c(a,{t:"Oh no... This link is either expired or invalid."})])])]))])],8,w)}const $=_(g,[["render",j],["__scopeId","data-v-1b44aacd"]]);export{$ as default}; diff --git a/src/static/app/dist/assets/signin-D6BnWOQO.js b/src/static/app/dist/assets/signin-M3EwqtyC.js similarity index 98% rename from src/static/app/dist/assets/signin-D6BnWOQO.js rename to src/static/app/dist/assets/signin-M3EwqtyC.js index ff62628..38b6f04 100644 --- a/src/static/app/dist/assets/signin-D6BnWOQO.js +++ b/src/static/app/dist/assets/signin-M3EwqtyC.js @@ -1 +1 @@ -import{_ as g,G as u,a as i,c as r,b as t,m as f,s as k,n as w,t as T,D as C,d as n,F as L,h as E,i as S,e as y,j as c,X as M,g as _,q as D,v as A,f as R,w as P,k as V}from"./index-BPNEscAR.js";import{M as B}from"./message-Cw7_G39b.js";import{d as $}from"./dayjs.min-Lw24H7b2.js";import{L as I}from"./localeText-DX813vQA.js";const O={name:"RemoteServer",props:{server:Object},data(){return{active:!1,startTime:void 0,endTime:void 0,errorMsg:"",refreshing:!1}},methods:{async handshake(){this.active=!1,this.server.host&&this.server.apiKey&&(this.refreshing=!0,this.startTime=void 0,this.endTime=void 0,this.startTime=$(),await fetch(`${this.server.host}/api/handshake`,{headers:{"content-type":"application/json","wg-dashboard-apikey":this.server.apiKey},method:"GET",signal:AbortSignal.timeout(5e3)}).then(s=>{if(s.status===200)return s.json();throw new Error(s.statusText)}).then(()=>{this.endTime=$(),this.active=!0}).catch(s=>{this.active=!1,this.errorMsg=s}),this.refreshing=!1)},async connect(){await fetch(`${this.server.host}/api/authenticate`,{headers:{"content-type":"application/json","wg-dashboard-apikey":this.server.apiKey},body:JSON.stringify({host:window.location.hostname}),method:"POST",signal:AbortSignal.timeout(5e3)}).then(s=>s.json()).then(s=>{this.$emit("setActiveServer"),this.$router.push("/")})}},mounted(){this.handshake()},computed:{getHandshakeTime(){return this.startTime&&this.endTime?`${$().subtract(this.startTime).millisecond()}ms`:this.refreshing?u("Pinging..."):this.errorMsg?this.errorMsg:"N/A"}}},j={class:"card rounded-3"},q={class:"card-body"},G={class:"d-flex gap-3 w-100 remoteServerContainer"},N={class:"d-flex gap-3 align-items-center flex-grow-1"},U={class:"d-flex gap-3 align-items-center flex-grow-1"},z={class:"d-flex gap-2 button-group"},K={class:"card-footer gap-2 d-flex align-items-center"},W={key:0,class:"spin ms-auto text-primary-emphasis"};function F(s,e,l,d,a,h){return i(),r("div",j,[t("div",q,[t("div",G,[t("div",N,[e[7]||(e[7]=t("i",{class:"bi bi-server"},null,-1)),f(t("input",{class:"form-control form-control-sm",onBlur:e[0]||(e[0]=o=>this.handshake()),"onUpdate:modelValue":e[1]||(e[1]=o=>this.server.host=o),type:"url"},null,544),[[k,this.server.host]])]),t("div",U,[e[8]||(e[8]=t("i",{class:"bi bi-key-fill"},null,-1)),f(t("input",{class:"form-control form-control-sm",onBlur:e[2]||(e[2]=o=>this.handshake()),"onUpdate:modelValue":e[3]||(e[3]=o=>this.server.apiKey=o),type:"text"},null,544),[[k,this.server.apiKey]])]),t("div",z,[t("button",{onClick:e[4]||(e[4]=o=>this.$emit("delete")),class:"ms-auto btn btn-sm bg-danger-subtle text-danger-emphasis border-1 border-danger-subtle"},e[9]||(e[9]=[t("i",{class:"bi bi-trash"},null,-1)])),t("button",{onClick:e[5]||(e[5]=o=>this.connect()),class:w([{disabled:!this.active},"ms-auto btn btn-sm bg-success-subtle text-success-emphasis border-1 border-success-subtle"])},e[10]||(e[10]=[t("i",{class:"bi bi-arrow-right-circle"},null,-1)]),2)])])]),t("div",K,[t("span",{class:w(["dot ms-0 me-2",[this.active?"active":"inactive"]])},null,2),t("small",null,T(this.getHandshakeTime),1),this.refreshing?(i(),r("div",W,e[11]||(e[11]=[t("i",{class:"bi bi-arrow-clockwise"},null,-1)]))):(i(),r("a",{key:1,role:"button",onClick:e[6]||(e[6]=o=>this.handshake()),class:"text-primary-emphasis text-decoration-none ms-auto disabled"},e[12]||(e[12]=[t("i",{class:"bi bi-arrow-clockwise me"},null,-1)])))])])}const H=g(O,[["render",F],["__scopeId","data-v-ed7817c7"]]),J={name:"RemoteServerList",setup(){return{store:C()}},components:{LocaleText:I,RemoteServer:H}},X={class:"w-100 mt-3"},Z={class:"d-flex align-items-center mb-3"},Q={class:"mb-0"},Y={class:"w-100 d-flex gap-3 flex-column p-3 border border-1 border-secondary-subtle rounded-3",style:{height:"400px","overflow-y":"scroll"}},ee={key:0,class:"text-muted m-auto"};function te(s,e,l,d,a,h){const o=c("LocaleText"),b=c("RemoteServer");return i(),r("div",X,[t("div",Z,[t("h5",Q,[n(o,{t:"Server List"})]),t("button",{onClick:e[0]||(e[0]=v=>this.store.addCrossServerConfiguration()),class:"btn bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle shadow-sm ms-auto"},[e[1]||(e[1]=t("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),n(o,{t:"Server"})])]),t("div",Y,[(i(!0),r(L,null,E(this.store.CrossServerConfiguration.ServerList,(v,p)=>(i(),S(b,{onSetActiveServer:x=>this.store.setActiveCrossServer(p),onDelete:x=>this.store.deleteCrossServerConfiguration(p),key:p,server:v},null,8,["onSetActiveServer","onDelete","server"]))),128)),Object.keys(this.store.CrossServerConfiguration.ServerList).length===0?(i(),r("h6",ee,[n(o,{t:"Click"}),e[2]||(e[2]=t("i",{class:"bi bi-plus-circle-fill mx-1"},null,-1)),n(o,{t:"to add your server"})])):y("",!0)])])}const se=g(J,[["render",te]]),oe={name:"signInInput",methods:{GetLocale:u},props:{id:"",data:"",type:"",placeholder:""},computed:{getLocaleText(){return u(this.placeholder)}}},ie=["type","id","name","placeholder"];function re(s,e,l,d,a,h){return f((i(),r("input",{type:l.type,"onUpdate:modelValue":e[0]||(e[0]=o=>this.data[this.id]=o),class:"form-control rounded-3",id:this.id,name:this.id,autocomplete:"on",placeholder:this.getLocaleText,required:""},null,8,ie)),[[M,this.data[this.id]]])}const ne=g(oe,[["render",re]]),ae={name:"signInTOTP",methods:{GetLocale:u},props:{data:""},computed:{getLocaleText(){return u("OTP from your authenticator")}}},le=["placeholder"];function de(s,e,l,d,a,h){return f((i(),r("input",{class:"form-control totp",required:"",id:"totp",maxlength:"6",type:"text",inputmode:"numeric",autocomplete:"one-time-code",placeholder:this.getLocaleText,"onUpdate:modelValue":e[0]||(e[0]=o=>this.data.totp=o)},null,8,le)),[[k,this.data.totp]])}const ce=g(ae,[["render",de]]),ue={name:"signin",components:{SignInTOTP:ce,SignInInput:ne,LocaleText:I,RemoteServerList:se,Message:B},async setup(){const s=C();let e="dark",l=!1,d;return s.IsElectronApp||await Promise.all([_("/api/getDashboardTheme",{},a=>{e=a.data}),_("/api/isTotpEnabled",{},a=>{l=a.data}),_("/api/getDashboardVersion",{},a=>{d=a.data})]),s.removeActiveCrossServer(),{store:s,theme:e,totpEnabled:l,version:d}},data(){return{data:{username:"",password:"",totp:""},loginError:!1,loginErrorMessage:"",loading:!1}},computed:{getMessages(){return this.store.Messages.filter(s=>s.show)},applyLocale(s){return u(s)}},methods:{GetLocale:u,async auth(){this.data.username&&this.data.password&&(this.totpEnabled&&this.data.totp||!this.totpEnabled)?(this.loading=!0,await D("/api/authenticate",this.data,s=>{s.status?(this.loginError=!1,this.$refs.signInBtn.classList.add("signedIn"),s.message?this.$router.push("/welcome"):this.store.Redirect!==void 0?this.$router.push(this.store.Redirect):this.$router.push("/")):(this.loginError=!0,this.loginErrorMessage=s.message,document.querySelectorAll("input[required]").forEach(e=>{e.classList.remove("is-valid"),e.classList.add("is-invalid")}),this.loading=!1)})):document.querySelectorAll("input[required]").forEach(s=>{s.value.length===0?(s.classList.remove("is-valid"),s.classList.add("is-invalid")):(s.classList.remove("is-invalid"),s.classList.add("is-valid"))})}}},me=["data-bs-theme"],he={class:"login-box m-auto"},pe={class:"m-auto",style:{width:"700px"}},fe={class:"mb-0 text-body"},ge={key:0,class:"alert alert-danger mt-2 mb-0",role:"alert"},be={class:"form-group text-body"},ve={class:"form-group text-body"},ye={key:0,class:"form-group text-body"},xe=["disabled"],_e={key:0,class:"d-flex w-100"},$e={key:1,class:"d-flex w-100 align-items-center"},ke={key:3,class:"d-flex mt-3"},Se={class:"form-check form-switch ms-auto"},we={class:"form-check-label",for:"flexSwitchCheckChecked"},Te={class:"text-muted pb-3 d-block w-100 text-center mt-3"},Ce={class:"messageCentre text-body position-absolute end-0 m-3"};function Le(s,e,l,d,a,h){const o=c("LocaleText"),b=c("SignInInput"),v=c("SignInTOTP"),p=c("RemoteServerList"),x=c("Message");return i(),r("div",{class:"container-fluid login-container-fluid d-flex main flex-column py-4 text-body h-100",style:{"overflow-y":"scroll"},"data-bs-theme":this.theme},[t("div",he,[t("div",pe,[t("h4",fe,[n(o,{t:"Welcome to"})]),e[7]||(e[7]=t("span",{class:"dashboardLogo display-3"},[t("strong",null,"WGDashboard")],-1)),a.loginError?(i(),r("div",ge,[n(o,{t:this.loginErrorMessage},null,8,["t"])])):y("",!0),this.store.CrossServerConfiguration.Enable?(i(),S(p,{key:2})):(i(),r("form",{key:1,onSubmit:e[0]||(e[0]=m=>{m.preventDefault(),this.auth()})},[t("div",be,[e[2]||(e[2]=t("label",{for:"username",class:"text-left",style:{"font-size":"1rem"}},[t("i",{class:"bi bi-person-circle"})],-1)),n(b,{id:"username",data:this.data,type:"text",placeholder:"Username"},null,8,["data"])]),t("div",ve,[e[3]||(e[3]=t("label",{for:"password",class:"text-left",style:{"font-size":"1rem"}},[t("i",{class:"bi bi-key-fill"})],-1)),n(b,{id:"password",data:this.data,type:"password",placeholder:"Password"},null,8,["data"])]),d.totpEnabled?(i(),r("div",ye,[e[4]||(e[4]=t("label",{for:"totp",class:"text-left",style:{"font-size":"1rem"}},[t("i",{class:"bi bi-lock-fill"})],-1)),n(v,{data:this.data},null,8,["data"])])):y("",!0),t("button",{class:"btn btn-lg btn-dark ms-auto mt-5 w-100 d-flex btn-brand signInBtn",disabled:this.loading,ref:"signInBtn"},[this.loading?(i(),r("span",$e,[n(o,{t:"Signing In..."}),e[6]||(e[6]=t("span",{class:"spinner-border ms-auto spinner-border-sm",role:"status"},null,-1))])):(i(),r("span",_e,[n(o,{t:"Sign In"}),e[5]||(e[5]=t("i",{class:"ms-auto bi bi-chevron-right"},null,-1))]))],8,xe)],32)),this.store.IsElectronApp?y("",!0):(i(),r("div",ke,[t("div",Se,[f(t("input",{"onUpdate:modelValue":e[1]||(e[1]=m=>this.store.CrossServerConfiguration.Enable=m),class:"form-check-input",type:"checkbox",role:"switch",id:"flexSwitchCheckChecked"},null,512),[[A,this.store.CrossServerConfiguration.Enable]]),t("label",we,[n(o,{t:"Access Remote Server"})])])]))])]),t("small",Te,[R(" WGDashboard "+T(this.version)+" | Developed with ❤️ by ",1),e[8]||(e[8]=t("a",{href:"https://github.com/donaldzou",target:"_blank"},[t("strong",null,"Donald Zou")],-1))]),t("div",Ce,[n(V,{name:"message",tag:"div",class:"position-relative"},{default:P(()=>[(i(!0),r(L,null,E(h.getMessages.slice().reverse(),m=>(i(),S(x,{message:m,key:m.id},null,8,["message"]))),128))]),_:1})])],8,me)}const Ae=g(ue,[["render",Le],["__scopeId","data-v-eca07c7a"]]);export{Ae as default}; +import{_ as g,G as u,a as i,c as r,b as t,m as f,s as k,n as w,t as T,D as C,d as n,F as L,h as E,i as S,e as y,j as c,X as M,g as _,q as D,v as A,f as R,w as P,k as V}from"./index-DOaPWS1X.js";import{M as B}from"./message-ChztDIV3.js";import{d as $}from"./dayjs.min-D8jwq_wn.js";import{L as I}from"./localeText-CaAXeE0W.js";const O={name:"RemoteServer",props:{server:Object},data(){return{active:!1,startTime:void 0,endTime:void 0,errorMsg:"",refreshing:!1}},methods:{async handshake(){this.active=!1,this.server.host&&this.server.apiKey&&(this.refreshing=!0,this.startTime=void 0,this.endTime=void 0,this.startTime=$(),await fetch(`${this.server.host}/api/handshake`,{headers:{"content-type":"application/json","wg-dashboard-apikey":this.server.apiKey},method:"GET",signal:AbortSignal.timeout(5e3)}).then(s=>{if(s.status===200)return s.json();throw new Error(s.statusText)}).then(()=>{this.endTime=$(),this.active=!0}).catch(s=>{this.active=!1,this.errorMsg=s}),this.refreshing=!1)},async connect(){await fetch(`${this.server.host}/api/authenticate`,{headers:{"content-type":"application/json","wg-dashboard-apikey":this.server.apiKey},body:JSON.stringify({host:window.location.hostname}),method:"POST",signal:AbortSignal.timeout(5e3)}).then(s=>s.json()).then(s=>{this.$emit("setActiveServer"),this.$router.push("/")})}},mounted(){this.handshake()},computed:{getHandshakeTime(){return this.startTime&&this.endTime?`${$().subtract(this.startTime).millisecond()}ms`:this.refreshing?u("Pinging..."):this.errorMsg?this.errorMsg:"N/A"}}},j={class:"card rounded-3"},q={class:"card-body"},G={class:"d-flex gap-3 w-100 remoteServerContainer"},N={class:"d-flex gap-3 align-items-center flex-grow-1"},U={class:"d-flex gap-3 align-items-center flex-grow-1"},z={class:"d-flex gap-2 button-group"},K={class:"card-footer gap-2 d-flex align-items-center"},W={key:0,class:"spin ms-auto text-primary-emphasis"};function F(s,e,l,d,a,h){return i(),r("div",j,[t("div",q,[t("div",G,[t("div",N,[e[7]||(e[7]=t("i",{class:"bi bi-server"},null,-1)),f(t("input",{class:"form-control form-control-sm",onBlur:e[0]||(e[0]=o=>this.handshake()),"onUpdate:modelValue":e[1]||(e[1]=o=>this.server.host=o),type:"url"},null,544),[[k,this.server.host]])]),t("div",U,[e[8]||(e[8]=t("i",{class:"bi bi-key-fill"},null,-1)),f(t("input",{class:"form-control form-control-sm",onBlur:e[2]||(e[2]=o=>this.handshake()),"onUpdate:modelValue":e[3]||(e[3]=o=>this.server.apiKey=o),type:"text"},null,544),[[k,this.server.apiKey]])]),t("div",z,[t("button",{onClick:e[4]||(e[4]=o=>this.$emit("delete")),class:"ms-auto btn btn-sm bg-danger-subtle text-danger-emphasis border-1 border-danger-subtle"},e[9]||(e[9]=[t("i",{class:"bi bi-trash"},null,-1)])),t("button",{onClick:e[5]||(e[5]=o=>this.connect()),class:w([{disabled:!this.active},"ms-auto btn btn-sm bg-success-subtle text-success-emphasis border-1 border-success-subtle"])},e[10]||(e[10]=[t("i",{class:"bi bi-arrow-right-circle"},null,-1)]),2)])])]),t("div",K,[t("span",{class:w(["dot ms-0 me-2",[this.active?"active":"inactive"]])},null,2),t("small",null,T(this.getHandshakeTime),1),this.refreshing?(i(),r("div",W,e[11]||(e[11]=[t("i",{class:"bi bi-arrow-clockwise"},null,-1)]))):(i(),r("a",{key:1,role:"button",onClick:e[6]||(e[6]=o=>this.handshake()),class:"text-primary-emphasis text-decoration-none ms-auto disabled"},e[12]||(e[12]=[t("i",{class:"bi bi-arrow-clockwise me"},null,-1)])))])])}const H=g(O,[["render",F],["__scopeId","data-v-ed7817c7"]]),J={name:"RemoteServerList",setup(){return{store:C()}},components:{LocaleText:I,RemoteServer:H}},X={class:"w-100 mt-3"},Z={class:"d-flex align-items-center mb-3"},Q={class:"mb-0"},Y={class:"w-100 d-flex gap-3 flex-column p-3 border border-1 border-secondary-subtle rounded-3",style:{height:"400px","overflow-y":"scroll"}},ee={key:0,class:"text-muted m-auto"};function te(s,e,l,d,a,h){const o=c("LocaleText"),b=c("RemoteServer");return i(),r("div",X,[t("div",Z,[t("h5",Q,[n(o,{t:"Server List"})]),t("button",{onClick:e[0]||(e[0]=v=>this.store.addCrossServerConfiguration()),class:"btn bg-primary-subtle text-primary-emphasis border-1 border-primary-subtle shadow-sm ms-auto"},[e[1]||(e[1]=t("i",{class:"bi bi-plus-circle-fill me-2"},null,-1)),n(o,{t:"Server"})])]),t("div",Y,[(i(!0),r(L,null,E(this.store.CrossServerConfiguration.ServerList,(v,p)=>(i(),S(b,{onSetActiveServer:x=>this.store.setActiveCrossServer(p),onDelete:x=>this.store.deleteCrossServerConfiguration(p),key:p,server:v},null,8,["onSetActiveServer","onDelete","server"]))),128)),Object.keys(this.store.CrossServerConfiguration.ServerList).length===0?(i(),r("h6",ee,[n(o,{t:"Click"}),e[2]||(e[2]=t("i",{class:"bi bi-plus-circle-fill mx-1"},null,-1)),n(o,{t:"to add your server"})])):y("",!0)])])}const se=g(J,[["render",te]]),oe={name:"signInInput",methods:{GetLocale:u},props:{id:"",data:"",type:"",placeholder:""},computed:{getLocaleText(){return u(this.placeholder)}}},ie=["type","id","name","placeholder"];function re(s,e,l,d,a,h){return f((i(),r("input",{type:l.type,"onUpdate:modelValue":e[0]||(e[0]=o=>this.data[this.id]=o),class:"form-control rounded-3",id:this.id,name:this.id,autocomplete:"on",placeholder:this.getLocaleText,required:""},null,8,ie)),[[M,this.data[this.id]]])}const ne=g(oe,[["render",re]]),ae={name:"signInTOTP",methods:{GetLocale:u},props:{data:""},computed:{getLocaleText(){return u("OTP from your authenticator")}}},le=["placeholder"];function de(s,e,l,d,a,h){return f((i(),r("input",{class:"form-control totp",required:"",id:"totp",maxlength:"6",type:"text",inputmode:"numeric",autocomplete:"one-time-code",placeholder:this.getLocaleText,"onUpdate:modelValue":e[0]||(e[0]=o=>this.data.totp=o)},null,8,le)),[[k,this.data.totp]])}const ce=g(ae,[["render",de]]),ue={name:"signin",components:{SignInTOTP:ce,SignInInput:ne,LocaleText:I,RemoteServerList:se,Message:B},async setup(){const s=C();let e="dark",l=!1,d;return s.IsElectronApp||await Promise.all([_("/api/getDashboardTheme",{},a=>{e=a.data}),_("/api/isTotpEnabled",{},a=>{l=a.data}),_("/api/getDashboardVersion",{},a=>{d=a.data})]),s.removeActiveCrossServer(),{store:s,theme:e,totpEnabled:l,version:d}},data(){return{data:{username:"",password:"",totp:""},loginError:!1,loginErrorMessage:"",loading:!1}},computed:{getMessages(){return this.store.Messages.filter(s=>s.show)},applyLocale(s){return u(s)}},methods:{GetLocale:u,async auth(){this.data.username&&this.data.password&&(this.totpEnabled&&this.data.totp||!this.totpEnabled)?(this.loading=!0,await D("/api/authenticate",this.data,s=>{s.status?(this.loginError=!1,this.$refs.signInBtn.classList.add("signedIn"),s.message?this.$router.push("/welcome"):this.store.Redirect!==void 0?this.$router.push(this.store.Redirect):this.$router.push("/")):(this.loginError=!0,this.loginErrorMessage=s.message,document.querySelectorAll("input[required]").forEach(e=>{e.classList.remove("is-valid"),e.classList.add("is-invalid")}),this.loading=!1)})):document.querySelectorAll("input[required]").forEach(s=>{s.value.length===0?(s.classList.remove("is-valid"),s.classList.add("is-invalid")):(s.classList.remove("is-invalid"),s.classList.add("is-valid"))})}}},me=["data-bs-theme"],he={class:"login-box m-auto"},pe={class:"m-auto",style:{width:"700px"}},fe={class:"mb-0 text-body"},ge={key:0,class:"alert alert-danger mt-2 mb-0",role:"alert"},be={class:"form-group text-body"},ve={class:"form-group text-body"},ye={key:0,class:"form-group text-body"},xe=["disabled"],_e={key:0,class:"d-flex w-100"},$e={key:1,class:"d-flex w-100 align-items-center"},ke={key:3,class:"d-flex mt-3"},Se={class:"form-check form-switch ms-auto"},we={class:"form-check-label",for:"flexSwitchCheckChecked"},Te={class:"text-muted pb-3 d-block w-100 text-center mt-3"},Ce={class:"messageCentre text-body position-absolute end-0 m-3"};function Le(s,e,l,d,a,h){const o=c("LocaleText"),b=c("SignInInput"),v=c("SignInTOTP"),p=c("RemoteServerList"),x=c("Message");return i(),r("div",{class:"container-fluid login-container-fluid d-flex main flex-column py-4 text-body h-100",style:{"overflow-y":"scroll"},"data-bs-theme":this.theme},[t("div",he,[t("div",pe,[t("h4",fe,[n(o,{t:"Welcome to"})]),e[7]||(e[7]=t("span",{class:"dashboardLogo display-3"},[t("strong",null,"WGDashboard")],-1)),a.loginError?(i(),r("div",ge,[n(o,{t:this.loginErrorMessage},null,8,["t"])])):y("",!0),this.store.CrossServerConfiguration.Enable?(i(),S(p,{key:2})):(i(),r("form",{key:1,onSubmit:e[0]||(e[0]=m=>{m.preventDefault(),this.auth()})},[t("div",be,[e[2]||(e[2]=t("label",{for:"username",class:"text-left",style:{"font-size":"1rem"}},[t("i",{class:"bi bi-person-circle"})],-1)),n(b,{id:"username",data:this.data,type:"text",placeholder:"Username"},null,8,["data"])]),t("div",ve,[e[3]||(e[3]=t("label",{for:"password",class:"text-left",style:{"font-size":"1rem"}},[t("i",{class:"bi bi-key-fill"})],-1)),n(b,{id:"password",data:this.data,type:"password",placeholder:"Password"},null,8,["data"])]),d.totpEnabled?(i(),r("div",ye,[e[4]||(e[4]=t("label",{for:"totp",class:"text-left",style:{"font-size":"1rem"}},[t("i",{class:"bi bi-lock-fill"})],-1)),n(v,{data:this.data},null,8,["data"])])):y("",!0),t("button",{class:"btn btn-lg btn-dark ms-auto mt-5 w-100 d-flex btn-brand signInBtn",disabled:this.loading,ref:"signInBtn"},[this.loading?(i(),r("span",$e,[n(o,{t:"Signing In..."}),e[6]||(e[6]=t("span",{class:"spinner-border ms-auto spinner-border-sm",role:"status"},null,-1))])):(i(),r("span",_e,[n(o,{t:"Sign In"}),e[5]||(e[5]=t("i",{class:"ms-auto bi bi-chevron-right"},null,-1))]))],8,xe)],32)),this.store.IsElectronApp?y("",!0):(i(),r("div",ke,[t("div",Se,[f(t("input",{"onUpdate:modelValue":e[1]||(e[1]=m=>this.store.CrossServerConfiguration.Enable=m),class:"form-check-input",type:"checkbox",role:"switch",id:"flexSwitchCheckChecked"},null,512),[[A,this.store.CrossServerConfiguration.Enable]]),t("label",we,[n(o,{t:"Access Remote Server"})])])]))])]),t("small",Te,[R(" WGDashboard "+T(this.version)+" | Developed with ❤️ by ",1),e[8]||(e[8]=t("a",{href:"https://github.com/donaldzou",target:"_blank"},[t("strong",null,"Donald Zou")],-1))]),t("div",Ce,[n(V,{name:"message",tag:"div",class:"position-relative"},{default:P(()=>[(i(!0),r(L,null,E(h.getMessages.slice().reverse(),m=>(i(),S(x,{message:m,key:m.id},null,8,["message"]))),128))]),_:1})])],8,me)}const Ae=g(ue,[["render",Le],["__scopeId","data-v-eca07c7a"]]);export{Ae as default}; diff --git a/src/static/app/dist/assets/totp-B2bG5DyX.js b/src/static/app/dist/assets/totp-BZU5dK65.js similarity index 96% rename from src/static/app/dist/assets/totp-B2bG5DyX.js rename to src/static/app/dist/assets/totp-BZU5dK65.js index ab03717..a5f3c91 100644 --- a/src/static/app/dist/assets/totp-B2bG5DyX.js +++ b/src/static/app/dist/assets/totp-BZU5dK65.js @@ -1 +1 @@ -import{_ as h,D as m,g as p,q as f,c as b,b as t,d as i,t as _,m as v,s as g,i as d,w as r,j as c,a as n}from"./index-BPNEscAR.js";import{b as x}from"./browser-CjSdxGTc.js";import{L as y}from"./localeText-DX813vQA.js";const T={name:"totp",components:{LocaleText:y},async setup(){const s=m();let e="";return await p("/api/Welcome_GetTotpLink",{},a=>{a.status&&(e=a.data)}),{l:e,store:s}},mounted(){this.l&&x.toCanvas(document.getElementById("qrcode"),this.l,function(s){})},data(){return{totp:"",totpInvalidMessage:"",verified:!1}},methods:{validateTotp(){}},watch:{totp(s){const e=document.querySelector("#totp");e.classList.remove("is-invalid","is-valid"),s.length===6&&(console.log(s),/[0-9]{6}/.test(s)?f("/api/Welcome_VerifyTotpLink",{totp:s},a=>{a.status?(this.verified=!0,e.classList.add("is-valid"),this.$emit("verified")):(e.classList.add("is-invalid"),this.totpInvalidMessage="TOTP does not match.")}):(e.classList.add("is-invalid"),this.totpInvalidMessage="TOTP can only contain numbers"))}}},k=["data-bs-theme"],w={class:"m-auto text-body",style:{width:"500px"}},L={class:"d-flex flex-column"},M={class:"dashboardLogo display-4"},C={class:"mb-2"},P={class:"text-muted"},I={class:"p-3 bg-body-secondary rounded-3 border mb-3"},O={class:"text-muted mb-0"},B=["href"],$={style:{"line-break":"anywhere"}},q={for:"totp",class:"mb-2"},D={class:"text-muted"},S={class:"form-group mb-2"},A=["disabled"],E={class:"invalid-feedback"},F={class:"valid-feedback"},R={class:"d-flex gap-3 mt-5 flex-column"};function G(s,e,a,N,W,j){const o=c("LocaleText"),l=c("RouterLink");return n(),b("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.store.Configuration.Server.dashboard_theme},[t("div",w,[t("div",L,[t("div",null,[t("h1",M,[i(o,{t:"Multi-Factor Authentication (MFA)"})]),t("p",C,[t("small",P,[i(o,{t:"1. Please scan the following QR Code to generate TOTP with your choice of authenticator"})])]),e[1]||(e[1]=t("canvas",{id:"qrcode",class:"rounded-3 mb-2"},null,-1)),t("div",I,[t("p",O,[t("small",null,[i(o,{t:"Or you can click the link below:"})])]),t("a",{href:this.l},[t("code",$,_(this.l),1)],8,B)]),t("label",q,[t("small",D,[i(o,{t:"2. Enter the TOTP generated by your authenticator to verify"})])]),t("div",S,[v(t("input",{class:"form-control text-center totp",id:"totp",maxlength:"6",type:"text",inputmode:"numeric",autocomplete:"one-time-code","onUpdate:modelValue":e[0]||(e[0]=u=>this.totp=u),disabled:this.verified},null,8,A),[[g,this.totp]]),t("div",E,[i(o,{t:this.totpInvalidMessage},null,8,["t"])]),t("div",F,[i(o,{t:"TOTP verified!"})])])]),e[4]||(e[4]=t("hr",null,null,-1)),t("div",R,[this.verified?(n(),d(l,{key:1,to:"/",class:"btn btn-dark btn-lg d-flex btn-brand shadow align-items-center flex-grow-1 rounded-3"},{default:r(()=>[i(o,{t:"Complete"}),e[3]||(e[3]=t("i",{class:"bi bi-chevron-right ms-auto"},null,-1))]),_:1})):(n(),d(l,{key:0,to:"/",class:"btn bg-secondary-subtle text-secondary-emphasis rounded-3 flex-grow-1 btn-lg border-1 border-secondary-subtle shadow d-flex"},{default:r(()=>[i(o,{t:"I don't need MFA"}),e[2]||(e[2]=t("i",{class:"bi bi-chevron-right ms-auto"},null,-1))]),_:1}))])])])],8,k)}const z=h(T,[["render",G]]);export{z as default}; +import{_ as h,D as m,g as p,q as f,c as b,b as t,d as i,t as _,m as v,s as g,i as d,w as r,j as c,a as n}from"./index-DOaPWS1X.js";import{b as x}from"./browser-CjSdxGTc.js";import{L as y}from"./localeText-CaAXeE0W.js";const T={name:"totp",components:{LocaleText:y},async setup(){const s=m();let e="";return await p("/api/Welcome_GetTotpLink",{},a=>{a.status&&(e=a.data)}),{l:e,store:s}},mounted(){this.l&&x.toCanvas(document.getElementById("qrcode"),this.l,function(s){})},data(){return{totp:"",totpInvalidMessage:"",verified:!1}},methods:{validateTotp(){}},watch:{totp(s){const e=document.querySelector("#totp");e.classList.remove("is-invalid","is-valid"),s.length===6&&(console.log(s),/[0-9]{6}/.test(s)?f("/api/Welcome_VerifyTotpLink",{totp:s},a=>{a.status?(this.verified=!0,e.classList.add("is-valid"),this.$emit("verified")):(e.classList.add("is-invalid"),this.totpInvalidMessage="TOTP does not match.")}):(e.classList.add("is-invalid"),this.totpInvalidMessage="TOTP can only contain numbers"))}}},k=["data-bs-theme"],w={class:"m-auto text-body",style:{width:"500px"}},L={class:"d-flex flex-column"},M={class:"dashboardLogo display-4"},C={class:"mb-2"},P={class:"text-muted"},I={class:"p-3 bg-body-secondary rounded-3 border mb-3"},O={class:"text-muted mb-0"},B=["href"],$={style:{"line-break":"anywhere"}},q={for:"totp",class:"mb-2"},D={class:"text-muted"},S={class:"form-group mb-2"},A=["disabled"],E={class:"invalid-feedback"},F={class:"valid-feedback"},R={class:"d-flex gap-3 mt-5 flex-column"};function G(s,e,a,N,W,j){const o=c("LocaleText"),l=c("RouterLink");return n(),b("div",{class:"container-fluid login-container-fluid d-flex main pt-5 overflow-scroll","data-bs-theme":this.store.Configuration.Server.dashboard_theme},[t("div",w,[t("div",L,[t("div",null,[t("h1",M,[i(o,{t:"Multi-Factor Authentication (MFA)"})]),t("p",C,[t("small",P,[i(o,{t:"1. Please scan the following QR Code to generate TOTP with your choice of authenticator"})])]),e[1]||(e[1]=t("canvas",{id:"qrcode",class:"rounded-3 mb-2"},null,-1)),t("div",I,[t("p",O,[t("small",null,[i(o,{t:"Or you can click the link below:"})])]),t("a",{href:this.l},[t("code",$,_(this.l),1)],8,B)]),t("label",q,[t("small",D,[i(o,{t:"2. Enter the TOTP generated by your authenticator to verify"})])]),t("div",S,[v(t("input",{class:"form-control text-center totp",id:"totp",maxlength:"6",type:"text",inputmode:"numeric",autocomplete:"one-time-code","onUpdate:modelValue":e[0]||(e[0]=u=>this.totp=u),disabled:this.verified},null,8,A),[[g,this.totp]]),t("div",E,[i(o,{t:this.totpInvalidMessage},null,8,["t"])]),t("div",F,[i(o,{t:"TOTP verified!"})])])]),e[4]||(e[4]=t("hr",null,null,-1)),t("div",R,[this.verified?(n(),d(l,{key:1,to:"/",class:"btn btn-dark btn-lg d-flex btn-brand shadow align-items-center flex-grow-1 rounded-3"},{default:r(()=>[i(o,{t:"Complete"}),e[3]||(e[3]=t("i",{class:"bi bi-chevron-right ms-auto"},null,-1))]),_:1})):(n(),d(l,{key:0,to:"/",class:"btn bg-secondary-subtle text-secondary-emphasis rounded-3 flex-grow-1 btn-lg border-1 border-secondary-subtle shadow d-flex"},{default:r(()=>[i(o,{t:"I don't need MFA"}),e[2]||(e[2]=t("i",{class:"bi bi-chevron-right ms-auto"},null,-1))]),_:1}))])])])],8,k)}const z=h(T,[["render",G]]);export{z as default}; diff --git a/src/static/app/dist/assets/traceroute-D1nMpdIh.js b/src/static/app/dist/assets/traceroute-BGkng5o-.js similarity index 96% rename from src/static/app/dist/assets/traceroute-D1nMpdIh.js rename to src/static/app/dist/assets/traceroute-BGkng5o-.js index 9a89157..503262d 100644 --- a/src/static/app/dist/assets/traceroute-D1nMpdIh.js +++ b/src/static/app/dist/assets/traceroute-BGkng5o-.js @@ -1 +1 @@ -import{_ as h,W as b,g,c as o,b as t,d as n,m as y,s as f,A as v,w as r,T as c,a,f as x,F as u,h as m,n as T,z as k,t as i,e as A,j as _}from"./index-BPNEscAR.js";import{O as w}from"./osmap-DFqkfaU2.js";import{L as R}from"./localeText-DX813vQA.js";const M={name:"traceroute",components:{LocaleText:R,OSMap:w},data(){return{tracing:!1,ipAddress:void 0,tracerouteResult:void 0}},setup(){return{store:b()}},methods:{execute(){this.ipAddress&&(this.tracing=!0,this.tracerouteResult=void 0,g("/api/traceroute/execute",{ipAddress:this.ipAddress},d=>{d.status?this.tracerouteResult=d.data:this.store.newMessage("Server",d.message,"danger"),this.tracing=!1}))}}},S={class:"mt-md-5 mt-3 text-body"},$={class:"container-md"},C={class:"mb-3 text-body"},L={class:"d-flex gap-2 flex-column mb-5"},P={class:"mb-1 text-muted",for:"ipAddress"},V=["disabled"],N=["disabled"],O={key:0,class:"d-block"},z={key:1,class:"d-block"},B={class:"position-relative"},I={key:"pingPlaceholder"},D={key:1},E={key:"table",class:"w-100 mt-2"},F={class:"table table-sm rounded-3 w-100"},G={scope:"col"},H={scope:"col"},K={scope:"col"},W={scope:"col"},j={scope:"col"},U={scope:"col"},q={key:0};function J(d,s,Q,X,Y,Z){const l=_("LocaleText"),p=_("OSMap");return a(),o("div",S,[t("div",$,[t("h3",C,[n(l,{t:"Traceroute"})]),t("div",L,[t("div",null,[t("label",P,[t("small",null,[n(l,{t:"Enter IP Address / Hostname"})])]),y(t("input",{disabled:this.tracing,id:"ipAddress",class:"form-control","onUpdate:modelValue":s[0]||(s[0]=e=>this.ipAddress=e),onKeyup:s[1]||(s[1]=v(e=>this.execute(),["enter"])),type:"text"},null,40,V),[[f,this.ipAddress]])]),t("button",{class:"btn btn-primary rounded-3 mt-3 position-relative",disabled:this.tracing||!this.ipAddress,onClick:s[2]||(s[2]=e=>this.execute())},[n(c,{name:"slide"},{default:r(()=>[this.tracing?(a(),o("span",z,s[4]||(s[4]=[t("span",{class:"spinner-border spinner-border-sm","aria-hidden":"true"},null,-1),t("span",{class:"visually-hidden",role:"status"},"Loading...",-1)]))):(a(),o("span",O,s[3]||(s[3]=[t("i",{class:"bi bi-person-walking me-2"},null,-1),x("Trace! ")])))]),_:1})],8,N)]),t("div",B,[n(c,{name:"ping"},{default:r(()=>[this.tracerouteResult?(a(),o("div",D,[n(p,{d:this.tracerouteResult,type:"traceroute"},null,8,["d"]),t("div",E,[t("table",F,[t("thead",null,[t("tr",null,[t("th",G,[n(l,{t:"Hop"})]),t("th",H,[n(l,{t:"IP Address"})]),t("th",K,[n(l,{t:"Average RTT (ms)"})]),t("th",W,[n(l,{t:"Min RTT (ms)"})]),t("th",j,[n(l,{t:"Max RTT (ms)"})]),t("th",U,[n(l,{t:"Geolocation"})])])]),t("tbody",null,[(a(!0),o(u,null,m(this.tracerouteResult,(e,tt)=>(a(),o("tr",null,[t("td",null,[t("small",null,i(e.hop),1)]),t("td",null,[t("small",null,i(e.ip),1)]),t("td",null,[t("small",null,i(e.avg_rtt),1)]),t("td",null,[t("small",null,i(e.min_rtt),1)]),t("td",null,[t("small",null,i(e.max_rtt),1)]),t("td",null,[e.geo.city&&e.geo.country?(a(),o("span",q,[t("small",null,i(e.geo.city)+", "+i(e.geo.country),1)])):A("",!0)])]))),256))])])])])):(a(),o("div",I,[s[5]||(s[5]=t("div",{class:"pingPlaceholder bg-body-secondary rounded-3 mb-3",style:{height:"300px !important"}},null,-1)),(a(),o(u,null,m(5,e=>t("div",{class:T(["pingPlaceholder bg-body-secondary rounded-3 mb-3",{"animate__animated animate__flash animate__slower animate__infinite":this.tracing}]),style:k({"animation-delay":`${e*.05}s`})},null,6)),64))]))]),_:1})])])])}const ot=h(M,[["render",J],["__scopeId","data-v-549eb223"]]);export{ot as default}; +import{_ as h,W as b,g,c as o,b as t,d as n,m as y,s as f,A as v,w as r,T as c,a,f as x,F as u,h as m,n as T,z as k,t as i,e as A,j as _}from"./index-DOaPWS1X.js";import{O as w}from"./osmap-BRB1j1wE.js";import{L as R}from"./localeText-CaAXeE0W.js";const M={name:"traceroute",components:{LocaleText:R,OSMap:w},data(){return{tracing:!1,ipAddress:void 0,tracerouteResult:void 0}},setup(){return{store:b()}},methods:{execute(){this.ipAddress&&(this.tracing=!0,this.tracerouteResult=void 0,g("/api/traceroute/execute",{ipAddress:this.ipAddress},d=>{d.status?this.tracerouteResult=d.data:this.store.newMessage("Server",d.message,"danger"),this.tracing=!1}))}}},S={class:"mt-md-5 mt-3 text-body"},$={class:"container-md"},C={class:"mb-3 text-body"},L={class:"d-flex gap-2 flex-column mb-5"},P={class:"mb-1 text-muted",for:"ipAddress"},V=["disabled"],N=["disabled"],O={key:0,class:"d-block"},z={key:1,class:"d-block"},B={class:"position-relative"},I={key:"pingPlaceholder"},D={key:1},E={key:"table",class:"w-100 mt-2"},F={class:"table table-sm rounded-3 w-100"},G={scope:"col"},H={scope:"col"},K={scope:"col"},W={scope:"col"},j={scope:"col"},U={scope:"col"},q={key:0};function J(d,s,Q,X,Y,Z){const l=_("LocaleText"),p=_("OSMap");return a(),o("div",S,[t("div",$,[t("h3",C,[n(l,{t:"Traceroute"})]),t("div",L,[t("div",null,[t("label",P,[t("small",null,[n(l,{t:"Enter IP Address / Hostname"})])]),y(t("input",{disabled:this.tracing,id:"ipAddress",class:"form-control","onUpdate:modelValue":s[0]||(s[0]=e=>this.ipAddress=e),onKeyup:s[1]||(s[1]=v(e=>this.execute(),["enter"])),type:"text"},null,40,V),[[f,this.ipAddress]])]),t("button",{class:"btn btn-primary rounded-3 mt-3 position-relative",disabled:this.tracing||!this.ipAddress,onClick:s[2]||(s[2]=e=>this.execute())},[n(c,{name:"slide"},{default:r(()=>[this.tracing?(a(),o("span",z,s[4]||(s[4]=[t("span",{class:"spinner-border spinner-border-sm","aria-hidden":"true"},null,-1),t("span",{class:"visually-hidden",role:"status"},"Loading...",-1)]))):(a(),o("span",O,s[3]||(s[3]=[t("i",{class:"bi bi-person-walking me-2"},null,-1),x("Trace! ")])))]),_:1})],8,N)]),t("div",B,[n(c,{name:"ping"},{default:r(()=>[this.tracerouteResult?(a(),o("div",D,[n(p,{d:this.tracerouteResult,type:"traceroute"},null,8,["d"]),t("div",E,[t("table",F,[t("thead",null,[t("tr",null,[t("th",G,[n(l,{t:"Hop"})]),t("th",H,[n(l,{t:"IP Address"})]),t("th",K,[n(l,{t:"Average RTT (ms)"})]),t("th",W,[n(l,{t:"Min RTT (ms)"})]),t("th",j,[n(l,{t:"Max RTT (ms)"})]),t("th",U,[n(l,{t:"Geolocation"})])])]),t("tbody",null,[(a(!0),o(u,null,m(this.tracerouteResult,(e,tt)=>(a(),o("tr",null,[t("td",null,[t("small",null,i(e.hop),1)]),t("td",null,[t("small",null,i(e.ip),1)]),t("td",null,[t("small",null,i(e.avg_rtt),1)]),t("td",null,[t("small",null,i(e.min_rtt),1)]),t("td",null,[t("small",null,i(e.max_rtt),1)]),t("td",null,[e.geo.city&&e.geo.country?(a(),o("span",q,[t("small",null,i(e.geo.city)+", "+i(e.geo.country),1)])):A("",!0)])]))),256))])])])])):(a(),o("div",I,[s[5]||(s[5]=t("div",{class:"pingPlaceholder bg-body-secondary rounded-3 mb-3",style:{height:"300px !important"}},null,-1)),(a(),o(u,null,m(5,e=>t("div",{class:T(["pingPlaceholder bg-body-secondary rounded-3 mb-3",{"animate__animated animate__flash animate__slower animate__infinite":this.tracing}]),style:k({"animation-delay":`${e*.05}s`})},null,6)),64))]))]),_:1})])])])}const ot=h(M,[["render",J],["__scopeId","data-v-549eb223"]]);export{ot as default}; diff --git a/src/static/app/dist/assets/vue-datepicker-D9reu0Fg.js b/src/static/app/dist/assets/vue-datepicker-D91GxXPq.js similarity index 99% rename from src/static/app/dist/assets/vue-datepicker-D9reu0Fg.js rename to src/static/app/dist/assets/vue-datepicker-D91GxXPq.js index de55b95..ad9294f 100644 --- a/src/static/app/dist/assets/vue-datepicker-D9reu0Fg.js +++ b/src/static/app/dist/assets/vue-datepicker-D91GxXPq.js @@ -1 +1 @@ -import{C as ha,r as Z,K as ze,a1 as qt,a2 as ca,o as Ke,Q as it,O as Ca,E as ct,x as G,a as P,c as W,d as ot,a3 as je,h as Ye,w as _e,a4 as ue,a5 as We,a6 as at,B as d,a7 as Qe,a8 as Pn,i as De,T as ta,e as j,l as Oa,a9 as Br,n as ke,b as ye,F as we,z as dt,aa as va,t as Ge,M as Nr,ab as An,ac as Lr,f as Dt,ad as Hr,m as Ma,ae as Da,A as Vr,I as Fr,J as qr}from"./index-BPNEscAR.js";function ve(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Te(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function mt(e,t){const n=ve(e);return isNaN(t)?Te(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function ft(e,t){const n=ve(e);if(isNaN(t))return Te(e,NaN);if(!t)return n;const a=n.getDate(),r=Te(e,n.getTime());r.setMonth(n.getMonth()+t+1,0);const l=r.getDate();return a>=l?r:(n.setFullYear(r.getFullYear(),r.getMonth(),a),n)}function Xn(e,t){const{years:n=0,months:a=0,weeks:r=0,days:l=0,hours:i=0,minutes:p=0,seconds:c=0}=t,C=ve(e),m=a||n?ft(C,a+n*12):C,v=l||r?mt(m,l+r*7):m,h=p+i*60,Y=(c+h*60)*1e3;return Te(e,v.getTime()+Y)}function Wr(e,t){const n=+ve(e);return Te(e,n+t)}const Gn=6048e5,Qr=864e5,zr=6e4,jn=36e5,Ur=1e3;function Xr(e,t){return Wr(e,t*jn)}let Gr={};function Wt(){return Gr}function ht(e,t){const n=Wt(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=ve(e),l=r.getDay(),i=(l=r.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function Cn(e){const t=ve(e);return t.setHours(0,0,0,0),t}function Ta(e){const t=ve(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Jn(e,t){const n=Cn(e),a=Cn(t),r=+n-Ta(n),l=+a-Ta(a);return Math.round((r-l)/Qr)}function jr(e){const t=Kn(e),n=Te(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Gt(n)}function Kr(e,t){const n=t*3;return ft(e,n)}function un(e,t){return ft(e,t*12)}function On(e,t){const n=ve(e),a=ve(t),r=n.getTime()-a.getTime();return r<0?-1:r>0?1:r}function Zn(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ua(e){if(!Zn(e)&&typeof e!="number")return!1;const t=ve(e);return!isNaN(Number(t))}function $n(e){const t=ve(e);return Math.trunc(t.getMonth()/3)+1}function Jr(e,t){const n=ve(e),a=ve(t);return n.getFullYear()-a.getFullYear()}function Zr(e,t){const n=ve(e),a=ve(t),r=On(n,a),l=Math.abs(Jr(n,a));n.setFullYear(1584),a.setFullYear(1584);const i=On(n,a)===-r,p=r*(l-+i);return p===0?0:p}function er(e,t){const n=ve(e.start),a=ve(e.end);let r=+n>+a;const l=r?+n:+a,i=r?a:n;i.setHours(0,0,0,0);let p=1;const c=[];for(;+i<=l;)c.push(ve(i)),i.setDate(i.getDate()+p),i.setHours(0,0,0,0);return r?c.reverse():c}function Ht(e){const t=ve(e),n=t.getMonth(),a=n-n%3;return t.setMonth(a,1),t.setHours(0,0,0,0),t}function el(e,t){const n=ve(e.start),a=ve(e.end);let r=+n>+a;const l=r?+Ht(n):+Ht(a);let i=Ht(r?a:n),p=1;const c=[];for(;+i<=l;)c.push(ve(i)),i=Kr(i,p);return r?c.reverse():c}function tl(e){const t=ve(e);return t.setDate(1),t.setHours(0,0,0,0),t}function tr(e){const t=ve(e),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}function ma(e){const t=ve(e),n=Te(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ar(e,t){const n=Wt(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=ve(e),l=r.getDay(),i=(l{let a;const r=al[e];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function Wa(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const rl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ll={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ol={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},il={date:Wa({formats:rl,defaultWidth:"full"}),time:Wa({formats:ll,defaultWidth:"full"}),dateTime:Wa({formats:ol,defaultWidth:"full"})},sl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ul=(e,t,n,a)=>sl[e];function oa(e){return(t,n)=>{const a=n?.context?String(n.context):"standalone";let r;if(a==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,p=n?.width?String(n.width):i;r=e.formattingValues[p]||e.formattingValues[i]}else{const i=e.defaultWidth,p=n?.width?String(n.width):e.defaultWidth;r=e.values[p]||e.values[i]}const l=e.argumentCallback?e.argumentCallback(t):t;return r[l]}}const dl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},cl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},vl={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ml={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},pl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},fl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hl=(e,t)=>{const n=Number(e),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yl={ordinalNumber:hl,era:oa({values:dl,defaultWidth:"wide"}),quarter:oa({values:cl,defaultWidth:"wide",argumentCallback:e=>e-1}),month:oa({values:vl,defaultWidth:"wide"}),day:oa({values:ml,defaultWidth:"wide"}),dayPeriod:oa({values:pl,defaultWidth:"wide",formattingValues:fl,defaultFormattingWidth:"wide"})};function ia(e){return(t,n={})=>{const a=n.width,r=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],l=t.match(r);if(!l)return null;const i=l[0],p=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(p)?bl(p,v=>v.test(i)):gl(p,v=>v.test(i));let C;C=e.valueCallback?e.valueCallback(c):c,C=n.valueCallback?n.valueCallback(C):C;const m=t.slice(i.length);return{value:C,rest:m}}}function gl(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function bl(e,t){for(let n=0;n{const a=t.match(e.matchPattern);if(!a)return null;const r=a[0],l=t.match(e.parsePattern);if(!l)return null;let i=e.valueCallback?e.valueCallback(l[0]):l[0];i=n.valueCallback?n.valueCallback(i):i;const p=t.slice(r.length);return{value:i,rest:p}}}const _l=/^(\d+)(th|st|nd|rd)?/i,kl=/\d+/i,xl={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ml={any:[/^b/i,/^(a|c)/i]},Dl={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Tl={any:[/1/i,/2/i,/3/i,/4/i]},Pl={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Al={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Cl={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ol={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$l={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Yl={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Sl={ordinalNumber:wl({matchPattern:_l,parsePattern:kl,valueCallback:e=>parseInt(e,10)}),era:ia({matchPatterns:xl,defaultMatchWidth:"wide",parsePatterns:Ml,defaultParseWidth:"any"}),quarter:ia({matchPatterns:Dl,defaultMatchWidth:"wide",parsePatterns:Tl,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ia({matchPatterns:Pl,defaultMatchWidth:"wide",parsePatterns:Al,defaultParseWidth:"any"}),day:ia({matchPatterns:Cl,defaultMatchWidth:"wide",parsePatterns:Ol,defaultParseWidth:"any"}),dayPeriod:ia({matchPatterns:$l,defaultMatchWidth:"any",parsePatterns:Yl,defaultParseWidth:"any"})},nr={code:"en-US",formatDistance:nl,formatLong:il,formatRelative:ul,localize:yl,match:Sl,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Rl(e){const t=ve(e);return Jn(t,ma(t))+1}function dn(e){const t=ve(e),n=+Gt(t)-+jr(t);return Math.round(n/Gn)+1}function cn(e,t){const n=ve(e),a=n.getFullYear(),r=Wt(),l=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=Te(e,0);i.setFullYear(a+1,0,l),i.setHours(0,0,0,0);const p=ht(i,t),c=Te(e,0);c.setFullYear(a,0,l),c.setHours(0,0,0,0);const C=ht(c,t);return n.getTime()>=p.getTime()?a+1:n.getTime()>=C.getTime()?a:a-1}function Il(e,t){const n=Wt(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=cn(e,t),l=Te(e,0);return l.setFullYear(r,0,a),l.setHours(0,0,0,0),ht(l,t)}function vn(e,t){const n=ve(e),a=+ht(n,t)-+Il(n,t);return Math.round(a/Gn)+1}function Ae(e,t){const n=e<0?"-":"",a=Math.abs(e).toString().padStart(t,"0");return n+a}const Ct={y(e,t){const n=e.getFullYear(),a=n>0?n:1-n;return Ae(t==="yy"?a%100:a,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ae(n+1,2)},d(e,t){return Ae(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ae(e.getHours()%12||12,t.length)},H(e,t){return Ae(e.getHours(),t.length)},m(e,t){return Ae(e.getMinutes(),t.length)},s(e,t){return Ae(e.getSeconds(),t.length)},S(e,t){const n=t.length,a=e.getMilliseconds(),r=Math.trunc(a*Math.pow(10,n-3));return Ae(r,t.length)}},Qt={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Sn={G:function(e,t,n){const a=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});case"GGGG":default:return n.era(a,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const a=e.getFullYear(),r=a>0?a:1-a;return n.ordinalNumber(r,{unit:"year"})}return Ct.y(e,t)},Y:function(e,t,n,a){const r=cn(e,a),l=r>0?r:1-r;if(t==="YY"){const i=l%100;return Ae(i,2)}return t==="Yo"?n.ordinalNumber(l,{unit:"year"}):Ae(l,t.length)},R:function(e,t){const n=Kn(e);return Ae(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ae(n,t.length)},Q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return Ae(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return Ae(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,n){const a=e.getMonth();switch(t){case"M":case"MM":return Ct.M(e,t);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,n){const a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return Ae(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,n,a){const r=vn(e,a);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Ae(r,t.length)},I:function(e,t,n){const a=dn(e);return t==="Io"?n.ordinalNumber(a,{unit:"week"}):Ae(a,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ct.d(e,t)},D:function(e,t,n){const a=Rl(e);return t==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):Ae(a,t.length)},E:function(e,t,n){const a=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});case"EEEE":default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,n,a){const r=e.getDay(),l=(r-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return Ae(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,a){const r=e.getDay(),l=(r-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return Ae(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const a=e.getDay(),r=a===0?7:a;switch(t){case"i":return String(r);case"ii":return Ae(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});case"iiii":default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const a=e.getHours();let r;switch(a===12?r=Qt.noon:a===0?r=Qt.midnight:r=a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const a=e.getHours();let r;switch(a>=17?r=Qt.evening:a>=12?r=Qt.afternoon:a>=4?r=Qt.morning:r=Qt.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let a=e.getHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return Ct.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ct.H(e,t)},K:function(e,t,n){const a=e.getHours()%12;return t==="Ko"?n.ordinalNumber(a,{unit:"hour"}):Ae(a,t.length)},k:function(e,t,n){let a=e.getHours();return a===0&&(a=24),t==="ko"?n.ordinalNumber(a,{unit:"hour"}):Ae(a,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ct.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ct.s(e,t)},S:function(e,t){return Ct.S(e,t)},X:function(e,t,n){const a=e.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return In(a);case"XXXX":case"XX":return Nt(a);case"XXXXX":case"XXX":default:return Nt(a,":")}},x:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"x":return In(a);case"xxxx":case"xx":return Nt(a);case"xxxxx":case"xxx":default:return Nt(a,":")}},O:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Rn(a,":");case"OOOO":default:return"GMT"+Nt(a,":")}},z:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Rn(a,":");case"zzzz":default:return"GMT"+Nt(a,":")}},t:function(e,t,n){const a=Math.trunc(e.getTime()/1e3);return Ae(a,t.length)},T:function(e,t,n){const a=e.getTime();return Ae(a,t.length)}};function Rn(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),r=Math.trunc(a/60),l=a%60;return l===0?n+String(r):n+String(r)+t+Ae(l,2)}function In(e,t){return e%60===0?(e>0?"-":"+")+Ae(Math.abs(e)/60,2):Nt(e,t)}function Nt(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),r=Ae(Math.trunc(a/60),2),l=Ae(a%60,2);return n+r+t+l}const En=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},rr=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},El=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],a=n[1],r=n[2];if(!r)return En(e,t);let l;switch(a){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",En(a,t)).replace("{{time}}",rr(r,t))},an={p:rr,P:El},Bl=/^D+$/,Nl=/^Y+$/,Ll=["D","DD","YY","YYYY"];function lr(e){return Bl.test(e)}function or(e){return Nl.test(e)}function nn(e,t,n){const a=Hl(e,t,n);if(console.warn(a),Ll.includes(e))throw new RangeError(a)}function Hl(e,t,n){const a=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Vl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ql=/^'([^]*?)'?$/,Wl=/''/g,Ql=/[a-zA-Z]/;function kt(e,t,n){const a=Wt(),r=n?.locale??a.locale??nr,l=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,p=ve(e);if(!ua(p))throw new RangeError("Invalid time value");let c=t.match(Fl).map(m=>{const v=m[0];if(v==="p"||v==="P"){const h=an[v];return h(m,r.formatLong)}return m}).join("").match(Vl).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const v=m[0];if(v==="'")return{isToken:!1,value:zl(m)};if(Sn[v])return{isToken:!0,value:m};if(v.match(Ql))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:m}});r.localize.preprocessor&&(c=r.localize.preprocessor(p,c));const C={firstWeekContainsDate:l,weekStartsOn:i,locale:r};return c.map(m=>{if(!m.isToken)return m.value;const v=m.value;(!n?.useAdditionalWeekYearTokens&&or(v)||!n?.useAdditionalDayOfYearTokens&&lr(v))&&nn(v,t,String(e));const h=Sn[v[0]];return h(p,v,r.localize,C)}).join("")}function zl(e){const t=e.match(ql);return t?t[1].replace(Wl,"'"):e}function Ul(e){return ve(e).getDay()}function Xl(e){const t=ve(e),n=t.getFullYear(),a=t.getMonth(),r=Te(e,0);return r.setFullYear(n,a+1,0),r.setHours(0,0,0,0),r.getDate()}function Gl(){return Object.assign({},Wt())}function Tt(e){return ve(e).getHours()}function jl(e){let n=ve(e).getDay();return n===0&&(n=7),n}function Rt(e){return ve(e).getMinutes()}function xe(e){return ve(e).getMonth()}function jt(e){return ve(e).getSeconds()}function he(e){return ve(e).getFullYear()}function Kt(e,t){const n=ve(e),a=ve(t);return n.getTime()>a.getTime()}function pa(e,t){const n=ve(e),a=ve(t);return+n<+a}function Xt(e,t){const n=ve(e),a=ve(t);return+n==+a}function Kl(e,t){const n=t instanceof Date?Te(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}const Jl=10;class ir{subPriority=0;validate(t,n){return!0}}class Zl extends ir{constructor(t,n,a,r,l){super(),this.value=t,this.validateValue=n,this.setValue=a,this.priority=r,l&&(this.subPriority=l)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,a){return this.setValue(t,n,this.value,a)}}class eo extends ir{priority=Jl;subPriority=-1;set(t,n){return n.timestampIsSet?t:Te(t,Kl(t,Date))}}class Pe{run(t,n,a,r){const l=this.parse(t,n,a,r);return l?{setter:new Zl(l.value,this.validate,this.set,this.priority,this.subPriority),rest:l.rest}:null}validate(t,n,a){return!0}}class to extends Pe{priority=140;parse(t,n,a){switch(n){case"G":case"GG":case"GGG":return a.era(t,{width:"abbreviated"})||a.era(t,{width:"narrow"});case"GGGGG":return a.era(t,{width:"narrow"});case"GGGG":default:return a.era(t,{width:"wide"})||a.era(t,{width:"abbreviated"})||a.era(t,{width:"narrow"})}}set(t,n,a){return n.era=a,t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const Le={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},bt={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function He(e,t){return e&&{value:t(e.value),rest:e.rest}}function Re(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function wt(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const a=n[1]==="+"?1:-1,r=n[2]?parseInt(n[2],10):0,l=n[3]?parseInt(n[3],10):0,i=n[5]?parseInt(n[5],10):0;return{value:a*(r*jn+l*zr+i*Ur),rest:t.slice(n[0].length)}}function sr(e){return Re(Le.anyDigitsSigned,e)}function Ee(e,t){switch(e){case 1:return Re(Le.singleDigit,t);case 2:return Re(Le.twoDigits,t);case 3:return Re(Le.threeDigits,t);case 4:return Re(Le.fourDigits,t);default:return Re(new RegExp("^\\d{1,"+e+"}"),t)}}function Pa(e,t){switch(e){case 1:return Re(Le.singleDigitSigned,t);case 2:return Re(Le.twoDigitsSigned,t);case 3:return Re(Le.threeDigitsSigned,t);case 4:return Re(Le.fourDigitsSigned,t);default:return Re(new RegExp("^-?\\d{1,"+e+"}"),t)}}function mn(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function ur(e,t){const n=t>0,a=n?t:1-t;let r;if(a<=50)r=e||100;else{const l=a+50,i=Math.trunc(l/100)*100,p=e>=l%100;r=e+i-(p?100:0)}return n?r:1-r}function dr(e){return e%400===0||e%4===0&&e%100!==0}class ao extends Pe{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,a){const r=l=>({year:l,isTwoDigitYear:n==="yy"});switch(n){case"y":return He(Ee(4,t),r);case"yo":return He(a.ordinalNumber(t,{unit:"year"}),r);default:return He(Ee(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,a){const r=t.getFullYear();if(a.isTwoDigitYear){const i=ur(a.year,r);return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}const l=!("era"in n)||n.era===1?a.year:1-a.year;return t.setFullYear(l,0,1),t.setHours(0,0,0,0),t}}class no extends Pe{priority=130;parse(t,n,a){const r=l=>({year:l,isTwoDigitYear:n==="YY"});switch(n){case"Y":return He(Ee(4,t),r);case"Yo":return He(a.ordinalNumber(t,{unit:"year"}),r);default:return He(Ee(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,a,r){const l=cn(t,r);if(a.isTwoDigitYear){const p=ur(a.year,l);return t.setFullYear(p,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),ht(t,r)}const i=!("era"in n)||n.era===1?a.year:1-a.year;return t.setFullYear(i,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),ht(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class ro extends Pe{priority=130;parse(t,n){return Pa(n==="R"?4:n.length,t)}set(t,n,a){const r=Te(t,0);return r.setFullYear(a,0,4),r.setHours(0,0,0,0),Gt(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class lo extends Pe{priority=130;parse(t,n){return Pa(n==="u"?4:n.length,t)}set(t,n,a){return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class oo extends Pe{priority=120;parse(t,n,a){switch(n){case"Q":case"QQ":return Ee(n.length,t);case"Qo":return a.ordinalNumber(t,{unit:"quarter"});case"QQQ":return a.quarter(t,{width:"abbreviated",context:"formatting"})||a.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(t,{width:"wide",context:"formatting"})||a.quarter(t,{width:"abbreviated",context:"formatting"})||a.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,a){return t.setMonth((a-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class io extends Pe{priority=120;parse(t,n,a){switch(n){case"q":case"qq":return Ee(n.length,t);case"qo":return a.ordinalNumber(t,{unit:"quarter"});case"qqq":return a.quarter(t,{width:"abbreviated",context:"standalone"})||a.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(t,{width:"wide",context:"standalone"})||a.quarter(t,{width:"abbreviated",context:"standalone"})||a.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,a){return t.setMonth((a-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class so extends Pe{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,a){const r=l=>l-1;switch(n){case"M":return He(Re(Le.month,t),r);case"MM":return He(Ee(2,t),r);case"Mo":return He(a.ordinalNumber(t,{unit:"month"}),r);case"MMM":return a.month(t,{width:"abbreviated",context:"formatting"})||a.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(t,{width:"wide",context:"formatting"})||a.month(t,{width:"abbreviated",context:"formatting"})||a.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,a){return t.setMonth(a,1),t.setHours(0,0,0,0),t}}class uo extends Pe{priority=110;parse(t,n,a){const r=l=>l-1;switch(n){case"L":return He(Re(Le.month,t),r);case"LL":return He(Ee(2,t),r);case"Lo":return He(a.ordinalNumber(t,{unit:"month"}),r);case"LLL":return a.month(t,{width:"abbreviated",context:"standalone"})||a.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(t,{width:"wide",context:"standalone"})||a.month(t,{width:"abbreviated",context:"standalone"})||a.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,a){return t.setMonth(a,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function co(e,t,n){const a=ve(e),r=vn(a,n)-t;return a.setDate(a.getDate()-r*7),a}class vo extends Pe{priority=100;parse(t,n,a){switch(n){case"w":return Re(Le.week,t);case"wo":return a.ordinalNumber(t,{unit:"week"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,a,r){return ht(co(t,a,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function mo(e,t){const n=ve(e),a=dn(n)-t;return n.setDate(n.getDate()-a*7),n}class po extends Pe{priority=100;parse(t,n,a){switch(n){case"I":return Re(Le.week,t);case"Io":return a.ordinalNumber(t,{unit:"week"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,a){return Gt(mo(t,a))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const fo=[31,28,31,30,31,30,31,31,30,31,30,31],ho=[31,29,31,30,31,30,31,31,30,31,30,31];class yo extends Pe{priority=90;subPriority=1;parse(t,n,a){switch(n){case"d":return Re(Le.date,t);case"do":return a.ordinalNumber(t,{unit:"date"});default:return Ee(n.length,t)}}validate(t,n){const a=t.getFullYear(),r=dr(a),l=t.getMonth();return r?n>=1&&n<=ho[l]:n>=1&&n<=fo[l]}set(t,n,a){return t.setDate(a),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class go extends Pe{priority=90;subpriority=1;parse(t,n,a){switch(n){case"D":case"DD":return Re(Le.dayOfYear,t);case"Do":return a.ordinalNumber(t,{unit:"date"});default:return Ee(n.length,t)}}validate(t,n){const a=t.getFullYear();return dr(a)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,a){return t.setMonth(0,a),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function pn(e,t,n){const a=Wt(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,l=ve(e),i=l.getDay(),c=(t%7+7)%7,C=7-r,m=t<0||t>6?t-(i+C)%7:(c+C)%7-(i+C)%7;return mt(l,m)}class bo extends Pe{priority=90;parse(t,n,a){switch(n){case"E":case"EE":case"EEE":return a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(t,{width:"wide",context:"formatting"})||a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,a,r){return t=pn(t,a,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class wo extends Pe{priority=90;parse(t,n,a,r){const l=i=>{const p=Math.floor((i-1)/7)*7;return(i+r.weekStartsOn+6)%7+p};switch(n){case"e":case"ee":return He(Ee(n.length,t),l);case"eo":return He(a.ordinalNumber(t,{unit:"day"}),l);case"eee":return a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"eeeee":return a.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(t,{width:"wide",context:"formatting"})||a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,a,r){return t=pn(t,a,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class _o extends Pe{priority=90;parse(t,n,a,r){const l=i=>{const p=Math.floor((i-1)/7)*7;return(i+r.weekStartsOn+6)%7+p};switch(n){case"c":case"cc":return He(Ee(n.length,t),l);case"co":return He(a.ordinalNumber(t,{unit:"day"}),l);case"ccc":return a.day(t,{width:"abbreviated",context:"standalone"})||a.day(t,{width:"short",context:"standalone"})||a.day(t,{width:"narrow",context:"standalone"});case"ccccc":return a.day(t,{width:"narrow",context:"standalone"});case"cccccc":return a.day(t,{width:"short",context:"standalone"})||a.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(t,{width:"wide",context:"standalone"})||a.day(t,{width:"abbreviated",context:"standalone"})||a.day(t,{width:"short",context:"standalone"})||a.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,a,r){return t=pn(t,a,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function ko(e,t){const n=ve(e),a=jl(n),r=t-a;return mt(n,r)}class xo extends Pe{priority=90;parse(t,n,a){const r=l=>l===0?7:l;switch(n){case"i":case"ii":return Ee(n.length,t);case"io":return a.ordinalNumber(t,{unit:"day"});case"iii":return He(a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return He(a.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return He(a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"}),r);case"iiii":default:return He(a.day(t,{width:"wide",context:"formatting"})||a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,n){return n>=1&&n<=7}set(t,n,a){return t=ko(t,a),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Mo extends Pe{priority=80;parse(t,n,a){switch(n){case"a":case"aa":case"aaa":return a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(t,{width:"wide",context:"formatting"})||a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,a){return t.setHours(mn(a),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class Do extends Pe{priority=80;parse(t,n,a){switch(n){case"b":case"bb":case"bbb":return a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(t,{width:"wide",context:"formatting"})||a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,a){return t.setHours(mn(a),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class To extends Pe{priority=80;parse(t,n,a){switch(n){case"B":case"BB":case"BBB":return a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(t,{width:"wide",context:"formatting"})||a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,a){return t.setHours(mn(a),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class Po extends Pe{priority=70;parse(t,n,a){switch(n){case"h":return Re(Le.hour12h,t);case"ho":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,a){const r=t.getHours()>=12;return r&&a<12?t.setHours(a+12,0,0,0):!r&&a===12?t.setHours(0,0,0,0):t.setHours(a,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class Ao extends Pe{priority=70;parse(t,n,a){switch(n){case"H":return Re(Le.hour23h,t);case"Ho":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,a){return t.setHours(a,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class Co extends Pe{priority=70;parse(t,n,a){switch(n){case"K":return Re(Le.hour11h,t);case"Ko":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,a){return t.getHours()>=12&&a<12?t.setHours(a+12,0,0,0):t.setHours(a,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class Oo extends Pe{priority=70;parse(t,n,a){switch(n){case"k":return Re(Le.hour24h,t);case"ko":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,a){const r=a<=24?a%24:a;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class $o extends Pe{priority=60;parse(t,n,a){switch(n){case"m":return Re(Le.minute,t);case"mo":return a.ordinalNumber(t,{unit:"minute"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,a){return t.setMinutes(a,0,0),t}incompatibleTokens=["t","T"]}class Yo extends Pe{priority=50;parse(t,n,a){switch(n){case"s":return Re(Le.second,t);case"so":return a.ordinalNumber(t,{unit:"second"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,a){return t.setSeconds(a,0),t}incompatibleTokens=["t","T"]}class So extends Pe{priority=30;parse(t,n){const a=r=>Math.trunc(r*Math.pow(10,-n.length+3));return He(Ee(n.length,t),a)}set(t,n,a){return t.setMilliseconds(a),t}incompatibleTokens=["t","T"]}class Ro extends Pe{priority=10;parse(t,n){switch(n){case"X":return wt(bt.basicOptionalMinutes,t);case"XX":return wt(bt.basic,t);case"XXXX":return wt(bt.basicOptionalSeconds,t);case"XXXXX":return wt(bt.extendedOptionalSeconds,t);case"XXX":default:return wt(bt.extended,t)}}set(t,n,a){return n.timestampIsSet?t:Te(t,t.getTime()-Ta(t)-a)}incompatibleTokens=["t","T","x"]}class Io extends Pe{priority=10;parse(t,n){switch(n){case"x":return wt(bt.basicOptionalMinutes,t);case"xx":return wt(bt.basic,t);case"xxxx":return wt(bt.basicOptionalSeconds,t);case"xxxxx":return wt(bt.extendedOptionalSeconds,t);case"xxx":default:return wt(bt.extended,t)}}set(t,n,a){return n.timestampIsSet?t:Te(t,t.getTime()-Ta(t)-a)}incompatibleTokens=["t","T","X"]}class Eo extends Pe{priority=40;parse(t){return sr(t)}set(t,n,a){return[Te(t,a*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Bo extends Pe{priority=20;parse(t){return sr(t)}set(t,n,a){return[Te(t,a),{timestampIsSet:!0}]}incompatibleTokens="*"}const No={G:new to,y:new ao,Y:new no,R:new ro,u:new lo,Q:new oo,q:new io,M:new so,L:new uo,w:new vo,I:new po,d:new yo,D:new go,E:new bo,e:new wo,c:new _o,i:new xo,a:new Mo,b:new Do,B:new To,h:new Po,H:new Ao,K:new Co,k:new Oo,m:new $o,s:new Yo,S:new So,X:new Ro,x:new Io,t:new Eo,T:new Bo},Lo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ho=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vo=/^'([^]*?)'?$/,Fo=/''/g,qo=/\S/,Wo=/[a-zA-Z]/;function rn(e,t,n,a){const r=Gl(),l=a?.locale??r.locale??nr,i=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,p=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0;if(t==="")return e===""?ve(n):Te(n,NaN);const c={firstWeekContainsDate:i,weekStartsOn:p,locale:l},C=[new eo],m=t.match(Ho).map(f=>{const S=f[0];if(S in an){const I=an[S];return I(f,l.formatLong)}return f}).join("").match(Lo),v=[];for(let f of m){!a?.useAdditionalWeekYearTokens&&or(f)&&nn(f,t,e),!a?.useAdditionalDayOfYearTokens&&lr(f)&&nn(f,t,e);const S=f[0],I=No[S];if(I){const{incompatibleTokens:U}=I;if(Array.isArray(U)){const q=v.find(ae=>U.includes(ae.token)||ae.token===S);if(q)throw new RangeError(`The format string mustn't contain \`${q.fullToken}\` and \`${f}\` at the same time`)}else if(I.incompatibleTokens==="*"&&v.length>0)throw new RangeError(`The format string mustn't contain \`${f}\` and any other token at the same time`);v.push({token:S,fullToken:f});const A=I.run(e,f,l.match,c);if(!A)return Te(n,NaN);C.push(A.setter),e=A.rest}else{if(S.match(Wo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");if(f==="''"?f="'":S==="'"&&(f=Qo(f)),e.indexOf(f)===0)e=e.slice(f.length);else return Te(n,NaN)}}if(e.length>0&&qo.test(e))return Te(n,NaN);const h=C.map(f=>f.priority).sort((f,S)=>S-f).filter((f,S,I)=>I.indexOf(f)===S).map(f=>C.filter(S=>S.priority===f).sort((S,I)=>I.subPriority-S.subPriority)).map(f=>f[0]);let k=ve(n);if(isNaN(k.getTime()))return Te(n,NaN);const Y={};for(const f of h){if(!f.validate(k,c))return Te(n,NaN);const S=f.set(k,Y,c);Array.isArray(S)?(k=S[0],Object.assign(Y,S[1])):k=S}return Te(n,k)}function Qo(e){return e.match(Vo)[1].replace(Fo,"'")}function Bn(e,t){const n=Ht(e),a=Ht(t);return+n==+a}function zo(e,t){return mt(e,-t)}function cr(e,t){const n=ve(e),a=n.getFullYear(),r=n.getDate(),l=Te(e,0);l.setFullYear(a,t,15),l.setHours(0,0,0,0);const i=Xl(l);return n.setMonth(t,Math.min(r,i)),n}function Ce(e,t){let n=ve(e);return isNaN(+n)?Te(e,NaN):(t.year!=null&&n.setFullYear(t.year),t.month!=null&&(n=cr(n,t.month)),t.date!=null&&n.setDate(t.date),t.hours!=null&&n.setHours(t.hours),t.minutes!=null&&n.setMinutes(t.minutes),t.seconds!=null&&n.setSeconds(t.seconds),t.milliseconds!=null&&n.setMilliseconds(t.milliseconds),n)}function Uo(e,t){const n=ve(e);return n.setHours(t),n}function vr(e,t){const n=ve(e);return n.setMilliseconds(t),n}function Xo(e,t){const n=ve(e);return n.setMinutes(t),n}function mr(e,t){const n=ve(e);return n.setSeconds(t),n}function _t(e,t){const n=ve(e);return isNaN(+n)?Te(e,NaN):(n.setFullYear(t),n)}function Jt(e,t){return ft(e,-t)}function Go(e,t){const{years:n=0,months:a=0,weeks:r=0,days:l=0,hours:i=0,minutes:p=0,seconds:c=0}=t,C=Jt(e,a+n*12),m=zo(C,l+r*7),v=p+i*60,k=(c+v*60)*1e3;return Te(e,m.getTime()-k)}function pr(e,t){return un(e,-t)}function aa(){const e=Lr();return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img",...e},[ye("path",{d:"M29.333 8c0-2.208-1.792-4-4-4h-18.667c-2.208 0-4 1.792-4 4v18.667c0 2.208 1.792 4 4 4h18.667c2.208 0 4-1.792 4-4v-18.667zM26.667 8v18.667c0 0.736-0.597 1.333-1.333 1.333 0 0-18.667 0-18.667 0-0.736 0-1.333-0.597-1.333-1.333 0 0 0-18.667 0-18.667 0-0.736 0.597-1.333 1.333-1.333 0 0 18.667 0 18.667 0 0.736 0 1.333 0.597 1.333 1.333z"}),ye("path",{d:"M20 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),ye("path",{d:"M9.333 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),ye("path",{d:"M4 14.667h24c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-24c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"})])}aa.compatConfig={MODE:3};function fr(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"}),ye("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}fr.compatConfig={MODE:3};function fn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M20.943 23.057l-7.057-7.057c0 0 7.057-7.057 7.057-7.057 0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-8 8c-0.521 0.521-0.521 1.365 0 1.885l8 8c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}fn.compatConfig={MODE:3};function hn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M12.943 24.943l8-8c0.521-0.521 0.521-1.365 0-1.885l-8-8c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885l7.057 7.057c0 0-7.057 7.057-7.057 7.057-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0z"})])}hn.compatConfig={MODE:3};function yn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M16 1.333c-8.095 0-14.667 6.572-14.667 14.667s6.572 14.667 14.667 14.667c8.095 0 14.667-6.572 14.667-14.667s-6.572-14.667-14.667-14.667zM16 4c6.623 0 12 5.377 12 12s-5.377 12-12 12c-6.623 0-12-5.377-12-12s5.377-12 12-12z"}),ye("path",{d:"M14.667 8v8c0 0.505 0.285 0.967 0.737 1.193l5.333 2.667c0.658 0.329 1.46 0.062 1.789-0.596s0.062-1.46-0.596-1.789l-4.596-2.298c0 0 0-7.176 0-7.176 0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"})])}yn.compatConfig={MODE:3};function gn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M24.943 19.057l-8-8c-0.521-0.521-1.365-0.521-1.885 0l-8 8c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l7.057-7.057c0 0 7.057 7.057 7.057 7.057 0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}gn.compatConfig={MODE:3};function bn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M7.057 12.943l8 8c0.521 0.521 1.365 0.521 1.885 0l8-8c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-7.057 7.057c0 0-7.057-7.057-7.057-7.057-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}bn.compatConfig={MODE:3};const nt=(e,t)=>t?new Date(e.toLocaleString("en-US",{timeZone:t})):new Date(e),wn=(e,t,n)=>ln(e,t,n)||Q(),jo=(e,t,n)=>{const a=t.dateInTz?nt(new Date(e),t.dateInTz):Q(e);return n?tt(a,!0):a},ln=(e,t,n)=>{if(!e)return null;const a=n?tt(Q(e),!0):Q(e);return t?t.exactMatch?jo(e,t,n):nt(a,t.timezone):a},Ko=e=>{if(!e)return 0;const t=new Date,n=new Date(t.toLocaleString("en-US",{timeZone:"UTC"})),a=new Date(t.toLocaleString("en-US",{timeZone:e})),r=a.getTimezoneOffset()/60;return(+n-+a)/(1e3*60*60)-r};var vt=(e=>(e.month="month",e.year="year",e))(vt||{}),Lt=(e=>(e.top="top",e.bottom="bottom",e))(Lt||{}),Vt=(e=>(e.header="header",e.calendar="calendar",e.timePicker="timePicker",e))(Vt||{}),Xe=(e=>(e.month="month",e.year="year",e.calendar="calendar",e.time="time",e.minutes="minutes",e.hours="hours",e.seconds="seconds",e))(Xe||{});const Jo=["timestamp","date","iso"];var Ze=(e=>(e.up="up",e.down="down",e.left="left",e.right="right",e))(Ze||{}),$e=(e=>(e.arrowUp="ArrowUp",e.arrowDown="ArrowDown",e.arrowLeft="ArrowLeft",e.arrowRight="ArrowRight",e.enter="Enter",e.space=" ",e.esc="Escape",e.tab="Tab",e.home="Home",e.end="End",e.pageUp="PageUp",e.pageDown="PageDown",e))($e||{});function Nn(e){return t=>new Intl.DateTimeFormat(e,{weekday:"short",timeZone:"UTC"}).format(new Date(`2017-01-0${t}T00:00:00+00:00`)).slice(0,2)}function Zo(e){return t=>kt(nt(new Date(`2017-01-0${t}T00:00:00+00:00`),"UTC"),"EEEEEE",{locale:e})}const ei=(e,t,n)=>{const a=[1,2,3,4,5,6,7];let r;if(e!==null)try{r=a.map(Zo(e))}catch{r=a.map(Nn(t))}else r=a.map(Nn(t));const l=r.slice(0,n),i=r.slice(n+1,r.length);return[r[n]].concat(...i).concat(...l)},_n=(e,t,n)=>{const a=[];for(let r=+e[0];r<=+e[1];r++)a.push({value:+r,text:br(r,t)});return n?a.reverse():a},hr=(e,t,n)=>{const a=[1,2,3,4,5,6,7,8,9,10,11,12].map(l=>{const i=l<10?`0${l}`:l;return new Date(`2017-${i}-01T00:00:00+00:00`)});if(e!==null)try{const l=n==="long"?"LLLL":"LLL";return a.map((i,p)=>{const c=kt(nt(i,"UTC"),l,{locale:e});return{text:c.charAt(0).toUpperCase()+c.substring(1),value:p}})}catch{}const r=new Intl.DateTimeFormat(t,{month:n,timeZone:"UTC"});return a.map((l,i)=>{const p=r.format(l);return{text:p.charAt(0).toUpperCase()+p.substring(1),value:i}})},ti=e=>[12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11][e],Fe=e=>{const t=d(e);return t!=null&&t.$el?t?.$el:t},ai=e=>({type:"dot",...e??{}}),yr=e=>Array.isArray(e)?!!e[0]&&!!e[1]:!1,kn={prop:e=>`"${e}" prop must be enabled!`,dateArr:e=>`You need to use array as "model-value" binding in order to support "${e}"`},qe=e=>e,Ln=e=>e===0?e:!e||isNaN(+e)?null:+e,Hn=e=>e===null,gr=e=>{if(e)return[...e.querySelectorAll("input, button, select, textarea, a[href]")][0]},ni=e=>{const t=[],n=a=>a.filter(r=>r);for(let a=0;a{const a=n!=null,r=t!=null;if(!a&&!r)return!1;const l=+n,i=+t;return a&&r?+e>l||+el:r?+eni(e).map(n=>n.map(a=>{const{active:r,disabled:l,isBetween:i,highlighted:p}=t(a);return{...a,active:r,disabled:l,className:{dp__overlay_cell_active:r,dp__overlay_cell:!r,dp__overlay_cell_disabled:l,dp__overlay_cell_pad:!0,dp__overlay_cell_active_disabled:l&&r,dp__cell_in_between:i,"dp--highlighted":p}}})),Yt=(e,t,n=!1)=>{e&&t.allowStopPropagation&&(n&&e.stopImmediatePropagation(),e.stopPropagation())},ri=()=>["a[href]","area[href]","input:not([disabled]):not([type='hidden'])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","[tabindex]:not([tabindex='-1'])","[data-datepicker-instance]"].join(", ");function li(e,t){let n=[...document.querySelectorAll(ri())];n=n.filter(r=>!e.contains(r)||r.hasAttribute("data-datepicker-instance"));const a=n.indexOf(e);if(a>=0&&(t?a-1>=0:a+1<=n.length))return n[a+(t?-1:1)]}const on=(e,t)=>e?.querySelector(`[data-dp-element="${t}"]`),br=(e,t)=>new Intl.NumberFormat(t,{useGrouping:!1,style:"decimal"}).format(e),xn=e=>kt(e,"dd-MM-yyyy"),Qa=e=>Array.isArray(e),Aa=(e,t)=>t.get(xn(e)),oi=(e,t)=>e?t?t instanceof Map?!!Aa(e,t):t(Q(e)):!1:!0,et=(e,t,n=!1,a)=>{if(e.key===$e.enter||e.key===$e.space)return n&&e.preventDefault(),t();if(a)return a(e)},Vn=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].some(e=>navigator.userAgent.includes(e))||navigator.userAgent.includes("Mac")&&"ontouchend"in document,Fn=(e,t,n,a,r,l)=>{const i=rn(e,t.slice(0,e.length),new Date,{locale:l});return ua(i)&&Zn(i)?a||r?i:Ce(i,{hours:+n.hours,minutes:+n?.minutes,seconds:+n?.seconds,milliseconds:0}):null},ii=(e,t,n,a,r,l)=>{const i=Array.isArray(n)?n[0]:n;if(typeof t=="string")return Fn(e,t,i,a,r,l);if(Array.isArray(t)){let p=null;for(const c of t)if(p=Fn(e,c,i,a,r,l),p)break;return p}return typeof t=="function"?t(e):null},Q=e=>e?new Date(e):new Date,si=(e,t,n)=>{if(t){const r=(e.getMonth()+1).toString().padStart(2,"0"),l=e.getDate().toString().padStart(2,"0"),i=e.getHours().toString().padStart(2,"0"),p=e.getMinutes().toString().padStart(2,"0"),c=n?e.getSeconds().toString().padStart(2,"0"):"00";return`${e.getFullYear()}-${r}-${l}T${i}:${p}:${c}.000Z`}const a=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds());return new Date(a).toISOString()},tt=(e,t)=>{const n=Q(JSON.parse(JSON.stringify(e))),a=Ce(n,{hours:0,minutes:0,seconds:0,milliseconds:0});return t?tl(a):a},St=(e,t,n,a)=>{let r=e?Q(e):Q();return(t||t===0)&&(r=Uo(r,+t)),(n||n===0)&&(r=Xo(r,+n)),(a||a===0)&&(r=mr(r,+a)),vr(r,0)},Ie=(e,t)=>!e||!t?!1:pa(tt(e),tt(t)),Me=(e,t)=>!e||!t?!1:Xt(tt(e),tt(t)),Ne=(e,t)=>!e||!t?!1:Kt(tt(e),tt(t)),$a=(e,t,n)=>e!=null&&e[0]&&e!=null&&e[1]?Ne(n,e[0])&&Ie(n,e[1]):e!=null&&e[0]&&t?Ne(n,e[0])&&Ie(n,t)||Ie(n,e[0])&&Ne(n,t):!1,pt=e=>{const t=Ce(new Date(e),{date:1});return tt(t)},za=(e,t,n)=>t&&(n||n===0)?Object.fromEntries(["hours","minutes","seconds"].map(a=>a===t?[a,n]:[a,isNaN(+e[a])?void 0:+e[a]])):{hours:isNaN(+e.hours)?void 0:+e.hours,minutes:isNaN(+e.minutes)?void 0:+e.minutes,seconds:isNaN(+e.seconds)?void 0:+e.seconds},Ft=e=>({hours:Tt(e),minutes:Rt(e),seconds:jt(e)}),wr=(e,t)=>{if(t){const n=he(Q(t));if(n>e)return 12;if(n===e)return xe(Q(t))}},_r=(e,t)=>{if(t){const n=he(Q(t));return n{if(e)return he(Q(e))},kr=(e,t)=>{const n=Ne(e,t)?t:e,a=Ne(t,e)?t:e;return er({start:n,end:a})},ui=e=>{const t=ft(e,1);return{month:xe(t),year:he(t)}},xt=(e,t)=>{const n=ht(e,{weekStartsOn:+t}),a=ar(e,{weekStartsOn:+t});return[n,a]},xr=(e,t)=>{const n={hours:Tt(Q()),minutes:Rt(Q()),seconds:t?jt(Q()):0};return Object.assign(n,e)},$t=(e,t,n)=>[Ce(Q(e),{date:1}),Ce(Q(),{month:t,year:n,date:1})],Mt=(e,t,n)=>{let a=e?Q(e):Q();return(t||t===0)&&(a=cr(a,t)),n&&(a=_t(a,n)),a},Mr=(e,t,n,a,r)=>{if(!a||r&&!t||!r&&!n)return!1;const l=r?ft(e,1):Jt(e,1),i=[xe(l),he(l)];return r?!ci(...i,t):!di(...i,n)},di=(e,t,n)=>Ie(...$t(n,e,t))||Me(...$t(n,e,t)),ci=(e,t,n)=>Ne(...$t(n,e,t))||Me(...$t(n,e,t)),Dr=(e,t,n,a,r,l,i)=>{if(typeof t=="function"&&!i)return t(e);const p=n?{locale:n}:void 0;return Array.isArray(e)?`${kt(e[0],l,p)}${r&&!e[1]?"":a}${e[1]?kt(e[1],l,p):""}`:kt(e,l,p)},zt=e=>{if(e)return null;throw new Error(kn.prop("partial-range"))},ka=(e,t)=>{if(t)return e();throw new Error(kn.prop("range"))},sn=e=>Array.isArray(e)?ua(e[0])&&(e[1]?ua(e[1]):!0):e?ua(e):!1,vi=(e,t)=>Ce(t??Q(),{hours:+e.hours||0,minutes:+e.minutes||0,seconds:+e.seconds||0}),Ua=(e,t,n,a)=>{if(!e)return!0;if(a){const r=n==="max"?pa(e,t):Kt(e,t),l={seconds:0,milliseconds:0};return r||Xt(Ce(e,l),Ce(t,l))}return n==="max"?e.getTime()<=t.getTime():e.getTime()>=t.getTime()},Xa=(e,t,n)=>e?vi(e,t):Q(n??t),qn=(e,t,n,a,r)=>{if(Array.isArray(a)){const i=Xa(e,a[0],t),p=Xa(e,a[1],t);return Ua(a[0],i,n,!!t)&&Ua(a[1],p,n,!!t)&&r}const l=Xa(e,a,t);return Ua(a,l,n,!!t)&&r},Ga=e=>Ce(Q(),Ft(e)),mi=(e,t)=>e instanceof Map?Array.from(e.values()).filter(n=>he(Q(n))===t).map(n=>xe(n)):[],Tr=(e,t,n)=>typeof e=="function"?e({month:t,year:n}):!!e.months.find(a=>a.month===t&&a.year===n),Mn=(e,t)=>typeof e=="function"?e(t):e.years.includes(t),Pr=e=>kt(e,"yyyy-MM-dd"),sa=ha({menuFocused:!1,shiftKeyInMenu:!1}),Ar=()=>{const e=n=>{sa.menuFocused=n},t=n=>{sa.shiftKeyInMenu!==n&&(sa.shiftKeyInMenu=n)};return{control:G(()=>({shiftKeyInMenu:sa.shiftKeyInMenu,menuFocused:sa.menuFocused})),setMenuFocused:e,setShiftKey:t}},Oe=ha({monthYear:[],calendar:[],time:[],actionRow:[],selectionGrid:[],timePicker:{0:[],1:[]},monthPicker:[]}),ja=Z(null),xa=Z(!1),Ka=Z(!1),Ja=Z(!1),Za=Z(!1),Ue=Z(0),Be=Z(0),It=()=>{const e=G(()=>xa.value?[...Oe.selectionGrid,Oe.actionRow].filter(v=>v.length):Ka.value?[...Oe.timePicker[0],...Oe.timePicker[1],Za.value?[]:[ja.value],Oe.actionRow].filter(v=>v.length):Ja.value?[...Oe.monthPicker,Oe.actionRow]:[Oe.monthYear,...Oe.calendar,Oe.time,Oe.actionRow].filter(v=>v.length)),t=v=>{Ue.value=v?Ue.value+1:Ue.value-1;let h=null;e.value[Be.value]&&(h=e.value[Be.value][Ue.value]),!h&&e.value[Be.value+(v?1:-1)]?(Be.value=Be.value+(v?1:-1),Ue.value=v?0:e.value[Be.value].length-1):h||(Ue.value=v?Ue.value-1:Ue.value+1)},n=v=>{Be.value===0&&!v||Be.value===e.value.length&&v||(Be.value=v?Be.value+1:Be.value-1,e.value[Be.value]?e.value[Be.value]&&!e.value[Be.value][Ue.value]&&Ue.value!==0&&(Ue.value=e.value[Be.value].length-1):Be.value=v?Be.value-1:Be.value+1)},a=v=>{let h=null;e.value[Be.value]&&(h=e.value[Be.value][Ue.value]),h?h.focus({preventScroll:!xa.value}):Ue.value=v?Ue.value-1:Ue.value+1},r=()=>{t(!0),a(!0)},l=()=>{t(!1),a(!1)},i=()=>{n(!1),a(!0)},p=()=>{n(!0),a(!0)},c=(v,h)=>{Oe[h]=v},C=(v,h)=>{Oe[h]=v},m=()=>{Ue.value=0,Be.value=0};return{buildMatrix:c,buildMultiLevelMatrix:C,setTimePickerBackRef:v=>{ja.value=v},setSelectionGrid:v=>{xa.value=v,m(),v||(Oe.selectionGrid=[])},setTimePicker:(v,h=!1)=>{Ka.value=v,Za.value=h,m(),v||(Oe.timePicker[0]=[],Oe.timePicker[1]=[])},setTimePickerElements:(v,h=0)=>{Oe.timePicker[h]=v},arrowRight:r,arrowLeft:l,arrowUp:i,arrowDown:p,clearArrowNav:()=>{Oe.monthYear=[],Oe.calendar=[],Oe.time=[],Oe.actionRow=[],Oe.selectionGrid=[],Oe.timePicker[0]=[],Oe.timePicker[1]=[],xa.value=!1,Ka.value=!1,Za.value=!1,Ja.value=!1,m(),ja.value=null},setMonthPicker:v=>{Ja.value=v,m()},refSets:Oe}},Wn=e=>({menuAppearTop:"dp-menu-appear-top",menuAppearBottom:"dp-menu-appear-bottom",open:"dp-slide-down",close:"dp-slide-up",next:"calendar-next",previous:"calendar-prev",vNext:"dp-slide-up",vPrevious:"dp-slide-down",...e??{}}),pi=e=>({toggleOverlay:"Toggle overlay",menu:"Datepicker menu",input:"Datepicker input",openTimePicker:"Open time picker",closeTimePicker:"Close time Picker",incrementValue:t=>`Increment ${t}`,decrementValue:t=>`Decrement ${t}`,openTpOverlay:t=>`Open ${t} overlay`,amPmButton:"Switch AM/PM mode",openYearsOverlay:"Open years overlay",openMonthsOverlay:"Open months overlay",nextMonth:"Next month",prevMonth:"Previous month",nextYear:"Next year",prevYear:"Previous year",day:void 0,weekDay:void 0,clearInput:"Clear value",calendarIcon:"Calendar icon",timePicker:"Time picker",monthPicker:t=>`Month picker${t?" overlay":""}`,yearPicker:t=>`Year picker${t?" overlay":""}`,timeOverlay:t=>`${t} overlay`,...e??{}}),Qn=e=>e?typeof e=="boolean"?e?2:0:+e>=2?+e:2:0,fi=e=>{const t=typeof e=="object"&&e,n={static:!0,solo:!1};if(!e)return{...n,count:Qn(!1)};const a=t?e:{},r=t?a.count??!0:e,l=Qn(r);return Object.assign(n,a,{count:l})},hi=(e,t,n)=>e||(typeof n=="string"?n:t),yi=e=>typeof e=="boolean"?e?Wn({}):!1:Wn(e),gi=e=>{const t={enterSubmit:!0,tabSubmit:!0,openMenu:"open",selectOnFocus:!1,rangeSeparator:" - "};return typeof e=="object"?{...t,...e??{},enabled:!0}:{...t,enabled:e}},bi=e=>({months:[],years:[],times:{hours:[],minutes:[],seconds:[]},...e??{}}),wi=e=>({showSelect:!0,showCancel:!0,showNow:!1,showPreview:!0,...e??{}}),_i=e=>{const t={input:!1};return typeof e=="object"?{...t,...e??{},enabled:!0}:{enabled:e,...t}},ki=e=>({allowStopPropagation:!0,closeOnScroll:!1,modeHeight:255,allowPreventDefault:!1,closeOnClearValue:!0,closeOnAutoApply:!0,noSwipe:!1,keepActionRow:!1,onClickOutside:void 0,tabOutClosesMenu:!0,arrowLeft:void 0,keepViewOnOffsetClick:!1,timeArrowHoldThreshold:0,shadowDom:!1,...e??{}}),xi=e=>{const t={dates:Array.isArray(e)?e.map(n=>Q(n)):[],years:[],months:[],quarters:[],weeks:[],weekdays:[],options:{highlightDisabled:!1}};return typeof e=="function"?e:{...t,...e??{}}},Mi=e=>typeof e=="object"?{type:e?.type??"local",hideOnOffsetDates:e?.hideOnOffsetDates??!1}:{type:e,hideOnOffsetDates:!1},Di=e=>{const t={noDisabledRange:!1,showLastInRange:!0,minMaxRawRange:!1,partialRange:!0,disableTimeRangeValidation:!1,maxRange:void 0,minRange:void 0,autoRange:void 0,fixedStart:!1,fixedEnd:!1};return typeof e=="object"?{enabled:!0,...t,...e}:{enabled:e,...t}},Ti=e=>e?typeof e=="string"?{timezone:e,exactMatch:!1,dateInTz:void 0,emitTimezone:void 0,convertModel:!0}:{timezone:e.timezone,exactMatch:e.exactMatch??!1,dateInTz:e.dateInTz??void 0,emitTimezone:e.emitTimezone??void 0,convertModel:e.convertModel??!0}:{timezone:void 0,exactMatch:!1,emitTimezone:void 0},en=(e,t,n)=>new Map(e.map(a=>{const r=wn(a,t,n);return[xn(r),r]})),Pi=(e,t)=>e.length?new Map(e.map(n=>{const a=wn(n.date,t);return[xn(a),n]})):null,Ai=e=>{var t;return{minDate:ln(e.minDate,e.timezone,e.isSpecific),maxDate:ln(e.maxDate,e.timezone,e.isSpecific),disabledDates:Qa(e.disabledDates)?en(e.disabledDates,e.timezone,e.isSpecific):e.disabledDates,allowedDates:Qa(e.allowedDates)?en(e.allowedDates,e.timezone,e.isSpecific):null,highlight:typeof e.highlight=="object"&&Qa((t=e.highlight)==null?void 0:t.dates)?en(e.highlight.dates,e.timezone):e.highlight,markers:Pi(e.markers,e.timezone)}},Ci=e=>typeof e=="boolean"?{enabled:e,dragSelect:!0,limit:null}:{enabled:!!e,limit:e.limit?+e.limit:null,dragSelect:e.dragSelect??!0},Oi=e=>({...Object.fromEntries(Object.keys(e).map(t=>{const n=t,a=e[n],r=typeof e[n]=="string"?{[a]:!0}:Object.fromEntries(a.map(l=>[l,!0]));return[t,r]}))}),Se=e=>{const t=()=>{const E=e.enableSeconds?":ss":"",B=e.enableMinutes?":mm":"";return e.is24?`HH${B}${E}`:`hh${B}${E} aa`},n=()=>{var E;return e.format?e.format:e.monthPicker?"MM/yyyy":e.timePicker?t():e.weekPicker?`${((E=S.value)==null?void 0:E.type)==="iso"?"RR":"ww"}-yyyy`:e.yearPicker?"yyyy":e.quarterPicker?"QQQ/yyyy":e.enableTimePicker?`MM/dd/yyyy, ${t()}`:"MM/dd/yyyy"},a=E=>xr(E,e.enableSeconds),r=()=>q.value.enabled?e.startTime&&Array.isArray(e.startTime)?[a(e.startTime[0]),a(e.startTime[1])]:null:e.startTime&&!Array.isArray(e.startTime)?a(e.startTime):null,l=G(()=>fi(e.multiCalendars)),i=G(()=>r()),p=G(()=>pi(e.ariaLabels)),c=G(()=>bi(e.filters)),C=G(()=>yi(e.transitions)),m=G(()=>wi(e.actionRow)),v=G(()=>hi(e.previewFormat,e.format,n())),h=G(()=>gi(e.textInput)),k=G(()=>_i(e.inline)),Y=G(()=>ki(e.config)),f=G(()=>xi(e.highlight)),S=G(()=>Mi(e.weekNumbers)),I=G(()=>Ti(e.timezone)),U=G(()=>Ci(e.multiDates)),A=G(()=>Ai({minDate:e.minDate,maxDate:e.maxDate,disabledDates:e.disabledDates,allowedDates:e.allowedDates,highlight:f.value,markers:e.markers,timezone:I.value,isSpecific:e.monthPicker||e.yearPicker||e.quarterPicker})),q=G(()=>Di(e.range)),ae=G(()=>Oi(e.ui));return{defaultedTransitions:C,defaultedMultiCalendars:l,defaultedStartTime:i,defaultedAriaLabels:p,defaultedFilters:c,defaultedActionRow:m,defaultedPreviewFormat:v,defaultedTextInput:h,defaultedInline:k,defaultedConfig:Y,defaultedHighlight:f,defaultedWeekNumbers:S,defaultedRange:q,propDates:A,defaultedTz:I,defaultedMultiDates:U,defaultedUI:ae,getDefaultPattern:n,getDefaultStartTime:r}},$i=(e,t,n)=>{const a=Z(),{defaultedTextInput:r,defaultedRange:l,defaultedTz:i,defaultedMultiDates:p,getDefaultPattern:c}=Se(t),C=Z(""),m=ca(t,"format"),v=ca(t,"formatLocale");ct(a,()=>{typeof t.onInternalModelChange=="function"&&e("internal-model-change",a.value,z(!0))},{deep:!0}),ct(l,(u,le)=>{u.enabled!==le.enabled&&(a.value=null)}),ct(m,()=>{re()});const h=u=>i.value.timezone&&i.value.convertModel?nt(u,i.value.timezone):u,k=u=>{if(i.value.timezone&&i.value.convertModel){const le=Ko(i.value.timezone);return Xr(u,le)}return u},Y=(u,le,fe=!1)=>Dr(u,t.format,t.formatLocale,r.value.rangeSeparator,t.modelAuto,le??c(),fe),f=u=>u?t.modelType?b(u):{hours:Tt(u),minutes:Rt(u),seconds:t.enableSeconds?jt(u):0}:null,S=u=>t.modelType?b(u):{month:xe(u),year:he(u)},I=u=>Array.isArray(u)?p.value.enabled?u.map(le=>U(le,_t(Q(),le))):ka(()=>[_t(Q(),u[0]),u[1]?_t(Q(),u[1]):zt(l.value.partialRange)],l.value.enabled):_t(Q(),+u),U=(u,le)=>(typeof u=="string"||typeof u=="number")&&t.modelType?R(u):le,A=u=>Array.isArray(u)?[U(u[0],St(null,+u[0].hours,+u[0].minutes,u[0].seconds)),U(u[1],St(null,+u[1].hours,+u[1].minutes,u[1].seconds))]:U(u,St(null,u.hours,u.minutes,u.seconds)),q=u=>{const le=Ce(Q(),{date:1});return Array.isArray(u)?p.value.enabled?u.map(fe=>U(fe,Mt(le,+fe.month,+fe.year))):ka(()=>[U(u[0],Mt(le,+u[0].month,+u[0].year)),U(u[1],u[1]?Mt(le,+u[1].month,+u[1].year):zt(l.value.partialRange))],l.value.enabled):U(u,Mt(le,+u.month,+u.year))},ae=u=>{if(Array.isArray(u))return u.map(le=>R(le));throw new Error(kn.dateArr("multi-dates"))},E=u=>{if(Array.isArray(u)&&l.value.enabled){const le=u[0],fe=u[1];return[Q(Array.isArray(le)?le[0]:null),Array.isArray(fe)&&fe.length?Q(fe[0]):null]}return Q(u[0])},B=u=>t.modelAuto?Array.isArray(u)?[R(u[0]),R(u[1])]:t.autoApply?[R(u)]:[R(u),null]:Array.isArray(u)?ka(()=>u[1]?[R(u[0]),u[1]?R(u[1]):zt(l.value.partialRange)]:[R(u[0])],l.value.enabled):R(u),ne=()=>{Array.isArray(a.value)&&l.value.enabled&&a.value.length===1&&a.value.push(zt(l.value.partialRange))},F=()=>{const u=a.value;return[b(u[0]),u[1]?b(u[1]):zt(l.value.partialRange)]},N=()=>a.value[1]?F():b(qe(a.value[0])),ie=()=>(a.value||[]).map(u=>b(u)),ce=(u=!1)=>(u||ne(),t.modelAuto?N():p.value.enabled?ie():Array.isArray(a.value)?ka(()=>F(),l.value.enabled):b(qe(a.value))),pe=u=>!u||Array.isArray(u)&&!u.length?null:t.timePicker?A(qe(u)):t.monthPicker?q(qe(u)):t.yearPicker?I(qe(u)):p.value.enabled?ae(qe(u)):t.weekPicker?E(qe(u)):B(qe(u)),g=u=>{const le=pe(u);sn(qe(le))?(a.value=qe(le),re()):(a.value=null,C.value="")},D=()=>{const u=le=>kt(le,r.value.format);return`${u(a.value[0])} ${r.value.rangeSeparator} ${a.value[1]?u(a.value[1]):""}`},y=()=>n.value&&a.value?Array.isArray(a.value)?D():kt(a.value,r.value.format):Y(a.value),H=()=>a.value?p.value.enabled?a.value.map(u=>Y(u)).join("; "):r.value.enabled&&typeof r.value.format=="string"?y():Y(a.value):"",re=()=>{!t.format||typeof t.format=="string"||r.value.enabled&&typeof r.value.format=="string"?C.value=H():C.value=t.format(a.value)},R=u=>{if(t.utc){const le=new Date(u);return t.utc==="preserve"?new Date(le.getTime()+le.getTimezoneOffset()*6e4):le}return t.modelType?Jo.includes(t.modelType)?h(new Date(u)):t.modelType==="format"&&(typeof t.format=="string"||!t.format)?h(rn(u,c(),new Date,{locale:v.value})):h(rn(u,t.modelType,new Date,{locale:v.value})):h(new Date(u))},b=u=>u?t.utc?si(u,t.utc==="preserve",t.enableSeconds):t.modelType?t.modelType==="timestamp"?+k(u):t.modelType==="iso"?k(u).toISOString():t.modelType==="format"&&(typeof t.format=="string"||!t.format)?Y(k(u)):Y(k(u),t.modelType,!0):k(u):"",oe=(u,le=!1,fe=!1)=>{if(fe)return u;if(e("update:model-value",u),i.value.emitTimezone&&le){const Ve=Array.isArray(u)?u.map(T=>nt(qe(T),i.value.emitTimezone)):nt(qe(u),i.value.emitTimezone);e("update:model-timezone-value",Ve)}},V=u=>Array.isArray(a.value)?p.value.enabled?a.value.map(le=>u(le)):[u(a.value[0]),a.value[1]?u(a.value[1]):zt(l.value.partialRange)]:u(qe(a.value)),M=()=>{if(Array.isArray(a.value)){const u=xt(a.value[0],t.weekStart),le=a.value[1]?xt(a.value[1],t.weekStart):[];return[u.map(fe=>Q(fe)),le.map(fe=>Q(fe))]}return xt(a.value,t.weekStart).map(u=>Q(u))},o=(u,le)=>oe(qe(V(u)),!1,le),w=u=>{const le=M();return u?le:e("update:model-value",M())},z=(u=!1)=>(u||re(),t.monthPicker?o(S,u):t.timePicker?o(f,u):t.yearPicker?o(he,u):t.weekPicker?w(u):oe(ce(u),!0,u));return{inputValue:C,internalModelValue:a,checkBeforeEmit:()=>a.value?l.value.enabled?l.value.partialRange?a.value.length>=1:a.value.length===2:!!a.value:!1,parseExternalModelValue:g,formatInputValue:re,emitModelValue:z}},Yi=(e,t)=>{const{defaultedFilters:n,propDates:a}=Se(e),{validateMonthYearInRange:r}=Et(e),l=(m,v)=>{let h=m;return n.value.months.includes(xe(h))?(h=v?ft(m,1):Jt(m,1),l(h,v)):h},i=(m,v)=>{let h=m;return n.value.years.includes(he(h))?(h=v?un(m,1):pr(m,1),i(h,v)):h},p=(m,v=!1)=>{const h=Ce(Q(),{month:e.month,year:e.year});let k=m?ft(h,1):Jt(h,1);e.disableYearSelect&&(k=_t(k,e.year));let Y=xe(k),f=he(k);n.value.months.includes(Y)&&(k=l(k,m),Y=xe(k),f=he(k)),n.value.years.includes(f)&&(k=i(k,m),f=he(k)),r(Y,f,m,e.preventMinMaxNavigation)&&c(Y,f,v)},c=(m,v,h)=>{t("update-month-year",{month:m,year:v,fromNav:h})},C=G(()=>m=>Mr(Ce(Q(),{month:e.month,year:e.year}),a.value.maxDate,a.value.minDate,e.preventMinMaxNavigation,m));return{handleMonthYearChange:p,isDisabled:C,updateMonthYear:c}},Ya={multiCalendars:{type:[Boolean,Number,String,Object],default:void 0},modelValue:{type:[String,Date,Array,Object,Number],default:null},modelType:{type:String,default:null},position:{type:String,default:"center"},dark:{type:Boolean,default:!1},format:{type:[String,Function],default:()=>null},autoPosition:{type:Boolean,default:!0},altPosition:{type:Function,default:null},transitions:{type:[Boolean,Object],default:!0},formatLocale:{type:Object,default:null},utc:{type:[Boolean,String],default:!1},ariaLabels:{type:Object,default:()=>({})},offset:{type:[Number,String],default:10},hideNavigation:{type:Array,default:()=>[]},timezone:{type:[String,Object],default:null},vertical:{type:Boolean,default:!1},disableMonthYearSelect:{type:Boolean,default:!1},disableYearSelect:{type:Boolean,default:!1},dayClass:{type:Function,default:null},yearRange:{type:Array,default:()=>[1900,2100]},enableTimePicker:{type:Boolean,default:!0},autoApply:{type:Boolean,default:!1},disabledDates:{type:[Array,Function],default:()=>[]},monthNameFormat:{type:String,default:"short"},startDate:{type:[Date,String],default:null},startTime:{type:[Object,Array],default:null},hideOffsetDates:{type:Boolean,default:!1},noToday:{type:Boolean,default:!1},disabledWeekDays:{type:Array,default:()=>[]},allowedDates:{type:Array,default:null},nowButtonLabel:{type:String,default:"Now"},markers:{type:Array,default:()=>[]},escClose:{type:Boolean,default:!0},spaceConfirm:{type:Boolean,default:!0},monthChangeOnArrows:{type:Boolean,default:!0},presetDates:{type:Array,default:()=>[]},flow:{type:Array,default:()=>[]},partialFlow:{type:Boolean,default:!1},preventMinMaxNavigation:{type:Boolean,default:!1},reverseYears:{type:Boolean,default:!1},weekPicker:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})},arrowNavigation:{type:Boolean,default:!1},highlight:{type:[Function,Object],default:null},teleport:{type:[Boolean,String,Object],default:null},teleportCenter:{type:Boolean,default:!1},locale:{type:String,default:"en-Us"},weekNumName:{type:String,default:"W"},weekStart:{type:[Number,String],default:1},weekNumbers:{type:[String,Function,Object],default:null},monthChangeOnScroll:{type:[Boolean,String],default:!0},dayNames:{type:[Function,Array],default:null},monthPicker:{type:Boolean,default:!1},customProps:{type:Object,default:null},yearPicker:{type:Boolean,default:!1},modelAuto:{type:Boolean,default:!1},selectText:{type:String,default:"Select"},cancelText:{type:String,default:"Cancel"},previewFormat:{type:[String,Function],default:()=>""},multiDates:{type:[Object,Boolean],default:!1},ignoreTimeValidation:{type:Boolean,default:!1},minDate:{type:[Date,String],default:null},maxDate:{type:[Date,String],default:null},minTime:{type:Object,default:null},maxTime:{type:Object,default:null},name:{type:String,default:null},placeholder:{type:String,default:""},hideInputIcon:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},state:{type:Boolean,default:null},required:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},timePicker:{type:Boolean,default:!1},enableSeconds:{type:Boolean,default:!1},is24:{type:Boolean,default:!0},noHoursOverlay:{type:Boolean,default:!1},noMinutesOverlay:{type:Boolean,default:!1},noSecondsOverlay:{type:Boolean,default:!1},hoursGridIncrement:{type:[String,Number],default:1},minutesGridIncrement:{type:[String,Number],default:5},secondsGridIncrement:{type:[String,Number],default:5},hoursIncrement:{type:[Number,String],default:1},minutesIncrement:{type:[Number,String],default:1},secondsIncrement:{type:[Number,String],default:1},range:{type:[Boolean,Object],default:!1},uid:{type:String,default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},inline:{type:[Boolean,Object],default:!1},textInput:{type:[Boolean,Object],default:!1},sixWeeks:{type:[Boolean,String],default:!1},actionRow:{type:Object,default:()=>({})},focusStartDate:{type:Boolean,default:!1},disabledTimes:{type:[Function,Array],default:void 0},timePickerInline:{type:Boolean,default:!1},calendar:{type:Function,default:null},config:{type:Object,default:void 0},quarterPicker:{type:Boolean,default:!1},yearFirst:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},onInternalModelChange:{type:[Function,Object],default:null},enableMinutes:{type:Boolean,default:!0},ui:{type:Object,default:()=>({})}},yt={...Ya,shadow:{type:Boolean,default:!1},flowStep:{type:Number,default:0},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},menuWrapRef:{type:Object,default:null},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},Si=["title"],Ri=["disabled"],Ii=ze({compatConfig:{MODE:3},__name:"ActionRow",props:{menuMount:{type:Boolean,default:!1},calendarWidth:{type:Number,default:0},...yt},emits:["close-picker","select-date","select-now","invalid-select"],setup(e,{emit:t}){const n=t,a=e,{defaultedActionRow:r,defaultedPreviewFormat:l,defaultedMultiCalendars:i,defaultedTextInput:p,defaultedInline:c,defaultedRange:C,defaultedMultiDates:m}=Se(a),{isTimeValid:v,isMonthValid:h}=Et(a),{buildMatrix:k}=It(),Y=Z(null),f=Z(null),S=Z(!1),I=Z({}),U=Z(null),A=Z(null);Ke(()=>{a.arrowNavigation&&k([Fe(Y),Fe(f)],"actionRow"),q(),window.addEventListener("resize",q)}),Ca(()=>{window.removeEventListener("resize",q)});const q=()=>{S.value=!1,setTimeout(()=>{var g,D;const y=(g=U.value)==null?void 0:g.getBoundingClientRect(),H=(D=A.value)==null?void 0:D.getBoundingClientRect();y&&H&&(I.value.maxWidth=`${H.width-y.width-20}px`),S.value=!0},0)},ae=G(()=>C.value.enabled&&!C.value.partialRange&&a.internalModelValue?a.internalModelValue.length===2:!0),E=G(()=>!v.value(a.internalModelValue)||!h.value(a.internalModelValue)||!ae.value),B=()=>{const g=l.value;return a.timePicker||a.monthPicker,g(qe(a.internalModelValue))},ne=()=>{const g=a.internalModelValue;return i.value.count>0?`${F(g[0])} - ${F(g[1])}`:[F(g[0]),F(g[1])]},F=g=>Dr(g,l.value,a.formatLocale,p.value.rangeSeparator,a.modelAuto,l.value),N=G(()=>!a.internalModelValue||!a.menuMount?"":typeof l.value=="string"?Array.isArray(a.internalModelValue)?a.internalModelValue.length===2&&a.internalModelValue[1]?ne():m.value.enabled?a.internalModelValue.map(g=>`${F(g)}`):a.modelAuto?`${F(a.internalModelValue[0])}`:`${F(a.internalModelValue[0])} -`:F(a.internalModelValue):B()),ie=()=>m.value.enabled?"; ":" - ",ce=G(()=>Array.isArray(N.value)?N.value.join(ie()):N.value),pe=()=>{v.value(a.internalModelValue)&&h.value(a.internalModelValue)&&ae.value?n("select-date"):n("invalid-select")};return(g,D)=>(P(),W("div",{ref_key:"actionRowRef",ref:A,class:"dp__action_row"},[g.$slots["action-row"]?ue(g.$slots,"action-row",We(Qe({key:0},{internalModelValue:g.internalModelValue,disabled:E.value,selectDate:()=>g.$emit("select-date"),closePicker:()=>g.$emit("close-picker")}))):(P(),W(we,{key:1},[d(r).showPreview?(P(),W("div",{key:0,class:"dp__selection_preview",title:ce.value,style:dt(I.value)},[g.$slots["action-preview"]&&S.value?ue(g.$slots,"action-preview",{key:0,value:g.internalModelValue}):j("",!0),!g.$slots["action-preview"]&&S.value?(P(),W(we,{key:1},[Dt(Ge(ce.value),1)],64)):j("",!0)],12,Si)):j("",!0),ye("div",{ref_key:"actionBtnContainer",ref:U,class:"dp__action_buttons","data-dp-element":"action-row"},[g.$slots["action-buttons"]?ue(g.$slots,"action-buttons",{key:0,value:g.internalModelValue}):j("",!0),g.$slots["action-buttons"]?j("",!0):(P(),W(we,{key:1},[!d(c).enabled&&d(r).showCancel?(P(),W("button",{key:0,ref_key:"cancelButtonRef",ref:Y,type:"button",class:"dp__action_button dp__action_cancel",onClick:D[0]||(D[0]=y=>g.$emit("close-picker")),onKeydown:D[1]||(D[1]=y=>d(et)(y,()=>g.$emit("close-picker")))},Ge(g.cancelText),545)):j("",!0),d(r).showNow?(P(),W("button",{key:1,type:"button",class:"dp__action_button dp__action_cancel",onClick:D[2]||(D[2]=y=>g.$emit("select-now")),onKeydown:D[3]||(D[3]=y=>d(et)(y,()=>g.$emit("select-now")))},Ge(g.nowButtonLabel),33)):j("",!0),d(r).showSelect?(P(),W("button",{key:2,ref_key:"selectButtonRef",ref:f,type:"button",class:"dp__action_button dp__action_select",disabled:E.value,"data-test":"select-button",onKeydown:D[4]||(D[4]=y=>d(et)(y,()=>pe())),onClick:pe},Ge(g.selectText),41,Ri)):j("",!0)],64))],512)],64))],512))}}),Ei=["role","aria-label","tabindex"],Bi={class:"dp__selection_grid_header"},Ni=["aria-selected","aria-disabled","data-test","onClick","onKeydown","onMouseover"],Li=["aria-label"],ya=ze({__name:"SelectionOverlay",props:{items:{},type:{},isLast:{type:Boolean},arrowNavigation:{type:Boolean},skipButtonRef:{type:Boolean},headerRefs:{},hideNavigation:{},escClose:{type:Boolean},useRelative:{type:Boolean},height:{},textInput:{type:[Boolean,Object]},config:{},noOverlayFocus:{type:Boolean},focusValue:{},menuWrapRef:{},ariaLabels:{},overlayLabel:{}},emits:["selected","toggle","reset-flow","hover-value"],setup(e,{expose:t,emit:n}){const{setSelectionGrid:a,buildMultiLevelMatrix:r,setMonthPicker:l}=It(),i=n,p=e,{defaultedAriaLabels:c,defaultedTextInput:C,defaultedConfig:m}=Se(p),{hideNavigationButtons:v}=Ia(),h=Z(!1),k=Z(null),Y=Z(null),f=Z([]),S=Z(),I=Z(null),U=Z(0),A=Z(null);Hr(()=>{k.value=null}),Ke(()=>{it().then(()=>ie()),p.noOverlayFocus||ae(),q(!0)}),Ca(()=>q(!1));const q=V=>{var M;p.arrowNavigation&&((M=p.headerRefs)!=null&&M.length?l(V):a(V))},ae=()=>{var V;const M=Fe(Y);M&&(C.value.enabled||(k.value?(V=k.value)==null||V.focus({preventScroll:!0}):M.focus({preventScroll:!0})),h.value=M.clientHeight({dp__overlay:!0,"dp--overlay-absolute":!p.useRelative,"dp--overlay-relative":p.useRelative})),B=G(()=>p.useRelative?{height:`${p.height}px`,width:"var(--dp-menu-min-width)"}:void 0),ne=G(()=>({dp__overlay_col:!0})),F=G(()=>({dp__btn:!0,dp__button:!0,dp__overlay_action:!0,dp__over_action_scroll:h.value,dp__button_bottom:p.isLast})),N=G(()=>{var V,M;return{dp__overlay_container:!0,dp__container_flex:((V=p.items)==null?void 0:V.length)<=6,dp__container_block:((M=p.items)==null?void 0:M.length)>6}});ct(()=>p.items,()=>ie(!1),{deep:!0});const ie=(V=!0)=>{it().then(()=>{const M=Fe(k),o=Fe(Y),w=Fe(I),z=Fe(A),u=w?w.getBoundingClientRect().height:0;o&&(o.getBoundingClientRect().height?U.value=o.getBoundingClientRect().height-u:U.value=m.value.modeHeight-u),M&&z&&V&&(z.scrollTop=M.offsetTop-z.offsetTop-(U.value/2-M.getBoundingClientRect().height)-u)})},ce=V=>{V.disabled||i("selected",V.value)},pe=()=>{i("toggle"),i("reset-flow")},g=()=>{p.escClose&&pe()},D=(V,M,o,w)=>{V&&((M.active||M.value===p.focusValue)&&(k.value=V),p.arrowNavigation&&(Array.isArray(f.value[o])?f.value[o][w]=V:f.value[o]=[V],y()))},y=()=>{var V,M;const o=(V=p.headerRefs)!=null&&V.length?[p.headerRefs].concat(f.value):f.value.concat([p.skipButtonRef?[]:[I.value]]);r(qe(o),(M=p.headerRefs)!=null&&M.length?"monthPicker":"selectionGrid")},H=V=>{p.arrowNavigation||Yt(V,m.value,!0)},re=V=>{S.value=V,i("hover-value",V)},R=()=>{if(pe(),!p.isLast){const V=on(p.menuWrapRef??null,"action-row");if(V){const M=gr(V);M?.focus()}}},b=V=>{switch(V.key){case $e.esc:return g();case $e.arrowLeft:return H(V);case $e.arrowRight:return H(V);case $e.arrowUp:return H(V);case $e.arrowDown:return H(V);default:return}},oe=V=>{if(V.key===$e.enter)return pe();if(V.key===$e.tab)return R()};return t({focusGrid:ae}),(V,M)=>{var o;return P(),W("div",{ref_key:"gridWrapRef",ref:Y,class:ke(E.value),style:dt(B.value),role:V.useRelative?void 0:"dialog","aria-label":V.overlayLabel,tabindex:V.useRelative?void 0:"0",onKeydown:b,onClick:M[0]||(M[0]=va(()=>{},["prevent"]))},[ye("div",{ref_key:"containerRef",ref:A,class:ke(N.value),style:dt({"--dp-overlay-height":`${U.value}px`}),role:"grid"},[ye("div",Bi,[ue(V.$slots,"header")]),V.$slots.overlay?ue(V.$slots,"overlay",{key:0}):(P(!0),W(we,{key:1},Ye(V.items,(w,z)=>(P(),W("div",{key:z,class:ke(["dp__overlay_row",{dp__flex_row:V.items.length>=3}]),role:"row"},[(P(!0),W(we,null,Ye(w,(u,le)=>(P(),W("div",{key:u.value,ref_for:!0,ref:fe=>D(fe,u,z,le),role:"gridcell",class:ke(ne.value),"aria-selected":u.active||void 0,"aria-disabled":u.disabled||void 0,tabindex:"0","data-test":u.text,onClick:va(fe=>ce(u),["prevent"]),onKeydown:fe=>d(et)(fe,()=>ce(u),!0),onMouseover:fe=>re(u.value)},[ye("div",{class:ke(u.className)},[V.$slots.item?ue(V.$slots,"item",{key:0,item:u}):j("",!0),V.$slots.item?j("",!0):(P(),W(we,{key:1},[Dt(Ge(u.text),1)],64))],2)],42,Ni))),128))],2))),128))],6),V.$slots["button-icon"]?Ma((P(),W("button",{key:0,ref_key:"toggleButton",ref:I,type:"button","aria-label":(o=d(c))==null?void 0:o.toggleOverlay,class:ke(F.value),tabindex:"0",onClick:pe,onKeydown:oe},[ue(V.$slots,"button-icon")],42,Li)),[[Da,!d(v)(V.hideNavigation,V.type)]]):j("",!0)],46,Ei)}}}),Sa=ze({__name:"InstanceWrap",props:{multiCalendars:{},stretch:{type:Boolean},collapse:{type:Boolean}},setup(e){const t=e,n=G(()=>t.multiCalendars>0?[...Array(t.multiCalendars).keys()]:[0]),a=G(()=>({dp__instance_calendar:t.multiCalendars>0}));return(r,l)=>(P(),W("div",{class:ke({dp__menu_inner:!r.stretch,"dp--menu--inner-stretched":r.stretch,dp__flex_display:r.multiCalendars>0,"dp--flex-display-collapsed":r.collapse})},[(P(!0),W(we,null,Ye(n.value,(i,p)=>(P(),W("div",{key:i,class:ke(a.value)},[ue(r.$slots,"default",{instance:i,index:p})],2))),128))],2))}}),Hi=["data-dp-element","aria-label","aria-disabled"],da=ze({compatConfig:{MODE:3},__name:"ArrowBtn",props:{ariaLabel:{},elName:{},disabled:{type:Boolean}},emits:["activate","set-ref"],setup(e,{emit:t}){const n=t,a=Z(null);return Ke(()=>n("set-ref",a)),(r,l)=>(P(),W("button",{ref_key:"elRef",ref:a,type:"button","data-dp-element":r.elName,class:"dp__btn dp--arrow-btn-nav",tabindex:"0","aria-label":r.ariaLabel,"aria-disabled":r.disabled||void 0,onClick:l[0]||(l[0]=i=>r.$emit("activate")),onKeydown:l[1]||(l[1]=i=>d(et)(i,()=>r.$emit("activate"),!0))},[ye("span",{class:ke(["dp__inner_nav",{dp__inner_nav_disabled:r.disabled}])},[ue(r.$slots,"default")],2)],40,Hi))}}),Vi=["aria-label","data-test"],Cr=ze({__name:"YearModePicker",props:{...yt,showYearPicker:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},instance:{type:Number,default:0},year:{type:Number,default:0},isDisabled:{type:Function,default:()=>!1}},emits:["toggle-year-picker","year-select","handle-year"],setup(e,{emit:t}){const n=t,a=e,{showRightIcon:r,showLeftIcon:l}=Ia(),{defaultedConfig:i,defaultedMultiCalendars:p,defaultedAriaLabels:c,defaultedTransitions:C,defaultedUI:m}=Se(a),{showTransition:v,transitionName:h}=ga(C),k=Z(!1),Y=(I=!1,U)=>{k.value=!k.value,n("toggle-year-picker",{flow:I,show:U})},f=I=>{k.value=!1,n("year-select",I)},S=(I=!1)=>{n("handle-year",I)};return(I,U)=>{var A,q,ae,E,B;return P(),W(we,null,[ye("div",{class:ke(["dp--year-mode-picker",{"dp--hidden-el":k.value}])},[d(l)(d(p),e.instance)?(P(),De(da,{key:0,ref:"mpPrevIconRef","aria-label":(A=d(c))==null?void 0:A.prevYear,disabled:e.isDisabled(!1),class:ke((q=d(m))==null?void 0:q.navBtnPrev),onActivate:U[0]||(U[0]=ne=>S(!1))},{default:_e(()=>[I.$slots["arrow-left"]?ue(I.$slots,"arrow-left",{key:0}):j("",!0),I.$slots["arrow-left"]?j("",!0):(P(),De(d(fn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0),ye("button",{ref:"mpYearButtonRef",class:"dp__btn dp--year-select",type:"button","aria-label":`${e.year}-${(ae=d(c))==null?void 0:ae.openYearsOverlay}`,"data-test":`year-mode-btn-${e.instance}`,onClick:U[1]||(U[1]=()=>Y(!1)),onKeydown:U[2]||(U[2]=Vr(()=>Y(!1),["enter"]))},[I.$slots.year?ue(I.$slots,"year",{key:0,year:e.year}):j("",!0),I.$slots.year?j("",!0):(P(),W(we,{key:1},[Dt(Ge(e.year),1)],64))],40,Vi),d(r)(d(p),e.instance)?(P(),De(da,{key:1,ref:"mpNextIconRef","aria-label":(E=d(c))==null?void 0:E.nextYear,disabled:e.isDisabled(!0),class:ke((B=d(m))==null?void 0:B.navBtnNext),onActivate:U[3]||(U[3]=ne=>S(!0))},{default:_e(()=>[I.$slots["arrow-right"]?ue(I.$slots,"arrow-right",{key:0}):j("",!0),I.$slots["arrow-right"]?j("",!0):(P(),De(d(hn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0)],2),ot(ta,{name:d(h)(e.showYearPicker),css:d(v)},{default:_e(()=>{var ne,F;return[e.showYearPicker?(P(),De(ya,{key:0,items:e.items,"text-input":I.textInput,"esc-close":I.escClose,config:I.config,"is-last":I.autoApply&&!d(i).keepActionRow,"hide-navigation":I.hideNavigation,"aria-labels":I.ariaLabels,"overlay-label":(F=(ne=d(c))==null?void 0:ne.yearPicker)==null?void 0:F.call(ne,!0),type:"year",onToggle:Y,onSelected:U[4]||(U[4]=N=>f(N))},je({"button-icon":_e(()=>[I.$slots["calendar-icon"]?ue(I.$slots,"calendar-icon",{key:0}):j("",!0),I.$slots["calendar-icon"]?j("",!0):(P(),De(d(aa),{key:1}))]),_:2},[I.$slots["year-overlay-value"]?{name:"item",fn:_e(({item:N})=>[ue(I.$slots,"year-overlay-value",{text:N.text,value:N.value})]),key:"0"}:void 0]),1032,["items","text-input","esc-close","config","is-last","hide-navigation","aria-labels","overlay-label"])):j("",!0)]}),_:3},8,["name","css"])],64)}}}),Dn=(e,t,n)=>{if(t.value&&Array.isArray(t.value))if(t.value.some(a=>Me(e,a))){const a=t.value.filter(r=>!Me(r,e));t.value=a.length?a:null}else(n&&+n>t.value.length||!n)&&t.value.push(e);else t.value=[e]},Tn=(e,t,n)=>{let a=e.value?e.value.slice():[];return a.length===2&&a[1]!==null&&(a=[]),a.length?Ie(t,a[0])?(a.unshift(t),n("range-start",a[0]),n("range-start",a[1])):(a[1]=t,n("range-end",t)):(a=[t],n("range-start",t)),a},Ra=(e,t,n,a)=>{e&&(e[0]&&e[1]&&n&&t("auto-apply"),e[0]&&!e[1]&&a&&n&&t("auto-apply"))},Or=e=>{Array.isArray(e.value)&&e.value.length<=2&&e.range?e.modelValue.value=e.value.map(t=>nt(Q(t),e.timezone)):Array.isArray(e.value)||(e.modelValue.value=nt(Q(e.value),e.timezone))},$r=(e,t,n,a)=>Array.isArray(t.value)&&(t.value.length===2||t.value.length===1&&a.value.partialRange)?a.value.fixedStart&&(Ne(e,t.value[0])||Me(e,t.value[0]))?[t.value[0],e]:a.value.fixedEnd&&(Ie(e,t.value[1])||Me(e,t.value[1]))?[e,t.value[1]]:(n("invalid-fixed-range",e),t.value):[],Yr=({multiCalendars:e,range:t,highlight:n,propDates:a,calendars:r,modelValue:l,props:i,filters:p,year:c,month:C,emit:m})=>{const v=G(()=>_n(i.yearRange,i.locale,i.reverseYears)),h=Z([!1]),k=G(()=>(N,ie)=>{const ce=Ce(pt(new Date),{month:C.value(N),year:c.value(N)}),pe=ie?tr(ce):ma(ce);return Mr(pe,a.value.maxDate,a.value.minDate,i.preventMinMaxNavigation,ie)}),Y=()=>Array.isArray(l.value)&&e.value.solo&&l.value[1],f=()=>{for(let N=0;N{if(!N)return f();const ie=Ce(Q(),r.value[N]);return r.value[0].year=he(pr(ie,e.value.count-1)),f()},I=(N,ie)=>{const ce=Zr(ie,N);return t.value.showLastInRange&&ce>1?ie:N},U=N=>i.focusStartDate||e.value.solo?N[0]:N[1]?I(N[0],N[1]):N[0],A=()=>{if(l.value){const N=Array.isArray(l.value)?U(l.value):l.value;r.value[0]={month:xe(N),year:he(N)}}},q=()=>{A(),e.value.count&&f()};ct(l,(N,ie)=>{i.isTextInputDate&&JSON.stringify(N??{})!==JSON.stringify(ie??{})&&q()}),Ke(()=>{q()});const ae=(N,ie)=>{r.value[ie].year=N,m("update-month-year",{instance:ie,year:N,month:r.value[ie].month}),e.value.count&&!e.value.solo&&S(ie)},E=G(()=>N=>Zt(v.value,ie=>{var ce;const pe=c.value(N)===ie.value,g=fa(ie.value,ea(a.value.minDate),ea(a.value.maxDate))||((ce=p.value.years)==null?void 0:ce.includes(c.value(N))),D=Mn(n.value,ie.value);return{active:pe,disabled:g,highlighted:D}})),B=(N,ie)=>{ae(N,ie),F(ie)},ne=(N,ie=!1)=>{if(!k.value(N,ie)){const ce=ie?c.value(N)+1:c.value(N)-1;ae(ce,N)}},F=(N,ie=!1,ce)=>{ie||m("reset-flow"),ce!==void 0?h.value[N]=ce:h.value[N]=!h.value[N],h.value[N]?m("overlay-toggle",{open:!0,overlay:Xe.year}):(m("overlay-closed"),m("overlay-toggle",{open:!1,overlay:Xe.year}))};return{isDisabled:k,groupedYears:E,showYearPicker:h,selectYear:ae,toggleYearPicker:F,handleYearSelect:B,handleYear:ne}},Fi=(e,t)=>{const{defaultedMultiCalendars:n,defaultedAriaLabels:a,defaultedTransitions:r,defaultedConfig:l,defaultedRange:i,defaultedHighlight:p,propDates:c,defaultedTz:C,defaultedFilters:m,defaultedMultiDates:v}=Se(e),h=()=>{e.isTextInputDate&&q(he(Q(e.startDate)),0)},{modelValue:k,year:Y,month:f,calendars:S}=ba(e,t,h),I=G(()=>hr(e.formatLocale,e.locale,e.monthNameFormat)),U=Z(null),{checkMinMaxRange:A}=Et(e),{selectYear:q,groupedYears:ae,showYearPicker:E,toggleYearPicker:B,handleYearSelect:ne,handleYear:F,isDisabled:N}=Yr({modelValue:k,multiCalendars:n,range:i,highlight:p,calendars:S,year:Y,propDates:c,month:f,filters:m,props:e,emit:t});Ke(()=>{e.startDate&&(k.value&&e.focusStartDate||!k.value)&&q(he(Q(e.startDate)),0)});const ie=o=>o?{month:xe(o),year:he(o)}:{month:null,year:null},ce=()=>k.value?Array.isArray(k.value)?k.value.map(o=>ie(o)):ie(k.value):ie(),pe=(o,w)=>{const z=S.value[o],u=ce();return Array.isArray(u)?u.some(le=>le.year===z?.year&&le.month===w):z?.year===u.year&&w===u.month},g=(o,w,z)=>{var u,le;const fe=ce();return Array.isArray(fe)?Y.value(w)===((u=fe[z])==null?void 0:u.year)&&o===((le=fe[z])==null?void 0:le.month):!1},D=(o,w)=>{if(i.value.enabled){const z=ce();if(Array.isArray(k.value)&&Array.isArray(z)){const u=g(o,w,0)||g(o,w,1),le=Mt(pt(Q()),o,Y.value(w));return $a(k.value,U.value,le)&&!u}return!1}return!1},y=G(()=>o=>Zt(I.value,w=>{var z;const u=pe(o,w.value),le=fa(w.value,wr(Y.value(o),c.value.minDate),_r(Y.value(o),c.value.maxDate))||mi(c.value.disabledDates,Y.value(o)).includes(w.value)||((z=m.value.months)==null?void 0:z.includes(w.value)),fe=D(w.value,o),Ve=Tr(p.value,w.value,Y.value(o));return{active:u,disabled:le,isBetween:fe,highlighted:Ve}})),H=(o,w)=>Mt(pt(Q()),o,Y.value(w)),re=(o,w)=>{const z=k.value?k.value:pt(new Date);k.value=Mt(z,o,Y.value(w)),t("auto-apply"),t("update-flow-step")},R=(o,w)=>{const z=H(o,w);i.value.fixedEnd||i.value.fixedStart?k.value=$r(z,k,t,i):k.value?A(z,k.value)&&(k.value=Tn(k,H(o,w),t)):k.value=[H(o,w)],it().then(()=>{Ra(k.value,t,e.autoApply,e.modelAuto)})},b=(o,w)=>{Dn(H(o,w),k,v.value.limit),t("auto-apply",!0)},oe=(o,w)=>(S.value[w].month=o,M(w,S.value[w].year,o),v.value.enabled?b(o,w):i.value.enabled?R(o,w):re(o,w)),V=(o,w)=>{q(o,w),M(w,o,null)},M=(o,w,z)=>{let u=z;if(!u&&u!==0){const le=ce();u=Array.isArray(le)?le[o].month:le.month}t("update-month-year",{instance:o,year:w,month:u})};return{groupedMonths:y,groupedYears:ae,year:Y,isDisabled:N,defaultedMultiCalendars:n,defaultedAriaLabels:a,defaultedTransitions:r,defaultedConfig:l,showYearPicker:E,modelValue:k,presetDate:(o,w)=>{Or({value:o,modelValue:k,range:i.value.enabled,timezone:w?void 0:C.value.timezone}),t("auto-apply")},setHoverDate:(o,w)=>{U.value=H(o,w)},selectMonth:oe,selectYear:V,toggleYearPicker:B,handleYearSelect:ne,handleYear:F,getModelMonthYear:ce}},qi=ze({compatConfig:{MODE:3},__name:"MonthPicker",props:{...yt},emits:["update:internal-model-value","overlay-closed","reset-flow","range-start","range-end","auto-apply","update-month-year","update-flow-step","mount","invalid-fixed-range","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=qt(),l=lt(r,"yearMode"),i=e;Ke(()=>{i.shadow||a("mount",null)});const{groupedMonths:p,groupedYears:c,year:C,isDisabled:m,defaultedMultiCalendars:v,defaultedConfig:h,showYearPicker:k,modelValue:Y,presetDate:f,setHoverDate:S,selectMonth:I,selectYear:U,toggleYearPicker:A,handleYearSelect:q,handleYear:ae,getModelMonthYear:E}=Fi(i,a);return t({getSidebarProps:()=>({modelValue:Y,year:C,getModelMonthYear:E,selectMonth:I,selectYear:U,handleYear:ae}),presetDate:f,toggleYearPicker:B=>A(0,B)}),(B,ne)=>(P(),De(Sa,{"multi-calendars":d(v).count,collapse:B.collapse,stretch:""},{default:_e(({instance:F})=>[B.$slots["top-extra"]?ue(B.$slots,"top-extra",{key:0,value:B.internalModelValue}):j("",!0),B.$slots["month-year"]?ue(B.$slots,"month-year",We(Qe({key:1},{year:d(C),months:d(p)(F),years:d(c)(F),selectMonth:d(I),selectYear:d(U),instance:F}))):(P(),De(ya,{key:2,items:d(p)(F),"arrow-navigation":B.arrowNavigation,"is-last":B.autoApply&&!d(h).keepActionRow,"esc-close":B.escClose,height:d(h).modeHeight,config:B.config,"no-overlay-focus":!!(B.noOverlayFocus||B.textInput),"use-relative":"",type:"month",onSelected:N=>d(I)(N,F),onHoverValue:N=>d(S)(N,F)},je({header:_e(()=>[ot(Cr,Qe(B.$props,{items:d(c)(F),instance:F,"show-year-picker":d(k)[F],year:d(C)(F),"is-disabled":N=>d(m)(F,N),onHandleYear:N=>d(ae)(F,N),onYearSelect:N=>d(q)(N,F),onToggleYearPicker:N=>d(A)(F,N?.flow,N?.show)}),je({_:2},[Ye(d(l),(N,ie)=>({name:N,fn:_e(ce=>[ue(B.$slots,N,We(at(ce)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),_:2},[B.$slots["month-overlay-value"]?{name:"item",fn:_e(({item:N})=>[ue(B.$slots,"month-overlay-value",{text:N.text,value:N.value})]),key:"0"}:void 0]),1032,["items","arrow-navigation","is-last","esc-close","height","config","no-overlay-focus","onSelected","onHoverValue"]))]),_:3},8,["multi-calendars","collapse"]))}}),Wi=(e,t)=>{const n=()=>{e.isTextInputDate&&(m.value=he(Q(e.startDate)))},{modelValue:a}=ba(e,t,n),r=Z(null),{defaultedHighlight:l,defaultedMultiDates:i,defaultedFilters:p,defaultedRange:c,propDates:C}=Se(e),m=Z();Ke(()=>{e.startDate&&(a.value&&e.focusStartDate||!a.value)&&(m.value=he(Q(e.startDate)))});const v=f=>Array.isArray(a.value)?a.value.some(S=>he(S)===f):a.value?he(a.value)===f:!1,h=f=>c.value.enabled&&Array.isArray(a.value)?$a(a.value,r.value,Y(f)):!1,k=G(()=>Zt(_n(e.yearRange,e.locale,e.reverseYears),f=>{const S=v(f.value),I=fa(f.value,ea(C.value.minDate),ea(C.value.maxDate))||p.value.years.includes(f.value),U=h(f.value)&&!S,A=Mn(l.value,f.value);return{active:S,disabled:I,isBetween:U,highlighted:A}})),Y=f=>_t(pt(ma(new Date)),f);return{groupedYears:k,modelValue:a,focusYear:m,setHoverValue:f=>{r.value=_t(pt(new Date),f)},selectYear:f=>{var S;if(t("update-month-year",{instance:0,year:f}),i.value.enabled)return a.value?Array.isArray(a.value)&&(((S=a.value)==null?void 0:S.map(I=>he(I))).includes(f)?a.value=a.value.filter(I=>he(I)!==f):a.value.push(_t(tt(Q()),f))):a.value=[_t(tt(ma(Q())),f)],t("auto-apply",!0);c.value.enabled?(a.value=Tn(a,Y(f),t),it().then(()=>{Ra(a.value,t,e.autoApply,e.modelAuto)})):(a.value=Y(f),t("auto-apply"))}}},Qi=ze({compatConfig:{MODE:3},__name:"YearPicker",props:{...yt},emits:["update:internal-model-value","reset-flow","range-start","range-end","auto-apply","update-month-year"],setup(e,{expose:t,emit:n}){const a=n,r=e,{groupedYears:l,modelValue:i,focusYear:p,selectYear:c,setHoverValue:C}=Wi(r,a),{defaultedConfig:m}=Se(r);return t({getSidebarProps:()=>({modelValue:i,selectYear:c})}),(v,h)=>(P(),W("div",null,[v.$slots["top-extra"]?ue(v.$slots,"top-extra",{key:0,value:v.internalModelValue}):j("",!0),v.$slots["month-year"]?ue(v.$slots,"month-year",We(Qe({key:1},{years:d(l),selectYear:d(c)}))):(P(),De(ya,{key:2,items:d(l),"is-last":v.autoApply&&!d(m).keepActionRow,height:d(m).modeHeight,config:v.config,"no-overlay-focus":!!(v.noOverlayFocus||v.textInput),"focus-value":d(p),type:"year","use-relative":"",onSelected:d(c),onHoverValue:d(C)},je({_:2},[v.$slots["year-overlay-value"]?{name:"item",fn:_e(({item:k})=>[ue(v.$slots,"year-overlay-value",{text:k.text,value:k.value})]),key:"0"}:void 0]),1032,["items","is-last","height","config","no-overlay-focus","focus-value","onSelected","onHoverValue"]))]))}}),zi={key:0,class:"dp__time_input"},Ui=["data-test","aria-label","onKeydown","onClick","onMousedown"],Xi=["aria-label","disabled","data-test","onKeydown","onClick"],Gi=["data-test","aria-label","onKeydown","onClick","onMousedown"],ji={key:0},Ki=["aria-label"],Ji=ze({compatConfig:{MODE:3},__name:"TimeInput",props:{hours:{type:Number,default:0},minutes:{type:Number,default:0},seconds:{type:Number,default:0},closeTimePickerBtn:{type:Object,default:null},order:{type:Number,default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...yt},emits:["set-hours","set-minutes","update:hours","update:minutes","update:seconds","reset-flow","mounted","overlay-closed","overlay-opened","am-pm-change"],setup(e,{expose:t,emit:n}){const a=n,r=e,{setTimePickerElements:l,setTimePickerBackRef:i}=It(),{defaultedAriaLabels:p,defaultedTransitions:c,defaultedFilters:C,defaultedConfig:m,defaultedRange:v}=Se(r),{transitionName:h,showTransition:k}=ga(c),Y=ha({hours:!1,minutes:!1,seconds:!1}),f=Z("AM"),S=Z(null),I=Z([]),U=Z(),A=Z(!1);Ke(()=>{a("mounted")});const q=s=>Ce(new Date,{hours:s.hours,minutes:s.minutes,seconds:r.enableSeconds?s.seconds:0,milliseconds:0}),ae=G(()=>s=>H(s,r[s])||B(s,r[s])),E=G(()=>({hours:r.hours,minutes:r.minutes,seconds:r.seconds})),B=(s,L)=>v.value.enabled&&!v.value.disableTimeRangeValidation?!r.validateTime(s,L):!1,ne=(s,L)=>{if(v.value.enabled&&!v.value.disableTimeRangeValidation){const J=L?+r[`${s}Increment`]:-+r[`${s}Increment`],$=r[s]+J;return!r.validateTime(s,$)}return!1},F=G(()=>s=>!V(+r[s]+ +r[`${s}Increment`],s)||ne(s,!0)),N=G(()=>s=>!V(+r[s]-+r[`${s}Increment`],s)||ne(s,!1)),ie=(s,L)=>Xn(Ce(Q(),s),L),ce=(s,L)=>Go(Ce(Q(),s),L),pe=G(()=>({dp__time_col:!0,dp__time_col_block:!r.timePickerInline,dp__time_col_reg_block:!r.enableSeconds&&r.is24&&!r.timePickerInline,dp__time_col_reg_inline:!r.enableSeconds&&r.is24&&r.timePickerInline,dp__time_col_reg_with_button:!r.enableSeconds&&!r.is24,dp__time_col_sec:r.enableSeconds&&r.is24,dp__time_col_sec_with_button:r.enableSeconds&&!r.is24})),g=G(()=>{const s=[{type:"hours"}];return r.enableMinutes&&s.push({type:"",separator:!0},{type:"minutes"}),r.enableSeconds&&s.push({type:"",separator:!0},{type:"seconds"}),s}),D=G(()=>g.value.filter(s=>!s.separator)),y=G(()=>s=>{if(s==="hours"){const L=le(+r.hours);return{text:L<10?`0${L}`:`${L}`,value:L}}return{text:r[s]<10?`0${r[s]}`:`${r[s]}`,value:r[s]}}),H=(s,L)=>{var J;if(!r.disabledTimesConfig)return!1;const $=r.disabledTimesConfig(r.order,s==="hours"?L:void 0);return $[s]?!!((J=$[s])!=null&&J.includes(L)):!0},re=(s,L)=>L!=="hours"||f.value==="AM"?s:s+12,R=s=>{const L=r.is24?24:12,J=s==="hours"?L:60,$=+r[`${s}GridIncrement`],ge=s==="hours"&&!r.is24?$:0,x=[];for(let X=ge;X({active:!1,disabled:C.value.times[s].includes(X.value)||!V(X.value,s)||H(s,X.value)||B(s,X.value)}))},b=s=>s>=0?s:59,oe=s=>s>=0?s:23,V=(s,L)=>{const J=r.minTime?q(za(r.minTime)):null,$=r.maxTime?q(za(r.maxTime)):null,ge=q(za(E.value,L,L==="minutes"||L==="seconds"?b(s):oe(s)));return J&&$?(pa(ge,$)||Xt(ge,$))&&(Kt(ge,J)||Xt(ge,J)):J?Kt(ge,J)||Xt(ge,J):$?pa(ge,$)||Xt(ge,$):!0},M=s=>r[`no${s[0].toUpperCase()+s.slice(1)}Overlay`],o=s=>{M(s)||(Y[s]=!Y[s],Y[s]?(A.value=!0,a("overlay-opened",s)):(A.value=!1,a("overlay-closed",s)))},w=s=>s==="hours"?Tt:s==="minutes"?Rt:jt,z=()=>{U.value&&clearTimeout(U.value)},u=(s,L=!0,J)=>{const $=L?ie:ce,ge=L?+r[`${s}Increment`]:-+r[`${s}Increment`];V(+r[s]+ge,s)&&a(`update:${s}`,w(s)($({[s]:+r[s]},{[s]:+r[`${s}Increment`]}))),!(J!=null&&J.keyboard)&&m.value.timeArrowHoldThreshold&&(U.value=setTimeout(()=>{u(s,L)},m.value.timeArrowHoldThreshold))},le=s=>r.is24?s:(s>=12?f.value="PM":f.value="AM",ti(s)),fe=()=>{f.value==="PM"?(f.value="AM",a("update:hours",r.hours-12)):(f.value="PM",a("update:hours",r.hours+12)),a("am-pm-change",f.value)},Ve=s=>{Y[s]=!0},T=(s,L,J)=>{if(s&&r.arrowNavigation){Array.isArray(I.value[L])?I.value[L][J]=s:I.value[L]=[s];const $=I.value.reduce((ge,x)=>x.map((X,de)=>[...ge[de]||[],x[de]]),[]);i(r.closeTimePickerBtn),S.value&&($[1]=$[1].concat(S.value)),l($,r.order)}},K=(s,L)=>(o(s),a(`update:${s}`,L));return t({openChildCmp:Ve}),(s,L)=>{var J;return s.disabled?j("",!0):(P(),W("div",zi,[(P(!0),W(we,null,Ye(g.value,($,ge)=>{var x,X,de;return P(),W("div",{key:ge,class:ke(pe.value)},[$.separator?(P(),W(we,{key:0},[A.value?j("",!0):(P(),W(we,{key:0},[Dt(":")],64))],64)):(P(),W(we,{key:1},[ye("button",{ref_for:!0,ref:be=>T(be,ge,0),type:"button",class:ke({dp__btn:!0,dp__inc_dec_button:!s.timePickerInline,dp__inc_dec_button_inline:s.timePickerInline,dp__tp_inline_btn_top:s.timePickerInline,dp__inc_dec_button_disabled:F.value($.type),"dp--hidden-el":A.value}),"data-test":`${$.type}-time-inc-btn-${r.order}`,"aria-label":(x=d(p))==null?void 0:x.incrementValue($.type),tabindex:"0",onKeydown:be=>d(et)(be,()=>u($.type,!0,{keyboard:!0}),!0),onClick:be=>d(m).timeArrowHoldThreshold?void 0:u($.type,!0),onMousedown:be=>d(m).timeArrowHoldThreshold?u($.type,!0):void 0,onMouseup:z},[r.timePickerInline?(P(),W(we,{key:1},[s.$slots["tp-inline-arrow-up"]?ue(s.$slots,"tp-inline-arrow-up",{key:0}):(P(),W(we,{key:1},[L[2]||(L[2]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1)),L[3]||(L[3]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1))],64))],64)):(P(),W(we,{key:0},[s.$slots["arrow-up"]?ue(s.$slots,"arrow-up",{key:0}):j("",!0),s.$slots["arrow-up"]?j("",!0):(P(),De(d(gn),{key:1}))],64))],42,Ui),ye("button",{ref_for:!0,ref:be=>T(be,ge,1),type:"button","aria-label":`${y.value($.type).text}-${(X=d(p))==null?void 0:X.openTpOverlay($.type)}`,class:ke({dp__time_display:!0,dp__time_display_block:!s.timePickerInline,dp__time_display_inline:s.timePickerInline,"dp--time-invalid":ae.value($.type),"dp--time-overlay-btn":!ae.value($.type),"dp--hidden-el":A.value}),disabled:M($.type),tabindex:"0","data-test":`${$.type}-toggle-overlay-btn-${r.order}`,onKeydown:be=>d(et)(be,()=>o($.type),!0),onClick:be=>o($.type)},[s.$slots[$.type]?ue(s.$slots,$.type,{key:0,text:y.value($.type).text,value:y.value($.type).value}):j("",!0),s.$slots[$.type]?j("",!0):(P(),W(we,{key:1},[Dt(Ge(y.value($.type).text),1)],64))],42,Xi),ye("button",{ref_for:!0,ref:be=>T(be,ge,2),type:"button",class:ke({dp__btn:!0,dp__inc_dec_button:!s.timePickerInline,dp__inc_dec_button_inline:s.timePickerInline,dp__tp_inline_btn_bottom:s.timePickerInline,dp__inc_dec_button_disabled:N.value($.type),"dp--hidden-el":A.value}),"data-test":`${$.type}-time-dec-btn-${r.order}`,"aria-label":(de=d(p))==null?void 0:de.decrementValue($.type),tabindex:"0",onKeydown:be=>d(et)(be,()=>u($.type,!1,{keyboard:!0}),!0),onClick:be=>d(m).timeArrowHoldThreshold?void 0:u($.type,!1),onMousedown:be=>d(m).timeArrowHoldThreshold?u($.type,!1):void 0,onMouseup:z},[r.timePickerInline?(P(),W(we,{key:1},[s.$slots["tp-inline-arrow-down"]?ue(s.$slots,"tp-inline-arrow-down",{key:0}):(P(),W(we,{key:1},[L[4]||(L[4]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1)),L[5]||(L[5]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1))],64))],64)):(P(),W(we,{key:0},[s.$slots["arrow-down"]?ue(s.$slots,"arrow-down",{key:0}):j("",!0),s.$slots["arrow-down"]?j("",!0):(P(),De(d(bn),{key:1}))],64))],42,Gi)],64))],2)}),128)),s.is24?j("",!0):(P(),W("div",ji,[s.$slots["am-pm-button"]?ue(s.$slots,"am-pm-button",{key:0,toggle:fe,value:f.value}):j("",!0),s.$slots["am-pm-button"]?j("",!0):(P(),W("button",{key:1,ref_key:"amPmButton",ref:S,type:"button",class:"dp__pm_am_button",role:"button","aria-label":(J=d(p))==null?void 0:J.amPmButton,tabindex:"0",onClick:fe,onKeydown:L[0]||(L[0]=$=>d(et)($,()=>fe(),!0))},Ge(f.value),41,Ki))])),(P(!0),W(we,null,Ye(D.value,($,ge)=>(P(),De(ta,{key:ge,name:d(h)(Y[$.type]),css:d(k)},{default:_e(()=>{var x,X;return[Y[$.type]?(P(),De(ya,{key:0,items:R($.type),"is-last":s.autoApply&&!d(m).keepActionRow,"esc-close":s.escClose,type:$.type,"text-input":s.textInput,config:s.config,"arrow-navigation":s.arrowNavigation,"aria-labels":s.ariaLabels,"overlay-label":(X=(x=d(p)).timeOverlay)==null?void 0:X.call(x,$.type),onSelected:de=>K($.type,de),onToggle:de=>o($.type),onResetFlow:L[1]||(L[1]=de=>s.$emit("reset-flow"))},je({"button-icon":_e(()=>[s.$slots["clock-icon"]?ue(s.$slots,"clock-icon",{key:0}):j("",!0),s.$slots["clock-icon"]?j("",!0):(P(),De(Oa(s.timePickerInline?d(aa):d(yn)),{key:1}))]),_:2},[s.$slots[`${$.type}-overlay-value`]?{name:"item",fn:_e(({item:de})=>[ue(s.$slots,`${$.type}-overlay-value`,{text:de.text,value:de.value})]),key:"0"}:void 0,s.$slots[`${$.type}-overlay-header`]?{name:"header",fn:_e(()=>[ue(s.$slots,`${$.type}-overlay-header`,{toggle:()=>o($.type)})]),key:"1"}:void 0]),1032,["items","is-last","esc-close","type","text-input","config","arrow-navigation","aria-labels","overlay-label","onSelected","onToggle"])):j("",!0)]}),_:2},1032,["name","css"]))),128))]))}}}),Zi={class:"dp--tp-wrap"},es=["aria-label","tabindex"],ts=["role","aria-label","tabindex"],as=["aria-label"],Sr=ze({compatConfig:{MODE:3},__name:"TimePicker",props:{hours:{type:[Number,Array],default:0},minutes:{type:[Number,Array],default:0},seconds:{type:[Number,Array],default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...yt},emits:["update:hours","update:minutes","update:seconds","mount","reset-flow","overlay-opened","overlay-closed","am-pm-change"],setup(e,{expose:t,emit:n}){const a=n,r=e,{buildMatrix:l,setTimePicker:i}=It(),p=qt(),{defaultedTransitions:c,defaultedAriaLabels:C,defaultedTextInput:m,defaultedConfig:v,defaultedRange:h}=Se(r),{transitionName:k,showTransition:Y}=ga(c),{hideNavigationButtons:f}=Ia(),S=Z(null),I=Z(null),U=Z([]),A=Z(null),q=Z(!1);Ke(()=>{a("mount"),!r.timePicker&&r.arrowNavigation?l([Fe(S.value)],"time"):i(!0,r.timePicker)});const ae=G(()=>h.value.enabled&&r.modelAuto?yr(r.internalModelValue):!0),E=Z(!1),B=R=>({hours:Array.isArray(r.hours)?r.hours[R]:r.hours,minutes:Array.isArray(r.minutes)?r.minutes[R]:r.minutes,seconds:Array.isArray(r.seconds)?r.seconds[R]:r.seconds}),ne=G(()=>{const R=[];if(h.value.enabled)for(let b=0;b<2;b++)R.push(B(b));else R.push(B(0));return R}),F=(R,b=!1,oe="")=>{b||a("reset-flow"),E.value=R,a(R?"overlay-opened":"overlay-closed",Xe.time),r.arrowNavigation&&i(R),it(()=>{oe!==""&&U.value[0]&&U.value[0].openChildCmp(oe)})},N=G(()=>({dp__btn:!0,dp__button:!0,dp__button_bottom:r.autoApply&&!v.value.keepActionRow})),ie=lt(p,"timePicker"),ce=(R,b,oe)=>h.value.enabled?b===0?[R,ne.value[1][oe]]:[ne.value[0][oe],R]:R,pe=R=>{a("update:hours",R)},g=R=>{a("update:minutes",R)},D=R=>{a("update:seconds",R)},y=()=>{if(A.value&&!m.value.enabled&&!r.noOverlayFocus){const R=gr(A.value);R&&R.focus({preventScroll:!0})}},H=R=>{q.value=!1,a("overlay-closed",R)},re=R=>{q.value=!0,a("overlay-opened",R)};return t({toggleTimePicker:F}),(R,b)=>{var oe;return P(),W("div",Zi,[!R.timePicker&&!R.timePickerInline?Ma((P(),W("button",{key:0,ref_key:"openTimePickerBtn",ref:S,type:"button",class:ke({...N.value,"dp--hidden-el":E.value}),"aria-label":(oe=d(C))==null?void 0:oe.openTimePicker,tabindex:R.noOverlayFocus?void 0:0,"data-test":"open-time-picker-btn",onKeydown:b[0]||(b[0]=V=>d(et)(V,()=>F(!0))),onClick:b[1]||(b[1]=V=>F(!0))},[R.$slots["clock-icon"]?ue(R.$slots,"clock-icon",{key:0}):j("",!0),R.$slots["clock-icon"]?j("",!0):(P(),De(d(yn),{key:1}))],42,es)),[[Da,!d(f)(R.hideNavigation,"time")]]):j("",!0),ot(ta,{name:d(k)(E.value),css:d(Y)&&!R.timePickerInline},{default:_e(()=>{var V,M;return[E.value||R.timePicker||R.timePickerInline?(P(),W("div",{key:0,ref_key:"overlayRef",ref:A,role:R.timePickerInline?void 0:"dialog",class:ke({dp__overlay:!R.timePickerInline,"dp--overlay-absolute":!r.timePicker&&!R.timePickerInline,"dp--overlay-relative":r.timePicker}),style:dt(R.timePicker?{height:`${d(v).modeHeight}px`}:void 0),"aria-label":(V=d(C))==null?void 0:V.timePicker,tabindex:R.timePickerInline?void 0:0},[ye("div",{class:ke(R.timePickerInline?"dp__time_picker_inline_container":"dp__overlay_container dp__container_flex dp__time_picker_overlay_container"),style:{display:"flex"}},[R.$slots["time-picker-overlay"]?ue(R.$slots,"time-picker-overlay",{key:0,hours:e.hours,minutes:e.minutes,seconds:e.seconds,setHours:pe,setMinutes:g,setSeconds:D}):j("",!0),R.$slots["time-picker-overlay"]?j("",!0):(P(),W("div",{key:1,class:ke(R.timePickerInline?"dp__flex":"dp__overlay_row dp__flex_row")},[(P(!0),W(we,null,Ye(ne.value,(o,w)=>Ma((P(),De(Ji,Qe({key:w,ref_for:!0},{...R.$props,order:w,hours:o.hours,minutes:o.minutes,seconds:o.seconds,closeTimePickerBtn:I.value,disabledTimesConfig:e.disabledTimesConfig,disabled:w===0?d(h).fixedStart:d(h).fixedEnd},{ref_for:!0,ref_key:"timeInputRefs",ref:U,"validate-time":(z,u)=>e.validateTime(z,ce(u,w,z)),"onUpdate:hours":z=>pe(ce(z,w,"hours")),"onUpdate:minutes":z=>g(ce(z,w,"minutes")),"onUpdate:seconds":z=>D(ce(z,w,"seconds")),onMounted:y,onOverlayClosed:H,onOverlayOpened:re,onAmPmChange:b[2]||(b[2]=z=>R.$emit("am-pm-change",z))}),je({_:2},[Ye(d(ie),(z,u)=>({name:z,fn:_e(le=>[ue(R.$slots,z,Qe({ref_for:!0},le))])}))]),1040,["validate-time","onUpdate:hours","onUpdate:minutes","onUpdate:seconds"])),[[Da,w===0?!0:ae.value]])),128))],2)),!R.timePicker&&!R.timePickerInline?Ma((P(),W("button",{key:2,ref_key:"closeTimePickerBtn",ref:I,type:"button",class:ke({...N.value,"dp--hidden-el":q.value}),"aria-label":(M=d(C))==null?void 0:M.closeTimePicker,tabindex:"0",onKeydown:b[3]||(b[3]=o=>d(et)(o,()=>F(!1))),onClick:b[4]||(b[4]=o=>F(!1))},[R.$slots["calendar-icon"]?ue(R.$slots,"calendar-icon",{key:0}):j("",!0),R.$slots["calendar-icon"]?j("",!0):(P(),De(d(aa),{key:1}))],42,as)),[[Da,!d(f)(R.hideNavigation,"time")]]):j("",!0)],2)],14,ts)):j("",!0)]}),_:3},8,["name","css"])])}}}),Rr=(e,t,n,a)=>{const{defaultedRange:r}=Se(e),l=(A,q)=>Array.isArray(t[A])?t[A][q]:t[A],i=A=>e.enableSeconds?Array.isArray(t.seconds)?t.seconds[A]:t.seconds:0,p=(A,q)=>A?q!==void 0?St(A,l("hours",q),l("minutes",q),i(q)):St(A,t.hours,t.minutes,i()):mr(Q(),i(q)),c=(A,q)=>{t[A]=q},C=G(()=>e.modelAuto&&r.value.enabled?Array.isArray(n.value)?n.value.length>1:!1:r.value.enabled),m=(A,q)=>{const ae=Object.fromEntries(Object.keys(t).map(E=>E===A?[E,q]:[E,t[E]].slice()));if(C.value&&!r.value.disableTimeRangeValidation){const E=ne=>n.value?St(n.value[ne],ae.hours[ne],ae.minutes[ne],ae.seconds[ne]):null,B=ne=>vr(n.value[ne],0);return!(Me(E(0),E(1))&&(Kt(E(0),B(1))||pa(E(1),B(0))))}return!0},v=(A,q)=>{m(A,q)&&(c(A,q),a&&a())},h=A=>{v("hours",A)},k=A=>{v("minutes",A)},Y=A=>{v("seconds",A)},f=(A,q,ae,E)=>{q&&h(A),!q&&!ae&&k(A),ae&&Y(A),n.value&&E(n.value)},S=A=>{if(A){const q=Array.isArray(A),ae=q?[+A[0].hours,+A[1].hours]:+A.hours,E=q?[+A[0].minutes,+A[1].minutes]:+A.minutes,B=q?[+A[0].seconds,+A[1].seconds]:+A.seconds;c("hours",ae),c("minutes",E),e.enableSeconds&&c("seconds",B)}},I=(A,q)=>{const ae={hours:Array.isArray(t.hours)?t.hours[A]:t.hours,disabledArr:[]};return(q||q===0)&&(ae.hours=q),Array.isArray(e.disabledTimes)&&(ae.disabledArr=r.value.enabled&&Array.isArray(e.disabledTimes[A])?e.disabledTimes[A]:e.disabledTimes),ae},U=G(()=>(A,q)=>{var ae;if(Array.isArray(e.disabledTimes)){const{disabledArr:E,hours:B}=I(A,q),ne=E.filter(F=>+F.hours===B);return((ae=ne[0])==null?void 0:ae.minutes)==="*"?{hours:[B],minutes:void 0,seconds:void 0}:{hours:[],minutes:ne?.map(F=>+F.minutes)??[],seconds:ne?.map(F=>F.seconds?+F.seconds:void 0)??[]}}return{hours:[],minutes:[],seconds:[]}});return{setTime:c,updateHours:h,updateMinutes:k,updateSeconds:Y,getSetDateTime:p,updateTimeValues:f,getSecondsValue:i,assignStartTime:S,validateTime:m,disabledTimesConfig:U}},ns=(e,t)=>{const n=()=>{e.isTextInputDate&&q()},{modelValue:a,time:r}=ba(e,t,n),{defaultedStartTime:l,defaultedRange:i,defaultedTz:p}=Se(e),{updateTimeValues:c,getSetDateTime:C,setTime:m,assignStartTime:v,disabledTimesConfig:h,validateTime:k}=Rr(e,r,a,Y);function Y(){t("update-flow-step")}const f=E=>{const{hours:B,minutes:ne,seconds:F}=E;return{hours:+B,minutes:+ne,seconds:F?+F:0}},S=()=>{if(e.startTime){if(Array.isArray(e.startTime)){const B=f(e.startTime[0]),ne=f(e.startTime[1]);return[Ce(Q(),B),Ce(Q(),ne)]}const E=f(e.startTime);return Ce(Q(),E)}return i.value.enabled?[null,null]:null},I=()=>{if(i.value.enabled){const[E,B]=S();a.value=[nt(C(E,0),p.value.timezone),nt(C(B,1),p.value.timezone)]}else a.value=nt(C(S()),p.value.timezone)},U=E=>Array.isArray(E)?[Ft(Q(E[0])),Ft(Q(E[1]))]:[Ft(E??Q())],A=(E,B,ne)=>{m("hours",E),m("minutes",B),m("seconds",e.enableSeconds?ne:0)},q=()=>{const[E,B]=U(a.value);return i.value.enabled?A([E.hours,B.hours],[E.minutes,B.minutes],[E.seconds,B.seconds]):A(E.hours,E.minutes,E.seconds)};Ke(()=>{if(!e.shadow)return v(l.value),a.value?q():I()});const ae=()=>{Array.isArray(a.value)?a.value=a.value.map((E,B)=>E&&C(E,B)):a.value=C(a.value),t("time-update")};return{modelValue:a,time:r,disabledTimesConfig:h,updateTime:(E,B=!0,ne=!1)=>{c(E,B,ne,ae)},validateTime:k}},rs=ze({compatConfig:{MODE:3},__name:"TimePickerSolo",props:{...yt},emits:["update:internal-model-value","time-update","am-pm-change","mount","reset-flow","update-flow-step","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=qt(),i=lt(l,"timePicker"),p=Z(null),{time:c,modelValue:C,disabledTimesConfig:m,updateTime:v,validateTime:h}=ns(r,a);return Ke(()=>{r.shadow||a("mount",null)}),t({getSidebarProps:()=>({modelValue:C,time:c,updateTime:v}),toggleTimePicker:(k,Y=!1,f="")=>{var S;(S=p.value)==null||S.toggleTimePicker(k,Y,f)}}),(k,Y)=>(P(),De(Sa,{"multi-calendars":0,stretch:""},{default:_e(()=>[ot(Sr,Qe({ref_key:"tpRef",ref:p},k.$props,{hours:d(c).hours,minutes:d(c).minutes,seconds:d(c).seconds,"internal-model-value":k.internalModelValue,"disabled-times-config":d(m),"validate-time":d(h),"onUpdate:hours":Y[0]||(Y[0]=f=>d(v)(f)),"onUpdate:minutes":Y[1]||(Y[1]=f=>d(v)(f,!1)),"onUpdate:seconds":Y[2]||(Y[2]=f=>d(v)(f,!1,!0)),onAmPmChange:Y[3]||(Y[3]=f=>k.$emit("am-pm-change",f)),onResetFlow:Y[4]||(Y[4]=f=>k.$emit("reset-flow")),onOverlayClosed:Y[5]||(Y[5]=f=>k.$emit("overlay-toggle",{open:!1,overlay:f})),onOverlayOpened:Y[6]||(Y[6]=f=>k.$emit("overlay-toggle",{open:!0,overlay:f}))}),je({_:2},[Ye(d(i),(f,S)=>({name:f,fn:_e(I=>[ue(k.$slots,f,We(at(I)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"])]),_:3}))}}),ls={class:"dp--header-wrap"},os={key:0,class:"dp__month_year_wrap"},is={key:0},ss={class:"dp__month_year_wrap"},us=["data-dp-element","aria-label","data-test","onClick","onKeydown"],ds=ze({compatConfig:{MODE:3},__name:"DpHeader",props:{month:{type:Number,default:0},year:{type:Number,default:0},instance:{type:Number,default:0},years:{type:Array,default:()=>[]},months:{type:Array,default:()=>[]},...yt},emits:["update-month-year","mount","reset-flow","overlay-closed","overlay-opened"],setup(e,{expose:t,emit:n}){const a=n,r=e,{defaultedTransitions:l,defaultedAriaLabels:i,defaultedMultiCalendars:p,defaultedFilters:c,defaultedConfig:C,defaultedHighlight:m,propDates:v,defaultedUI:h}=Se(r),{transitionName:k,showTransition:Y}=ga(l),{buildMatrix:f}=It(),{handleMonthYearChange:S,isDisabled:I,updateMonthYear:U}=Yi(r,a),{showLeftIcon:A,showRightIcon:q}=Ia(),ae=Z(!1),E=Z(!1),B=Z(!1),ne=Z([null,null,null,null]);Ke(()=>{a("mount")});const F=M=>({get:()=>r[M],set:o=>{const w=M===vt.month?vt.year:vt.month;a("update-month-year",{[M]:o,[w]:r[w]}),M===vt.month?H(!0):re(!0)}}),N=G(F(vt.month)),ie=G(F(vt.year)),ce=G(()=>M=>({month:r.month,year:r.year,items:M===vt.month?r.months:r.years,instance:r.instance,updateMonthYear:U,toggle:M===vt.month?H:re})),pe=G(()=>r.months.find(o=>o.value===r.month)||{text:"",value:0}),g=G(()=>Zt(r.months,M=>{const o=r.month===M.value,w=fa(M.value,wr(r.year,v.value.minDate),_r(r.year,v.value.maxDate))||c.value.months.includes(M.value),z=Tr(m.value,M.value,r.year);return{active:o,disabled:w,highlighted:z}})),D=G(()=>Zt(r.years,M=>{const o=r.year===M.value,w=fa(M.value,ea(v.value.minDate),ea(v.value.maxDate))||c.value.years.includes(M.value),z=Mn(m.value,M.value);return{active:o,disabled:w,highlighted:z}})),y=(M,o,w)=>{w!==void 0?M.value=w:M.value=!M.value,M.value?(B.value=!0,a("overlay-opened",o)):(B.value=!1,a("overlay-closed",o))},H=(M=!1,o)=>{R(M),y(ae,Xe.month,o)},re=(M=!1,o)=>{R(M),y(E,Xe.year,o)},R=M=>{M||a("reset-flow")},b=(M,o)=>{r.arrowNavigation&&(ne.value[o]=Fe(M),f(ne.value,"monthYear"))},oe=G(()=>{var M,o,w,z,u,le;return[{type:vt.month,index:1,toggle:H,modelValue:N.value,updateModelValue:fe=>N.value=fe,text:pe.value.text,showSelectionGrid:ae.value,items:g.value,ariaLabel:(M=i.value)==null?void 0:M.openMonthsOverlay,overlayLabel:((w=(o=i.value).monthPicker)==null?void 0:w.call(o,!0))??void 0},{type:vt.year,index:2,toggle:re,modelValue:ie.value,updateModelValue:fe=>ie.value=fe,text:br(r.year,r.locale),showSelectionGrid:E.value,items:D.value,ariaLabel:(z=i.value)==null?void 0:z.openYearsOverlay,overlayLabel:((le=(u=i.value).yearPicker)==null?void 0:le.call(u,!0))??void 0}]}),V=G(()=>r.disableYearSelect?[oe.value[0]]:r.yearFirst?[...oe.value].reverse():oe.value);return t({toggleMonthPicker:H,toggleYearPicker:re,handleMonthYearChange:S}),(M,o)=>{var w,z,u,le,fe,Ve;return P(),W("div",ls,[M.$slots["month-year"]?(P(),W("div",os,[ue(M.$slots,"month-year",We(at({month:e.month,year:e.year,months:e.months,years:e.years,updateMonthYear:d(U),handleMonthYearChange:d(S),instance:e.instance})))])):(P(),W(we,{key:1},[M.$slots["top-extra"]?(P(),W("div",is,[ue(M.$slots,"top-extra",{value:M.internalModelValue})])):j("",!0),ye("div",ss,[d(A)(d(p),e.instance)&&!M.vertical?(P(),De(da,{key:0,"aria-label":(w=d(i))==null?void 0:w.prevMonth,disabled:d(I)(!1),class:ke((z=d(h))==null?void 0:z.navBtnPrev),"el-name":"action-prev",onActivate:o[0]||(o[0]=T=>d(S)(!1,!0)),onSetRef:o[1]||(o[1]=T=>b(T,0))},{default:_e(()=>[M.$slots["arrow-left"]?ue(M.$slots,"arrow-left",{key:0}):j("",!0),M.$slots["arrow-left"]?j("",!0):(P(),De(d(fn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0),ye("div",{class:ke(["dp__month_year_wrap",{dp__year_disable_select:M.disableYearSelect}])},[(P(!0),W(we,null,Ye(V.value,(T,K)=>(P(),W(we,{key:T.type},[ye("button",{ref_for:!0,ref:s=>b(s,K+1),type:"button","data-dp-element":`overlay-${T.type}`,class:ke(["dp__btn dp__month_year_select",{"dp--hidden-el":B.value}]),"aria-label":`${T.text}-${T.ariaLabel}`,"data-test":`${T.type}-toggle-overlay-${e.instance}`,onClick:T.toggle,onKeydown:s=>d(et)(s,()=>T.toggle(),!0)},[M.$slots[T.type]?ue(M.$slots,T.type,{key:0,text:T.text,value:r[T.type]}):j("",!0),M.$slots[T.type]?j("",!0):(P(),W(we,{key:1},[Dt(Ge(T.text),1)],64))],42,us),ot(ta,{name:d(k)(T.showSelectionGrid),css:d(Y)},{default:_e(()=>[T.showSelectionGrid?(P(),De(ya,{key:0,items:T.items,"arrow-navigation":M.arrowNavigation,"hide-navigation":M.hideNavigation,"is-last":M.autoApply&&!d(C).keepActionRow,"skip-button-ref":!1,config:M.config,type:T.type,"header-refs":[],"esc-close":M.escClose,"menu-wrap-ref":M.menuWrapRef,"text-input":M.textInput,"aria-labels":M.ariaLabels,"overlay-label":T.overlayLabel,onSelected:T.updateModelValue,onToggle:T.toggle},je({"button-icon":_e(()=>[M.$slots["calendar-icon"]?ue(M.$slots,"calendar-icon",{key:0}):j("",!0),M.$slots["calendar-icon"]?j("",!0):(P(),De(d(aa),{key:1}))]),_:2},[M.$slots[`${T.type}-overlay-value`]?{name:"item",fn:_e(({item:s})=>[ue(M.$slots,`${T.type}-overlay-value`,{text:s.text,value:s.value})]),key:"0"}:void 0,M.$slots[`${T.type}-overlay`]?{name:"overlay",fn:_e(()=>[ue(M.$slots,`${T.type}-overlay`,Qe({ref_for:!0},ce.value(T.type)))]),key:"1"}:void 0,M.$slots[`${T.type}-overlay-header`]?{name:"header",fn:_e(()=>[ue(M.$slots,`${T.type}-overlay-header`,{toggle:T.toggle})]),key:"2"}:void 0]),1032,["items","arrow-navigation","hide-navigation","is-last","config","type","esc-close","menu-wrap-ref","text-input","aria-labels","overlay-label","onSelected","onToggle"])):j("",!0)]),_:2},1032,["name","css"])],64))),128))],2),d(A)(d(p),e.instance)&&M.vertical?(P(),De(da,{key:1,"aria-label":(u=d(i))==null?void 0:u.prevMonth,"el-name":"action-prev",disabled:d(I)(!1),class:ke((le=d(h))==null?void 0:le.navBtnPrev),onActivate:o[2]||(o[2]=T=>d(S)(!1,!0))},{default:_e(()=>[M.$slots["arrow-up"]?ue(M.$slots,"arrow-up",{key:0}):j("",!0),M.$slots["arrow-up"]?j("",!0):(P(),De(d(gn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0),d(q)(d(p),e.instance)?(P(),De(da,{key:2,ref:"rightIcon","el-name":"action-next",disabled:d(I)(!0),"aria-label":(fe=d(i))==null?void 0:fe.nextMonth,class:ke((Ve=d(h))==null?void 0:Ve.navBtnNext),onActivate:o[3]||(o[3]=T=>d(S)(!0,!0)),onSetRef:o[4]||(o[4]=T=>b(T,M.disableYearSelect?2:3))},{default:_e(()=>[M.$slots[M.vertical?"arrow-down":"arrow-right"]?ue(M.$slots,M.vertical?"arrow-down":"arrow-right",{key:0}):j("",!0),M.$slots[M.vertical?"arrow-down":"arrow-right"]?j("",!0):(P(),De(Oa(M.vertical?d(bn):d(hn)),{key:1}))]),_:3},8,["disabled","aria-label","class"])):j("",!0)])],64))])}}}),cs={class:"dp__calendar_header",role:"row"},vs={key:0,class:"dp__calendar_header_item",role:"gridcell"},ms=["aria-label"],ps={key:0,class:"dp__calendar_item dp__week_num",role:"gridcell"},fs={class:"dp__cell_inner"},hs=["id","aria-pressed","aria-disabled","aria-label","tabindex","data-test","onClick","onTouchend","onKeydown","onMouseenter","onMouseleave","onMousedown"],ys=ze({compatConfig:{MODE:3},__name:"DpCalendar",props:{mappedDates:{type:Array,default:()=>[]},instance:{type:Number,default:0},month:{type:Number,default:0},year:{type:Number,default:0},...yt},emits:["select-date","set-hover-date","handle-scroll","mount","handle-swipe","handle-space","tooltip-open","tooltip-close"],setup(e,{expose:t,emit:n}){const a=n,r=e,{buildMultiLevelMatrix:l}=It(),{defaultedTransitions:i,defaultedConfig:p,defaultedAriaLabels:c,defaultedMultiCalendars:C,defaultedWeekNumbers:m,defaultedMultiDates:v,defaultedUI:h}=Se(r),k=Z(null),Y=Z({bottom:"",left:"",transform:""}),f=Z([]),S=Z(null),I=Z(!0),U=Z(""),A=Z({startX:0,endX:0,startY:0,endY:0}),q=Z([]),ae=Z({left:"50%"}),E=Z(!1),B=G(()=>r.calendar?r.calendar(r.mappedDates):r.mappedDates),ne=G(()=>r.dayNames?Array.isArray(r.dayNames)?r.dayNames:r.dayNames(r.locale,+r.weekStart):ei(r.formatLocale,r.locale,+r.weekStart));Ke(()=>{a("mount",{cmp:"calendar",refs:f}),p.value.noSwipe||S.value&&(S.value.addEventListener("touchstart",b,{passive:!1}),S.value.addEventListener("touchend",oe,{passive:!1}),S.value.addEventListener("touchmove",V,{passive:!1})),r.monthChangeOnScroll&&S.value&&S.value.addEventListener("wheel",w,{passive:!1})});const F=T=>T?r.vertical?"vNext":"next":r.vertical?"vPrevious":"previous",N=(T,K)=>{if(r.transitions){const s=tt(Mt(Q(),r.month,r.year));U.value=Ne(tt(Mt(Q(),T,K)),s)?i.value[F(!0)]:i.value[F(!1)],I.value=!1,it(()=>{I.value=!0})}},ie=G(()=>({...h.value.calendar??{}})),ce=G(()=>T=>{const K=ai(T);return{dp__marker_dot:K.type==="dot",dp__marker_line:K.type==="line"}}),pe=G(()=>T=>Me(T,k.value)),g=G(()=>({dp__calendar:!0,dp__calendar_next:C.value.count>0&&r.instance!==0})),D=G(()=>T=>r.hideOffsetDates?T.current:!0),y=async(T,K)=>{const{width:s,height:L}=T.getBoundingClientRect();k.value=K.value;let J={left:`${s/2}px`},$=-50;if(await it(),q.value[0]){const{left:ge,width:x}=q.value[0].getBoundingClientRect();ge<0&&(J={left:"0"},$=0,ae.value.left=`${s/2}px`),window.innerWidth{var L,J,$;const ge=Fe(f.value[K][s]);ge&&((L=T.marker)!=null&&L.customPosition&&($=(J=T.marker)==null?void 0:J.tooltip)!=null&&$.length?Y.value=T.marker.customPosition(ge):await y(ge,T),a("tooltip-open",T.marker))},re=async(T,K,s)=>{var L,J;if(E.value&&v.value.enabled&&v.value.dragSelect)return a("select-date",T);a("set-hover-date",T),(J=(L=T.marker)==null?void 0:L.tooltip)!=null&&J.length&&await H(T,K,s)},R=T=>{k.value&&(k.value=null,Y.value=JSON.parse(JSON.stringify({bottom:"",left:"",transform:""})),a("tooltip-close",T.marker))},b=T=>{A.value.startX=T.changedTouches[0].screenX,A.value.startY=T.changedTouches[0].screenY},oe=T=>{A.value.endX=T.changedTouches[0].screenX,A.value.endY=T.changedTouches[0].screenY,M()},V=T=>{r.vertical&&!r.inline&&T.preventDefault()},M=()=>{const T=r.vertical?"Y":"X";Math.abs(A.value[`start${T}`]-A.value[`end${T}`])>10&&a("handle-swipe",A.value[`start${T}`]>A.value[`end${T}`]?"right":"left")},o=(T,K,s)=>{T&&(Array.isArray(f.value[K])?f.value[K][s]=T:f.value[K]=[T]),r.arrowNavigation&&l(f.value,"calendar")},w=T=>{r.monthChangeOnScroll&&(T.preventDefault(),a("handle-scroll",T))},z=T=>m.value.type==="local"?vn(T.value,{weekStartsOn:+r.weekStart}):m.value.type==="iso"?dn(T.value):typeof m.value.type=="function"?m.value.type(T.value):"",u=T=>{const K=T[0];return m.value.hideOnOffsetDates?T.some(s=>s.current)?z(K):"":z(K)},le=(T,K,s=!0)=>{s&&Vn()||!s&&!Vn()||v.value.enabled||(Yt(T,p.value),a("select-date",K))},fe=T=>{Yt(T,p.value)},Ve=T=>{v.value.enabled&&v.value.dragSelect?(E.value=!0,a("select-date",T)):v.value.enabled&&a("select-date",T)};return t({triggerTransition:N}),(T,K)=>(P(),W("div",{class:ke(g.value)},[ye("div",{ref_key:"calendarWrapRef",ref:S,class:ke(ie.value),role:"grid"},[ye("div",cs,[T.weekNumbers?(P(),W("div",vs,Ge(T.weekNumName),1)):j("",!0),(P(!0),W(we,null,Ye(ne.value,(s,L)=>{var J,$;return P(),W("div",{key:L,class:"dp__calendar_header_item",role:"gridcell","data-test":"calendar-header","aria-label":($=(J=d(c))==null?void 0:J.weekDay)==null?void 0:$.call(J,L)},[T.$slots["calendar-header"]?ue(T.$slots,"calendar-header",{key:0,day:s,index:L}):j("",!0),T.$slots["calendar-header"]?j("",!0):(P(),W(we,{key:1},[Dt(Ge(s),1)],64))],8,ms)}),128))]),K[2]||(K[2]=ye("div",{class:"dp__calendar_header_separator"},null,-1)),ot(ta,{name:U.value,css:!!T.transitions},{default:_e(()=>[I.value?(P(),W("div",{key:0,class:"dp__calendar",role:"rowgroup",onMouseleave:K[1]||(K[1]=s=>E.value=!1)},[(P(!0),W(we,null,Ye(B.value,(s,L)=>(P(),W("div",{key:L,class:"dp__calendar_row",role:"row"},[T.weekNumbers?(P(),W("div",ps,[ye("div",fs,Ge(u(s.days)),1)])):j("",!0),(P(!0),W(we,null,Ye(s.days,(J,$)=>{var ge,x,X;return P(),W("div",{id:d(Pr)(J.value),ref_for:!0,ref:de=>o(de,L,$),key:$+L,role:"gridcell",class:"dp__calendar_item","aria-pressed":(J.classData.dp__active_date||J.classData.dp__range_start||J.classData.dp__range_start)??void 0,"aria-disabled":J.classData.dp__cell_disabled||void 0,"aria-label":(x=(ge=d(c))==null?void 0:ge.day)==null?void 0:x.call(ge,J),tabindex:!J.current&&T.hideOffsetDates?void 0:0,"data-test":J.value,onClick:va(de=>le(de,J),["prevent"]),onTouchend:de=>le(de,J,!1),onKeydown:de=>d(et)(de,()=>T.$emit("select-date",J)),onMouseenter:de=>re(J,L,$),onMouseleave:de=>R(J),onMousedown:de=>Ve(J),onMouseup:K[0]||(K[0]=de=>E.value=!1)},[ye("div",{class:ke(["dp__cell_inner",J.classData])},[T.$slots.day&&D.value(J)?ue(T.$slots,"day",{key:0,day:+J.text,date:J.value}):j("",!0),T.$slots.day?j("",!0):(P(),W(we,{key:1},[Dt(Ge(J.text),1)],64)),J.marker&&D.value(J)?(P(),W(we,{key:2},[T.$slots.marker?ue(T.$slots,"marker",{key:0,marker:J.marker,day:+J.text,date:J.value}):(P(),W("div",{key:1,class:ke(ce.value(J.marker)),style:dt(J.marker.color?{backgroundColor:J.marker.color}:{})},null,6))],64)):j("",!0),pe.value(J.value)?(P(),W("div",{key:3,ref_for:!0,ref_key:"activeTooltip",ref:q,class:"dp__marker_tooltip",style:dt(Y.value)},[(X=J.marker)!=null&&X.tooltip?(P(),W("div",{key:0,class:"dp__tooltip_content",onClick:fe},[(P(!0),W(we,null,Ye(J.marker.tooltip,(de,be)=>(P(),W("div",{key:be,class:"dp__tooltip_text"},[T.$slots["marker-tooltip"]?ue(T.$slots,"marker-tooltip",{key:0,tooltip:de,day:J.value}):j("",!0),T.$slots["marker-tooltip"]?j("",!0):(P(),W(we,{key:1},[ye("div",{class:"dp__tooltip_mark",style:dt(de.color?{backgroundColor:de.color}:{})},null,4),ye("div",null,Ge(de.text),1)],64))]))),128)),ye("div",{class:"dp__arrow_bottom_tp",style:dt(ae.value)},null,4)])):j("",!0)],4)):j("",!0)],2)],40,hs)}),128))]))),128))],32)):j("",!0)]),_:3},8,["name","css"])],2)],2))}}),zn=e=>Array.isArray(e),gs=(e,t,n,a)=>{const r=Z([]),l=Z(new Date),i=Z(),p=()=>b(e.isTextInputDate),{modelValue:c,calendars:C,time:m,today:v}=ba(e,t,p),{defaultedMultiCalendars:h,defaultedStartTime:k,defaultedRange:Y,defaultedConfig:f,defaultedTz:S,propDates:I,defaultedMultiDates:U}=Se(e),{validateMonthYearInRange:A,isDisabled:q,isDateRangeAllowed:ae,checkMinMaxRange:E}=Et(e),{updateTimeValues:B,getSetDateTime:ne,setTime:F,assignStartTime:N,validateTime:ie,disabledTimesConfig:ce}=Rr(e,m,c,a),pe=G(()=>_=>C.value[_]?C.value[_].month:0),g=G(()=>_=>C.value[_]?C.value[_].year:0),D=_=>!f.value.keepViewOnOffsetClick||_?!0:!i.value,y=(_,te,O,ee=!1)=>{var se,Je;D(ee)&&(C.value[_]||(C.value[_]={month:0,year:0}),C.value[_].month=Hn(te)?(se=C.value[_])==null?void 0:se.month:te,C.value[_].year=Hn(O)?(Je=C.value[_])==null?void 0:Je.year:O)},H=()=>{e.autoApply&&t("select-date")};Ke(()=>{e.shadow||(c.value||(T(),k.value&&N(k.value)),b(!0),e.focusStartDate&&e.startDate&&T())});const re=G(()=>{var _;return(_=e.flow)!=null&&_.length&&!e.partialFlow?e.flowStep===e.flow.length:!0}),R=()=>{e.autoApply&&re.value&&t("auto-apply",e.partialFlow?e.flowStep!==e.flow.length:!1)},b=(_=!1)=>{if(c.value)return Array.isArray(c.value)?(r.value=c.value,u(_)):M(c.value,_);if(h.value.count&&_&&!e.startDate)return V(Q(),_)},oe=()=>Array.isArray(c.value)&&Y.value.enabled?xe(c.value[0])===xe(c.value[1]??c.value[0]):!1,V=(_=new Date,te=!1)=>{if((!h.value.count||!h.value.static||te)&&y(0,xe(_),he(_)),h.value.count&&(!h.value.solo||!c.value||oe()))for(let O=1;O{V(_),F("hours",Tt(_)),F("minutes",Rt(_)),F("seconds",jt(_)),h.value.count&&te&&Ve()},o=_=>{if(h.value.count){if(h.value.solo)return 0;const te=xe(_[0]),O=xe(_[1]);return Math.abs(O-te){_[1]&&Y.value.showLastInRange?V(_[o(_)],te):V(_[0],te);const O=(ee,se)=>[ee(_[0]),_[1]?ee(_[1]):m[se][1]];F("hours",O(Tt,"hours")),F("minutes",O(Rt,"minutes")),F("seconds",O(jt,"seconds"))},z=(_,te)=>{if((Y.value.enabled||e.weekPicker)&&!U.value.enabled)return w(_,te);if(U.value.enabled&&te){const O=_[_.length-1];return M(O,te)}},u=_=>{const te=c.value;z(te,_),h.value.count&&h.value.solo&&Ve()},le=(_,te)=>{const O=Ce(Q(),{month:pe.value(te),year:g.value(te)}),ee=_<0?ft(O,1):Jt(O,1);A(xe(ee),he(ee),_<0,e.preventMinMaxNavigation)&&(y(te,xe(ee),he(ee)),t("update-month-year",{instance:te,month:xe(ee),year:he(ee)}),h.value.count&&!h.value.solo&&fe(te),n())},fe=_=>{for(let te=_-1;te>=0;te--){const O=Jt(Ce(Q(),{month:pe.value(te+1),year:g.value(te+1)}),1);y(te,xe(O),he(O))}for(let te=_+1;te<=h.value.count-1;te++){const O=ft(Ce(Q(),{month:pe.value(te-1),year:g.value(te-1)}),1);y(te,xe(O),he(O))}},Ve=()=>{if(Array.isArray(c.value)&&c.value.length===2){const _=Q(Q(c.value[1]?c.value[1]:ft(c.value[0],1))),[te,O]=[xe(c.value[0]),he(c.value[0])],[ee,se]=[xe(c.value[1]),he(c.value[1])];(te!==ee||te===ee&&O!==se)&&h.value.solo&&y(1,xe(_),he(_))}else c.value&&!Array.isArray(c.value)&&(y(0,xe(c.value),he(c.value)),V(Q()))},T=()=>{e.startDate&&(y(0,xe(Q(e.startDate)),he(Q(e.startDate))),h.value.count&&fe(0))},K=(_,te)=>{if(e.monthChangeOnScroll){const O=new Date().getTime()-l.value.getTime(),ee=Math.abs(_.deltaY);let se=500;ee>1&&(se=100),ee>100&&(se=0),O>se&&(l.value=new Date,le(e.monthChangeOnScroll!=="inverse"?-_.deltaY:_.deltaY,te))}},s=(_,te,O=!1)=>{e.monthChangeOnArrows&&e.vertical===O&&L(_,te)},L=(_,te)=>{le(_==="right"?-1:1,te)},J=_=>{if(I.value.markers)return Aa(_.value,I.value.markers)},$=(_,te)=>{switch(e.sixWeeks===!0?"append":e.sixWeeks){case"prepend":return[!0,!1];case"center":return[_==0,!0];case"fair":return[_==0||te>_,!0];case"append":return[!1,!1];default:return[!1,!1]}},ge=(_,te,O,ee)=>{if(e.sixWeeks&&_.length<6){const se=6-_.length,Je=(te.getDay()+7-ee)%7,ut=6-(O.getDay()+7-ee)%7,[Bt,_a]=$(Je,ut);for(let la=1;la<=se;la++)if(_a?!!(la%2)==Bt:Bt){const At=_[0].days[0],qa=x(mt(At.value,-7),xe(te));_.unshift({days:qa})}else{const At=_[_.length-1],qa=At.days[At.days.length-1],Er=x(mt(qa.value,1),xe(te));_.push({days:Er})}}return _},x=(_,te)=>{const O=Q(_),ee=[];for(let se=0;se<7;se++){const Je=mt(O,se),ut=xe(Je)!==te;ee.push({text:e.hideOffsetDates&&ut?"":Je.getDate(),value:Je,current:!ut,classData:{}})}return ee},X=(_,te)=>{const O=[],ee=new Date(te,_),se=new Date(te,_+1,0),Je=e.weekStart,ut=ht(ee,{weekStartsOn:Je}),Bt=_a=>{const la=x(_a,_);if(O.push({days:la}),!O[O.length-1].days.some(At=>Me(tt(At.value),tt(se)))){const At=mt(_a,7);Bt(At)}};return Bt(ut),ge(O,ee,se,Je)},de=_=>{const te=St(Q(_.value),m.hours,m.minutes,rt());t("date-update",te),U.value.enabled?Dn(te,c,U.value.limit):c.value=te,a(),it().then(()=>{R()})},be=_=>Y.value.noDisabledRange?kr(r.value[0],_).some(te=>q(te)):!1,st=()=>{r.value=c.value?c.value.slice():[],r.value.length===2&&!(Y.value.fixedStart||Y.value.fixedEnd)&&(r.value=[])},me=(_,te)=>{const O=[Q(_.value),mt(Q(_.value),+Y.value.autoRange)];ae(O)?(te&&Pt(_.value),r.value=O):t("invalid-date",_.value)},Pt=_=>{const te=xe(Q(_)),O=he(Q(_));if(y(0,te,O),h.value.count>0)for(let ee=1;ee{if(be(_.value)||!E(_.value,c.value,Y.value.fixedStart?0:1))return t("invalid-date",_.value);r.value=$r(Q(_.value),c,t,Y)},na=(_,te)=>{if(st(),Y.value.autoRange)return me(_,te);if(Y.value.fixedStart||Y.value.fixedEnd)return gt(_);r.value[0]?E(Q(_.value),c.value)&&!be(_.value)?Ie(Q(_.value),Q(r.value[0]))?(r.value.unshift(Q(_.value)),t("range-end",r.value[0])):(r.value[1]=Q(_.value),t("range-end",r.value[1])):(e.autoApply&&t("auto-apply-invalid",_.value),t("invalid-date",_.value)):(r.value[0]=Q(_.value),t("range-start",r.value[0]))},rt=(_=!0)=>e.enableSeconds?Array.isArray(m.seconds)?_?m.seconds[0]:m.seconds[1]:m.seconds:0,ra=_=>{r.value[_]=St(r.value[_],m.hours[_],m.minutes[_],rt(_!==1))},Ea=()=>{var _,te;r.value[0]&&r.value[1]&&+((_=r.value)==null?void 0:_[0])>+((te=r.value)==null?void 0:te[1])&&(r.value.reverse(),t("range-start",r.value[0]),t("range-end",r.value[1]))},wa=()=>{r.value.length&&(r.value[0]&&!r.value[1]?ra(0):(ra(0),ra(1),a()),Ea(),c.value=r.value.slice(),Ra(r.value,t,e.autoApply,e.modelAuto))},Ba=(_,te=!1)=>{if(q(_.value)||!_.current&&e.hideOffsetDates)return t("invalid-date",_.value);if(i.value=JSON.parse(JSON.stringify(_)),!Y.value.enabled)return de(_);zn(m.hours)&&zn(m.minutes)&&!U.value.enabled&&(na(_,te),wa())},Na=(_,te)=>{var O;y(_,te.month,te.year,!0),h.value.count&&!h.value.solo&&fe(_),t("update-month-year",{instance:_,month:te.month,year:te.year}),n(h.value.solo?_:void 0);const ee=(O=e.flow)!=null&&O.length?e.flow[e.flowStep]:void 0;!te.fromNav&&(ee===Xe.month||ee===Xe.year)&&a()},La=(_,te)=>{Or({value:_,modelValue:c,range:Y.value.enabled,timezone:te?void 0:S.value.timezone}),H(),e.multiCalendars&&it().then(()=>b(!0))},Ha=()=>{const _=wn(Q(),S.value);Y.value.enabled?c.value&&Array.isArray(c.value)&&c.value[0]?c.value=Ie(_,c.value[0])?[_,c.value[0]]:[c.value[0],_]:c.value=[_]:c.value=_,H()},Va=()=>{if(Array.isArray(c.value))if(U.value.enabled){const _=Fa();c.value[c.value.length-1]=ne(_)}else c.value=c.value.map((_,te)=>_&&ne(_,te));else c.value=ne(c.value);t("time-update")},Fa=()=>Array.isArray(c.value)&&c.value.length?c.value[c.value.length-1]:null;return{calendars:C,modelValue:c,month:pe,year:g,time:m,disabledTimesConfig:ce,today:v,validateTime:ie,getCalendarDays:X,getMarker:J,handleScroll:K,handleSwipe:L,handleArrow:s,selectDate:Ba,updateMonthYear:Na,presetDate:La,selectCurrentDate:Ha,updateTime:(_,te=!0,O=!1)=>{B(_,te,O,Va)},assignMonthAndYear:V}},bs={key:0},ws=ze({__name:"DatePicker",props:{...yt},emits:["tooltip-open","tooltip-close","mount","update:internal-model-value","update-flow-step","reset-flow","auto-apply","focus-menu","select-date","range-start","range-end","invalid-fixed-range","time-update","am-pm-change","time-picker-open","time-picker-close","recalculate-position","update-month-year","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=e,{calendars:l,month:i,year:p,modelValue:c,time:C,disabledTimesConfig:m,today:v,validateTime:h,getCalendarDays:k,getMarker:Y,handleArrow:f,handleScroll:S,handleSwipe:I,selectDate:U,updateMonthYear:A,presetDate:q,selectCurrentDate:ae,updateTime:E,assignMonthAndYear:B}=gs(r,a,oe,V),ne=qt(),{setHoverDate:F,getDayClassData:N,clearHoverDate:ie}=Is(c,r),{defaultedMultiCalendars:ce}=Se(r),pe=Z([]),g=Z([]),D=Z(null),y=lt(ne,"calendar"),H=lt(ne,"monthYear"),re=lt(ne,"timePicker"),R=K=>{r.shadow||a("mount",K)};ct(l,()=>{r.shadow||setTimeout(()=>{a("recalculate-position")},0)},{deep:!0}),ct(ce,(K,s)=>{K.count-s.count>0&&B()},{deep:!0});const b=G(()=>K=>k(i.value(K),p.value(K)).map(s=>({...s,days:s.days.map(L=>(L.marker=Y(L),L.classData=N(L),L))})));function oe(K){var s;K||K===0?(s=g.value[K])==null||s.triggerTransition(i.value(K),p.value(K)):g.value.forEach((L,J)=>L.triggerTransition(i.value(J),p.value(J)))}function V(){a("update-flow-step")}const M=(K,s=!1)=>{U(K,s),r.spaceConfirm&&a("select-date")},o=(K,s,L=0)=>{var J;(J=pe.value[L])==null||J.toggleMonthPicker(K,s)},w=(K,s,L=0)=>{var J;(J=pe.value[L])==null||J.toggleYearPicker(K,s)},z=(K,s,L)=>{var J;(J=D.value)==null||J.toggleTimePicker(K,s,L)},u=(K,s)=>{var L;if(!r.range){const J=c.value?c.value:v,$=s?new Date(s):J,ge=K?ht($,{weekStartsOn:1}):ar($,{weekStartsOn:1});U({value:ge,current:xe($)===i.value(0),text:"",classData:{}}),(L=document.getElementById(Pr(ge)))==null||L.focus()}},le=K=>{var s;(s=pe.value[0])==null||s.handleMonthYearChange(K,!0)},fe=K=>{A(0,{month:i.value(0),year:p.value(0)+(K?1:-1),fromNav:!0})},Ve=(K,s)=>{K===Xe.time&&a(`time-picker-${s?"open":"close"}`),a("overlay-toggle",{open:s,overlay:K})},T=K=>{a("overlay-toggle",{open:!1,overlay:K}),a("focus-menu")};return t({clearHoverDate:ie,presetDate:q,selectCurrentDate:ae,toggleMonthPicker:o,toggleYearPicker:w,toggleTimePicker:z,handleArrow:f,updateMonthYear:A,getSidebarProps:()=>({modelValue:c,month:i,year:p,time:C,updateTime:E,updateMonthYear:A,selectDate:U,presetDate:q}),changeMonth:le,changeYear:fe,selectWeekDate:u}),(K,s)=>(P(),W(we,null,[ot(Sa,{"multi-calendars":d(ce).count,collapse:K.collapse},{default:_e(({instance:L,index:J})=>[K.disableMonthYearSelect?j("",!0):(P(),De(ds,Qe({key:0,ref:$=>{$&&(pe.value[J]=$)},months:d(hr)(K.formatLocale,K.locale,K.monthNameFormat),years:d(_n)(K.yearRange,K.locale,K.reverseYears),month:d(i)(L),year:d(p)(L),instance:L},K.$props,{onMount:s[0]||(s[0]=$=>R(d(Vt).header)),onResetFlow:s[1]||(s[1]=$=>K.$emit("reset-flow")),onUpdateMonthYear:$=>d(A)(L,$),onOverlayClosed:T,onOverlayOpened:s[2]||(s[2]=$=>K.$emit("overlay-toggle",{open:!0,overlay:$}))}),je({_:2},[Ye(d(H),($,ge)=>({name:$,fn:_e(x=>[ue(K.$slots,$,We(at(x)))])}))]),1040,["months","years","month","year","instance","onUpdateMonthYear"])),ot(ys,Qe({ref:$=>{$&&(g.value[J]=$)},"mapped-dates":b.value(L),month:d(i)(L),year:d(p)(L),instance:L},K.$props,{onSelectDate:$=>d(U)($,L!==1),onHandleSpace:$=>M($,L!==1),onSetHoverDate:s[3]||(s[3]=$=>d(F)($)),onHandleScroll:$=>d(S)($,L),onHandleSwipe:$=>d(I)($,L),onMount:s[4]||(s[4]=$=>R(d(Vt).calendar)),onResetFlow:s[5]||(s[5]=$=>K.$emit("reset-flow")),onTooltipOpen:s[6]||(s[6]=$=>K.$emit("tooltip-open",$)),onTooltipClose:s[7]||(s[7]=$=>K.$emit("tooltip-close",$))}),je({_:2},[Ye(d(y),($,ge)=>({name:$,fn:_e(x=>[ue(K.$slots,$,We(at({...x})))])}))]),1040,["mapped-dates","month","year","instance","onSelectDate","onHandleSpace","onHandleScroll","onHandleSwipe"])]),_:3},8,["multi-calendars","collapse"]),K.enableTimePicker?(P(),W("div",bs,[K.$slots["time-picker"]?ue(K.$slots,"time-picker",We(Qe({key:0},{time:d(C),updateTime:d(E)}))):(P(),De(Sr,Qe({key:1,ref_key:"timePickerRef",ref:D},K.$props,{hours:d(C).hours,minutes:d(C).minutes,seconds:d(C).seconds,"internal-model-value":K.internalModelValue,"disabled-times-config":d(m),"validate-time":d(h),onMount:s[8]||(s[8]=L=>R(d(Vt).timePicker)),"onUpdate:hours":s[9]||(s[9]=L=>d(E)(L)),"onUpdate:minutes":s[10]||(s[10]=L=>d(E)(L,!1)),"onUpdate:seconds":s[11]||(s[11]=L=>d(E)(L,!1,!0)),onResetFlow:s[12]||(s[12]=L=>K.$emit("reset-flow")),onOverlayClosed:s[13]||(s[13]=L=>Ve(L,!1)),onOverlayOpened:s[14]||(s[14]=L=>Ve(L,!0)),onAmPmChange:s[15]||(s[15]=L=>K.$emit("am-pm-change",L))}),je({_:2},[Ye(d(re),(L,J)=>({name:L,fn:_e($=>[ue(K.$slots,L,We(at($)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"]))])):j("",!0)],64))}}),_s=(e,t)=>{const n=Z(),{defaultedMultiCalendars:a,defaultedConfig:r,defaultedHighlight:l,defaultedRange:i,propDates:p,defaultedFilters:c,defaultedMultiDates:C}=Se(e),{modelValue:m,year:v,month:h,calendars:k}=ba(e,t),{isDisabled:Y}=Et(e),{selectYear:f,groupedYears:S,showYearPicker:I,isDisabled:U,toggleYearPicker:A,handleYearSelect:q,handleYear:ae}=Yr({modelValue:m,multiCalendars:a,range:i,highlight:l,calendars:k,propDates:p,month:h,year:v,filters:c,props:e,emit:t}),E=(D,y)=>[D,y].map(H=>kt(H,"MMMM",{locale:e.formatLocale})).join("-"),B=G(()=>D=>m.value?Array.isArray(m.value)?m.value.some(y=>Bn(D,y)):Bn(m.value,D):!1),ne=D=>{if(i.value.enabled){if(Array.isArray(m.value)){const y=Me(D,m.value[0])||Me(D,m.value[1]);return $a(m.value,n.value,D)&&!y}return!1}return!1},F=(D,y)=>D.quarter===$n(y)&&D.year===he(y),N=D=>typeof l.value=="function"?l.value({quarter:$n(D),year:he(D)}):!!l.value.quarters.find(y=>F(y,D)),ie=G(()=>D=>{const y=Ce(new Date,{year:v.value(D)});return el({start:ma(y),end:tr(y)}).map(H=>{const re=Ht(H),R=Yn(H),b=Y(H),oe=ne(re),V=N(re);return{text:E(re,R),value:re,active:B.value(re),highlighted:V,disabled:b,isBetween:oe}})}),ce=D=>{Dn(D,m,C.value.limit),t("auto-apply",!0)},pe=D=>{m.value=Tn(m,D,t),Ra(m.value,t,e.autoApply,e.modelAuto)},g=D=>{m.value=D,t("auto-apply")};return{defaultedConfig:r,defaultedMultiCalendars:a,groupedYears:S,year:v,isDisabled:U,quarters:ie,showYearPicker:I,modelValue:m,setHoverDate:D=>{n.value=D},selectYear:f,selectQuarter:(D,y,H)=>{if(!H)return k.value[y].month=xe(Yn(D)),C.value.enabled?ce(D):i.value.enabled?pe(D):g(D)},toggleYearPicker:A,handleYearSelect:q,handleYear:ae}},ks={class:"dp--quarter-items"},xs=["data-test","disabled","onClick","onMouseover"],Ms=ze({compatConfig:{MODE:3},__name:"QuarterPicker",props:{...yt},emits:["update:internal-model-value","reset-flow","overlay-closed","auto-apply","range-start","range-end","overlay-toggle","update-month-year"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=qt(),i=lt(l,"yearMode"),{defaultedMultiCalendars:p,defaultedConfig:c,groupedYears:C,year:m,isDisabled:v,quarters:h,modelValue:k,showYearPicker:Y,setHoverDate:f,selectQuarter:S,toggleYearPicker:I,handleYearSelect:U,handleYear:A}=_s(r,a);return t({getSidebarProps:()=>({modelValue:k,year:m,selectQuarter:S,handleYearSelect:U,handleYear:A})}),(q,ae)=>(P(),De(Sa,{"multi-calendars":d(p).count,collapse:q.collapse,stretch:""},{default:_e(({instance:E})=>[ye("div",{class:"dp-quarter-picker-wrap",style:dt({minHeight:`${d(c).modeHeight}px`})},[q.$slots["top-extra"]?ue(q.$slots,"top-extra",{key:0,value:q.internalModelValue}):j("",!0),ye("div",null,[ot(Cr,Qe(q.$props,{items:d(C)(E),instance:E,"show-year-picker":d(Y)[E],year:d(m)(E),"is-disabled":B=>d(v)(E,B),onHandleYear:B=>d(A)(E,B),onYearSelect:B=>d(U)(B,E),onToggleYearPicker:B=>d(I)(E,B?.flow,B?.show)}),je({_:2},[Ye(d(i),(B,ne)=>({name:B,fn:_e(F=>[ue(q.$slots,B,We(at(F)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),ye("div",ks,[(P(!0),W(we,null,Ye(d(h)(E),(B,ne)=>(P(),W("div",{key:ne},[ye("button",{type:"button",class:ke(["dp--qr-btn",{"dp--qr-btn-active":B.active,"dp--qr-btn-between":B.isBetween,"dp--qr-btn-disabled":B.disabled,"dp--highlighted":B.highlighted}]),"data-test":B.value,disabled:B.disabled,onClick:F=>d(S)(B.value,E,B.disabled),onMouseover:F=>d(f)(B.value)},[q.$slots.quarter?ue(q.$slots,"quarter",{key:0,value:B.value,text:B.text}):(P(),W(we,{key:1},[Dt(Ge(B.text),1)],64))],42,xs)]))),128))])],4)]),_:3},8,["multi-calendars","collapse"]))}}),Ds=["id","tabindex","role","aria-label"],Ts={key:0,class:"dp--menu-load-container"},Ps={key:1,class:"dp--menu-header"},As={key:0,class:"dp__sidebar_left"},Cs=["data-test","onClick","onKeydown"],Os={key:2,class:"dp__sidebar_right"},$s={key:3,class:"dp__action_extra"},Un=ze({compatConfig:{MODE:3},__name:"DatepickerMenu",props:{...Ya,shadow:{type:Boolean,default:!1},openOnTop:{type:Boolean,default:!1},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},emits:["close-picker","select-date","auto-apply","time-update","flow-step","update-month-year","invalid-select","update:internal-model-value","recalculate-position","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=Z(null),i=G(()=>{const{openOnTop:x,...X}=r;return{...X,flowStep:F.value,collapse:r.collapse,noOverlayFocus:r.noOverlayFocus,menuWrapRef:l.value}}),{setMenuFocused:p,setShiftKey:c,control:C}=Ar(),m=qt(),{defaultedTextInput:v,defaultedInline:h,defaultedConfig:k,defaultedUI:Y}=Se(r),f=Z(null),S=Z(0),I=Z(null),U=Z(!1),A=Z(null);Ke(()=>{if(!r.shadow){U.value=!0,q(),window.addEventListener("resize",q);const x=Fe(l);if(x&&!v.value.enabled&&!h.value.enabled&&(p(!0),y()),x){const X=de=>{k.value.allowPreventDefault&&de.preventDefault(),Yt(de,k.value,!0)};x.addEventListener("pointerdown",X),x.addEventListener("mousedown",X)}}}),Ca(()=>{window.removeEventListener("resize",q)});const q=()=>{const x=Fe(I);x&&(S.value=x.getBoundingClientRect().width)},{arrowRight:ae,arrowLeft:E,arrowDown:B,arrowUp:ne}=It(),{flowStep:F,updateFlowStep:N,childMount:ie,resetFlow:ce,handleFlow:pe}=Es(r,a,A),g=G(()=>r.monthPicker?qi:r.yearPicker?Qi:r.timePicker?rs:r.quarterPicker?Ms:ws),D=G(()=>{var x;if(k.value.arrowLeft)return k.value.arrowLeft;const X=(x=l.value)==null?void 0:x.getBoundingClientRect(),de=r.getInputRect();return de?.width=(X?.right??0)&&de?.width{const x=Fe(l);x&&x.focus({preventScroll:!0})},H=G(()=>{var x;return((x=A.value)==null?void 0:x.getSidebarProps())||{}}),re=()=>{r.openOnTop&&a("recalculate-position")},R=lt(m,"action"),b=G(()=>r.monthPicker||r.yearPicker?lt(m,"monthYear"):r.timePicker?lt(m,"timePicker"):lt(m,"shared")),oe=G(()=>r.openOnTop?"dp__arrow_bottom":"dp__arrow_top"),V=G(()=>({dp__menu_disabled:r.disabled,dp__menu_readonly:r.readonly,"dp-menu-loading":r.loading})),M=G(()=>({dp__menu:!0,dp__menu_index:!h.value.enabled,dp__relative:h.value.enabled,...Y.value.menu??{}})),o=x=>{Yt(x,k.value,!0)},w=()=>{r.escClose&&a("close-picker")},z=x=>{if(r.arrowNavigation){if(x===Ze.up)return ne();if(x===Ze.down)return B();if(x===Ze.left)return E();if(x===Ze.right)return ae()}else x===Ze.left||x===Ze.up?T("handleArrow",Ze.left,0,x===Ze.up):T("handleArrow",Ze.right,0,x===Ze.down)},u=x=>{c(x.shiftKey),!r.disableMonthYearSelect&&x.code===$e.tab&&x.target.classList.contains("dp__menu")&&C.value.shiftKeyInMenu&&(x.preventDefault(),Yt(x,k.value,!0),a("close-picker"))},le=()=>{y(),a("time-picker-close")},fe=x=>{var X,de,be;(X=A.value)==null||X.toggleTimePicker(!1,!1),(de=A.value)==null||de.toggleMonthPicker(!1,!1,x),(be=A.value)==null||be.toggleYearPicker(!1,!1,x)},Ve=(x,X=0)=>{var de,be,st;return x==="month"?(de=A.value)==null?void 0:de.toggleMonthPicker(!1,!0,X):x==="year"?(be=A.value)==null?void 0:be.toggleYearPicker(!1,!0,X):x==="time"?(st=A.value)==null?void 0:st.toggleTimePicker(!0,!1):fe(X)},T=(x,...X)=>{var de,be;(de=A.value)!=null&&de[x]&&((be=A.value)==null||be[x](...X))},K=()=>{T("selectCurrentDate")},s=(x,X)=>{T("presetDate",x,X)},L=()=>{T("clearHoverDate")},J=(x,X)=>{T("updateMonthYear",x,X)},$=(x,X)=>{x.preventDefault(),z(X)},ge=x=>{var X,de,be;if(u(x),x.key===$e.home||x.key===$e.end)return T("selectWeekDate",x.key===$e.home,x.target.getAttribute("id"));switch((x.key===$e.pageUp||x.key===$e.pageDown)&&(x.shiftKey?(T("changeYear",x.key===$e.pageUp),(X=on(l.value,"overlay-year"))==null||X.focus()):(T("changeMonth",x.key===$e.pageUp),(de=on(l.value,x.key===$e.pageUp?"action-prev":"action-next"))==null||de.focus()),x.target.getAttribute("id")&&((be=l.value)==null||be.focus({preventScroll:!0}))),x.key){case $e.esc:return w();case $e.arrowLeft:return $(x,Ze.left);case $e.arrowRight:return $(x,Ze.right);case $e.arrowUp:return $(x,Ze.up);case $e.arrowDown:return $(x,Ze.down);default:return}};return t({updateMonthYear:J,switchView:Ve,handleFlow:pe}),(x,X)=>{var de,be,st;return P(),W("div",{id:x.uid?`dp-menu-${x.uid}`:void 0,ref_key:"dpMenuRef",ref:l,tabindex:d(h).enabled?void 0:"0",role:d(h).enabled?void 0:"dialog","aria-label":(de=x.ariaLabels)==null?void 0:de.menu,class:ke(M.value),style:dt({"--dp-arrow-left":D.value}),onMouseleave:L,onClick:o,onKeydown:ge},[(x.disabled||x.readonly)&&d(h).enabled||x.loading?(P(),W("div",{key:0,class:ke(V.value)},[x.loading?(P(),W("div",Ts,X[19]||(X[19]=[ye("span",{class:"dp--menu-loader"},null,-1)]))):j("",!0)],2)):j("",!0),x.$slots["menu-header"]?(P(),W("div",Ps,[ue(x.$slots,"menu-header")])):j("",!0),!d(h).enabled&&!x.teleportCenter?(P(),W("div",{key:2,class:ke(oe.value)},null,2)):j("",!0),ye("div",{ref_key:"innerMenuRef",ref:I,class:ke({dp__menu_content_wrapper:((be=x.presetDates)==null?void 0:be.length)||!!x.$slots["left-sidebar"]||!!x.$slots["right-sidebar"],"dp--menu-content-wrapper-collapsed":e.collapse&&(((st=x.presetDates)==null?void 0:st.length)||!!x.$slots["left-sidebar"]||!!x.$slots["right-sidebar"])}),style:dt({"--dp-menu-width":`${S.value}px`})},[x.$slots["left-sidebar"]?(P(),W("div",As,[ue(x.$slots,"left-sidebar",We(at(H.value)))])):j("",!0),x.presetDates.length?(P(),W("div",{key:1,class:ke({"dp--preset-dates-collapsed":e.collapse,"dp--preset-dates":!0})},[(P(!0),W(we,null,Ye(x.presetDates,(me,Pt)=>(P(),W(we,{key:Pt},[me.slot?ue(x.$slots,me.slot,{key:0,presetDate:s,label:me.label,value:me.value}):(P(),W("button",{key:1,type:"button",style:dt(me.style||{}),class:ke(["dp__btn dp--preset-range",{"dp--preset-range-collapsed":e.collapse}]),"data-test":me.testId??void 0,onClick:va(gt=>s(me.value,me.noTz),["prevent"]),onKeydown:gt=>d(et)(gt,()=>s(me.value,me.noTz),!0)},Ge(me.label),47,Cs))],64))),128))],2)):j("",!0),ye("div",{ref_key:"calendarWrapperRef",ref:f,class:"dp__instance_calendar",role:"document"},[(P(),De(Oa(g.value),Qe({ref_key:"dynCmpRef",ref:A},i.value,{"flow-step":d(F),onMount:d(ie),onUpdateFlowStep:d(N),onResetFlow:d(ce),onFocusMenu:y,onSelectDate:X[0]||(X[0]=me=>x.$emit("select-date")),onDateUpdate:X[1]||(X[1]=me=>x.$emit("date-update",me)),onTooltipOpen:X[2]||(X[2]=me=>x.$emit("tooltip-open",me)),onTooltipClose:X[3]||(X[3]=me=>x.$emit("tooltip-close",me)),onAutoApply:X[4]||(X[4]=me=>x.$emit("auto-apply",me)),onRangeStart:X[5]||(X[5]=me=>x.$emit("range-start",me)),onRangeEnd:X[6]||(X[6]=me=>x.$emit("range-end",me)),onInvalidFixedRange:X[7]||(X[7]=me=>x.$emit("invalid-fixed-range",me)),onTimeUpdate:X[8]||(X[8]=me=>x.$emit("time-update")),onAmPmChange:X[9]||(X[9]=me=>x.$emit("am-pm-change",me)),onTimePickerOpen:X[10]||(X[10]=me=>x.$emit("time-picker-open",me)),onTimePickerClose:le,onRecalculatePosition:re,onUpdateMonthYear:X[11]||(X[11]=me=>x.$emit("update-month-year",me)),onAutoApplyInvalid:X[12]||(X[12]=me=>x.$emit("auto-apply-invalid",me)),onInvalidDate:X[13]||(X[13]=me=>x.$emit("invalid-date",me)),onOverlayToggle:X[14]||(X[14]=me=>x.$emit("overlay-toggle",me)),"onUpdate:internalModelValue":X[15]||(X[15]=me=>x.$emit("update:internal-model-value",me))}),je({_:2},[Ye(b.value,(me,Pt)=>({name:me,fn:_e(gt=>[ue(x.$slots,me,We(at({...gt})))])}))]),1040,["flow-step","onMount","onUpdateFlowStep","onResetFlow"]))],512),x.$slots["right-sidebar"]?(P(),W("div",Os,[ue(x.$slots,"right-sidebar",We(at(H.value)))])):j("",!0),x.$slots["action-extra"]?(P(),W("div",$s,[x.$slots["action-extra"]?ue(x.$slots,"action-extra",{key:0,selectCurrentDate:K}):j("",!0)])):j("",!0)],6),!x.autoApply||d(k).keepActionRow?(P(),De(Ii,Qe({key:3,"menu-mount":U.value},i.value,{"calendar-width":S.value,onClosePicker:X[16]||(X[16]=me=>x.$emit("close-picker")),onSelectDate:X[17]||(X[17]=me=>x.$emit("select-date")),onInvalidSelect:X[18]||(X[18]=me=>x.$emit("invalid-select")),onSelectNow:K}),je({_:2},[Ye(d(R),(me,Pt)=>({name:me,fn:_e(gt=>[ue(x.$slots,me,We(at({...gt})))])}))]),1040,["menu-mount","calendar-width"])):j("",!0)],46,Ds)}}});var Ut=(e=>(e.center="center",e.left="left",e.right="right",e))(Ut||{});const Ys=({menuRef:e,menuRefInner:t,inputRef:n,pickerWrapperRef:a,inline:r,emit:l,props:i,slots:p})=>{const{defaultedConfig:c}=Se(i),C=Z({}),m=Z(!1),v=Z({top:"0",left:"0"}),h=Z(!1),k=ca(i,"teleportCenter");ct(k,()=>{v.value=JSON.parse(JSON.stringify({})),ae()});const Y=y=>{if(i.teleport){const H=y.getBoundingClientRect();return{left:H.left+window.scrollX,top:H.top+window.scrollY}}return{top:0,left:0}},f=(y,H)=>{v.value.left=`${y+H-C.value.width}px`},S=y=>{v.value.left=`${y}px`},I=(y,H)=>{i.position===Ut.left&&S(y),i.position===Ut.right&&f(y,H),i.position===Ut.center&&(v.value.left=`${y+H/2-C.value.width/2}px`)},U=y=>{const{width:H,height:re}=y.getBoundingClientRect(),{top:R,left:b}=i.altPosition?i.altPosition(y):Y(y);return{top:+R,left:+b,width:H,height:re}},A=()=>{v.value.left="50%",v.value.top="50%",v.value.transform="translate(-50%, -50%)",v.value.position="fixed",delete v.value.opacity},q=()=>{const y=Fe(n),{top:H,left:re,transform:R}=i.altPosition(y);v.value={top:`${H}px`,left:`${re}px`,transform:R??""}},ae=(y=!0)=>{var H;if(!r.value.enabled){if(k.value)return A();if(i.altPosition!==null)return q();if(y){const re=i.teleport?(H=t.value)==null?void 0:H.$el:e.value;re&&(C.value=re.getBoundingClientRect()),l("recalculate-position")}return ce()}},E=({inputEl:y,left:H,width:re})=>{window.screen.width>768&&!m.value&&I(H,re),F(y)},B=y=>{const{top:H,left:re,height:R,width:b}=U(y);v.value.top=`${R+H+ +i.offset}px`,h.value=!1,m.value||(v.value.left=`${re+b/2-C.value.width/2}px`),E({inputEl:y,left:re,width:b})},ne=y=>{const{top:H,left:re,width:R}=U(y);v.value.top=`${H-+i.offset-C.value.height}px`,h.value=!0,E({inputEl:y,left:re,width:R})},F=y=>{if(i.autoPosition){const{left:H,width:re}=U(y),{left:R,right:b}=C.value;if(!m.value){if(Math.abs(R)!==Math.abs(b)){if(R<=0)return m.value=!0,S(H);if(b>=document.documentElement.clientWidth)return m.value=!0,f(H,re)}return I(H,re)}}},N=()=>{const y=Fe(n);if(y){const{height:H}=C.value,{top:re,height:R}=y.getBoundingClientRect(),b=window.innerHeight-re-R,oe=re;return H<=b?Lt.bottom:H>b&&H<=oe?Lt.top:b>=oe?Lt.bottom:Lt.top}return Lt.bottom},ie=y=>N()===Lt.bottom?B(y):ne(y),ce=()=>{const y=Fe(n);if(y)return i.autoPosition?ie(y):B(y)},pe=function(y){if(y){const H=y.scrollHeight>y.clientHeight,re=window.getComputedStyle(y).overflowY.indexOf("hidden")!==-1;return H&&!re}return!0},g=function(y){return!y||y===document.body||y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?window:pe(y)?y:g(y.assignedSlot&&c.value.shadowDom?y.assignedSlot.parentNode:y.parentNode)},D=y=>{if(y)switch(i.position){case Ut.left:return{left:0,transform:"translateX(0)"};case Ut.right:return{left:`${y.width}px`,transform:"translateX(-100%)"};default:return{left:`${y.width/2}px`,transform:"translateX(-50%)"}}return{}};return{openOnTop:h,menuStyle:v,xCorrect:m,setMenuPosition:ae,getScrollableParent:g,shadowRender:(y,H)=>{var re,R,b;const oe=document.createElement("div"),V=(re=Fe(n))==null?void 0:re.getBoundingClientRect();oe.setAttribute("id","dp--temp-container");const M=(R=a.value)!=null&&R.clientWidth?a.value:document.body;M.append(oe);const o=D(V),w=c.value.shadowDom?Object.keys(p).filter(u=>["right-sidebar","left-sidebar","top-extra","action-extra"].includes(u)):Object.keys(p),z=Nr(y,{...H,shadow:!0,style:{opacity:0,position:"absolute",...o}},Object.fromEntries(w.map(u=>[u,p[u]])));An(z,oe),C.value=(b=z.el)==null?void 0:b.getBoundingClientRect(),An(null,oe),M.removeChild(oe)}}},Ot=[{name:"clock-icon",use:["time","calendar","shared"]},{name:"arrow-left",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-right",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-up",use:["time","calendar","month-year","shared"]},{name:"arrow-down",use:["time","calendar","month-year","shared"]},{name:"calendar-icon",use:["month-year","time","calendar","shared","year-mode"]},{name:"day",use:["calendar","shared"]},{name:"month-overlay-value",use:["calendar","month-year","shared"]},{name:"year-overlay-value",use:["calendar","month-year","shared","year-mode"]},{name:"year-overlay",use:["month-year","shared"]},{name:"month-overlay",use:["month-year","shared"]},{name:"month-overlay-header",use:["month-year","shared"]},{name:"year-overlay-header",use:["month-year","shared"]},{name:"hours-overlay-value",use:["calendar","time","shared"]},{name:"hours-overlay-header",use:["calendar","time","shared"]},{name:"minutes-overlay-value",use:["calendar","time","shared"]},{name:"minutes-overlay-header",use:["calendar","time","shared"]},{name:"seconds-overlay-value",use:["calendar","time","shared"]},{name:"seconds-overlay-header",use:["calendar","time","shared"]},{name:"hours",use:["calendar","time","shared"]},{name:"minutes",use:["calendar","time","shared"]},{name:"month",use:["calendar","month-year","shared"]},{name:"year",use:["calendar","month-year","shared","year-mode"]},{name:"action-buttons",use:["action"]},{name:"action-preview",use:["action"]},{name:"calendar-header",use:["calendar","shared"]},{name:"marker-tooltip",use:["calendar","shared"]},{name:"action-extra",use:["menu"]},{name:"time-picker-overlay",use:["calendar","time","shared"]},{name:"am-pm-button",use:["calendar","time","shared"]},{name:"left-sidebar",use:["menu"]},{name:"right-sidebar",use:["menu"]},{name:"month-year",use:["month-year","shared"]},{name:"time-picker",use:["menu","shared"]},{name:"action-row",use:["action"]},{name:"marker",use:["calendar","shared"]},{name:"quarter",use:["shared"]},{name:"top-extra",use:["shared","month-year"]},{name:"tp-inline-arrow-up",use:["shared","time"]},{name:"tp-inline-arrow-down",use:["shared","time"]},{name:"menu-header",use:["menu"]}],Ss=[{name:"trigger"},{name:"input-icon"},{name:"clear-icon"},{name:"dp-input"}],Rs={all:()=>Ot,monthYear:()=>Ot.filter(e=>e.use.includes("month-year")),input:()=>Ss,timePicker:()=>Ot.filter(e=>e.use.includes("time")),action:()=>Ot.filter(e=>e.use.includes("action")),calendar:()=>Ot.filter(e=>e.use.includes("calendar")),menu:()=>Ot.filter(e=>e.use.includes("menu")),shared:()=>Ot.filter(e=>e.use.includes("shared")),yearMode:()=>Ot.filter(e=>e.use.includes("year-mode"))},lt=(e,t,n)=>{const a=[];return Rs[t]().forEach(r=>{e[r.name]&&a.push(r.name)}),n!=null&&n.length&&n.forEach(r=>{r.slot&&a.push(r.slot)}),a},ga=e=>{const t=G(()=>a=>e.value?a?e.value.open:e.value.close:""),n=G(()=>a=>e.value?a?e.value.menuAppearTop:e.value.menuAppearBottom:"");return{transitionName:t,showTransition:!!e.value,menuTransition:n}},ba=(e,t,n)=>{const{defaultedRange:a,defaultedTz:r}=Se(e),l=Q(nt(Q(),r.value.timezone)),i=Z([{month:xe(l),year:he(l)}]),p=h=>{const k={hours:Tt(l),minutes:Rt(l),seconds:0};return a.value.enabled?[k[h],k[h]]:k[h]},c=ha({hours:p("hours"),minutes:p("minutes"),seconds:p("seconds")});ct(a,(h,k)=>{h.enabled!==k.enabled&&(c.hours=p("hours"),c.minutes=p("minutes"),c.seconds=p("seconds"))},{deep:!0});const C=G({get:()=>e.internalModelValue,set:h=>{!e.readonly&&!e.disabled&&t("update:internal-model-value",h)}}),m=G(()=>h=>i.value[h]?i.value[h].month:0),v=G(()=>h=>i.value[h]?i.value[h].year:0);return ct(C,(h,k)=>{n&&JSON.stringify(h??{})!==JSON.stringify(k??{})&&n()},{deep:!0}),{calendars:i,time:c,modelValue:C,month:m,year:v,today:l}},Is=(e,t)=>{const{defaultedMultiCalendars:n,defaultedMultiDates:a,defaultedUI:r,defaultedHighlight:l,defaultedTz:i,propDates:p,defaultedRange:c}=Se(t),{isDisabled:C}=Et(t),m=Z(null),v=Z(nt(new Date,i.value.timezone)),h=o=>{!o.current&&t.hideOffsetDates||(m.value=o.value)},k=()=>{m.value=null},Y=o=>Array.isArray(e.value)&&c.value.enabled&&e.value[0]&&m.value?o?Ne(m.value,e.value[0]):Ie(m.value,e.value[0]):!0,f=(o,w)=>{const z=()=>e.value?w?e.value[0]||null:e.value[1]:null,u=e.value&&Array.isArray(e.value)?z():null;return Me(Q(o.value),u)},S=o=>{const w=Array.isArray(e.value)?e.value[0]:null;return o?!Ie(m.value??null,w):!0},I=(o,w=!0)=>(c.value.enabled||t.weekPicker)&&Array.isArray(e.value)&&e.value.length===2?t.hideOffsetDates&&!o.current?!1:Me(Q(o.value),e.value[w?0:1]):c.value.enabled?f(o,w)&&S(w)||Me(o.value,Array.isArray(e.value)?e.value[0]:null)&&Y(w):!1,U=(o,w)=>{if(Array.isArray(e.value)&&e.value[0]&&e.value.length===1){const z=Me(o.value,m.value);return w?Ne(e.value[0],o.value)&&z:Ie(e.value[0],o.value)&&z}return!1},A=o=>!e.value||t.hideOffsetDates&&!o.current?!1:c.value.enabled?t.modelAuto&&Array.isArray(e.value)?Me(o.value,e.value[0]?e.value[0]:v.value):!1:a.value.enabled&&Array.isArray(e.value)?e.value.some(w=>Me(w,o.value)):Me(o.value,e.value?e.value:v.value),q=o=>{if(c.value.autoRange||t.weekPicker){if(m.value){if(t.hideOffsetDates&&!o.current)return!1;const w=mt(m.value,+c.value.autoRange),z=xt(Q(m.value),t.weekStart);return t.weekPicker?Me(z[1],Q(o.value)):Me(w,Q(o.value))}return!1}return!1},ae=o=>{if(c.value.autoRange||t.weekPicker){if(m.value){const w=mt(m.value,+c.value.autoRange);if(t.hideOffsetDates&&!o.current)return!1;const z=xt(Q(m.value),t.weekStart);return t.weekPicker?Ne(o.value,z[0])&&Ie(o.value,z[1]):Ne(o.value,m.value)&&Ie(o.value,w)}return!1}return!1},E=o=>{if(c.value.autoRange||t.weekPicker){if(m.value){if(t.hideOffsetDates&&!o.current)return!1;const w=xt(Q(m.value),t.weekStart);return t.weekPicker?Me(w[0],o.value):Me(m.value,o.value)}return!1}return!1},B=o=>$a(e.value,m.value,o.value),ne=()=>t.modelAuto&&Array.isArray(t.internalModelValue)?!!t.internalModelValue[0]:!1,F=()=>t.modelAuto?yr(t.internalModelValue):!0,N=o=>{if(t.weekPicker)return!1;const w=c.value.enabled?!I(o)&&!I(o,!1):!0;return!C(o.value)&&!A(o)&&!(!o.current&&t.hideOffsetDates)&&w},ie=o=>c.value.enabled?t.modelAuto?ne()&&A(o):!1:A(o),ce=o=>l.value?oi(o.value,p.value.highlight):!1,pe=o=>{const w=C(o.value);return w&&(typeof l.value=="function"?!l.value(o.value,w):!l.value.options.highlightDisabled)},g=o=>{var w;return typeof l.value=="function"?l.value(o.value):(w=l.value.weekdays)==null?void 0:w.includes(o.value.getDay())},D=o=>(c.value.enabled||t.weekPicker)&&(!(n.value.count>0)||o.current)&&F()&&!(!o.current&&t.hideOffsetDates)&&!A(o)?B(o):!1,y=o=>{const{isRangeStart:w,isRangeEnd:z}=b(o),u=c.value.enabled?w||z:!1;return{dp__cell_offset:!o.current,dp__pointer:!t.disabled&&!(!o.current&&t.hideOffsetDates)&&!C(o.value),dp__cell_disabled:C(o.value),dp__cell_highlight:!pe(o)&&(ce(o)||g(o))&&!ie(o)&&!u&&!E(o)&&!(D(o)&&t.weekPicker)&&!z,dp__cell_highlight_active:!pe(o)&&(ce(o)||g(o))&&ie(o),dp__today:!t.noToday&&Me(o.value,v.value)&&o.current,"dp--past":Ie(o.value,v.value),"dp--future":Ne(o.value,v.value)}},H=o=>({dp__active_date:ie(o),dp__date_hover:N(o)}),re=o=>{if(e.value&&!Array.isArray(e.value)){const w=xt(e.value,t.weekStart);return{...V(o),dp__range_start:Me(w[0],o.value),dp__range_end:Me(w[1],o.value),dp__range_between_week:Ne(o.value,w[0])&&Ie(o.value,w[1])}}return{...V(o)}},R=o=>{if(e.value&&Array.isArray(e.value)){const w=xt(e.value[0],t.weekStart),z=e.value[1]?xt(e.value[1],t.weekStart):[];return{...V(o),dp__range_start:Me(w[0],o.value)||Me(z[0],o.value),dp__range_end:Me(w[1],o.value)||Me(z[1],o.value),dp__range_between_week:Ne(o.value,w[0])&&Ie(o.value,w[1])||Ne(o.value,z[0])&&Ie(o.value,z[1]),dp__range_between:Ne(o.value,w[1])&&Ie(o.value,z[0])}}return{...V(o)}},b=o=>{const w=n.value.count>0?o.current&&I(o)&&F():I(o)&&F(),z=n.value.count>0?o.current&&I(o,!1)&&F():I(o,!1)&&F();return{isRangeStart:w,isRangeEnd:z}},oe=o=>{const{isRangeStart:w,isRangeEnd:z}=b(o);return{dp__range_start:w,dp__range_end:z,dp__range_between:D(o),dp__date_hover:Me(o.value,m.value)&&!w&&!z&&!t.weekPicker,dp__date_hover_start:U(o,!0),dp__date_hover_end:U(o,!1)}},V=o=>({...oe(o),dp__cell_auto_range:ae(o),dp__cell_auto_range_start:E(o),dp__cell_auto_range_end:q(o)}),M=o=>c.value.enabled?c.value.autoRange?V(o):t.modelAuto?{...H(o),...oe(o)}:t.weekPicker?R(o):oe(o):t.weekPicker?re(o):H(o);return{setHoverDate:h,clearHoverDate:k,getDayClassData:o=>t.hideOffsetDates&&!o.current?{}:{...y(o),...M(o),[t.dayClass?t.dayClass(o.value,t.internalModelValue):""]:!0,...r.value.calendarCell??{}}}},Et=e=>{const{defaultedFilters:t,defaultedRange:n,propDates:a,defaultedMultiDates:r}=Se(e),l=g=>a.value.disabledDates?typeof a.value.disabledDates=="function"?a.value.disabledDates(Q(g)):!!Aa(g,a.value.disabledDates):!1,i=g=>a.value.maxDate?e.yearPicker?he(g)>he(a.value.maxDate):Ne(g,a.value.maxDate):!1,p=g=>a.value.minDate?e.yearPicker?he(g){const D=i(g),y=p(g),H=l(g),re=t.value.months.map(M=>+M).includes(xe(g)),R=e.disabledWeekDays.length?e.disabledWeekDays.some(M=>+M===Ul(g)):!1,b=k(g),oe=he(g),V=oe<+e.yearRange[0]||oe>+e.yearRange[1];return!(D||y||H||re||V||R||b)},C=(g,D)=>Ie(...$t(a.value.minDate,g,D))||Me(...$t(a.value.minDate,g,D)),m=(g,D)=>Ne(...$t(a.value.maxDate,g,D))||Me(...$t(a.value.maxDate,g,D)),v=(g,D,y)=>{let H=!1;return a.value.maxDate&&y&&m(g,D)&&(H=!0),a.value.minDate&&!y&&C(g,D)&&(H=!0),H},h=(g,D,y,H)=>{let re=!1;return H&&(a.value.minDate||a.value.maxDate)?a.value.minDate&&a.value.maxDate?re=v(g,D,y):(a.value.minDate&&C(g,D)||a.value.maxDate&&m(g,D))&&(re=!0):re=!0,re},k=g=>Array.isArray(a.value.allowedDates)&&!a.value.allowedDates.length?!0:a.value.allowedDates?!Aa(g,a.value.allowedDates):!1,Y=g=>!c(g),f=g=>n.value.noDisabledRange?!er({start:g[0],end:g[1]}).some(D=>Y(D)):!0,S=g=>{if(g){const D=he(g);return D>=+e.yearRange[0]&&D<=e.yearRange[1]}return!0},I=(g,D)=>!!(Array.isArray(g)&&g[D]&&(n.value.maxRange||n.value.minRange)&&S(g[D])),U=(g,D,y=0)=>{if(I(D,y)&&S(g)){const H=Jn(g,D[y]),re=kr(D[y],g),R=re.length===1?0:re.filter(oe=>Y(oe)).length,b=Math.abs(H)-(n.value.minMaxRawRange?0:R);if(n.value.minRange&&n.value.maxRange)return b>=+n.value.minRange&&b<=+n.value.maxRange;if(n.value.minRange)return b>=+n.value.minRange;if(n.value.maxRange)return b<=+n.value.maxRange}return!0},A=()=>!e.enableTimePicker||e.monthPicker||e.yearPicker||e.ignoreTimeValidation,q=g=>Array.isArray(g)?[g[0]?Ga(g[0]):null,g[1]?Ga(g[1]):null]:Ga(g),ae=(g,D,y)=>g.find(H=>+H.hours===Tt(D)&&H.minutes==="*"?!0:+H.minutes===Rt(D)&&+H.hours===Tt(D))&&y,E=(g,D,y)=>{const[H,re]=g,[R,b]=D;return!ae(H,R,y)&&!ae(re,b,y)&&y},B=(g,D)=>{const y=Array.isArray(D)?D:[D];return Array.isArray(e.disabledTimes)?Array.isArray(e.disabledTimes[0])?E(e.disabledTimes,y,g):!y.some(H=>ae(e.disabledTimes,H,g)):g},ne=(g,D)=>{const y=Array.isArray(D)?[Ft(D[0]),D[1]?Ft(D[1]):void 0]:Ft(D),H=!e.disabledTimes(y);return g&&H},F=(g,D)=>e.disabledTimes?Array.isArray(e.disabledTimes)?B(D,g):ne(D,g):D,N=g=>{let D=!0;if(!g||A())return!0;const y=!a.value.minDate&&!a.value.maxDate?q(g):g;return(e.maxTime||a.value.maxDate)&&(D=qn(e.maxTime,a.value.maxDate,"max",qe(y),D)),(e.minTime||a.value.minDate)&&(D=qn(e.minTime,a.value.minDate,"min",qe(y),D)),F(g,D)},ie=g=>{if(!e.monthPicker)return!0;let D=!0;const y=Q(pt(g));if(a.value.minDate&&a.value.maxDate){const H=Q(pt(a.value.minDate)),re=Q(pt(a.value.maxDate));return Ne(y,H)&&Ie(y,re)||Me(y,H)||Me(y,re)}if(a.value.minDate){const H=Q(pt(a.value.minDate));D=Ne(y,H)||Me(y,H)}if(a.value.maxDate){const H=Q(pt(a.value.maxDate));D=Ie(y,H)||Me(y,H)}return D},ce=G(()=>g=>!e.enableTimePicker||e.ignoreTimeValidation?!0:N(g)),pe=G(()=>g=>e.monthPicker?Array.isArray(g)&&(n.value.enabled||r.value.enabled)?!g.filter(D=>!ie(D)).length:ie(g):!0);return{isDisabled:Y,validateDate:c,validateMonthYearInRange:h,isDateRangeAllowed:f,checkMinMaxRange:U,isValidTime:N,isTimeValid:ce,isMonthValid:pe}},Ia=()=>{const e=G(()=>(a,r)=>a?.includes(r)),t=G(()=>(a,r)=>a.count?a.solo?!0:r===0:!0),n=G(()=>(a,r)=>a.count?a.solo?!0:r===a.count-1:!0);return{hideNavigationButtons:e,showLeftIcon:t,showRightIcon:n}},Es=(e,t,n)=>{const a=Z(0),r=ha({[Vt.timePicker]:!e.enableTimePicker||e.timePicker||e.monthPicker,[Vt.calendar]:!1,[Vt.header]:!1}),l=G(()=>e.monthPicker||e.timePicker),i=v=>{var h;if((h=e.flow)!=null&&h.length){if(!v&&l.value)return m();r[v]=!0,Object.keys(r).filter(k=>!r[k]).length||m()}},p=()=>{var v,h;(v=e.flow)!=null&&v.length&&a.value!==-1&&(a.value+=1,t("flow-step",a.value),m()),((h=e.flow)==null?void 0:h.length)===a.value&&it().then(()=>c())},c=()=>{a.value=-1},C=(v,h,...k)=>{var Y,f;e.flow[a.value]===v&&n.value&&((f=(Y=n.value)[h])==null||f.call(Y,...k))},m=(v=0)=>{v&&(a.value+=v),C(Xe.month,"toggleMonthPicker",!0),C(Xe.year,"toggleYearPicker",!0),C(Xe.calendar,"toggleTimePicker",!1,!0),C(Xe.time,"toggleTimePicker",!0,!0);const h=e.flow[a.value];(h===Xe.hours||h===Xe.minutes||h===Xe.seconds)&&C(h,"toggleTimePicker",!0,!0,h)};return{childMount:i,updateFlowStep:p,resetFlow:c,handleFlow:m,flowStep:a}},Bs={key:1,class:"dp__input_wrap"},Ns=["id","name","inputmode","placeholder","disabled","readonly","required","value","autocomplete","aria-label","aria-disabled","aria-invalid"],Ls={key:2,class:"dp--clear-btn"},Hs=["aria-label"],Vs=ze({compatConfig:{MODE:3},__name:"DatepickerInput",props:{isMenuOpen:{type:Boolean,default:!1},inputValue:{type:String,default:""},...Ya},emits:["clear","open","update:input-value","set-input-date","close","select-date","set-empty-date","toggle","focus-prev","focus","blur","real-blur","text-input"],setup(e,{expose:t,emit:n}){const a=n,r=e,{defaultedTextInput:l,defaultedAriaLabels:i,defaultedInline:p,defaultedConfig:c,defaultedRange:C,defaultedMultiDates:m,defaultedUI:v,getDefaultPattern:h,getDefaultStartTime:k}=Se(r),{checkMinMaxRange:Y}=Et(r),f=Z(),S=Z(null),I=Z(!1),U=Z(!1),A=G(()=>({dp__pointer:!r.disabled&&!r.readonly&&!l.value.enabled,dp__disabled:r.disabled,dp__input_readonly:!l.value.enabled,dp__input:!0,dp__input_icon_pad:!r.hideInputIcon,dp__input_valid:typeof r.state=="boolean"?r.state:!1,dp__input_invalid:typeof r.state=="boolean"?!r.state:!1,dp__input_focus:I.value||r.isMenuOpen,dp__input_reg:!l.value.enabled,...v.value.input??{}})),q=()=>{a("set-input-date",null),r.clearable&&r.autoApply&&(a("set-empty-date"),f.value=null)},ae=b=>{const oe=k();return ii(b,l.value.format??h(),oe??xr({},r.enableSeconds),r.inputValue,U.value,r.formatLocale)},E=b=>{const{rangeSeparator:oe}=l.value,[V,M]=b.split(`${oe}`);if(V){const o=ae(V.trim()),w=M?ae(M.trim()):null;if(Kt(o,w))return;const z=o&&w?[o,w]:[o];Y(w,z,0)&&(f.value=o?z:null)}},B=()=>{U.value=!0},ne=b=>{if(C.value.enabled)E(b);else if(m.value.enabled){const oe=b.split(";");f.value=oe.map(V=>ae(V.trim())).filter(V=>V)}else f.value=ae(b)},F=b=>{var oe;const V=typeof b=="string"?b:(oe=b.target)==null?void 0:oe.value;V!==""?(l.value.openMenu&&!r.isMenuOpen&&a("open"),ne(V),a("set-input-date",f.value)):q(),U.value=!1,a("update:input-value",V),a("text-input",b,f.value)},N=b=>{l.value.enabled?(ne(b.target.value),l.value.enterSubmit&&sn(f.value)&&r.inputValue!==""?(a("set-input-date",f.value,!0),f.value=null):l.value.enterSubmit&&r.inputValue===""&&(f.value=null,a("clear"))):pe(b)},ie=(b,oe)=>{l.value.enabled&&l.value.tabSubmit&&!oe&&ne(b.target.value),l.value.tabSubmit&&sn(f.value)&&r.inputValue!==""?(a("set-input-date",f.value,!0,!0),f.value=null):l.value.tabSubmit&&r.inputValue===""&&(f.value=null,a("clear",!0))},ce=()=>{I.value=!0,a("focus"),it().then(()=>{var b;l.value.enabled&&l.value.selectOnFocus&&((b=S.value)==null||b.select())})},pe=b=>{if(Yt(b,c.value,!0),l.value.enabled&&l.value.openMenu&&!p.value.input){if(l.value.openMenu==="open"&&!r.isMenuOpen)return a("open");if(l.value.openMenu==="toggle")return a("toggle")}else l.value.enabled||a("toggle")},g=()=>{a("real-blur"),I.value=!1,(!r.isMenuOpen||p.value.enabled&&p.value.input)&&a("blur"),r.autoApply&&l.value.enabled&&f.value&&!r.isMenuOpen&&(a("set-input-date",f.value),a("select-date"),f.value=null)},D=b=>{Yt(b,c.value,!0),a("clear")},y=b=>{if(b.key==="Tab"&&ie(b),b.key==="Enter"&&N(b),!l.value.enabled){if(b.code==="Tab")return;b.preventDefault()}},H=()=>{var b;(b=S.value)==null||b.focus({preventScroll:!0})},re=b=>{f.value=b},R=b=>{b.key===$e.tab&&ie(b,!0)};return t({focusInput:H,setParsedDate:re}),(b,oe)=>{var V,M,o;return P(),W("div",{onClick:pe},[b.$slots.trigger&&!b.$slots["dp-input"]&&!d(p).enabled?ue(b.$slots,"trigger",{key:0}):j("",!0),!b.$slots.trigger&&(!d(p).enabled||d(p).input)?(P(),W("div",Bs,[b.$slots["dp-input"]&&!b.$slots.trigger&&(!d(p).enabled||d(p).enabled&&d(p).input)?ue(b.$slots,"dp-input",{key:0,value:e.inputValue,isMenuOpen:e.isMenuOpen,onInput:F,onEnter:N,onTab:ie,onClear:D,onBlur:g,onKeypress:y,onPaste:B,onFocus:ce,openMenu:()=>b.$emit("open"),closeMenu:()=>b.$emit("close"),toggleMenu:()=>b.$emit("toggle")}):j("",!0),b.$slots["dp-input"]?j("",!0):(P(),W("input",{key:1,id:b.uid?`dp-input-${b.uid}`:void 0,ref_key:"inputRef",ref:S,"data-test":"dp-input",name:b.name,class:ke(A.value),inputmode:d(l).enabled?"text":"none",placeholder:b.placeholder,disabled:b.disabled,readonly:b.readonly,required:b.required,value:e.inputValue,autocomplete:b.autocomplete,"aria-label":(V=d(i))==null?void 0:V.input,"aria-disabled":b.disabled||void 0,"aria-invalid":b.state===!1?!0:void 0,onInput:F,onBlur:g,onFocus:ce,onKeypress:y,onKeydown:oe[0]||(oe[0]=w=>y(w)),onPaste:B},null,42,Ns)),ye("div",{onClick:oe[3]||(oe[3]=w=>a("toggle"))},[b.$slots["input-icon"]&&!b.hideInputIcon?(P(),W("span",{key:0,class:"dp__input_icon",onClick:oe[1]||(oe[1]=w=>a("toggle"))},[ue(b.$slots,"input-icon")])):j("",!0),!b.$slots["input-icon"]&&!b.hideInputIcon&&!b.$slots["dp-input"]?(P(),De(d(aa),{key:1,"aria-label":(M=d(i))==null?void 0:M.calendarIcon,class:"dp__input_icon dp__input_icons",onClick:oe[2]||(oe[2]=w=>a("toggle"))},null,8,["aria-label"])):j("",!0)]),b.$slots["clear-icon"]&&e.inputValue&&b.clearable&&!b.disabled&&!b.readonly?(P(),W("span",Ls,[ue(b.$slots,"clear-icon",{clear:D})])):j("",!0),b.clearable&&!b.$slots["clear-icon"]&&e.inputValue&&!b.disabled&&!b.readonly?(P(),W("button",{key:3,"aria-label":(o=d(i))==null?void 0:o.clearInput,class:"dp--clear-btn",type:"button",onKeydown:oe[4]||(oe[4]=w=>d(et)(w,()=>D(w),!0,R)),onClick:oe[5]||(oe[5]=va(w=>D(w),["prevent"]))},[ot(d(fr),{class:"dp__input_icons","data-test":"clear-icon"})],40,Hs)):j("",!0)])):j("",!0)])}}}),Fs=typeof window<"u"?window:void 0,tn=()=>{},qs=e=>Fr()?(qr(e),!0):!1,Ws=(e,t,n,a)=>{if(!e)return tn;let r=tn;const l=ct(()=>d(e),p=>{r(),p&&(p.addEventListener(t,n,a),r=()=>{p.removeEventListener(t,n,a),r=tn})},{immediate:!0,flush:"post"}),i=()=>{l(),r()};return qs(i),i},Qs=(e,t,n,a={})=>{const{window:r=Fs,event:l="pointerdown"}=a;return r?Ws(r,l,i=>{const p=Fe(e),c=Fe(t);!p||!c||p===i.target||i.composedPath().includes(p)||i.composedPath().includes(c)||n(i)},{passive:!0}):void 0},zs=ze({compatConfig:{MODE:3},__name:"VueDatePicker",props:{...Ya},emits:["update:model-value","update:model-timezone-value","text-submit","closed","cleared","open","focus","blur","internal-model-change","recalculate-position","flow-step","update-month-year","invalid-select","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","date-update","invalid-date","overlay-toggle","text-input"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=qt(),i=Z(!1),p=ca(r,"modelValue"),c=ca(r,"timezone"),C=Z(null),m=Z(null),v=Z(null),h=Z(!1),k=Z(null),Y=Z(!1),f=Z(!1),S=Z(!1),I=Z(!1),{setMenuFocused:U,setShiftKey:A}=Ar(),{clearArrowNav:q}=It(),{validateDate:ae,isValidTime:E}=Et(r),{defaultedTransitions:B,defaultedTextInput:ne,defaultedInline:F,defaultedConfig:N,defaultedRange:ie,defaultedMultiDates:ce}=Se(r),{menuTransition:pe,showTransition:g}=ga(B);Ke(()=>{w(r.modelValue),it().then(()=>{if(!F.value.enabled){const O=oe(k.value);O?.addEventListener("scroll",J),window?.addEventListener("resize",$)}}),F.value.enabled&&(i.value=!0),window?.addEventListener("keyup",ge),window?.addEventListener("keydown",x)}),Ca(()=>{if(!F.value.enabled){const O=oe(k.value);O?.removeEventListener("scroll",J),window?.removeEventListener("resize",$)}window?.removeEventListener("keyup",ge),window?.removeEventListener("keydown",x)});const D=lt(l,"all",r.presetDates),y=lt(l,"input");ct([p,c],()=>{w(p.value)},{deep:!0});const{openOnTop:H,menuStyle:re,xCorrect:R,setMenuPosition:b,getScrollableParent:oe,shadowRender:V}=Ys({menuRef:C,menuRefInner:m,inputRef:v,pickerWrapperRef:k,inline:F,emit:a,props:r,slots:l}),{inputValue:M,internalModelValue:o,parseExternalModelValue:w,emitModelValue:z,formatInputValue:u,checkBeforeEmit:le}=$i(a,r,h),fe=G(()=>({dp__main:!0,dp__theme_dark:r.dark,dp__theme_light:!r.dark,dp__flex_display:F.value.enabled,"dp--flex-display-collapsed":S.value,dp__flex_display_with_input:F.value.input})),Ve=G(()=>r.dark?"dp__theme_dark":"dp__theme_light"),T=G(()=>r.teleport?{to:typeof r.teleport=="boolean"?"body":r.teleport,disabled:!r.teleport||F.value.enabled}:{}),K=G(()=>({class:"dp__outer_menu_wrap"})),s=G(()=>F.value.enabled&&(r.timePicker||r.monthPicker||r.yearPicker||r.quarterPicker)),L=()=>{var O,ee;return(ee=(O=v.value)==null?void 0:O.$el)==null?void 0:ee.getBoundingClientRect()},J=()=>{i.value&&(N.value.closeOnScroll?rt():b())},$=()=>{var O;i.value&&b();const ee=(O=m.value)==null?void 0:O.$el.getBoundingClientRect().width;S.value=document.body.offsetWidth<=ee},ge=O=>{O.key==="Tab"&&!F.value.enabled&&!r.teleport&&N.value.tabOutClosesMenu&&(k.value.contains(document.activeElement)||rt()),f.value=O.shiftKey},x=O=>{f.value=O.shiftKey},X=()=>{!r.disabled&&!r.readonly&&(V(Un,r),b(!1),i.value=!0,i.value&&a("open"),i.value||na(),w(r.modelValue))},de=()=>{var O;M.value="",na(),(O=v.value)==null||O.setParsedDate(null),a("update:model-value",null),a("update:model-timezone-value",null),a("cleared"),N.value.closeOnClearValue&&rt()},be=()=>{const O=o.value;return!O||!Array.isArray(O)&&ae(O)?!0:Array.isArray(O)?ce.value.enabled||O.length===2&&ae(O[0])&&ae(O[1])?!0:ie.value.partialRange&&!r.timePicker?ae(O[0]):!1:!1},st=()=>{le()&&be()?(z(),rt()):a("invalid-select",o.value)},me=O=>{Pt(),z(),N.value.closeOnAutoApply&&!O&&rt()},Pt=()=>{v.value&&ne.value.enabled&&v.value.setParsedDate(o.value)},gt=(O=!1)=>{r.autoApply&&E(o.value)&&be()&&(ie.value.enabled&&Array.isArray(o.value)?(ie.value.partialRange||o.value.length===2)&&me(O):me(O))},na=()=>{ne.value.enabled||(o.value=null)},rt=()=>{F.value.enabled||(i.value&&(i.value=!1,R.value=!1,U(!1),A(!1),q(),a("closed"),M.value&&w(p.value)),na(),a("blur"))},ra=(O,ee,se=!1)=>{if(!O){o.value=null;return}const Je=Array.isArray(O)?!O.some(Bt=>!ae(Bt)):ae(O),ut=E(O);Je&&ut?(I.value=!0,o.value=O,ee&&(Y.value=se,st(),a("text-submit")),it().then(()=>{I.value=!1})):a("invalid-date",O)},Ea=()=>{r.autoApply&&E(o.value)&&z(),Pt()},wa=()=>i.value?rt():X(),Ba=O=>{o.value=O},Na=()=>{ne.value.enabled&&(h.value=!0,u()),a("focus")},La=()=>{if(ne.value.enabled&&(h.value=!1,w(r.modelValue),Y.value)){const O=li(k.value,f.value);O?.focus()}a("blur")},Ha=O=>{m.value&&m.value.updateMonthYear(0,{month:Ln(O.month),year:Ln(O.year)})},Va=O=>{w(O??r.modelValue)},Fa=(O,ee)=>{var se;(se=m.value)==null||se.switchView(O,ee)},_=O=>N.value.onClickOutside?N.value.onClickOutside(O):rt(),te=(O=0)=>{var ee;(ee=m.value)==null||ee.handleFlow(O)};return Qs(C,v,()=>_(be)),t({closeMenu:rt,selectDate:st,clearValue:de,openMenu:X,onScroll:J,formatInputValue:u,updateInternalModelValue:Ba,setMonthYear:Ha,parseModel:Va,switchView:Fa,toggleMenu:wa,handleFlow:te,dpWrapMenuRef:C}),(O,ee)=>(P(),W("div",{ref_key:"pickerWrapperRef",ref:k,class:ke(fe.value),"data-datepicker-instance":""},[ot(Vs,Qe({ref_key:"inputRef",ref:v,"input-value":d(M),"onUpdate:inputValue":ee[0]||(ee[0]=se=>Pn(M)?M.value=se:null),"is-menu-open":i.value},O.$props,{onClear:de,onOpen:X,onSetInputDate:ra,onSetEmptyDate:d(z),onSelectDate:st,onToggle:wa,onClose:rt,onFocus:Na,onBlur:La,onRealBlur:ee[1]||(ee[1]=se=>h.value=!1),onTextInput:ee[2]||(ee[2]=se=>O.$emit("text-input",se))}),je({_:2},[Ye(d(y),(se,Je)=>({name:se,fn:_e(ut=>[ue(O.$slots,se,We(at(ut)))])}))]),1040,["input-value","is-menu-open","onSetEmptyDate"]),(P(),De(Oa(O.teleport?Br:"div"),We(at(T.value)),{default:_e(()=>[ot(ta,{name:d(pe)(d(H)),css:d(g)&&!d(F).enabled},{default:_e(()=>[i.value?(P(),W("div",Qe({key:0,ref_key:"dpWrapMenuRef",ref:C},K.value,{class:{"dp--menu-wrapper":!d(F).enabled},style:d(F).enabled?void 0:d(re)}),[ot(Un,Qe({ref_key:"dpMenuRef",ref:m},O.$props,{"internal-model-value":d(o),"onUpdate:internalModelValue":ee[3]||(ee[3]=se=>Pn(o)?o.value=se:null),class:{[Ve.value]:!0,"dp--menu-wrapper":O.teleport},"open-on-top":d(H),"no-overlay-focus":s.value,collapse:S.value,"get-input-rect":L,"is-text-input-date":I.value,onClosePicker:rt,onSelectDate:st,onAutoApply:gt,onTimeUpdate:Ea,onFlowStep:ee[4]||(ee[4]=se=>O.$emit("flow-step",se)),onUpdateMonthYear:ee[5]||(ee[5]=se=>O.$emit("update-month-year",se)),onInvalidSelect:ee[6]||(ee[6]=se=>O.$emit("invalid-select",d(o))),onAutoApplyInvalid:ee[7]||(ee[7]=se=>O.$emit("invalid-select",se)),onInvalidFixedRange:ee[8]||(ee[8]=se=>O.$emit("invalid-fixed-range",se)),onRecalculatePosition:d(b),onTooltipOpen:ee[9]||(ee[9]=se=>O.$emit("tooltip-open",se)),onTooltipClose:ee[10]||(ee[10]=se=>O.$emit("tooltip-close",se)),onTimePickerOpen:ee[11]||(ee[11]=se=>O.$emit("time-picker-open",se)),onTimePickerClose:ee[12]||(ee[12]=se=>O.$emit("time-picker-close",se)),onAmPmChange:ee[13]||(ee[13]=se=>O.$emit("am-pm-change",se)),onRangeStart:ee[14]||(ee[14]=se=>O.$emit("range-start",se)),onRangeEnd:ee[15]||(ee[15]=se=>O.$emit("range-end",se)),onDateUpdate:ee[16]||(ee[16]=se=>O.$emit("date-update",se)),onInvalidDate:ee[17]||(ee[17]=se=>O.$emit("invalid-date",se)),onOverlayToggle:ee[18]||(ee[18]=se=>O.$emit("overlay-toggle",se))}),je({_:2},[Ye(d(D),(se,Je)=>({name:se,fn:_e(ut=>[ue(O.$slots,se,We(at({...ut})))])}))]),1040,["internal-model-value","class","open-on-top","no-overlay-focus","collapse","is-text-input-date","onRecalculatePosition"])],16)):j("",!0)]),_:3},8,["name","css"])]),_:3},16))],2))}}),Ir=(()=>{const e=zs;return e.install=t=>{t.component("Vue3DatePicker",e)},e})(),Us=Object.freeze(Object.defineProperty({__proto__:null,default:Ir},Symbol.toStringTag,{value:"Module"}));Object.entries(Us).forEach(([e,t])=>{e!=="default"&&(Ir[e]=t)});export{Ir as V}; +import{C as ha,r as Z,K as ze,a1 as qt,a2 as ca,o as Ke,Q as it,O as Ca,E as ct,x as G,a as P,c as W,d as ot,a3 as je,h as Ye,w as _e,a4 as ue,a5 as We,a6 as at,B as d,a7 as Qe,a8 as Pn,i as De,T as ta,e as j,l as Oa,a9 as Br,n as ke,b as ye,F as we,z as dt,aa as va,t as Ge,M as Nr,ab as An,ac as Lr,f as Dt,ad as Hr,m as Ma,ae as Da,A as Vr,I as Fr,J as qr}from"./index-DOaPWS1X.js";function ve(e){const t=Object.prototype.toString.call(e);return e instanceof Date||typeof e=="object"&&t==="[object Date]"?new e.constructor(+e):typeof e=="number"||t==="[object Number]"||typeof e=="string"||t==="[object String]"?new Date(e):new Date(NaN)}function Te(e,t){return e instanceof Date?new e.constructor(t):new Date(t)}function mt(e,t){const n=ve(e);return isNaN(t)?Te(e,NaN):(t&&n.setDate(n.getDate()+t),n)}function ft(e,t){const n=ve(e);if(isNaN(t))return Te(e,NaN);if(!t)return n;const a=n.getDate(),r=Te(e,n.getTime());r.setMonth(n.getMonth()+t+1,0);const l=r.getDate();return a>=l?r:(n.setFullYear(r.getFullYear(),r.getMonth(),a),n)}function Xn(e,t){const{years:n=0,months:a=0,weeks:r=0,days:l=0,hours:i=0,minutes:p=0,seconds:c=0}=t,C=ve(e),m=a||n?ft(C,a+n*12):C,v=l||r?mt(m,l+r*7):m,h=p+i*60,Y=(c+h*60)*1e3;return Te(e,v.getTime()+Y)}function Wr(e,t){const n=+ve(e);return Te(e,n+t)}const Gn=6048e5,Qr=864e5,zr=6e4,jn=36e5,Ur=1e3;function Xr(e,t){return Wr(e,t*jn)}let Gr={};function Wt(){return Gr}function ht(e,t){const n=Wt(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=ve(e),l=r.getDay(),i=(l=r.getTime()?n+1:t.getTime()>=i.getTime()?n:n-1}function Cn(e){const t=ve(e);return t.setHours(0,0,0,0),t}function Ta(e){const t=ve(e),n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return n.setUTCFullYear(t.getFullYear()),+e-+n}function Jn(e,t){const n=Cn(e),a=Cn(t),r=+n-Ta(n),l=+a-Ta(a);return Math.round((r-l)/Qr)}function jr(e){const t=Kn(e),n=Te(e,0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),Gt(n)}function Kr(e,t){const n=t*3;return ft(e,n)}function un(e,t){return ft(e,t*12)}function On(e,t){const n=ve(e),a=ve(t),r=n.getTime()-a.getTime();return r<0?-1:r>0?1:r}function Zn(e){return e instanceof Date||typeof e=="object"&&Object.prototype.toString.call(e)==="[object Date]"}function ua(e){if(!Zn(e)&&typeof e!="number")return!1;const t=ve(e);return!isNaN(Number(t))}function $n(e){const t=ve(e);return Math.trunc(t.getMonth()/3)+1}function Jr(e,t){const n=ve(e),a=ve(t);return n.getFullYear()-a.getFullYear()}function Zr(e,t){const n=ve(e),a=ve(t),r=On(n,a),l=Math.abs(Jr(n,a));n.setFullYear(1584),a.setFullYear(1584);const i=On(n,a)===-r,p=r*(l-+i);return p===0?0:p}function er(e,t){const n=ve(e.start),a=ve(e.end);let r=+n>+a;const l=r?+n:+a,i=r?a:n;i.setHours(0,0,0,0);let p=1;const c=[];for(;+i<=l;)c.push(ve(i)),i.setDate(i.getDate()+p),i.setHours(0,0,0,0);return r?c.reverse():c}function Ht(e){const t=ve(e),n=t.getMonth(),a=n-n%3;return t.setMonth(a,1),t.setHours(0,0,0,0),t}function el(e,t){const n=ve(e.start),a=ve(e.end);let r=+n>+a;const l=r?+Ht(n):+Ht(a);let i=Ht(r?a:n),p=1;const c=[];for(;+i<=l;)c.push(ve(i)),i=Kr(i,p);return r?c.reverse():c}function tl(e){const t=ve(e);return t.setDate(1),t.setHours(0,0,0,0),t}function tr(e){const t=ve(e),n=t.getFullYear();return t.setFullYear(n+1,0,0),t.setHours(23,59,59,999),t}function ma(e){const t=ve(e),n=Te(e,0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function ar(e,t){const n=Wt(),a=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,r=ve(e),l=r.getDay(),i=(l{let a;const r=al[e];return typeof r=="string"?a=r:t===1?a=r.one:a=r.other.replace("{{count}}",t.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+a:a+" ago":a};function Wa(e){return(t={})=>{const n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}const rl={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},ll={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},ol={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},il={date:Wa({formats:rl,defaultWidth:"full"}),time:Wa({formats:ll,defaultWidth:"full"}),dateTime:Wa({formats:ol,defaultWidth:"full"})},sl={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},ul=(e,t,n,a)=>sl[e];function oa(e){return(t,n)=>{const a=n?.context?String(n.context):"standalone";let r;if(a==="formatting"&&e.formattingValues){const i=e.defaultFormattingWidth||e.defaultWidth,p=n?.width?String(n.width):i;r=e.formattingValues[p]||e.formattingValues[i]}else{const i=e.defaultWidth,p=n?.width?String(n.width):e.defaultWidth;r=e.values[p]||e.values[i]}const l=e.argumentCallback?e.argumentCallback(t):t;return r[l]}}const dl={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},cl={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},vl={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},ml={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},pl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},fl={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},hl=(e,t)=>{const n=Number(e),a=n%100;if(a>20||a<10)switch(a%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},yl={ordinalNumber:hl,era:oa({values:dl,defaultWidth:"wide"}),quarter:oa({values:cl,defaultWidth:"wide",argumentCallback:e=>e-1}),month:oa({values:vl,defaultWidth:"wide"}),day:oa({values:ml,defaultWidth:"wide"}),dayPeriod:oa({values:pl,defaultWidth:"wide",formattingValues:fl,defaultFormattingWidth:"wide"})};function ia(e){return(t,n={})=>{const a=n.width,r=a&&e.matchPatterns[a]||e.matchPatterns[e.defaultMatchWidth],l=t.match(r);if(!l)return null;const i=l[0],p=a&&e.parsePatterns[a]||e.parsePatterns[e.defaultParseWidth],c=Array.isArray(p)?bl(p,v=>v.test(i)):gl(p,v=>v.test(i));let C;C=e.valueCallback?e.valueCallback(c):c,C=n.valueCallback?n.valueCallback(C):C;const m=t.slice(i.length);return{value:C,rest:m}}}function gl(e,t){for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t(e[n]))return n}function bl(e,t){for(let n=0;n{const a=t.match(e.matchPattern);if(!a)return null;const r=a[0],l=t.match(e.parsePattern);if(!l)return null;let i=e.valueCallback?e.valueCallback(l[0]):l[0];i=n.valueCallback?n.valueCallback(i):i;const p=t.slice(r.length);return{value:i,rest:p}}}const _l=/^(\d+)(th|st|nd|rd)?/i,kl=/\d+/i,xl={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},Ml={any:[/^b/i,/^(a|c)/i]},Dl={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},Tl={any:[/1/i,/2/i,/3/i,/4/i]},Pl={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},Al={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},Cl={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},Ol={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},$l={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},Yl={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},Sl={ordinalNumber:wl({matchPattern:_l,parsePattern:kl,valueCallback:e=>parseInt(e,10)}),era:ia({matchPatterns:xl,defaultMatchWidth:"wide",parsePatterns:Ml,defaultParseWidth:"any"}),quarter:ia({matchPatterns:Dl,defaultMatchWidth:"wide",parsePatterns:Tl,defaultParseWidth:"any",valueCallback:e=>e+1}),month:ia({matchPatterns:Pl,defaultMatchWidth:"wide",parsePatterns:Al,defaultParseWidth:"any"}),day:ia({matchPatterns:Cl,defaultMatchWidth:"wide",parsePatterns:Ol,defaultParseWidth:"any"}),dayPeriod:ia({matchPatterns:$l,defaultMatchWidth:"any",parsePatterns:Yl,defaultParseWidth:"any"})},nr={code:"en-US",formatDistance:nl,formatLong:il,formatRelative:ul,localize:yl,match:Sl,options:{weekStartsOn:0,firstWeekContainsDate:1}};function Rl(e){const t=ve(e);return Jn(t,ma(t))+1}function dn(e){const t=ve(e),n=+Gt(t)-+jr(t);return Math.round(n/Gn)+1}function cn(e,t){const n=ve(e),a=n.getFullYear(),r=Wt(),l=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=Te(e,0);i.setFullYear(a+1,0,l),i.setHours(0,0,0,0);const p=ht(i,t),c=Te(e,0);c.setFullYear(a,0,l),c.setHours(0,0,0,0);const C=ht(c,t);return n.getTime()>=p.getTime()?a+1:n.getTime()>=C.getTime()?a:a-1}function Il(e,t){const n=Wt(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,r=cn(e,t),l=Te(e,0);return l.setFullYear(r,0,a),l.setHours(0,0,0,0),ht(l,t)}function vn(e,t){const n=ve(e),a=+ht(n,t)-+Il(n,t);return Math.round(a/Gn)+1}function Ae(e,t){const n=e<0?"-":"",a=Math.abs(e).toString().padStart(t,"0");return n+a}const Ct={y(e,t){const n=e.getFullYear(),a=n>0?n:1-n;return Ae(t==="yy"?a%100:a,t.length)},M(e,t){const n=e.getMonth();return t==="M"?String(n+1):Ae(n+1,2)},d(e,t){return Ae(e.getDate(),t.length)},a(e,t){const n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];case"aaaa":default:return n==="am"?"a.m.":"p.m."}},h(e,t){return Ae(e.getHours()%12||12,t.length)},H(e,t){return Ae(e.getHours(),t.length)},m(e,t){return Ae(e.getMinutes(),t.length)},s(e,t){return Ae(e.getSeconds(),t.length)},S(e,t){const n=t.length,a=e.getMilliseconds(),r=Math.trunc(a*Math.pow(10,n-3));return Ae(r,t.length)}},Qt={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Sn={G:function(e,t,n){const a=e.getFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(a,{width:"abbreviated"});case"GGGGG":return n.era(a,{width:"narrow"});case"GGGG":default:return n.era(a,{width:"wide"})}},y:function(e,t,n){if(t==="yo"){const a=e.getFullYear(),r=a>0?a:1-a;return n.ordinalNumber(r,{unit:"year"})}return Ct.y(e,t)},Y:function(e,t,n,a){const r=cn(e,a),l=r>0?r:1-r;if(t==="YY"){const i=l%100;return Ae(i,2)}return t==="Yo"?n.ordinalNumber(l,{unit:"year"}):Ae(l,t.length)},R:function(e,t){const n=Kn(e);return Ae(n,t.length)},u:function(e,t){const n=e.getFullYear();return Ae(n,t.length)},Q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(a);case"QQ":return Ae(a,2);case"Qo":return n.ordinalNumber(a,{unit:"quarter"});case"QQQ":return n.quarter(a,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(a,{width:"narrow",context:"formatting"});case"QQQQ":default:return n.quarter(a,{width:"wide",context:"formatting"})}},q:function(e,t,n){const a=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(a);case"qq":return Ae(a,2);case"qo":return n.ordinalNumber(a,{unit:"quarter"});case"qqq":return n.quarter(a,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(a,{width:"narrow",context:"standalone"});case"qqqq":default:return n.quarter(a,{width:"wide",context:"standalone"})}},M:function(e,t,n){const a=e.getMonth();switch(t){case"M":case"MM":return Ct.M(e,t);case"Mo":return n.ordinalNumber(a+1,{unit:"month"});case"MMM":return n.month(a,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(a,{width:"narrow",context:"formatting"});case"MMMM":default:return n.month(a,{width:"wide",context:"formatting"})}},L:function(e,t,n){const a=e.getMonth();switch(t){case"L":return String(a+1);case"LL":return Ae(a+1,2);case"Lo":return n.ordinalNumber(a+1,{unit:"month"});case"LLL":return n.month(a,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(a,{width:"narrow",context:"standalone"});case"LLLL":default:return n.month(a,{width:"wide",context:"standalone"})}},w:function(e,t,n,a){const r=vn(e,a);return t==="wo"?n.ordinalNumber(r,{unit:"week"}):Ae(r,t.length)},I:function(e,t,n){const a=dn(e);return t==="Io"?n.ordinalNumber(a,{unit:"week"}):Ae(a,t.length)},d:function(e,t,n){return t==="do"?n.ordinalNumber(e.getDate(),{unit:"date"}):Ct.d(e,t)},D:function(e,t,n){const a=Rl(e);return t==="Do"?n.ordinalNumber(a,{unit:"dayOfYear"}):Ae(a,t.length)},E:function(e,t,n){const a=e.getDay();switch(t){case"E":case"EE":case"EEE":return n.day(a,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(a,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(a,{width:"short",context:"formatting"});case"EEEE":default:return n.day(a,{width:"wide",context:"formatting"})}},e:function(e,t,n,a){const r=e.getDay(),l=(r-a.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return Ae(l,2);case"eo":return n.ordinalNumber(l,{unit:"day"});case"eee":return n.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(r,{width:"short",context:"formatting"});case"eeee":default:return n.day(r,{width:"wide",context:"formatting"})}},c:function(e,t,n,a){const r=e.getDay(),l=(r-a.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return Ae(l,t.length);case"co":return n.ordinalNumber(l,{unit:"day"});case"ccc":return n.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(r,{width:"narrow",context:"standalone"});case"cccccc":return n.day(r,{width:"short",context:"standalone"});case"cccc":default:return n.day(r,{width:"wide",context:"standalone"})}},i:function(e,t,n){const a=e.getDay(),r=a===0?7:a;switch(t){case"i":return String(r);case"ii":return Ae(r,t.length);case"io":return n.ordinalNumber(r,{unit:"day"});case"iii":return n.day(a,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(a,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(a,{width:"short",context:"formatting"});case"iiii":default:return n.day(a,{width:"wide",context:"formatting"})}},a:function(e,t,n){const r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){const a=e.getHours();let r;switch(a===12?r=Qt.noon:a===0?r=Qt.midnight:r=a/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){const a=e.getHours();let r;switch(a>=17?r=Qt.evening:a>=12?r=Qt.afternoon:a>=4?r=Qt.morning:r=Qt.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if(t==="ho"){let a=e.getHours()%12;return a===0&&(a=12),n.ordinalNumber(a,{unit:"hour"})}return Ct.h(e,t)},H:function(e,t,n){return t==="Ho"?n.ordinalNumber(e.getHours(),{unit:"hour"}):Ct.H(e,t)},K:function(e,t,n){const a=e.getHours()%12;return t==="Ko"?n.ordinalNumber(a,{unit:"hour"}):Ae(a,t.length)},k:function(e,t,n){let a=e.getHours();return a===0&&(a=24),t==="ko"?n.ordinalNumber(a,{unit:"hour"}):Ae(a,t.length)},m:function(e,t,n){return t==="mo"?n.ordinalNumber(e.getMinutes(),{unit:"minute"}):Ct.m(e,t)},s:function(e,t,n){return t==="so"?n.ordinalNumber(e.getSeconds(),{unit:"second"}):Ct.s(e,t)},S:function(e,t){return Ct.S(e,t)},X:function(e,t,n){const a=e.getTimezoneOffset();if(a===0)return"Z";switch(t){case"X":return In(a);case"XXXX":case"XX":return Nt(a);case"XXXXX":case"XXX":default:return Nt(a,":")}},x:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"x":return In(a);case"xxxx":case"xx":return Nt(a);case"xxxxx":case"xxx":default:return Nt(a,":")}},O:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+Rn(a,":");case"OOOO":default:return"GMT"+Nt(a,":")}},z:function(e,t,n){const a=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+Rn(a,":");case"zzzz":default:return"GMT"+Nt(a,":")}},t:function(e,t,n){const a=Math.trunc(e.getTime()/1e3);return Ae(a,t.length)},T:function(e,t,n){const a=e.getTime();return Ae(a,t.length)}};function Rn(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),r=Math.trunc(a/60),l=a%60;return l===0?n+String(r):n+String(r)+t+Ae(l,2)}function In(e,t){return e%60===0?(e>0?"-":"+")+Ae(Math.abs(e)/60,2):Nt(e,t)}function Nt(e,t=""){const n=e>0?"-":"+",a=Math.abs(e),r=Ae(Math.trunc(a/60),2),l=Ae(a%60,2);return n+r+t+l}const En=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});case"PPPP":default:return t.date({width:"full"})}},rr=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});case"pppp":default:return t.time({width:"full"})}},El=(e,t)=>{const n=e.match(/(P+)(p+)?/)||[],a=n[1],r=n[2];if(!r)return En(e,t);let l;switch(a){case"P":l=t.dateTime({width:"short"});break;case"PP":l=t.dateTime({width:"medium"});break;case"PPP":l=t.dateTime({width:"long"});break;case"PPPP":default:l=t.dateTime({width:"full"});break}return l.replace("{{date}}",En(a,t)).replace("{{time}}",rr(r,t))},an={p:rr,P:El},Bl=/^D+$/,Nl=/^Y+$/,Ll=["D","DD","YY","YYYY"];function lr(e){return Bl.test(e)}function or(e){return Nl.test(e)}function nn(e,t,n){const a=Hl(e,t,n);if(console.warn(a),Ll.includes(e))throw new RangeError(a)}function Hl(e,t,n){const a=e[0]==="Y"?"years":"days of the month";return`Use \`${e.toLowerCase()}\` instead of \`${e}\` (in \`${t}\`) for formatting ${a} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const Vl=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Fl=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ql=/^'([^]*?)'?$/,Wl=/''/g,Ql=/[a-zA-Z]/;function kt(e,t,n){const a=Wt(),r=n?.locale??a.locale??nr,l=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,p=ve(e);if(!ua(p))throw new RangeError("Invalid time value");let c=t.match(Fl).map(m=>{const v=m[0];if(v==="p"||v==="P"){const h=an[v];return h(m,r.formatLong)}return m}).join("").match(Vl).map(m=>{if(m==="''")return{isToken:!1,value:"'"};const v=m[0];if(v==="'")return{isToken:!1,value:zl(m)};if(Sn[v])return{isToken:!0,value:m};if(v.match(Ql))throw new RangeError("Format string contains an unescaped latin alphabet character `"+v+"`");return{isToken:!1,value:m}});r.localize.preprocessor&&(c=r.localize.preprocessor(p,c));const C={firstWeekContainsDate:l,weekStartsOn:i,locale:r};return c.map(m=>{if(!m.isToken)return m.value;const v=m.value;(!n?.useAdditionalWeekYearTokens&&or(v)||!n?.useAdditionalDayOfYearTokens&&lr(v))&&nn(v,t,String(e));const h=Sn[v[0]];return h(p,v,r.localize,C)}).join("")}function zl(e){const t=e.match(ql);return t?t[1].replace(Wl,"'"):e}function Ul(e){return ve(e).getDay()}function Xl(e){const t=ve(e),n=t.getFullYear(),a=t.getMonth(),r=Te(e,0);return r.setFullYear(n,a+1,0),r.setHours(0,0,0,0),r.getDate()}function Gl(){return Object.assign({},Wt())}function Tt(e){return ve(e).getHours()}function jl(e){let n=ve(e).getDay();return n===0&&(n=7),n}function Rt(e){return ve(e).getMinutes()}function xe(e){return ve(e).getMonth()}function jt(e){return ve(e).getSeconds()}function he(e){return ve(e).getFullYear()}function Kt(e,t){const n=ve(e),a=ve(t);return n.getTime()>a.getTime()}function pa(e,t){const n=ve(e),a=ve(t);return+n<+a}function Xt(e,t){const n=ve(e),a=ve(t);return+n==+a}function Kl(e,t){const n=t instanceof Date?Te(t,0):new t(0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}const Jl=10;class ir{subPriority=0;validate(t,n){return!0}}class Zl extends ir{constructor(t,n,a,r,l){super(),this.value=t,this.validateValue=n,this.setValue=a,this.priority=r,l&&(this.subPriority=l)}validate(t,n){return this.validateValue(t,this.value,n)}set(t,n,a){return this.setValue(t,n,this.value,a)}}class eo extends ir{priority=Jl;subPriority=-1;set(t,n){return n.timestampIsSet?t:Te(t,Kl(t,Date))}}class Pe{run(t,n,a,r){const l=this.parse(t,n,a,r);return l?{setter:new Zl(l.value,this.validate,this.set,this.priority,this.subPriority),rest:l.rest}:null}validate(t,n,a){return!0}}class to extends Pe{priority=140;parse(t,n,a){switch(n){case"G":case"GG":case"GGG":return a.era(t,{width:"abbreviated"})||a.era(t,{width:"narrow"});case"GGGGG":return a.era(t,{width:"narrow"});case"GGGG":default:return a.era(t,{width:"wide"})||a.era(t,{width:"abbreviated"})||a.era(t,{width:"narrow"})}}set(t,n,a){return n.era=a,t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["R","u","t","T"]}const Le={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},bt={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function He(e,t){return e&&{value:t(e.value),rest:e.rest}}function Re(e,t){const n=t.match(e);return n?{value:parseInt(n[0],10),rest:t.slice(n[0].length)}:null}function wt(e,t){const n=t.match(e);if(!n)return null;if(n[0]==="Z")return{value:0,rest:t.slice(1)};const a=n[1]==="+"?1:-1,r=n[2]?parseInt(n[2],10):0,l=n[3]?parseInt(n[3],10):0,i=n[5]?parseInt(n[5],10):0;return{value:a*(r*jn+l*zr+i*Ur),rest:t.slice(n[0].length)}}function sr(e){return Re(Le.anyDigitsSigned,e)}function Ee(e,t){switch(e){case 1:return Re(Le.singleDigit,t);case 2:return Re(Le.twoDigits,t);case 3:return Re(Le.threeDigits,t);case 4:return Re(Le.fourDigits,t);default:return Re(new RegExp("^\\d{1,"+e+"}"),t)}}function Pa(e,t){switch(e){case 1:return Re(Le.singleDigitSigned,t);case 2:return Re(Le.twoDigitsSigned,t);case 3:return Re(Le.threeDigitsSigned,t);case 4:return Re(Le.fourDigitsSigned,t);default:return Re(new RegExp("^-?\\d{1,"+e+"}"),t)}}function mn(e){switch(e){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function ur(e,t){const n=t>0,a=n?t:1-t;let r;if(a<=50)r=e||100;else{const l=a+50,i=Math.trunc(l/100)*100,p=e>=l%100;r=e+i-(p?100:0)}return n?r:1-r}function dr(e){return e%400===0||e%4===0&&e%100!==0}class ao extends Pe{priority=130;incompatibleTokens=["Y","R","u","w","I","i","e","c","t","T"];parse(t,n,a){const r=l=>({year:l,isTwoDigitYear:n==="yy"});switch(n){case"y":return He(Ee(4,t),r);case"yo":return He(a.ordinalNumber(t,{unit:"year"}),r);default:return He(Ee(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,a){const r=t.getFullYear();if(a.isTwoDigitYear){const i=ur(a.year,r);return t.setFullYear(i,0,1),t.setHours(0,0,0,0),t}const l=!("era"in n)||n.era===1?a.year:1-a.year;return t.setFullYear(l,0,1),t.setHours(0,0,0,0),t}}class no extends Pe{priority=130;parse(t,n,a){const r=l=>({year:l,isTwoDigitYear:n==="YY"});switch(n){case"Y":return He(Ee(4,t),r);case"Yo":return He(a.ordinalNumber(t,{unit:"year"}),r);default:return He(Ee(n.length,t),r)}}validate(t,n){return n.isTwoDigitYear||n.year>0}set(t,n,a,r){const l=cn(t,r);if(a.isTwoDigitYear){const p=ur(a.year,l);return t.setFullYear(p,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),ht(t,r)}const i=!("era"in n)||n.era===1?a.year:1-a.year;return t.setFullYear(i,0,r.firstWeekContainsDate),t.setHours(0,0,0,0),ht(t,r)}incompatibleTokens=["y","R","u","Q","q","M","L","I","d","D","i","t","T"]}class ro extends Pe{priority=130;parse(t,n){return Pa(n==="R"?4:n.length,t)}set(t,n,a){const r=Te(t,0);return r.setFullYear(a,0,4),r.setHours(0,0,0,0),Gt(r)}incompatibleTokens=["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]}class lo extends Pe{priority=130;parse(t,n){return Pa(n==="u"?4:n.length,t)}set(t,n,a){return t.setFullYear(a,0,1),t.setHours(0,0,0,0),t}incompatibleTokens=["G","y","Y","R","w","I","i","e","c","t","T"]}class oo extends Pe{priority=120;parse(t,n,a){switch(n){case"Q":case"QQ":return Ee(n.length,t);case"Qo":return a.ordinalNumber(t,{unit:"quarter"});case"QQQ":return a.quarter(t,{width:"abbreviated",context:"formatting"})||a.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(t,{width:"wide",context:"formatting"})||a.quarter(t,{width:"abbreviated",context:"formatting"})||a.quarter(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=1&&n<=4}set(t,n,a){return t.setMonth((a-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]}class io extends Pe{priority=120;parse(t,n,a){switch(n){case"q":case"qq":return Ee(n.length,t);case"qo":return a.ordinalNumber(t,{unit:"quarter"});case"qqq":return a.quarter(t,{width:"abbreviated",context:"standalone"})||a.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(t,{width:"wide",context:"standalone"})||a.quarter(t,{width:"abbreviated",context:"standalone"})||a.quarter(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=1&&n<=4}set(t,n,a){return t.setMonth((a-1)*3,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]}class so extends Pe{incompatibleTokens=["Y","R","q","Q","L","w","I","D","i","e","c","t","T"];priority=110;parse(t,n,a){const r=l=>l-1;switch(n){case"M":return He(Re(Le.month,t),r);case"MM":return He(Ee(2,t),r);case"Mo":return He(a.ordinalNumber(t,{unit:"month"}),r);case"MMM":return a.month(t,{width:"abbreviated",context:"formatting"})||a.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(t,{width:"wide",context:"formatting"})||a.month(t,{width:"abbreviated",context:"formatting"})||a.month(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=11}set(t,n,a){return t.setMonth(a,1),t.setHours(0,0,0,0),t}}class uo extends Pe{priority=110;parse(t,n,a){const r=l=>l-1;switch(n){case"L":return He(Re(Le.month,t),r);case"LL":return He(Ee(2,t),r);case"Lo":return He(a.ordinalNumber(t,{unit:"month"}),r);case"LLL":return a.month(t,{width:"abbreviated",context:"standalone"})||a.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(t,{width:"wide",context:"standalone"})||a.month(t,{width:"abbreviated",context:"standalone"})||a.month(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=11}set(t,n,a){return t.setMonth(a,1),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]}function co(e,t,n){const a=ve(e),r=vn(a,n)-t;return a.setDate(a.getDate()-r*7),a}class vo extends Pe{priority=100;parse(t,n,a){switch(n){case"w":return Re(Le.week,t);case"wo":return a.ordinalNumber(t,{unit:"week"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,a,r){return ht(co(t,a,r),r)}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","i","t","T"]}function mo(e,t){const n=ve(e),a=dn(n)-t;return n.setDate(n.getDate()-a*7),n}class po extends Pe{priority=100;parse(t,n,a){switch(n){case"I":return Re(Le.week,t);case"Io":return a.ordinalNumber(t,{unit:"week"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=53}set(t,n,a){return Gt(mo(t,a))}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]}const fo=[31,28,31,30,31,30,31,31,30,31,30,31],ho=[31,29,31,30,31,30,31,31,30,31,30,31];class yo extends Pe{priority=90;subPriority=1;parse(t,n,a){switch(n){case"d":return Re(Le.date,t);case"do":return a.ordinalNumber(t,{unit:"date"});default:return Ee(n.length,t)}}validate(t,n){const a=t.getFullYear(),r=dr(a),l=t.getMonth();return r?n>=1&&n<=ho[l]:n>=1&&n<=fo[l]}set(t,n,a){return t.setDate(a),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","w","I","D","i","e","c","t","T"]}class go extends Pe{priority=90;subpriority=1;parse(t,n,a){switch(n){case"D":case"DD":return Re(Le.dayOfYear,t);case"Do":return a.ordinalNumber(t,{unit:"date"});default:return Ee(n.length,t)}}validate(t,n){const a=t.getFullYear();return dr(a)?n>=1&&n<=366:n>=1&&n<=365}set(t,n,a){return t.setMonth(0,a),t.setHours(0,0,0,0),t}incompatibleTokens=["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]}function pn(e,t,n){const a=Wt(),r=n?.weekStartsOn??n?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,l=ve(e),i=l.getDay(),c=(t%7+7)%7,C=7-r,m=t<0||t>6?t-(i+C)%7:(c+C)%7-(i+C)%7;return mt(l,m)}class bo extends Pe{priority=90;parse(t,n,a){switch(n){case"E":case"EE":case"EEE":return a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(t,{width:"wide",context:"formatting"})||a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,a,r){return t=pn(t,a,r),t.setHours(0,0,0,0),t}incompatibleTokens=["D","i","e","c","t","T"]}class wo extends Pe{priority=90;parse(t,n,a,r){const l=i=>{const p=Math.floor((i-1)/7)*7;return(i+r.weekStartsOn+6)%7+p};switch(n){case"e":case"ee":return He(Ee(n.length,t),l);case"eo":return He(a.ordinalNumber(t,{unit:"day"}),l);case"eee":return a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"eeeee":return a.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(t,{width:"wide",context:"formatting"})||a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"})}}validate(t,n){return n>=0&&n<=6}set(t,n,a,r){return t=pn(t,a,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]}class _o extends Pe{priority=90;parse(t,n,a,r){const l=i=>{const p=Math.floor((i-1)/7)*7;return(i+r.weekStartsOn+6)%7+p};switch(n){case"c":case"cc":return He(Ee(n.length,t),l);case"co":return He(a.ordinalNumber(t,{unit:"day"}),l);case"ccc":return a.day(t,{width:"abbreviated",context:"standalone"})||a.day(t,{width:"short",context:"standalone"})||a.day(t,{width:"narrow",context:"standalone"});case"ccccc":return a.day(t,{width:"narrow",context:"standalone"});case"cccccc":return a.day(t,{width:"short",context:"standalone"})||a.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(t,{width:"wide",context:"standalone"})||a.day(t,{width:"abbreviated",context:"standalone"})||a.day(t,{width:"short",context:"standalone"})||a.day(t,{width:"narrow",context:"standalone"})}}validate(t,n){return n>=0&&n<=6}set(t,n,a,r){return t=pn(t,a,r),t.setHours(0,0,0,0),t}incompatibleTokens=["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]}function ko(e,t){const n=ve(e),a=jl(n),r=t-a;return mt(n,r)}class xo extends Pe{priority=90;parse(t,n,a){const r=l=>l===0?7:l;switch(n){case"i":case"ii":return Ee(n.length,t);case"io":return a.ordinalNumber(t,{unit:"day"});case"iii":return He(a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"}),r);case"iiiii":return He(a.day(t,{width:"narrow",context:"formatting"}),r);case"iiiiii":return He(a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"}),r);case"iiii":default:return He(a.day(t,{width:"wide",context:"formatting"})||a.day(t,{width:"abbreviated",context:"formatting"})||a.day(t,{width:"short",context:"formatting"})||a.day(t,{width:"narrow",context:"formatting"}),r)}}validate(t,n){return n>=1&&n<=7}set(t,n,a){return t=ko(t,a),t.setHours(0,0,0,0),t}incompatibleTokens=["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]}class Mo extends Pe{priority=80;parse(t,n,a){switch(n){case"a":case"aa":case"aaa":return a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(t,{width:"wide",context:"formatting"})||a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,a){return t.setHours(mn(a),0,0,0),t}incompatibleTokens=["b","B","H","k","t","T"]}class Do extends Pe{priority=80;parse(t,n,a){switch(n){case"b":case"bb":case"bbb":return a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(t,{width:"wide",context:"formatting"})||a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,a){return t.setHours(mn(a),0,0,0),t}incompatibleTokens=["a","B","H","k","t","T"]}class To extends Pe{priority=80;parse(t,n,a){switch(n){case"B":case"BB":case"BBB":return a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(t,{width:"wide",context:"formatting"})||a.dayPeriod(t,{width:"abbreviated",context:"formatting"})||a.dayPeriod(t,{width:"narrow",context:"formatting"})}}set(t,n,a){return t.setHours(mn(a),0,0,0),t}incompatibleTokens=["a","b","t","T"]}class Po extends Pe{priority=70;parse(t,n,a){switch(n){case"h":return Re(Le.hour12h,t);case"ho":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=12}set(t,n,a){const r=t.getHours()>=12;return r&&a<12?t.setHours(a+12,0,0,0):!r&&a===12?t.setHours(0,0,0,0):t.setHours(a,0,0,0),t}incompatibleTokens=["H","K","k","t","T"]}class Ao extends Pe{priority=70;parse(t,n,a){switch(n){case"H":return Re(Le.hour23h,t);case"Ho":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=23}set(t,n,a){return t.setHours(a,0,0,0),t}incompatibleTokens=["a","b","h","K","k","t","T"]}class Co extends Pe{priority=70;parse(t,n,a){switch(n){case"K":return Re(Le.hour11h,t);case"Ko":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=11}set(t,n,a){return t.getHours()>=12&&a<12?t.setHours(a+12,0,0,0):t.setHours(a,0,0,0),t}incompatibleTokens=["h","H","k","t","T"]}class Oo extends Pe{priority=70;parse(t,n,a){switch(n){case"k":return Re(Le.hour24h,t);case"ko":return a.ordinalNumber(t,{unit:"hour"});default:return Ee(n.length,t)}}validate(t,n){return n>=1&&n<=24}set(t,n,a){const r=a<=24?a%24:a;return t.setHours(r,0,0,0),t}incompatibleTokens=["a","b","h","H","K","t","T"]}class $o extends Pe{priority=60;parse(t,n,a){switch(n){case"m":return Re(Le.minute,t);case"mo":return a.ordinalNumber(t,{unit:"minute"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,a){return t.setMinutes(a,0,0),t}incompatibleTokens=["t","T"]}class Yo extends Pe{priority=50;parse(t,n,a){switch(n){case"s":return Re(Le.second,t);case"so":return a.ordinalNumber(t,{unit:"second"});default:return Ee(n.length,t)}}validate(t,n){return n>=0&&n<=59}set(t,n,a){return t.setSeconds(a,0),t}incompatibleTokens=["t","T"]}class So extends Pe{priority=30;parse(t,n){const a=r=>Math.trunc(r*Math.pow(10,-n.length+3));return He(Ee(n.length,t),a)}set(t,n,a){return t.setMilliseconds(a),t}incompatibleTokens=["t","T"]}class Ro extends Pe{priority=10;parse(t,n){switch(n){case"X":return wt(bt.basicOptionalMinutes,t);case"XX":return wt(bt.basic,t);case"XXXX":return wt(bt.basicOptionalSeconds,t);case"XXXXX":return wt(bt.extendedOptionalSeconds,t);case"XXX":default:return wt(bt.extended,t)}}set(t,n,a){return n.timestampIsSet?t:Te(t,t.getTime()-Ta(t)-a)}incompatibleTokens=["t","T","x"]}class Io extends Pe{priority=10;parse(t,n){switch(n){case"x":return wt(bt.basicOptionalMinutes,t);case"xx":return wt(bt.basic,t);case"xxxx":return wt(bt.basicOptionalSeconds,t);case"xxxxx":return wt(bt.extendedOptionalSeconds,t);case"xxx":default:return wt(bt.extended,t)}}set(t,n,a){return n.timestampIsSet?t:Te(t,t.getTime()-Ta(t)-a)}incompatibleTokens=["t","T","X"]}class Eo extends Pe{priority=40;parse(t){return sr(t)}set(t,n,a){return[Te(t,a*1e3),{timestampIsSet:!0}]}incompatibleTokens="*"}class Bo extends Pe{priority=20;parse(t){return sr(t)}set(t,n,a){return[Te(t,a),{timestampIsSet:!0}]}incompatibleTokens="*"}const No={G:new to,y:new ao,Y:new no,R:new ro,u:new lo,Q:new oo,q:new io,M:new so,L:new uo,w:new vo,I:new po,d:new yo,D:new go,E:new bo,e:new wo,c:new _o,i:new xo,a:new Mo,b:new Do,B:new To,h:new Po,H:new Ao,K:new Co,k:new Oo,m:new $o,s:new Yo,S:new So,X:new Ro,x:new Io,t:new Eo,T:new Bo},Lo=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Ho=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,Vo=/^'([^]*?)'?$/,Fo=/''/g,qo=/\S/,Wo=/[a-zA-Z]/;function rn(e,t,n,a){const r=Gl(),l=a?.locale??r.locale??nr,i=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,p=a?.weekStartsOn??a?.locale?.options?.weekStartsOn??r.weekStartsOn??r.locale?.options?.weekStartsOn??0;if(t==="")return e===""?ve(n):Te(n,NaN);const c={firstWeekContainsDate:i,weekStartsOn:p,locale:l},C=[new eo],m=t.match(Ho).map(f=>{const S=f[0];if(S in an){const I=an[S];return I(f,l.formatLong)}return f}).join("").match(Lo),v=[];for(let f of m){!a?.useAdditionalWeekYearTokens&&or(f)&&nn(f,t,e),!a?.useAdditionalDayOfYearTokens&&lr(f)&&nn(f,t,e);const S=f[0],I=No[S];if(I){const{incompatibleTokens:U}=I;if(Array.isArray(U)){const q=v.find(ae=>U.includes(ae.token)||ae.token===S);if(q)throw new RangeError(`The format string mustn't contain \`${q.fullToken}\` and \`${f}\` at the same time`)}else if(I.incompatibleTokens==="*"&&v.length>0)throw new RangeError(`The format string mustn't contain \`${f}\` and any other token at the same time`);v.push({token:S,fullToken:f});const A=I.run(e,f,l.match,c);if(!A)return Te(n,NaN);C.push(A.setter),e=A.rest}else{if(S.match(Wo))throw new RangeError("Format string contains an unescaped latin alphabet character `"+S+"`");if(f==="''"?f="'":S==="'"&&(f=Qo(f)),e.indexOf(f)===0)e=e.slice(f.length);else return Te(n,NaN)}}if(e.length>0&&qo.test(e))return Te(n,NaN);const h=C.map(f=>f.priority).sort((f,S)=>S-f).filter((f,S,I)=>I.indexOf(f)===S).map(f=>C.filter(S=>S.priority===f).sort((S,I)=>I.subPriority-S.subPriority)).map(f=>f[0]);let k=ve(n);if(isNaN(k.getTime()))return Te(n,NaN);const Y={};for(const f of h){if(!f.validate(k,c))return Te(n,NaN);const S=f.set(k,Y,c);Array.isArray(S)?(k=S[0],Object.assign(Y,S[1])):k=S}return Te(n,k)}function Qo(e){return e.match(Vo)[1].replace(Fo,"'")}function Bn(e,t){const n=Ht(e),a=Ht(t);return+n==+a}function zo(e,t){return mt(e,-t)}function cr(e,t){const n=ve(e),a=n.getFullYear(),r=n.getDate(),l=Te(e,0);l.setFullYear(a,t,15),l.setHours(0,0,0,0);const i=Xl(l);return n.setMonth(t,Math.min(r,i)),n}function Ce(e,t){let n=ve(e);return isNaN(+n)?Te(e,NaN):(t.year!=null&&n.setFullYear(t.year),t.month!=null&&(n=cr(n,t.month)),t.date!=null&&n.setDate(t.date),t.hours!=null&&n.setHours(t.hours),t.minutes!=null&&n.setMinutes(t.minutes),t.seconds!=null&&n.setSeconds(t.seconds),t.milliseconds!=null&&n.setMilliseconds(t.milliseconds),n)}function Uo(e,t){const n=ve(e);return n.setHours(t),n}function vr(e,t){const n=ve(e);return n.setMilliseconds(t),n}function Xo(e,t){const n=ve(e);return n.setMinutes(t),n}function mr(e,t){const n=ve(e);return n.setSeconds(t),n}function _t(e,t){const n=ve(e);return isNaN(+n)?Te(e,NaN):(n.setFullYear(t),n)}function Jt(e,t){return ft(e,-t)}function Go(e,t){const{years:n=0,months:a=0,weeks:r=0,days:l=0,hours:i=0,minutes:p=0,seconds:c=0}=t,C=Jt(e,a+n*12),m=zo(C,l+r*7),v=p+i*60,k=(c+v*60)*1e3;return Te(e,m.getTime()-k)}function pr(e,t){return un(e,-t)}function aa(){const e=Lr();return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img",...e},[ye("path",{d:"M29.333 8c0-2.208-1.792-4-4-4h-18.667c-2.208 0-4 1.792-4 4v18.667c0 2.208 1.792 4 4 4h18.667c2.208 0 4-1.792 4-4v-18.667zM26.667 8v18.667c0 0.736-0.597 1.333-1.333 1.333 0 0-18.667 0-18.667 0-0.736 0-1.333-0.597-1.333-1.333 0 0 0-18.667 0-18.667 0-0.736 0.597-1.333 1.333-1.333 0 0 18.667 0 18.667 0 0.736 0 1.333 0.597 1.333 1.333z"}),ye("path",{d:"M20 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),ye("path",{d:"M9.333 2.667v5.333c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-5.333c0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"}),ye("path",{d:"M4 14.667h24c0.736 0 1.333-0.597 1.333-1.333s-0.597-1.333-1.333-1.333h-24c-0.736 0-1.333 0.597-1.333 1.333s0.597 1.333 1.333 1.333z"})])}aa.compatConfig={MODE:3};function fr(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M23.057 7.057l-16 16c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l16-16c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0z"}),ye("path",{d:"M7.057 8.943l16 16c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885l-16-16c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}fr.compatConfig={MODE:3};function fn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M20.943 23.057l-7.057-7.057c0 0 7.057-7.057 7.057-7.057 0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-8 8c-0.521 0.521-0.521 1.365 0 1.885l8 8c0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}fn.compatConfig={MODE:3};function hn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M12.943 24.943l8-8c0.521-0.521 0.521-1.365 0-1.885l-8-8c-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885l7.057 7.057c0 0-7.057 7.057-7.057 7.057-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0z"})])}hn.compatConfig={MODE:3};function yn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M16 1.333c-8.095 0-14.667 6.572-14.667 14.667s6.572 14.667 14.667 14.667c8.095 0 14.667-6.572 14.667-14.667s-6.572-14.667-14.667-14.667zM16 4c6.623 0 12 5.377 12 12s-5.377 12-12 12c-6.623 0-12-5.377-12-12s5.377-12 12-12z"}),ye("path",{d:"M14.667 8v8c0 0.505 0.285 0.967 0.737 1.193l5.333 2.667c0.658 0.329 1.46 0.062 1.789-0.596s0.062-1.46-0.596-1.789l-4.596-2.298c0 0 0-7.176 0-7.176 0-0.736-0.597-1.333-1.333-1.333s-1.333 0.597-1.333 1.333z"})])}yn.compatConfig={MODE:3};function gn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M24.943 19.057l-8-8c-0.521-0.521-1.365-0.521-1.885 0l-8 8c-0.52 0.52-0.52 1.365 0 1.885s1.365 0.52 1.885 0l7.057-7.057c0 0 7.057 7.057 7.057 7.057 0.52 0.52 1.365 0.52 1.885 0s0.52-1.365 0-1.885z"})])}gn.compatConfig={MODE:3};function bn(){return P(),W("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",fill:"currentColor","aria-hidden":"true",class:"dp__icon",role:"img"},[ye("path",{d:"M7.057 12.943l8 8c0.521 0.521 1.365 0.521 1.885 0l8-8c0.52-0.52 0.52-1.365 0-1.885s-1.365-0.52-1.885 0l-7.057 7.057c0 0-7.057-7.057-7.057-7.057-0.52-0.52-1.365-0.52-1.885 0s-0.52 1.365 0 1.885z"})])}bn.compatConfig={MODE:3};const nt=(e,t)=>t?new Date(e.toLocaleString("en-US",{timeZone:t})):new Date(e),wn=(e,t,n)=>ln(e,t,n)||Q(),jo=(e,t,n)=>{const a=t.dateInTz?nt(new Date(e),t.dateInTz):Q(e);return n?tt(a,!0):a},ln=(e,t,n)=>{if(!e)return null;const a=n?tt(Q(e),!0):Q(e);return t?t.exactMatch?jo(e,t,n):nt(a,t.timezone):a},Ko=e=>{if(!e)return 0;const t=new Date,n=new Date(t.toLocaleString("en-US",{timeZone:"UTC"})),a=new Date(t.toLocaleString("en-US",{timeZone:e})),r=a.getTimezoneOffset()/60;return(+n-+a)/(1e3*60*60)-r};var vt=(e=>(e.month="month",e.year="year",e))(vt||{}),Lt=(e=>(e.top="top",e.bottom="bottom",e))(Lt||{}),Vt=(e=>(e.header="header",e.calendar="calendar",e.timePicker="timePicker",e))(Vt||{}),Xe=(e=>(e.month="month",e.year="year",e.calendar="calendar",e.time="time",e.minutes="minutes",e.hours="hours",e.seconds="seconds",e))(Xe||{});const Jo=["timestamp","date","iso"];var Ze=(e=>(e.up="up",e.down="down",e.left="left",e.right="right",e))(Ze||{}),$e=(e=>(e.arrowUp="ArrowUp",e.arrowDown="ArrowDown",e.arrowLeft="ArrowLeft",e.arrowRight="ArrowRight",e.enter="Enter",e.space=" ",e.esc="Escape",e.tab="Tab",e.home="Home",e.end="End",e.pageUp="PageUp",e.pageDown="PageDown",e))($e||{});function Nn(e){return t=>new Intl.DateTimeFormat(e,{weekday:"short",timeZone:"UTC"}).format(new Date(`2017-01-0${t}T00:00:00+00:00`)).slice(0,2)}function Zo(e){return t=>kt(nt(new Date(`2017-01-0${t}T00:00:00+00:00`),"UTC"),"EEEEEE",{locale:e})}const ei=(e,t,n)=>{const a=[1,2,3,4,5,6,7];let r;if(e!==null)try{r=a.map(Zo(e))}catch{r=a.map(Nn(t))}else r=a.map(Nn(t));const l=r.slice(0,n),i=r.slice(n+1,r.length);return[r[n]].concat(...i).concat(...l)},_n=(e,t,n)=>{const a=[];for(let r=+e[0];r<=+e[1];r++)a.push({value:+r,text:br(r,t)});return n?a.reverse():a},hr=(e,t,n)=>{const a=[1,2,3,4,5,6,7,8,9,10,11,12].map(l=>{const i=l<10?`0${l}`:l;return new Date(`2017-${i}-01T00:00:00+00:00`)});if(e!==null)try{const l=n==="long"?"LLLL":"LLL";return a.map((i,p)=>{const c=kt(nt(i,"UTC"),l,{locale:e});return{text:c.charAt(0).toUpperCase()+c.substring(1),value:p}})}catch{}const r=new Intl.DateTimeFormat(t,{month:n,timeZone:"UTC"});return a.map((l,i)=>{const p=r.format(l);return{text:p.charAt(0).toUpperCase()+p.substring(1),value:i}})},ti=e=>[12,1,2,3,4,5,6,7,8,9,10,11,12,1,2,3,4,5,6,7,8,9,10,11][e],Fe=e=>{const t=d(e);return t!=null&&t.$el?t?.$el:t},ai=e=>({type:"dot",...e??{}}),yr=e=>Array.isArray(e)?!!e[0]&&!!e[1]:!1,kn={prop:e=>`"${e}" prop must be enabled!`,dateArr:e=>`You need to use array as "model-value" binding in order to support "${e}"`},qe=e=>e,Ln=e=>e===0?e:!e||isNaN(+e)?null:+e,Hn=e=>e===null,gr=e=>{if(e)return[...e.querySelectorAll("input, button, select, textarea, a[href]")][0]},ni=e=>{const t=[],n=a=>a.filter(r=>r);for(let a=0;a{const a=n!=null,r=t!=null;if(!a&&!r)return!1;const l=+n,i=+t;return a&&r?+e>l||+el:r?+eni(e).map(n=>n.map(a=>{const{active:r,disabled:l,isBetween:i,highlighted:p}=t(a);return{...a,active:r,disabled:l,className:{dp__overlay_cell_active:r,dp__overlay_cell:!r,dp__overlay_cell_disabled:l,dp__overlay_cell_pad:!0,dp__overlay_cell_active_disabled:l&&r,dp__cell_in_between:i,"dp--highlighted":p}}})),Yt=(e,t,n=!1)=>{e&&t.allowStopPropagation&&(n&&e.stopImmediatePropagation(),e.stopPropagation())},ri=()=>["a[href]","area[href]","input:not([disabled]):not([type='hidden'])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","[tabindex]:not([tabindex='-1'])","[data-datepicker-instance]"].join(", ");function li(e,t){let n=[...document.querySelectorAll(ri())];n=n.filter(r=>!e.contains(r)||r.hasAttribute("data-datepicker-instance"));const a=n.indexOf(e);if(a>=0&&(t?a-1>=0:a+1<=n.length))return n[a+(t?-1:1)]}const on=(e,t)=>e?.querySelector(`[data-dp-element="${t}"]`),br=(e,t)=>new Intl.NumberFormat(t,{useGrouping:!1,style:"decimal"}).format(e),xn=e=>kt(e,"dd-MM-yyyy"),Qa=e=>Array.isArray(e),Aa=(e,t)=>t.get(xn(e)),oi=(e,t)=>e?t?t instanceof Map?!!Aa(e,t):t(Q(e)):!1:!0,et=(e,t,n=!1,a)=>{if(e.key===$e.enter||e.key===$e.space)return n&&e.preventDefault(),t();if(a)return a(e)},Vn=()=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].some(e=>navigator.userAgent.includes(e))||navigator.userAgent.includes("Mac")&&"ontouchend"in document,Fn=(e,t,n,a,r,l)=>{const i=rn(e,t.slice(0,e.length),new Date,{locale:l});return ua(i)&&Zn(i)?a||r?i:Ce(i,{hours:+n.hours,minutes:+n?.minutes,seconds:+n?.seconds,milliseconds:0}):null},ii=(e,t,n,a,r,l)=>{const i=Array.isArray(n)?n[0]:n;if(typeof t=="string")return Fn(e,t,i,a,r,l);if(Array.isArray(t)){let p=null;for(const c of t)if(p=Fn(e,c,i,a,r,l),p)break;return p}return typeof t=="function"?t(e):null},Q=e=>e?new Date(e):new Date,si=(e,t,n)=>{if(t){const r=(e.getMonth()+1).toString().padStart(2,"0"),l=e.getDate().toString().padStart(2,"0"),i=e.getHours().toString().padStart(2,"0"),p=e.getMinutes().toString().padStart(2,"0"),c=n?e.getSeconds().toString().padStart(2,"0"):"00";return`${e.getFullYear()}-${r}-${l}T${i}:${p}:${c}.000Z`}const a=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate(),e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds());return new Date(a).toISOString()},tt=(e,t)=>{const n=Q(JSON.parse(JSON.stringify(e))),a=Ce(n,{hours:0,minutes:0,seconds:0,milliseconds:0});return t?tl(a):a},St=(e,t,n,a)=>{let r=e?Q(e):Q();return(t||t===0)&&(r=Uo(r,+t)),(n||n===0)&&(r=Xo(r,+n)),(a||a===0)&&(r=mr(r,+a)),vr(r,0)},Ie=(e,t)=>!e||!t?!1:pa(tt(e),tt(t)),Me=(e,t)=>!e||!t?!1:Xt(tt(e),tt(t)),Ne=(e,t)=>!e||!t?!1:Kt(tt(e),tt(t)),$a=(e,t,n)=>e!=null&&e[0]&&e!=null&&e[1]?Ne(n,e[0])&&Ie(n,e[1]):e!=null&&e[0]&&t?Ne(n,e[0])&&Ie(n,t)||Ie(n,e[0])&&Ne(n,t):!1,pt=e=>{const t=Ce(new Date(e),{date:1});return tt(t)},za=(e,t,n)=>t&&(n||n===0)?Object.fromEntries(["hours","minutes","seconds"].map(a=>a===t?[a,n]:[a,isNaN(+e[a])?void 0:+e[a]])):{hours:isNaN(+e.hours)?void 0:+e.hours,minutes:isNaN(+e.minutes)?void 0:+e.minutes,seconds:isNaN(+e.seconds)?void 0:+e.seconds},Ft=e=>({hours:Tt(e),minutes:Rt(e),seconds:jt(e)}),wr=(e,t)=>{if(t){const n=he(Q(t));if(n>e)return 12;if(n===e)return xe(Q(t))}},_r=(e,t)=>{if(t){const n=he(Q(t));return n{if(e)return he(Q(e))},kr=(e,t)=>{const n=Ne(e,t)?t:e,a=Ne(t,e)?t:e;return er({start:n,end:a})},ui=e=>{const t=ft(e,1);return{month:xe(t),year:he(t)}},xt=(e,t)=>{const n=ht(e,{weekStartsOn:+t}),a=ar(e,{weekStartsOn:+t});return[n,a]},xr=(e,t)=>{const n={hours:Tt(Q()),minutes:Rt(Q()),seconds:t?jt(Q()):0};return Object.assign(n,e)},$t=(e,t,n)=>[Ce(Q(e),{date:1}),Ce(Q(),{month:t,year:n,date:1})],Mt=(e,t,n)=>{let a=e?Q(e):Q();return(t||t===0)&&(a=cr(a,t)),n&&(a=_t(a,n)),a},Mr=(e,t,n,a,r)=>{if(!a||r&&!t||!r&&!n)return!1;const l=r?ft(e,1):Jt(e,1),i=[xe(l),he(l)];return r?!ci(...i,t):!di(...i,n)},di=(e,t,n)=>Ie(...$t(n,e,t))||Me(...$t(n,e,t)),ci=(e,t,n)=>Ne(...$t(n,e,t))||Me(...$t(n,e,t)),Dr=(e,t,n,a,r,l,i)=>{if(typeof t=="function"&&!i)return t(e);const p=n?{locale:n}:void 0;return Array.isArray(e)?`${kt(e[0],l,p)}${r&&!e[1]?"":a}${e[1]?kt(e[1],l,p):""}`:kt(e,l,p)},zt=e=>{if(e)return null;throw new Error(kn.prop("partial-range"))},ka=(e,t)=>{if(t)return e();throw new Error(kn.prop("range"))},sn=e=>Array.isArray(e)?ua(e[0])&&(e[1]?ua(e[1]):!0):e?ua(e):!1,vi=(e,t)=>Ce(t??Q(),{hours:+e.hours||0,minutes:+e.minutes||0,seconds:+e.seconds||0}),Ua=(e,t,n,a)=>{if(!e)return!0;if(a){const r=n==="max"?pa(e,t):Kt(e,t),l={seconds:0,milliseconds:0};return r||Xt(Ce(e,l),Ce(t,l))}return n==="max"?e.getTime()<=t.getTime():e.getTime()>=t.getTime()},Xa=(e,t,n)=>e?vi(e,t):Q(n??t),qn=(e,t,n,a,r)=>{if(Array.isArray(a)){const i=Xa(e,a[0],t),p=Xa(e,a[1],t);return Ua(a[0],i,n,!!t)&&Ua(a[1],p,n,!!t)&&r}const l=Xa(e,a,t);return Ua(a,l,n,!!t)&&r},Ga=e=>Ce(Q(),Ft(e)),mi=(e,t)=>e instanceof Map?Array.from(e.values()).filter(n=>he(Q(n))===t).map(n=>xe(n)):[],Tr=(e,t,n)=>typeof e=="function"?e({month:t,year:n}):!!e.months.find(a=>a.month===t&&a.year===n),Mn=(e,t)=>typeof e=="function"?e(t):e.years.includes(t),Pr=e=>kt(e,"yyyy-MM-dd"),sa=ha({menuFocused:!1,shiftKeyInMenu:!1}),Ar=()=>{const e=n=>{sa.menuFocused=n},t=n=>{sa.shiftKeyInMenu!==n&&(sa.shiftKeyInMenu=n)};return{control:G(()=>({shiftKeyInMenu:sa.shiftKeyInMenu,menuFocused:sa.menuFocused})),setMenuFocused:e,setShiftKey:t}},Oe=ha({monthYear:[],calendar:[],time:[],actionRow:[],selectionGrid:[],timePicker:{0:[],1:[]},monthPicker:[]}),ja=Z(null),xa=Z(!1),Ka=Z(!1),Ja=Z(!1),Za=Z(!1),Ue=Z(0),Be=Z(0),It=()=>{const e=G(()=>xa.value?[...Oe.selectionGrid,Oe.actionRow].filter(v=>v.length):Ka.value?[...Oe.timePicker[0],...Oe.timePicker[1],Za.value?[]:[ja.value],Oe.actionRow].filter(v=>v.length):Ja.value?[...Oe.monthPicker,Oe.actionRow]:[Oe.monthYear,...Oe.calendar,Oe.time,Oe.actionRow].filter(v=>v.length)),t=v=>{Ue.value=v?Ue.value+1:Ue.value-1;let h=null;e.value[Be.value]&&(h=e.value[Be.value][Ue.value]),!h&&e.value[Be.value+(v?1:-1)]?(Be.value=Be.value+(v?1:-1),Ue.value=v?0:e.value[Be.value].length-1):h||(Ue.value=v?Ue.value-1:Ue.value+1)},n=v=>{Be.value===0&&!v||Be.value===e.value.length&&v||(Be.value=v?Be.value+1:Be.value-1,e.value[Be.value]?e.value[Be.value]&&!e.value[Be.value][Ue.value]&&Ue.value!==0&&(Ue.value=e.value[Be.value].length-1):Be.value=v?Be.value-1:Be.value+1)},a=v=>{let h=null;e.value[Be.value]&&(h=e.value[Be.value][Ue.value]),h?h.focus({preventScroll:!xa.value}):Ue.value=v?Ue.value-1:Ue.value+1},r=()=>{t(!0),a(!0)},l=()=>{t(!1),a(!1)},i=()=>{n(!1),a(!0)},p=()=>{n(!0),a(!0)},c=(v,h)=>{Oe[h]=v},C=(v,h)=>{Oe[h]=v},m=()=>{Ue.value=0,Be.value=0};return{buildMatrix:c,buildMultiLevelMatrix:C,setTimePickerBackRef:v=>{ja.value=v},setSelectionGrid:v=>{xa.value=v,m(),v||(Oe.selectionGrid=[])},setTimePicker:(v,h=!1)=>{Ka.value=v,Za.value=h,m(),v||(Oe.timePicker[0]=[],Oe.timePicker[1]=[])},setTimePickerElements:(v,h=0)=>{Oe.timePicker[h]=v},arrowRight:r,arrowLeft:l,arrowUp:i,arrowDown:p,clearArrowNav:()=>{Oe.monthYear=[],Oe.calendar=[],Oe.time=[],Oe.actionRow=[],Oe.selectionGrid=[],Oe.timePicker[0]=[],Oe.timePicker[1]=[],xa.value=!1,Ka.value=!1,Za.value=!1,Ja.value=!1,m(),ja.value=null},setMonthPicker:v=>{Ja.value=v,m()},refSets:Oe}},Wn=e=>({menuAppearTop:"dp-menu-appear-top",menuAppearBottom:"dp-menu-appear-bottom",open:"dp-slide-down",close:"dp-slide-up",next:"calendar-next",previous:"calendar-prev",vNext:"dp-slide-up",vPrevious:"dp-slide-down",...e??{}}),pi=e=>({toggleOverlay:"Toggle overlay",menu:"Datepicker menu",input:"Datepicker input",openTimePicker:"Open time picker",closeTimePicker:"Close time Picker",incrementValue:t=>`Increment ${t}`,decrementValue:t=>`Decrement ${t}`,openTpOverlay:t=>`Open ${t} overlay`,amPmButton:"Switch AM/PM mode",openYearsOverlay:"Open years overlay",openMonthsOverlay:"Open months overlay",nextMonth:"Next month",prevMonth:"Previous month",nextYear:"Next year",prevYear:"Previous year",day:void 0,weekDay:void 0,clearInput:"Clear value",calendarIcon:"Calendar icon",timePicker:"Time picker",monthPicker:t=>`Month picker${t?" overlay":""}`,yearPicker:t=>`Year picker${t?" overlay":""}`,timeOverlay:t=>`${t} overlay`,...e??{}}),Qn=e=>e?typeof e=="boolean"?e?2:0:+e>=2?+e:2:0,fi=e=>{const t=typeof e=="object"&&e,n={static:!0,solo:!1};if(!e)return{...n,count:Qn(!1)};const a=t?e:{},r=t?a.count??!0:e,l=Qn(r);return Object.assign(n,a,{count:l})},hi=(e,t,n)=>e||(typeof n=="string"?n:t),yi=e=>typeof e=="boolean"?e?Wn({}):!1:Wn(e),gi=e=>{const t={enterSubmit:!0,tabSubmit:!0,openMenu:"open",selectOnFocus:!1,rangeSeparator:" - "};return typeof e=="object"?{...t,...e??{},enabled:!0}:{...t,enabled:e}},bi=e=>({months:[],years:[],times:{hours:[],minutes:[],seconds:[]},...e??{}}),wi=e=>({showSelect:!0,showCancel:!0,showNow:!1,showPreview:!0,...e??{}}),_i=e=>{const t={input:!1};return typeof e=="object"?{...t,...e??{},enabled:!0}:{enabled:e,...t}},ki=e=>({allowStopPropagation:!0,closeOnScroll:!1,modeHeight:255,allowPreventDefault:!1,closeOnClearValue:!0,closeOnAutoApply:!0,noSwipe:!1,keepActionRow:!1,onClickOutside:void 0,tabOutClosesMenu:!0,arrowLeft:void 0,keepViewOnOffsetClick:!1,timeArrowHoldThreshold:0,shadowDom:!1,...e??{}}),xi=e=>{const t={dates:Array.isArray(e)?e.map(n=>Q(n)):[],years:[],months:[],quarters:[],weeks:[],weekdays:[],options:{highlightDisabled:!1}};return typeof e=="function"?e:{...t,...e??{}}},Mi=e=>typeof e=="object"?{type:e?.type??"local",hideOnOffsetDates:e?.hideOnOffsetDates??!1}:{type:e,hideOnOffsetDates:!1},Di=e=>{const t={noDisabledRange:!1,showLastInRange:!0,minMaxRawRange:!1,partialRange:!0,disableTimeRangeValidation:!1,maxRange:void 0,minRange:void 0,autoRange:void 0,fixedStart:!1,fixedEnd:!1};return typeof e=="object"?{enabled:!0,...t,...e}:{enabled:e,...t}},Ti=e=>e?typeof e=="string"?{timezone:e,exactMatch:!1,dateInTz:void 0,emitTimezone:void 0,convertModel:!0}:{timezone:e.timezone,exactMatch:e.exactMatch??!1,dateInTz:e.dateInTz??void 0,emitTimezone:e.emitTimezone??void 0,convertModel:e.convertModel??!0}:{timezone:void 0,exactMatch:!1,emitTimezone:void 0},en=(e,t,n)=>new Map(e.map(a=>{const r=wn(a,t,n);return[xn(r),r]})),Pi=(e,t)=>e.length?new Map(e.map(n=>{const a=wn(n.date,t);return[xn(a),n]})):null,Ai=e=>{var t;return{minDate:ln(e.minDate,e.timezone,e.isSpecific),maxDate:ln(e.maxDate,e.timezone,e.isSpecific),disabledDates:Qa(e.disabledDates)?en(e.disabledDates,e.timezone,e.isSpecific):e.disabledDates,allowedDates:Qa(e.allowedDates)?en(e.allowedDates,e.timezone,e.isSpecific):null,highlight:typeof e.highlight=="object"&&Qa((t=e.highlight)==null?void 0:t.dates)?en(e.highlight.dates,e.timezone):e.highlight,markers:Pi(e.markers,e.timezone)}},Ci=e=>typeof e=="boolean"?{enabled:e,dragSelect:!0,limit:null}:{enabled:!!e,limit:e.limit?+e.limit:null,dragSelect:e.dragSelect??!0},Oi=e=>({...Object.fromEntries(Object.keys(e).map(t=>{const n=t,a=e[n],r=typeof e[n]=="string"?{[a]:!0}:Object.fromEntries(a.map(l=>[l,!0]));return[t,r]}))}),Se=e=>{const t=()=>{const E=e.enableSeconds?":ss":"",B=e.enableMinutes?":mm":"";return e.is24?`HH${B}${E}`:`hh${B}${E} aa`},n=()=>{var E;return e.format?e.format:e.monthPicker?"MM/yyyy":e.timePicker?t():e.weekPicker?`${((E=S.value)==null?void 0:E.type)==="iso"?"RR":"ww"}-yyyy`:e.yearPicker?"yyyy":e.quarterPicker?"QQQ/yyyy":e.enableTimePicker?`MM/dd/yyyy, ${t()}`:"MM/dd/yyyy"},a=E=>xr(E,e.enableSeconds),r=()=>q.value.enabled?e.startTime&&Array.isArray(e.startTime)?[a(e.startTime[0]),a(e.startTime[1])]:null:e.startTime&&!Array.isArray(e.startTime)?a(e.startTime):null,l=G(()=>fi(e.multiCalendars)),i=G(()=>r()),p=G(()=>pi(e.ariaLabels)),c=G(()=>bi(e.filters)),C=G(()=>yi(e.transitions)),m=G(()=>wi(e.actionRow)),v=G(()=>hi(e.previewFormat,e.format,n())),h=G(()=>gi(e.textInput)),k=G(()=>_i(e.inline)),Y=G(()=>ki(e.config)),f=G(()=>xi(e.highlight)),S=G(()=>Mi(e.weekNumbers)),I=G(()=>Ti(e.timezone)),U=G(()=>Ci(e.multiDates)),A=G(()=>Ai({minDate:e.minDate,maxDate:e.maxDate,disabledDates:e.disabledDates,allowedDates:e.allowedDates,highlight:f.value,markers:e.markers,timezone:I.value,isSpecific:e.monthPicker||e.yearPicker||e.quarterPicker})),q=G(()=>Di(e.range)),ae=G(()=>Oi(e.ui));return{defaultedTransitions:C,defaultedMultiCalendars:l,defaultedStartTime:i,defaultedAriaLabels:p,defaultedFilters:c,defaultedActionRow:m,defaultedPreviewFormat:v,defaultedTextInput:h,defaultedInline:k,defaultedConfig:Y,defaultedHighlight:f,defaultedWeekNumbers:S,defaultedRange:q,propDates:A,defaultedTz:I,defaultedMultiDates:U,defaultedUI:ae,getDefaultPattern:n,getDefaultStartTime:r}},$i=(e,t,n)=>{const a=Z(),{defaultedTextInput:r,defaultedRange:l,defaultedTz:i,defaultedMultiDates:p,getDefaultPattern:c}=Se(t),C=Z(""),m=ca(t,"format"),v=ca(t,"formatLocale");ct(a,()=>{typeof t.onInternalModelChange=="function"&&e("internal-model-change",a.value,z(!0))},{deep:!0}),ct(l,(u,le)=>{u.enabled!==le.enabled&&(a.value=null)}),ct(m,()=>{re()});const h=u=>i.value.timezone&&i.value.convertModel?nt(u,i.value.timezone):u,k=u=>{if(i.value.timezone&&i.value.convertModel){const le=Ko(i.value.timezone);return Xr(u,le)}return u},Y=(u,le,fe=!1)=>Dr(u,t.format,t.formatLocale,r.value.rangeSeparator,t.modelAuto,le??c(),fe),f=u=>u?t.modelType?b(u):{hours:Tt(u),minutes:Rt(u),seconds:t.enableSeconds?jt(u):0}:null,S=u=>t.modelType?b(u):{month:xe(u),year:he(u)},I=u=>Array.isArray(u)?p.value.enabled?u.map(le=>U(le,_t(Q(),le))):ka(()=>[_t(Q(),u[0]),u[1]?_t(Q(),u[1]):zt(l.value.partialRange)],l.value.enabled):_t(Q(),+u),U=(u,le)=>(typeof u=="string"||typeof u=="number")&&t.modelType?R(u):le,A=u=>Array.isArray(u)?[U(u[0],St(null,+u[0].hours,+u[0].minutes,u[0].seconds)),U(u[1],St(null,+u[1].hours,+u[1].minutes,u[1].seconds))]:U(u,St(null,u.hours,u.minutes,u.seconds)),q=u=>{const le=Ce(Q(),{date:1});return Array.isArray(u)?p.value.enabled?u.map(fe=>U(fe,Mt(le,+fe.month,+fe.year))):ka(()=>[U(u[0],Mt(le,+u[0].month,+u[0].year)),U(u[1],u[1]?Mt(le,+u[1].month,+u[1].year):zt(l.value.partialRange))],l.value.enabled):U(u,Mt(le,+u.month,+u.year))},ae=u=>{if(Array.isArray(u))return u.map(le=>R(le));throw new Error(kn.dateArr("multi-dates"))},E=u=>{if(Array.isArray(u)&&l.value.enabled){const le=u[0],fe=u[1];return[Q(Array.isArray(le)?le[0]:null),Array.isArray(fe)&&fe.length?Q(fe[0]):null]}return Q(u[0])},B=u=>t.modelAuto?Array.isArray(u)?[R(u[0]),R(u[1])]:t.autoApply?[R(u)]:[R(u),null]:Array.isArray(u)?ka(()=>u[1]?[R(u[0]),u[1]?R(u[1]):zt(l.value.partialRange)]:[R(u[0])],l.value.enabled):R(u),ne=()=>{Array.isArray(a.value)&&l.value.enabled&&a.value.length===1&&a.value.push(zt(l.value.partialRange))},F=()=>{const u=a.value;return[b(u[0]),u[1]?b(u[1]):zt(l.value.partialRange)]},N=()=>a.value[1]?F():b(qe(a.value[0])),ie=()=>(a.value||[]).map(u=>b(u)),ce=(u=!1)=>(u||ne(),t.modelAuto?N():p.value.enabled?ie():Array.isArray(a.value)?ka(()=>F(),l.value.enabled):b(qe(a.value))),pe=u=>!u||Array.isArray(u)&&!u.length?null:t.timePicker?A(qe(u)):t.monthPicker?q(qe(u)):t.yearPicker?I(qe(u)):p.value.enabled?ae(qe(u)):t.weekPicker?E(qe(u)):B(qe(u)),g=u=>{const le=pe(u);sn(qe(le))?(a.value=qe(le),re()):(a.value=null,C.value="")},D=()=>{const u=le=>kt(le,r.value.format);return`${u(a.value[0])} ${r.value.rangeSeparator} ${a.value[1]?u(a.value[1]):""}`},y=()=>n.value&&a.value?Array.isArray(a.value)?D():kt(a.value,r.value.format):Y(a.value),H=()=>a.value?p.value.enabled?a.value.map(u=>Y(u)).join("; "):r.value.enabled&&typeof r.value.format=="string"?y():Y(a.value):"",re=()=>{!t.format||typeof t.format=="string"||r.value.enabled&&typeof r.value.format=="string"?C.value=H():C.value=t.format(a.value)},R=u=>{if(t.utc){const le=new Date(u);return t.utc==="preserve"?new Date(le.getTime()+le.getTimezoneOffset()*6e4):le}return t.modelType?Jo.includes(t.modelType)?h(new Date(u)):t.modelType==="format"&&(typeof t.format=="string"||!t.format)?h(rn(u,c(),new Date,{locale:v.value})):h(rn(u,t.modelType,new Date,{locale:v.value})):h(new Date(u))},b=u=>u?t.utc?si(u,t.utc==="preserve",t.enableSeconds):t.modelType?t.modelType==="timestamp"?+k(u):t.modelType==="iso"?k(u).toISOString():t.modelType==="format"&&(typeof t.format=="string"||!t.format)?Y(k(u)):Y(k(u),t.modelType,!0):k(u):"",oe=(u,le=!1,fe=!1)=>{if(fe)return u;if(e("update:model-value",u),i.value.emitTimezone&&le){const Ve=Array.isArray(u)?u.map(T=>nt(qe(T),i.value.emitTimezone)):nt(qe(u),i.value.emitTimezone);e("update:model-timezone-value",Ve)}},V=u=>Array.isArray(a.value)?p.value.enabled?a.value.map(le=>u(le)):[u(a.value[0]),a.value[1]?u(a.value[1]):zt(l.value.partialRange)]:u(qe(a.value)),M=()=>{if(Array.isArray(a.value)){const u=xt(a.value[0],t.weekStart),le=a.value[1]?xt(a.value[1],t.weekStart):[];return[u.map(fe=>Q(fe)),le.map(fe=>Q(fe))]}return xt(a.value,t.weekStart).map(u=>Q(u))},o=(u,le)=>oe(qe(V(u)),!1,le),w=u=>{const le=M();return u?le:e("update:model-value",M())},z=(u=!1)=>(u||re(),t.monthPicker?o(S,u):t.timePicker?o(f,u):t.yearPicker?o(he,u):t.weekPicker?w(u):oe(ce(u),!0,u));return{inputValue:C,internalModelValue:a,checkBeforeEmit:()=>a.value?l.value.enabled?l.value.partialRange?a.value.length>=1:a.value.length===2:!!a.value:!1,parseExternalModelValue:g,formatInputValue:re,emitModelValue:z}},Yi=(e,t)=>{const{defaultedFilters:n,propDates:a}=Se(e),{validateMonthYearInRange:r}=Et(e),l=(m,v)=>{let h=m;return n.value.months.includes(xe(h))?(h=v?ft(m,1):Jt(m,1),l(h,v)):h},i=(m,v)=>{let h=m;return n.value.years.includes(he(h))?(h=v?un(m,1):pr(m,1),i(h,v)):h},p=(m,v=!1)=>{const h=Ce(Q(),{month:e.month,year:e.year});let k=m?ft(h,1):Jt(h,1);e.disableYearSelect&&(k=_t(k,e.year));let Y=xe(k),f=he(k);n.value.months.includes(Y)&&(k=l(k,m),Y=xe(k),f=he(k)),n.value.years.includes(f)&&(k=i(k,m),f=he(k)),r(Y,f,m,e.preventMinMaxNavigation)&&c(Y,f,v)},c=(m,v,h)=>{t("update-month-year",{month:m,year:v,fromNav:h})},C=G(()=>m=>Mr(Ce(Q(),{month:e.month,year:e.year}),a.value.maxDate,a.value.minDate,e.preventMinMaxNavigation,m));return{handleMonthYearChange:p,isDisabled:C,updateMonthYear:c}},Ya={multiCalendars:{type:[Boolean,Number,String,Object],default:void 0},modelValue:{type:[String,Date,Array,Object,Number],default:null},modelType:{type:String,default:null},position:{type:String,default:"center"},dark:{type:Boolean,default:!1},format:{type:[String,Function],default:()=>null},autoPosition:{type:Boolean,default:!0},altPosition:{type:Function,default:null},transitions:{type:[Boolean,Object],default:!0},formatLocale:{type:Object,default:null},utc:{type:[Boolean,String],default:!1},ariaLabels:{type:Object,default:()=>({})},offset:{type:[Number,String],default:10},hideNavigation:{type:Array,default:()=>[]},timezone:{type:[String,Object],default:null},vertical:{type:Boolean,default:!1},disableMonthYearSelect:{type:Boolean,default:!1},disableYearSelect:{type:Boolean,default:!1},dayClass:{type:Function,default:null},yearRange:{type:Array,default:()=>[1900,2100]},enableTimePicker:{type:Boolean,default:!0},autoApply:{type:Boolean,default:!1},disabledDates:{type:[Array,Function],default:()=>[]},monthNameFormat:{type:String,default:"short"},startDate:{type:[Date,String],default:null},startTime:{type:[Object,Array],default:null},hideOffsetDates:{type:Boolean,default:!1},noToday:{type:Boolean,default:!1},disabledWeekDays:{type:Array,default:()=>[]},allowedDates:{type:Array,default:null},nowButtonLabel:{type:String,default:"Now"},markers:{type:Array,default:()=>[]},escClose:{type:Boolean,default:!0},spaceConfirm:{type:Boolean,default:!0},monthChangeOnArrows:{type:Boolean,default:!0},presetDates:{type:Array,default:()=>[]},flow:{type:Array,default:()=>[]},partialFlow:{type:Boolean,default:!1},preventMinMaxNavigation:{type:Boolean,default:!1},reverseYears:{type:Boolean,default:!1},weekPicker:{type:Boolean,default:!1},filters:{type:Object,default:()=>({})},arrowNavigation:{type:Boolean,default:!1},highlight:{type:[Function,Object],default:null},teleport:{type:[Boolean,String,Object],default:null},teleportCenter:{type:Boolean,default:!1},locale:{type:String,default:"en-Us"},weekNumName:{type:String,default:"W"},weekStart:{type:[Number,String],default:1},weekNumbers:{type:[String,Function,Object],default:null},monthChangeOnScroll:{type:[Boolean,String],default:!0},dayNames:{type:[Function,Array],default:null},monthPicker:{type:Boolean,default:!1},customProps:{type:Object,default:null},yearPicker:{type:Boolean,default:!1},modelAuto:{type:Boolean,default:!1},selectText:{type:String,default:"Select"},cancelText:{type:String,default:"Cancel"},previewFormat:{type:[String,Function],default:()=>""},multiDates:{type:[Object,Boolean],default:!1},ignoreTimeValidation:{type:Boolean,default:!1},minDate:{type:[Date,String],default:null},maxDate:{type:[Date,String],default:null},minTime:{type:Object,default:null},maxTime:{type:Object,default:null},name:{type:String,default:null},placeholder:{type:String,default:""},hideInputIcon:{type:Boolean,default:!1},clearable:{type:Boolean,default:!0},state:{type:Boolean,default:null},required:{type:Boolean,default:!1},autocomplete:{type:String,default:"off"},timePicker:{type:Boolean,default:!1},enableSeconds:{type:Boolean,default:!1},is24:{type:Boolean,default:!0},noHoursOverlay:{type:Boolean,default:!1},noMinutesOverlay:{type:Boolean,default:!1},noSecondsOverlay:{type:Boolean,default:!1},hoursGridIncrement:{type:[String,Number],default:1},minutesGridIncrement:{type:[String,Number],default:5},secondsGridIncrement:{type:[String,Number],default:5},hoursIncrement:{type:[Number,String],default:1},minutesIncrement:{type:[Number,String],default:1},secondsIncrement:{type:[Number,String],default:1},range:{type:[Boolean,Object],default:!1},uid:{type:String,default:null},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},inline:{type:[Boolean,Object],default:!1},textInput:{type:[Boolean,Object],default:!1},sixWeeks:{type:[Boolean,String],default:!1},actionRow:{type:Object,default:()=>({})},focusStartDate:{type:Boolean,default:!1},disabledTimes:{type:[Function,Array],default:void 0},timePickerInline:{type:Boolean,default:!1},calendar:{type:Function,default:null},config:{type:Object,default:void 0},quarterPicker:{type:Boolean,default:!1},yearFirst:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},onInternalModelChange:{type:[Function,Object],default:null},enableMinutes:{type:Boolean,default:!0},ui:{type:Object,default:()=>({})}},yt={...Ya,shadow:{type:Boolean,default:!1},flowStep:{type:Number,default:0},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},menuWrapRef:{type:Object,default:null},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},Si=["title"],Ri=["disabled"],Ii=ze({compatConfig:{MODE:3},__name:"ActionRow",props:{menuMount:{type:Boolean,default:!1},calendarWidth:{type:Number,default:0},...yt},emits:["close-picker","select-date","select-now","invalid-select"],setup(e,{emit:t}){const n=t,a=e,{defaultedActionRow:r,defaultedPreviewFormat:l,defaultedMultiCalendars:i,defaultedTextInput:p,defaultedInline:c,defaultedRange:C,defaultedMultiDates:m}=Se(a),{isTimeValid:v,isMonthValid:h}=Et(a),{buildMatrix:k}=It(),Y=Z(null),f=Z(null),S=Z(!1),I=Z({}),U=Z(null),A=Z(null);Ke(()=>{a.arrowNavigation&&k([Fe(Y),Fe(f)],"actionRow"),q(),window.addEventListener("resize",q)}),Ca(()=>{window.removeEventListener("resize",q)});const q=()=>{S.value=!1,setTimeout(()=>{var g,D;const y=(g=U.value)==null?void 0:g.getBoundingClientRect(),H=(D=A.value)==null?void 0:D.getBoundingClientRect();y&&H&&(I.value.maxWidth=`${H.width-y.width-20}px`),S.value=!0},0)},ae=G(()=>C.value.enabled&&!C.value.partialRange&&a.internalModelValue?a.internalModelValue.length===2:!0),E=G(()=>!v.value(a.internalModelValue)||!h.value(a.internalModelValue)||!ae.value),B=()=>{const g=l.value;return a.timePicker||a.monthPicker,g(qe(a.internalModelValue))},ne=()=>{const g=a.internalModelValue;return i.value.count>0?`${F(g[0])} - ${F(g[1])}`:[F(g[0]),F(g[1])]},F=g=>Dr(g,l.value,a.formatLocale,p.value.rangeSeparator,a.modelAuto,l.value),N=G(()=>!a.internalModelValue||!a.menuMount?"":typeof l.value=="string"?Array.isArray(a.internalModelValue)?a.internalModelValue.length===2&&a.internalModelValue[1]?ne():m.value.enabled?a.internalModelValue.map(g=>`${F(g)}`):a.modelAuto?`${F(a.internalModelValue[0])}`:`${F(a.internalModelValue[0])} -`:F(a.internalModelValue):B()),ie=()=>m.value.enabled?"; ":" - ",ce=G(()=>Array.isArray(N.value)?N.value.join(ie()):N.value),pe=()=>{v.value(a.internalModelValue)&&h.value(a.internalModelValue)&&ae.value?n("select-date"):n("invalid-select")};return(g,D)=>(P(),W("div",{ref_key:"actionRowRef",ref:A,class:"dp__action_row"},[g.$slots["action-row"]?ue(g.$slots,"action-row",We(Qe({key:0},{internalModelValue:g.internalModelValue,disabled:E.value,selectDate:()=>g.$emit("select-date"),closePicker:()=>g.$emit("close-picker")}))):(P(),W(we,{key:1},[d(r).showPreview?(P(),W("div",{key:0,class:"dp__selection_preview",title:ce.value,style:dt(I.value)},[g.$slots["action-preview"]&&S.value?ue(g.$slots,"action-preview",{key:0,value:g.internalModelValue}):j("",!0),!g.$slots["action-preview"]&&S.value?(P(),W(we,{key:1},[Dt(Ge(ce.value),1)],64)):j("",!0)],12,Si)):j("",!0),ye("div",{ref_key:"actionBtnContainer",ref:U,class:"dp__action_buttons","data-dp-element":"action-row"},[g.$slots["action-buttons"]?ue(g.$slots,"action-buttons",{key:0,value:g.internalModelValue}):j("",!0),g.$slots["action-buttons"]?j("",!0):(P(),W(we,{key:1},[!d(c).enabled&&d(r).showCancel?(P(),W("button",{key:0,ref_key:"cancelButtonRef",ref:Y,type:"button",class:"dp__action_button dp__action_cancel",onClick:D[0]||(D[0]=y=>g.$emit("close-picker")),onKeydown:D[1]||(D[1]=y=>d(et)(y,()=>g.$emit("close-picker")))},Ge(g.cancelText),545)):j("",!0),d(r).showNow?(P(),W("button",{key:1,type:"button",class:"dp__action_button dp__action_cancel",onClick:D[2]||(D[2]=y=>g.$emit("select-now")),onKeydown:D[3]||(D[3]=y=>d(et)(y,()=>g.$emit("select-now")))},Ge(g.nowButtonLabel),33)):j("",!0),d(r).showSelect?(P(),W("button",{key:2,ref_key:"selectButtonRef",ref:f,type:"button",class:"dp__action_button dp__action_select",disabled:E.value,"data-test":"select-button",onKeydown:D[4]||(D[4]=y=>d(et)(y,()=>pe())),onClick:pe},Ge(g.selectText),41,Ri)):j("",!0)],64))],512)],64))],512))}}),Ei=["role","aria-label","tabindex"],Bi={class:"dp__selection_grid_header"},Ni=["aria-selected","aria-disabled","data-test","onClick","onKeydown","onMouseover"],Li=["aria-label"],ya=ze({__name:"SelectionOverlay",props:{items:{},type:{},isLast:{type:Boolean},arrowNavigation:{type:Boolean},skipButtonRef:{type:Boolean},headerRefs:{},hideNavigation:{},escClose:{type:Boolean},useRelative:{type:Boolean},height:{},textInput:{type:[Boolean,Object]},config:{},noOverlayFocus:{type:Boolean},focusValue:{},menuWrapRef:{},ariaLabels:{},overlayLabel:{}},emits:["selected","toggle","reset-flow","hover-value"],setup(e,{expose:t,emit:n}){const{setSelectionGrid:a,buildMultiLevelMatrix:r,setMonthPicker:l}=It(),i=n,p=e,{defaultedAriaLabels:c,defaultedTextInput:C,defaultedConfig:m}=Se(p),{hideNavigationButtons:v}=Ia(),h=Z(!1),k=Z(null),Y=Z(null),f=Z([]),S=Z(),I=Z(null),U=Z(0),A=Z(null);Hr(()=>{k.value=null}),Ke(()=>{it().then(()=>ie()),p.noOverlayFocus||ae(),q(!0)}),Ca(()=>q(!1));const q=V=>{var M;p.arrowNavigation&&((M=p.headerRefs)!=null&&M.length?l(V):a(V))},ae=()=>{var V;const M=Fe(Y);M&&(C.value.enabled||(k.value?(V=k.value)==null||V.focus({preventScroll:!0}):M.focus({preventScroll:!0})),h.value=M.clientHeight({dp__overlay:!0,"dp--overlay-absolute":!p.useRelative,"dp--overlay-relative":p.useRelative})),B=G(()=>p.useRelative?{height:`${p.height}px`,width:"var(--dp-menu-min-width)"}:void 0),ne=G(()=>({dp__overlay_col:!0})),F=G(()=>({dp__btn:!0,dp__button:!0,dp__overlay_action:!0,dp__over_action_scroll:h.value,dp__button_bottom:p.isLast})),N=G(()=>{var V,M;return{dp__overlay_container:!0,dp__container_flex:((V=p.items)==null?void 0:V.length)<=6,dp__container_block:((M=p.items)==null?void 0:M.length)>6}});ct(()=>p.items,()=>ie(!1),{deep:!0});const ie=(V=!0)=>{it().then(()=>{const M=Fe(k),o=Fe(Y),w=Fe(I),z=Fe(A),u=w?w.getBoundingClientRect().height:0;o&&(o.getBoundingClientRect().height?U.value=o.getBoundingClientRect().height-u:U.value=m.value.modeHeight-u),M&&z&&V&&(z.scrollTop=M.offsetTop-z.offsetTop-(U.value/2-M.getBoundingClientRect().height)-u)})},ce=V=>{V.disabled||i("selected",V.value)},pe=()=>{i("toggle"),i("reset-flow")},g=()=>{p.escClose&&pe()},D=(V,M,o,w)=>{V&&((M.active||M.value===p.focusValue)&&(k.value=V),p.arrowNavigation&&(Array.isArray(f.value[o])?f.value[o][w]=V:f.value[o]=[V],y()))},y=()=>{var V,M;const o=(V=p.headerRefs)!=null&&V.length?[p.headerRefs].concat(f.value):f.value.concat([p.skipButtonRef?[]:[I.value]]);r(qe(o),(M=p.headerRefs)!=null&&M.length?"monthPicker":"selectionGrid")},H=V=>{p.arrowNavigation||Yt(V,m.value,!0)},re=V=>{S.value=V,i("hover-value",V)},R=()=>{if(pe(),!p.isLast){const V=on(p.menuWrapRef??null,"action-row");if(V){const M=gr(V);M?.focus()}}},b=V=>{switch(V.key){case $e.esc:return g();case $e.arrowLeft:return H(V);case $e.arrowRight:return H(V);case $e.arrowUp:return H(V);case $e.arrowDown:return H(V);default:return}},oe=V=>{if(V.key===$e.enter)return pe();if(V.key===$e.tab)return R()};return t({focusGrid:ae}),(V,M)=>{var o;return P(),W("div",{ref_key:"gridWrapRef",ref:Y,class:ke(E.value),style:dt(B.value),role:V.useRelative?void 0:"dialog","aria-label":V.overlayLabel,tabindex:V.useRelative?void 0:"0",onKeydown:b,onClick:M[0]||(M[0]=va(()=>{},["prevent"]))},[ye("div",{ref_key:"containerRef",ref:A,class:ke(N.value),style:dt({"--dp-overlay-height":`${U.value}px`}),role:"grid"},[ye("div",Bi,[ue(V.$slots,"header")]),V.$slots.overlay?ue(V.$slots,"overlay",{key:0}):(P(!0),W(we,{key:1},Ye(V.items,(w,z)=>(P(),W("div",{key:z,class:ke(["dp__overlay_row",{dp__flex_row:V.items.length>=3}]),role:"row"},[(P(!0),W(we,null,Ye(w,(u,le)=>(P(),W("div",{key:u.value,ref_for:!0,ref:fe=>D(fe,u,z,le),role:"gridcell",class:ke(ne.value),"aria-selected":u.active||void 0,"aria-disabled":u.disabled||void 0,tabindex:"0","data-test":u.text,onClick:va(fe=>ce(u),["prevent"]),onKeydown:fe=>d(et)(fe,()=>ce(u),!0),onMouseover:fe=>re(u.value)},[ye("div",{class:ke(u.className)},[V.$slots.item?ue(V.$slots,"item",{key:0,item:u}):j("",!0),V.$slots.item?j("",!0):(P(),W(we,{key:1},[Dt(Ge(u.text),1)],64))],2)],42,Ni))),128))],2))),128))],6),V.$slots["button-icon"]?Ma((P(),W("button",{key:0,ref_key:"toggleButton",ref:I,type:"button","aria-label":(o=d(c))==null?void 0:o.toggleOverlay,class:ke(F.value),tabindex:"0",onClick:pe,onKeydown:oe},[ue(V.$slots,"button-icon")],42,Li)),[[Da,!d(v)(V.hideNavigation,V.type)]]):j("",!0)],46,Ei)}}}),Sa=ze({__name:"InstanceWrap",props:{multiCalendars:{},stretch:{type:Boolean},collapse:{type:Boolean}},setup(e){const t=e,n=G(()=>t.multiCalendars>0?[...Array(t.multiCalendars).keys()]:[0]),a=G(()=>({dp__instance_calendar:t.multiCalendars>0}));return(r,l)=>(P(),W("div",{class:ke({dp__menu_inner:!r.stretch,"dp--menu--inner-stretched":r.stretch,dp__flex_display:r.multiCalendars>0,"dp--flex-display-collapsed":r.collapse})},[(P(!0),W(we,null,Ye(n.value,(i,p)=>(P(),W("div",{key:i,class:ke(a.value)},[ue(r.$slots,"default",{instance:i,index:p})],2))),128))],2))}}),Hi=["data-dp-element","aria-label","aria-disabled"],da=ze({compatConfig:{MODE:3},__name:"ArrowBtn",props:{ariaLabel:{},elName:{},disabled:{type:Boolean}},emits:["activate","set-ref"],setup(e,{emit:t}){const n=t,a=Z(null);return Ke(()=>n("set-ref",a)),(r,l)=>(P(),W("button",{ref_key:"elRef",ref:a,type:"button","data-dp-element":r.elName,class:"dp__btn dp--arrow-btn-nav",tabindex:"0","aria-label":r.ariaLabel,"aria-disabled":r.disabled||void 0,onClick:l[0]||(l[0]=i=>r.$emit("activate")),onKeydown:l[1]||(l[1]=i=>d(et)(i,()=>r.$emit("activate"),!0))},[ye("span",{class:ke(["dp__inner_nav",{dp__inner_nav_disabled:r.disabled}])},[ue(r.$slots,"default")],2)],40,Hi))}}),Vi=["aria-label","data-test"],Cr=ze({__name:"YearModePicker",props:{...yt,showYearPicker:{type:Boolean,default:!1},items:{type:Array,default:()=>[]},instance:{type:Number,default:0},year:{type:Number,default:0},isDisabled:{type:Function,default:()=>!1}},emits:["toggle-year-picker","year-select","handle-year"],setup(e,{emit:t}){const n=t,a=e,{showRightIcon:r,showLeftIcon:l}=Ia(),{defaultedConfig:i,defaultedMultiCalendars:p,defaultedAriaLabels:c,defaultedTransitions:C,defaultedUI:m}=Se(a),{showTransition:v,transitionName:h}=ga(C),k=Z(!1),Y=(I=!1,U)=>{k.value=!k.value,n("toggle-year-picker",{flow:I,show:U})},f=I=>{k.value=!1,n("year-select",I)},S=(I=!1)=>{n("handle-year",I)};return(I,U)=>{var A,q,ae,E,B;return P(),W(we,null,[ye("div",{class:ke(["dp--year-mode-picker",{"dp--hidden-el":k.value}])},[d(l)(d(p),e.instance)?(P(),De(da,{key:0,ref:"mpPrevIconRef","aria-label":(A=d(c))==null?void 0:A.prevYear,disabled:e.isDisabled(!1),class:ke((q=d(m))==null?void 0:q.navBtnPrev),onActivate:U[0]||(U[0]=ne=>S(!1))},{default:_e(()=>[I.$slots["arrow-left"]?ue(I.$slots,"arrow-left",{key:0}):j("",!0),I.$slots["arrow-left"]?j("",!0):(P(),De(d(fn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0),ye("button",{ref:"mpYearButtonRef",class:"dp__btn dp--year-select",type:"button","aria-label":`${e.year}-${(ae=d(c))==null?void 0:ae.openYearsOverlay}`,"data-test":`year-mode-btn-${e.instance}`,onClick:U[1]||(U[1]=()=>Y(!1)),onKeydown:U[2]||(U[2]=Vr(()=>Y(!1),["enter"]))},[I.$slots.year?ue(I.$slots,"year",{key:0,year:e.year}):j("",!0),I.$slots.year?j("",!0):(P(),W(we,{key:1},[Dt(Ge(e.year),1)],64))],40,Vi),d(r)(d(p),e.instance)?(P(),De(da,{key:1,ref:"mpNextIconRef","aria-label":(E=d(c))==null?void 0:E.nextYear,disabled:e.isDisabled(!0),class:ke((B=d(m))==null?void 0:B.navBtnNext),onActivate:U[3]||(U[3]=ne=>S(!0))},{default:_e(()=>[I.$slots["arrow-right"]?ue(I.$slots,"arrow-right",{key:0}):j("",!0),I.$slots["arrow-right"]?j("",!0):(P(),De(d(hn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0)],2),ot(ta,{name:d(h)(e.showYearPicker),css:d(v)},{default:_e(()=>{var ne,F;return[e.showYearPicker?(P(),De(ya,{key:0,items:e.items,"text-input":I.textInput,"esc-close":I.escClose,config:I.config,"is-last":I.autoApply&&!d(i).keepActionRow,"hide-navigation":I.hideNavigation,"aria-labels":I.ariaLabels,"overlay-label":(F=(ne=d(c))==null?void 0:ne.yearPicker)==null?void 0:F.call(ne,!0),type:"year",onToggle:Y,onSelected:U[4]||(U[4]=N=>f(N))},je({"button-icon":_e(()=>[I.$slots["calendar-icon"]?ue(I.$slots,"calendar-icon",{key:0}):j("",!0),I.$slots["calendar-icon"]?j("",!0):(P(),De(d(aa),{key:1}))]),_:2},[I.$slots["year-overlay-value"]?{name:"item",fn:_e(({item:N})=>[ue(I.$slots,"year-overlay-value",{text:N.text,value:N.value})]),key:"0"}:void 0]),1032,["items","text-input","esc-close","config","is-last","hide-navigation","aria-labels","overlay-label"])):j("",!0)]}),_:3},8,["name","css"])],64)}}}),Dn=(e,t,n)=>{if(t.value&&Array.isArray(t.value))if(t.value.some(a=>Me(e,a))){const a=t.value.filter(r=>!Me(r,e));t.value=a.length?a:null}else(n&&+n>t.value.length||!n)&&t.value.push(e);else t.value=[e]},Tn=(e,t,n)=>{let a=e.value?e.value.slice():[];return a.length===2&&a[1]!==null&&(a=[]),a.length?Ie(t,a[0])?(a.unshift(t),n("range-start",a[0]),n("range-start",a[1])):(a[1]=t,n("range-end",t)):(a=[t],n("range-start",t)),a},Ra=(e,t,n,a)=>{e&&(e[0]&&e[1]&&n&&t("auto-apply"),e[0]&&!e[1]&&a&&n&&t("auto-apply"))},Or=e=>{Array.isArray(e.value)&&e.value.length<=2&&e.range?e.modelValue.value=e.value.map(t=>nt(Q(t),e.timezone)):Array.isArray(e.value)||(e.modelValue.value=nt(Q(e.value),e.timezone))},$r=(e,t,n,a)=>Array.isArray(t.value)&&(t.value.length===2||t.value.length===1&&a.value.partialRange)?a.value.fixedStart&&(Ne(e,t.value[0])||Me(e,t.value[0]))?[t.value[0],e]:a.value.fixedEnd&&(Ie(e,t.value[1])||Me(e,t.value[1]))?[e,t.value[1]]:(n("invalid-fixed-range",e),t.value):[],Yr=({multiCalendars:e,range:t,highlight:n,propDates:a,calendars:r,modelValue:l,props:i,filters:p,year:c,month:C,emit:m})=>{const v=G(()=>_n(i.yearRange,i.locale,i.reverseYears)),h=Z([!1]),k=G(()=>(N,ie)=>{const ce=Ce(pt(new Date),{month:C.value(N),year:c.value(N)}),pe=ie?tr(ce):ma(ce);return Mr(pe,a.value.maxDate,a.value.minDate,i.preventMinMaxNavigation,ie)}),Y=()=>Array.isArray(l.value)&&e.value.solo&&l.value[1],f=()=>{for(let N=0;N{if(!N)return f();const ie=Ce(Q(),r.value[N]);return r.value[0].year=he(pr(ie,e.value.count-1)),f()},I=(N,ie)=>{const ce=Zr(ie,N);return t.value.showLastInRange&&ce>1?ie:N},U=N=>i.focusStartDate||e.value.solo?N[0]:N[1]?I(N[0],N[1]):N[0],A=()=>{if(l.value){const N=Array.isArray(l.value)?U(l.value):l.value;r.value[0]={month:xe(N),year:he(N)}}},q=()=>{A(),e.value.count&&f()};ct(l,(N,ie)=>{i.isTextInputDate&&JSON.stringify(N??{})!==JSON.stringify(ie??{})&&q()}),Ke(()=>{q()});const ae=(N,ie)=>{r.value[ie].year=N,m("update-month-year",{instance:ie,year:N,month:r.value[ie].month}),e.value.count&&!e.value.solo&&S(ie)},E=G(()=>N=>Zt(v.value,ie=>{var ce;const pe=c.value(N)===ie.value,g=fa(ie.value,ea(a.value.minDate),ea(a.value.maxDate))||((ce=p.value.years)==null?void 0:ce.includes(c.value(N))),D=Mn(n.value,ie.value);return{active:pe,disabled:g,highlighted:D}})),B=(N,ie)=>{ae(N,ie),F(ie)},ne=(N,ie=!1)=>{if(!k.value(N,ie)){const ce=ie?c.value(N)+1:c.value(N)-1;ae(ce,N)}},F=(N,ie=!1,ce)=>{ie||m("reset-flow"),ce!==void 0?h.value[N]=ce:h.value[N]=!h.value[N],h.value[N]?m("overlay-toggle",{open:!0,overlay:Xe.year}):(m("overlay-closed"),m("overlay-toggle",{open:!1,overlay:Xe.year}))};return{isDisabled:k,groupedYears:E,showYearPicker:h,selectYear:ae,toggleYearPicker:F,handleYearSelect:B,handleYear:ne}},Fi=(e,t)=>{const{defaultedMultiCalendars:n,defaultedAriaLabels:a,defaultedTransitions:r,defaultedConfig:l,defaultedRange:i,defaultedHighlight:p,propDates:c,defaultedTz:C,defaultedFilters:m,defaultedMultiDates:v}=Se(e),h=()=>{e.isTextInputDate&&q(he(Q(e.startDate)),0)},{modelValue:k,year:Y,month:f,calendars:S}=ba(e,t,h),I=G(()=>hr(e.formatLocale,e.locale,e.monthNameFormat)),U=Z(null),{checkMinMaxRange:A}=Et(e),{selectYear:q,groupedYears:ae,showYearPicker:E,toggleYearPicker:B,handleYearSelect:ne,handleYear:F,isDisabled:N}=Yr({modelValue:k,multiCalendars:n,range:i,highlight:p,calendars:S,year:Y,propDates:c,month:f,filters:m,props:e,emit:t});Ke(()=>{e.startDate&&(k.value&&e.focusStartDate||!k.value)&&q(he(Q(e.startDate)),0)});const ie=o=>o?{month:xe(o),year:he(o)}:{month:null,year:null},ce=()=>k.value?Array.isArray(k.value)?k.value.map(o=>ie(o)):ie(k.value):ie(),pe=(o,w)=>{const z=S.value[o],u=ce();return Array.isArray(u)?u.some(le=>le.year===z?.year&&le.month===w):z?.year===u.year&&w===u.month},g=(o,w,z)=>{var u,le;const fe=ce();return Array.isArray(fe)?Y.value(w)===((u=fe[z])==null?void 0:u.year)&&o===((le=fe[z])==null?void 0:le.month):!1},D=(o,w)=>{if(i.value.enabled){const z=ce();if(Array.isArray(k.value)&&Array.isArray(z)){const u=g(o,w,0)||g(o,w,1),le=Mt(pt(Q()),o,Y.value(w));return $a(k.value,U.value,le)&&!u}return!1}return!1},y=G(()=>o=>Zt(I.value,w=>{var z;const u=pe(o,w.value),le=fa(w.value,wr(Y.value(o),c.value.minDate),_r(Y.value(o),c.value.maxDate))||mi(c.value.disabledDates,Y.value(o)).includes(w.value)||((z=m.value.months)==null?void 0:z.includes(w.value)),fe=D(w.value,o),Ve=Tr(p.value,w.value,Y.value(o));return{active:u,disabled:le,isBetween:fe,highlighted:Ve}})),H=(o,w)=>Mt(pt(Q()),o,Y.value(w)),re=(o,w)=>{const z=k.value?k.value:pt(new Date);k.value=Mt(z,o,Y.value(w)),t("auto-apply"),t("update-flow-step")},R=(o,w)=>{const z=H(o,w);i.value.fixedEnd||i.value.fixedStart?k.value=$r(z,k,t,i):k.value?A(z,k.value)&&(k.value=Tn(k,H(o,w),t)):k.value=[H(o,w)],it().then(()=>{Ra(k.value,t,e.autoApply,e.modelAuto)})},b=(o,w)=>{Dn(H(o,w),k,v.value.limit),t("auto-apply",!0)},oe=(o,w)=>(S.value[w].month=o,M(w,S.value[w].year,o),v.value.enabled?b(o,w):i.value.enabled?R(o,w):re(o,w)),V=(o,w)=>{q(o,w),M(w,o,null)},M=(o,w,z)=>{let u=z;if(!u&&u!==0){const le=ce();u=Array.isArray(le)?le[o].month:le.month}t("update-month-year",{instance:o,year:w,month:u})};return{groupedMonths:y,groupedYears:ae,year:Y,isDisabled:N,defaultedMultiCalendars:n,defaultedAriaLabels:a,defaultedTransitions:r,defaultedConfig:l,showYearPicker:E,modelValue:k,presetDate:(o,w)=>{Or({value:o,modelValue:k,range:i.value.enabled,timezone:w?void 0:C.value.timezone}),t("auto-apply")},setHoverDate:(o,w)=>{U.value=H(o,w)},selectMonth:oe,selectYear:V,toggleYearPicker:B,handleYearSelect:ne,handleYear:F,getModelMonthYear:ce}},qi=ze({compatConfig:{MODE:3},__name:"MonthPicker",props:{...yt},emits:["update:internal-model-value","overlay-closed","reset-flow","range-start","range-end","auto-apply","update-month-year","update-flow-step","mount","invalid-fixed-range","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=qt(),l=lt(r,"yearMode"),i=e;Ke(()=>{i.shadow||a("mount",null)});const{groupedMonths:p,groupedYears:c,year:C,isDisabled:m,defaultedMultiCalendars:v,defaultedConfig:h,showYearPicker:k,modelValue:Y,presetDate:f,setHoverDate:S,selectMonth:I,selectYear:U,toggleYearPicker:A,handleYearSelect:q,handleYear:ae,getModelMonthYear:E}=Fi(i,a);return t({getSidebarProps:()=>({modelValue:Y,year:C,getModelMonthYear:E,selectMonth:I,selectYear:U,handleYear:ae}),presetDate:f,toggleYearPicker:B=>A(0,B)}),(B,ne)=>(P(),De(Sa,{"multi-calendars":d(v).count,collapse:B.collapse,stretch:""},{default:_e(({instance:F})=>[B.$slots["top-extra"]?ue(B.$slots,"top-extra",{key:0,value:B.internalModelValue}):j("",!0),B.$slots["month-year"]?ue(B.$slots,"month-year",We(Qe({key:1},{year:d(C),months:d(p)(F),years:d(c)(F),selectMonth:d(I),selectYear:d(U),instance:F}))):(P(),De(ya,{key:2,items:d(p)(F),"arrow-navigation":B.arrowNavigation,"is-last":B.autoApply&&!d(h).keepActionRow,"esc-close":B.escClose,height:d(h).modeHeight,config:B.config,"no-overlay-focus":!!(B.noOverlayFocus||B.textInput),"use-relative":"",type:"month",onSelected:N=>d(I)(N,F),onHoverValue:N=>d(S)(N,F)},je({header:_e(()=>[ot(Cr,Qe(B.$props,{items:d(c)(F),instance:F,"show-year-picker":d(k)[F],year:d(C)(F),"is-disabled":N=>d(m)(F,N),onHandleYear:N=>d(ae)(F,N),onYearSelect:N=>d(q)(N,F),onToggleYearPicker:N=>d(A)(F,N?.flow,N?.show)}),je({_:2},[Ye(d(l),(N,ie)=>({name:N,fn:_e(ce=>[ue(B.$slots,N,We(at(ce)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),_:2},[B.$slots["month-overlay-value"]?{name:"item",fn:_e(({item:N})=>[ue(B.$slots,"month-overlay-value",{text:N.text,value:N.value})]),key:"0"}:void 0]),1032,["items","arrow-navigation","is-last","esc-close","height","config","no-overlay-focus","onSelected","onHoverValue"]))]),_:3},8,["multi-calendars","collapse"]))}}),Wi=(e,t)=>{const n=()=>{e.isTextInputDate&&(m.value=he(Q(e.startDate)))},{modelValue:a}=ba(e,t,n),r=Z(null),{defaultedHighlight:l,defaultedMultiDates:i,defaultedFilters:p,defaultedRange:c,propDates:C}=Se(e),m=Z();Ke(()=>{e.startDate&&(a.value&&e.focusStartDate||!a.value)&&(m.value=he(Q(e.startDate)))});const v=f=>Array.isArray(a.value)?a.value.some(S=>he(S)===f):a.value?he(a.value)===f:!1,h=f=>c.value.enabled&&Array.isArray(a.value)?$a(a.value,r.value,Y(f)):!1,k=G(()=>Zt(_n(e.yearRange,e.locale,e.reverseYears),f=>{const S=v(f.value),I=fa(f.value,ea(C.value.minDate),ea(C.value.maxDate))||p.value.years.includes(f.value),U=h(f.value)&&!S,A=Mn(l.value,f.value);return{active:S,disabled:I,isBetween:U,highlighted:A}})),Y=f=>_t(pt(ma(new Date)),f);return{groupedYears:k,modelValue:a,focusYear:m,setHoverValue:f=>{r.value=_t(pt(new Date),f)},selectYear:f=>{var S;if(t("update-month-year",{instance:0,year:f}),i.value.enabled)return a.value?Array.isArray(a.value)&&(((S=a.value)==null?void 0:S.map(I=>he(I))).includes(f)?a.value=a.value.filter(I=>he(I)!==f):a.value.push(_t(tt(Q()),f))):a.value=[_t(tt(ma(Q())),f)],t("auto-apply",!0);c.value.enabled?(a.value=Tn(a,Y(f),t),it().then(()=>{Ra(a.value,t,e.autoApply,e.modelAuto)})):(a.value=Y(f),t("auto-apply"))}}},Qi=ze({compatConfig:{MODE:3},__name:"YearPicker",props:{...yt},emits:["update:internal-model-value","reset-flow","range-start","range-end","auto-apply","update-month-year"],setup(e,{expose:t,emit:n}){const a=n,r=e,{groupedYears:l,modelValue:i,focusYear:p,selectYear:c,setHoverValue:C}=Wi(r,a),{defaultedConfig:m}=Se(r);return t({getSidebarProps:()=>({modelValue:i,selectYear:c})}),(v,h)=>(P(),W("div",null,[v.$slots["top-extra"]?ue(v.$slots,"top-extra",{key:0,value:v.internalModelValue}):j("",!0),v.$slots["month-year"]?ue(v.$slots,"month-year",We(Qe({key:1},{years:d(l),selectYear:d(c)}))):(P(),De(ya,{key:2,items:d(l),"is-last":v.autoApply&&!d(m).keepActionRow,height:d(m).modeHeight,config:v.config,"no-overlay-focus":!!(v.noOverlayFocus||v.textInput),"focus-value":d(p),type:"year","use-relative":"",onSelected:d(c),onHoverValue:d(C)},je({_:2},[v.$slots["year-overlay-value"]?{name:"item",fn:_e(({item:k})=>[ue(v.$slots,"year-overlay-value",{text:k.text,value:k.value})]),key:"0"}:void 0]),1032,["items","is-last","height","config","no-overlay-focus","focus-value","onSelected","onHoverValue"]))]))}}),zi={key:0,class:"dp__time_input"},Ui=["data-test","aria-label","onKeydown","onClick","onMousedown"],Xi=["aria-label","disabled","data-test","onKeydown","onClick"],Gi=["data-test","aria-label","onKeydown","onClick","onMousedown"],ji={key:0},Ki=["aria-label"],Ji=ze({compatConfig:{MODE:3},__name:"TimeInput",props:{hours:{type:Number,default:0},minutes:{type:Number,default:0},seconds:{type:Number,default:0},closeTimePickerBtn:{type:Object,default:null},order:{type:Number,default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...yt},emits:["set-hours","set-minutes","update:hours","update:minutes","update:seconds","reset-flow","mounted","overlay-closed","overlay-opened","am-pm-change"],setup(e,{expose:t,emit:n}){const a=n,r=e,{setTimePickerElements:l,setTimePickerBackRef:i}=It(),{defaultedAriaLabels:p,defaultedTransitions:c,defaultedFilters:C,defaultedConfig:m,defaultedRange:v}=Se(r),{transitionName:h,showTransition:k}=ga(c),Y=ha({hours:!1,minutes:!1,seconds:!1}),f=Z("AM"),S=Z(null),I=Z([]),U=Z(),A=Z(!1);Ke(()=>{a("mounted")});const q=s=>Ce(new Date,{hours:s.hours,minutes:s.minutes,seconds:r.enableSeconds?s.seconds:0,milliseconds:0}),ae=G(()=>s=>H(s,r[s])||B(s,r[s])),E=G(()=>({hours:r.hours,minutes:r.minutes,seconds:r.seconds})),B=(s,L)=>v.value.enabled&&!v.value.disableTimeRangeValidation?!r.validateTime(s,L):!1,ne=(s,L)=>{if(v.value.enabled&&!v.value.disableTimeRangeValidation){const J=L?+r[`${s}Increment`]:-+r[`${s}Increment`],$=r[s]+J;return!r.validateTime(s,$)}return!1},F=G(()=>s=>!V(+r[s]+ +r[`${s}Increment`],s)||ne(s,!0)),N=G(()=>s=>!V(+r[s]-+r[`${s}Increment`],s)||ne(s,!1)),ie=(s,L)=>Xn(Ce(Q(),s),L),ce=(s,L)=>Go(Ce(Q(),s),L),pe=G(()=>({dp__time_col:!0,dp__time_col_block:!r.timePickerInline,dp__time_col_reg_block:!r.enableSeconds&&r.is24&&!r.timePickerInline,dp__time_col_reg_inline:!r.enableSeconds&&r.is24&&r.timePickerInline,dp__time_col_reg_with_button:!r.enableSeconds&&!r.is24,dp__time_col_sec:r.enableSeconds&&r.is24,dp__time_col_sec_with_button:r.enableSeconds&&!r.is24})),g=G(()=>{const s=[{type:"hours"}];return r.enableMinutes&&s.push({type:"",separator:!0},{type:"minutes"}),r.enableSeconds&&s.push({type:"",separator:!0},{type:"seconds"}),s}),D=G(()=>g.value.filter(s=>!s.separator)),y=G(()=>s=>{if(s==="hours"){const L=le(+r.hours);return{text:L<10?`0${L}`:`${L}`,value:L}}return{text:r[s]<10?`0${r[s]}`:`${r[s]}`,value:r[s]}}),H=(s,L)=>{var J;if(!r.disabledTimesConfig)return!1;const $=r.disabledTimesConfig(r.order,s==="hours"?L:void 0);return $[s]?!!((J=$[s])!=null&&J.includes(L)):!0},re=(s,L)=>L!=="hours"||f.value==="AM"?s:s+12,R=s=>{const L=r.is24?24:12,J=s==="hours"?L:60,$=+r[`${s}GridIncrement`],ge=s==="hours"&&!r.is24?$:0,x=[];for(let X=ge;X({active:!1,disabled:C.value.times[s].includes(X.value)||!V(X.value,s)||H(s,X.value)||B(s,X.value)}))},b=s=>s>=0?s:59,oe=s=>s>=0?s:23,V=(s,L)=>{const J=r.minTime?q(za(r.minTime)):null,$=r.maxTime?q(za(r.maxTime)):null,ge=q(za(E.value,L,L==="minutes"||L==="seconds"?b(s):oe(s)));return J&&$?(pa(ge,$)||Xt(ge,$))&&(Kt(ge,J)||Xt(ge,J)):J?Kt(ge,J)||Xt(ge,J):$?pa(ge,$)||Xt(ge,$):!0},M=s=>r[`no${s[0].toUpperCase()+s.slice(1)}Overlay`],o=s=>{M(s)||(Y[s]=!Y[s],Y[s]?(A.value=!0,a("overlay-opened",s)):(A.value=!1,a("overlay-closed",s)))},w=s=>s==="hours"?Tt:s==="minutes"?Rt:jt,z=()=>{U.value&&clearTimeout(U.value)},u=(s,L=!0,J)=>{const $=L?ie:ce,ge=L?+r[`${s}Increment`]:-+r[`${s}Increment`];V(+r[s]+ge,s)&&a(`update:${s}`,w(s)($({[s]:+r[s]},{[s]:+r[`${s}Increment`]}))),!(J!=null&&J.keyboard)&&m.value.timeArrowHoldThreshold&&(U.value=setTimeout(()=>{u(s,L)},m.value.timeArrowHoldThreshold))},le=s=>r.is24?s:(s>=12?f.value="PM":f.value="AM",ti(s)),fe=()=>{f.value==="PM"?(f.value="AM",a("update:hours",r.hours-12)):(f.value="PM",a("update:hours",r.hours+12)),a("am-pm-change",f.value)},Ve=s=>{Y[s]=!0},T=(s,L,J)=>{if(s&&r.arrowNavigation){Array.isArray(I.value[L])?I.value[L][J]=s:I.value[L]=[s];const $=I.value.reduce((ge,x)=>x.map((X,de)=>[...ge[de]||[],x[de]]),[]);i(r.closeTimePickerBtn),S.value&&($[1]=$[1].concat(S.value)),l($,r.order)}},K=(s,L)=>(o(s),a(`update:${s}`,L));return t({openChildCmp:Ve}),(s,L)=>{var J;return s.disabled?j("",!0):(P(),W("div",zi,[(P(!0),W(we,null,Ye(g.value,($,ge)=>{var x,X,de;return P(),W("div",{key:ge,class:ke(pe.value)},[$.separator?(P(),W(we,{key:0},[A.value?j("",!0):(P(),W(we,{key:0},[Dt(":")],64))],64)):(P(),W(we,{key:1},[ye("button",{ref_for:!0,ref:be=>T(be,ge,0),type:"button",class:ke({dp__btn:!0,dp__inc_dec_button:!s.timePickerInline,dp__inc_dec_button_inline:s.timePickerInline,dp__tp_inline_btn_top:s.timePickerInline,dp__inc_dec_button_disabled:F.value($.type),"dp--hidden-el":A.value}),"data-test":`${$.type}-time-inc-btn-${r.order}`,"aria-label":(x=d(p))==null?void 0:x.incrementValue($.type),tabindex:"0",onKeydown:be=>d(et)(be,()=>u($.type,!0,{keyboard:!0}),!0),onClick:be=>d(m).timeArrowHoldThreshold?void 0:u($.type,!0),onMousedown:be=>d(m).timeArrowHoldThreshold?u($.type,!0):void 0,onMouseup:z},[r.timePickerInline?(P(),W(we,{key:1},[s.$slots["tp-inline-arrow-up"]?ue(s.$slots,"tp-inline-arrow-up",{key:0}):(P(),W(we,{key:1},[L[2]||(L[2]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1)),L[3]||(L[3]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1))],64))],64)):(P(),W(we,{key:0},[s.$slots["arrow-up"]?ue(s.$slots,"arrow-up",{key:0}):j("",!0),s.$slots["arrow-up"]?j("",!0):(P(),De(d(gn),{key:1}))],64))],42,Ui),ye("button",{ref_for:!0,ref:be=>T(be,ge,1),type:"button","aria-label":`${y.value($.type).text}-${(X=d(p))==null?void 0:X.openTpOverlay($.type)}`,class:ke({dp__time_display:!0,dp__time_display_block:!s.timePickerInline,dp__time_display_inline:s.timePickerInline,"dp--time-invalid":ae.value($.type),"dp--time-overlay-btn":!ae.value($.type),"dp--hidden-el":A.value}),disabled:M($.type),tabindex:"0","data-test":`${$.type}-toggle-overlay-btn-${r.order}`,onKeydown:be=>d(et)(be,()=>o($.type),!0),onClick:be=>o($.type)},[s.$slots[$.type]?ue(s.$slots,$.type,{key:0,text:y.value($.type).text,value:y.value($.type).value}):j("",!0),s.$slots[$.type]?j("",!0):(P(),W(we,{key:1},[Dt(Ge(y.value($.type).text),1)],64))],42,Xi),ye("button",{ref_for:!0,ref:be=>T(be,ge,2),type:"button",class:ke({dp__btn:!0,dp__inc_dec_button:!s.timePickerInline,dp__inc_dec_button_inline:s.timePickerInline,dp__tp_inline_btn_bottom:s.timePickerInline,dp__inc_dec_button_disabled:N.value($.type),"dp--hidden-el":A.value}),"data-test":`${$.type}-time-dec-btn-${r.order}`,"aria-label":(de=d(p))==null?void 0:de.decrementValue($.type),tabindex:"0",onKeydown:be=>d(et)(be,()=>u($.type,!1,{keyboard:!0}),!0),onClick:be=>d(m).timeArrowHoldThreshold?void 0:u($.type,!1),onMousedown:be=>d(m).timeArrowHoldThreshold?u($.type,!1):void 0,onMouseup:z},[r.timePickerInline?(P(),W(we,{key:1},[s.$slots["tp-inline-arrow-down"]?ue(s.$slots,"tp-inline-arrow-down",{key:0}):(P(),W(we,{key:1},[L[4]||(L[4]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_l"},null,-1)),L[5]||(L[5]=ye("span",{class:"dp__tp_inline_btn_bar dp__tp_btn_in_r"},null,-1))],64))],64)):(P(),W(we,{key:0},[s.$slots["arrow-down"]?ue(s.$slots,"arrow-down",{key:0}):j("",!0),s.$slots["arrow-down"]?j("",!0):(P(),De(d(bn),{key:1}))],64))],42,Gi)],64))],2)}),128)),s.is24?j("",!0):(P(),W("div",ji,[s.$slots["am-pm-button"]?ue(s.$slots,"am-pm-button",{key:0,toggle:fe,value:f.value}):j("",!0),s.$slots["am-pm-button"]?j("",!0):(P(),W("button",{key:1,ref_key:"amPmButton",ref:S,type:"button",class:"dp__pm_am_button",role:"button","aria-label":(J=d(p))==null?void 0:J.amPmButton,tabindex:"0",onClick:fe,onKeydown:L[0]||(L[0]=$=>d(et)($,()=>fe(),!0))},Ge(f.value),41,Ki))])),(P(!0),W(we,null,Ye(D.value,($,ge)=>(P(),De(ta,{key:ge,name:d(h)(Y[$.type]),css:d(k)},{default:_e(()=>{var x,X;return[Y[$.type]?(P(),De(ya,{key:0,items:R($.type),"is-last":s.autoApply&&!d(m).keepActionRow,"esc-close":s.escClose,type:$.type,"text-input":s.textInput,config:s.config,"arrow-navigation":s.arrowNavigation,"aria-labels":s.ariaLabels,"overlay-label":(X=(x=d(p)).timeOverlay)==null?void 0:X.call(x,$.type),onSelected:de=>K($.type,de),onToggle:de=>o($.type),onResetFlow:L[1]||(L[1]=de=>s.$emit("reset-flow"))},je({"button-icon":_e(()=>[s.$slots["clock-icon"]?ue(s.$slots,"clock-icon",{key:0}):j("",!0),s.$slots["clock-icon"]?j("",!0):(P(),De(Oa(s.timePickerInline?d(aa):d(yn)),{key:1}))]),_:2},[s.$slots[`${$.type}-overlay-value`]?{name:"item",fn:_e(({item:de})=>[ue(s.$slots,`${$.type}-overlay-value`,{text:de.text,value:de.value})]),key:"0"}:void 0,s.$slots[`${$.type}-overlay-header`]?{name:"header",fn:_e(()=>[ue(s.$slots,`${$.type}-overlay-header`,{toggle:()=>o($.type)})]),key:"1"}:void 0]),1032,["items","is-last","esc-close","type","text-input","config","arrow-navigation","aria-labels","overlay-label","onSelected","onToggle"])):j("",!0)]}),_:2},1032,["name","css"]))),128))]))}}}),Zi={class:"dp--tp-wrap"},es=["aria-label","tabindex"],ts=["role","aria-label","tabindex"],as=["aria-label"],Sr=ze({compatConfig:{MODE:3},__name:"TimePicker",props:{hours:{type:[Number,Array],default:0},minutes:{type:[Number,Array],default:0},seconds:{type:[Number,Array],default:0},disabledTimesConfig:{type:Function,default:null},validateTime:{type:Function,default:()=>!1},...yt},emits:["update:hours","update:minutes","update:seconds","mount","reset-flow","overlay-opened","overlay-closed","am-pm-change"],setup(e,{expose:t,emit:n}){const a=n,r=e,{buildMatrix:l,setTimePicker:i}=It(),p=qt(),{defaultedTransitions:c,defaultedAriaLabels:C,defaultedTextInput:m,defaultedConfig:v,defaultedRange:h}=Se(r),{transitionName:k,showTransition:Y}=ga(c),{hideNavigationButtons:f}=Ia(),S=Z(null),I=Z(null),U=Z([]),A=Z(null),q=Z(!1);Ke(()=>{a("mount"),!r.timePicker&&r.arrowNavigation?l([Fe(S.value)],"time"):i(!0,r.timePicker)});const ae=G(()=>h.value.enabled&&r.modelAuto?yr(r.internalModelValue):!0),E=Z(!1),B=R=>({hours:Array.isArray(r.hours)?r.hours[R]:r.hours,minutes:Array.isArray(r.minutes)?r.minutes[R]:r.minutes,seconds:Array.isArray(r.seconds)?r.seconds[R]:r.seconds}),ne=G(()=>{const R=[];if(h.value.enabled)for(let b=0;b<2;b++)R.push(B(b));else R.push(B(0));return R}),F=(R,b=!1,oe="")=>{b||a("reset-flow"),E.value=R,a(R?"overlay-opened":"overlay-closed",Xe.time),r.arrowNavigation&&i(R),it(()=>{oe!==""&&U.value[0]&&U.value[0].openChildCmp(oe)})},N=G(()=>({dp__btn:!0,dp__button:!0,dp__button_bottom:r.autoApply&&!v.value.keepActionRow})),ie=lt(p,"timePicker"),ce=(R,b,oe)=>h.value.enabled?b===0?[R,ne.value[1][oe]]:[ne.value[0][oe],R]:R,pe=R=>{a("update:hours",R)},g=R=>{a("update:minutes",R)},D=R=>{a("update:seconds",R)},y=()=>{if(A.value&&!m.value.enabled&&!r.noOverlayFocus){const R=gr(A.value);R&&R.focus({preventScroll:!0})}},H=R=>{q.value=!1,a("overlay-closed",R)},re=R=>{q.value=!0,a("overlay-opened",R)};return t({toggleTimePicker:F}),(R,b)=>{var oe;return P(),W("div",Zi,[!R.timePicker&&!R.timePickerInline?Ma((P(),W("button",{key:0,ref_key:"openTimePickerBtn",ref:S,type:"button",class:ke({...N.value,"dp--hidden-el":E.value}),"aria-label":(oe=d(C))==null?void 0:oe.openTimePicker,tabindex:R.noOverlayFocus?void 0:0,"data-test":"open-time-picker-btn",onKeydown:b[0]||(b[0]=V=>d(et)(V,()=>F(!0))),onClick:b[1]||(b[1]=V=>F(!0))},[R.$slots["clock-icon"]?ue(R.$slots,"clock-icon",{key:0}):j("",!0),R.$slots["clock-icon"]?j("",!0):(P(),De(d(yn),{key:1}))],42,es)),[[Da,!d(f)(R.hideNavigation,"time")]]):j("",!0),ot(ta,{name:d(k)(E.value),css:d(Y)&&!R.timePickerInline},{default:_e(()=>{var V,M;return[E.value||R.timePicker||R.timePickerInline?(P(),W("div",{key:0,ref_key:"overlayRef",ref:A,role:R.timePickerInline?void 0:"dialog",class:ke({dp__overlay:!R.timePickerInline,"dp--overlay-absolute":!r.timePicker&&!R.timePickerInline,"dp--overlay-relative":r.timePicker}),style:dt(R.timePicker?{height:`${d(v).modeHeight}px`}:void 0),"aria-label":(V=d(C))==null?void 0:V.timePicker,tabindex:R.timePickerInline?void 0:0},[ye("div",{class:ke(R.timePickerInline?"dp__time_picker_inline_container":"dp__overlay_container dp__container_flex dp__time_picker_overlay_container"),style:{display:"flex"}},[R.$slots["time-picker-overlay"]?ue(R.$slots,"time-picker-overlay",{key:0,hours:e.hours,minutes:e.minutes,seconds:e.seconds,setHours:pe,setMinutes:g,setSeconds:D}):j("",!0),R.$slots["time-picker-overlay"]?j("",!0):(P(),W("div",{key:1,class:ke(R.timePickerInline?"dp__flex":"dp__overlay_row dp__flex_row")},[(P(!0),W(we,null,Ye(ne.value,(o,w)=>Ma((P(),De(Ji,Qe({key:w,ref_for:!0},{...R.$props,order:w,hours:o.hours,minutes:o.minutes,seconds:o.seconds,closeTimePickerBtn:I.value,disabledTimesConfig:e.disabledTimesConfig,disabled:w===0?d(h).fixedStart:d(h).fixedEnd},{ref_for:!0,ref_key:"timeInputRefs",ref:U,"validate-time":(z,u)=>e.validateTime(z,ce(u,w,z)),"onUpdate:hours":z=>pe(ce(z,w,"hours")),"onUpdate:minutes":z=>g(ce(z,w,"minutes")),"onUpdate:seconds":z=>D(ce(z,w,"seconds")),onMounted:y,onOverlayClosed:H,onOverlayOpened:re,onAmPmChange:b[2]||(b[2]=z=>R.$emit("am-pm-change",z))}),je({_:2},[Ye(d(ie),(z,u)=>({name:z,fn:_e(le=>[ue(R.$slots,z,Qe({ref_for:!0},le))])}))]),1040,["validate-time","onUpdate:hours","onUpdate:minutes","onUpdate:seconds"])),[[Da,w===0?!0:ae.value]])),128))],2)),!R.timePicker&&!R.timePickerInline?Ma((P(),W("button",{key:2,ref_key:"closeTimePickerBtn",ref:I,type:"button",class:ke({...N.value,"dp--hidden-el":q.value}),"aria-label":(M=d(C))==null?void 0:M.closeTimePicker,tabindex:"0",onKeydown:b[3]||(b[3]=o=>d(et)(o,()=>F(!1))),onClick:b[4]||(b[4]=o=>F(!1))},[R.$slots["calendar-icon"]?ue(R.$slots,"calendar-icon",{key:0}):j("",!0),R.$slots["calendar-icon"]?j("",!0):(P(),De(d(aa),{key:1}))],42,as)),[[Da,!d(f)(R.hideNavigation,"time")]]):j("",!0)],2)],14,ts)):j("",!0)]}),_:3},8,["name","css"])])}}}),Rr=(e,t,n,a)=>{const{defaultedRange:r}=Se(e),l=(A,q)=>Array.isArray(t[A])?t[A][q]:t[A],i=A=>e.enableSeconds?Array.isArray(t.seconds)?t.seconds[A]:t.seconds:0,p=(A,q)=>A?q!==void 0?St(A,l("hours",q),l("minutes",q),i(q)):St(A,t.hours,t.minutes,i()):mr(Q(),i(q)),c=(A,q)=>{t[A]=q},C=G(()=>e.modelAuto&&r.value.enabled?Array.isArray(n.value)?n.value.length>1:!1:r.value.enabled),m=(A,q)=>{const ae=Object.fromEntries(Object.keys(t).map(E=>E===A?[E,q]:[E,t[E]].slice()));if(C.value&&!r.value.disableTimeRangeValidation){const E=ne=>n.value?St(n.value[ne],ae.hours[ne],ae.minutes[ne],ae.seconds[ne]):null,B=ne=>vr(n.value[ne],0);return!(Me(E(0),E(1))&&(Kt(E(0),B(1))||pa(E(1),B(0))))}return!0},v=(A,q)=>{m(A,q)&&(c(A,q),a&&a())},h=A=>{v("hours",A)},k=A=>{v("minutes",A)},Y=A=>{v("seconds",A)},f=(A,q,ae,E)=>{q&&h(A),!q&&!ae&&k(A),ae&&Y(A),n.value&&E(n.value)},S=A=>{if(A){const q=Array.isArray(A),ae=q?[+A[0].hours,+A[1].hours]:+A.hours,E=q?[+A[0].minutes,+A[1].minutes]:+A.minutes,B=q?[+A[0].seconds,+A[1].seconds]:+A.seconds;c("hours",ae),c("minutes",E),e.enableSeconds&&c("seconds",B)}},I=(A,q)=>{const ae={hours:Array.isArray(t.hours)?t.hours[A]:t.hours,disabledArr:[]};return(q||q===0)&&(ae.hours=q),Array.isArray(e.disabledTimes)&&(ae.disabledArr=r.value.enabled&&Array.isArray(e.disabledTimes[A])?e.disabledTimes[A]:e.disabledTimes),ae},U=G(()=>(A,q)=>{var ae;if(Array.isArray(e.disabledTimes)){const{disabledArr:E,hours:B}=I(A,q),ne=E.filter(F=>+F.hours===B);return((ae=ne[0])==null?void 0:ae.minutes)==="*"?{hours:[B],minutes:void 0,seconds:void 0}:{hours:[],minutes:ne?.map(F=>+F.minutes)??[],seconds:ne?.map(F=>F.seconds?+F.seconds:void 0)??[]}}return{hours:[],minutes:[],seconds:[]}});return{setTime:c,updateHours:h,updateMinutes:k,updateSeconds:Y,getSetDateTime:p,updateTimeValues:f,getSecondsValue:i,assignStartTime:S,validateTime:m,disabledTimesConfig:U}},ns=(e,t)=>{const n=()=>{e.isTextInputDate&&q()},{modelValue:a,time:r}=ba(e,t,n),{defaultedStartTime:l,defaultedRange:i,defaultedTz:p}=Se(e),{updateTimeValues:c,getSetDateTime:C,setTime:m,assignStartTime:v,disabledTimesConfig:h,validateTime:k}=Rr(e,r,a,Y);function Y(){t("update-flow-step")}const f=E=>{const{hours:B,minutes:ne,seconds:F}=E;return{hours:+B,minutes:+ne,seconds:F?+F:0}},S=()=>{if(e.startTime){if(Array.isArray(e.startTime)){const B=f(e.startTime[0]),ne=f(e.startTime[1]);return[Ce(Q(),B),Ce(Q(),ne)]}const E=f(e.startTime);return Ce(Q(),E)}return i.value.enabled?[null,null]:null},I=()=>{if(i.value.enabled){const[E,B]=S();a.value=[nt(C(E,0),p.value.timezone),nt(C(B,1),p.value.timezone)]}else a.value=nt(C(S()),p.value.timezone)},U=E=>Array.isArray(E)?[Ft(Q(E[0])),Ft(Q(E[1]))]:[Ft(E??Q())],A=(E,B,ne)=>{m("hours",E),m("minutes",B),m("seconds",e.enableSeconds?ne:0)},q=()=>{const[E,B]=U(a.value);return i.value.enabled?A([E.hours,B.hours],[E.minutes,B.minutes],[E.seconds,B.seconds]):A(E.hours,E.minutes,E.seconds)};Ke(()=>{if(!e.shadow)return v(l.value),a.value?q():I()});const ae=()=>{Array.isArray(a.value)?a.value=a.value.map((E,B)=>E&&C(E,B)):a.value=C(a.value),t("time-update")};return{modelValue:a,time:r,disabledTimesConfig:h,updateTime:(E,B=!0,ne=!1)=>{c(E,B,ne,ae)},validateTime:k}},rs=ze({compatConfig:{MODE:3},__name:"TimePickerSolo",props:{...yt},emits:["update:internal-model-value","time-update","am-pm-change","mount","reset-flow","update-flow-step","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=qt(),i=lt(l,"timePicker"),p=Z(null),{time:c,modelValue:C,disabledTimesConfig:m,updateTime:v,validateTime:h}=ns(r,a);return Ke(()=>{r.shadow||a("mount",null)}),t({getSidebarProps:()=>({modelValue:C,time:c,updateTime:v}),toggleTimePicker:(k,Y=!1,f="")=>{var S;(S=p.value)==null||S.toggleTimePicker(k,Y,f)}}),(k,Y)=>(P(),De(Sa,{"multi-calendars":0,stretch:""},{default:_e(()=>[ot(Sr,Qe({ref_key:"tpRef",ref:p},k.$props,{hours:d(c).hours,minutes:d(c).minutes,seconds:d(c).seconds,"internal-model-value":k.internalModelValue,"disabled-times-config":d(m),"validate-time":d(h),"onUpdate:hours":Y[0]||(Y[0]=f=>d(v)(f)),"onUpdate:minutes":Y[1]||(Y[1]=f=>d(v)(f,!1)),"onUpdate:seconds":Y[2]||(Y[2]=f=>d(v)(f,!1,!0)),onAmPmChange:Y[3]||(Y[3]=f=>k.$emit("am-pm-change",f)),onResetFlow:Y[4]||(Y[4]=f=>k.$emit("reset-flow")),onOverlayClosed:Y[5]||(Y[5]=f=>k.$emit("overlay-toggle",{open:!1,overlay:f})),onOverlayOpened:Y[6]||(Y[6]=f=>k.$emit("overlay-toggle",{open:!0,overlay:f}))}),je({_:2},[Ye(d(i),(f,S)=>({name:f,fn:_e(I=>[ue(k.$slots,f,We(at(I)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"])]),_:3}))}}),ls={class:"dp--header-wrap"},os={key:0,class:"dp__month_year_wrap"},is={key:0},ss={class:"dp__month_year_wrap"},us=["data-dp-element","aria-label","data-test","onClick","onKeydown"],ds=ze({compatConfig:{MODE:3},__name:"DpHeader",props:{month:{type:Number,default:0},year:{type:Number,default:0},instance:{type:Number,default:0},years:{type:Array,default:()=>[]},months:{type:Array,default:()=>[]},...yt},emits:["update-month-year","mount","reset-flow","overlay-closed","overlay-opened"],setup(e,{expose:t,emit:n}){const a=n,r=e,{defaultedTransitions:l,defaultedAriaLabels:i,defaultedMultiCalendars:p,defaultedFilters:c,defaultedConfig:C,defaultedHighlight:m,propDates:v,defaultedUI:h}=Se(r),{transitionName:k,showTransition:Y}=ga(l),{buildMatrix:f}=It(),{handleMonthYearChange:S,isDisabled:I,updateMonthYear:U}=Yi(r,a),{showLeftIcon:A,showRightIcon:q}=Ia(),ae=Z(!1),E=Z(!1),B=Z(!1),ne=Z([null,null,null,null]);Ke(()=>{a("mount")});const F=M=>({get:()=>r[M],set:o=>{const w=M===vt.month?vt.year:vt.month;a("update-month-year",{[M]:o,[w]:r[w]}),M===vt.month?H(!0):re(!0)}}),N=G(F(vt.month)),ie=G(F(vt.year)),ce=G(()=>M=>({month:r.month,year:r.year,items:M===vt.month?r.months:r.years,instance:r.instance,updateMonthYear:U,toggle:M===vt.month?H:re})),pe=G(()=>r.months.find(o=>o.value===r.month)||{text:"",value:0}),g=G(()=>Zt(r.months,M=>{const o=r.month===M.value,w=fa(M.value,wr(r.year,v.value.minDate),_r(r.year,v.value.maxDate))||c.value.months.includes(M.value),z=Tr(m.value,M.value,r.year);return{active:o,disabled:w,highlighted:z}})),D=G(()=>Zt(r.years,M=>{const o=r.year===M.value,w=fa(M.value,ea(v.value.minDate),ea(v.value.maxDate))||c.value.years.includes(M.value),z=Mn(m.value,M.value);return{active:o,disabled:w,highlighted:z}})),y=(M,o,w)=>{w!==void 0?M.value=w:M.value=!M.value,M.value?(B.value=!0,a("overlay-opened",o)):(B.value=!1,a("overlay-closed",o))},H=(M=!1,o)=>{R(M),y(ae,Xe.month,o)},re=(M=!1,o)=>{R(M),y(E,Xe.year,o)},R=M=>{M||a("reset-flow")},b=(M,o)=>{r.arrowNavigation&&(ne.value[o]=Fe(M),f(ne.value,"monthYear"))},oe=G(()=>{var M,o,w,z,u,le;return[{type:vt.month,index:1,toggle:H,modelValue:N.value,updateModelValue:fe=>N.value=fe,text:pe.value.text,showSelectionGrid:ae.value,items:g.value,ariaLabel:(M=i.value)==null?void 0:M.openMonthsOverlay,overlayLabel:((w=(o=i.value).monthPicker)==null?void 0:w.call(o,!0))??void 0},{type:vt.year,index:2,toggle:re,modelValue:ie.value,updateModelValue:fe=>ie.value=fe,text:br(r.year,r.locale),showSelectionGrid:E.value,items:D.value,ariaLabel:(z=i.value)==null?void 0:z.openYearsOverlay,overlayLabel:((le=(u=i.value).yearPicker)==null?void 0:le.call(u,!0))??void 0}]}),V=G(()=>r.disableYearSelect?[oe.value[0]]:r.yearFirst?[...oe.value].reverse():oe.value);return t({toggleMonthPicker:H,toggleYearPicker:re,handleMonthYearChange:S}),(M,o)=>{var w,z,u,le,fe,Ve;return P(),W("div",ls,[M.$slots["month-year"]?(P(),W("div",os,[ue(M.$slots,"month-year",We(at({month:e.month,year:e.year,months:e.months,years:e.years,updateMonthYear:d(U),handleMonthYearChange:d(S),instance:e.instance})))])):(P(),W(we,{key:1},[M.$slots["top-extra"]?(P(),W("div",is,[ue(M.$slots,"top-extra",{value:M.internalModelValue})])):j("",!0),ye("div",ss,[d(A)(d(p),e.instance)&&!M.vertical?(P(),De(da,{key:0,"aria-label":(w=d(i))==null?void 0:w.prevMonth,disabled:d(I)(!1),class:ke((z=d(h))==null?void 0:z.navBtnPrev),"el-name":"action-prev",onActivate:o[0]||(o[0]=T=>d(S)(!1,!0)),onSetRef:o[1]||(o[1]=T=>b(T,0))},{default:_e(()=>[M.$slots["arrow-left"]?ue(M.$slots,"arrow-left",{key:0}):j("",!0),M.$slots["arrow-left"]?j("",!0):(P(),De(d(fn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0),ye("div",{class:ke(["dp__month_year_wrap",{dp__year_disable_select:M.disableYearSelect}])},[(P(!0),W(we,null,Ye(V.value,(T,K)=>(P(),W(we,{key:T.type},[ye("button",{ref_for:!0,ref:s=>b(s,K+1),type:"button","data-dp-element":`overlay-${T.type}`,class:ke(["dp__btn dp__month_year_select",{"dp--hidden-el":B.value}]),"aria-label":`${T.text}-${T.ariaLabel}`,"data-test":`${T.type}-toggle-overlay-${e.instance}`,onClick:T.toggle,onKeydown:s=>d(et)(s,()=>T.toggle(),!0)},[M.$slots[T.type]?ue(M.$slots,T.type,{key:0,text:T.text,value:r[T.type]}):j("",!0),M.$slots[T.type]?j("",!0):(P(),W(we,{key:1},[Dt(Ge(T.text),1)],64))],42,us),ot(ta,{name:d(k)(T.showSelectionGrid),css:d(Y)},{default:_e(()=>[T.showSelectionGrid?(P(),De(ya,{key:0,items:T.items,"arrow-navigation":M.arrowNavigation,"hide-navigation":M.hideNavigation,"is-last":M.autoApply&&!d(C).keepActionRow,"skip-button-ref":!1,config:M.config,type:T.type,"header-refs":[],"esc-close":M.escClose,"menu-wrap-ref":M.menuWrapRef,"text-input":M.textInput,"aria-labels":M.ariaLabels,"overlay-label":T.overlayLabel,onSelected:T.updateModelValue,onToggle:T.toggle},je({"button-icon":_e(()=>[M.$slots["calendar-icon"]?ue(M.$slots,"calendar-icon",{key:0}):j("",!0),M.$slots["calendar-icon"]?j("",!0):(P(),De(d(aa),{key:1}))]),_:2},[M.$slots[`${T.type}-overlay-value`]?{name:"item",fn:_e(({item:s})=>[ue(M.$slots,`${T.type}-overlay-value`,{text:s.text,value:s.value})]),key:"0"}:void 0,M.$slots[`${T.type}-overlay`]?{name:"overlay",fn:_e(()=>[ue(M.$slots,`${T.type}-overlay`,Qe({ref_for:!0},ce.value(T.type)))]),key:"1"}:void 0,M.$slots[`${T.type}-overlay-header`]?{name:"header",fn:_e(()=>[ue(M.$slots,`${T.type}-overlay-header`,{toggle:T.toggle})]),key:"2"}:void 0]),1032,["items","arrow-navigation","hide-navigation","is-last","config","type","esc-close","menu-wrap-ref","text-input","aria-labels","overlay-label","onSelected","onToggle"])):j("",!0)]),_:2},1032,["name","css"])],64))),128))],2),d(A)(d(p),e.instance)&&M.vertical?(P(),De(da,{key:1,"aria-label":(u=d(i))==null?void 0:u.prevMonth,"el-name":"action-prev",disabled:d(I)(!1),class:ke((le=d(h))==null?void 0:le.navBtnPrev),onActivate:o[2]||(o[2]=T=>d(S)(!1,!0))},{default:_e(()=>[M.$slots["arrow-up"]?ue(M.$slots,"arrow-up",{key:0}):j("",!0),M.$slots["arrow-up"]?j("",!0):(P(),De(d(gn),{key:1}))]),_:3},8,["aria-label","disabled","class"])):j("",!0),d(q)(d(p),e.instance)?(P(),De(da,{key:2,ref:"rightIcon","el-name":"action-next",disabled:d(I)(!0),"aria-label":(fe=d(i))==null?void 0:fe.nextMonth,class:ke((Ve=d(h))==null?void 0:Ve.navBtnNext),onActivate:o[3]||(o[3]=T=>d(S)(!0,!0)),onSetRef:o[4]||(o[4]=T=>b(T,M.disableYearSelect?2:3))},{default:_e(()=>[M.$slots[M.vertical?"arrow-down":"arrow-right"]?ue(M.$slots,M.vertical?"arrow-down":"arrow-right",{key:0}):j("",!0),M.$slots[M.vertical?"arrow-down":"arrow-right"]?j("",!0):(P(),De(Oa(M.vertical?d(bn):d(hn)),{key:1}))]),_:3},8,["disabled","aria-label","class"])):j("",!0)])],64))])}}}),cs={class:"dp__calendar_header",role:"row"},vs={key:0,class:"dp__calendar_header_item",role:"gridcell"},ms=["aria-label"],ps={key:0,class:"dp__calendar_item dp__week_num",role:"gridcell"},fs={class:"dp__cell_inner"},hs=["id","aria-pressed","aria-disabled","aria-label","tabindex","data-test","onClick","onTouchend","onKeydown","onMouseenter","onMouseleave","onMousedown"],ys=ze({compatConfig:{MODE:3},__name:"DpCalendar",props:{mappedDates:{type:Array,default:()=>[]},instance:{type:Number,default:0},month:{type:Number,default:0},year:{type:Number,default:0},...yt},emits:["select-date","set-hover-date","handle-scroll","mount","handle-swipe","handle-space","tooltip-open","tooltip-close"],setup(e,{expose:t,emit:n}){const a=n,r=e,{buildMultiLevelMatrix:l}=It(),{defaultedTransitions:i,defaultedConfig:p,defaultedAriaLabels:c,defaultedMultiCalendars:C,defaultedWeekNumbers:m,defaultedMultiDates:v,defaultedUI:h}=Se(r),k=Z(null),Y=Z({bottom:"",left:"",transform:""}),f=Z([]),S=Z(null),I=Z(!0),U=Z(""),A=Z({startX:0,endX:0,startY:0,endY:0}),q=Z([]),ae=Z({left:"50%"}),E=Z(!1),B=G(()=>r.calendar?r.calendar(r.mappedDates):r.mappedDates),ne=G(()=>r.dayNames?Array.isArray(r.dayNames)?r.dayNames:r.dayNames(r.locale,+r.weekStart):ei(r.formatLocale,r.locale,+r.weekStart));Ke(()=>{a("mount",{cmp:"calendar",refs:f}),p.value.noSwipe||S.value&&(S.value.addEventListener("touchstart",b,{passive:!1}),S.value.addEventListener("touchend",oe,{passive:!1}),S.value.addEventListener("touchmove",V,{passive:!1})),r.monthChangeOnScroll&&S.value&&S.value.addEventListener("wheel",w,{passive:!1})});const F=T=>T?r.vertical?"vNext":"next":r.vertical?"vPrevious":"previous",N=(T,K)=>{if(r.transitions){const s=tt(Mt(Q(),r.month,r.year));U.value=Ne(tt(Mt(Q(),T,K)),s)?i.value[F(!0)]:i.value[F(!1)],I.value=!1,it(()=>{I.value=!0})}},ie=G(()=>({...h.value.calendar??{}})),ce=G(()=>T=>{const K=ai(T);return{dp__marker_dot:K.type==="dot",dp__marker_line:K.type==="line"}}),pe=G(()=>T=>Me(T,k.value)),g=G(()=>({dp__calendar:!0,dp__calendar_next:C.value.count>0&&r.instance!==0})),D=G(()=>T=>r.hideOffsetDates?T.current:!0),y=async(T,K)=>{const{width:s,height:L}=T.getBoundingClientRect();k.value=K.value;let J={left:`${s/2}px`},$=-50;if(await it(),q.value[0]){const{left:ge,width:x}=q.value[0].getBoundingClientRect();ge<0&&(J={left:"0"},$=0,ae.value.left=`${s/2}px`),window.innerWidth{var L,J,$;const ge=Fe(f.value[K][s]);ge&&((L=T.marker)!=null&&L.customPosition&&($=(J=T.marker)==null?void 0:J.tooltip)!=null&&$.length?Y.value=T.marker.customPosition(ge):await y(ge,T),a("tooltip-open",T.marker))},re=async(T,K,s)=>{var L,J;if(E.value&&v.value.enabled&&v.value.dragSelect)return a("select-date",T);a("set-hover-date",T),(J=(L=T.marker)==null?void 0:L.tooltip)!=null&&J.length&&await H(T,K,s)},R=T=>{k.value&&(k.value=null,Y.value=JSON.parse(JSON.stringify({bottom:"",left:"",transform:""})),a("tooltip-close",T.marker))},b=T=>{A.value.startX=T.changedTouches[0].screenX,A.value.startY=T.changedTouches[0].screenY},oe=T=>{A.value.endX=T.changedTouches[0].screenX,A.value.endY=T.changedTouches[0].screenY,M()},V=T=>{r.vertical&&!r.inline&&T.preventDefault()},M=()=>{const T=r.vertical?"Y":"X";Math.abs(A.value[`start${T}`]-A.value[`end${T}`])>10&&a("handle-swipe",A.value[`start${T}`]>A.value[`end${T}`]?"right":"left")},o=(T,K,s)=>{T&&(Array.isArray(f.value[K])?f.value[K][s]=T:f.value[K]=[T]),r.arrowNavigation&&l(f.value,"calendar")},w=T=>{r.monthChangeOnScroll&&(T.preventDefault(),a("handle-scroll",T))},z=T=>m.value.type==="local"?vn(T.value,{weekStartsOn:+r.weekStart}):m.value.type==="iso"?dn(T.value):typeof m.value.type=="function"?m.value.type(T.value):"",u=T=>{const K=T[0];return m.value.hideOnOffsetDates?T.some(s=>s.current)?z(K):"":z(K)},le=(T,K,s=!0)=>{s&&Vn()||!s&&!Vn()||v.value.enabled||(Yt(T,p.value),a("select-date",K))},fe=T=>{Yt(T,p.value)},Ve=T=>{v.value.enabled&&v.value.dragSelect?(E.value=!0,a("select-date",T)):v.value.enabled&&a("select-date",T)};return t({triggerTransition:N}),(T,K)=>(P(),W("div",{class:ke(g.value)},[ye("div",{ref_key:"calendarWrapRef",ref:S,class:ke(ie.value),role:"grid"},[ye("div",cs,[T.weekNumbers?(P(),W("div",vs,Ge(T.weekNumName),1)):j("",!0),(P(!0),W(we,null,Ye(ne.value,(s,L)=>{var J,$;return P(),W("div",{key:L,class:"dp__calendar_header_item",role:"gridcell","data-test":"calendar-header","aria-label":($=(J=d(c))==null?void 0:J.weekDay)==null?void 0:$.call(J,L)},[T.$slots["calendar-header"]?ue(T.$slots,"calendar-header",{key:0,day:s,index:L}):j("",!0),T.$slots["calendar-header"]?j("",!0):(P(),W(we,{key:1},[Dt(Ge(s),1)],64))],8,ms)}),128))]),K[2]||(K[2]=ye("div",{class:"dp__calendar_header_separator"},null,-1)),ot(ta,{name:U.value,css:!!T.transitions},{default:_e(()=>[I.value?(P(),W("div",{key:0,class:"dp__calendar",role:"rowgroup",onMouseleave:K[1]||(K[1]=s=>E.value=!1)},[(P(!0),W(we,null,Ye(B.value,(s,L)=>(P(),W("div",{key:L,class:"dp__calendar_row",role:"row"},[T.weekNumbers?(P(),W("div",ps,[ye("div",fs,Ge(u(s.days)),1)])):j("",!0),(P(!0),W(we,null,Ye(s.days,(J,$)=>{var ge,x,X;return P(),W("div",{id:d(Pr)(J.value),ref_for:!0,ref:de=>o(de,L,$),key:$+L,role:"gridcell",class:"dp__calendar_item","aria-pressed":(J.classData.dp__active_date||J.classData.dp__range_start||J.classData.dp__range_start)??void 0,"aria-disabled":J.classData.dp__cell_disabled||void 0,"aria-label":(x=(ge=d(c))==null?void 0:ge.day)==null?void 0:x.call(ge,J),tabindex:!J.current&&T.hideOffsetDates?void 0:0,"data-test":J.value,onClick:va(de=>le(de,J),["prevent"]),onTouchend:de=>le(de,J,!1),onKeydown:de=>d(et)(de,()=>T.$emit("select-date",J)),onMouseenter:de=>re(J,L,$),onMouseleave:de=>R(J),onMousedown:de=>Ve(J),onMouseup:K[0]||(K[0]=de=>E.value=!1)},[ye("div",{class:ke(["dp__cell_inner",J.classData])},[T.$slots.day&&D.value(J)?ue(T.$slots,"day",{key:0,day:+J.text,date:J.value}):j("",!0),T.$slots.day?j("",!0):(P(),W(we,{key:1},[Dt(Ge(J.text),1)],64)),J.marker&&D.value(J)?(P(),W(we,{key:2},[T.$slots.marker?ue(T.$slots,"marker",{key:0,marker:J.marker,day:+J.text,date:J.value}):(P(),W("div",{key:1,class:ke(ce.value(J.marker)),style:dt(J.marker.color?{backgroundColor:J.marker.color}:{})},null,6))],64)):j("",!0),pe.value(J.value)?(P(),W("div",{key:3,ref_for:!0,ref_key:"activeTooltip",ref:q,class:"dp__marker_tooltip",style:dt(Y.value)},[(X=J.marker)!=null&&X.tooltip?(P(),W("div",{key:0,class:"dp__tooltip_content",onClick:fe},[(P(!0),W(we,null,Ye(J.marker.tooltip,(de,be)=>(P(),W("div",{key:be,class:"dp__tooltip_text"},[T.$slots["marker-tooltip"]?ue(T.$slots,"marker-tooltip",{key:0,tooltip:de,day:J.value}):j("",!0),T.$slots["marker-tooltip"]?j("",!0):(P(),W(we,{key:1},[ye("div",{class:"dp__tooltip_mark",style:dt(de.color?{backgroundColor:de.color}:{})},null,4),ye("div",null,Ge(de.text),1)],64))]))),128)),ye("div",{class:"dp__arrow_bottom_tp",style:dt(ae.value)},null,4)])):j("",!0)],4)):j("",!0)],2)],40,hs)}),128))]))),128))],32)):j("",!0)]),_:3},8,["name","css"])],2)],2))}}),zn=e=>Array.isArray(e),gs=(e,t,n,a)=>{const r=Z([]),l=Z(new Date),i=Z(),p=()=>b(e.isTextInputDate),{modelValue:c,calendars:C,time:m,today:v}=ba(e,t,p),{defaultedMultiCalendars:h,defaultedStartTime:k,defaultedRange:Y,defaultedConfig:f,defaultedTz:S,propDates:I,defaultedMultiDates:U}=Se(e),{validateMonthYearInRange:A,isDisabled:q,isDateRangeAllowed:ae,checkMinMaxRange:E}=Et(e),{updateTimeValues:B,getSetDateTime:ne,setTime:F,assignStartTime:N,validateTime:ie,disabledTimesConfig:ce}=Rr(e,m,c,a),pe=G(()=>_=>C.value[_]?C.value[_].month:0),g=G(()=>_=>C.value[_]?C.value[_].year:0),D=_=>!f.value.keepViewOnOffsetClick||_?!0:!i.value,y=(_,te,O,ee=!1)=>{var se,Je;D(ee)&&(C.value[_]||(C.value[_]={month:0,year:0}),C.value[_].month=Hn(te)?(se=C.value[_])==null?void 0:se.month:te,C.value[_].year=Hn(O)?(Je=C.value[_])==null?void 0:Je.year:O)},H=()=>{e.autoApply&&t("select-date")};Ke(()=>{e.shadow||(c.value||(T(),k.value&&N(k.value)),b(!0),e.focusStartDate&&e.startDate&&T())});const re=G(()=>{var _;return(_=e.flow)!=null&&_.length&&!e.partialFlow?e.flowStep===e.flow.length:!0}),R=()=>{e.autoApply&&re.value&&t("auto-apply",e.partialFlow?e.flowStep!==e.flow.length:!1)},b=(_=!1)=>{if(c.value)return Array.isArray(c.value)?(r.value=c.value,u(_)):M(c.value,_);if(h.value.count&&_&&!e.startDate)return V(Q(),_)},oe=()=>Array.isArray(c.value)&&Y.value.enabled?xe(c.value[0])===xe(c.value[1]??c.value[0]):!1,V=(_=new Date,te=!1)=>{if((!h.value.count||!h.value.static||te)&&y(0,xe(_),he(_)),h.value.count&&(!h.value.solo||!c.value||oe()))for(let O=1;O{V(_),F("hours",Tt(_)),F("minutes",Rt(_)),F("seconds",jt(_)),h.value.count&&te&&Ve()},o=_=>{if(h.value.count){if(h.value.solo)return 0;const te=xe(_[0]),O=xe(_[1]);return Math.abs(O-te){_[1]&&Y.value.showLastInRange?V(_[o(_)],te):V(_[0],te);const O=(ee,se)=>[ee(_[0]),_[1]?ee(_[1]):m[se][1]];F("hours",O(Tt,"hours")),F("minutes",O(Rt,"minutes")),F("seconds",O(jt,"seconds"))},z=(_,te)=>{if((Y.value.enabled||e.weekPicker)&&!U.value.enabled)return w(_,te);if(U.value.enabled&&te){const O=_[_.length-1];return M(O,te)}},u=_=>{const te=c.value;z(te,_),h.value.count&&h.value.solo&&Ve()},le=(_,te)=>{const O=Ce(Q(),{month:pe.value(te),year:g.value(te)}),ee=_<0?ft(O,1):Jt(O,1);A(xe(ee),he(ee),_<0,e.preventMinMaxNavigation)&&(y(te,xe(ee),he(ee)),t("update-month-year",{instance:te,month:xe(ee),year:he(ee)}),h.value.count&&!h.value.solo&&fe(te),n())},fe=_=>{for(let te=_-1;te>=0;te--){const O=Jt(Ce(Q(),{month:pe.value(te+1),year:g.value(te+1)}),1);y(te,xe(O),he(O))}for(let te=_+1;te<=h.value.count-1;te++){const O=ft(Ce(Q(),{month:pe.value(te-1),year:g.value(te-1)}),1);y(te,xe(O),he(O))}},Ve=()=>{if(Array.isArray(c.value)&&c.value.length===2){const _=Q(Q(c.value[1]?c.value[1]:ft(c.value[0],1))),[te,O]=[xe(c.value[0]),he(c.value[0])],[ee,se]=[xe(c.value[1]),he(c.value[1])];(te!==ee||te===ee&&O!==se)&&h.value.solo&&y(1,xe(_),he(_))}else c.value&&!Array.isArray(c.value)&&(y(0,xe(c.value),he(c.value)),V(Q()))},T=()=>{e.startDate&&(y(0,xe(Q(e.startDate)),he(Q(e.startDate))),h.value.count&&fe(0))},K=(_,te)=>{if(e.monthChangeOnScroll){const O=new Date().getTime()-l.value.getTime(),ee=Math.abs(_.deltaY);let se=500;ee>1&&(se=100),ee>100&&(se=0),O>se&&(l.value=new Date,le(e.monthChangeOnScroll!=="inverse"?-_.deltaY:_.deltaY,te))}},s=(_,te,O=!1)=>{e.monthChangeOnArrows&&e.vertical===O&&L(_,te)},L=(_,te)=>{le(_==="right"?-1:1,te)},J=_=>{if(I.value.markers)return Aa(_.value,I.value.markers)},$=(_,te)=>{switch(e.sixWeeks===!0?"append":e.sixWeeks){case"prepend":return[!0,!1];case"center":return[_==0,!0];case"fair":return[_==0||te>_,!0];case"append":return[!1,!1];default:return[!1,!1]}},ge=(_,te,O,ee)=>{if(e.sixWeeks&&_.length<6){const se=6-_.length,Je=(te.getDay()+7-ee)%7,ut=6-(O.getDay()+7-ee)%7,[Bt,_a]=$(Je,ut);for(let la=1;la<=se;la++)if(_a?!!(la%2)==Bt:Bt){const At=_[0].days[0],qa=x(mt(At.value,-7),xe(te));_.unshift({days:qa})}else{const At=_[_.length-1],qa=At.days[At.days.length-1],Er=x(mt(qa.value,1),xe(te));_.push({days:Er})}}return _},x=(_,te)=>{const O=Q(_),ee=[];for(let se=0;se<7;se++){const Je=mt(O,se),ut=xe(Je)!==te;ee.push({text:e.hideOffsetDates&&ut?"":Je.getDate(),value:Je,current:!ut,classData:{}})}return ee},X=(_,te)=>{const O=[],ee=new Date(te,_),se=new Date(te,_+1,0),Je=e.weekStart,ut=ht(ee,{weekStartsOn:Je}),Bt=_a=>{const la=x(_a,_);if(O.push({days:la}),!O[O.length-1].days.some(At=>Me(tt(At.value),tt(se)))){const At=mt(_a,7);Bt(At)}};return Bt(ut),ge(O,ee,se,Je)},de=_=>{const te=St(Q(_.value),m.hours,m.minutes,rt());t("date-update",te),U.value.enabled?Dn(te,c,U.value.limit):c.value=te,a(),it().then(()=>{R()})},be=_=>Y.value.noDisabledRange?kr(r.value[0],_).some(te=>q(te)):!1,st=()=>{r.value=c.value?c.value.slice():[],r.value.length===2&&!(Y.value.fixedStart||Y.value.fixedEnd)&&(r.value=[])},me=(_,te)=>{const O=[Q(_.value),mt(Q(_.value),+Y.value.autoRange)];ae(O)?(te&&Pt(_.value),r.value=O):t("invalid-date",_.value)},Pt=_=>{const te=xe(Q(_)),O=he(Q(_));if(y(0,te,O),h.value.count>0)for(let ee=1;ee{if(be(_.value)||!E(_.value,c.value,Y.value.fixedStart?0:1))return t("invalid-date",_.value);r.value=$r(Q(_.value),c,t,Y)},na=(_,te)=>{if(st(),Y.value.autoRange)return me(_,te);if(Y.value.fixedStart||Y.value.fixedEnd)return gt(_);r.value[0]?E(Q(_.value),c.value)&&!be(_.value)?Ie(Q(_.value),Q(r.value[0]))?(r.value.unshift(Q(_.value)),t("range-end",r.value[0])):(r.value[1]=Q(_.value),t("range-end",r.value[1])):(e.autoApply&&t("auto-apply-invalid",_.value),t("invalid-date",_.value)):(r.value[0]=Q(_.value),t("range-start",r.value[0]))},rt=(_=!0)=>e.enableSeconds?Array.isArray(m.seconds)?_?m.seconds[0]:m.seconds[1]:m.seconds:0,ra=_=>{r.value[_]=St(r.value[_],m.hours[_],m.minutes[_],rt(_!==1))},Ea=()=>{var _,te;r.value[0]&&r.value[1]&&+((_=r.value)==null?void 0:_[0])>+((te=r.value)==null?void 0:te[1])&&(r.value.reverse(),t("range-start",r.value[0]),t("range-end",r.value[1]))},wa=()=>{r.value.length&&(r.value[0]&&!r.value[1]?ra(0):(ra(0),ra(1),a()),Ea(),c.value=r.value.slice(),Ra(r.value,t,e.autoApply,e.modelAuto))},Ba=(_,te=!1)=>{if(q(_.value)||!_.current&&e.hideOffsetDates)return t("invalid-date",_.value);if(i.value=JSON.parse(JSON.stringify(_)),!Y.value.enabled)return de(_);zn(m.hours)&&zn(m.minutes)&&!U.value.enabled&&(na(_,te),wa())},Na=(_,te)=>{var O;y(_,te.month,te.year,!0),h.value.count&&!h.value.solo&&fe(_),t("update-month-year",{instance:_,month:te.month,year:te.year}),n(h.value.solo?_:void 0);const ee=(O=e.flow)!=null&&O.length?e.flow[e.flowStep]:void 0;!te.fromNav&&(ee===Xe.month||ee===Xe.year)&&a()},La=(_,te)=>{Or({value:_,modelValue:c,range:Y.value.enabled,timezone:te?void 0:S.value.timezone}),H(),e.multiCalendars&&it().then(()=>b(!0))},Ha=()=>{const _=wn(Q(),S.value);Y.value.enabled?c.value&&Array.isArray(c.value)&&c.value[0]?c.value=Ie(_,c.value[0])?[_,c.value[0]]:[c.value[0],_]:c.value=[_]:c.value=_,H()},Va=()=>{if(Array.isArray(c.value))if(U.value.enabled){const _=Fa();c.value[c.value.length-1]=ne(_)}else c.value=c.value.map((_,te)=>_&&ne(_,te));else c.value=ne(c.value);t("time-update")},Fa=()=>Array.isArray(c.value)&&c.value.length?c.value[c.value.length-1]:null;return{calendars:C,modelValue:c,month:pe,year:g,time:m,disabledTimesConfig:ce,today:v,validateTime:ie,getCalendarDays:X,getMarker:J,handleScroll:K,handleSwipe:L,handleArrow:s,selectDate:Ba,updateMonthYear:Na,presetDate:La,selectCurrentDate:Ha,updateTime:(_,te=!0,O=!1)=>{B(_,te,O,Va)},assignMonthAndYear:V}},bs={key:0},ws=ze({__name:"DatePicker",props:{...yt},emits:["tooltip-open","tooltip-close","mount","update:internal-model-value","update-flow-step","reset-flow","auto-apply","focus-menu","select-date","range-start","range-end","invalid-fixed-range","time-update","am-pm-change","time-picker-open","time-picker-close","recalculate-position","update-month-year","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=e,{calendars:l,month:i,year:p,modelValue:c,time:C,disabledTimesConfig:m,today:v,validateTime:h,getCalendarDays:k,getMarker:Y,handleArrow:f,handleScroll:S,handleSwipe:I,selectDate:U,updateMonthYear:A,presetDate:q,selectCurrentDate:ae,updateTime:E,assignMonthAndYear:B}=gs(r,a,oe,V),ne=qt(),{setHoverDate:F,getDayClassData:N,clearHoverDate:ie}=Is(c,r),{defaultedMultiCalendars:ce}=Se(r),pe=Z([]),g=Z([]),D=Z(null),y=lt(ne,"calendar"),H=lt(ne,"monthYear"),re=lt(ne,"timePicker"),R=K=>{r.shadow||a("mount",K)};ct(l,()=>{r.shadow||setTimeout(()=>{a("recalculate-position")},0)},{deep:!0}),ct(ce,(K,s)=>{K.count-s.count>0&&B()},{deep:!0});const b=G(()=>K=>k(i.value(K),p.value(K)).map(s=>({...s,days:s.days.map(L=>(L.marker=Y(L),L.classData=N(L),L))})));function oe(K){var s;K||K===0?(s=g.value[K])==null||s.triggerTransition(i.value(K),p.value(K)):g.value.forEach((L,J)=>L.triggerTransition(i.value(J),p.value(J)))}function V(){a("update-flow-step")}const M=(K,s=!1)=>{U(K,s),r.spaceConfirm&&a("select-date")},o=(K,s,L=0)=>{var J;(J=pe.value[L])==null||J.toggleMonthPicker(K,s)},w=(K,s,L=0)=>{var J;(J=pe.value[L])==null||J.toggleYearPicker(K,s)},z=(K,s,L)=>{var J;(J=D.value)==null||J.toggleTimePicker(K,s,L)},u=(K,s)=>{var L;if(!r.range){const J=c.value?c.value:v,$=s?new Date(s):J,ge=K?ht($,{weekStartsOn:1}):ar($,{weekStartsOn:1});U({value:ge,current:xe($)===i.value(0),text:"",classData:{}}),(L=document.getElementById(Pr(ge)))==null||L.focus()}},le=K=>{var s;(s=pe.value[0])==null||s.handleMonthYearChange(K,!0)},fe=K=>{A(0,{month:i.value(0),year:p.value(0)+(K?1:-1),fromNav:!0})},Ve=(K,s)=>{K===Xe.time&&a(`time-picker-${s?"open":"close"}`),a("overlay-toggle",{open:s,overlay:K})},T=K=>{a("overlay-toggle",{open:!1,overlay:K}),a("focus-menu")};return t({clearHoverDate:ie,presetDate:q,selectCurrentDate:ae,toggleMonthPicker:o,toggleYearPicker:w,toggleTimePicker:z,handleArrow:f,updateMonthYear:A,getSidebarProps:()=>({modelValue:c,month:i,year:p,time:C,updateTime:E,updateMonthYear:A,selectDate:U,presetDate:q}),changeMonth:le,changeYear:fe,selectWeekDate:u}),(K,s)=>(P(),W(we,null,[ot(Sa,{"multi-calendars":d(ce).count,collapse:K.collapse},{default:_e(({instance:L,index:J})=>[K.disableMonthYearSelect?j("",!0):(P(),De(ds,Qe({key:0,ref:$=>{$&&(pe.value[J]=$)},months:d(hr)(K.formatLocale,K.locale,K.monthNameFormat),years:d(_n)(K.yearRange,K.locale,K.reverseYears),month:d(i)(L),year:d(p)(L),instance:L},K.$props,{onMount:s[0]||(s[0]=$=>R(d(Vt).header)),onResetFlow:s[1]||(s[1]=$=>K.$emit("reset-flow")),onUpdateMonthYear:$=>d(A)(L,$),onOverlayClosed:T,onOverlayOpened:s[2]||(s[2]=$=>K.$emit("overlay-toggle",{open:!0,overlay:$}))}),je({_:2},[Ye(d(H),($,ge)=>({name:$,fn:_e(x=>[ue(K.$slots,$,We(at(x)))])}))]),1040,["months","years","month","year","instance","onUpdateMonthYear"])),ot(ys,Qe({ref:$=>{$&&(g.value[J]=$)},"mapped-dates":b.value(L),month:d(i)(L),year:d(p)(L),instance:L},K.$props,{onSelectDate:$=>d(U)($,L!==1),onHandleSpace:$=>M($,L!==1),onSetHoverDate:s[3]||(s[3]=$=>d(F)($)),onHandleScroll:$=>d(S)($,L),onHandleSwipe:$=>d(I)($,L),onMount:s[4]||(s[4]=$=>R(d(Vt).calendar)),onResetFlow:s[5]||(s[5]=$=>K.$emit("reset-flow")),onTooltipOpen:s[6]||(s[6]=$=>K.$emit("tooltip-open",$)),onTooltipClose:s[7]||(s[7]=$=>K.$emit("tooltip-close",$))}),je({_:2},[Ye(d(y),($,ge)=>({name:$,fn:_e(x=>[ue(K.$slots,$,We(at({...x})))])}))]),1040,["mapped-dates","month","year","instance","onSelectDate","onHandleSpace","onHandleScroll","onHandleSwipe"])]),_:3},8,["multi-calendars","collapse"]),K.enableTimePicker?(P(),W("div",bs,[K.$slots["time-picker"]?ue(K.$slots,"time-picker",We(Qe({key:0},{time:d(C),updateTime:d(E)}))):(P(),De(Sr,Qe({key:1,ref_key:"timePickerRef",ref:D},K.$props,{hours:d(C).hours,minutes:d(C).minutes,seconds:d(C).seconds,"internal-model-value":K.internalModelValue,"disabled-times-config":d(m),"validate-time":d(h),onMount:s[8]||(s[8]=L=>R(d(Vt).timePicker)),"onUpdate:hours":s[9]||(s[9]=L=>d(E)(L)),"onUpdate:minutes":s[10]||(s[10]=L=>d(E)(L,!1)),"onUpdate:seconds":s[11]||(s[11]=L=>d(E)(L,!1,!0)),onResetFlow:s[12]||(s[12]=L=>K.$emit("reset-flow")),onOverlayClosed:s[13]||(s[13]=L=>Ve(L,!1)),onOverlayOpened:s[14]||(s[14]=L=>Ve(L,!0)),onAmPmChange:s[15]||(s[15]=L=>K.$emit("am-pm-change",L))}),je({_:2},[Ye(d(re),(L,J)=>({name:L,fn:_e($=>[ue(K.$slots,L,We(at($)))])}))]),1040,["hours","minutes","seconds","internal-model-value","disabled-times-config","validate-time"]))])):j("",!0)],64))}}),_s=(e,t)=>{const n=Z(),{defaultedMultiCalendars:a,defaultedConfig:r,defaultedHighlight:l,defaultedRange:i,propDates:p,defaultedFilters:c,defaultedMultiDates:C}=Se(e),{modelValue:m,year:v,month:h,calendars:k}=ba(e,t),{isDisabled:Y}=Et(e),{selectYear:f,groupedYears:S,showYearPicker:I,isDisabled:U,toggleYearPicker:A,handleYearSelect:q,handleYear:ae}=Yr({modelValue:m,multiCalendars:a,range:i,highlight:l,calendars:k,propDates:p,month:h,year:v,filters:c,props:e,emit:t}),E=(D,y)=>[D,y].map(H=>kt(H,"MMMM",{locale:e.formatLocale})).join("-"),B=G(()=>D=>m.value?Array.isArray(m.value)?m.value.some(y=>Bn(D,y)):Bn(m.value,D):!1),ne=D=>{if(i.value.enabled){if(Array.isArray(m.value)){const y=Me(D,m.value[0])||Me(D,m.value[1]);return $a(m.value,n.value,D)&&!y}return!1}return!1},F=(D,y)=>D.quarter===$n(y)&&D.year===he(y),N=D=>typeof l.value=="function"?l.value({quarter:$n(D),year:he(D)}):!!l.value.quarters.find(y=>F(y,D)),ie=G(()=>D=>{const y=Ce(new Date,{year:v.value(D)});return el({start:ma(y),end:tr(y)}).map(H=>{const re=Ht(H),R=Yn(H),b=Y(H),oe=ne(re),V=N(re);return{text:E(re,R),value:re,active:B.value(re),highlighted:V,disabled:b,isBetween:oe}})}),ce=D=>{Dn(D,m,C.value.limit),t("auto-apply",!0)},pe=D=>{m.value=Tn(m,D,t),Ra(m.value,t,e.autoApply,e.modelAuto)},g=D=>{m.value=D,t("auto-apply")};return{defaultedConfig:r,defaultedMultiCalendars:a,groupedYears:S,year:v,isDisabled:U,quarters:ie,showYearPicker:I,modelValue:m,setHoverDate:D=>{n.value=D},selectYear:f,selectQuarter:(D,y,H)=>{if(!H)return k.value[y].month=xe(Yn(D)),C.value.enabled?ce(D):i.value.enabled?pe(D):g(D)},toggleYearPicker:A,handleYearSelect:q,handleYear:ae}},ks={class:"dp--quarter-items"},xs=["data-test","disabled","onClick","onMouseover"],Ms=ze({compatConfig:{MODE:3},__name:"QuarterPicker",props:{...yt},emits:["update:internal-model-value","reset-flow","overlay-closed","auto-apply","range-start","range-end","overlay-toggle","update-month-year"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=qt(),i=lt(l,"yearMode"),{defaultedMultiCalendars:p,defaultedConfig:c,groupedYears:C,year:m,isDisabled:v,quarters:h,modelValue:k,showYearPicker:Y,setHoverDate:f,selectQuarter:S,toggleYearPicker:I,handleYearSelect:U,handleYear:A}=_s(r,a);return t({getSidebarProps:()=>({modelValue:k,year:m,selectQuarter:S,handleYearSelect:U,handleYear:A})}),(q,ae)=>(P(),De(Sa,{"multi-calendars":d(p).count,collapse:q.collapse,stretch:""},{default:_e(({instance:E})=>[ye("div",{class:"dp-quarter-picker-wrap",style:dt({minHeight:`${d(c).modeHeight}px`})},[q.$slots["top-extra"]?ue(q.$slots,"top-extra",{key:0,value:q.internalModelValue}):j("",!0),ye("div",null,[ot(Cr,Qe(q.$props,{items:d(C)(E),instance:E,"show-year-picker":d(Y)[E],year:d(m)(E),"is-disabled":B=>d(v)(E,B),onHandleYear:B=>d(A)(E,B),onYearSelect:B=>d(U)(B,E),onToggleYearPicker:B=>d(I)(E,B?.flow,B?.show)}),je({_:2},[Ye(d(i),(B,ne)=>({name:B,fn:_e(F=>[ue(q.$slots,B,We(at(F)))])}))]),1040,["items","instance","show-year-picker","year","is-disabled","onHandleYear","onYearSelect","onToggleYearPicker"])]),ye("div",ks,[(P(!0),W(we,null,Ye(d(h)(E),(B,ne)=>(P(),W("div",{key:ne},[ye("button",{type:"button",class:ke(["dp--qr-btn",{"dp--qr-btn-active":B.active,"dp--qr-btn-between":B.isBetween,"dp--qr-btn-disabled":B.disabled,"dp--highlighted":B.highlighted}]),"data-test":B.value,disabled:B.disabled,onClick:F=>d(S)(B.value,E,B.disabled),onMouseover:F=>d(f)(B.value)},[q.$slots.quarter?ue(q.$slots,"quarter",{key:0,value:B.value,text:B.text}):(P(),W(we,{key:1},[Dt(Ge(B.text),1)],64))],42,xs)]))),128))])],4)]),_:3},8,["multi-calendars","collapse"]))}}),Ds=["id","tabindex","role","aria-label"],Ts={key:0,class:"dp--menu-load-container"},Ps={key:1,class:"dp--menu-header"},As={key:0,class:"dp__sidebar_left"},Cs=["data-test","onClick","onKeydown"],Os={key:2,class:"dp__sidebar_right"},$s={key:3,class:"dp__action_extra"},Un=ze({compatConfig:{MODE:3},__name:"DatepickerMenu",props:{...Ya,shadow:{type:Boolean,default:!1},openOnTop:{type:Boolean,default:!1},internalModelValue:{type:[Date,Array],default:null},noOverlayFocus:{type:Boolean,default:!1},collapse:{type:Boolean,default:!1},getInputRect:{type:Function,default:()=>({})},isTextInputDate:{type:Boolean,default:!1}},emits:["close-picker","select-date","auto-apply","time-update","flow-step","update-month-year","invalid-select","update:internal-model-value","recalculate-position","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","auto-apply-invalid","date-update","invalid-date","overlay-toggle"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=Z(null),i=G(()=>{const{openOnTop:x,...X}=r;return{...X,flowStep:F.value,collapse:r.collapse,noOverlayFocus:r.noOverlayFocus,menuWrapRef:l.value}}),{setMenuFocused:p,setShiftKey:c,control:C}=Ar(),m=qt(),{defaultedTextInput:v,defaultedInline:h,defaultedConfig:k,defaultedUI:Y}=Se(r),f=Z(null),S=Z(0),I=Z(null),U=Z(!1),A=Z(null);Ke(()=>{if(!r.shadow){U.value=!0,q(),window.addEventListener("resize",q);const x=Fe(l);if(x&&!v.value.enabled&&!h.value.enabled&&(p(!0),y()),x){const X=de=>{k.value.allowPreventDefault&&de.preventDefault(),Yt(de,k.value,!0)};x.addEventListener("pointerdown",X),x.addEventListener("mousedown",X)}}}),Ca(()=>{window.removeEventListener("resize",q)});const q=()=>{const x=Fe(I);x&&(S.value=x.getBoundingClientRect().width)},{arrowRight:ae,arrowLeft:E,arrowDown:B,arrowUp:ne}=It(),{flowStep:F,updateFlowStep:N,childMount:ie,resetFlow:ce,handleFlow:pe}=Es(r,a,A),g=G(()=>r.monthPicker?qi:r.yearPicker?Qi:r.timePicker?rs:r.quarterPicker?Ms:ws),D=G(()=>{var x;if(k.value.arrowLeft)return k.value.arrowLeft;const X=(x=l.value)==null?void 0:x.getBoundingClientRect(),de=r.getInputRect();return de?.width=(X?.right??0)&&de?.width{const x=Fe(l);x&&x.focus({preventScroll:!0})},H=G(()=>{var x;return((x=A.value)==null?void 0:x.getSidebarProps())||{}}),re=()=>{r.openOnTop&&a("recalculate-position")},R=lt(m,"action"),b=G(()=>r.monthPicker||r.yearPicker?lt(m,"monthYear"):r.timePicker?lt(m,"timePicker"):lt(m,"shared")),oe=G(()=>r.openOnTop?"dp__arrow_bottom":"dp__arrow_top"),V=G(()=>({dp__menu_disabled:r.disabled,dp__menu_readonly:r.readonly,"dp-menu-loading":r.loading})),M=G(()=>({dp__menu:!0,dp__menu_index:!h.value.enabled,dp__relative:h.value.enabled,...Y.value.menu??{}})),o=x=>{Yt(x,k.value,!0)},w=()=>{r.escClose&&a("close-picker")},z=x=>{if(r.arrowNavigation){if(x===Ze.up)return ne();if(x===Ze.down)return B();if(x===Ze.left)return E();if(x===Ze.right)return ae()}else x===Ze.left||x===Ze.up?T("handleArrow",Ze.left,0,x===Ze.up):T("handleArrow",Ze.right,0,x===Ze.down)},u=x=>{c(x.shiftKey),!r.disableMonthYearSelect&&x.code===$e.tab&&x.target.classList.contains("dp__menu")&&C.value.shiftKeyInMenu&&(x.preventDefault(),Yt(x,k.value,!0),a("close-picker"))},le=()=>{y(),a("time-picker-close")},fe=x=>{var X,de,be;(X=A.value)==null||X.toggleTimePicker(!1,!1),(de=A.value)==null||de.toggleMonthPicker(!1,!1,x),(be=A.value)==null||be.toggleYearPicker(!1,!1,x)},Ve=(x,X=0)=>{var de,be,st;return x==="month"?(de=A.value)==null?void 0:de.toggleMonthPicker(!1,!0,X):x==="year"?(be=A.value)==null?void 0:be.toggleYearPicker(!1,!0,X):x==="time"?(st=A.value)==null?void 0:st.toggleTimePicker(!0,!1):fe(X)},T=(x,...X)=>{var de,be;(de=A.value)!=null&&de[x]&&((be=A.value)==null||be[x](...X))},K=()=>{T("selectCurrentDate")},s=(x,X)=>{T("presetDate",x,X)},L=()=>{T("clearHoverDate")},J=(x,X)=>{T("updateMonthYear",x,X)},$=(x,X)=>{x.preventDefault(),z(X)},ge=x=>{var X,de,be;if(u(x),x.key===$e.home||x.key===$e.end)return T("selectWeekDate",x.key===$e.home,x.target.getAttribute("id"));switch((x.key===$e.pageUp||x.key===$e.pageDown)&&(x.shiftKey?(T("changeYear",x.key===$e.pageUp),(X=on(l.value,"overlay-year"))==null||X.focus()):(T("changeMonth",x.key===$e.pageUp),(de=on(l.value,x.key===$e.pageUp?"action-prev":"action-next"))==null||de.focus()),x.target.getAttribute("id")&&((be=l.value)==null||be.focus({preventScroll:!0}))),x.key){case $e.esc:return w();case $e.arrowLeft:return $(x,Ze.left);case $e.arrowRight:return $(x,Ze.right);case $e.arrowUp:return $(x,Ze.up);case $e.arrowDown:return $(x,Ze.down);default:return}};return t({updateMonthYear:J,switchView:Ve,handleFlow:pe}),(x,X)=>{var de,be,st;return P(),W("div",{id:x.uid?`dp-menu-${x.uid}`:void 0,ref_key:"dpMenuRef",ref:l,tabindex:d(h).enabled?void 0:"0",role:d(h).enabled?void 0:"dialog","aria-label":(de=x.ariaLabels)==null?void 0:de.menu,class:ke(M.value),style:dt({"--dp-arrow-left":D.value}),onMouseleave:L,onClick:o,onKeydown:ge},[(x.disabled||x.readonly)&&d(h).enabled||x.loading?(P(),W("div",{key:0,class:ke(V.value)},[x.loading?(P(),W("div",Ts,X[19]||(X[19]=[ye("span",{class:"dp--menu-loader"},null,-1)]))):j("",!0)],2)):j("",!0),x.$slots["menu-header"]?(P(),W("div",Ps,[ue(x.$slots,"menu-header")])):j("",!0),!d(h).enabled&&!x.teleportCenter?(P(),W("div",{key:2,class:ke(oe.value)},null,2)):j("",!0),ye("div",{ref_key:"innerMenuRef",ref:I,class:ke({dp__menu_content_wrapper:((be=x.presetDates)==null?void 0:be.length)||!!x.$slots["left-sidebar"]||!!x.$slots["right-sidebar"],"dp--menu-content-wrapper-collapsed":e.collapse&&(((st=x.presetDates)==null?void 0:st.length)||!!x.$slots["left-sidebar"]||!!x.$slots["right-sidebar"])}),style:dt({"--dp-menu-width":`${S.value}px`})},[x.$slots["left-sidebar"]?(P(),W("div",As,[ue(x.$slots,"left-sidebar",We(at(H.value)))])):j("",!0),x.presetDates.length?(P(),W("div",{key:1,class:ke({"dp--preset-dates-collapsed":e.collapse,"dp--preset-dates":!0})},[(P(!0),W(we,null,Ye(x.presetDates,(me,Pt)=>(P(),W(we,{key:Pt},[me.slot?ue(x.$slots,me.slot,{key:0,presetDate:s,label:me.label,value:me.value}):(P(),W("button",{key:1,type:"button",style:dt(me.style||{}),class:ke(["dp__btn dp--preset-range",{"dp--preset-range-collapsed":e.collapse}]),"data-test":me.testId??void 0,onClick:va(gt=>s(me.value,me.noTz),["prevent"]),onKeydown:gt=>d(et)(gt,()=>s(me.value,me.noTz),!0)},Ge(me.label),47,Cs))],64))),128))],2)):j("",!0),ye("div",{ref_key:"calendarWrapperRef",ref:f,class:"dp__instance_calendar",role:"document"},[(P(),De(Oa(g.value),Qe({ref_key:"dynCmpRef",ref:A},i.value,{"flow-step":d(F),onMount:d(ie),onUpdateFlowStep:d(N),onResetFlow:d(ce),onFocusMenu:y,onSelectDate:X[0]||(X[0]=me=>x.$emit("select-date")),onDateUpdate:X[1]||(X[1]=me=>x.$emit("date-update",me)),onTooltipOpen:X[2]||(X[2]=me=>x.$emit("tooltip-open",me)),onTooltipClose:X[3]||(X[3]=me=>x.$emit("tooltip-close",me)),onAutoApply:X[4]||(X[4]=me=>x.$emit("auto-apply",me)),onRangeStart:X[5]||(X[5]=me=>x.$emit("range-start",me)),onRangeEnd:X[6]||(X[6]=me=>x.$emit("range-end",me)),onInvalidFixedRange:X[7]||(X[7]=me=>x.$emit("invalid-fixed-range",me)),onTimeUpdate:X[8]||(X[8]=me=>x.$emit("time-update")),onAmPmChange:X[9]||(X[9]=me=>x.$emit("am-pm-change",me)),onTimePickerOpen:X[10]||(X[10]=me=>x.$emit("time-picker-open",me)),onTimePickerClose:le,onRecalculatePosition:re,onUpdateMonthYear:X[11]||(X[11]=me=>x.$emit("update-month-year",me)),onAutoApplyInvalid:X[12]||(X[12]=me=>x.$emit("auto-apply-invalid",me)),onInvalidDate:X[13]||(X[13]=me=>x.$emit("invalid-date",me)),onOverlayToggle:X[14]||(X[14]=me=>x.$emit("overlay-toggle",me)),"onUpdate:internalModelValue":X[15]||(X[15]=me=>x.$emit("update:internal-model-value",me))}),je({_:2},[Ye(b.value,(me,Pt)=>({name:me,fn:_e(gt=>[ue(x.$slots,me,We(at({...gt})))])}))]),1040,["flow-step","onMount","onUpdateFlowStep","onResetFlow"]))],512),x.$slots["right-sidebar"]?(P(),W("div",Os,[ue(x.$slots,"right-sidebar",We(at(H.value)))])):j("",!0),x.$slots["action-extra"]?(P(),W("div",$s,[x.$slots["action-extra"]?ue(x.$slots,"action-extra",{key:0,selectCurrentDate:K}):j("",!0)])):j("",!0)],6),!x.autoApply||d(k).keepActionRow?(P(),De(Ii,Qe({key:3,"menu-mount":U.value},i.value,{"calendar-width":S.value,onClosePicker:X[16]||(X[16]=me=>x.$emit("close-picker")),onSelectDate:X[17]||(X[17]=me=>x.$emit("select-date")),onInvalidSelect:X[18]||(X[18]=me=>x.$emit("invalid-select")),onSelectNow:K}),je({_:2},[Ye(d(R),(me,Pt)=>({name:me,fn:_e(gt=>[ue(x.$slots,me,We(at({...gt})))])}))]),1040,["menu-mount","calendar-width"])):j("",!0)],46,Ds)}}});var Ut=(e=>(e.center="center",e.left="left",e.right="right",e))(Ut||{});const Ys=({menuRef:e,menuRefInner:t,inputRef:n,pickerWrapperRef:a,inline:r,emit:l,props:i,slots:p})=>{const{defaultedConfig:c}=Se(i),C=Z({}),m=Z(!1),v=Z({top:"0",left:"0"}),h=Z(!1),k=ca(i,"teleportCenter");ct(k,()=>{v.value=JSON.parse(JSON.stringify({})),ae()});const Y=y=>{if(i.teleport){const H=y.getBoundingClientRect();return{left:H.left+window.scrollX,top:H.top+window.scrollY}}return{top:0,left:0}},f=(y,H)=>{v.value.left=`${y+H-C.value.width}px`},S=y=>{v.value.left=`${y}px`},I=(y,H)=>{i.position===Ut.left&&S(y),i.position===Ut.right&&f(y,H),i.position===Ut.center&&(v.value.left=`${y+H/2-C.value.width/2}px`)},U=y=>{const{width:H,height:re}=y.getBoundingClientRect(),{top:R,left:b}=i.altPosition?i.altPosition(y):Y(y);return{top:+R,left:+b,width:H,height:re}},A=()=>{v.value.left="50%",v.value.top="50%",v.value.transform="translate(-50%, -50%)",v.value.position="fixed",delete v.value.opacity},q=()=>{const y=Fe(n),{top:H,left:re,transform:R}=i.altPosition(y);v.value={top:`${H}px`,left:`${re}px`,transform:R??""}},ae=(y=!0)=>{var H;if(!r.value.enabled){if(k.value)return A();if(i.altPosition!==null)return q();if(y){const re=i.teleport?(H=t.value)==null?void 0:H.$el:e.value;re&&(C.value=re.getBoundingClientRect()),l("recalculate-position")}return ce()}},E=({inputEl:y,left:H,width:re})=>{window.screen.width>768&&!m.value&&I(H,re),F(y)},B=y=>{const{top:H,left:re,height:R,width:b}=U(y);v.value.top=`${R+H+ +i.offset}px`,h.value=!1,m.value||(v.value.left=`${re+b/2-C.value.width/2}px`),E({inputEl:y,left:re,width:b})},ne=y=>{const{top:H,left:re,width:R}=U(y);v.value.top=`${H-+i.offset-C.value.height}px`,h.value=!0,E({inputEl:y,left:re,width:R})},F=y=>{if(i.autoPosition){const{left:H,width:re}=U(y),{left:R,right:b}=C.value;if(!m.value){if(Math.abs(R)!==Math.abs(b)){if(R<=0)return m.value=!0,S(H);if(b>=document.documentElement.clientWidth)return m.value=!0,f(H,re)}return I(H,re)}}},N=()=>{const y=Fe(n);if(y){const{height:H}=C.value,{top:re,height:R}=y.getBoundingClientRect(),b=window.innerHeight-re-R,oe=re;return H<=b?Lt.bottom:H>b&&H<=oe?Lt.top:b>=oe?Lt.bottom:Lt.top}return Lt.bottom},ie=y=>N()===Lt.bottom?B(y):ne(y),ce=()=>{const y=Fe(n);if(y)return i.autoPosition?ie(y):B(y)},pe=function(y){if(y){const H=y.scrollHeight>y.clientHeight,re=window.getComputedStyle(y).overflowY.indexOf("hidden")!==-1;return H&&!re}return!0},g=function(y){return!y||y===document.body||y.nodeType===Node.DOCUMENT_FRAGMENT_NODE?window:pe(y)?y:g(y.assignedSlot&&c.value.shadowDom?y.assignedSlot.parentNode:y.parentNode)},D=y=>{if(y)switch(i.position){case Ut.left:return{left:0,transform:"translateX(0)"};case Ut.right:return{left:`${y.width}px`,transform:"translateX(-100%)"};default:return{left:`${y.width/2}px`,transform:"translateX(-50%)"}}return{}};return{openOnTop:h,menuStyle:v,xCorrect:m,setMenuPosition:ae,getScrollableParent:g,shadowRender:(y,H)=>{var re,R,b;const oe=document.createElement("div"),V=(re=Fe(n))==null?void 0:re.getBoundingClientRect();oe.setAttribute("id","dp--temp-container");const M=(R=a.value)!=null&&R.clientWidth?a.value:document.body;M.append(oe);const o=D(V),w=c.value.shadowDom?Object.keys(p).filter(u=>["right-sidebar","left-sidebar","top-extra","action-extra"].includes(u)):Object.keys(p),z=Nr(y,{...H,shadow:!0,style:{opacity:0,position:"absolute",...o}},Object.fromEntries(w.map(u=>[u,p[u]])));An(z,oe),C.value=(b=z.el)==null?void 0:b.getBoundingClientRect(),An(null,oe),M.removeChild(oe)}}},Ot=[{name:"clock-icon",use:["time","calendar","shared"]},{name:"arrow-left",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-right",use:["month-year","calendar","shared","year-mode"]},{name:"arrow-up",use:["time","calendar","month-year","shared"]},{name:"arrow-down",use:["time","calendar","month-year","shared"]},{name:"calendar-icon",use:["month-year","time","calendar","shared","year-mode"]},{name:"day",use:["calendar","shared"]},{name:"month-overlay-value",use:["calendar","month-year","shared"]},{name:"year-overlay-value",use:["calendar","month-year","shared","year-mode"]},{name:"year-overlay",use:["month-year","shared"]},{name:"month-overlay",use:["month-year","shared"]},{name:"month-overlay-header",use:["month-year","shared"]},{name:"year-overlay-header",use:["month-year","shared"]},{name:"hours-overlay-value",use:["calendar","time","shared"]},{name:"hours-overlay-header",use:["calendar","time","shared"]},{name:"minutes-overlay-value",use:["calendar","time","shared"]},{name:"minutes-overlay-header",use:["calendar","time","shared"]},{name:"seconds-overlay-value",use:["calendar","time","shared"]},{name:"seconds-overlay-header",use:["calendar","time","shared"]},{name:"hours",use:["calendar","time","shared"]},{name:"minutes",use:["calendar","time","shared"]},{name:"month",use:["calendar","month-year","shared"]},{name:"year",use:["calendar","month-year","shared","year-mode"]},{name:"action-buttons",use:["action"]},{name:"action-preview",use:["action"]},{name:"calendar-header",use:["calendar","shared"]},{name:"marker-tooltip",use:["calendar","shared"]},{name:"action-extra",use:["menu"]},{name:"time-picker-overlay",use:["calendar","time","shared"]},{name:"am-pm-button",use:["calendar","time","shared"]},{name:"left-sidebar",use:["menu"]},{name:"right-sidebar",use:["menu"]},{name:"month-year",use:["month-year","shared"]},{name:"time-picker",use:["menu","shared"]},{name:"action-row",use:["action"]},{name:"marker",use:["calendar","shared"]},{name:"quarter",use:["shared"]},{name:"top-extra",use:["shared","month-year"]},{name:"tp-inline-arrow-up",use:["shared","time"]},{name:"tp-inline-arrow-down",use:["shared","time"]},{name:"menu-header",use:["menu"]}],Ss=[{name:"trigger"},{name:"input-icon"},{name:"clear-icon"},{name:"dp-input"}],Rs={all:()=>Ot,monthYear:()=>Ot.filter(e=>e.use.includes("month-year")),input:()=>Ss,timePicker:()=>Ot.filter(e=>e.use.includes("time")),action:()=>Ot.filter(e=>e.use.includes("action")),calendar:()=>Ot.filter(e=>e.use.includes("calendar")),menu:()=>Ot.filter(e=>e.use.includes("menu")),shared:()=>Ot.filter(e=>e.use.includes("shared")),yearMode:()=>Ot.filter(e=>e.use.includes("year-mode"))},lt=(e,t,n)=>{const a=[];return Rs[t]().forEach(r=>{e[r.name]&&a.push(r.name)}),n!=null&&n.length&&n.forEach(r=>{r.slot&&a.push(r.slot)}),a},ga=e=>{const t=G(()=>a=>e.value?a?e.value.open:e.value.close:""),n=G(()=>a=>e.value?a?e.value.menuAppearTop:e.value.menuAppearBottom:"");return{transitionName:t,showTransition:!!e.value,menuTransition:n}},ba=(e,t,n)=>{const{defaultedRange:a,defaultedTz:r}=Se(e),l=Q(nt(Q(),r.value.timezone)),i=Z([{month:xe(l),year:he(l)}]),p=h=>{const k={hours:Tt(l),minutes:Rt(l),seconds:0};return a.value.enabled?[k[h],k[h]]:k[h]},c=ha({hours:p("hours"),minutes:p("minutes"),seconds:p("seconds")});ct(a,(h,k)=>{h.enabled!==k.enabled&&(c.hours=p("hours"),c.minutes=p("minutes"),c.seconds=p("seconds"))},{deep:!0});const C=G({get:()=>e.internalModelValue,set:h=>{!e.readonly&&!e.disabled&&t("update:internal-model-value",h)}}),m=G(()=>h=>i.value[h]?i.value[h].month:0),v=G(()=>h=>i.value[h]?i.value[h].year:0);return ct(C,(h,k)=>{n&&JSON.stringify(h??{})!==JSON.stringify(k??{})&&n()},{deep:!0}),{calendars:i,time:c,modelValue:C,month:m,year:v,today:l}},Is=(e,t)=>{const{defaultedMultiCalendars:n,defaultedMultiDates:a,defaultedUI:r,defaultedHighlight:l,defaultedTz:i,propDates:p,defaultedRange:c}=Se(t),{isDisabled:C}=Et(t),m=Z(null),v=Z(nt(new Date,i.value.timezone)),h=o=>{!o.current&&t.hideOffsetDates||(m.value=o.value)},k=()=>{m.value=null},Y=o=>Array.isArray(e.value)&&c.value.enabled&&e.value[0]&&m.value?o?Ne(m.value,e.value[0]):Ie(m.value,e.value[0]):!0,f=(o,w)=>{const z=()=>e.value?w?e.value[0]||null:e.value[1]:null,u=e.value&&Array.isArray(e.value)?z():null;return Me(Q(o.value),u)},S=o=>{const w=Array.isArray(e.value)?e.value[0]:null;return o?!Ie(m.value??null,w):!0},I=(o,w=!0)=>(c.value.enabled||t.weekPicker)&&Array.isArray(e.value)&&e.value.length===2?t.hideOffsetDates&&!o.current?!1:Me(Q(o.value),e.value[w?0:1]):c.value.enabled?f(o,w)&&S(w)||Me(o.value,Array.isArray(e.value)?e.value[0]:null)&&Y(w):!1,U=(o,w)=>{if(Array.isArray(e.value)&&e.value[0]&&e.value.length===1){const z=Me(o.value,m.value);return w?Ne(e.value[0],o.value)&&z:Ie(e.value[0],o.value)&&z}return!1},A=o=>!e.value||t.hideOffsetDates&&!o.current?!1:c.value.enabled?t.modelAuto&&Array.isArray(e.value)?Me(o.value,e.value[0]?e.value[0]:v.value):!1:a.value.enabled&&Array.isArray(e.value)?e.value.some(w=>Me(w,o.value)):Me(o.value,e.value?e.value:v.value),q=o=>{if(c.value.autoRange||t.weekPicker){if(m.value){if(t.hideOffsetDates&&!o.current)return!1;const w=mt(m.value,+c.value.autoRange),z=xt(Q(m.value),t.weekStart);return t.weekPicker?Me(z[1],Q(o.value)):Me(w,Q(o.value))}return!1}return!1},ae=o=>{if(c.value.autoRange||t.weekPicker){if(m.value){const w=mt(m.value,+c.value.autoRange);if(t.hideOffsetDates&&!o.current)return!1;const z=xt(Q(m.value),t.weekStart);return t.weekPicker?Ne(o.value,z[0])&&Ie(o.value,z[1]):Ne(o.value,m.value)&&Ie(o.value,w)}return!1}return!1},E=o=>{if(c.value.autoRange||t.weekPicker){if(m.value){if(t.hideOffsetDates&&!o.current)return!1;const w=xt(Q(m.value),t.weekStart);return t.weekPicker?Me(w[0],o.value):Me(m.value,o.value)}return!1}return!1},B=o=>$a(e.value,m.value,o.value),ne=()=>t.modelAuto&&Array.isArray(t.internalModelValue)?!!t.internalModelValue[0]:!1,F=()=>t.modelAuto?yr(t.internalModelValue):!0,N=o=>{if(t.weekPicker)return!1;const w=c.value.enabled?!I(o)&&!I(o,!1):!0;return!C(o.value)&&!A(o)&&!(!o.current&&t.hideOffsetDates)&&w},ie=o=>c.value.enabled?t.modelAuto?ne()&&A(o):!1:A(o),ce=o=>l.value?oi(o.value,p.value.highlight):!1,pe=o=>{const w=C(o.value);return w&&(typeof l.value=="function"?!l.value(o.value,w):!l.value.options.highlightDisabled)},g=o=>{var w;return typeof l.value=="function"?l.value(o.value):(w=l.value.weekdays)==null?void 0:w.includes(o.value.getDay())},D=o=>(c.value.enabled||t.weekPicker)&&(!(n.value.count>0)||o.current)&&F()&&!(!o.current&&t.hideOffsetDates)&&!A(o)?B(o):!1,y=o=>{const{isRangeStart:w,isRangeEnd:z}=b(o),u=c.value.enabled?w||z:!1;return{dp__cell_offset:!o.current,dp__pointer:!t.disabled&&!(!o.current&&t.hideOffsetDates)&&!C(o.value),dp__cell_disabled:C(o.value),dp__cell_highlight:!pe(o)&&(ce(o)||g(o))&&!ie(o)&&!u&&!E(o)&&!(D(o)&&t.weekPicker)&&!z,dp__cell_highlight_active:!pe(o)&&(ce(o)||g(o))&&ie(o),dp__today:!t.noToday&&Me(o.value,v.value)&&o.current,"dp--past":Ie(o.value,v.value),"dp--future":Ne(o.value,v.value)}},H=o=>({dp__active_date:ie(o),dp__date_hover:N(o)}),re=o=>{if(e.value&&!Array.isArray(e.value)){const w=xt(e.value,t.weekStart);return{...V(o),dp__range_start:Me(w[0],o.value),dp__range_end:Me(w[1],o.value),dp__range_between_week:Ne(o.value,w[0])&&Ie(o.value,w[1])}}return{...V(o)}},R=o=>{if(e.value&&Array.isArray(e.value)){const w=xt(e.value[0],t.weekStart),z=e.value[1]?xt(e.value[1],t.weekStart):[];return{...V(o),dp__range_start:Me(w[0],o.value)||Me(z[0],o.value),dp__range_end:Me(w[1],o.value)||Me(z[1],o.value),dp__range_between_week:Ne(o.value,w[0])&&Ie(o.value,w[1])||Ne(o.value,z[0])&&Ie(o.value,z[1]),dp__range_between:Ne(o.value,w[1])&&Ie(o.value,z[0])}}return{...V(o)}},b=o=>{const w=n.value.count>0?o.current&&I(o)&&F():I(o)&&F(),z=n.value.count>0?o.current&&I(o,!1)&&F():I(o,!1)&&F();return{isRangeStart:w,isRangeEnd:z}},oe=o=>{const{isRangeStart:w,isRangeEnd:z}=b(o);return{dp__range_start:w,dp__range_end:z,dp__range_between:D(o),dp__date_hover:Me(o.value,m.value)&&!w&&!z&&!t.weekPicker,dp__date_hover_start:U(o,!0),dp__date_hover_end:U(o,!1)}},V=o=>({...oe(o),dp__cell_auto_range:ae(o),dp__cell_auto_range_start:E(o),dp__cell_auto_range_end:q(o)}),M=o=>c.value.enabled?c.value.autoRange?V(o):t.modelAuto?{...H(o),...oe(o)}:t.weekPicker?R(o):oe(o):t.weekPicker?re(o):H(o);return{setHoverDate:h,clearHoverDate:k,getDayClassData:o=>t.hideOffsetDates&&!o.current?{}:{...y(o),...M(o),[t.dayClass?t.dayClass(o.value,t.internalModelValue):""]:!0,...r.value.calendarCell??{}}}},Et=e=>{const{defaultedFilters:t,defaultedRange:n,propDates:a,defaultedMultiDates:r}=Se(e),l=g=>a.value.disabledDates?typeof a.value.disabledDates=="function"?a.value.disabledDates(Q(g)):!!Aa(g,a.value.disabledDates):!1,i=g=>a.value.maxDate?e.yearPicker?he(g)>he(a.value.maxDate):Ne(g,a.value.maxDate):!1,p=g=>a.value.minDate?e.yearPicker?he(g){const D=i(g),y=p(g),H=l(g),re=t.value.months.map(M=>+M).includes(xe(g)),R=e.disabledWeekDays.length?e.disabledWeekDays.some(M=>+M===Ul(g)):!1,b=k(g),oe=he(g),V=oe<+e.yearRange[0]||oe>+e.yearRange[1];return!(D||y||H||re||V||R||b)},C=(g,D)=>Ie(...$t(a.value.minDate,g,D))||Me(...$t(a.value.minDate,g,D)),m=(g,D)=>Ne(...$t(a.value.maxDate,g,D))||Me(...$t(a.value.maxDate,g,D)),v=(g,D,y)=>{let H=!1;return a.value.maxDate&&y&&m(g,D)&&(H=!0),a.value.minDate&&!y&&C(g,D)&&(H=!0),H},h=(g,D,y,H)=>{let re=!1;return H&&(a.value.minDate||a.value.maxDate)?a.value.minDate&&a.value.maxDate?re=v(g,D,y):(a.value.minDate&&C(g,D)||a.value.maxDate&&m(g,D))&&(re=!0):re=!0,re},k=g=>Array.isArray(a.value.allowedDates)&&!a.value.allowedDates.length?!0:a.value.allowedDates?!Aa(g,a.value.allowedDates):!1,Y=g=>!c(g),f=g=>n.value.noDisabledRange?!er({start:g[0],end:g[1]}).some(D=>Y(D)):!0,S=g=>{if(g){const D=he(g);return D>=+e.yearRange[0]&&D<=e.yearRange[1]}return!0},I=(g,D)=>!!(Array.isArray(g)&&g[D]&&(n.value.maxRange||n.value.minRange)&&S(g[D])),U=(g,D,y=0)=>{if(I(D,y)&&S(g)){const H=Jn(g,D[y]),re=kr(D[y],g),R=re.length===1?0:re.filter(oe=>Y(oe)).length,b=Math.abs(H)-(n.value.minMaxRawRange?0:R);if(n.value.minRange&&n.value.maxRange)return b>=+n.value.minRange&&b<=+n.value.maxRange;if(n.value.minRange)return b>=+n.value.minRange;if(n.value.maxRange)return b<=+n.value.maxRange}return!0},A=()=>!e.enableTimePicker||e.monthPicker||e.yearPicker||e.ignoreTimeValidation,q=g=>Array.isArray(g)?[g[0]?Ga(g[0]):null,g[1]?Ga(g[1]):null]:Ga(g),ae=(g,D,y)=>g.find(H=>+H.hours===Tt(D)&&H.minutes==="*"?!0:+H.minutes===Rt(D)&&+H.hours===Tt(D))&&y,E=(g,D,y)=>{const[H,re]=g,[R,b]=D;return!ae(H,R,y)&&!ae(re,b,y)&&y},B=(g,D)=>{const y=Array.isArray(D)?D:[D];return Array.isArray(e.disabledTimes)?Array.isArray(e.disabledTimes[0])?E(e.disabledTimes,y,g):!y.some(H=>ae(e.disabledTimes,H,g)):g},ne=(g,D)=>{const y=Array.isArray(D)?[Ft(D[0]),D[1]?Ft(D[1]):void 0]:Ft(D),H=!e.disabledTimes(y);return g&&H},F=(g,D)=>e.disabledTimes?Array.isArray(e.disabledTimes)?B(D,g):ne(D,g):D,N=g=>{let D=!0;if(!g||A())return!0;const y=!a.value.minDate&&!a.value.maxDate?q(g):g;return(e.maxTime||a.value.maxDate)&&(D=qn(e.maxTime,a.value.maxDate,"max",qe(y),D)),(e.minTime||a.value.minDate)&&(D=qn(e.minTime,a.value.minDate,"min",qe(y),D)),F(g,D)},ie=g=>{if(!e.monthPicker)return!0;let D=!0;const y=Q(pt(g));if(a.value.minDate&&a.value.maxDate){const H=Q(pt(a.value.minDate)),re=Q(pt(a.value.maxDate));return Ne(y,H)&&Ie(y,re)||Me(y,H)||Me(y,re)}if(a.value.minDate){const H=Q(pt(a.value.minDate));D=Ne(y,H)||Me(y,H)}if(a.value.maxDate){const H=Q(pt(a.value.maxDate));D=Ie(y,H)||Me(y,H)}return D},ce=G(()=>g=>!e.enableTimePicker||e.ignoreTimeValidation?!0:N(g)),pe=G(()=>g=>e.monthPicker?Array.isArray(g)&&(n.value.enabled||r.value.enabled)?!g.filter(D=>!ie(D)).length:ie(g):!0);return{isDisabled:Y,validateDate:c,validateMonthYearInRange:h,isDateRangeAllowed:f,checkMinMaxRange:U,isValidTime:N,isTimeValid:ce,isMonthValid:pe}},Ia=()=>{const e=G(()=>(a,r)=>a?.includes(r)),t=G(()=>(a,r)=>a.count?a.solo?!0:r===0:!0),n=G(()=>(a,r)=>a.count?a.solo?!0:r===a.count-1:!0);return{hideNavigationButtons:e,showLeftIcon:t,showRightIcon:n}},Es=(e,t,n)=>{const a=Z(0),r=ha({[Vt.timePicker]:!e.enableTimePicker||e.timePicker||e.monthPicker,[Vt.calendar]:!1,[Vt.header]:!1}),l=G(()=>e.monthPicker||e.timePicker),i=v=>{var h;if((h=e.flow)!=null&&h.length){if(!v&&l.value)return m();r[v]=!0,Object.keys(r).filter(k=>!r[k]).length||m()}},p=()=>{var v,h;(v=e.flow)!=null&&v.length&&a.value!==-1&&(a.value+=1,t("flow-step",a.value),m()),((h=e.flow)==null?void 0:h.length)===a.value&&it().then(()=>c())},c=()=>{a.value=-1},C=(v,h,...k)=>{var Y,f;e.flow[a.value]===v&&n.value&&((f=(Y=n.value)[h])==null||f.call(Y,...k))},m=(v=0)=>{v&&(a.value+=v),C(Xe.month,"toggleMonthPicker",!0),C(Xe.year,"toggleYearPicker",!0),C(Xe.calendar,"toggleTimePicker",!1,!0),C(Xe.time,"toggleTimePicker",!0,!0);const h=e.flow[a.value];(h===Xe.hours||h===Xe.minutes||h===Xe.seconds)&&C(h,"toggleTimePicker",!0,!0,h)};return{childMount:i,updateFlowStep:p,resetFlow:c,handleFlow:m,flowStep:a}},Bs={key:1,class:"dp__input_wrap"},Ns=["id","name","inputmode","placeholder","disabled","readonly","required","value","autocomplete","aria-label","aria-disabled","aria-invalid"],Ls={key:2,class:"dp--clear-btn"},Hs=["aria-label"],Vs=ze({compatConfig:{MODE:3},__name:"DatepickerInput",props:{isMenuOpen:{type:Boolean,default:!1},inputValue:{type:String,default:""},...Ya},emits:["clear","open","update:input-value","set-input-date","close","select-date","set-empty-date","toggle","focus-prev","focus","blur","real-blur","text-input"],setup(e,{expose:t,emit:n}){const a=n,r=e,{defaultedTextInput:l,defaultedAriaLabels:i,defaultedInline:p,defaultedConfig:c,defaultedRange:C,defaultedMultiDates:m,defaultedUI:v,getDefaultPattern:h,getDefaultStartTime:k}=Se(r),{checkMinMaxRange:Y}=Et(r),f=Z(),S=Z(null),I=Z(!1),U=Z(!1),A=G(()=>({dp__pointer:!r.disabled&&!r.readonly&&!l.value.enabled,dp__disabled:r.disabled,dp__input_readonly:!l.value.enabled,dp__input:!0,dp__input_icon_pad:!r.hideInputIcon,dp__input_valid:typeof r.state=="boolean"?r.state:!1,dp__input_invalid:typeof r.state=="boolean"?!r.state:!1,dp__input_focus:I.value||r.isMenuOpen,dp__input_reg:!l.value.enabled,...v.value.input??{}})),q=()=>{a("set-input-date",null),r.clearable&&r.autoApply&&(a("set-empty-date"),f.value=null)},ae=b=>{const oe=k();return ii(b,l.value.format??h(),oe??xr({},r.enableSeconds),r.inputValue,U.value,r.formatLocale)},E=b=>{const{rangeSeparator:oe}=l.value,[V,M]=b.split(`${oe}`);if(V){const o=ae(V.trim()),w=M?ae(M.trim()):null;if(Kt(o,w))return;const z=o&&w?[o,w]:[o];Y(w,z,0)&&(f.value=o?z:null)}},B=()=>{U.value=!0},ne=b=>{if(C.value.enabled)E(b);else if(m.value.enabled){const oe=b.split(";");f.value=oe.map(V=>ae(V.trim())).filter(V=>V)}else f.value=ae(b)},F=b=>{var oe;const V=typeof b=="string"?b:(oe=b.target)==null?void 0:oe.value;V!==""?(l.value.openMenu&&!r.isMenuOpen&&a("open"),ne(V),a("set-input-date",f.value)):q(),U.value=!1,a("update:input-value",V),a("text-input",b,f.value)},N=b=>{l.value.enabled?(ne(b.target.value),l.value.enterSubmit&&sn(f.value)&&r.inputValue!==""?(a("set-input-date",f.value,!0),f.value=null):l.value.enterSubmit&&r.inputValue===""&&(f.value=null,a("clear"))):pe(b)},ie=(b,oe)=>{l.value.enabled&&l.value.tabSubmit&&!oe&&ne(b.target.value),l.value.tabSubmit&&sn(f.value)&&r.inputValue!==""?(a("set-input-date",f.value,!0,!0),f.value=null):l.value.tabSubmit&&r.inputValue===""&&(f.value=null,a("clear",!0))},ce=()=>{I.value=!0,a("focus"),it().then(()=>{var b;l.value.enabled&&l.value.selectOnFocus&&((b=S.value)==null||b.select())})},pe=b=>{if(Yt(b,c.value,!0),l.value.enabled&&l.value.openMenu&&!p.value.input){if(l.value.openMenu==="open"&&!r.isMenuOpen)return a("open");if(l.value.openMenu==="toggle")return a("toggle")}else l.value.enabled||a("toggle")},g=()=>{a("real-blur"),I.value=!1,(!r.isMenuOpen||p.value.enabled&&p.value.input)&&a("blur"),r.autoApply&&l.value.enabled&&f.value&&!r.isMenuOpen&&(a("set-input-date",f.value),a("select-date"),f.value=null)},D=b=>{Yt(b,c.value,!0),a("clear")},y=b=>{if(b.key==="Tab"&&ie(b),b.key==="Enter"&&N(b),!l.value.enabled){if(b.code==="Tab")return;b.preventDefault()}},H=()=>{var b;(b=S.value)==null||b.focus({preventScroll:!0})},re=b=>{f.value=b},R=b=>{b.key===$e.tab&&ie(b,!0)};return t({focusInput:H,setParsedDate:re}),(b,oe)=>{var V,M,o;return P(),W("div",{onClick:pe},[b.$slots.trigger&&!b.$slots["dp-input"]&&!d(p).enabled?ue(b.$slots,"trigger",{key:0}):j("",!0),!b.$slots.trigger&&(!d(p).enabled||d(p).input)?(P(),W("div",Bs,[b.$slots["dp-input"]&&!b.$slots.trigger&&(!d(p).enabled||d(p).enabled&&d(p).input)?ue(b.$slots,"dp-input",{key:0,value:e.inputValue,isMenuOpen:e.isMenuOpen,onInput:F,onEnter:N,onTab:ie,onClear:D,onBlur:g,onKeypress:y,onPaste:B,onFocus:ce,openMenu:()=>b.$emit("open"),closeMenu:()=>b.$emit("close"),toggleMenu:()=>b.$emit("toggle")}):j("",!0),b.$slots["dp-input"]?j("",!0):(P(),W("input",{key:1,id:b.uid?`dp-input-${b.uid}`:void 0,ref_key:"inputRef",ref:S,"data-test":"dp-input",name:b.name,class:ke(A.value),inputmode:d(l).enabled?"text":"none",placeholder:b.placeholder,disabled:b.disabled,readonly:b.readonly,required:b.required,value:e.inputValue,autocomplete:b.autocomplete,"aria-label":(V=d(i))==null?void 0:V.input,"aria-disabled":b.disabled||void 0,"aria-invalid":b.state===!1?!0:void 0,onInput:F,onBlur:g,onFocus:ce,onKeypress:y,onKeydown:oe[0]||(oe[0]=w=>y(w)),onPaste:B},null,42,Ns)),ye("div",{onClick:oe[3]||(oe[3]=w=>a("toggle"))},[b.$slots["input-icon"]&&!b.hideInputIcon?(P(),W("span",{key:0,class:"dp__input_icon",onClick:oe[1]||(oe[1]=w=>a("toggle"))},[ue(b.$slots,"input-icon")])):j("",!0),!b.$slots["input-icon"]&&!b.hideInputIcon&&!b.$slots["dp-input"]?(P(),De(d(aa),{key:1,"aria-label":(M=d(i))==null?void 0:M.calendarIcon,class:"dp__input_icon dp__input_icons",onClick:oe[2]||(oe[2]=w=>a("toggle"))},null,8,["aria-label"])):j("",!0)]),b.$slots["clear-icon"]&&e.inputValue&&b.clearable&&!b.disabled&&!b.readonly?(P(),W("span",Ls,[ue(b.$slots,"clear-icon",{clear:D})])):j("",!0),b.clearable&&!b.$slots["clear-icon"]&&e.inputValue&&!b.disabled&&!b.readonly?(P(),W("button",{key:3,"aria-label":(o=d(i))==null?void 0:o.clearInput,class:"dp--clear-btn",type:"button",onKeydown:oe[4]||(oe[4]=w=>d(et)(w,()=>D(w),!0,R)),onClick:oe[5]||(oe[5]=va(w=>D(w),["prevent"]))},[ot(d(fr),{class:"dp__input_icons","data-test":"clear-icon"})],40,Hs)):j("",!0)])):j("",!0)])}}}),Fs=typeof window<"u"?window:void 0,tn=()=>{},qs=e=>Fr()?(qr(e),!0):!1,Ws=(e,t,n,a)=>{if(!e)return tn;let r=tn;const l=ct(()=>d(e),p=>{r(),p&&(p.addEventListener(t,n,a),r=()=>{p.removeEventListener(t,n,a),r=tn})},{immediate:!0,flush:"post"}),i=()=>{l(),r()};return qs(i),i},Qs=(e,t,n,a={})=>{const{window:r=Fs,event:l="pointerdown"}=a;return r?Ws(r,l,i=>{const p=Fe(e),c=Fe(t);!p||!c||p===i.target||i.composedPath().includes(p)||i.composedPath().includes(c)||n(i)},{passive:!0}):void 0},zs=ze({compatConfig:{MODE:3},__name:"VueDatePicker",props:{...Ya},emits:["update:model-value","update:model-timezone-value","text-submit","closed","cleared","open","focus","blur","internal-model-change","recalculate-position","flow-step","update-month-year","invalid-select","invalid-fixed-range","tooltip-open","tooltip-close","time-picker-open","time-picker-close","am-pm-change","range-start","range-end","date-update","invalid-date","overlay-toggle","text-input"],setup(e,{expose:t,emit:n}){const a=n,r=e,l=qt(),i=Z(!1),p=ca(r,"modelValue"),c=ca(r,"timezone"),C=Z(null),m=Z(null),v=Z(null),h=Z(!1),k=Z(null),Y=Z(!1),f=Z(!1),S=Z(!1),I=Z(!1),{setMenuFocused:U,setShiftKey:A}=Ar(),{clearArrowNav:q}=It(),{validateDate:ae,isValidTime:E}=Et(r),{defaultedTransitions:B,defaultedTextInput:ne,defaultedInline:F,defaultedConfig:N,defaultedRange:ie,defaultedMultiDates:ce}=Se(r),{menuTransition:pe,showTransition:g}=ga(B);Ke(()=>{w(r.modelValue),it().then(()=>{if(!F.value.enabled){const O=oe(k.value);O?.addEventListener("scroll",J),window?.addEventListener("resize",$)}}),F.value.enabled&&(i.value=!0),window?.addEventListener("keyup",ge),window?.addEventListener("keydown",x)}),Ca(()=>{if(!F.value.enabled){const O=oe(k.value);O?.removeEventListener("scroll",J),window?.removeEventListener("resize",$)}window?.removeEventListener("keyup",ge),window?.removeEventListener("keydown",x)});const D=lt(l,"all",r.presetDates),y=lt(l,"input");ct([p,c],()=>{w(p.value)},{deep:!0});const{openOnTop:H,menuStyle:re,xCorrect:R,setMenuPosition:b,getScrollableParent:oe,shadowRender:V}=Ys({menuRef:C,menuRefInner:m,inputRef:v,pickerWrapperRef:k,inline:F,emit:a,props:r,slots:l}),{inputValue:M,internalModelValue:o,parseExternalModelValue:w,emitModelValue:z,formatInputValue:u,checkBeforeEmit:le}=$i(a,r,h),fe=G(()=>({dp__main:!0,dp__theme_dark:r.dark,dp__theme_light:!r.dark,dp__flex_display:F.value.enabled,"dp--flex-display-collapsed":S.value,dp__flex_display_with_input:F.value.input})),Ve=G(()=>r.dark?"dp__theme_dark":"dp__theme_light"),T=G(()=>r.teleport?{to:typeof r.teleport=="boolean"?"body":r.teleport,disabled:!r.teleport||F.value.enabled}:{}),K=G(()=>({class:"dp__outer_menu_wrap"})),s=G(()=>F.value.enabled&&(r.timePicker||r.monthPicker||r.yearPicker||r.quarterPicker)),L=()=>{var O,ee;return(ee=(O=v.value)==null?void 0:O.$el)==null?void 0:ee.getBoundingClientRect()},J=()=>{i.value&&(N.value.closeOnScroll?rt():b())},$=()=>{var O;i.value&&b();const ee=(O=m.value)==null?void 0:O.$el.getBoundingClientRect().width;S.value=document.body.offsetWidth<=ee},ge=O=>{O.key==="Tab"&&!F.value.enabled&&!r.teleport&&N.value.tabOutClosesMenu&&(k.value.contains(document.activeElement)||rt()),f.value=O.shiftKey},x=O=>{f.value=O.shiftKey},X=()=>{!r.disabled&&!r.readonly&&(V(Un,r),b(!1),i.value=!0,i.value&&a("open"),i.value||na(),w(r.modelValue))},de=()=>{var O;M.value="",na(),(O=v.value)==null||O.setParsedDate(null),a("update:model-value",null),a("update:model-timezone-value",null),a("cleared"),N.value.closeOnClearValue&&rt()},be=()=>{const O=o.value;return!O||!Array.isArray(O)&&ae(O)?!0:Array.isArray(O)?ce.value.enabled||O.length===2&&ae(O[0])&&ae(O[1])?!0:ie.value.partialRange&&!r.timePicker?ae(O[0]):!1:!1},st=()=>{le()&&be()?(z(),rt()):a("invalid-select",o.value)},me=O=>{Pt(),z(),N.value.closeOnAutoApply&&!O&&rt()},Pt=()=>{v.value&&ne.value.enabled&&v.value.setParsedDate(o.value)},gt=(O=!1)=>{r.autoApply&&E(o.value)&&be()&&(ie.value.enabled&&Array.isArray(o.value)?(ie.value.partialRange||o.value.length===2)&&me(O):me(O))},na=()=>{ne.value.enabled||(o.value=null)},rt=()=>{F.value.enabled||(i.value&&(i.value=!1,R.value=!1,U(!1),A(!1),q(),a("closed"),M.value&&w(p.value)),na(),a("blur"))},ra=(O,ee,se=!1)=>{if(!O){o.value=null;return}const Je=Array.isArray(O)?!O.some(Bt=>!ae(Bt)):ae(O),ut=E(O);Je&&ut?(I.value=!0,o.value=O,ee&&(Y.value=se,st(),a("text-submit")),it().then(()=>{I.value=!1})):a("invalid-date",O)},Ea=()=>{r.autoApply&&E(o.value)&&z(),Pt()},wa=()=>i.value?rt():X(),Ba=O=>{o.value=O},Na=()=>{ne.value.enabled&&(h.value=!0,u()),a("focus")},La=()=>{if(ne.value.enabled&&(h.value=!1,w(r.modelValue),Y.value)){const O=li(k.value,f.value);O?.focus()}a("blur")},Ha=O=>{m.value&&m.value.updateMonthYear(0,{month:Ln(O.month),year:Ln(O.year)})},Va=O=>{w(O??r.modelValue)},Fa=(O,ee)=>{var se;(se=m.value)==null||se.switchView(O,ee)},_=O=>N.value.onClickOutside?N.value.onClickOutside(O):rt(),te=(O=0)=>{var ee;(ee=m.value)==null||ee.handleFlow(O)};return Qs(C,v,()=>_(be)),t({closeMenu:rt,selectDate:st,clearValue:de,openMenu:X,onScroll:J,formatInputValue:u,updateInternalModelValue:Ba,setMonthYear:Ha,parseModel:Va,switchView:Fa,toggleMenu:wa,handleFlow:te,dpWrapMenuRef:C}),(O,ee)=>(P(),W("div",{ref_key:"pickerWrapperRef",ref:k,class:ke(fe.value),"data-datepicker-instance":""},[ot(Vs,Qe({ref_key:"inputRef",ref:v,"input-value":d(M),"onUpdate:inputValue":ee[0]||(ee[0]=se=>Pn(M)?M.value=se:null),"is-menu-open":i.value},O.$props,{onClear:de,onOpen:X,onSetInputDate:ra,onSetEmptyDate:d(z),onSelectDate:st,onToggle:wa,onClose:rt,onFocus:Na,onBlur:La,onRealBlur:ee[1]||(ee[1]=se=>h.value=!1),onTextInput:ee[2]||(ee[2]=se=>O.$emit("text-input",se))}),je({_:2},[Ye(d(y),(se,Je)=>({name:se,fn:_e(ut=>[ue(O.$slots,se,We(at(ut)))])}))]),1040,["input-value","is-menu-open","onSetEmptyDate"]),(P(),De(Oa(O.teleport?Br:"div"),We(at(T.value)),{default:_e(()=>[ot(ta,{name:d(pe)(d(H)),css:d(g)&&!d(F).enabled},{default:_e(()=>[i.value?(P(),W("div",Qe({key:0,ref_key:"dpWrapMenuRef",ref:C},K.value,{class:{"dp--menu-wrapper":!d(F).enabled},style:d(F).enabled?void 0:d(re)}),[ot(Un,Qe({ref_key:"dpMenuRef",ref:m},O.$props,{"internal-model-value":d(o),"onUpdate:internalModelValue":ee[3]||(ee[3]=se=>Pn(o)?o.value=se:null),class:{[Ve.value]:!0,"dp--menu-wrapper":O.teleport},"open-on-top":d(H),"no-overlay-focus":s.value,collapse:S.value,"get-input-rect":L,"is-text-input-date":I.value,onClosePicker:rt,onSelectDate:st,onAutoApply:gt,onTimeUpdate:Ea,onFlowStep:ee[4]||(ee[4]=se=>O.$emit("flow-step",se)),onUpdateMonthYear:ee[5]||(ee[5]=se=>O.$emit("update-month-year",se)),onInvalidSelect:ee[6]||(ee[6]=se=>O.$emit("invalid-select",d(o))),onAutoApplyInvalid:ee[7]||(ee[7]=se=>O.$emit("invalid-select",se)),onInvalidFixedRange:ee[8]||(ee[8]=se=>O.$emit("invalid-fixed-range",se)),onRecalculatePosition:d(b),onTooltipOpen:ee[9]||(ee[9]=se=>O.$emit("tooltip-open",se)),onTooltipClose:ee[10]||(ee[10]=se=>O.$emit("tooltip-close",se)),onTimePickerOpen:ee[11]||(ee[11]=se=>O.$emit("time-picker-open",se)),onTimePickerClose:ee[12]||(ee[12]=se=>O.$emit("time-picker-close",se)),onAmPmChange:ee[13]||(ee[13]=se=>O.$emit("am-pm-change",se)),onRangeStart:ee[14]||(ee[14]=se=>O.$emit("range-start",se)),onRangeEnd:ee[15]||(ee[15]=se=>O.$emit("range-end",se)),onDateUpdate:ee[16]||(ee[16]=se=>O.$emit("date-update",se)),onInvalidDate:ee[17]||(ee[17]=se=>O.$emit("invalid-date",se)),onOverlayToggle:ee[18]||(ee[18]=se=>O.$emit("overlay-toggle",se))}),je({_:2},[Ye(d(D),(se,Je)=>({name:se,fn:_e(ut=>[ue(O.$slots,se,We(at({...ut})))])}))]),1040,["internal-model-value","class","open-on-top","no-overlay-focus","collapse","is-text-input-date","onRecalculatePosition"])],16)):j("",!0)]),_:3},8,["name","css"])]),_:3},16))],2))}}),Ir=(()=>{const e=zs;return e.install=t=>{t.component("Vue3DatePicker",e)},e})(),Us=Object.freeze(Object.defineProperty({__proto__:null,default:Ir},Symbol.toStringTag,{value:"Module"}));Object.entries(Us).forEach(([e,t])=>{e!=="default"&&(Ir[e]=t)});export{Ir as V}; diff --git a/src/static/app/dist/index.html b/src/static/app/dist/index.html index 50a969f..5a6208b 100644 --- a/src/static/app/dist/index.html +++ b/src/static/app/dist/index.html @@ -10,7 +10,7 @@ WGDashboard - + diff --git a/src/static/app/src/components/configurationComponents/peerConfigurationFile.vue b/src/static/app/src/components/configurationComponents/peerConfigurationFile.vue index d6ff1a5..f637605 100644 --- a/src/static/app/src/components/configurationComponents/peerConfigurationFile.vue +++ b/src/static/app/src/components/configurationComponents/peerConfigurationFile.vue @@ -65,8 +65,7 @@ const copy = async () => {