diary.jsfunction n(t,e){if(e.length<t)throw new TypeError(t+" argument"+(t>1?"s":"")+" required, but only "+e.length+" present")}function s(t){n(1,arguments);let e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new Date(t.getTime()):typeof t=="number"||e==="[object Number]"?new Date(t):((typeof t=="string"||e==="[object String]")&&typeof console!="undefined"&&(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function A(t){n(1,arguments);let r=s(t).getFullYear();return r%400==0||r%4==0&&r%100!=0}function _(t){n(1,arguments);let e=s(t);return String(new Date(e))==="Invalid Date"?NaN:A(e)?366:365}function M(t){n(1,arguments);let e=s(t),r=new Date(0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}function l(t){let e=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return e.setUTCFullYear(t.getFullYear()),t.getTime()-e.getTime()}function h(t){n(1,arguments);let e=s(t);return e.setHours(0,0,0,0),e}var k=864e5;function q(t,e){n(2,arguments);let r=h(t),o=h(e),f=r.getTime()-l(r),d=o.getTime()-l(o);return Math.round((f-d)/k)}function I(t){n(1,arguments);let e=s(t);return q(e,M(e))+1}function i(t){if(t===null||t===!0||t===!1)return NaN;let e=Number(t);return isNaN(e)?e:e<0?Math.ceil(e):Math.floor(e)}function g(t,e){n(2,arguments);let r=s(t),o=i(e);return isNaN(o)?new Date(NaN):(o&&r.setDate(r.getDate()+o),r)}function y(t,e){n(2,arguments);let r=i(e);return g(t,-r)}function Y(t,e){n(2,arguments);let o=i(e)*7;return g(t,o)}function p(t,e){n(2,arguments);let r=i(e);return Y(t,-r)}function D(t,e){n(2,arguments);let r=s(t),o=i(e);if(isNaN(o))return new Date(NaN);if(!o)return r;let f=r.getDate(),d=new Date(r.getTime());d.setMonth(r.getMonth()+o+1,0);let S=d.getDate();return f>=S?d:(r.setFullYear(d.getFullYear(),d.getMonth(),f),r)}function x(t,e){n(2,arguments);let r=i(e);return D(t,-r)}function w(t,e){n(2,arguments);let r=i(e);return D(t,r*12)}function T(t,e){n(2,arguments);let r=i(e);return w(t,-r)}function O(t){return n(1,arguments),s(t).getDay()}function N(t){return n(1,arguments),s(t).getFullYear()}function m(t,e){for(var r=t<0?"-":"",o=Math.abs(t).toString();o.length<e;)o="0"+o;return r+o}var U={y(t,e){let r=t.getUTCFullYear(),o=r>0?r:1-r;return m(e==="yy"?o%100:o,e.length)},M(t,e){let r=t.getUTCMonth();return e==="M"?String(r+1):m(r+1,2)},d(t,e){return m(t.getUTCDate(),e.length)},a(t,e){let r=t.getUTCHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(t,e){return m(t.getUTCHours()%12||12,e.length)},H(t,e){return m(t.getUTCHours(),e.length)},m(t,e){return m(t.getUTCMinutes(),e.length)},s(t,e){return m(t.getUTCSeconds(),e.length)},S(t,e){let r=e.length,o=t.getUTCMilliseconds(),f=Math.floor(o*Math.pow(10,r-3));return m(f,e.length)}},j=U;function $(t){n(1,arguments);var e=s(t);return!isNaN(e)}function C(t,e){n(2,arguments);let r=s(t).getTime(),o=i(e);return new Date(r+o)}function v(t,e){n(2,arguments);let r=i(e);return C(t,-r)}var E=/(\w)\1*|''|'(''|[^'])+('|$)|./g,L=/^'([^]*?)'?$/,R=/''/g,z=/[a-zA-Z]/;function a(t,e){n(2,arguments);let r=s(t);if(!$(r))throw new RangeError("Invalid time value");let o=l(r),f=v(r,o),d=e.match(E);return d?d.map(c=>{if(c==="''")return"'";let b=c[0];if(b==="'")return H(c);let F=j[b];if(F)return F(f,c);if(b.match(z))throw new RangeError("Format string contains an unescaped latin alphabet character `"+b+"`");return c}).join(""):""}function H(t){let e=t.match(L);return e?e[1].replace(R,"'"):t}var u="yyyy/MM/dd",ve=t=>[a(t,u),[`[${a(y(t,1),u)}.icon]←${a(t,u)}→[${a(g(t,1),u)}.icon]`,`[[${W(t)}曜日]]`,`${N(t)}年 ${(I(t)*100/_(t)).toFixed(2)}%経過`,`[🌏 https://ja.wikipedia.org/wiki/${a(t,"M月d日")}]`,[`[${a(p(t,1),u)}.icon]`,`[${a(p(t,2),u)}.icon]`,`[${a(p(t,3),u)}.icon]`,`[${a(x(t,1),u)}.icon]`,`[${a(x(t,2),u)}.icon]`,`[${a(x(t,3),u)}.icon]`].join(" "),"今日のn年前",` [${a(T(t,1),u)}]`].join(`\n`),`[${a(y(t,1),u)}]←${a(t,u)}→[${a(g(t,1),u)}]`];function W(t){switch(O(t)){case 0:return"日";case 1:return"月";case 2:return"火";case 3:return"水";case 4:return"木";case 5:return"金";case 6:return"土"}}export{ve as getTemplate};