/*!
 * Custom elements for Nanopore-Digital Web applications
 */
const n=/^(\d{4})-(\d{2})-(\d{2})/;var t;function e(n,t,e){const r=parseInt(e,10),u=parseInt(t,10),a=parseInt(n,10);if(Number.isInteger(a)&&Number.isInteger(u)&&Number.isInteger(r)&&u>0&&u<=12&&r>0&&r<=31&&a>0)return new Date(a,u-1,r)}function r(t){if(!t)return;const r=t.match(n);return r?e(r[1],r[2],r[3]):void 0}function u(n){if(!n)return"";let t=n.getDate().toString(10),e=(n.getMonth()+1).toString(10);const r=n.getFullYear().toString(10);return n.getDate()<10&&(t=`0${t}`),n.getMonth()<9&&(e=`0${e}`),`${r}-${e}-${t}`}function a(n,t){return null!=n&&null!=t&&n.getFullYear()===t.getFullYear()&&n.getMonth()===t.getMonth()&&n.getDate()===t.getDate()}function s(n,t){const e=new Date(n);return e.setDate(e.getDate()+t),e}function o(n,e=t.Monday){const r=new Date(n),u=r.getDay(),a=(u<e?7:0)+u-e;return r.setDate(r.getDate()-a),r}function c(n,e=t.Monday){const r=new Date(n),u=r.getDay(),a=6+(u<e?-7:0)-(u-e);return r.setDate(r.getDate()+a),r}function i(n){return new Date(n.getFullYear(),n.getMonth(),1)}function f(n){return new Date(n.getFullYear(),n.getMonth()+1,0)}function d(n,t){const e=new Date(n);return e.setMonth(t),e}function D(n,t){const e=new Date(n);return e.setFullYear(t),e}function w(n,t,e){return l(n,t,e)===n}function l(n,t,e){const r=n.getTime();return t&&t instanceof Date&&r<t.getTime()?t:e&&e instanceof Date&&r>e.getTime()?e:n}function y(n,e=t.Monday){return function(n,t){const e=[];let r=n;for(;!a(r,t);)e.push(r),r=s(r,1);return e.push(r),e}(o(i(n),e),c(f(n),e))}!function(n){n[n.Sunday=0]="Sunday",n[n.Monday=1]="Monday",n[n.Tuesday=2]="Tuesday",n[n.Wednesday=3]="Wednesday",n[n.Thursday=4]="Thursday",n[n.Friday=5]="Friday",n[n.Saturday=6]="Saturday"}(t||(t={}));export{t as D,u as a,w as b,e as c,s as d,c as e,d as f,y as g,i as h,a as i,f as j,l as k,D as l,r as p,o as s}